{"version":3,"file":"Popup.BCH4X-Rt.mjs","names":["__esmMin","init_jsx_runtime","J","c","init_npm_react_18_3_1","ce","createStore","init_store_js__1_0","withPageBlur","state","setState","usePopupState","timer","active","armTimer","handleClick","target","e","Component","props","init_Popup"],"sources":["https:/framerusercontent.com/modules/Vfu7zKP9fk9al4aj2q3a/VlpP50e0bgNvDOY0VYIw/Popup.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const usePopupState=createStore({open:false});// 1. Apply to your main Page container to handle the background blur\nexport function withPageBlur(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[state,setState]=usePopupState();useEffect(()=>{const timer=setTimeout(()=>{setState({open:true});},1e3);return()=>clearTimeout(timer);},[]);useEffect(()=>{if(!state.open)return;let active=false;const armTimer=setTimeout(()=>{active=true;},300);const handleClick=e=>{if(!active)return;const target=e.target;if(!target)return;if(!target.closest('[data-popup-marker=\"true\"]')){setState({open:false});}};document.addEventListener(\"click\",handleClick);return()=>{clearTimeout(armTimer);document.removeEventListener(\"click\",handleClick);};},[state.open]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,filter:state.open?\"blur(5px)\":\"none\",transition:\"filter 0.4s ease\"}});});}// 2. Apply to the main Popup/Banner frame component\nexport function withPopupMarker(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[state]=usePopupState();return /*#__PURE__*/_jsx(\"div\",{\"data-popup-marker\":\"true\",style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,display:state.open?\"flex\":\"none\",alignItems:\"center\",justifyContent:\"center\",pointerEvents:\"none\",zIndex:9999},children:/*#__PURE__*/_jsx(\"div\",{style:{pointerEvents:\"auto\"},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props})})});});}// 3. Apply this override directly to your \"X\" close button frame/icon\nexport function withCloseButton(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[,setState]=usePopupState();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:e=>{if(props.onClick)props.onClick(e);setState({open:false});}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCloseButton\":{\"type\":\"reactHoc\",\"name\":\"withCloseButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPageBlur\":{\"type\":\"reactHoc\",\"name\":\"withPageBlur\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPopupMarker\":{\"type\":\"reactHoc\",\"name\":\"withPopupMarker\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Popup.map"],"mappings":"A,iLACA,SAAgBQ,EAAa,EAAU,CAAC,MAAoB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAACC,EAAMC,GAAUC,EAAc,EAAugB,OAArgBN,MAAc,CAAC,IAAMO,EAAM,eAAe,CAACF,EAAS,CAAC,KAAK,EAAI,CAAC,CAAE,EAAE,GAAG,EAAE,UAAU,aAAaE,CAAK,CAAE,EAAE,CAAC,CAAC,EAAEP,MAAc,CAAC,GAAG,CAACI,EAAM,KAAK,OAAO,IAAII,EAAO,GAAYC,EAAS,eAAe,CAAC,EAAO,EAAK,EAAE,GAAG,EAAQC,EAAY,GAAG,CAAC,GAAG,CAACF,EAAO,OAAO,IAAMG,EAAOC,EAAE,OAAWD,IAAkBA,EAAO,QAAQ,4BAA4B,GAAGN,EAAS,CAAC,KAAK,EAAK,CAAC,EAAG,EAAiD,OAA/C,SAAS,iBAAiB,QAAQK,CAAW,MAAY,CAAC,aAAaD,CAAQ,EAAE,SAAS,oBAAoB,QAAQC,CAAW,CAAE,CAAE,EAAE,CAACN,EAAM,IAAI,CAAC,EAAsB,gBAAKS,EAAU,CAAK,MAAI,GAAGC,EAAM,MAAM,CAAC,GAAGA,EAAM,MAAM,OAAOV,EAAM,KAAK,YAAY,OAAO,WAAW,kBAAkB,CAAC,CAAC,CAAE,CAAC,CAAE,C,gDADtnB,EAAcH,EAAY,CAAC,KAAK,EAAK,CAAC,C"}