{"version":3,"file":"ScrollDots.RoSWXQsQ.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/UaE3I3zCs0OHK1zIeUaf/B9Ab1SbUgM2YloD3NKdr/ScrollDots.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Scroll Dots\n *\n * Pagination dots that follow a horizontal scroll container.\n * Point Target ID at the element ID of the scrolling row.\n *\n * @framerIntrinsicWidth 60\n * @framerIntrinsicHeight 8\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ScrollDots(props){const{targetId=\"\",count=3,activeColor=\"#FBCE01\",inactiveColor=\"rgba(255, 255, 255, 0.22)\",dotSize=8,activeWidth=26,gap=7,style}=props;const[active,setActive]=useState(0);useEffect(()=>{if(typeof document===\"undefined\"||typeof window===\"undefined\")return;if(!targetId)return;let el=null;let raf=0;let cancelled=false;// Framer wraps any child that carries breakpoint overrides in a zero-width\n// \"ssr-variant\" div, so el.children is not reliably the slide list.\nfunction slides(row){const out=[];for(const child of Array.from(row.children)){if(child.getBoundingClientRect().width>0){out.push(child);}else{for(const inner of Array.from(child.children)){if(inner.getBoundingClientRect().width>0)out.push(inner);}}}return out;}function update(){if(!el)return;const kids=slides(el);if(kids.length===0)return;const padLeft=parseFloat(getComputedStyle(el).paddingLeft)||0;// measure against live rects so wrapper nesting cannot skew the offsets\nconst anchor=el.getBoundingClientRect().left+padLeft;let best=0;let bestDistance=Number.POSITIVE_INFINITY;for(let i=0;i<kids.length;i++){const distance=Math.abs(kids[i].getBoundingClientRect().left-anchor);if(distance<bestDistance){bestDistance=distance;best=i;}}startTransition(function(){setActive(best);});}// the row may not be in the DOM on the first pass, so keep looking\nfunction attach(){el=document.getElementById(targetId);if(!el){if(!cancelled)raf=requestAnimationFrame(attach);return;}update();el.addEventListener(\"scroll\",update,{passive:true});window.addEventListener(\"resize\",update);}attach();return function(){cancelled=true;cancelAnimationFrame(raf);if(el)el.removeEventListener(\"scroll\",update);window.removeEventListener(\"resize\",update);};},[targetId,count]);const dots=[];for(let i=0;i<count;i++){const isActive=i===active;dots.push(/*#__PURE__*/_jsx(\"div\",{role:\"tab\",\"aria-selected\":isActive,\"aria-label\":\"Slide \"+(i+1),style:{width:isActive?activeWidth:dotSize,height:dotSize,borderRadius:100,backgroundColor:isActive?activeColor:inactiveColor,flex:\"0 0 auto\",transition:\"width 0.32s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.32s ease\"}},i));}return /*#__PURE__*/_jsx(\"div\",{role:\"tablist\",\"aria-label\":\"Carousel position\",style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:\"center\",gap:gap},children:dots});}addPropertyControls(ScrollDots,{targetId:{type:ControlType.String,title:\"Target ID\",defaultValue:\"\",placeholder:\"coach-carousel\"},count:{type:ControlType.Number,title:\"Dots\",defaultValue:3,min:1,max:12,step:1},activeColor:{type:ControlType.Color,title:\"Active\",defaultValue:\"#FBCE01\"},inactiveColor:{type:ControlType.Color,title:\"Inactive\",defaultValue:\"rgba(255, 255, 255, 0.22)\"},dotSize:{type:ControlType.Number,title:\"Dot Size\",defaultValue:8,min:4,max:20,step:1,unit:\"px\"},activeWidth:{type:ControlType.Number,title:\"Active Width\",defaultValue:26,min:8,max:60,step:1,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:7,min:0,max:24,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollDots\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"60\",\"framerIntrinsicHeight\":\"8\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollDots.map"],"mappings":"uMAWG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