{"version":3,"file":"MasterclassOverlay.CvG0-Jbx.mjs","names":["useState","useRef","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/B1hZaHi8H5KYC33SRyNv/Av5DosaZttAY0SvcJAXc/MasterclassOverlay.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function MasterclassOverlay(props){const{overlayBackground=\"rgba(0, 0, 0, 0.8)\",bottomBackground=\"rgb(39, 80, 69)\",copyColor=\"#FFFFFF\",copyText=\"Leave your email and get access to the next masterclass now!\"}=props;const[isVisible,setIsVisible]=useState(false);const[iframeHeight,setIframeHeight]=useState(\"200px\");const videoRef=useRef(null);const iframeRef=useRef(null);const shouldShowFromUrl=useCallback(()=>{if(typeof window!==\"undefined\"){const{search,hash}=window.location;const params=new URLSearchParams(search);return params.get(\"play\")===\"masterclass\"||hash===\"#watch-masterclass\";}return false;},[]);useEffect(()=>{const updateVisibility=()=>{startTransition(()=>setIsVisible(shouldShowFromUrl()));};if(typeof window!==\"undefined\"){updateVisibility();window.addEventListener(\"popstate\",updateVisibility);window.addEventListener(\"hashchange\",updateVisibility);return()=>{window.removeEventListener(\"popstate\",updateVisibility);window.removeEventListener(\"hashchange\",updateVisibility);};}return undefined;},[shouldShowFromUrl]);useEffect(()=>{if(!isVisible)return;const video=videoRef.current;if(!video)return;void video.play().catch(()=>{});},[isVisible]);useEffect(()=>{if(typeof window===\"undefined\")return;const handler=e=>{if(e.data?.type===\"hsFormHeight\"){const nextHeight=`${e.data.height+20}px`;startTransition(()=>setIframeHeight(nextHeight));}};window.addEventListener(\"message\",handler);return()=>window.removeEventListener(\"message\",handler);},[]);const closeOverlay=useCallback(()=>{if(typeof window!==\"undefined\"){const url=new URL(window.location.href);const params=new URLSearchParams(url.search);if(params.get(\"play\")===\"masterclass\"){params.delete(\"play\");}if(url.hash===\"#watch-masterclass\"){url.hash=\"\";}const search=params.toString();const nextUrl=`${url.pathname}${search?`?${search}`:\"\"}${url.hash}`;window.history.pushState({},\"\",nextUrl);}startTransition(()=>setIsVisible(false));},[]);const overlayStyle=useMemo(()=>({position:\"fixed\",inset:0,zIndex:9999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:overlayBackground}),[overlayBackground]);const videoStyle=useMemo(()=>({width:\"60%\",maxWidth:\"900px\",height:\"auto\",aspectRatio:\"16 / 9\",display:\"block\",borderRadius:\"6px\"}),[]);const contentStyle=useMemo(()=>({width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:\"24px\"}),[]);const bottomSectionStyle=useMemo(()=>({width:\"100%\",display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:\"space-between\",gap:\"48px\",padding:\"16px 112px\",background:bottomBackground,boxSizing:\"border-box\"}),[bottomBackground]);const copyStyle=useMemo(()=>({color:copyColor,fontSize:\"20px\",fontFamily:\"Gilroy-SemiBold\",lineHeight:1.44,margin:0,flex:\"0 1 auto\"}),[copyColor]);const formContainerWrapStyle=useMemo(()=>({width:\"100%\",maxWidth:\"560px\",minWidth:0,flex:\"1 1 auto\"}),[]);const closeButtonStyle=useMemo(()=>({position:\"absolute\",top:\"20px\",right:\"24px\",background:\"transparent\",border:\"none\",color:\"#FFFFFF\",fontFamily:'-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif',fontSize:\"32px\",lineHeight:1,cursor:\"pointer\",padding:0}),[]);if(!isVisible)return null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsxs(\"div\",{style:overlayStyle,onClick:closeOverlay,role:\"dialog\",\"aria-modal\":\"true\",children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Close masterclass video\",style:closeButtonStyle,onClick:closeOverlay,children:\"\\xd7\"}),/*#__PURE__*/_jsxs(\"div\",{onClick:event=>event.stopPropagation(),style:contentStyle,children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:\"https://framerusercontent.com/assets/jKpis5XsNeRxbivBlRS1Yc4ZKNY.mp4\",autoPlay:true,controls:true,muted:true,playsInline:true,style:videoStyle}),/*#__PURE__*/_jsxs(\"div\",{style:bottomSectionStyle,children:[/*#__PURE__*/_jsx(\"p\",{style:copyStyle,children:copyText}),/*#__PURE__*/_jsx(\"div\",{style:formContainerWrapStyle,children:/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,srcDoc:`<!DOCTYPE html>\n<html>\n<head>\n<style>\n  body { margin: 0; padding: 0; background: transparent; font-family: Gilroy-SemiBold, sans-serif; }\n  .hs-form-field label { color: white; font-size: 14px; }\n  .hs-form-field input { background: white; color: #111; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px; padding: 10px 14px; font-size: 15px; width: 100%; box-sizing: border-box; }\n  .hs-button { background: #111111; color: white; border: none; border-radius: 6px; padding: 10px 20px; font-size: 15px; cursor: pointer; width: 100%; margin-top: 8px; }\n  .hs-error-msgs label { color: #ff6b6b; }\n  * { color: white; }\n</style>\n</head>\n<body>\n<script charset=\"utf-8\" type=\"text/javascript\" src=\"//js.hsforms.net/forms/embed/v2.js\"></script>\n<script>\n  hbspt.forms.create({ region: \"eu1\", portalId: \"144557791\", formId: \"c7f50ab1-4b46-478b-82a9-431512c0b361\" });\n  function sendHeight() {\n    window.parent.postMessage({ type: 'hsFormHeight', height: document.body.scrollHeight }, '*');\n  }\n  // Send after form renders\n  setTimeout(sendHeight, 800);\n  // Also send on any DOM changes\n  new MutationObserver(sendHeight).observe(document.body, { childList: true, subtree: true });\n</script>\n</body>\n</html>`,style:{width:\"100%\",height:iframeHeight,border:\"none\",background:\"transparent\"},title:\"Masterclass signup form\"})})]})]})]})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MasterclassOverlay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MasterclassOverlay.map"],"mappings":"qKAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,oBAAkB,qBAAqB,mBAAiB,kBAAkB,YAAU,UAAU,WAAS,gEAAgE,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAa,GAAiBA,EAAS,OAAO,EAAQ,EAASC,EAAO,IAAI,EAAQ,EAAUA,EAAO,IAAI,EAAQ,EAAkBC,MAAgB,CAAC,GAAU,IAAS,OAAY,CAAC,GAAK,CAAC,SAAO,QAAM,EAAO,SAAkD,OAAO,IAA/B,gBAAgB,CAAoB,CAAC,CAAC,IAAI,MAAM,IAAI,eAAe,IAAO,oBAAqB,CAAC,MAAO,EAAM,EAAE,CAAC,CAAC,EAAE,MAAc,CAAC,IAAM,MAAqB,CAAC,MAAoB,EAAa,EAAkB,CAAC,CAAC,CAAE,EAAE,GAAU,IAAS,OAA4I,OAA/H,EAAiB,EAAE,EAAO,iBAAiB,WAAW,CAAgB,EAAE,EAAO,iBAAiB,aAAa,CAAgB,MAAY,CAAC,EAAO,oBAAoB,WAAW,CAAgB,EAAE,EAAO,oBAAoB,aAAa,CAAgB,CAAE,CAAoB,EAAE,CAAC,CAAiB,CAAC,EAAE,MAAc,CAAC,GAAG,CAAC,EAAU,OAAO,IAAM,EAAM,EAAS,QAAY,GAAa,EAAW,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,CAAE,EAAE,CAAC,CAAS,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,OAAO,eAAe,CAAC,IAAM,EAAW,GAAG,EAAE,KAAK,OAAO,GAAG,IAAI,MAAoB,EAAgB,CAAU,CAAC,C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