{"version":3,"file":"AppDownloadPopup.CTxeSfo1.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/bESJAAb6Pc7q78B4Jymn/luNE1YgN9SxF0k8QN37x/AppDownloadPopup.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType}from\"framer\";const MADANI=\"'Madani Arabic', 'Madani Arabic SemiBold', sans-serif\";function PopupPortal({children}){const el=useRef(null);if(!el.current){el.current=document.createElement(\"div\");}useEffect(()=>{const container=el.current;document.body.appendChild(container);return()=>{document.body.removeChild(container);};},[]);return /*#__PURE__*/createPortal(children,el.current);}export function AppDownloadPopup(props){const{buttonLabel,buttonBackground,buttonColor,popupTitle,popupSubtitle,qrCodeImage,borderRadius}=props;const[isOpen,setIsOpen]=useState(false);const[animating,setAnimating]=useState(false);const[hovered,setHovered]=useState(false);// Some pages on this site use a smooth-scroll library (Lenis). At the very\n// top of the page (exactly where this button usually sits, e.g. the Hero\n// section), a tap that includes even a tiny amount of touch-move can be\n// read by mobile Safari/Chrome as a \"pull to refresh\" gesture, reloading\n// the page instead of registering the click. Disabling the native\n// overscroll/refresh gesture while this component is mounted prevents\n// that — it does not affect normal scrolling.\nuseEffect(()=>{const html=document.documentElement;const body=document.body;const prevHtml=html.style.overscrollBehaviorY;const prevBody=body.style.overscrollBehaviorY;html.style.overscrollBehaviorY=\"none\";body.style.overscrollBehaviorY=\"none\";return()=>{html.style.overscrollBehaviorY=prevHtml;body.style.overscrollBehaviorY=prevBody;};},[]);const openPopup=e=>{e.preventDefault();e.stopPropagation();setIsOpen(true);requestAnimationFrame(()=>{requestAnimationFrame(()=>setAnimating(true));});};const closePopup=()=>{setAnimating(false);setTimeout(()=>setIsOpen(false),250);};useEffect(()=>{if(!isOpen)return;const handleKey=e=>{if(e.key===\"Escape\")closePopup();};window.addEventListener(\"keydown\",handleKey);return()=>window.removeEventListener(\"keydown\",handleKey);},[isOpen]);useEffect(()=>{if(isOpen){document.body.style.overflow=\"hidden\";}else{document.body.style.overflow=\"\";}return()=>{document.body.style.overflow=\"\";};},[isOpen]);return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"div\",{role:\"button\",tabIndex:0,onClick:openPopup,onTouchEnd:openPopup,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),onKeyDown:e=>e.key===\"Enter\"&&openPopup(e),style:{backgroundColor:hovered?buttonBackground+\"dd\":buttonBackground,color:buttonColor,borderRadius:100,padding:\"14px 28px\",fontSize:16,fontWeight:600,cursor:\"pointer\",fontFamily:MADANI,whiteSpace:\"nowrap\",userSelect:\"none\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"background-color 150ms ease\",letterSpacing:\"-0.01em\",touchAction:\"manipulation\",WebkitTapHighlightColor:\"transparent\"},children:buttonLabel}),isOpen&&/*#__PURE__*/_jsx(PopupPortal,{children:/*#__PURE__*/_jsx(\"div\",{onClick:closePopup,style:{position:\"fixed\",inset:0,zIndex:99999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:animating?\"rgba(0,0,0,0.5)\":\"rgba(0,0,0,0)\",transition:\"background-color 250ms ease\"},children:/*#__PURE__*/_jsxs(\"div\",{onClick:e=>e.stopPropagation(),style:{backgroundColor:\"#ffffff\",borderRadius:borderRadius,padding:\"40px 36px 36px\",width:360,maxWidth:\"90vw\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:16,boxShadow:\"0 24px 60px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.08)\",transform:animating?\"scale(1) translateY(0)\":\"scale(0.88) translateY(12px)\",opacity:animating?1:0,transition:\"transform 280ms cubic-bezier(0.34,1.56,0.64,1), opacity 220ms ease\",position:\"relative\",fontFamily:MADANI},children:[/*#__PURE__*/_jsx(\"div\",{role:\"button\",tabIndex:0,onClick:e=>{e.stopPropagation();closePopup();},\"aria-label\":\"Close\",style:{position:\"absolute\",top:14,right:14,background:\"#f2f2f2\",borderRadius:\"50%\",width:28,height:28,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:14,color:\"#666\",userSelect:\"none\",fontFamily:MADANI},children:\"✕\"}),/*#__PURE__*/_jsx(\"h2\",{style:{margin:0,fontSize:22,fontWeight:700,textAlign:\"center\",color:\"#111\",lineHeight:1.3,fontFamily:MADANI},children:popupTitle}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontSize:15,color:\"#666\",textAlign:\"center\",fontFamily:MADANI,lineHeight:1.5},children:popupSubtitle}),/*#__PURE__*/_jsx(\"div\",{style:{width:190,height:190,borderRadius:12,overflow:\"hidden\",background:\"#fff\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:8,border:\"1px solid #eee\"},children:qrCodeImage?/*#__PURE__*/_jsx(\"img\",{src:qrCodeImage,alt:\"Scan to download the Thawani Pay app\",style:{width:\"100%\",height:\"100%\",objectFit:\"contain\"}}):/*#__PURE__*/_jsx(\"span\",{style:{fontSize:12,color:\"#aaa\",textAlign:\"center\",padding:12,fontFamily:MADANI},children:\"Upload your QR code in the properties panel →\"})}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:10,marginTop:4},children:[/*#__PURE__*/_jsx(\"img\",{src:\"https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg\",alt:\"Download on the App Store\",style:{height:36,cursor:\"pointer\"}}),/*#__PURE__*/_jsx(\"img\",{src:\"https://upload.wikimedia.org/wikipedia/commons/7/78/Google_Play_Store_badge_EN.svg\",alt:\"Get it on Google Play\",style:{height:36,cursor:\"pointer\"}})]})]})})})]});}AppDownloadPopup.defaultProps={buttonLabel:\"Download the app\",buttonBackground:\"#1B1464\",buttonColor:\"#ffffff\",popupTitle:\"Get the Thawani Pay app\",popupSubtitle:\"Scan the QR code to download the Thawani Pay app\",qrCodeImage:\"\",borderRadius:20};addPropertyControls(AppDownloadPopup,{buttonLabel:{type:ControlType.String,title:\"Button Label\"},buttonBackground:{type:ControlType.Color,title:\"Button Color\"},buttonColor:{type:ControlType.Color,title:\"Button Text\"},popupTitle:{type:ControlType.String,title:\"Popup Title\"},popupSubtitle:{type:ControlType.String,title:\"Subtitle\"},qrCodeImage:{type:ControlType.Image,title:\"QR Code Image\"},borderRadius:{type:ControlType.Number,title:\"Corner Radius\",min:0,max:40,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"AppDownloadPopup\":{\"type\":\"reactComponent\",\"name\":\"AppDownloadPopup\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AppDownloadPopup.map"],"mappings":"2NAAmQ,SAAS,EAAY,CAAC,YAAU,CAAC,IAAM,EAAGA,EAAO,IAAI,EAAmM,MAAjM,CAAgB,EAAG,UAAQ,SAAS,cAAc,KAAK,EAAG,MAAc,CAAC,IAAM,EAAU,EAAG,QAA6C,OAArC,SAAS,KAAK,YAAY,CAAS,MAAY,CAAC,SAAS,KAAK,YAAY,CAAS,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAa,EAAS,EAAG,OAAO,CAAE,CAAC,SAAgB,EAAiB,EAAM,CAAC,GAAK,CAAC,cAAY,mBAAiB,cAAY,aAAW,gBAAc,cAAY,gBAAc,EAAW,CAAC,EAAO,GAAWC,EAAS,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAOh0B,MAAc,CAAC,IAAM,EAAK,SAAS,gBAAsB,EAAK,SAAS,KAAW,EAAS,EAAK,MAAM,oBAA0B,EAAS,EAAK,MAAM,oBAAgG,MAA5E,GAAK,MAAM,oBAAoB,OAAO,EAAK,MAAM,oBAAoB,WAAiB,CAAC,EAAK,MAAM,oBAAoB,E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