{"version":3,"file":"InlineVimeoPoster.BKaUYdfM.mjs","names":["useState","useRef","useMemo","useEffect","customEvent","startTransition","useCallback","_jsx","_jsxs","_Fragment","__esmMin","pe","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","te","window","l","_e","c","init_jsx_runtime","ce","de","addPropertyControls","init_framer_BWzg2IRg","ControlType","withIframeParams","url","parsed","InlineVimeoPoster","props","posterImageUrl","title","vimeoPlayerUrl","playLabel","compactRow","background","playButtonBackground","playButtonTextColor","borderRadius","onPlayStart","isPlaying","setIsPlaying","instanceIdRef","iframeSrc","handleOtherPlayback","event","sourceId","INLINE_VIMEO_PLAY_EVENT","startPlayback","handleKeyDown","p","init_InlineVimeoPoster"],"sources":["https:/framerusercontent.com/modules/2E5c5QTTDpBY7BXOTNvs/zeWvaijMN8LjGz0lnTNW/InlineVimeoPoster.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const INLINE_VIMEO_PLAY_EVENT=\"freshground:inline-vimeo-play\";function withIframeParams(url){try{const parsed=new URL(url);parsed.searchParams.set(\"controls\",\"1\");parsed.searchParams.set(\"autoplay\",\"0\");return parsed.toString();}catch(_error){return url;}}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function InlineVimeoPoster(props){const{posterImageUrl=\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",title=\"Supporting Film\",vimeoPlayerUrl=\"https://player.vimeo.com/video/76979871\",playLabel=\"Play film\",compactRow=false,background=\"#0F2A1F\",playButtonBackground=\"#C26A2A\",playButtonTextColor=\"#FFF6E8\",borderRadius=\"14px\",onPlayStart}=props;const[isPlaying,setIsPlaying]=useState(false);const instanceIdRef=useRef(`inline-vimeo-${Math.random().toString(36).slice(2,11)}`);const iframeSrc=useMemo(()=>withIframeParams(vimeoPlayerUrl),[vimeoPlayerUrl]);useEffect(()=>{if(typeof window===\"undefined\")return;const handleOtherPlayback=event=>{const customEvent=event;const sourceId=customEvent.detail?.instanceId;if(!sourceId||sourceId===instanceIdRef.current)return;startTransition(()=>setIsPlaying(false));};window.addEventListener(INLINE_VIMEO_PLAY_EVENT,handleOtherPlayback);return()=>{window.removeEventListener(INLINE_VIMEO_PLAY_EVENT,handleOtherPlayback);};},[]);const startPlayback=useCallback(()=>{if(isPlaying)return;if(typeof window!==\"undefined\"){window.dispatchEvent(new CustomEvent(INLINE_VIMEO_PLAY_EVENT,{detail:{instanceId:instanceIdRef.current}}));}startTransition(()=>setIsPlaying(true));onPlayStart?.();},[isPlaying,onPlayStart]);const handleKeyDown=useCallback(event=>{if(event.key===\"Enter\"||event.key===\" \"){event.preventDefault();startPlayback();}},[startPlayback]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:compactRow&&!isPlaying?undefined:\"16 / 9\",background,borderRadius,overflow:\"hidden\",borderTop:compactRow&&!isPlaying?\"1px solid rgba(255, 246, 232, 0.22)\":undefined},children:isPlaying?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"iframe\",{src:iframeSrc,title:title,style:{width:\"100%\",height:\"100%\",border:\"0\",display:\"block\"},allow:\"fullscreen; picture-in-picture; encrypted-media\",allowFullScreen:true}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,backgroundColor:\"rgba(245,245,245,0.15)\",pointerEvents:\"none\"}})]}):compactRow?/*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-label\":`${playLabel}: ${title}`,onClick:startPlayback,onKeyDown:handleKeyDown,style:{width:\"100%\",minHeight:48,padding:\"12px 0\",border:\"0\",background:\"transparent\",color:playButtonTextColor,display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:16,cursor:\"pointer\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:playButtonTextColor,fontSize:15,fontWeight:500,letterSpacing:\"-0.01em\",lineHeight:1.2,textAlign:\"left\"},children:title}),/*#__PURE__*/_jsx(\"span\",{style:{color:playButtonBackground,fontSize:14,fontWeight:600,letterSpacing:\"-0.01em\",lineHeight:1,whiteSpace:\"nowrap\"},children:playLabel})]}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"img\",{src:posterImageUrl,alt:\"\",\"aria-hidden\":\"true\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,backgroundColor:\"rgba(245,245,245,0.15)\",pointerEvents:\"none\"}}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":`${playLabel}: ${title}`,onClick:startPlayback,onKeyDown:handleKeyDown,style:{position:\"absolute\",inset:\"0\",margin:\"auto\",width:\"fit-content\",height:\"fit-content\",minHeight:48,minWidth:48,padding:\"12px 18px\",borderRadius:\"999px\",border:\"1px solid rgba(255, 246, 232, 0.45)\",background:playButtonBackground,color:playButtonTextColor,fontSize:14,fontWeight:600,letterSpacing:\"-0.01em\",lineHeight:1,cursor:\"pointer\",boxShadow:\"0 4px 16px rgba(0,0,0,0.25)\"},children:playLabel})]})});}addPropertyControls(InlineVimeoPoster,{posterImageUrl:{type:ControlType.String,title:\"Poster URL\",defaultValue:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Supporting Film\"},vimeoPlayerUrl:{type:ControlType.String,title:\"Vimeo URL\",defaultValue:\"https://player.vimeo.com/video/76979871\"},playLabel:{type:ControlType.String,title:\"Play Label\",defaultValue:\"Play film\"},compactRow:{type:ControlType.Boolean,title:\"Compact Row\",defaultValue:false},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0F2A1F\"},playButtonBackground:{type:ControlType.Color,title:\"Action BG\",defaultValue:\"#C26A2A\"},playButtonTextColor:{type:ControlType.Color,title:\"Action Text\",defaultValue:\"#FFF6E8\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"14px\"},onPlayStart:{type:ControlType.EventHandler,title:\"On Play\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InlineVimeoPoster\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./InlineVimeoPoster.map"],"mappings":"A,oOAAkR,SAAS0B,EAAiBC,EAAI,CAAC,GAAG,CAAC,IAAMC,EAAO,IAAI,IAAID,CAAG,EAAkF,OAAhFC,EAAO,aAAa,IAAI,WAAW,GAAG,EAAEA,EAAO,aAAa,IAAI,WAAW,GAAG,EAASA,EAAO,SAAS,CAAE,MAAc,CAAC,OAAOD,CAAI,CAAC,CAGhd,SAAwBE,EAAkBC,EAAM,CAAC,GAAK,CAACC,iBAAe,sEAAsEC,QAAM,kBAAkBC,iBAAe,0CAA0CC,YAAU,YAAYC,aAAW,GAAMC,aAAW,UAAUC,uBAAqB,UAAUC,sBAAoB,UAAUC,eAAa,OAAOC,eAAaV,EAAW,CAACW,EAAUC,GAAc1C,EAAS,EAAK,EAAQ2C,EAAc1C,EAAO,gBAAgB,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,EAAQ2C,EAAU1C,MAAYwB,EAAiBO,CAAc,EAAE,CAACA,CAAc,CAAC,EAAE9B,MAAc,CAAC,GAAUa,IAAS,OAAY,OAAO,IAAM6B,EAAoBC,GAAO,CAAyB,IAAMC,EAAS3C,EAAY,QAAQ,WAAe2C,GAAUA,IAAWJ,EAAc,SAAetC,MAAoBqC,EAAa,EAAK,CAAC,CAAE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