{"version":3,"file":"LoopVideo.Q3h74cR5.mjs","names":["useRef","useState","startTransition","__esmMin","te","_e","de","window","init_ssg_sandbox_shims","ce","c","init_npm_react_18_3_1","init_jsx_runtime","useIsStaticRenderer","init_framer_Cb9Z_4vX","addPropertyControls","ControlType","LoopVideo","props","isStatic","ref","reduced","setReduced","mq","update","v","io","e","entries","src","box","style","radius","media","fit","poster","label","init_LoopVideo"],"sources":["https:/framerusercontent.com/modules/cgQB0ttdgMAXh8TlixEJ/hAU7VuakTwbEItKSiasz/LoopVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef,useState,startTransition}from\"react\";/**\n * Loop Video\n *\n * Muted looping video that plays only while it is on screen and shows its poster\n * when the visitor prefers reduced motion.\n *\n * @framerIntrinsicWidth 1080\n * @framerIntrinsicHeight 608\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LoopVideo(props){const{src=\"\",poster=\"\",label=\"\",background=\"#003D30\",radius=0,fit=\"cover\",style}=props;const isStatic=useIsStaticRenderer();const ref=useRef(null);const[reduced,setReduced]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"||!window.matchMedia)return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const update=()=>startTransition(()=>setReduced(mq.matches));update();mq.addEventListener?.(\"change\",update);return()=>mq.removeEventListener?.(\"change\",update);},[]);useEffect(()=>{const v=ref.current;if(!v||isStatic||reduced||typeof IntersectionObserver===\"undefined\")return;const io=new IntersectionObserver(entries=>{for(const e of entries){if(e.isIntersecting)v.play().catch(()=>{});else v.pause();}},{threshold:.15});io.observe(v);return()=>{io.disconnect();v.pause();};},[isStatic,reduced,src]);const box={...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:radius,background};const media={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"};if(isStatic||reduced||!src){return /*#__PURE__*/_jsx(\"div\",{style:box,children:poster?/*#__PURE__*/_jsx(\"img\",{src:poster,alt:label,style:media}):null});}return /*#__PURE__*/_jsx(\"div\",{style:box,children:/*#__PURE__*/_jsx(\"video\",{ref:ref,src:src,poster:poster||undefined,muted:true,loop:true,playsInline:true,autoPlay:true,preload:\"metadata\",\"aria-label\":label,style:media})});}addPropertyControls(LoopVideo,{src:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\"},poster:{type:ControlType.String,title:\"Poster URL\",defaultValue:\"\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#003D30\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:48,unit:\"px\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\"],optionTitles:[\"Cover\",\"Contain\"],defaultValue:\"cover\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoopVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"608\",\"framerIntrinsicWidth\":\"1080\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoopVideo.map"],"mappings":"A,qNAWG,SAAwBiB,EAAU,EAAM,CAAC,GAAK,CAAC,MAAI,GAAG,SAAO,GAAG,QAAM,GAAG,aAAW,UAAU,SAAO,EAAE,MAAI,QAAQ,SAAOC,EAAYC,EAASN,EAAoB,EAAQO,EAAIpB,EAAO,IAAI,EAAO,CAACqB,EAAQC,GAAYrB,EAAS,EAAK,EAAEQ,MAAc,CAAC,GAAUF,IAAS,QAAa,CAACA,EAAO,WAAW,OAAO,IAAMgB,EAAGhB,EAAO,WAAW,kCAAkC,EAAQiB,MAAWtB,M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