{"version":3,"file":"BackgroundVideo.DPPy7bnV.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/ZcH5KRSg4ygb1Fnrm7PB/d7Vi7ZoDftbUL8ofVAFy/BackgroundVideo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Background video for hero sections. The poster is a real <img> so it is the\n// page's LCP image and paints before any JS. The video gets no src until the\n// page has finished loading, so it never competes with the first paint; phones\n// (≤809px, the site's Phone breakpoint) get the short portrait loop instead.\n// Reduced-motion, Data Saver and slow-connection visitors keep the still.\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n * @framerDisableUnlink\n */const PHONE=\"(max-width: 809.98px)\";export default function BackgroundVideo(props){const{src=\"\",phoneSrc=\"\",poster,phonePoster}=props;const posterUrl=typeof poster===\"string\"?poster:poster?.src;const phonePosterUrl=typeof phonePoster===\"string\"?phonePoster:phonePoster?.src;const ref=useRef(null);useEffect(()=>{const v=ref.current;if(!v)return;const start=()=>{if(!v.getClientRects().length)return;// hidden breakpoint copy\nif(matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;// Slow connection: keep the still. Chrome/Android report the link\n// speed; Safari doesn't, so a page that took 8s+ to load counts too.\nconst c=navigator.connection;if(c?.saveData||/2g|3g/.test(c?.effectiveType??\"\")||c?.downlink<2)return;const nav=performance.getEntriesByType(\"navigation\")[0];if(nav?.loadEventStart>8e3)return;v.src=phoneSrc&&matchMedia(PHONE).matches&&phoneSrc||src;v.play().catch(()=>{});};if(document.readyState===\"complete\")start();else{window.addEventListener(\"load\",start,{once:true});return()=>window.removeEventListener(\"load\",start);}},[src,phoneSrc]);if(!src)return null;const fill={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:\"50% 50%\",display:\"block\",pointerEvents:\"none\"};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[posterUrl&&/*#__PURE__*/_jsxs(\"picture\",{children:[phonePosterUrl&&/*#__PURE__*/_jsx(\"source\",{media:PHONE,srcSet:phonePosterUrl}),/*#__PURE__*/_jsx(\"img\",{src:posterUrl,alt:\"\",decoding:\"async\",...{fetchpriority:\"high\"},style:fill})]}),/*#__PURE__*/_jsx(\"video\",{ref:ref,autoPlay:true,loop:true,muted:true,playsInline:true,preload:\"none\",\"aria-hidden\":\"true\",onPlaying:e=>e.currentTarget.style.opacity=\"1\",style:{...fill,opacity:0,transition:\"opacity 0.6s ease\"}})]});}addPropertyControls(BackgroundVideo,{src:{type:ControlType.String,title:\"Src\",defaultValue:\"\"},phoneSrc:{type:ControlType.String,title:\"Phone Src\"},poster:{type:ControlType.Image,title:\"Poster\"},phonePoster:{type:ControlType.Image,title:\"Phone Poster\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackgroundVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackgroundVideo.map"],"mappings":"mMAWuC,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,MAAI,GAAG,WAAS,GAAG,SAAO,eAAa,EAAY,EAAU,OAAO,GAAS,SAAS,EAAO,GAAQ,IAAU,EAAe,OAAO,GAAc,SAAS,EAAY,GAAa,IAAU,EAAIA,EAAO,IAAI,EAGiJ,GAH/I,MAAc,CAAC,IAAM,EAAE,EAAI,QAAQ,GAAG,CAAC,EAAE,OAAO,IAAM,MAAU,CAC5W,GADgX,CAAC,EAAE,eAAe,CAAC,CAAC,QACjY,WAAW,kCAAkC,CAAC,CAAC,QAAQ,OAE1D,IAAM,EAAE,EAAU,WAAc,GAAG,UAAU,QAAQ,KAAK,GAAG,eAAe,EAAE,GAAG,GAAG,SAAS,GAAmB,YAAY,i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