{"version":3,"file":"CardTicker.BrcclfHV.mjs","names":["_jsxs","_jsx","useRef","useState","useEffect","__esmMin","init_ssg_sandbox_shims","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","window","useLocaleInfo","addPropertyControls","init_framer_BWzg2IRg","useIsStaticRenderer","ControlType","PauseToggle","props","paused","onToggle","theme","label","fg","bg","ring","CardTicker","speed","pauseOnHover","setLayer","pauseButton","buttonTheme","selfRef","isStatic","activeLocale","PAUSE_LABELS","userPaused","setUserPaused","canAnimate","setCanAnimate","userPausedRef","self","shown","el","motion","scope","row","sets","loop","x","frame","last","hovered","focused","held","onScreen","cleanups","tick","now","dt","stop","measure","a","setup","fn","found","root","on","t","type","s","n","viewport","io","entry","resizeTimer","onResize","onMotion","raf","late","toggle","showButton","init_CardTicker"],"sources":["https:/framerusercontent.com/modules/LTPtBe6rYgMQkSqTKQss/n7y8ajdxGRWzcmxYYNLV/CardTicker.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer,useLocaleInfo}from\"framer\";const PAUSE_LABELS={en:[\"Pause animation\",\"Play animation\"],nl:[\"Animatie pauzeren\",\"Animatie afspelen\"],de:[\"Animation pausieren\",\"Animation abspielen\"],es:[\"Pausar animaci\\xf3n\",\"Reproducir animaci\\xf3n\"],fr:[\"Mettre l’animation en pause\",\"Lire l’animation\"]};function PauseToggle(props){const{paused,onToggle,theme,label}=props;const fg=theme===\"dark\"?\"rgb(255, 255, 255)\":\"rgb(8, 19, 40)\";const bg=theme===\"dark\"?\"rgba(8, 19, 40, 0.48)\":\"rgba(255, 255, 255, 0.88)\";const ring=theme===\"dark\"?\"rgb(27, 173, 255)\":\"rgb(0, 106, 166)\";return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"motion-pause-toggle\",onClick:onToggle,\"aria-label\":paused?label[1]:label[0],style:{width:44,height:44,padding:0,border:0,background:\"transparent\",display:\"grid\",placeItems:\"center\",cursor:\"pointer\",pointerEvents:\"auto\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`.motion-pause-toggle span{transition:background-color 150ms ease}.motion-pause-toggle:focus-visible{outline:2px solid ${ring};outline-offset:0;border-radius:999px}@media (hover:hover) and (pointer:fine){.motion-pause-toggle:hover span{filter:brightness(0.96)}}.motion-pause-toggle:active span{filter:brightness(0.92)}`}),/*#__PURE__*/_jsx(\"span\",{style:{width:32,height:32,borderRadius:999,background:bg,display:\"grid\",placeItems:\"center\",backdropFilter:\"blur(8px)\"},children:paused?/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",\"aria-hidden\":true,fill:fg,children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5.6v12.8c0 .8.9 1.3 1.6.8l9.4-6.4a1 1 0 0 0 0-1.6L9.6 4.8C8.9 4.3 8 4.8 8 5.6z\"})}):/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",\"aria-hidden\":true,fill:fg,children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 5h3.5v14H7zM13.5 5H17v14h-3.5z\"})})})]});}/**\n * Card Ticker\n *\n * Scrolls a row of cards in a seamless loop. Place it inside the frame that\n * clips the row. The row holds two copies of the same CMS list, both named\n * \"Ticker Set\". The second copy is hidden from screen readers and keyboards.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function CardTicker(props){const{speed=40,pauseOnHover=true,setLayer=\"Ticker Set\",pauseButton=false,buttonTheme=\"light\"}=props;const selfRef=useRef(null);const isStatic=useIsStaticRenderer();const{activeLocale}=useLocaleInfo();const label=PAUSE_LABELS[(activeLocale?.code||\"en\").slice(0,2)]||PAUSE_LABELS.en;const[userPaused,setUserPaused]=useState(false);const[canAnimate,setCanAnimate]=useState(false);const userPausedRef=useRef(false);useEffect(()=>{const self=selfRef.current;if(!self||isStatic)return;const shown=el=>el.getClientRects().length>0;const motion=window.matchMedia(\"(prefers-reduced-motion: reduce)\");let scope=null;let row=null;let sets=[];let loop=0;let x=0;let frame=0;let last=0;let hovered=false;let focused=false;let held=false;let onScreen=true;const cleanups=[];const paused=()=>userPausedRef.current||pauseOnHover&&hovered||focused||held||!onScreen||document.hidden;const tick=now=>{const dt=last?Math.min(64,now-last):16;last=now;if(!paused()&&loop>0){x-=speed*dt/1e3;if(x<=-loop)x+=loop;if(row)row.style.transform=`translate3d(${x}px, 0, 0)`;}frame=requestAnimationFrame(tick);};const stop=()=>{if(frame)cancelAnimationFrame(frame);frame=0;last=0;};const measure=()=>{if(!row||sets.length<2)return;const a=sets[0].getBoundingClientRect();const b=sets[1].getBoundingClientRect();loop=b.left-a.left;};const setup=()=>{cleanups.splice(0).forEach(fn=>fn());stop();if(!shown(self))return;let el=self.parentElement;scope=null;while(el){const found=Array.from(el.querySelectorAll(`[data-framer-name=\"${setLayer}\"]`)).filter(shown);if(found.length>=1){scope=el;sets=found;break;}el=el.parentElement;}if(!scope||!sets.length)return;row=sets[0].parentElement;const root=scope;const on=(t,type,fn)=>{t.addEventListener(type,fn);cleanups.push(()=>t.removeEventListener(type,fn));};// Copies after the first are decorative: hide them from assistive tech and the tab order.\nsets.slice(1).forEach(s=>{s.setAttribute(\"aria-hidden\",\"true\");s.querySelectorAll(\"a, button, [tabindex]\").forEach(n=>n.setAttribute(\"tabindex\",\"-1\"));s.style.display=\"\";});setCanAnimate(!motion.matches&&sets.length>=2);if(motion.matches||sets.length<2){// No motion: let people scroll the row themselves instead.\nif(row)row.style.transform=\"\";sets.slice(1).forEach(s=>s.style.display=\"none\");// Scroll the clipping viewport (the row's parent), not the outer wrapper.\nconst viewport=row?.parentElement||root;viewport.style.overflowX=\"auto\";viewport.style.scrollSnapType=\"x proximity\";return;}const viewport=row?.parentElement||root;viewport.style.overflowX=\"\";viewport.style.scrollSnapType=\"\";measure();on(root,\"mouseenter\",()=>{hovered=true;});on(root,\"mouseleave\",()=>{hovered=false;});on(root,\"focusin\",e=>{if(e.target?.closest?.(\".motion-pause-toggle\"))return;focused=true;});on(root,\"focusout\",e=>{if(!root.contains(e.relatedTarget))focused=false;});on(root,\"pointerdown\",e=>{if(e.pointerType!==\"mouse\")held=true;});on(window,\"pointerup\",()=>{held=false;});on(window,\"pointercancel\",()=>{held=false;});const io=new IntersectionObserver(([entry])=>{onScreen=entry.isIntersecting;});io.observe(root);cleanups.push(()=>io.disconnect());frame=requestAnimationFrame(tick);};let resizeTimer=0;const onResize=()=>{window.clearTimeout(resizeTimer);resizeTimer=window.setTimeout(()=>{x=0;setup();},200);};const onMotion=()=>{x=0;setup();};window.addEventListener(\"resize\",onResize);motion.addEventListener(\"change\",onMotion);const raf=requestAnimationFrame(setup);// CMS images can change card widths after load; re-measure once they settle.\nconst late=window.setTimeout(measure,1500);return()=>{cancelAnimationFrame(raf);window.clearTimeout(resizeTimer);window.clearTimeout(late);stop();cleanups.splice(0).forEach(fn=>fn());window.removeEventListener(\"resize\",onResize);motion.removeEventListener(\"change\",onMotion);};},[isStatic,speed,pauseOnHover,setLayer]);const toggle=()=>{userPausedRef.current=!userPausedRef.current;setUserPaused(userPausedRef.current);};// Keep one root element, so the effect's reference to it stays valid when the button appears.\nconst showButton=pauseButton&&canAnimate;return /*#__PURE__*/_jsx(\"div\",{ref:selfRef,\"aria-hidden\":showButton?undefined:true,style:{width:pauseButton?44:1,height:pauseButton?44:1,pointerEvents:showButton?\"auto\":\"none\"},children:showButton&&/*#__PURE__*/_jsx(PauseToggle,{paused:userPaused,onToggle:toggle,theme:buttonTheme,label:label})});}addPropertyControls(CardTicker,{speed:{type:ControlType.Number,title:\"Speed\",defaultValue:40,min:5,max:200,step:5,unit:\"px/s\"},pauseOnHover:{type:ControlType.Boolean,title:\"Pause on hover\",defaultValue:true},setLayer:{type:ControlType.String,title:\"Set layer\",defaultValue:\"Ticker Set\"},pauseButton:{type:ControlType.Boolean,title:\"Pause button\",defaultValue:false},buttonTheme:{type:ControlType.Enum,title:\"Button theme\",options:[\"dark\",\"light\"],optionTitles:[\"On dark\",\"On light\"],defaultValue:\"light\",hidden:p=>!p.pauseButton}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CardTicker\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"1\",\"framerIntrinsicHeight\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CardTicker.map"],"mappings":"A,6NAAkc,SAASoB,EAAYC,EAAM,CAAC,GAAK,CAACC,SAAOC,WAASC,QAAMC,SAAOJ,EAAYK,EAAGF,IAAQ,OAAO,qBAAqB,iBAAuBG,EAAGH,IAAQ,OAAO,wBAAwB,4BAAkCI,EAAKJ,IAAQ,OAAO,oBAAoB,mBAAmB,MAAoBxB,gBAAM,SAAS,CAAC,KAAK,SAAS,UAAU,sBAAsB,QAAQuB,EAAS,aAAaD,EAAOG,EAAM,GAAGA,EAAM,GAAG,MAAM,CAAC,MAAM,GAAG,OAAO,GAAG,QAAQ,EAAE,OAAO,EAAE,WAAW,cAAc,QAAQ,OAAO,WAAW,SAAS,OAAO,UAAU,cAAc,MAAM,EAAE,SAAS,CAAcxB,gBAAK,QAAQ,CAAC,SAAS,yHAAyH2B,EAAK,iMAAiM,CAAC,EAAe3B,gBAAK,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,GAAG,aAAa,IAAI,WAAW0B,EAAG,QAAQ,OAAO,WAAW,SAAS,eAAe,WAAW,EAAE,SAASL,EAAoBrB,gBAAK,MAAM,CAAC,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,cAAc,GAAK,KAAKyB,EAAG,SAAsBzB,gBAAK,OAAO,CAAC,EAAE,mFAAmF,CAAC,CAAC,C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