{"version":3,"file":"Video.CMtRuAx3.mjs","names":["useRef","_Fragment","__esmMin","init_ssg_sandbox_shims","navigator","window","de","l","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","addPropertyControls","RenderTarget","init_framer_Bf4_tcb2","ControlType","Video","props","ref","canvas","v","src","small","still","ours","file","PHONE","attach","play","pause","onPause","onPlay","mq","onWidth","cur","io","entries","poster","fit","radius","style","EARLY","init_Video"],"sources":["https:/framerusercontent.com/modules/cD1bwps8qlnYY3veUXzC/IaG1gEiehwLuQawbmG7f/Video.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";const PHONE=\"(max-width: 767.98px)\";const STILL=\"matchMedia('(prefers-reduced-motion: reduce)').matches||!!(navigator.connection&&navigator.connection.saveData)\";// Runs once while the static HTML is parsed (React never executes it), so an above-the-fold video starts before\n// hydration. Hidden breakpoint copies have no boxes and are skipped.\nconst EARLY=`(function(s){var v=s&&s.previousElementSibling;if(!v||!v.getClientRects().length||${STILL})return;var r=v.getBoundingClientRect();if(r.top>innerHeight||r.bottom<0)return;var m=v.getAttribute(\"data-small\"),f=v.getAttribute(\"data-src\");v.preload=\"auto\";v.src=m&&matchMedia(\"${PHONE}\").matches?m:f||m;var p=v.play();p&&p.catch(function(){})})(document.currentScript)`;/**\n * Background video: muted, looping, inline, covering its box. The poster shows first; the file loads and plays only\n * within about a viewport of the screen and pauses far out of it. Poster only under reduced motion or Save-Data.\n * A smaller file plays below 768px when set. A pause from outside (Site Styles' Live Toggle) is kept: the video is\n * marked data-rw-paused and the in-view logic leaves it alone until something else plays it.\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function Video(props){const{src,small,poster,fit,radius,style}=props;const ref=useRef(null);const canvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{const v=ref.current;if(!v||canvas||!(src||small))return;const still=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches||!!navigator.connection?.saveData// same test as STILL\n;let ours=0// pause events we caused\n;const file=()=>small&&window.matchMedia(PHONE).matches?small:src||small;const attach=()=>{if(v.getAttribute(\"src\"))return;v.preload=\"auto\";v.src=file()// never a React prop: a re-render must not reset it\n;};const play=()=>{if(v.hasAttribute(\"data-rw-paused\"))return;attach();if(v.paused)v.play().catch(()=>{});};const pause=()=>{if(v.paused)return;ours++;v.pause();};const onPause=()=>{if(ours>0)return void ours--;if(document.hidden)return;// the browser pausing a background tab\nv.setAttribute(\"data-rw-paused\",\"\");};const onPlay=()=>{v.removeAttribute(\"data-rw-paused\");// An outside play() on a video that never loaded (reduced motion, Save-Data): load it now.\nif(!v.getAttribute(\"src\")){attach();v.play().catch(()=>{});}};// Crossing 768 with a file loaded: swap to the other source, keeping the play state.\nconst mq=window.matchMedia(PHONE);const onWidth=()=>{const cur=v.getAttribute(\"src\");if(!cur||!small||cur===file())return;if(v.paused){v.removeAttribute(\"src\")// the next play() attaches the right file\n;v.load();return;}pause();v.src=file();v.play().catch(()=>{});};mq.addEventListener(\"change\",onWidth);v.addEventListener(\"pause\",onPause);v.addEventListener(\"play\",onPlay);// New files on the same element (another breakpoint's values): drop the old one; the observer reattaches.\nconst cur=v.getAttribute(\"src\");if(cur&&cur!==src&&cur!==small){pause();v.removeAttribute(\"src\");v.load();}let io=null;if(!still){io=new IntersectionObserver(entries=>{entries[entries.length-1].isIntersecting?play():pause();},{rootMargin:\"100% 0px\"});io.observe(v);}return()=>{io?.disconnect();mq.removeEventListener(\"change\",onWidth);v.removeEventListener(\"pause\",onPause);v.removeEventListener(\"play\",onPlay);};},[src,small,canvas]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"video\",{ref:ref,muted:true,loop:true,playsInline:true,disablePictureInPicture:true,preload:\"none\",poster:poster||undefined,\"aria-hidden\":\"true\",\"data-rw-video\":\"\",\"data-src\":src||undefined,\"data-small\":small||undefined,...canvas&&!poster?{src:src||small,preload:\"metadata\"}:{},style:{width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\",borderRadius:radius,...style}}),canvas?null:/*#__PURE__*/_jsx(\"script\",{dangerouslySetInnerHTML:{__html:EARLY}})]});}Video.defaultProps={src:\"\",small:\"\",poster:\"\",fit:\"cover\",radius:0};addPropertyControls(Video,{src:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\"]},small:{type:ControlType.File,title:\"Phone Video\",allowedFileTypes:[\"mp4\",\"webm\"]},poster:{type:ControlType.Image,title:\"Poster\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\"],defaultValue:\"cover\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:100,defaultValue:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Video\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Video.map"],"mappings":"A,4NASG,SAAwBiB,EAAM,EAAM,CAAC,GAAK,CAAC,MAAI,QAAM,SAAO,MAAI,SAAO,SAAOC,EAAYC,EAAInB,EAAO,IAAI,EAAQoB,EAAON,EAAa,QAAQ,IAAIA,EAAa,OAQkR,OAR3QF,MAAc,CAAC,IAAMS,EAAEF,EAAI,QAAQ,GAAG,CAACE,GAAGD,GAAQ,EAAEE,GAAKC,GAAO,OAAO,IAAMC,EAAMnB,EAAO,WAAW,kCAAkC,CAAC,CAAC,SAAS,CAAC,CAACD,EAAU,YAAY,SAC7UqB,EAAK,EACHC,MAASH,GAAOlB,EAAO,WAAWsB,CAAK,CAAC,CAAC,QAAQJ,EAAMD,GAAKC,EAAYK,MAAW,CAAIP,EAAE,aAAa,KAAK,IAAS,EAAE,QAAQ,OAA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