{"version":3,"file":"LoopVideo.BcujMe4e.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/a14sgJagoVcjgk0Rm6V7/4hywI17XYf4SzzXHiQfi/BottomFade.js","https:/framerusercontent.com/modules/IqBRRZKKMwNPq6uVzC54/Yvboka4TrtJF2JmcPUEr/LoopVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Edge Fade — a transparent-in-the-middle vertical vignette (dark at the top and\n * dark at the bottom), to keep hero text readable behind a title (top) and a\n * stats row (bottom) while the video still shows through the clear middle band.\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 480\n * @framerDisableUnlink\n */export default function BottomFade(props){const{strength=.6,start=58,topStrength=.5,topEnd=42}=props;const s=Math.max(0,Math.min(1,strength));const ts=Math.max(0,Math.min(1,topStrength));const bg=`linear-gradient(180deg, rgba(0,0,0,${ts}) 0%, rgba(0,0,0,0) ${topEnd}%, rgba(0,0,0,0) ${start}%, rgba(0,0,0,${s}) 100%)`;return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",background:bg,pointerEvents:\"none\",...props.style}});}addPropertyControls(BottomFade,{strength:{type:ControlType.Number,title:\"Bottom darkness\",defaultValue:.6,min:0,max:1,step:.05},start:{type:ControlType.Number,title:\"Bottom start %\",defaultValue:58,min:0,max:100,step:1},topStrength:{type:ControlType.Number,title:\"Top darkness\",defaultValue:.5,min:0,max:1,step:.05},topEnd:{type:ControlType.Number,title:\"Top end %\",defaultValue:42,min:0,max:100,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BottomFade\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"480\",\"framerIntrinsicWidth\":\"800\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BottomFade.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef,useState}from\"react\";const DEFAULT_SRC=\"https://d2ol7oe51mr4n9.cloudfront.net/user_3FMPqLZy3N0UPmCIAVAvDMjs76h/319ebca4-068e-461f-b826-422f9073086c.mp4\";/**\n * Loop Video — autoplaying, muted background video that fills its frame.\n * With `smooth` on, two stacked copies crossfade at the loop point so the\n * restart is invisible instead of a hard cut; off = native loop.\n *\n * `srcUrl` (string) overrides the File control — File controls can't be set\n * via the plugin. `srcUrlMobile` + `mobileMax` swap in a portrait cut below\n * the given viewport width (matchMedia; keyed remount on switch).\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 540\n * @framerDisableUnlink\n */export default function LoopVideo(props){const{src,srcUrl=\"\",srcUrlMobile=\"\",mobileMax=810,fit=\"cover\",radius=0,smooth=true,fade=1}=props;const isStatic=useIsStaticRenderer();const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(isStatic||typeof window===\"undefined\"||!window.matchMedia)return;const mq=window.matchMedia(`(max-width: ${mobileMax}px)`);const apply=()=>setIsMobile(mq.matches);apply();mq.addEventListener?mq.addEventListener(\"change\",apply):mq.addListener(apply);return()=>{mq.removeEventListener?mq.removeEventListener(\"change\",apply):mq.removeListener(apply);};},[isStatic,mobileMax]);const desktopSrc=(srcUrl||\"\").trim()||src||DEFAULT_SRC;const mobileSrc=(srcUrlMobile||\"\").trim();const activeSrc=isMobile&&mobileSrc?mobileSrc:desktopSrc;const a=useRef(null);const b=useRef(null);const st=useRef({active:0,switching:false});useEffect(()=>{if(isStatic||!smooth)return;const vids=[a.current,b.current];if(!vids[0]||!vids[1])return;const s=st.current;s.active=0;s.switching=false;vids[0].style.opacity=\"1\";vids[1].style.opacity=\"0\";try{vids[0].currentTime=0;}catch(e){}vids[0].play().catch(()=>{});const tick=()=>{const cur=vids[s.active],nxt=vids[1-s.active];if(!cur||!nxt||s.switching)return;if(cur.duration&&cur.duration-cur.currentTime<=Math.max(.3,fade)){s.switching=true;try{nxt.currentTime=0;}catch(e){}nxt.play().catch(()=>{});nxt.style.opacity=\"1\";cur.style.opacity=\"0\";setTimeout(()=>{cur.pause();s.active=1-s.active;s.switching=false;},Math.max(.3,fade)*1e3);}};const id=setInterval(tick,100);return()=>clearInterval(id);},[isStatic,smooth,activeSrc,fade]);const base={width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"};if(isStatic||!smooth){return /*#__PURE__*/_jsx(\"video\",{src:activeSrc,autoPlay:true,loop:true,muted:true,playsInline:true,preload:\"auto\",style:{...base,borderRadius:radius,...props.style}},activeSrc);}const layer={...base,position:\"absolute\",inset:0,transition:`opacity ${Math.max(.3,fade)}s ease`};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:radius,...props.style},children:[/*#__PURE__*/_jsx(\"video\",{ref:a,src:activeSrc,autoPlay:true,muted:true,playsInline:true,preload:\"auto\",style:{...layer,opacity:1}}),/*#__PURE__*/_jsx(\"video\",{ref:b,src:activeSrc,muted:true,playsInline:true,preload:\"auto\",style:{...layer,opacity:0}})]},activeSrc);}addPropertyControls(LoopVideo,{src:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},srcUrl:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\"},srcUrlMobile:{type:ControlType.String,title:\"Mobile URL\",defaultValue:\"\"},mobileMax:{type:ControlType.Number,title:\"Mobile max px\",defaultValue:810,min:320,max:1200},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\"],defaultValue:\"cover\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:48},smooth:{type:ControlType.Boolean,title:\"Smooth loop\",defaultValue:true},fade:{type:ControlType.Number,title:\"Crossfade (s)\",defaultValue:1,min:.3,max:3,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoopVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"640\",\"framerIntrinsicHeight\":\"540\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoopVideo.map"],"mappings":"qNASG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,WAAS,GAAG,QAAM,GAAG,cAAY,GAAG,SAAO,IAAI,EAA+N,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,WAAW,sCAApP,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,CAAW,CAAmD,EAAE,sBAAsB,EAAO,mBAAmB,EAAM,gBAAtL,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,CAAQ,CAAwK,EAAE,SAAyF,cAAc,OAAO,GAAG,EAAM,KAAK,CAAC,CAAC,CAAE,iBAT9Y,IAAoD,EAS2V,EAAoB,EAAW,CAAC,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,kBAAkB,aAAa,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,MAAM,CAAC,KAAK,EAAY,OAAO,MAAM,iBAAiB,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,EAAY,OAAO,MAAM,eAAe,aAAa,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,OAAO,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KCI10B,SAAwB,EA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