"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react/jsx-runtime"),e=require("react"),t=require("react-dom");function o(){return n.jsx("svg",{stroke:"currentColor",fill:"none","stroke-width":"0",viewBox:"0 0 15 15",height:"20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"})})}function a(a){const{open:i,toggle:r,onClose:d,onOpenChange:s,title:l,footer:c,header:p,children:u,hideIcon:f,position:m,className:h,wrapperClassName:x,..._}=a,[y,g]=e.useState(!i);function w(){r&&r(),d&&d(),s&&s(!1)}if(e.useEffect((()=>(document.body.style.overflow=i?"hidden":"auto",()=>{document.body.style.overflow="auto"})),[i]),e.useEffect((()=>{if(i)return g(!1);const n=setTimeout((()=>{g(!0)}),500);return()=>clearTimeout(n)}),[i]),"undefined"==typeof window||!i&&y)return null;const b=["modal"];i&&b.push("modal__open"),m&&b.push(`modal__position-${m}`),x&&b.push(x);const v=["modal__popup"];h&&v.push(h);const j=!f||l?n.jsxs("header",{className:"modal__header",children:[p||n.jsx("h3",{className:"modal__title",children:l}),f?null:n.jsx("button",{onClick:w,className:"modal__close-button",children:n.jsx(o,{})})]}):null,C=n.jsxs("div",{className:b.join(" "),children:[n.jsx("div",{onClick:w,className:"modal__backdrop"}),n.jsxs("div",{className:v.join(" "),..._,children:[j,n.jsx("div",{className:"modal__body",children:u}),!!c&&n.jsx("footer",{children:c})]})]});return t.createPortal(C,document.body)}!function(n,e){void 0===e&&(e={});var t=e.insertAt;if(n&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=n:a.appendChild(document.createTextNode(n))}}("@keyframes fade-in {\n   0% {\n      opacity: 0;\n   }\n   100% {\n      opacity: 1;\n   }\n}\n\n@keyframes fade-out {\n   0% {\n      opacity: 1;\n   }\n   100% {\n      opacity: 0;\n   }\n}\n\n@keyframes fade-in-slide-down {\n   0% {\n      opacity: 0;\n      transform: translateY(-15px);\n   }\n   100% {\n      opacity: 1;\n      transform: translateY(0);\n   }\n}\n\n@keyframes fade-out-slide-up {\n   0% {\n      opacity: 1;\n      transform: translateY(0);\n   }\n   100% {\n      opacity: 0;\n      transform: translateY(15px);\n   }\n}\n\n.modal {\n   position: fixed;\n   width: 100vw;\n   height: 100dvh;\n   top: 0;\n   left: 0;\n   display: flex;\n   flex-wrap: wrap;\n   flex-direction: column;\n   align-content: center;\n   z-index: 9999;\n   justify-content: center;\n}\n.modal__position-top {\n   justify-content: flex-start;\n}\n\n.modal__backdrop {\n   background-color: rgba(0, 0, 0, 0.2);\n   position: fixed;\n   top: 0;\n   left: 0;\n   width: 100%;\n   height: 100%;\n   z-index: 9999;\n   opacity: 0;\n   animation: fade-out 0.5s forwards;\n}\n\n.modal__open .modal__backdrop {\n   animation: fade-in 0.5s forwards;\n}\n\n.modal__popup {\n   padding: 20px;\n   border-radius: 18px;\n   width: 90%;\n   max-height: 75vh;\n   border: 1px solid #ddd;\n   background: #fff;\n   z-index: 99999;\n   opacity: 0;\n   display: flex;\n   flex-direction: column;\n   transform: translateY(-15px);\n   max-width: 550px;\n   animation: fade-out-slide-up 0.5s ease-out forwards;\n   overflow: hidden;\n}\n\n.modal__open .modal__popup {\n   animation: fade-in-slide-down 0.5s ease-out forwards;\n}\n\n.modal__header {\n   display: flex;\n   justify-content: space-between;\n   align-items: flex-start;\n}\n\n.modal__title {\n   color: #000000c9;\n   margin: 0 0 12px;\n   font-weight: 600;\n   font-size: 22px;\n}\n\n.modal__body {\n   height: 100%;\n   overflow-y: auto;\n   flex-grow: 1;\n}\n\n.modal__close-button {\n   cursor: pointer;\n   border-radius: 50%;\n   border: none;\n   color: rgb(233 30 99);\n   height: 32px;\n   width: 32px;\n   overflow: hidden;\n   display: flex;\n   justify-content: center;\n   align-items: center;\n   margin: -4px 0 0;\n   background: #fff !important;\n   transition-property: all;\n   transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n   transition-duration: 0.2s;\n}\n.modal__close-button:hover {\n   background: rgba(0, 121, 211, 0.1) !important;\n}\n",{insertAt:"top"}),exports.Modal=a,exports.default=a,exports.useToggle=function(n=!1){const[t,o]=e.useState(n);return[t,function(){o(!t)}]};
