{"version":3,"file":"Loading_Lottie.CoaZq38f.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/OUqvRUSW31ppM5C27yB0/bpMnp8AP7JrjQ7MZCSiu/Loading_Lottie.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";// Utility: find the lottie-web AnimationItem instance mounted inside a DOM node\nfunction findLottieInstance(el){// lottie-web attaches to elements via a WeakMap internally; the easiest\n// cross-library hook is the __lottie property that lottie-web sets on the\n// container element, or the _lottie prop Framer's Lottie component uses.\nconst lottieKeys=[\"__lottie\",\"_lottie\",\"__lottieInstance\"];for(const key of lottieKeys){if(el[key])return el[key];}// Walk children one level deep (Framer wraps Lottie in a div)\nfor(const child of Array.from(el.children)){for(const key of lottieKeys){if(child[key])return child[key];}}return null;}// Utility: wait until the browser is idle (after first paint/LCP), with a\n// load+timeout fallback for Safari where requestIdleCallback doesn't exist.\nfunction onIdle(callback,timeout=3e3){if(\"requestIdleCallback\"in window){window.requestIdleCallback(callback,{timeout});}else{window.addEventListener(\"load\",()=>setTimeout(callback,500),{once:true});}}// Shared implementation, called from inside each plain exported override\n// below — not exported itself, so it never shows up as an override option.\nfunction useLottiePerformanceState(loadStrategy,rootMargin,freezeDelay){const wrapperRef=useRef(null);const[mounted,setMounted]=useState(loadStrategy===\"eager\");const[inView,setInView]=useState(false);const freezeTimer=useRef(null);// ── Mount timing ────────────────────────────────────────────────────\nuseEffect(()=>{if(loadStrategy===\"eager\"){setMounted(true);return;}if(loadStrategy===\"deferred\"){// Element is already visible (e.g. hero) — skip the viewport\n// check and just wait for browser idle instead, so init cost\n// lands after LCP instead of during it.\nlet cancelled=false;onIdle(()=>{if(!cancelled)setMounted(true);});return()=>{cancelled=true;};}// \"lazy\" — mount once near the viewport\nconst mountObserver=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){setMounted(true);mountObserver.disconnect();}},{rootMargin:`${rootMargin}px`});if(wrapperRef.current)mountObserver.observe(wrapperRef.current);return()=>mountObserver.disconnect();// eslint-disable-next-line react-hooks/exhaustive-deps\n},[]);// ── Play / pause on visibility ─────────────────────────────────────\nuseEffect(()=>{if(!mounted||!wrapperRef.current)return;const playObserver=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){if(freezeTimer.current){clearTimeout(freezeTimer.current);freezeTimer.current=null;}setInView(true);const instance=findLottieInstance(entry.target);if(instance?.play)instance.play();}else{freezeTimer.current=setTimeout(()=>{setInView(false);const instance=findLottieInstance(entry.target);if(instance?.pause)instance.pause();},freezeDelay);}},{threshold:.05});playObserver.observe(wrapperRef.current);return()=>{playObserver.disconnect();if(freezeTimer.current)clearTimeout(freezeTimer.current);};},[mounted,freezeDelay]);return{wrapperRef,mounted,inView};}function renderWrapper(Component,props,rendererMode,state){const{wrapperRef,mounted,inView}=state;// Set the renderer hint once (read on first mount by lottie-web /\n// Framer's Lottie component — can't switch live after mount).\nuseEffect(()=>{if(!wrapperRef.current)return;wrapperRef.current.setAttribute(\"data-renderer\",rendererMode);// eslint-disable-next-line react-hooks/exhaustive-deps\n},[]);return /*#__PURE__*/_jsx(\"div\",{ref:wrapperRef,style:{width:\"100%\",height:\"100%\",// Promote to own GPU layer — cheap for a single Lottie\n// container, avoids repaints bleeding into surrounding layout.\nwillChange:inView?\"transform\":\"auto\",// canvas renderer needs explicit overflow hidden to avoid\n// sub-pixel bleed on some browsers\noverflow:rendererMode===\"canvas\"?\"hidden\":\"visible\"},\"data-renderer\":rendererMode,children:mounted?/*#__PURE__*/_jsx(Component,{...props}):// Placeholder holds layout space while Lottie is not yet\n// mounted. Transparent — no flash of background color.\n/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"}})});}// ─── Exported overrides — pick one per layer via the \"Override\" dropdown ─────\n// UNCHANGED behavior — existing layers already reference this by name, keep\n// working as-is. Good for below-fold Lotties.\nexport function withLottiePerformance(Component){return function LottiePerformanceLazy(props){const state=useLottiePerformanceState(\"lazy\",200,300);return renderWrapper(Component,props,\"svg\",state);};}// NEW — use on Lotties that are already visible on load (hero stat cards,\n// etc). Waits for browser idle instead of viewport intersection, and\n// defaults to the cheaper Canvas renderer.\nexport function withLottiePerformanceDeferred(Component){return function LottiePerformanceDeferred(props){const state=useLottiePerformanceState(\"deferred\",0,300);return renderWrapper(Component,props,\"canvas\",state);};}// NEW — mounts immediately, no lazy/defer behavior. Still gets play/pause +\n// renderer benefits. Use for Lotties that must render right away for reasons\n// other than being above-the-fold (e.g. an interaction-triggered animation).\nexport function withLottiePerformanceEager(Component){return function LottiePerformanceEager(props){const state=useLottiePerformanceState(\"eager\",0,300);return renderWrapper(Component,props,\"svg\",state);};}\nexport const __FramerMetadata__ = {\"exports\":{\"withLottiePerformanceEager\":{\"type\":\"reactHoc\",\"name\":\"withLottiePerformanceEager\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLottiePerformance\":{\"type\":\"reactHoc\",\"name\":\"withLottiePerformance\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLottiePerformanceDeferred\":{\"type\":\"reactHoc\",\"name\":\"withLottiePerformanceDeferred\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Loading_Lottie.map"],"mappings":"8IACA,SAAS,EAAmB,EAAG,CAG/B,IAAM,EAAW,CAAC,WAAW,UAAU,kBAAkB,EAAE,IAAI,IAAM,KAAO,EAAY,GAAG,EAAG,GAAK,OAAO,EAAG,GAC7G,IAAI,IAAM,KAAS,MAAM,KAAK,EAAG,QAAQ,EAAG,IAAI,IAAM,KAAO,EAAY,GAAG,EAAM,GAAK,OAAO,EAAM,GAAO,OAAO,IAAK,CAEvH,SAAS,EAAO,EAAS,EAAQ,IAAI,CAAI,wBAAwB,EAAQ,EAAO,oBAAoB,EAAS,CAAC,SAAO,CAAC,EAAQ,EAAO,iBAAiB,WAAW,WAAW,EAAS,GAAG,EAAE,CAAC,KAAK,EAAI,CAAC,CAAG,CAExM,S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