{"version":3,"file":"ErrorPopup.Bth9tvOS.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/CqPZZDuGs9uCEaWfP9oM/3mtJfBCEXjcqVoaIzQ4r/ErrorPopup.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Error Popup\n * Centered popup component for showing error messages with a close button.\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ErrorPopup(props){const{message,isOpen,closeOnOverlayClick,overlayColor,popupBackground,textColor,borderRadius,shadow,font,style,onClose,success}=props;const[dummy,setDummy]=useState(false);const boxShadow=useMemo(()=>shadow?\"0 18px 45px rgba(0,0,0,0.25)\":\"none\",[shadow]);if(!isOpen)return null;const handleClose=()=>{props.isOpen=false;setDummy(!dummy);if(onClose){onClose();}};const handleOverlayClick=()=>{if(!closeOnOverlayClick)return;handleClose();};const isFixedWidth=style&&style.width===\"100%\";const isFixedHeight=style&&style.height===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",zIndex:\"10\",...style},children:/*#__PURE__*/_jsx(\"div\",{onClick:handleOverlayClick,style:{position:\"absolute\",inset:0,background:overlayColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsxs(\"div\",{role:\"alertdialog\",\"aria-modal\":\"true\",\"aria-live\":\"assertive\",\"aria-label\":\"Error message\",onClick:e=>e.stopPropagation(),style:{minWidth:isFixedWidth?undefined:280,maxWidth:\"90%\",maxHeight:\"90%\",background:popupBackground,color:textColor,borderRadius,boxShadow,padding:24,display:\"flex\",flexDirection:\"column\",gap:16,position:\"relative\",...font},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"flex-start\",gap:12},children:[/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{width:32,height:32,borderRadius:999,backgroundColor:success?\"rgba(52, 199, 89, 0.12)\":\"rgba(255, 59, 48, 0.12)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexShrink:0,color:success?\"#34C759\":\"#FF3B30\",fontSize:18,fontWeight:700},children:success?\"✓\":\"!\"}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",color:textColor},children:message})]}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"flex-end\",marginTop:8},children:/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:handleClose,style:{borderRadius:999,border:\"none\",padding:\"8px 16px\",cursor:\"pointer\",backgroundColor:\"#000000\",color:\"#FFFFFF\",fontSize:14,fontWeight:500,letterSpacing:\"-0.01em\"},children:\"Close\"})})]})})});}addPropertyControls(ErrorPopup,{message:{type:ControlType.String,title:\"Message\",defaultValue:\"Something went wrong. Please try again.\",displayTextArea:true},isOpen:{type:ControlType.Boolean,title:\"Open\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},closeOnOverlayClick:{type:ControlType.Boolean,title:\"Overlay click\",defaultValue:true,enabledTitle:\"Closes\",disabledTitle:\"Ignored\"},overlayColor:{type:ControlType.Color,title:\"Overlay\",defaultValue:\"rgba(0,0,0,0.35)\"},popupBackground:{type:ControlType.Color,title:\"Popup BG\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:40,unit:\"px\",step:1},shadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},onClose:{type:ControlType.EventHandler,title:\"On Close\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ErrorPopup\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ErrorPopup.map"],"mappings":"wLASG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,UAAQ,SAAO,sBAAoB,eAAa,kBAAgB,YAAU,eAAa,SAAO,OAAK,QAAM,UAAQ,WAAS,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAM,CAAO,EAAUC,MAAY,EAAO,+BAA+B,OAAO,CAAC,EAAO,CAAC,CAAC,GAAG,CAAC,EAAO,OAAO,KAAK,IAAM,MAAgB,CAAC,EAAM,OAAO,GAAM,EAAS,CAAC,EAAM,CAAI,GAAS,GAAS,EAAU,MAAuB,CAAK,GAA2B,GAAa,EAAS,EAAa,GAAO,EAAM,QAAQ,OAAwD,OAA7B,GAAO,EAAM,OAAoC,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,OAAO,KAAK,GAAG,EAAM,CAAC,SAAsB,EAAK,MAAM,CAAC,QAAQ,EAAmB,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,WAAW,EAAa,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,CAAC,cAAc,OAAO,SAAsB,EAAM,MAAM,CAAC,KAAK,cAAc,aAAa,OAAO,YAAY,YAAY,aAAa,gBAAgB,QAAQ,GAAG,EAAE,iBAAiB,CAAC,MAAM,CAAC,SAAS,EAAa,IAAA,GAAU,IAAI,SAAS,MAAM,UAAU,MAAM,WAAW,EAAgB,MAAM,EAAU,eAA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