{"version":3,"file":"AcPopup.C4dO2ZeB.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/iKbBZAuvfcuKDjc3FZPi/QuJqZ6gGotL1KxaQPDGn/AcPopup.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState}from\"react\";import{createPortal}from\"react-dom\";// This file used to load ActiveCampaign embeds. It is now a native Framer\n// popup and loads nothing from ActiveCampaign. The file name and the Form ID\n// control are kept so every instance already placed on the site switched over\n// in one edit, instead of hunting the instance down on every page.\n//\n// Only id 37 (the app waitlist) shows anything. Every other id, including the\n// retired 35, renders nothing on the live site.\nconst WAITLIST_FORM=\"37\";// The product shot from the old AC form, still hosted on ActiveCampaign's file\n// store. Used until an image is set on the instance; swap it for a\n// Framer-hosted copy via the Image control and this stops mattering.\nconst FALLBACK_IMAGE=\"https://ivee44116.activehosted.com/content/QG9XJd/2026/10/06/f58b4b2d-a0de-4fcc-a107-7acb1192d031.png\";const NAVY=\"#25397a\";const LIME=\"#e9ff70\";const CREAM=\"#fffff5\";const STORAGE_KEY=\"ivee_waitlist_popup\";// Framer publishes every breakpoint into the DOM and hides the non-matching\n// ones with display:none, so this component can mount two or three times on a\n// single page view. Only the first mounted copy may own the popup.\nlet owner=null;function capture(event,properties){try{const ph=window.posthog;if(ph&&typeof ph.capture===\"function\")ph.capture(event,properties);}catch{// analytics is never worth an exception\n}}// Storage can throw in private windows or with site data blocked. A failure\n// means the popup may show again, which is better than it breaking the page.\nfunction readState(){try{return JSON.parse(localStorage.getItem(STORAGE_KEY)||\"{}\");}catch{return{};}}function writeState(state){try{localStorage.setItem(STORAGE_KEY,JSON.stringify(state));}catch{// see readState\n}}function isSuppressed(days){const state=readState();if(state.clicked)return true;if(!state.closedAt)return false;return Date.now()-state.closedAt<days*24*60*60*1e3;}/**\n * ivee Waitlist Popup (formerly the ActiveCampaign popup)\n *\n * A native modal promoting the AI Learning Companion waitlist. It opens after\n * a delay, a scroll depth or desktop exit intent, whichever comes first, and\n * sends the visitor to the waitlist page. A delay or scroll of 0 switches that\n * trigger off. Closing it hides it for a set number of days; clicking through\n * hides it for good on that browser.\n *\n * @framerIntrinsicWidth 260\n * @framerIntrinsicHeight 40\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function AcPopup(props){const{formId=WAITLIST_FORM,waitlistUrl=\"https://waitlist.ivee.club\",image,heading=\"BRAND NEW AI Learning Companion. Free Beta Access.\",body=\"The ivee AI Learning Companion is almost here. Join the waitlist and be first in for free beta access (while spots last).\",buttonLabel=\"Get Free Beta Access →\",delaySeconds=10,scrollPercent=50,exitIntent=true,daysBeforeShowingAgain=7}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const active=formId.trim()===WAITLIST_FORM;const imageSrc=image?.src||FALLBACK_IMAGE;const imageAlt=image?.alt||\"ivee improving a Claude prompt before it is sent\";const[open,setOpen]=useState(false);const[mounted,setMounted]=useState(false);const idRef=useRef(Symbol(\"waitlist-popup\"));const buttonRef=useRef(null);// Claim ownership and arm the triggers.\nuseEffect(()=>{if(isCanvas||!active||typeof window===\"undefined\")return;if(owner)return;owner=idRef.current;setMounted(true);if(isSuppressed(daysBeforeShowingAgain)){return()=>{if(owner===idRef.current)owner=null;};}let fired=false;const fire=trigger=>{if(fired)return;fired=true;cleanup();setOpen(true);capture(\"waitlist_popup_shown\",{trigger,page_path:window.location.pathname});};// 0 switches the timer off, matching the scroll control.\nconst timer=delaySeconds>0?window.setTimeout(()=>fire(\"delay\"),delaySeconds*1e3):undefined;const onScroll=()=>{const doc=document.documentElement;const max=doc.scrollHeight-window.innerHeight;if(max<=0)return;if(window.scrollY/max*100>=scrollPercent)fire(\"scroll\");};// Exit intent only makes sense with a mouse.\nconst onMouseOut=event=>{if(!event.relatedTarget&&event.clientY<=0)fire(\"exit_intent\");};const hasMouse=window.matchMedia?.(\"(pointer: fine)\").matches;if(scrollPercent>0)window.addEventListener(\"scroll\",onScroll,{passive:true});if(exitIntent&&hasMouse)document.addEventListener(\"mouseout\",onMouseOut);function cleanup(){if(timer!==undefined)window.clearTimeout(timer);window.removeEventListener(\"scroll\",onScroll);document.removeEventListener(\"mouseout\",onMouseOut);}return()=>{cleanup();if(owner===idRef.current)owner=null;};},[isCanvas,active,delaySeconds,scrollPercent,exitIntent,daysBeforeShowingAgain]);const close=how=>{setOpen(false);writeState({...readState(),closedAt:Date.now()});capture(\"waitlist_popup_closed\",{how,page_path:window.location.pathname});};// Escape closes, focus moves to the button, and the page behind stops\n// scrolling while the popup is up.\nuseEffect(()=>{if(!open)return;const onKey=event=>{if(event.key===\"Escape\")close(\"escape\");};document.addEventListener(\"keydown\",onKey);const previousOverflow=document.body.style.overflow;document.body.style.overflow=\"hidden\";buttonRef.current?.focus({preventScroll:true});return()=>{document.removeEventListener(\"keydown\",onKey);document.body.style.overflow=previousOverflow;};},[open]);if(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"8px 14px\",borderRadius:999,border:\"1px dashed rgba(37, 57, 122, 0.35)\",background:active?\"rgba(221, 238, 255, 0.6)\":\"rgba(255, 34, 68, 0.12)\",color:NAVY,fontFamily:\"Poppins, sans-serif\",fontSize:12,whiteSpace:\"nowrap\"},children:active?\"Waitlist popup - live site only\":\"Old AC form \"+formId+\" - does nothing, safe to delete\"});}if(!active||!mounted||!open||typeof document===\"undefined\")return null;return /*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{onClick:event=>{if(event.target===event.currentTarget)close(\"backdrop\");},style:{position:\"fixed\",inset:0,zIndex:2147483e3,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:16,background:\"rgba(16, 24, 52, 0.6)\",fontFamily:\"Poppins, sans-serif\"},children:/*#__PURE__*/_jsxs(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"ivee-waitlist-popup-title\",style:{position:\"relative\",width:\"100%\",maxWidth:520,maxHeight:\"90vh\",overflowY:\"auto\",boxSizing:\"border-box\",padding:\"clamp(24px, 6vw, 40px)\",borderRadius:24,background:NAVY,color:CREAM,textAlign:\"center\",boxShadow:\"0 24px 80px rgba(0, 0, 0, 0.35)\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Close\",onClick:()=>close(\"button\"),style:{position:\"absolute\",top:14,right:14,width:36,height:36,borderRadius:999,border:\"none\",background:CREAM,color:NAVY,fontSize:20,lineHeight:\"36px\",cursor:\"pointer\",padding:0},children:\"\\xd7\"}),/*#__PURE__*/_jsx(\"img\",{src:imageSrc,alt:imageAlt,style:{display:\"block\",width:\"100%\",height:\"auto\",margin:\"0 auto 20px\",borderRadius:12}}),/*#__PURE__*/_jsx(\"h2\",{id:\"ivee-waitlist-popup-title\",style:{margin:\"0 0 12px\",color:LIME,fontSize:\"clamp(24px, 5.5vw, 34px)\",lineHeight:1.15,fontWeight:700},children:heading}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 24px\",fontSize:16,lineHeight:1.5,color:CREAM},children:body}),/*#__PURE__*/_jsx(\"a\",{ref:buttonRef,href:waitlistUrl,target:\"_blank\",rel:\"noopener\",onClick:()=>{writeState({...readState(),clicked:true});capture(\"waitlist_popup_clicked\",{page_path:window.location.pathname});setOpen(false);},style:{display:\"block\",padding:\"16px 20px\",borderRadius:12,background:LIME,color:NAVY,fontSize:18,fontWeight:600,textDecoration:\"none\"},children:buttonLabel})]})}),document.body);}addPropertyControls(AcPopup,{formId:{type:ControlType.String,title:\"Form ID\",defaultValue:WAITLIST_FORM,description:\"37 shows the waitlist popup. Any other id shows nothing - those were old ActiveCampaign forms.\"},waitlistUrl:{type:ControlType.String,title:\"Button link\",defaultValue:\"https://waitlist.ivee.club\"},image:{type:ControlType.ResponsiveImage,title:\"Image\"},heading:{type:ControlType.String,title:\"Heading\",defaultValue:\"BRAND NEW AI Learning Companion. Free Beta Access.\",displayTextArea:true},body:{type:ControlType.String,title:\"Body\",defaultValue:\"The ivee AI Learning Companion is almost here. Join the waitlist and be first in for free beta access (while spots last).\",displayTextArea:true},buttonLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"Get Free Beta Access →\"},delaySeconds:{type:ControlType.Number,title:\"Delay (s)\",defaultValue:10,min:0,max:120,step:1,description:\"0 turns the timer off.\"},scrollPercent:{type:ControlType.Number,title:\"Scroll %\",defaultValue:50,min:0,max:100,step:5,description:\"0 turns the scroll trigger off.\"},exitIntent:{type:ControlType.Boolean,title:\"Exit intent\",defaultValue:true,description:\"Desktop only - phones have no mouse to leave the page with.\"},daysBeforeShowingAgain:{type:ControlType.Number,title:\"Hide for (days)\",defaultValue:7,min:0,max:90,step:1,description:\"After a visitor closes it. Clicking through hides it for good.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AcPopup\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"260\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AcPopup.map"],"mappings":"kOAae,SAAS,EAAQ,EAAM,EAAW,CAAC,GAAG,CAAC,IAAM,EAAG,EAAO,QAAW,GAAI,OAAO,EAAG,SAAU,YAAW,EAAG,QAAQ,EAAM,CAAU,CAAE,MAAM,CACvJ,CAAC,CAED,SAAS,GAAW,CAAC,GAAG,CAAC,OAAO,KAAK,MAAM,aAAa,QAAQ,CAAW,GAAG,IAAI,CAAE,MAAM,CAAC,MAAM,CAAC,CAAE,CAAC,CAAC,SAAS,EAAW,EAAM,CAAC,GAAG,CAAC,aAAa,QAAQ,EAAY,KAAK,UAAU,CAAK,CAAC,CAAE,MAAM,CACnM,CAAC,CAAC,SAAS,EAAa,EAAK,CAAC,IAAM,EAAM,EAAU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