import{r as k,j as e,T as v,I as A,ec as B,K as t}from"./index-60a3c753.js";import{D as c,a as d}from"./DialogContent-89e21f2e.js";import{D as x}from"./DialogTitle-fe69da5c.js";import{D as p}from"./DialogContentText-6688bd59.js";import{D as h}from"./DialogActions-e754942c.js";import{L as I}from"./LoadingButton-3975ddf9.js";const z=({isOpen:u,title:m,children:g,onClose:o,onOK:f,okText:a,closeText:n,status:L,loading:j,showFooter:C=!0,maxWidth:b,...y})=>{const[D,r]=k.useState(!1),s=()=>{r(!0)},w=()=>{r(!1),o==null||o()},l=()=>{r(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(c,{open:u,onClose:s,sx:{"& .MuiDialog-paper":{borderRadius:"15px",overflow:"hidden"}},maxWidth:b||"sm",fullWidth:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",...y,children:[e.jsxs(x,{sx:{background:"linear-gradient(90deg, #5b6ef5 0%, #9b59b6 100%)",color:"white",p:2.5,display:"flex",alignItems:"center",justifyContent:"space-between"},id:"alert-dialog-title",children:[e.jsx(v,{variant:"h6",sx:{fontWeight:700},children:m}),e.jsx(A,{onClick:s,sx:{color:"white"},children:e.jsx(B,{size:20})})]}),e.jsx(d,{sx:i=>({p:"12px !important",bgcolor:i.palette.background.default}),children:e.jsx(p,{id:"alert-dialog-description",sx:i=>({p:2,borderRadius:"10px",bgcolor:i.palette.background.paper}),children:g})}),C&&e.jsxs(h,{sx:{display:"flex",justifyContent:"center"},children:[n&&e.jsx(t,{onClick:s,color:"secondary",variant:"outlined",children:n}),a&&e.jsx(I,{loading:j,onClick:f,variant:"contained",children:a})]})]}),e.jsxs(c,{open:D,onClose:l,children:[e.jsx(x,{children:"Confirm Close"}),e.jsx(d,{children:e.jsx(p,{children:"⚠️ Are you sure you want to close? Any unsaved changes will be lost."})}),e.jsxs(h,{children:[e.jsx(t,{onClick:l,color:"primary",children:"Cancel"}),e.jsx(t,{onClick:w,color:"error",variant:"contained",children:"Close"})]})]})]})};export{z as C};
