{"version":3,"file":"StepsLine.Vato4An2.mjs","names":["useRef","useState","__esmMin","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","useTransform","useMotionValueEvent","useReducedMotion","useSpring","useScroll","init_framer_motion_DhsWWWsN","motion","addPropertyControls","useIsStaticRenderer","ControlType","init_framer_B1b760uK","layerNames","list","name","layerSelector","StepsLine","isStatic","reducedMotion","rootRef","geo","setGeo","steps","markerNames","markers","pointNames","points","start","end","progress","scrollYProgress","tipOpacity","x1","y1","x2","y2","geoRef","tipX","g","v","tipY","angle","measure","root","scope","origin","found","marker","el","pointName","index","point","MARKER_ATTR","POINT_ATTR","rect","centers","step","first","last","dx","dy","length2","s","paint","active","value","fraction","ACTIVE_ATTR","observer","rootStyle","style","svgStyle","d","stepsCss","color","strokeWidth","init_StepsLine"],"sources":["https:/framerusercontent.com/modules/IjQTsUhdfDZa7WBEIUSL/PQvOp9csOBMdn3QfB2Kw/StepsLine.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useMotionValueEvent,useReducedMotion,useScroll,useSpring,useTransform}from\"framer-motion\";import{useEffect,useRef,useState}from\"react\";const MARKER_ATTR=\"data-imp-line-marker\";const POINT_ATTR=\"data-imp-line-point\";const ACTIVE_ATTR=\"data-imp-line-active\";// Same states as the Process Arc: step circles fill in and the step texts come to full\n// strength when the arrow reaches them. Set only once JavaScript runs.\nconst stepsCss=color=>`\n[${MARKER_ATTR}] { transition: background-color .5s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1); }\n[${MARKER_ATTR}]::after { transition: border-color .5s cubic-bezier(.22,1,.36,1); }\n[${MARKER_ATTR}] p { transition: color .5s cubic-bezier(.22,1,.36,1); }\n[${MARKER_ATTR}]:not([${ACTIVE_ATTR}]) { --border-color: rgba(17, 17, 17, .22) !important; }\n[${MARKER_ATTR}]:not([${ACTIVE_ATTR}]) p { --framer-text-color: rgba(17, 17, 17, .45) !important; }\n[${MARKER_ATTR}][${ACTIVE_ATTR}] { background-color: ${color} !important; --border-color: ${color} !important; }\n[${MARKER_ATTR}][${ACTIVE_ATTR}] p { --framer-text-color: #fff !important; }\n[${POINT_ATTR}] { transition: opacity .6s cubic-bezier(.22,1,.36,1); }\n[${POINT_ATTR}]:not([${ACTIVE_ATTR}]) { opacity: .35 !important; }\n`;function layerNames(list){return list.split(\",\").map(name=>name.trim()).filter(Boolean);}function layerSelector(name){return`[data-framer-name=\"${name.replace(/[\"\\\\]/g,\"\\\\$&\")}\"]`;}/**\n * Steps Line — a straight line through the step numbers, drawn as the visitor scrolls,\n * with an arrow at its tip. Each step lights up when the arrow reaches its number.\n * Works across (numbers in a row) and down (numbers in a column) — it follows the numbers.\n * Place it in the steps container, absolute, filling it, as the first layer.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 300\n */export default function StepsLine({color=\"#111111\",strokeWidth=1.5,markers=\"Step 01 marker, Step 02 marker, Step 03 marker, Step 04 marker, Step 05 marker, Step 06 marker, Step 07 marker\",points=\"Step 01 text, Step 02 text, Step 03 text, Step 04 text, Step 05 text, Step 06 text, Step 07 text\",start=85,end=55,style}){const isStatic=useIsStaticRenderer();const reducedMotion=useReducedMotion();const rootRef=useRef(null);const[geo,setGeo]=useState(null);const steps=useRef([]);const markerNames=layerNames(markers);const pointNames=layerNames(points);const{scrollYProgress}=useScroll({target:rootRef,offset:[`start ${start/100}`,`end ${end/100}`]});const progress=useSpring(scrollYProgress,{stiffness:220,damping:34,mass:.5,restDelta:5e-4});const tipOpacity=useTransform(progress,[0,.01,.995,1],[0,1,1,0]);const x1=geo?geo.x1:0;const y1=geo?geo.y1:0;const x2=geo?geo.x2:0;const y2=geo?geo.y2:0;// the tip reads the latest geometry from a ref, so a resize never leaves it behind\nconst geoRef=useRef(null);geoRef.current=geo;const tipX=useTransform(progress,v=>{const g=geoRef.current;return g?g.x1+(g.x2-g.x1)*v:0;});const tipY=useTransform(progress,v=>{const g=geoRef.current;return g?g.y1+(g.y2-g.y1)*v:0;});const angle=Math.atan2(y2-y1,x2-x1)*180/Math.PI;const measure=()=>{const root=rootRef.current;if(!root||!markerNames.length)return;let scope=root.parentElement;while(scope&&!scope.querySelector(layerSelector(markerNames[0])))scope=scope.parentElement;if(!scope)return;const origin=root.getBoundingClientRect();const found=markerNames.map((name,index)=>{const marker=[...scope.querySelectorAll(layerSelector(name))].find(el=>el.getBoundingClientRect().width>0)||null;const pointName=pointNames[index];const point=pointName?[...scope.querySelectorAll(layerSelector(pointName))].find(el=>el.getBoundingClientRect().width>0)||null:null;marker?.setAttribute(MARKER_ATTR,\"\");point?.setAttribute(POINT_ATTR,\"\");const rect=marker?.getBoundingClientRect();const center=rect?{x:rect.left+rect.width/2-origin.left,y:rect.top+rect.height/2-origin.top}:null;return{marker,point,center};});const centers=found.map(step=>step.center).filter(Boolean);if(centers.length<2)return;const first=centers[0];const last=centers[centers.length-1];const dx=last.x-first.x;const dy=last.y-first.y;const length2=dx*dx+dy*dy||1;steps.current=found.map(step=>({marker:step.marker,point:step.point,fraction:step.center?Math.min(1,Math.max(0,((step.center.x-first.x)*dx+(step.center.y-first.y)*dy)/length2)):1}));setGeo({x1:first.x,y1:first.y,x2:last.x,y2:last.y,fractions:steps.current.map(s=>s.fraction)});};const paint=value=>{for(const{marker,point,fraction}of steps.current){const active=reducedMotion||value>=fraction-.004;for(const el of[marker,point]){if(!el||el.hasAttribute(ACTIVE_ATTR)===active)continue;if(active)el.setAttribute(ACTIVE_ATTR,\"\");else el.removeAttribute(ACTIVE_ATTR);}}};useEffect(()=>{const root=rootRef.current;if(isStatic||!root)return;measure();paint(progress.get());const observer=new ResizeObserver(()=>{measure();paint(progress.get());});observer.observe(root);const fonts=document.fonts;fonts?.ready?.then?.(()=>{measure();paint(progress.get());});return()=>{observer.disconnect();for(const{marker,point}of steps.current){for(const el of[marker,point]){el?.removeAttribute(MARKER_ATTR);el?.removeAttribute(POINT_ATTR);el?.removeAttribute(ACTIVE_ATTR);}}};},[isStatic,markers,points,reducedMotion]);useMotionValueEvent(progress,\"change\",paint);const rootStyle={...style,position:\"relative\",width:\"100%\",height:\"100%\",pointerEvents:\"none\"};const svgStyle={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"visible\"};if(isStatic||!geo){return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,style:rootStyle});}const d=`M${x1.toFixed(2)} ${y1.toFixed(2)} L${x2.toFixed(2)} ${y2.toFixed(2)}`;return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,style:rootStyle,children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:stepsCss(color)}}),/*#__PURE__*/_jsxs(\"svg\",{style:svgStyle,\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"path\",{d:d,fill:\"none\",stroke:color,strokeOpacity:.14,strokeWidth:1}),/*#__PURE__*/_jsx(motion.path,{d:d,fill:\"none\",stroke:color,strokeWidth:strokeWidth,style:reducedMotion?{pathLength:1}:{pathLength:progress,opacity:tipOpacity}}),!reducedMotion&&/*#__PURE__*/_jsx(motion.g,{style:{x:tipX,y:tipY,opacity:tipOpacity},children:/*#__PURE__*/_jsx(\"path\",{d:\"M-8 -6 L1 0 L-8 6\",fill:\"none\",stroke:color,strokeWidth:strokeWidth+.5,strokeLinecap:\"round\",strokeLinejoin:\"round\",transform:`rotate(${angle})`})})]})]});}addPropertyControls(StepsLine,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#111111\"},strokeWidth:{type:ControlType.Number,title:\"Stroke\",defaultValue:1.5,min:.5,max:4,step:.5,unit:\"px\"},start:{type:ControlType.Number,title:\"Start At\",description:\"Line starts when the top of the steps reaches this % of the screen height.\",defaultValue:85,min:0,max:100,unit:\"%\"},end:{type:ControlType.Number,title:\"End At\",description:\"Line is complete when the bottom of the steps reaches this % of the screen height.\",defaultValue:55,min:0,max:100,unit:\"%\"},markers:{type:ControlType.String,title:\"Markers\",description:\"Layer names of the step circles, in order.\",defaultValue:\"Step 01 marker, Step 02 marker, Step 03 marker, Step 04 marker, Step 05 marker, Step 06 marker, Step 07 marker\",displayTextArea:true},points:{type:ControlType.String,title:\"Steps\",description:\"Layer names of the step texts, in the same order.\",defaultValue:\"Step 01 text, Step 02 text, Step 03 text, Step 04 text, Step 05 text, Step 06 text, Step 07 text\",displayTextArea:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StepsLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"1200\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StepsLine.map"],"mappings":"A,2RAYE,SAASqB,EAAW,EAAK,CAAC,OAAOC,EAAK,MAAM,GAAG,CAAC,CAAC,IAAI,GAAMC,EAAK,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAE,CAAC,SAASC,EAAc,EAAK,CAAC,MAAM,sBAAsBD,EAAK,QAAQ,SAAS,MAAM,EAAE,GAAI,CAUnL,SAAwBE,EAAU,CAAC,QAAM,UAAU,cAAY,IAAI,UAAQ,iHAAiH,SAAO,mGAAmG,QAAM,GAAG,MAAI,GAAG,SAAO,CAAC,IAAMC,EAASR,EAAoB,EAAQS,EAAcf,EAAiB,EAAQgB,EAAQ5B,EAAO,IAAI,EAAO,CAAC6B,EAAIC,GAAQ7B,EAAS,IAAI,EAAQ8B,EAAM/B,EAAO,CAAC,CAAC,EAAQgC,EAAYX,EAAWY,CAAO,EAAQC,EAAWb,EAAWc,CAAM,EAAO,CAAC,mBAAiBrB,EAAU,CAAC,OAAOc,EAAQ,OAAO,CAAC,SA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