{"version":3,"file":"VideoBackground.DpX4CRc2.mjs","names":["React.useRef","React.useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","le","_e","p","c","init_jsx_runtime","ce","de","init_framer_B1b760uK","RenderTarget","ControlType","addPropertyControls","VideoBackground","props","isCanvas","rootRef","videoRef","reduced","setReduced","mq","onChange","fillParent","wrapper","section","el","tryPlay","io","e","entries","src","mediaStyle","focus","grayscale","style","poster","overlay","init_VideoBackground"],"sources":["https:/framerusercontent.com/modules/EGSFuaPoIvvzyNqxscqK/iBOT58qcmxhLQp8pyUtr/VideoBackground.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Full-bleed hero backdrop: a looping video, or a static photo.\n *\n * Drop it in as the first child of a hero stack. The footage plays as shot,\n * with a single flat black layer over it so white headline text stays\n * readable over any frame. No colour wash: the client asked for the footage\n * to read as itself rather than being tinted.\n *\n * STATIC PHOTO HEROES. Leave Video URL empty and set Poster URL, and this\n * renders as a still photo hero. That is the client's rule from the\n * 2026-08-18 review: the looping video belongs to the homepage alone and\n * every other page gets a static photo with the same wording, fonts and\n * layout over it. Poster is also what shows under prefers-reduced-motion,\n * so a hero that does keep its video should always carry one anyway.\n *\n * Focus sets object-position. It matters more here than anywhere else on the\n * site: a hero crops almost nothing at desktop width and crops most of the\n * frame on a phone, and River Oaks' photography puts faces in the upper\n * third, so a centred crop lands on torsos. Default is a slight upward bias.\n *\n * Like AuroraBackground, it pins its own Framer wrapper at runtime: canvas\n * pin values do not survive MCP writes, so setting left/top on the instance\n * is not reliable.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 800\n */export default function VideoBackground(props){const{src,poster,focus,grayscale,overlay,fillParent,style}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const rootRef=React.useRef(null);const videoRef=React.useRef(null);const[reduced,setReduced]=React.useState(false);React.useEffect(()=>{if(typeof window===\"undefined\"||!window.matchMedia)return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const onChange=()=>setReduced(mq.matches);onChange();mq.addEventListener(\"change\",onChange);return()=>mq.removeEventListener(\"change\",onChange);},[]);// Canvas-set pins don't survive MCP writes, so at runtime we pin the\n// Framer wrapper element ourselves to fill the parent section.\nReact.useLayoutEffect(()=>{if(isCanvas||!fillParent||!rootRef.current)return;const wrapper=rootRef.current.parentElement;if(!wrapper||wrapper===document.body)return;Object.assign(wrapper.style,{position:\"absolute\",top:\"0px\",left:\"0px\",right:\"0px\",bottom:\"0px\",width:\"100%\",height:\"100%\",maxWidth:\"none\",transform:\"none\",pointerEvents:\"none\",zIndex:\"0\"});const section=wrapper.parentElement;if(section&&getComputedStyle(section).position===\"static\"){section.style.position=\"relative\";}},[isCanvas,fillParent]);// Autoplay is refused for anything mounted below the fold and is never\n// retried, so play on intersection instead. Pausing offscreen also stops\n// heroes on long pages from decoding video nobody is looking at.\nReact.useEffect(()=>{const el=videoRef.current;if(!el||reduced)return;const tryPlay=()=>{const p=el.play();if(p&&typeof p.catch===\"function\")p.catch(()=>{});};tryPlay();if(typeof window===\"undefined\"||!(\"IntersectionObserver\"in window))return;const io=new IntersectionObserver(entries=>{for(const e of entries){if(e.isIntersecting)tryPlay();else el.pause();}},{rootMargin:\"120px\"});io.observe(el);return()=>io.disconnect();},[reduced,src]);const mediaStyle={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:focus||\"center 35%\",filter:grayscale?\"grayscale(100%)\":\"none\"};return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,\"aria-hidden\":true,style:{width:\"100%\",height:\"100%\",overflow:\"hidden\",pointerEvents:\"none\",backgroundColor:\"#000000\",...style},children:[src&&!reduced?/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:src,poster:poster||undefined,autoPlay:true,muted:true,loop:true,playsInline:true,preload:\"auto\",tabIndex:-1,style:mediaStyle}):poster?/*#__PURE__*/_jsx(\"img\",{src:poster,alt:\"\",decoding:\"async\",style:mediaStyle}):null,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:`rgba(0, 0, 0, ${overlay})`}})]});}addPropertyControls(VideoBackground,{src:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\",description:\"Muted looping mp4. LEAVE EMPTY for a static photo hero and set Poster URL instead.\"},poster:{type:ControlType.String,title:\"Photo URL\",defaultValue:\"\",description:\"The still image. Used as the whole hero when Video URL is empty, and as the poster/reduced-motion frame when it is not.\"},focus:{type:ControlType.String,title:\"Focus\",defaultValue:\"\",description:\"CSS object-position, e.g. 'center 30%' or 'right 40%'. Defaults to center 35%.\"},grayscale:{type:ControlType.Boolean,title:\"Black & White\",defaultValue:false},overlay:{type:ControlType.Number,title:\"Black Overlay\",min:0,max:1,step:.05,defaultValue:.3,description:\"Opacity of the black layer over the media\"},fillParent:{type:ControlType.Boolean,title:\"Fill Section\",defaultValue:true,description:\"Pin itself to fill the parent section at runtime\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoBackground\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"1200\",\"framerIntrinsicHeight\":\"800\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoBackground.map"],"mappings":"A,4NA4BG,SAAwBiB,EAAgB,EAAM,CAAC,GAAK,CAAC,MAAI,SAAO,QAAM,YAAU,UAAQ,aAAW,SAAOC,EAAYC,EAASL,EAAa,QAAQ,IAAIA,EAAa,OAAaM,EAAQpB,EAAa,IAAI,EAAQqB,EAASrB,EAAa,IAAI,EAAO,CAACsB,EAAQC,GAAYtB,EAAe,EAAK,EAAEU,MAAoB,CAAC,GAAUN,IAAS,Q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