{"version":3,"file":"DoodleConnection.BzzoixCF.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/rUzrfORC9hWWDPVgbiRt/eY7jOm33zCr7AL42GNnu/DoodleConnection.js"],"sourcesContent":["// DoodleConnection component: horizontal SVG doodle symbolizing connection, adjustable stroke size, color, and drawing animation\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Horizontal DoodleConnection Connection\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function DoodleConnection(props){const{strokeColor,strokeWidth,animationDuration,delay,animate,variant,style}=props;const isStatic=useIsStaticRenderer();const[pathLength,setPathLength]=useState(0);const[drawn,setDrawn]=useState(false);const[hasPlayed,setHasPlayed]=useState(false);const pathRef=useRef(null);const containerRef=useRef(null);const[inView,setInView]=useState(false);// DoodleConnection path: a wavy horizontal line\nconst width=400;const height=60;// Animation variants\nconst doodleVariants={wave:`M 10 ${height/2} Q 60 10, 110 ${height/2} T 210 ${height/2} T 310 ${height/2} T 390 ${height/2}`,zigzag:`M 10 ${height/2} L 60 10 L 110 ${height/2} L 160 10 L 210 ${height/2} L 260 10 L 310 ${height/2} L 360 10 L 390 ${height/2}`,loop:`M 10 ${height/2} Q 60 10, 110 ${height/2} Q 160 60, 210 ${height/2} Q 260 10, 310 ${height/2} Q 360 60, 390 ${height/2}`,bounce:`M 10 ${height/2} Q 60 0, 110 ${height/2} Q 160 60, 210 ${height/2} Q 260 0, 310 ${height/2} Q 360 60, 390 ${height/2}`,squiggle:`M 10 ${height/2} C 40 10, 80 60, 110 ${height/2} C 140 10, 180 60, 210 ${height/2} C 240 10, 280 60, 310 ${height/2} C 340 10, 380 60, 390 ${height/2}`,heart:`M 10 30 Q 60 40, 110 30 Q 130 25, 150 30 Q 170 35, 175 25 Q 180 15, 200 30 Q 220 45, 225 30 Q 230 15, 250 30 Q 270 45, 275 30 Q 280 15, 300 30 Q 320 45, 325 30 Q 330 15, 350 30 Q 370 45, 390 30`};const path=doodleVariants[variant]||doodleVariants.wave;useEffect(()=>{if(pathRef.current){setPathLength(pathRef.current.getTotalLength());}},[strokeWidth]);useEffect(()=>{if(!animate){startTransition(()=>setDrawn(true));return;}if(isStatic){startTransition(()=>setDrawn(true));return;}startTransition(()=>setDrawn(false));const timeout=setTimeout(()=>{startTransition(()=>setDrawn(true));},delay*1e3+animationDuration*1e3);return()=>clearTimeout(timeout);},[animate,animationDuration,delay,isStatic]);// Intersection Observer for in-viewport detection\nuseEffect(()=>{if(typeof window===\"undefined\"||!containerRef.current)return;const observer=new window.IntersectionObserver(([entry])=>{startTransition(()=>setInView(entry.isIntersecting));},{threshold:.1});observer.observe(containerRef.current);return()=>observer.disconnect();},[]);useEffect(()=>{if(!animate){startTransition(()=>setDrawn(true));return;}if(isStatic){startTransition(()=>setDrawn(true));return;}if(inView&&!hasPlayed){startTransition(()=>{setDrawn(false);setTimeout(()=>{startTransition(()=>{setDrawn(true);setHasPlayed(true);});},delay*1e3);});}else if(!inView&&!hasPlayed){startTransition(()=>setDrawn(false));}},[inView,animate,animationDuration,delay,isStatic,hasPlayed]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",...style,position:\"relative\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"100%\",height:\"100%\",viewBox:`0 0 ${width} ${height}`,style:{display:\"block\"},\"aria-label\":\"DoodleConnection connection\",role:\"img\",children:/*#__PURE__*/_jsx(\"path\",{ref:pathRef,d:path,fill:\"none\",stroke:strokeColor,strokeWidth:strokeWidth,strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{strokeDasharray:pathLength,strokeDashoffset:drawn?0:pathLength,transition:drawn?`stroke-dashoffset ${animationDuration}s cubic-bezier(0.4,0,0.2,1)`:\"none\"}})})});}addPropertyControls(DoodleConnection,{strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#222222\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:4,min:1,max:16,step:1,unit:\"px\"},animationDuration:{type:ControlType.Number,title:\"Animation (s)\",defaultValue:1.5,min:.2,max:5,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay (s)\",defaultValue:0,min:0,max:5,step:.1,unit:\"s\"},animate:{type:ControlType.Boolean,title:\"Animate\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},variant:{type:ControlType.Enum,title:\"Doodle Style\",options:[\"wave\",\"zigzag\",\"loop\",\"bounce\",\"squiggle\",\"heart\"],optionTitles:[\"Wave\",\"Zigzag\",\"Loop\",\"Bounce\",\"Squiggle\",\"Heart\"],defaultValue:\"wave\",displaySegmentedControl:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DoodleConnection\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"60\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DoodleConnection.map"],"mappings":"qNASG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,cAAY,cAAY,oBAAkB,QAAM,UAAQ,UAAQ,SAAO,EAAY,EAAS,GAAqB,CAAM,CAAC,EAAW,GAAeA,EAAS,EAAE,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAQC,EAAO,KAAK,CAAO,EAAaA,EAAO,KAAK,CAAM,CAAC,EAAO,GAAWD,EAAS,GAAM,CAEvY,EAAe,CAAC,KAAK,QAAQ,GAAO,EAAE,gBAAgB,GAAO,EAAE,SAAS,GAAO,EAAE,SAAS,GAAO,EA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