{"version":3,"file":"GuideVideoPlayer.CSzGZqyZ.mjs","names":["React.useRef","React.useState","__esmMin","init_npm_react_18_3_1","_e","p","c","init_jsx_runtime","ce","de","init_framer_BWFVvmND","addPropertyControls","ControlType","GuideVideoPlayer","video","started","setStarted","error","setError","videoFile","play","result","style","title","poster","accent","background","init_GuideVideoPlayer"],"sources":["https:/framerusercontent.com/modules/DCkfEt5SQvkNBvD3Yyoi/Mqj6k4p0bubHpjzTCzrF/GuideVideoPlayer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 1280\n * @framerIntrinsicHeight 744\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function GuideVideoPlayer({videoFile=\"\",poster,background=\"#FFF1E3\",accent=\"#FFC38A\",title=\"guide video\",style}){const video=React.useRef(null);const[started,setStarted]=React.useState(false);const[error,setError]=React.useState(\"\");React.useEffect(()=>{setStarted(false);setError(\"\");},[videoFile]);const play=()=>{if(!video.current||!videoFile)return;setError(\"\");const result=video.current.play();if(result)result.catch(()=>{setStarted(false);setError(\"Unable to play this video. Please try again.\");});};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",background,borderRadius:\"inherit\"},children:[/*#__PURE__*/_jsx(\"style\",{children:\".wl-guide-play:focus-visible{outline:3px solid #202020;outline-offset:-6px}.wl-guide-play:not(:disabled):hover span{transform:scale(1.06)}@media(prefers-reduced-motion:reduce){.wl-guide-play span{transition:none!important}}\"}),videoFile&&/*#__PURE__*/_jsx(\"video\",{ref:video,src:videoFile,preload:\"none\",playsInline:true,controls:started,autoPlay:false,\"aria-label\":title,onPlay:()=>setStarted(true),onEnded:()=>setStarted(false),onError:()=>{setStarted(false);setError(\"Unable to load this video. Please try again later.\");},style:{display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"contain\",background:\"#000\",opacity:started?1:0}},videoFile),!started&&/*#__PURE__*/_jsx(\"button\",{className:\"wl-guide-play\",type:\"button\",disabled:!videoFile,\"aria-label\":videoFile?\"Play \"+title:\"Video not available\",onClick:play,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:0,padding:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background,backgroundImage:poster?.src?\"url(\"+JSON.stringify(poster.src)+\")\":undefined,backgroundPosition:\"center\",backgroundSize:\"cover\",cursor:videoFile?\"pointer\":\"default\"},children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"clamp(64px, 8vw, 100px)\",height:\"clamp(64px, 8vw, 100px)\",borderRadius:\"50%\",background:accent,transition:\"transform 150ms ease\"},children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 48 48\",width:\"48%\",height:\"48%\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 7 Q12 5 12 10 V38 Q12 43 16 40 L42 25 Q46 22 42 19 Z\",fill:background})})})}),error&&/*#__PURE__*/_jsx(\"p\",{role:\"alert\",style:{position:\"absolute\",bottom:16,left:16,right:16,margin:0,padding:\"12px 16px\",background:\"white\",color:\"#202020\",fontFamily:\"sans-serif\",fontSize:14,textAlign:\"center\"},children:error})]});}addPropertyControls(GuideVideoPlayer,{videoFile:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},poster:{type:ControlType.ResponsiveImage,title:\"Cover Image\"},title:{type:ControlType.String,title:\"Video Title\",defaultValue:\"guide video\"},background:{type:ControlType.Color,title:\"Cover Colour\",defaultValue:\"#FFF1E3\"},accent:{type:ControlType.Color,title:\"Play Colour\",defaultValue:\"#FFC38A\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GuideVideoPlayer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1280\",\"framerIntrinsicHeight\":\"744\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GuideVideoPlayer.map"],"mappings":"A,+LAKG,SAAwBa,EAAiB,CAAC,YAAU,GAAG,SAAO,aAAW,UAAU,SAAO,UAAU,QAAM,cAAc,SAAO,CAAC,IAAMC,EAAMd,EAAa,IAAI,EAAO,CAACe,EAAQC,GAAYf,EAAe,EAAK,EAAO,CAACgB,EAAMC,GAAUjB,EAAe,EAAE,EAAEO,MAAoB,CAACQ,EAAW,EAAK,EAAEE,EAAS,EAAE,CAAE,EAAE,CAACC,CAAS,CAAC,EAAE,IAAMC,MAAS,CAAC,GAAG,CAACN,EAAM,SAAS,CAACK,EAAU,OAAOD,EAAS,EAAE,EAAE,IAAMG,EAAOP,EAAM,QAAQ,KAAK,EAAKO,GAAOA,EAAO,UAAU,CAACL,EAAW,EAAK,EAAEE,EAAS,8CAA8C,CAAE,CAAC,CAAE,EAAE,MAAoB,gBAAM,MAAM,CAAC,MAAM,CAAC,GAAGI,EAAM,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,aAAW,aAAa,SAAS,EAAE,SAAS,CAAc,gBAAK,QAAQ,CAAC,SAAS,iOAAiO,CAAC,EAAEH,GAAwB,gBAAK,QAAQ,CAAC,IAAIL,EAAM,IAAIK,EAAU,QAAQ,OAAO,YAAY,GAAK,SAASJ,EAAQ,SAAS,GAAM,aAAaQ,EAAM,WAAWP,EAAW,EAAI,EAAE,YAAYA,EAAW,EAAK,EAAE,YAAY,CAACA,EAAW,EAAK,EAAEE,EAAS,oDAAoD,CAAE,EAAE,MAAM,CAAC,QAAQ,QAAQ,MAAM,OAAO,OAAO,OAAO,UAAU,UAAU,WAAW,OAAO,QAAQ,IAAW,CAAC,EAAEC,CAAS,EAAE,CAACJ,GAAsB,gBAAK,SAAS,CAAC,UAAU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