{"version":3,"file":"VimeoPlayer.Cih48adn.mjs","names":["useRef","useState","useEffect","startTransition","_jsxs","_jsx","_Fragment","__esmMin","window","te","init_ssg_sandbox_shims","l","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","init_framer_BWzg2IRg","addPropertyControls","ControlType","useInView","init_framer_motion_1EwlFBEG","VimeoPlayer","props","vimeoUrl","showControls","loop","showButton","buttonPosition","buttonColor","buttonBackground","buttonSize","autoplay","iframeRef","containerRef","isMuted","setIsMuted","isPlaying","setIsPlaying","isReady","setIsReady","wasPlayingBeforeLeaving","setWasPlayingBeforeLeaving","wasMutedBeforeLeaving","setWasMutedBeforeLeaving","isInView","isNearView","videoId","url","match","videoHash","iframe","handleMessage","event","toggleMute","newMutedState","getButtonPosition","embedUrl","init_VimeoPlayer"],"sources":["https:/framerusercontent.com/modules/VbaBZACVy6PIHPIugmti/0jhwVuaLFfLs0H9rOR7h/VimeoPlayer.js"],"sourcesContent":["// Custom Vimeo player with mute/unmute toggle that maintains playback state\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useInView}from\"framer-motion\";/**\n * Custom Vimeo Player with Mute Toggle\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VimeoPlayer(props){const{vimeoUrl=\"https://vimeo.com/76979871\",showControls=true,loop=false,showButton=true,buttonPosition=\"bottom-right\",buttonColor=\"#FFFFFF\",buttonBackground=\"rgba(0, 0, 0, 0.5)\",buttonSize=48,autoplay=true}=props;const iframeRef=useRef(null);const containerRef=useRef(null);const[isMuted,setIsMuted]=useState(true);const[isPlaying,setIsPlaying]=useState(true);const[isReady,setIsReady]=useState(false);const[wasPlayingBeforeLeaving,setWasPlayingBeforeLeaving]=useState(true);const[wasMutedBeforeLeaving,setWasMutedBeforeLeaving]=useState(true);const isInView=useInView(containerRef,{amount:.5});/*\n     * Defer mounting the Vimeo iframe until the player approaches the\n     * viewport - otherwise every player on the page starts streaming at\n     * load time, which wrecks mobile LCP. once:true keeps it mounted after.\n     */const isNearView=useInView(containerRef,{margin:\"600px 0px 600px 0px\",once:true});// Extract video ID from Vimeo URL\nconst extractVideoId=url=>{// Handle various Vimeo URL formats:\n// https://vimeo.com/123456789\n// https://vimeo.com/channels/staffpicks/123456789\n// https://player.vimeo.com/video/123456789\nconst match=url.match(/(?:vimeo\\.com\\/|video\\/)(\\d+)/);return match?match[1]:\"76979871\";};const videoId=extractVideoId(vimeoUrl);// Unlisted videos ship a privacy hash as a second path segment:\n// https://vimeo.com/123456789/abcdef1234 -> player needs ?h=abcdef1234\nconst extractVideoHash=url=>{const match=url.match(/vimeo\\.com\\/\\d+\\/([0-9a-zA-Z]+)/);return match?match[1]:null;};const videoHash=extractVideoHash(vimeoUrl);useEffect(()=>{if(typeof window===\"undefined\")return;const iframe=iframeRef.current;if(!iframe)return;const handleMessage=event=>{if(event.origin!==\"https://player.vimeo.com\")return;try{const data=JSON.parse(event.data);if(data.event===\"ready\"){startTransition(()=>setIsReady(true));// Set initial muted state and autoplay\niframe.contentWindow?.postMessage(JSON.stringify({method:\"setVolume\",value:0}),\"*\");iframe.contentWindow?.postMessage(JSON.stringify({method:\"play\"}),\"*\");}}catch(e){// Ignore parsing errors\n}};window.addEventListener(\"message\",handleMessage);return()=>{window.removeEventListener(\"message\",handleMessage);};},[isNearView]);const toggleMute=()=>{const iframe=iframeRef.current;if(!iframe||!isReady)return;const newMutedState=!isMuted;iframe.contentWindow?.postMessage(JSON.stringify({method:\"setVolume\",value:newMutedState?0:1}),\"*\");startTransition(()=>setIsMuted(newMutedState));};const getButtonPosition=()=>{const offset=16;switch(buttonPosition){case\"top-left\":return{top:offset,left:offset};case\"top-right\":return{top:offset,right:offset};case\"bottom-left\":return{bottom:offset,left:offset};case\"bottom-right\":return{bottom:offset,right:offset};}};const embedUrl=`https://player.vimeo.com/video/${videoId}?autoplay=1&muted=1&controls=${showControls?1:0}&loop=${loop?1:0}&autopause=0&dnt=1${videoHash?`&h=${videoHash}`:\"\"}`;useEffect(()=>{if(typeof window===\"undefined\")return;const iframe=iframeRef.current;if(!iframe)return;const handleMessage=event=>{if(event.origin!==\"https://player.vimeo.com\")return;try{const data=JSON.parse(event.data);if(data.event===\"ready\"){startTransition(()=>setIsReady(true));// Set initial muted state\niframe.contentWindow?.postMessage(JSON.stringify({method:\"setVolume\",value:0}),\"*\");// Control initial playback based on autoplay prop\nif(autoplay){iframe.contentWindow?.postMessage(JSON.stringify({method:\"play\"}),\"*\");}}}catch(e){// Ignore parsing errors\n}};window.addEventListener(\"message\",handleMessage);return()=>{window.removeEventListener(\"message\",handleMessage);};},[autoplay,isNearView]);// Control playback when autoplay prop changes\nuseEffect(()=>{const iframe=iframeRef.current;if(!iframe||!isReady)return;iframe.contentWindow?.postMessage(JSON.stringify({method:autoplay?\"play\":\"pause\"}),\"*\");},[autoplay,isReady]);// Handle viewport visibility changes\nuseEffect(()=>{const iframe=iframeRef.current;if(!iframe||!isReady)return;if(!isInView){// Save current state before leaving viewport\nsetWasPlayingBeforeLeaving(isPlaying);setWasMutedBeforeLeaving(isMuted);// Pause and mute when leaving viewport\niframe.contentWindow?.postMessage(JSON.stringify({method:\"pause\"}),\"*\");iframe.contentWindow?.postMessage(JSON.stringify({method:\"setVolume\",value:0}),\"*\");startTransition(()=>{setIsPlaying(false);setIsMuted(true);});}else{// Restore previous state when entering viewport\nif(wasPlayingBeforeLeaving){iframe.contentWindow?.postMessage(JSON.stringify({method:\"play\"}),\"*\");startTransition(()=>setIsPlaying(true));}if(!wasMutedBeforeLeaving){iframe.contentWindow?.postMessage(JSON.stringify({method:\"setVolume\",value:1}),\"*\");startTransition(()=>setIsMuted(false));}}},[isInView,isReady]);return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:[isNearView?/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:embedUrl,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",border:\"none\"},allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true,title:\"Vimeo video player\"}):/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{position:\"absolute\",inset:0,background:\"#0F0F13\"}}),showButton&&/*#__PURE__*/_jsx(\"button\",{onClick:toggleMute,style:{position:\"absolute\",...getButtonPosition(),width:buttonSize,height:buttonSize,borderRadius:\"50%\",backgroundColor:buttonBackground,border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,transition:\"transform 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.transform=\"scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"scale(1)\";},\"aria-label\":isMuted?\"Unmute video\":\"Mute video\",children:/*#__PURE__*/_jsx(\"svg\",{width:buttonSize*.5,height:buttonSize*.5,viewBox:\"0 0 24 24\",fill:\"none\",stroke:buttonColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:isMuted?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"polygon\",{points:\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"23\",y1:\"9\",x2:\"17\",y2:\"15\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"17\",y1:\"9\",x2:\"23\",y2:\"15\"})]}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"polygon\",{points:\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M15.54 8.46a5 5 0 0 1 0 7.07\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M19.07 4.93a10 10 0 0 1 0 14.14\"})]})})})]});}addPropertyControls(VimeoPlayer,{vimeoUrl:{type:ControlType.String,title:\"Vimeo URL\",defaultValue:\"https://vimeo.com/76979871\",placeholder:\"https://vimeo.com/76979871\"},showControls:{type:ControlType.Boolean,title:\"Show Controls\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},showButton:{type:ControlType.Boolean,title:\"Mute Button\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},buttonPosition:{type:ControlType.Enum,title:\"Button Position\",options:[\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"],optionTitles:[\"Top Left\",\"Top Right\",\"Bottom Left\",\"Bottom Right\"],defaultValue:\"bottom-right\",hidden:({showButton})=>!showButton},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#FFFFFF\",hidden:({showButton})=>!showButton},buttonBackground:{type:ControlType.Color,title:\"Button Background\",defaultValue:\"rgba(0, 0, 0, 0.5)\",hidden:({showButton})=>!showButton},buttonSize:{type:ControlType.Number,title:\"Button Size\",defaultValue:48,min:32,max:80,step:4,unit:\"px\",hidden:({showButton})=>!showButton},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true,enabledTitle:\"Play\",disabledTitle:\"Pause\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VimeoPlayer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VimeoPlayer.map"],"mappings":"A,4QAMG,SAAwBwB,EAAYC,EAAM,CAAC,GAAK,CAACC,WAAS,6BAA6BC,eAAa,GAAKC,OAAK,GAAMC,aAAW,GAAKC,iBAAe,eAAeC,cAAY,UAAUC,mBAAiB,qBAAqBC,aAAW,GAAGC,WAAS,IAAMT,EAAYU,EAAUnC,EAAO,IAAI,EAAQoC,EAAap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