{"version":3,"file":"ACBCFlowLine.BDYCfiL0.mjs","names":["React.useRef","React.useState","__esmMin","init_npm_react_18_3_1","_e","p","c","init_jsx_runtime","ce","de","useSpring","useMotionValue","useInView","useReducedMotion","motion","useTransform","useScroll","animate","init_framer_motion_DhsWWWsN","init_framer_DKgW_P28","addPropertyControls","useIsStaticRenderer","ControlType","ACBCFlowLine","props","ref","mainPathRef","isStatic","prefersReduced","fullyDrawn","mode","smooth","scrollYProgress","inView","inViewProgress","controls","EASE","duration","progress","echoProgress","fade","spec","SHAPES","shape","vbW","vbH","nodePoints","setNodePoints","path","showNodes","total","at","vertical","orientation","transform","mirror","strokeFor","role","accentColor","lineColor","opacityFor","widthFor","strokeWidth","mapPoint","x","pt","y","lineOpacity","style","isMain","common","i","FlowNode","opacity","scale","position","color","ring","drawn","init_ACBCFlowLine"],"sources":["https:/framerusercontent.com/modules/WamXZK54zYMlYO13pPGf/KKbZGJDxKaXDYsAcrbG5/ACBCFlowLine.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView,useReducedMotion,useScroll,useSpring,useTransform,animate,useMotionValue}from\"framer-motion\";// Each shape has its own drawing space; wide shapes use a wide space so curves keep their proportions.\nconst SHAPES={// Chao Phraya current: a main current and a softer echo beneath it\nriver:{paths:[{d:\"M0,560 C160,470 320,650 500,560 S820,440 1000,520\",role:\"main\"},{d:\"M0,660 C200,590 340,730 520,660 S840,560 1000,620\",role:\"echo\"}],nodes:[]},// Molecular pathway: one line with reaction nodes along it\npathway:{paths:[{d:\"M0,520 C140,520 190,300 340,300 S560,700 700,660 S880,420 1000,440\",role:\"main\"}],nodes:[.18,.42,.66,.9]},// Protein ribbon: two strands twisting around each other\nribbon:{paths:[{d:\"M0,500 C125,300 250,300 375,500 S625,700 750,500 S875,300 1000,500\",role:\"main\"},{d:\"M0,500 C125,700 250,700 375,500 S625,300 750,500 S875,700 1000,500\",role:\"accent\"}],nodes:[]},// Routes converging on Bangkok\nroute:{paths:[{d:\"M0,180 C380,180 620,500 1000,500\",role:\"echo\"},{d:\"M0,500 C340,520 660,480 1000,500\",role:\"main\"},{d:\"M0,820 C380,820 620,500 1000,500\",role:\"echo\"}],nodes:[1]},// Suphannahong-inspired prow: a long low hull rising into a curled prow, with a faint reflection\nsweep:{vb:[3e3,500],paths:[{d:\"M0,420 C700,440 1500,440 2150,400 C2450,380 2640,320 2740,220 C2810,150 2830,80 2790,50 C2755,25 2710,45 2715,85 C2720,120 2765,130 2790,105\",role:\"main\"},{d:\"M120,462 C800,476 1600,472 2200,442 C2450,428 2600,404 2700,366\",role:\"echo\"}],nodes:[]}};const EASE=[.22,.61,.36,1];/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1000\n * @framerIntrinsicHeight 200\n */export default function ACBCFlowLine(props){const{shape=\"river\",mode=\"scroll\",orientation=\"horizontal\",mirror=false,lineColor=\"#B18B3D\",accentColor=\"#087E91\",strokeWidth=1.25,lineOpacity=.9,showNodes=true,duration=2.4,style}=props;const ref=React.useRef(null);const mainPathRef=React.useRef(null);const isStatic=useIsStaticRenderer();const prefersReduced=useReducedMotion();const fullyDrawn=isStatic||prefersReduced||mode===\"static\";// Scroll-linked progress: starts as the frame enters the bottom of the viewport,\n// completes when it reaches the middle. Smoothed so it feels like water, not a scrubber.\nconst{scrollYProgress}=useScroll({target:ref,offset:[\"start end\",\"center center\"]});const smooth=useSpring(scrollYProgress,{stiffness:60,damping:22,mass:.6});// In-view progress: one calm draw when the line first enters the viewport.\nconst inView=useInView(ref,{once:true,amount:.3});const inViewProgress=useMotionValue(0);React.useEffect(()=>{if(mode!==\"inView\"||fullyDrawn||!inView)return;const controls=animate(inViewProgress,1,{duration,ease:EASE});return()=>controls.stop();},[mode,fullyDrawn,inView,duration,inViewProgress]);const progress=mode===\"scroll\"?smooth:inViewProgress;const echoProgress=useTransform(progress,[0,1],[0,1]);const fade=useTransform(progress,[0,.08],[0,1]);// Node positions are measured from this component's own path once mounted.\nconst spec=SHAPES[shape]||SHAPES.river;const[vbW,vbH]=spec.vb||[1e3,1e3];const[nodePoints,setNodePoints]=React.useState([]);React.useEffect(()=>{const path=mainPathRef.current;if(!path||!showNodes||spec.nodes.length===0){setNodePoints([]);return;}const total=path.getTotalLength();setNodePoints(spec.nodes.map(at=>{const p=path.getPointAtLength(total*at);return{x:p.x/vbW*100,y:p.y/vbH*100,at};}));},[shape,showNodes,spec.nodes,vbW,vbH]);// Vertical threads swap axes, which only makes sense in the square drawing space.\nconst vertical=orientation===\"vertical\"&&vbW===vbH;// Swap axes for vertical threads, then optionally mirror horizontally (SVG applies right to left).\nconst transform=[mirror?`translate(${vbW},0) scale(-1,1)`:\"\",vertical?\"matrix(0,1,1,0,0,0)\":\"\"].filter(Boolean).join(\" \");const strokeFor=role=>role===\"accent\"?accentColor:lineColor;const opacityFor=role=>role===\"main\"?1:role===\"accent\"?.55:.4;const widthFor=role=>role===\"main\"?strokeWidth:Math.max(.6,strokeWidth*.7);const mapPoint=pt=>{// pt is in percent of the 1000 space (0–100); apply the same axis swap / mirror as the SVG\nlet x=pt.x;let y=pt.y;if(vertical)[x,y]=[y,x];if(mirror)x=100-x;return{left:`${x}%`,top:`${y}%`};};return /*#__PURE__*/_jsxs(\"div\",{ref:ref,\"aria-hidden\":\"true\",style:{position:\"relative\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",opacity:lineOpacity,overflow:\"visible\",...style},children:[/*#__PURE__*/_jsx(\"svg\",{viewBox:`0 0 ${vbW} ${vbH}`,preserveAspectRatio:\"none\",width:\"100%\",height:\"100%\",style:{position:\"absolute\",inset:0,overflow:\"visible\"},focusable:\"false\",children:/*#__PURE__*/_jsx(\"g\",{transform:transform||undefined,children:spec.paths.map((p,i)=>{const isMain=p.role===\"main\";const common={d:p.d,fill:\"none\",stroke:strokeFor(p.role),strokeWidth:widthFor(p.role),strokeLinecap:\"round\",vectorEffect:\"non-scaling-stroke\",opacity:opacityFor(p.role)};if(fullyDrawn){return /*#__PURE__*/_jsx(\"path\",{ref:isMain?mainPathRef:undefined,...common},i);}return /*#__PURE__*/_jsx(motion.path,{ref:isMain?mainPathRef:undefined,...common,style:{pathLength:isMain?progress:echoProgress,opacity:fade},initial:false},i);})})}),nodePoints.map((pt,i)=>/*#__PURE__*/_jsx(FlowNode,{position:mapPoint(pt),at:pt.at,progress:progress,color:accentColor,ring:lineColor,drawn:fullyDrawn},i))]});}function FlowNode(props){const{position,at,progress,color,ring,drawn}=props;const opacity=useTransform(progress,[Math.max(0,at-.04),at],[0,1]);const scale=useTransform(progress,[Math.max(0,at-.04),at],[.6,1]);return /*#__PURE__*/_jsx(motion.span,{style:{position:\"absolute\",left:position.left,top:position.top,width:7,height:7,marginLeft:-3.5,marginTop:-3.5,borderRadius:\"50%\",background:color,boxShadow:`0 0 0 3px #FFFFFF, 0 0 0 4px ${ring}`,opacity:drawn?1:opacity,scale:drawn?1:scale}});}addPropertyControls(ACBCFlowLine,{shape:{type:ControlType.Enum,title:\"Shape\",options:[\"river\",\"pathway\",\"ribbon\",\"route\",\"sweep\"],optionTitles:[\"River\",\"Pathway\",\"Ribbon\",\"Route\",\"Sweep\"],defaultValue:\"river\"},mode:{type:ControlType.Enum,title:\"Motion\",options:[\"scroll\",\"inView\",\"static\"],optionTitles:[\"Draw on scroll\",\"Draw once\",\"Static\"],defaultValue:\"scroll\"},orientation:{type:ControlType.Enum,title:\"Direction\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],displaySegmentedControl:true,defaultValue:\"horizontal\"},mirror:{type:ControlType.Boolean,title:\"Mirror\",defaultValue:false},lineColor:{type:ControlType.Color,title:\"Line\",defaultValue:\"#B18B3D\"},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#087E91\"},strokeWidth:{type:ControlType.Number,title:\"Stroke\",defaultValue:1.25,min:.5,max:4,step:.25,unit:\"px\"},lineOpacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:.9,min:.1,max:1,step:.05},showNodes:{type:ControlType.Boolean,title:\"Nodes\",defaultValue:true},duration:{type:ControlType.Number,title:\"Draw Time\",defaultValue:2.4,min:.6,max:6,step:.2,unit:\"s\",hidden:p=>p.mode!==\"inView\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ACBCFlowLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"200\",\"framerIntrinsicWidth\":\"1000\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ACBCFlowLine.map"],"mappings":"A,ySAWG,SAAwBuB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,QAAQ,OAAK,SAAS,cAAY,aAAa,SAAO,GAAM,YAAU,UAAU,cAAY,UAAU,cAAY,KAAK,cAAY,GAAG,YAAU,GAAK,WAAS,IAAI,SAAOC,EAAYC,EAAIzB,EAAa,IAAI,EAAQ0B,EAAY1B,EAAa,IAAI,EAAQ2B,EAASN,EAAoB,EAAQO,EAAef,EAAiB,EAAQgB,EAAWF,GAAUC,GAAgBE,IAAO,SAEta,CAAC,mBAAiBd,EAAU,CAAC,OAAOS,EAAI,OAAO,CAAC,YAAY,eAAe,CAAC,CAAC,EAAQM,EAAOrB,EAAUsB,EAAgB,CAAC,UAAU,GAAG,QAAQ,GAAG,KAAK,EAAE,CAAC,EACtJC,EAAOrB,EAAUa,EAAI,CAAC,KAAK,GAAK,OAAO,EAAE,CAAC,EAAQS,EAAevB,EAAe,CAAC,EAAEH,MAAoB,CAAC,GAAGsB,IAAO,UAAUD,GAAY,CAACI,EAAO,OAAO,IAAME,EAASlB,EAAQiB,EAAe,EAAE,CAAC,WAAS,KAAKE,CAAI,CAAC,EAAE,UAAUD,EAAS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