import{j as e}from"./cm-1.0.63-CSIRHMXC.js";import{r as p}from"./redux-1.0.63-Df-eBzJn.js";import{y as d,z as g}from"./index-1.0.63-oIDff4nA.js";import{c as x}from"./ActionsSettings-1.0.63-BDjh4fuk.js";import{S}from"./ScopeEnum-1.0.63-B4DDvIDj.js";import{T as c}from"./TargetEnum-1.0.63-CIW1jlU5.js";import{C as h}from"./ConfirmDialog-1.0.63-eXgm3P8b.js";import{e as o}from"./notistack-1.0.63-B49ULGrj.js";import{l as j,a as s}from"./lib-1.0.63-DJZPtMem.js";import{A as T,a as v}from"./AccordionSummary-1.0.63-CweQ2Hjy.js";import{A}from"./AccordionDetails-1.0.63-nbUPBP1V.js";import{F as C,b as R}from"./TextField-1.0.63-C35Mfi1Q.js";import{B as l}from"./cjs-1.0.63-4A2xol4v.js";import"./vendor-1.0.63-CN03Eozo.js";import"./Typography-1.0.63-mecuj_Wl.js";import"./ButtonBase-1.0.63-CF10PFMS.js";import"./useEnhancedEffect-1.0.63-DnR0ZFqV.js";import"./ThemeProvider-1.0.63-Cq0KMgkh.js";import"./Modal-1.0.63-fMXTbfks.js";import"./iconBase-1.0.63-CFvHhC4t.js";import"./RestApi-1.0.63-BUfzocgq.js";import"./AdminTheme-1.0.63-DhJ0rrw5.js";import"./DialogContent-1.0.63-B3W-DlSe.js";import"./loglevel-1.0.63-BZ7XahX3.js";import"./lodash-1.0.63-hMxolcpJ.js";import"./moment-1.0.63-C5S46NFB.js";import"./Collapse-1.0.63-B-Rwe0o9.js";import"./Select-1.0.63-BMejr8a7.js";import"./Menu-1.0.63-DLh4HkF0.js";import"./createSvgIcon-1.0.63-DWL3J-DK.js";const er=({dbs:n,tbl:m})=>{j.debug(n,m);const[u,t]=p.useState(!1),[i,a]=p.useState(void 0),f=()=>{switch(i){case"form":return"Reset Form Builder?";case"theme":return"Reset Theme?";default:return"Reset Table Builder?"}};return e.jsxs(e.Fragment,{children:[e.jsxs(T,{disableGutters:!0,children:[e.jsx(v,{expandIcon:e.jsx(d,{}),children:"Reset"}),e.jsx(A,{children:e.jsxs(C,{sx:{display:"grid",gridGap:"20px"},children:[e.jsx(l,{variant:"contained",color:"primary",onClick:()=>{a(c.TABLE),t(!0)},children:"Reset Table Builder"}),e.jsx(l,{variant:"contained",color:"primary",onClick:()=>{a(c.FORM),t(!0)},children:"Reset Form Builder"}),e.jsxs(R,{sx:{display:"inline-grid",gridTemplateColumns:"20px auto",gridGap:"5px",alignItems:"center","& svg":{fontSize:"20px"}},error:!0,children:[e.jsx(g,{}),"A reset cannot be undone!"]})]})})]}),e.jsx(h,{title:f(),message:"Are you sure? This action cannot be undone!",open:u,setOpen:t,onConfirm:()=>{i!==void 0&&x(S.GLOBAL,i,n,m,null,r=>{if(r!=null&&r.code&&(r==null?void 0:r.message)!==void 0)switch(r.code){case"ok":o(r.message,{variant:"success"});break;case"info":o(r.message,{variant:"info"});break;default:o(r.message??s.contactSupport,{variant:"error"})}else console.error(r),o(s.contactSupport,{variant:"error"})},r=>{console.error("error",r),o(r??s.contactSupport,{variant:"error"})})}})]})};export{er as default};
