File "DataExplorer-1.0.13-ce3295c2.js"

Full Path: /home/vantageo/public_html/cache/.wp-cli/wp-content/plugins/wp-data-access/assets/dist/DataExplorer-1.0.13-ce3295c2.js
File size: 70.19 KB
MIME-type: text/plain
Charset: utf-8

import{r as d,j as e,_ as re,l as a,ac as dt,ad as pt,C as O,ae as ut,af as xt,ag as gt,ah as mt,ai as ht,aj as jt,ak as ft,al as bt,am as yt,an as Tt,ao as St,ap as Ct,aq as vt,ar as It,as as Ge,at as wt,au as _t,av as Et,K as Fe,aw as kt,ax as Pt,ay as At,az as Mt,aA as Lt,aB as Rt,aC as Ot,aD as zt,aE as Dt,aF as Nt,aG as ks,aH as gs,aI as $e,aJ as He,aK as Ft,aL as Bt,aM as Ps,aN as ze,aO as As,aP as Ze,aQ as Vt,aR as Wt,aS as Kt,aT as Gt,aU as $t,aV as Ht,W as ve,aW as Ms,a6 as cs,e as P,aX as Ut,aY as ms,aZ as Ls,a_ as qt,a$ as Yt,b0 as Qt,b1 as fe,b2 as Xe,b3 as Xt,R as Pe,b4 as Jt,b5 as Zt,b6 as Ue,b7 as es,b8 as en,aa as bs,P as sn,y as ys,B as tn}from"./main-1.0.13.js";import{l as nn,a as an,b as rn,c as on,d as ln,e as cn,f as dn,g as pn,h as un,s as xn}from"./ActionsExplorer-1.0.13-5e860b61.js";import{L as qe,N as Ye,B as l,O as gn,a as H,u as k,P as mn,Q as hn,i as jn,T as he,j as fn,U as bn,y as yn,V as Tn,W as Be,A as as,g as rs,X as Sn,Y as Cn,Z as Rs,_ as Os,h as zs,$ as vn,a0 as In,S as hs,c as le,a1 as wn,n as _n,v as En,d as Ds,a2 as kn,t as Pn}from"./main-1.0.13-4cbe632d.js";import{a as Me,_ as J,c as Ns,s as js,u as An,d as Ts,b as Mn,r as me,T as ye,I as oe,P as ds}from"./iconBase-1.0.13-98e06aa9.js";import{u as Ie,M as we,B as Ss,T as Fs,a as Bs,b as ss,c as Z,d as Vs}from"./index.esm-1.0.13-ae160362.js";import{a as Ws,b as Ks,c as Gs,d as Ln}from"./index.esm-1.0.13-8cdddba7.js";import{T as Rn,a as On}from"./index.esm-1.0.13-cc102a96.js";import{u as $s,t as ie,T as zn,a as Dn,b as Nn,g as Fn,S as Bn}from"./TreeItem2Provider-1.0.13-d4167759.js";import{f as Vn,D as Wn,g as Kn,h as Gn,C as ue,a as Je,T as ls,i as $n,S as De,R as Hn,B as Un,b as qn,c as Yn,d as Qn,e as Cs}from"./settings-1.0.13-650559d5.js";import{A as ne,a as Xn}from"./AdminTheme-1.0.13-a1e60de2.js";import{C as de}from"./Checkbox-1.0.13-3ec10fcc.js";import{L as je,A as Te}from"./Link-1.0.13-03de5435.js";import{C as ps,a as us,B as G}from"./useScreenSize-1.0.13-fa31f819.js";import{a as Jn,C as Zn}from"./index-1.0.13-8e548ee7.js";import{F as U,b as ee,T as ae,S as be,I as ts,a as xe,A as vs,C as Is}from"./TextField-1.0.13-7258d491.js";import{C as ea}from"./CardActions-1.0.13-4061c215.js";import{I as ws}from"./InputAdornment-1.0.13-83724c3f.js";import{D as sa,a as ta,b as na}from"./DialogContent-1.0.13-5873ffb9.js";import{M as W}from"./MenuItem-1.0.13-e7719456.js";import{A as aa}from"./AdminMetaData-1.0.13-2a40f924.js";import{S as ra}from"./ScopeEnum-1.0.13-d05c4b00.js";import{A as Se,a as Ce}from"./AccordionSummary-1.0.13-0885ed32.js";import{R as Hs}from"./RadioGroup-1.0.13-1d87a31c.js";import{R as ns}from"./Radio-1.0.13-befab7cd.js";import{c as ia}from"./index-1.0.13-93f67fc3.js";import{F as Ne}from"./FormControlLabel-1.0.13-143a10df.js";import{a as oa}from"./index.esm-1.0.13-0afa0259.js";import{g as la}from"./ActionsDml-1.0.13-147ce8d4.js";import{T as _s}from"./Tabs-1.0.13-f71c8d5c.js";import"./Close-1.0.13-b137ce2f.js";import"./Menu-1.0.13-2a06ef00.js";import"./AlertTitle-1.0.13-80063b16.js";import"./useSlot-1.0.13-62ad37b6.js";import"./ListItemIcon-1.0.13-2bfd9865.js";import"./DateTimePicker-1.0.13-12d520d7.js";import"./useMobilePicker-1.0.13-30bb98f7.js";import"./date-time-utils-1.0.13-2393af5c.js";import"./dateViewRenderers-1.0.13-3b668027.js";import"./TimePicker-1.0.13-101f1fcd.js";import"./DatePicker-1.0.13-5c3486db.js";function ca(s){const{instance:t,selection:{multiSelect:r}}=$s(),n=t.isItemExpandable(s),i=t.isItemExpanded(s),o=t.isItemFocused(s),m=t.isItemSelected(s),g=t.isItemDisabled(s);return{disabled:g,expanded:i,selected:m,focused:o,handleExpansion:u=>{if(!g){o||t.focusItem(u,s);const S=r&&(u.shiftKey||u.ctrlKey||u.metaKey);n&&!(S&&t.isItemExpanded(s))&&t.toggleItemExpansion(u,s)}},handleSelection:u=>{g||(o||t.focusItem(u,s),r&&(u.shiftKey||u.ctrlKey||u.metaKey)?u.shiftKey?t.selectRange(u,{end:s}):t.selectItem(u,s,!0):t.selectItem(u,s))},preventSelection:u=>{(u.shiftKey||u.ctrlKey||u.metaKey||g)&&u.preventDefault()}}}const da=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown"],Us=d.forwardRef(function(t,r){const{classes:n,className:i,displayIcon:o,expansionIcon:m,icon:g,label:h,itemId:b,onClick:c,onMouseDown:u}=t,S=Me(t,da),{disabled:j,expanded:T,selected:v,focused:I,handleExpansion:A,handleSelection:D,preventSelection:_}=ca(b),L=g||m||o,R=z=>{_(z),u&&u(z)},w=z=>{A(z),D(z),c&&c(z)};return e.jsxs("div",J({},S,{className:Ns(i,n.root,T&&n.expanded,v&&n.selected,I&&n.focused,j&&n.disabled),onClick:w,onMouseDown:R,ref:r,children:[e.jsx("div",{className:n.iconContainer,children:L}),e.jsx("div",{className:n.label,children:h})]}))}),pa=["children","className","slots","slotProps","ContentComponent","ContentProps","itemId","id","label","onClick","onMouseDown","onFocus","onBlur","onKeyDown"],ua=["ownerState"],xa=["ownerState"],ga=["ownerState"],ma=s=>{const{classes:t}=s;return Mn({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],groupTransition:["groupTransition"]},Fn,t)},ha=js("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(s,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),ja=js(Us,{name:"MuiTreeItem",slot:"Content",overridesResolver:(s,t)=>[t.content,t.iconContainer&&{[`& .${ie.iconContainer}`]:t.iconContainer},t.label&&{[`& .${ie.label}`]:t.label}]})(({theme:s})=>({padding:s.spacing(.5,1),borderRadius:s.shape.borderRadius,width:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",gap:s.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(s.vars||s).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ie.disabled}`]:{opacity:(s.vars||s).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${ie.focused}`]:{backgroundColor:(s.vars||s).palette.action.focus},[`&.${ie.selected}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:qe(s.palette.primary.main,s.palette.action.selectedOpacity),"&:hover":{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.hoverOpacity}))`:qe(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / ${s.vars.palette.action.selectedOpacity})`:qe(s.palette.primary.main,s.palette.action.selectedOpacity)}},[`&.${ie.focused}`]:{backgroundColor:s.vars?`rgba(${s.vars.palette.primary.mainChannel} / calc(${s.vars.palette.action.selectedOpacity} + ${s.vars.palette.action.focusOpacity}))`:qe(s.palette.primary.main,s.palette.action.selectedOpacity+s.palette.action.focusOpacity)}},[`& .${ie.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${ie.label}`]:J({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},s.typography.body1)})),fa=js(Vn,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(s,t)=>t.groupTransition})({margin:0,padding:0,paddingLeft:12}),se=d.forwardRef(function(t,r){const{icons:n,runItemPlugins:i,selection:{multiSelect:o},disabledItemsFocusable:m,instance:g}=$s(),h=An({props:t,name:"MuiTreeItem"}),{children:b,className:c,slots:u,slotProps:S,ContentComponent:j=Us,ContentProps:T,itemId:v,id:I,label:A,onClick:D,onMouseDown:_,onBlur:L,onKeyDown:R}=h,w=Me(h,pa),{contentRef:z,rootRef:N}=i(h),F=Ts(r,N),y=Ts(T==null?void 0:T.ref,z),x={expandIcon:(u==null?void 0:u.expandIcon)??n.slots.expandIcon??zn,collapseIcon:(u==null?void 0:u.collapseIcon)??n.slots.collapseIcon??Dn,endIcon:(u==null?void 0:u.endIcon)??n.slots.endIcon,icon:u==null?void 0:u.icon,groupTransition:u==null?void 0:u.groupTransition},f=V=>Array.isArray(V)?V.length>0&&V.some(f):!!V,C=f(b),E=g.isItemExpanded(v),M=g.isItemFocused(v),q=g.isItemSelected(v),B=g.isItemDisabled(v),te=J({},h,{expanded:E,focused:M,selected:q,disabled:B}),Q=ma(te),ke=x.groupTransition??void 0,Ve=Ye({elementType:ke,ownerState:{},externalSlotProps:S==null?void 0:S.groupTransition,additionalProps:{unmountOnExit:!0,in:E,component:"ul",role:"group"},className:Q.groupTransition}),ge=E?x.collapseIcon:x.expandIcon,We=Ye({elementType:ge,ownerState:{},externalSlotProps:V=>E?J({},me(n.slotProps.collapseIcon,V),me(S==null?void 0:S.collapseIcon,V)):J({},me(n.slotProps.expandIcon,V),me(S==null?void 0:S.expandIcon,V))}),Ke=Me(We,ua),p=C&&ge?e.jsx(ge,J({},Ke)):null,X=C?void 0:x.endIcon,Zs=Ye({elementType:X,ownerState:{},externalSlotProps:V=>C?{}:J({},me(n.slotProps.endIcon,V),me(S==null?void 0:S.endIcon,V))}),et=Me(Zs,xa),st=X?e.jsx(X,J({},et)):null,is=x.icon,tt=Ye({elementType:is,ownerState:{},externalSlotProps:S==null?void 0:S.icon}),nt=Me(tt,ga),at=is?e.jsx(is,J({},nt)):null;let os;o?os=q:q&&(os=!0);function rt(V){!M&&(!B||m)&&V.currentTarget===V.target&&g.focusItem(V,v)}function it(V){L==null||L(V),g.removeFocusedItem()}const ot=V=>{R==null||R(V),g.handleItemKeyDown(V,v)},lt=g.getTreeItemId(v,I),ct=g.canItemBeTabbed(v)?0:-1;return e.jsx(Nn,{itemId:v,children:e.jsxs(ha,J({className:Ns(Q.root,c),role:"treeitem","aria-expanded":C?E:void 0,"aria-selected":os,"aria-disabled":B||void 0,id:lt,tabIndex:ct},w,{ownerState:te,onFocus:rt,onBlur:it,onKeyDown:ot,ref:F,children:[e.jsx(ja,J({as:j,classes:{root:Q.content,expanded:Q.expanded,selected:Q.selected,focused:Q.focused,disabled:Q.disabled,iconContainer:Q.iconContainer,label:Q.label},label:A,itemId:v,onClick:D,onMouseDown:_,icon:at,expansionIcon:p,displayIcon:st,ownerState:te},T,{ref:y})),b&&e.jsx(fa,J({as:ke},Ve,{children:b}))]}))})}),ce=()=>e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",justifyContent:"start",alignItems:"center",gap:"10px",padding:"30px"},children:[e.jsx(gn,{sx:{width:"1em !important",height:"1em !important"}}),e.jsx(ye,{children:"Loading..."})]}),_e={columns:[],data:[],initialState:{},enableColumnActions:!1,enableColumnFilters:!1,enablePagination:!1,enableSorting:!1,enableBottomToolbar:!1,enableTopToolbar:!1,muiTablePaperProps:{sx:{display:"grid",boxShadow:"none"}},muiTableProps:{sx:{border:"unset","& th, td":{borderTop:"unset",borderRight:"unset",borderLeft:"unset"}}},muiTableHeadCellProps:{sx:{paddingTop:"1rem",paddingRight:"1rem",paddingBottom:"1rem",paddingLeft:"1rem"}},muiTableBodyRowProps:{hover:!0},muiTableBodyCellProps:{sx:{verticalAlign:"top"}}},Ee=({msg:s})=>e.jsx(l,{sx:{padding:"1rem 0"},children:e.jsx(ye,{children:s})}),ba=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),ya=({dbs:s,tbl:t})=>{a.debug(s,t);const r=H(),n=k(c=>dt(c,s,t));a.debug(n);const i=k(c=>pt(c,s,t));a.debug(i);const[o,m]=d.useState("");d.useEffect(()=>{n||g()},[n]);const g=()=>{nn(s,t,c=>{const u=c==null?void 0:c.data;a.debug("response data",u),r(ut({dbs:s,tbl:t,cls:u}))},c=>{a.error("error",c),m(c??O.contactSupport)})},h=d.useMemo(()=>[{accessorKey:"ordinal_position",header:"#",size:40},{accessorKey:"column_name",header:"Column name",size:100},{accessorKey:"column_type",header:"Column type",size:100},{accessorKey:"is_nullable",header:"Nullable?",size:50},{accessorKey:"character_maximum_length",header:"Max length",size:70,muiTableHeadCellProps:{align:"right"},muiTableBodyCellProps:{align:"right"}},{accessorKey:"numeric_precision",header:"Precision",size:60,muiTableHeadCellProps:{align:"right"},muiTableBodyCellProps:{align:"right"}},{accessorKey:"numeric_scale",header:"Scale",size:60,muiTableHeadCellProps:{align:"right"},muiTableBodyCellProps:{align:"right"}},{accessorKey:"extra",header:"Extra",size:100},{accessorKey:"column_default",header:"Default value",size:100}],[]),b=Ie({..._e,columns:h,data:i,initialState:{columnOrder:["ordinal_position","column_name","column_type","is_nullable","extra","column_default","character_maximum_length","numeric_precision","numeric_scale"],density:"comfortable"},muiTableProps:{className:"pp-explorer-table"}});return a.debug(b),o!==""?e.jsx(d.Suspense,{children:e.jsx(ba,{severity:"error",message:o,close:!1})}):n?n&&i.length===0?e.jsx(Ee,{msg:"Table has no columns"}):(a.debug(i),e.jsx(we,{table:b})):e.jsx(ce,{})},Ta=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),Sa=({dbs:s,tbl:t})=>{a.debug(s,t);const r=H(),n=k(c=>xt(c,s,t));a.debug(n);const i=k(c=>gt(c,s,t));a.debug(i);const[o,m]=d.useState("");d.useEffect(()=>{n||g()},[n]);const g=()=>{an(s,t,c=>{const u=c==null?void 0:c.data;a.debug("response data",u),r(mt({dbs:s,tbl:t,idx:u}))},c=>{a.error("error",c),m(c??O.contactSupport)})},h=d.useMemo(()=>[{accessorKey:"index_name",header:"Index name",size:100},{accessorKey:"non_unique",header:"Unique",size:80},{accessorKey:"seq_in_name",header:"#",size:40,muiTableHeadCellProps:{align:"right"},muiTableBodyCellProps:{align:"right"}},{accessorKey:"column_name",header:"Column name",size:100},{accessorKey:"collation",header:"Collation",size:80},{accessorKey:"nullable",header:"Nullable?",size:80},{accessorKey:"index_type",header:"Index type",size:100},{accessorKey:"cardinality",header:"Cardinality",size:80,muiTableHeadCellProps:{align:"right"},muiTableBodyCellProps:{align:"right"}}],[]),b=Ie({..._e,columns:h,data:i,initialState:{density:"comfortable"},muiTableProps:{className:"pp-explorer-table"}});return a.debug(b),o!==""?e.jsx(d.Suspense,{children:e.jsx(Ta,{severity:"error",message:o,close:!1})}):n?n&&i.length===0?e.jsx(Ee,{msg:"Table has no indexes"}):e.jsx(we,{table:b}):e.jsx(ce,{})},Ca=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),va=({dbs:s,tbl:t})=>{a.debug(s,t);const r=H(),n=k(c=>ht(c,s,t));a.debug(n);const i=k(c=>jt(c,s,t));a.debug(i);const[o,m]=d.useState("");d.useEffect(()=>{n||g()},[n]);const g=()=>{rn(s,t,c=>{const u=c==null?void 0:c.data;a.debug("response data",u),r(ft({dbs:s,tbl:t,trg:u}))},c=>{a.error("error",c),m(c??O.contactSupport)})},h=d.useMemo(()=>[{accessorKey:"trigger_name",header:"Trigger name",size:120},{accessorKey:"event_manipulation",header:"Event",size:80},{accessorKey:"action_timing",header:"Timin",size:80},{accessorKey:"action_statement",header:"SQL",size:200,Cell:({cell:c})=>e.jsx("pre",{style:{padding:0,margin:0},children:c.getValue()})}],[]),b=Ie({..._e,columns:h,data:i,initialState:{density:"comfortable"},muiTableProps:{className:"pp-explorer-table"}});return a.debug(b),o!==""?e.jsx(d.Suspense,{children:e.jsx(Ca,{severity:"error",message:o,close:!1})}):n?n&&i.length===0?e.jsx(Ee,{msg:"Table has no triggers"}):e.jsx(we,{table:b}):e.jsx(ce,{})},Ia=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),wa=({dbs:s,tbl:t})=>{a.debug(s,t);const r=H(),n=k(c=>bt(c,s,t));a.debug(n);const i=k(c=>yt(c,s,t));a.debug(i);const[o,m]=d.useState("");d.useEffect(()=>{n||g()},[n]);const g=()=>{on(s,t,c=>{const u=c==null?void 0:c.data;a.debug("response data",u),r(Tt({dbs:s,tbl:t,frk:u}))},c=>{a.error("error",c),m(c)})},h=d.useMemo(()=>[{accessorKey:"constraint_name",header:"Constraint name",size:100},{accessorKey:"column_name",header:"Column name",size:100},{accessorKey:"referenced_table_name",header:"Referenced table",size:100},{accessorKey:"referenced_column_name",header:"Referenced column",size:100}],[]),b=Ie({..._e,columns:h,data:i,initialState:{density:"comfortable"},muiTableProps:{className:"pp-explorer-table"}});return a.debug(b),o!==""?e.jsx(d.Suspense,{children:e.jsx(Ia,{severity:"error",message:o,close:!1})}):n?n&&i.length===0?e.jsx(Ee,{msg:"Table contains no foreign keys"}):e.jsx(we,{table:b}):e.jsx(ce,{})};var K=(s=>(s[s.TABLE=0]="TABLE",s[s.VIEW=1]="VIEW",s))(K||{});const qs=d.memo(({dbs:s,tbl:t,typ:r})=>(a.debug(s,t,r),e.jsxs(e.Fragment,{children:[e.jsx(se,{itemId:s+"-"+t+"-columns",label:e.jsxs(l,{sx:{display:"inline-grid",gridTemplateColumns:"auto auto",gap:"10px",alignItems:"center"},children:[e.jsx(mn,{}),e.jsx("span",{children:"Columns"})]}),sx:{padding:0,minWidth:0},children:e.jsx(ya,{dbs:s,tbl:t})}),r===K.TABLE&&e.jsxs(e.Fragment,{children:[e.jsx(se,{itemId:s+"-"+t+"-indexes",label:e.jsxs(l,{sx:{display:"inline-grid",gridTemplateColumns:"auto auto",gap:"10px",alignItems:"center"},children:[e.jsx(hn,{}),e.jsx("span",{children:"Indexes"})]}),sx:{padding:0,minWidth:0},children:e.jsx(Sa,{dbs:s,tbl:t})}),e.jsx(se,{itemId:s+"-"+t+"-foreignkeys",label:e.jsxs(l,{sx:{display:"inline-grid",gridTemplateColumns:"auto auto",gap:"10px",alignItems:"center"},children:[e.jsx(Rn,{}),e.jsx("span",{children:"Foreign Keys"})]}),sx:{padding:0,minWidth:0},children:e.jsx(wa,{dbs:s,tbl:t})}),e.jsx(se,{itemId:s+"-"+t+"-triggers",label:e.jsxs(l,{sx:{display:"inline-grid",gridTemplateColumns:"auto auto",gap:"10px",alignItems:"center"},children:[e.jsx(Ws,{}),e.jsx("span",{children:"Triggers"})]}),sx:{padding:0,minWidth:0},children:e.jsx(va,{dbs:s,tbl:t})})]})]})));var pe=(s=>(s[s.MANAGE=0]="MANAGE",s[s.EXPLORE=1]="EXPLORE",s))(pe||{});const _a=s=>{const t=k(r=>St(r,s));return a.debug("tablesSelected",t),t},Ea=s=>{const t=k(r=>Ct(r,s));return a.debug("viewsSelected",t),t},Ys=d.memo(({dbs:s,tbl:t,typ:r,tableContext:n})=>{var b,c;a.debug(s,t,r);const i=H(),o=_a(s),m=Ea(s),g=jn("(max-width:900px)"),h=d.useMemo(()=>(n==null?void 0:n.wp_tables)!==void 0&&n.wp_tables.filter(u=>u===t).length>0?" (WordPress Table)":(n==null?void 0:n.wpda_tables)!==void 0&&n.wpda_tables.filter(u=>u===t).length>0?" (Plugin Table)":"",[]);return e.jsxs(l,{color:"primary",sx:{display:"grid",gridTemplateColumns:"calc(100% - 110px) auto",justifyContent:"space-between",alignItems:"center",gridGap:"20px",marginLeft:"-10px","&:hover":{".pp-row-actions":{visibility:g?"hidden":"visible"}}},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",justifyContent:"start",alignItems:"center",gridGap:"0",overflow:"hidden"},children:[e.jsx(l,{sx:{display:"grid",alignItems:"center"},children:e.jsx(de,{size:"small",checked:m.includes(t)||o.includes(t),onClick:u=>{r===K.VIEW?i(vt({dbs:s,vws:t,isSelected:!m.includes(t)})):i(It({dbs:s,tbl:t,isSelected:!o.includes(t)})),u.stopPropagation()}})}),e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",alignItems:"stretch"},children:[e.jsxs(l,{sx:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:[t," ",h]}),e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto auto auto",gridGap:"10px",marginLeft:"10px",alignItems:"center",visibility:"hidden"},className:"pp-row-actions",children:[e.jsx(l,{sx:{borderLeft:"1px solid black",height:"100%"}}),e.jsx(he,{title:"Manage table `"+t+"`",placement:"bottom",children:e.jsx(je,{underline:"none",onClick:u=>{i(Ge({dbs:s,tbl:t,typ:r,explorerAction:pe.MANAGE})),u.preventDefault(),u.stopPropagation()},children:"Manage"})}),e.jsx(l,{sx:{borderLeft:"1px solid black",height:"100%"}}),e.jsx(he,{title:"Explore table `"+t+"`",placement:"bottom",children:e.jsx(je,{underline:"none",onClick:u=>{i(Ge({dbs:s,tbl:t,typ:r,explorerAction:pe.EXPLORE})),u.preventDefault(),u.stopPropagation()},children:"Explore"})})]})]})]}),e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",justifyContent:"space-evenly",alignItems:"center"},children:[e.jsx(he,{title:"Manage table `"+t+"`",placement:"bottom",children:e.jsx(oe,{sx:{color:(b=ne)==null?void 0:b.palette.primary.main},onClick:u=>{i(Ge({dbs:s,tbl:t,typ:r,explorerAction:pe.MANAGE})),u.preventDefault(),u.stopPropagation()},children:e.jsx(fn,{})})}),e.jsx(he,{title:"Explore table `"+t+"`",placement:"bottom",children:e.jsx(oe,{sx:{color:(c=ne)==null?void 0:c.palette.primary.main},onClick:u=>{i(Ge({dbs:s,tbl:t,typ:r,explorerAction:pe.EXPLORE})),u.preventDefault(),u.stopPropagation()},children:e.jsx(bn,{})})})]})]})}),ka=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),Pa=d.memo(({dbs:s,search:t})=>{const r=H();a.debug(s,t);const n=k(h=>wt(h,s));a.debug("tablesLoaded",n);const i=k(h=>_t(h,s));a.debug("tables",i);const o=k(h=>Et(h,s));a.debug("tableContext",o);const[m,g]=d.useState("");return d.useEffect(()=>{n||ln(s,function(h){const b=h==null?void 0:h.data;a.debug("response data",b),r(kt({dbs:s,tbl:b,context:h.context??void 0}))},h=>{a.error("error",h),g(h??O.contactSupport)})},[n]),m!==""?e.jsx(d.Suspense,{children:e.jsx(ka,{severity:"error",message:m,close:!1})}):n?n&&i.length===0?e.jsx(l,{sx:{padding:"1rem"},children:e.jsx(ye,{children:"Database contains no tables"})}):e.jsxs(e.Fragment,{children:[...i.map(h=>{const b=!Fe(h,t);return e.jsx(se,{itemId:s+"-"+h,label:e.jsx(Ys,{dbs:s,tbl:h,typ:K.TABLE,tableContext:o}),sx:{visibility:b?"hidden":"inherit",position:b?"fixed !important":"inherit"},children:e.jsx(qs,{dbs:s,tbl:h,typ:K.TABLE})})})]}):e.jsx(ce,{})}),Aa=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),Ma=({dbs:s,search:t})=>{const r=H();a.debug(s,t);const n=k(h=>Pt(h,s));a.debug(n);const[i,o]=d.useState("");d.useEffect(()=>{n||g()},[n]);const m=k(h=>At(h,s));a.debug(m);const g=()=>{cn(s,h=>{const b=h==null?void 0:h.data;a.debug("response data",b),r(Mt({dbs:s,vws:b}))},h=>{a.error("error",h),o(h??O.contactSupport)})};return i!==""?e.jsx(d.Suspense,{children:e.jsx(Aa,{severity:"error",message:i,close:!1})}):n?n&&m.length===0?e.jsx(l,{sx:{padding:"1rem"},children:e.jsx(ye,{children:"Database contains no views"})}):e.jsxs(e.Fragment,{children:[...m.map(h=>{const b=!Fe(h,t);return e.jsx(se,{itemId:s+"-"+h,label:e.jsx(Ys,{dbs:s,tbl:h,typ:K.VIEW}),sx:{visibility:b?"hidden":"unset",position:b?"fixed !important":"inherit"},children:e.jsx(qs,{dbs:s,tbl:h,typ:K.VIEW})})})]}):e.jsx(ce,{})},La=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),Ra=({dbs:s,search:t})=>{a.debug(s,t);const r=H(),n=k(c=>Lt(c,s));a.debug(n);const i=k(c=>Rt(c,s));a.debug(i);const[o,m]=d.useState("");d.useEffect(()=>{n||g()},[n]);const g=()=>{dn(s,c=>{const u=c==null?void 0:c.data;a.debug("response data",u),r(Ot({dbs:s,prc:u}))},c=>{a.error("error",c),m(c??O.contactSupport)})},h=d.useMemo(()=>[{accessorKey:"routine_name",header:"Name",size:100},{accessorKey:"routine_definition",header:"Body",size:300,Cell:({cell:c})=>e.jsx("pre",{style:{padding:0,margin:0},children:c.getValue()})}],[]),b=Ie({..._e,columns:h,data:i.filter(c=>Fe(c.routine_name,t)),initialState:{density:"comfortable"},muiTableProps:{className:"pp-explorer-table"}});return a.debug(b),o!==""?e.jsx(d.Suspense,{children:e.jsx(La,{severity:"error",message:o,close:!1})}):n?n&&i.length===0?e.jsx(Ee,{msg:"Database contains no stored procedures"}):e.jsx(we,{table:b}):e.jsx(ce,{})},Oa=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),za=({dbs:s,search:t})=>{a.debug(s,t);const r=H(),n=k(c=>zt(c,s));a.debug(n);const i=k(c=>Dt(c,s));a.debug(i);const[o,m]=d.useState("");d.useEffect(()=>{n||g()},[n]);const g=()=>{pn(s,c=>{const u=c==null?void 0:c.data;a.debug("response data",u),r(Nt({dbs:s,fnc:u}))},c=>{a.error("error",c),m(c??O.contactSupport)})},h=d.useMemo(()=>[{accessorKey:"routine_name",header:"Name",size:100},{accessorKey:"routine_definition",header:"Body",size:300,Cell:({cell:c})=>e.jsx("pre",{style:{padding:0,margin:0},children:c.getValue()})}],[]),b=Ie({..._e,columns:h,data:i.filter(c=>Fe(c.routine_name,t)),initialState:{density:"comfortable"},muiTableProps:{className:"pp-explorer-table"}});return a.debug(b),o!==""?e.jsx(d.Suspense,{children:e.jsx(Oa,{severity:"error",message:o,close:!1})}):n?n&&i.length===0?e.jsx(Ee,{msg:"Database contains no functions"}):e.jsx(we,{table:b}):e.jsx(ce,{})};var $=(s=>(s.WP="wp",s.LOCAL="local",s.REMOTE="remote",s.SYSTEM="system",s))($||{});const Da=({setShowFilter:s})=>{const t=H(),r=k(i=>ks(i));a.debug(r);const n=k(i=>gs(i));return a.debug(n),d.useEffect(()=>{localStorage.setItem("ppExplorerSearchDbsTypes",JSON.stringify(r))},[r]),e.jsxs(ps,{sx:{position:"absolute",top:"4em",right:"0",minWidth:"-webkit-fill-available",zIndex:9999999},children:[e.jsx(Jn,{title:"Database filter",sx:{textAlign:"center"}}),e.jsx(us,{sx:{textAlign:"center",padding:"0 1em 1em 0"},children:e.jsxs(l,{sx:{display:"inline-grid",textAlign:"left","& label":{display:"flex",alignItems:"center"}},children:[e.jsx(U,{children:e.jsxs(ee,{children:[e.jsx(de,{size:"small",checked:r.includes($.WP),onChange:(i,o)=>{t(o?$e({dbsType:$.WP}):He({dbsType:$.WP}))}}),"WordPress database"]})}),e.jsx(U,{children:e.jsxs(ee,{children:[e.jsx(de,{size:"small",checked:r.includes($.LOCAL),onChange:(i,o)=>{t(o?$e({dbsType:$.LOCAL}):He({dbsType:$.LOCAL}))}}),"Local databases"]})}),e.jsx(U,{children:e.jsxs(ee,{children:[e.jsx(de,{size:"small",checked:r.includes($.REMOTE),onChange:(i,o)=>{t(o?$e({dbsType:$.REMOTE}):He({dbsType:$.REMOTE}))}}),"Remote databases"]})}),e.jsx(U,{children:e.jsxs(ee,{children:[e.jsx(de,{size:"small",checked:r.includes($.SYSTEM),onChange:(i,o)=>{t(o?$e({dbsType:$.SYSTEM}):He({dbsType:$.SYSTEM}))}}),"System databases"]})})]})}),e.jsxs(ea,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr"},children:[e.jsx(l,{}),e.jsx(G,{variant:"contained",onClick:()=>s(!1),children:"OK"})]})]})},Le=({search:s,setSearch:t,addFilter:r})=>{a.debug(s,r);const[n,i]=d.useState(!1);return e.jsxs(l,{sx:{position:"relative"},children:[e.jsx(ae,{value:s,type:"search",onChange:o=>{t(o.target.value)},onClick:o=>{o.stopPropagation()},onKeyDown:o=>{o.stopPropagation()},sx:{backgroundColor:"#fff",fontSize:"1em",margin:0,padding:0,borderRadius:"4px","&.MuiFormControl-root.MuiTextField-root .MuiInputBase-root":{paddingRight:0},"&.MuiFormControl-root.MuiTextField-root input":{padding:"8px"}},InputProps:{startAdornment:e.jsx(ws,{position:"end",sx:{fontSize:"1.5rem",padding:0,margin:0},children:e.jsx(yn,{})}),endAdornment:e.jsx(e.Fragment,{children:r&&e.jsx(ws,{position:"end",sx:{fontSize:"1.5rem",padding:0,margin:0},children:e.jsx(oe,{onClick:()=>{i(!n)},children:e.jsx(Tn,{})})})})}}),n&&e.jsx(Da,{setShowFilter:i})]})},Na=(s,t)=>{const r=k(n=>Ft(n,s,t));return a.debug("allTablesSelected",r),r},Fa=(s,t)=>{const r=k(n=>Bt(n,s,t));return a.debug("allViewsSelected",r),r},Re=s=>{const[t,r]=d.useState(localStorage.getItem(s)??""),n=i=>{r(i),localStorage.setItem(s,i)};return a.debug(t),{search:t,setSearch:n}},Ba=d.memo(({dbs:s})=>{a.debug(s);const t=H(),[r,n]=d.useState(!1),{search:i,setSearch:o}=Re(`ppExplorerSearchTables-${s}`);a.debug(r,i);const[m,g]=d.useState(!1),{search:h,setSearch:b}=Re(`ppExplorerSearchViews-${s}`);a.debug(m,h);const[c,u]=d.useState(!1),{search:S,setSearch:j}=Re(`ppExplorerSearchProcedures-${s}`);a.debug(c,S);const[T,v]=d.useState(!1),{search:I,setSearch:A}=Re(`ppExplorerSearchFunctions-${s}`);a.debug(T,I);const D=Na(s,i),_=Fa(s,h),[L,R]=d.useState("");return a.debug(L),e.jsxs(e.Fragment,{children:[e.jsx(se,{itemId:s+"-tables",className:"pp-data-exporer-table-tree-item "+L,onClickCapture:w=>{var z,N;!(w.target instanceof HTMLInputElement)&&!(w.target instanceof HTMLAnchorElement)&&!((z=w.target.closest("span"))!=null&&z.classList.contains("pp-select-all-tables"))&&((N=w.target.closest("li"))!=null&&N.classList.contains("pp-data-exporer-table-tree-item"))&&(R(L===""?"hide-details":""),r?w.stopPropagation():(n(!0),R("")))},sx:{padding:0,minWidth:0,"&.hide-details > ul":{visibility:"hidden",position:"fixed"}},label:e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"20px",justifyContent:"space-between",alignItems:"center","&:hover":{".pp-row-actions":{display:"grid"}}},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"10px",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:r&&L===""?0:"10px",justifyContent:"space-between",alignItems:"center",margin:"0 8px 0 4px"},children:[r&&L===""?e.jsx(de,{size:"small",className:"pp-select-all-tables",checked:D,onClick:w=>{t(Ps({dbs:s,isSelected:!D,search:i})),w.stopPropagation()},sx:{marginLeft:"-12px"}}):e.jsx(Ks,{}),"Tables"]}),e.jsxs(l,{className:"pp-row-actions",sx:{display:"none",gridTemplateColumns:"auto auto",gridGap:"10px",alignItems:"center"},children:[e.jsx(l,{sx:{borderLeft:"1px solid black",height:"100%"}}),e.jsx(je,{underline:"none",onClick:w=>{t(ze({dbs:s})),w.preventDefault(),w.stopPropagation()},children:"Refresh"})]})]}),e.jsx(l,{children:r&&L===""&&e.jsx(Le,{search:i,setSearch:o})})]}),children:e.jsx(Pa,{dbs:s,search:i})}),e.jsx(se,{itemId:s+"-views",onClick:()=>{g(!m)},label:e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"20px",justifyContent:"space-between",alignItems:"center","&:hover":{".pp-row-actions":{display:"grid"}}},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"10px",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:m?0:"10px",justifyContent:"space-between",alignItems:"center",margin:"0 8px 0 4px"},children:[m?e.jsx(de,{size:"small",checked:_,onClick:w=>{t(As({dbs:s,isSelected:!_,search:h})),w.stopPropagation()},sx:{marginLeft:"-12px"}}):e.jsx(Gs,{}),"Views"]}),e.jsxs(l,{className:"pp-row-actions",sx:{display:"none",gridTemplateColumns:"auto auto",gridGap:"10px",alignItems:"center"},children:[e.jsx(l,{sx:{borderLeft:"1px solid black",height:"100%"}}),e.jsx(je,{underline:"none",onClick:w=>{t(Ze({dbs:s})),w.preventDefault(),w.stopPropagation()},children:"Refresh"})]})]}),e.jsx(l,{children:m&&e.jsx(Le,{search:h,setSearch:b})})]}),sx:{padding:0,minWidth:0},children:e.jsx(Ma,{dbs:s,search:h})}),e.jsx(se,{itemId:s+"-procedures",onClick:()=>{u(!c)},label:e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"20px",justifyContent:"space-between",alignItems:"center","&:hover":{".pp-row-actions":{display:"grid"}}},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"10px",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"10px",justifyContent:"space-between",alignItems:"center",margin:"0 8px 0 4px"},children:[e.jsx(Ws,{}),"Stored Procedures"]}),e.jsxs(l,{className:"pp-row-actions",sx:{display:"none",gridTemplateColumns:"auto auto",gridGap:"10px",alignItems:"center"},children:[e.jsx(l,{sx:{borderLeft:"1px solid black",height:"100%"}}),e.jsx(je,{underline:"none",onClick:w=>{t(Vt({dbs:s})),w.preventDefault(),w.stopPropagation()},children:"Refresh"})]})]}),e.jsx(l,{children:c&&e.jsx(Le,{search:S,setSearch:j})})]}),sx:{padding:0,minWidth:0},children:e.jsx(Ra,{dbs:s,search:S})}),e.jsx(se,{itemId:s+"-functions",onClick:()=>{v(!T)},label:e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"20px",justifyContent:"space-between",alignItems:"center","&:hover":{".pp-row-actions":{display:"grid"}}},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"10px",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"10px",justifyContent:"space-between",alignItems:"center",margin:"0 8px 0 4px"},children:[e.jsx(On,{}),"Functions"]}),e.jsxs(l,{className:"pp-row-actions",sx:{display:"none",gridTemplateColumns:"auto auto",gridGap:"10px",alignItems:"center"},children:[e.jsx(l,{sx:{borderLeft:"1px solid black",height:"100%"}}),e.jsx(je,{underline:"none",onClick:w=>{t(Wt({dbs:s})),w.preventDefault(),w.stopPropagation()},children:"Refresh"})]})]}),e.jsx(l,{children:T&&e.jsx(Le,{search:I,setSearch:A})})]}),sx:{padding:0,minWidth:0},children:e.jsx(za,{dbs:s,search:I})})]})}),Va=()=>{const s=k(t=>Kt(t));return a.debug("countSelectedTables",s),s},Wa=()=>{const s=k(t=>Gt(t));return a.debug("hasBulkActions",s),s},Ka=()=>{const s=k(t=>$t(t));return a.debug("countSelectedViews",s),s};function Ga(s){const t=d.useRef(null);return e.jsx(Gn,{nodeRef:t,handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]',children:e.jsx(ds,{ref:t,...s})})}const xs=s=>{const{title:t,message:r,open:n,setOpen:i,onConfirm:o}=s;return e.jsxs(sa,{open:n,onClose:()=>i(!1),PaperComponent:Ga,"aria-labelledby":"confirm-dialog",children:[e.jsx(Wn,{style:{marginTop:"10px",cursor:"move"},id:"draggable-dialog-title",children:t}),e.jsx(ta,{children:e.jsx(Kn,{component:"div",children:r})}),e.jsx(na,{sx:{marginRight:"15px",marginBottom:"15px"},children:e.jsx(G,{variant:"contained",onClick:()=>{i(!1),o!==void 0&&o()},children:"OK"})})]})},Qs=()=>{const s=k(t=>Ht(t));return a.debug("context",s),s},$a=(s,t,r,n,i,o=!1)=>{a.debug(s,t,r),Be(ve.appUrlActionRename,{dbs:s,from_tbl:t,to_tbl:r},n,i,o)},Ha=(s,t,r,n,i,o,m,g=!1)=>{a.debug(s,t,r,n,i),Be(ve.appUrlActionCopy,{from_dbs:s,to_dbs:t,from_tbl:r,to_tbl:n,copy_data:i},o,m,g)},Xs=(s,t,r,n,i=!1)=>{a.debug(s,t),Be(ve.appUrlActionTruncate,{dbs:s,tbl:t},r,n,i)},Js=(s,t,r,n,i,o=!1)=>{a.debug(s,t,r),Be(ve.appUrlActionDrop,{dbs:s,tbl:t,typ:r},n,i,o)},Ua=(s,t,r,n,i=!1)=>{a.debug(s);const o=new FormData;o.append("dbs",s),Object.keys(t).map(m=>{o.append("file"+m,t[m])}),Be(ve.appUrlActionImport,o,r,n,i)},Ae={export:"Export table(s)",truncate:"Truncate table(s)",drop:"Drop table(s)/view(s)"},qa=()=>{const s=H(),t=Wa(),r=Va(),n=Ka(),i=Qs(),[o,m]=d.useState({}),[g,h]=d.useState("*"),[b,c]=d.useState(null),[u,S]=d.useState(!1),[j,T]=d.useState(!1),[v,I]=d.useState(!1);d.useEffect(()=>{r===0&&(g==="export"||g==="truncate")&&h("*")},[r]);const A={vertical:"top",horizontal:"right"},D=()=>{const y=Ms(cs.getState()),x={};return y==null?{}:(Object.keys(y).map(f=>{y[f].tablesSelected.map(C=>{x[f]===void 0&&(x[f]={}),x[f][C]={status:null,typ:K.TABLE}}),g==="drop"&&y[f].viewsSelected.map(C=>{x[f]===void 0&&(x[f]={}),x[f][C]={status:null,typ:K.VIEW}})}),x)},_=(y,x,f)=>{const C={...o};x==="*"?Object.keys(C[y]).map(E=>C[y][E].status=f):C[y][x].status=f,m(C)},L=()=>{Object.keys(o).length>0&&Object.keys(o).map(y=>{window.document.getElementById(`pp-export-tables-${y}`).submit(),_(y,"*",!0)})},R=()=>{Object.keys(o).length>0&&Object.keys(o).map(y=>{Object.keys(o[y]).map(x=>{Xs(y,x,f=>{a.debug(f),(f==null?void 0:f.code)==="ok"&&(f==null?void 0:f.message)!==void 0?_(y,x,!0):_(y,x,!1)},f=>{a.error("error",y,x,f),_(y,x,!1)})})})},w=()=>{Object.keys(o).length>0&&Object.keys(o).map(y=>{Object.keys(o[y]).map(x=>{Js(y,x,o[y][x].typ,f=>{a.debug(f),(f==null?void 0:f.code)==="ok"&&(f==null?void 0:f.message)!==void 0?_(y,x,!0):_(y,x,!1)},f=>{a.error("error",f),_(y,x,!1)})})})},z=y=>e.jsxs(Fs,{sx:{"& th":{fontWeight:"bold",padding:"4px 6px"},"& td":{padding:"4px 6px",border:"none"}},children:[e.jsx(Bs,{children:e.jsxs(ss,{children:[e.jsx(Z,{children:"Database"}),e.jsx(Z,{children:"Table | View"}),e.jsx(Z,{children:"Status"})]})}),e.jsx(Vs,{children:Object.keys(y).map(x=>Object.keys(y[x]).map((f,C)=>{var E,M;return e.jsxs(ss,{children:[e.jsx(Z,{children:C===0?x:null}),e.jsx(Z,{children:f}),e.jsxs(Z,{children:[y[x][f]===null&&e.jsx(Cn,{style:{display:"block",margin:"0 auto"}}),y[x][f].status===!0&&e.jsx(Rs,{color:(E=ne)==null?void 0:E.palette.success.main,style:{display:"block",margin:"0 auto"}}),y[x][f].status===!1&&e.jsx(Os,{color:(M=ne)==null?void 0:M.palette.error.main,style:{display:"block",margin:"0 auto"}})]})]},C)}))})]}),N=()=>e.jsx(l,{children:z(o)}),F=()=>{const y=D();return m(y),e.jsxs(l,{children:[z(y),(g==="truncate"||g==="drop")&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{style:{marginTop:"20px"}}),e.jsx(l,{sx:{marginTop:"20px",marginBottom:"20px"},children:g==="drop"?e.jsx("span",{children:"Deletes views and tables with all data permanently."}):e.jsx("span",{children:"Deletes all data permanently."})}),e.jsx(l,{children:e.jsx("strong",{children:"This actions cannot be undone!"})}),e.jsxs(l,{children:["'",e.jsx("strong",{children:"NO"}),"' to stop, '",e.jsx("strong",{children:"YES"}),"' to continue."]}),e.jsxs(l,{sx:{marginTop:"20px",fontSize:"80%",display:"inline-grid",gridTemplateColumns:"auto auto",justifyContent:"space-between",alignItems:"center",gap:"5px"},children:[e.jsx(Sn,{}),e.jsxs("span",{children:["Does not ",g," WordPress tables"]})]})]})]})};return t?e.jsxs(e.Fragment,{children:[e.jsx(as,{className:"pp-bulk-actions-container",color:"inherit",position:"relative",elevation:4,sx:{margin:"0 0 5px 0"},children:e.jsxs(rs,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"12px",justifyContent:"space-between"},children:[e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"12px",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(U,{variant:"standard",sx:{minWidth:200},children:e.jsxs(be,{MenuProps:{id:"pp-select-menu"},value:g,onChange:y=>{h(y.target.value)},children:[e.jsx(W,{value:"*",children:"Bulk actions"}),e.jsx(W,{value:"export",disabled:r===0,children:Ae.export}),e.jsx(W,{value:"truncate",disabled:r===0,children:Ae.truncate}),e.jsx(W,{value:"drop",children:Ae.drop})]})}),e.jsx(G,{variant:"contained",onClick:()=>{g!=="*"?(c(F()),S(!0)):T(!0)},children:"Apply"})]}),e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",gap:"12px",justifyContent:"space-between"},children:[e.jsx(Ss,{badgeContent:r,color:"info",anchorOrigin:A,children:e.jsx(Ks,{color:"action",size:20})}),e.jsx(Ss,{badgeContent:n,color:"info",anchorOrigin:A,children:e.jsx(Gs,{color:"action",size:20})})]})]})}),g==="export"&&Object.keys(o).map(y=>e.jsxs("form",{id:"pp-export-tables-"+y,action:i.wp.home+"?action=wpda_export",method:"post",target:"_blank",children:[e.jsx("input",{type:"hidden",name:"type",value:"table"}),e.jsx("input",{type:"hidden",name:"wpdaschema_name",value:y}),Object.keys(o[y]).map(x=>e.jsx("input",{type:"hidden",name:"table_names[]",value:x},x)),e.jsx("input",{type:"hidden",name:"_wpnonce",value:i.wp.nonce.split("-")[0]})]},"pp-export-tables-"+y)),e.jsx(xs,{title:"Apply bulk action",message:"No bulk action selected",open:j,setOpen:T}),e.jsx(ue,{title:Ae[g],message:b,open:u,setOpen:S,onConfirm:()=>{switch(I(!0),g){case"export":L();break;case"truncate":R();break;case"drop":w()}}}),e.jsx(xs,{title:Ae[g],message:N(),open:v,setOpen:I,onConfirm:()=>{Object.keys(o).map(y=>{s(ze({dbs:y})),s(Ps({dbs:y,isSelected:!1,search:""})),s(Ze({dbs:y})),s(As({dbs:y,isSelected:!1,search:""}))})}})]}):null},fs=()=>{const s=k(t=>Ms(t));return a.debug(s),s},Ya=({setCanImport:s})=>{var N,F,y;const t=Qs(),r=fs(),[n,i]=d.useState(""),[o,m]=d.useState("");d.useEffect(()=>{if(r!=null&&Object.keys(r).length>0){const x=Object.keys(r).filter(f=>r[f].dbsType===$.WP);(x==null?void 0:x.length)>0&&i(x[0])}},[r]);const g=d.useRef(null),[h,b]=d.useState(null),c=(N=t==null?void 0:t.wp)!=null&&N.zip?".sql,.zip":".sql",u=(F=t==null?void 0:t.wp)!=null&&F.zip?"SQL and ZIP":"SQL",S=(y=t==null?void 0:t.wp)==null?void 0:y.upload,[j,T]=d.useState(!1),[v,I]=d.useState(null),[A,D]=d.useState(!1),[_,L]=d.useState(""),[R,w]=d.useState(null),z=x=>e.jsx(e.Fragment,{children:e.jsxs(Fs,{sx:{"& th":{fontWeight:"bold",padding:"4px 6px"},"& td":{padding:"4px 6px",border:"none"}},children:[e.jsx(Bs,{children:e.jsxs(ss,{children:[e.jsx(Z,{children:"Import file"}),e.jsx(Z,{children:"Message"}),e.jsx(Z,{children:"Status"})]})}),e.jsx(Vs,{children:x.map(f=>Object.keys(f).map(C=>{var E,M;return e.jsxs(ss,{children:[e.jsx(Z,{sx:{verticalAlign:"text-top"},children:C}),e.jsxs(Z,{sx:{verticalAlign:"text-top"},children:[f[C].msg,f[C].errors.map(q=>{var B;return e.jsx("ul",{style:{listStyle:"disc",padding:"0 40px"},children:e.jsx("li",{style:{color:(B=ne)==null?void 0:B.palette.error.main},children:q})})})]}),e.jsx(Z,{sx:{verticalAlign:"text-top"},children:f[C].status==="error"?e.jsx(Os,{color:(E=ne)==null?void 0:E.palette.error.main,style:{display:"block",margin:"0 auto"}}):e.jsx(Rs,{color:(M=ne)==null?void 0:M.palette.success.main,style:{display:"block",margin:"0 auto"}})})]},C)}))})]})});return e.jsxs(e.Fragment,{children:[e.jsxs(l,{className:"pp-import-container",sx:{position:"relative","& > .tooltip":{position:"absolute",top:"10px",right:"10px",zIndex:999}},children:[e.jsx(Je,{title:"Close",position:"bottom",children:e.jsx(oe,{onClick:()=>{g.current&&(g.current.value=""),m(""),s(!1)},size:"large",color:"inherit",sx:{fontSize:"1.4em"},children:e.jsx(zs,{})})}),e.jsx(as,{className:"pp-import-container",color:"inherit",position:"relative",elevation:4,sx:{display:"grid",alignItems:"center",margin:"0 0 5px 0"},children:e.jsxs(rs,{sx:{display:"grid",gap:"10px",alignItems:"center",height:"max-content",paddingTop:"50px",paddingBottom:"30px"},children:[e.jsx(e.Fragment,{children:e.jsxs(l,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"start",alignItems:"center",gap:"15px"},children:[e.jsx(l,{children:e.jsxs(U,{sx:{minWidth:"300px"},children:[e.jsx(ts,{variant:"outlined",children:"Select destination database"}),e.jsx(be,{MenuProps:{id:"pp-select-menu"},label:"Select destination database",value:n,onChange:x=>{i(x.target.value)},children:r!=null&&Object.keys(r).map(x=>{const f=r[x].dbsType===$.WP?x+" (WordPress database)":x;return e.jsx(W,{value:x,children:f},x)})})]})}),e.jsx(l,{children:e.jsx("form",{children:e.jsxs(G,{component:"label",variant:"outlined",startIcon:e.jsx(vn,{}),children:["Select file(s)",e.jsx(ae,{type:"file",inputProps:{accept:c,multiple:!0},onChange:x=>{const f=x.target.files;b(f);const C=Object.keys(f).map(E=>f[E].name).toString();m(C)},InputProps:{inputRef:g},sx:{display:"none"}})]})})}),o!==""&&e.jsx(e.Fragment,{children:e.jsx(l,{children:e.jsx(G,{component:"label",variant:"contained",startIcon:e.jsx(In,{}),onClick:()=>{I(e.jsxs(l,{children:[e.jsxs(l,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["Selected file(s): ",e.jsx("strong",{children:o})]}),e.jsxs(l,{children:["Selected database: ",e.jsx("strong",{children:n})]}),e.jsxs(l,{sx:{marginTop:"20px",fontSize:"80%"},children:[e.jsx("strong",{children:"NOTE"}),"  You can work on other tasks while your import is performed in the background."]})]})),T(!0)},children:"Import file(s)"})})})]})}),o!==""&&e.jsxs(l,{sx:{marginTop:"20px",marginBottom:"10px",minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left",fontWeight:"bold"},children:["Selected file(s): ",o]}),e.jsxs("fieldset",{className:"pp-fieldset",style:{marginTop:"5px",padding:"10px 30px",minWidth:0},children:[e.jsx("legend",{children:"IMPORTANT"}),e.jsxs("ul",{style:{paddingLeft:"15px",listStyle:"disc",padding:"0 40px"},children:[e.jsx("li",{children:"Supports multiple file uploads simultaneously."}),e.jsxs("li",{children:["Server supports ",u," file types."]}),e.jsxs("li",{children:["Maximum supported file size on this server is ",S,"."]}),e.jsx("li",{children:"Add a ; and a new line character at the end of every SQL statement."})]})]})]})})]}),e.jsx(ue,{title:"Import selected file(s)?",message:v,open:j,setOpen:T,onConfirm:()=>{Ua(n,h,x=>{var f;if(x!=null&&x.message&&((f=x==null?void 0:x.context)!=null&&f.imported)&&Array.isArray(x.context.imported)){const C=x.context.imported;D(!0),L(x.message),w(z(C))}else P(O.contactSupport,{variant:"error"})},x=>{a.error("error",x),P(O.contactSupport,{variant:"error"})})}}),e.jsx(xs,{title:_,message:R,open:A,setOpen:D,onConfirm:()=>{m(""),s(!1)}})]})};const Es=d.lazy(()=>re(()=>import("./Alert-1.0.13-3cded9f0.js"),["./Alert-1.0.13-3cded9f0.js","./main-1.0.13.js","./index.esm-1.0.13-8cdddba7.js","./iconBase-1.0.13-98e06aa9.js","./AlertTitle-1.0.13-80063b16.js","./Close-1.0.13-b137ce2f.js","./useSlot-1.0.13-62ad37b6.js"],import.meta.url)),Qa=()=>{var D;const s=H(),t=d.useRef(null),{search:r,setSearch:n}=Re("ppExplorerSearch"),i=fs(),o=k(_=>Ut(_));a.debug(o);const m=k(_=>ms(_));a.debug(m);const g=k(_=>ks(_));a.debug(g);const[h,b]=d.useState("");d.useEffect(()=>{window.ppActionEnableImport=(_=!0)=>{I(_)},c()},[]);const c=()=>{let _=[];const L=localStorage.getItem("ppExplorerSearchDbsTypes");L!=null&&L!==""?_=JSON.parse(L):_=[$.WP,$.LOCAL,$.REMOTE],un(R=>{const w=R==null?void 0:R.data;a.debug("response data",w);const z=[],N={};w.map(x=>{z.push({dbs:x.dbs,dbsType:x.dbs_type,pdsDbs:x.pds}),N[x.dbs]=!1}),S(N),z.sort((x,f)=>{var C,E,M,q;return((C=x==null?void 0:x.dbs)==null?void 0:C.toLocaleLowerCase())>((E=f==null?void 0:f.dbs)==null?void 0:E.toLocaleLowerCase())?1:((M=f==null?void 0:f.dbs)==null?void 0:M.toLocaleLowerCase())>((q=x==null?void 0:x.dbs)==null?void 0:q.toLocaleLowerCase())?-1:0}),a.debug(z),s(qt({dbs:z,dbsTypes:_}));const F={};w.map(x=>{F[x.dbs]=x.dbs_type}),s(Yt({dbs:F}));const y=R.context;a.debug("context",y),s(Qt({context:y}))},R=>{a.error("error",R),b(R??O.contactSupport)})},[u,S]=d.useState({}),[j,T]=d.useState(!0),[v,I]=d.useState(!1),A=()=>e.jsx(he,{title:"Import data or execute scripts",children:e.jsx(oe,{sx:{color:"inherit"},onClick:()=>{I(!v)},children:e.jsx(_n,{})})});return h!==""?e.jsx(d.Suspense,{children:e.jsx(Es,{severity:"error",message:h,close:!1})}):e.jsxs(l,{className:"pp-sub-container-explorer",sx:{width:"100%"},children:[e.jsx(as,{className:"pp-explorer-header",elevation:4,position:"relative",sx:{margin:"0 0 5px 0"},children:e.jsxs(rs,{sx:{display:"grid",gridTemplateColumns:"1fr auto",gap:"12px",justifyContent:"space-between",paddingRight:"12px !important"},children:[((D=ve.appOrig)==null?void 0:D.appTarget)==="backend"?e.jsx(l,{sx:{textAlign:"right"},children:"Search & Filter"}):e.jsxs(l,{sx:{display:"inline-grid",gridTemplateColumns:"auto auto",justifyContent:"start",alignItems:"center",gridGap:"10px"},children:[e.jsx(l,{sx:{fontSize:"18px",lineHeight:"18px",fontWeight:"bold",whiteSpace:"nowrap"},children:"Data Explorer"}),e.jsx(l,{children:A()})]}),e.jsx(l,{children:e.jsx(Le,{search:r,setSearch:n,addFilter:!0})})]})}),e.jsx(qa,{}),v&&e.jsx(Ya,{setCanImport:I}),i==null?e.jsx(l,{sx:{padding:"30px"},children:e.jsx(hs,{title:"Loading..."})}):e.jsxs(e.Fragment,{children:[o!==""&&e.jsx(ds,{sx:{marginBottom:"5px"},elevation:4,children:e.jsx(d.Suspense,{children:e.jsx(Es,{severity:"error",message:o,close:!0,setClose:()=>{s(Ls({error:""}))}})})}),e.jsx(ds,{className:"pp-data-exporer",elevation:4,children:e.jsx(Bn,{className:"pp-data-exporer-database-tree","aria-label":"Data Explorer",sx:{display:"grid",gridGap:"0","& li.MuiTreeItem-root:first-of-type li.MuiTreeItem-root:first-of-type":{borderTopLeftRadius:0,borderTopRightRadius:0}},children:Object.keys(i).map(_=>{var R;if(g.includes(m[_])===!1||r!==""&&!Fe(_,r))return null;const L=((R=m[_])==null?void 0:R.toLocaleLowerCase())==="wp"?_+" (WordPress database)":_;return e.jsx(se,{ref:t,slots:{expandIcon:le,collapseIcon:j?le:wn},itemId:_,className:"pp-data-exporer-database-tree-item hide-details",onClickCapture:w=>{var z,N,F,y;if((z=w.target.closest("li"))!=null&&z.classList.contains("pp-data-exporer-database-tree-item"))if((N=w.target.closest("li"))!=null&&N.classList.contains("hide-details")?((F=w.target.closest("li"))==null||F.classList.remove("hide-details"),T(!1)):((y=w.target.closest("li"))==null||y.classList.add("hide-details"),T(!0)),u[_])w.stopPropagation();else{const x=u;x[_]=!0,S(x)}},sx:{padding:"0","&.hide-details > ul":{visibility:"hidden",position:"fixed"}},label:e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"auto auto",justifyContent:"start",alignItems:"center",gap:"10px"},children:[e.jsx(Ln,{}),L]}),children:e.jsx(Ba,{dbs:_})},_)})})})]})]})},Xa=()=>{const s=k(t=>gs(t));return a.debug(s),e.jsx(e.Fragment,{children:s!==void 0&&s.action===pe.EXPLORE&&e.jsx(aa,{appId:En(),dbs:s.dbs,tbl:s.tbl,exploring:!0})})},Ja=({dbs:s,tbl:t})=>{a.debug(s,t);const[r,n]=d.useState(!1),[i,o]=d.useState(void 0),m=()=>{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(Se,{disableGutters:!0,children:[e.jsx(Ce,{expandIcon:e.jsx(le,{}),children:"Reset"}),e.jsx(Te,{children:e.jsxs(U,{sx:{display:"grid",gridGap:"20px"},children:[e.jsx(G,{variant:"contained",color:"primary",onClick:()=>{o(ls.TABLE),n(!0)},children:"Reset Table Builder"}),e.jsx(G,{variant:"contained",color:"primary",onClick:()=>{o(ls.FORM),n(!0)},children:"Reset Form Builder"}),e.jsx(G,{variant:"contained",color:"primary",onClick:()=>{o(ls.THEME),n(!0)},children:"Reset Theme"}),e.jsxs(xe,{sx:{display:"inline-grid",gridTemplateColumns:"20px auto",gridGap:"5px",alignItems:"center","& svg":{fontSize:"20px"}},error:!0,children:[e.jsx(Ds,{}),"A reset cannot be undone!"]})]})})]}),e.jsx(ue,{title:m(),message:"Are you sure? This action cannot be undone!",open:r,setOpen:n,onConfirm:()=>{i!==void 0&&$n(ra.GLOBAL,i,s,t,null,null,g=>{if(g!=null&&g.code&&(g==null?void 0:g.message)!==void 0)switch(g.code){case"ok":P(g.message,{variant:"success"});break;case"info":P(g.message,{variant:"info"});break;default:P(g.message??O.contactSupport,{variant:"error"})}else a.error(g),P(O.contactSupport,{variant:"error"})},g=>{a.error("error",g),P(g??O.contactSupport,{variant:"error"})})}})]})},Za=({dbs:s,tbl:t,setIsUpdated:r})=>{a.debug(s,t);const n=H(),i=k(m=>fe(m));a.debug(i);const o=m=>{const g={...i,table_settings:{...i.table_settings,hyperlink_definition:m}};n(Xe({settings:g})),r(!0)};return e.jsxs(Se,{disableGutters:!0,children:[e.jsx(Ce,{expandIcon:e.jsx(le,{}),children:"Table Settings"}),e.jsx(Te,{children:e.jsxs(U,{children:[e.jsx(ee,{children:"Process hyperlink columns as"}),e.jsxs(Hs,{sx:{marginTop:"10px",marginBottom:"10px"},children:[e.jsxs(ee,{className:"align-label-radio",children:[e.jsx(ns,{checked:i.table_settings.hyperlink_definition==="json",onChange:m=>{o("json"),m.stopPropagation()}}),"Preformatted JSON"]}),e.jsxs(ee,{children:[e.jsx(ns,{checked:i.table_settings.hyperlink_definition==="text",onChange:m=>{o("text"),m.stopPropagation()}}),"Plain text"]})]}),e.jsx(xe,{children:"Preformatted JSON supports individual label and target settings. Plain text converts column content to a hyperlink link."})]})})]})},er=({dbs:s,tbl:t,setIsUpdated:r})=>{var u;a.debug(s,t);const n=H(),i=k(S=>Xt(S));a.debug(i);const o=k(S=>fe(S));a.debug(o);const[m,g]=d.useState(""),h=(S,j)=>{const T={...o,list_labels:{...o.list_labels,[S]:j}};n(Xe({settings:T})),r(!0)},b=(S,j)=>{const T={...o,form_labels:{...o.form_labels,[S]:j}};n(Xe({settings:T})),r(!0)},c=(S,j)=>{const T={...o,column_media:{...o.column_media,[S]:j}};n(Xe({settings:T})),r(!0)};return e.jsxs(Se,{disableGutters:!0,slotProps:{transition:{unmountOnExit:!0}},children:[e.jsx(Ce,{expandIcon:e.jsx(le,{}),children:"Column Settings"}),e.jsx(Te,{children:e.jsxs(U,{fullWidth:!0,children:[e.jsx(l,{sx:{display:"grid",gridGap:"10px",marginBottom:"20px"},children:e.jsxs(l,{children:[...(u=i==null?void 0:i.columns)==null?void 0:u.map((S,j)=>{const T=S.column_name;return e.jsxs(Se,{expanded:m===T,onChange:()=>{g(m===T?"":T)},sx:{"&.MuiPaper-root.MuiPaper-elevation.Mui-expanded":{margin:0}},children:[e.jsx(Ce,{expandIcon:e.jsx(le,{}),children:S.column_name}),e.jsxs(Te,{sx:{display:"grid",gridGap:"10px"},children:[e.jsx(ae,{label:"Table label",value:o.list_labels[T],variant:"outlined",onChange:v=>{h(T,v.target.value)}}),e.jsx(ae,{label:"Form label",value:o.form_labels[T],variant:"outlined",onChange:v=>{b(T,v.target.value)}}),e.jsxs(U,{children:[e.jsx(ts,{id:"media_type_label"+j,variant:"outlined",children:"Media type"}),e.jsxs(be,{MenuProps:{id:"pp-select-menu"},labelId:"media_type_label"+j,id:"media_type"+j,label:"Media type",value:o.column_media[T]??"",variant:"outlined",onChange:v=>{c(T,v.target.value),v.stopPropagation()},children:[e.jsx(W,{value:"",children:" "},""),e.jsx(W,{value:"Attachment",children:"Attachment"},"Attachment"),e.jsx(W,{value:"Audio",children:"Audio"},"Audio"),e.jsx(W,{value:"Hyperlink",children:"Hyperlink"},"Hyperlink"),e.jsx(W,{value:"Image",children:"Image"},"Image"),e.jsx(W,{value:"ImageURL",children:"ImageURL"},"ImageURL"),e.jsx(W,{value:"Video",children:"Video"},"Video")]})]})]})]})})]})}),e.jsx(xe,{children:"Default column labels and column media types"})]})})]})};var Y=(s=>(s.SELECT="select",s.INSERT="insert",s.UPDATE="update",s.DELETE="delete",s))(Y||{}),Oe=(s=>(s.GET="GET",s.POST="POST",s))(Oe||{});const Qe=({restApi:s,action:t,roles:r,users:n,setRestApi:i,expanded:o,setExpanded:m})=>{a.debug(s,t,r,n,o);const g=(j,T)=>{const v=ia(s);if(T)v.methods.push(j);else{const I=v.methods.indexOf(j);I>-1&&v.methods.splice(I,1)}a.debug(j,T,v),i(v)},h=j=>{a.debug(j),i({...s,authorization:j})},b=j=>{a.debug(j),i({...s,authorized_roles:j.map(T=>T.key)})},c=j=>{a.debug(j),i({...s,authorized_users:j.map(T=>T.key)})},u=d.useMemo(()=>r.filter(j=>s.authorized_roles.includes(j.key)),[s.authorized_roles,r]),S=d.useMemo(()=>n.filter(j=>s.authorized_users.includes(j.key)),[s.authorized_users,n]);return e.jsxs(Se,{disableGutters:!0,expanded:o===t.toString(),onChange:()=>{o===t.toString()?m(""):m(t)},children:[e.jsx(Ce,{expandIcon:e.jsx(le,{}),sx:{textTransform:"capitalize"},children:t}),e.jsx(Te,{children:e.jsxs(l,{sx:{display:"grid",gridGap:"20px"},children:[e.jsx(ee,{children:"Supported HTTP methods"}),e.jsxs(l,{children:[e.jsx(Ne,{control:e.jsx(De,{checked:s.methods.includes(Oe.GET),onChange:(j,T)=>{g(Oe.GET,T),j.stopPropagation()}}),label:"GET",labelPlacement:"end"}),e.jsx(Ne,{control:e.jsx(De,{checked:s.methods.includes(Oe.POST),onChange:(j,T)=>{g(Oe.POST,T),j.stopPropagation()}}),label:"POST",labelPlacement:"end"})]}),e.jsx(ee,{children:"Authorization"}),e.jsxs(U,{sx:{marginLeft:"-10px"},children:[e.jsxs(Hs,{children:[e.jsxs(ee,{className:"align-label-radio",sx:{cursor:"pointer"},children:[e.jsx(ns,{checked:s.authorization===Pe.AUTHORIZED,onChange:j=>{h(Pe.AUTHORIZED),j.stopPropagation()}}),"Authorized access only"]}),e.jsxs(l,{sx:{display:"grid",gridGap:"10px",margin:"20px 10px 20px 42px"},children:[e.jsx(vs,{multiple:!0,disableCloseOnSelect:!0,options:r,getOptionLabel:j=>j.value,value:u,onChange:(j,T)=>{b(T)},renderInput:j=>e.jsx(ae,{...j,label:"Roles"}),renderTags:(j,T)=>j.map((v,I)=>{const{key:A,...D}=T({index:I});return e.jsx(Is,{variant:"outlined",label:v.value,...D},A)})}),e.jsx(vs,{multiple:!0,disableCloseOnSelect:!0,options:n,getOptionLabel:j=>j.value,value:S,onChange:(j,T)=>{c(T)},renderInput:j=>e.jsx(ae,{...j,label:"Users"}),renderTags:(j,T)=>j.map((v,I)=>{const{key:A,...D}=T({index:I});return e.jsx(Is,{variant:"outlined",label:v.value,...D},A)})})]}),e.jsxs(ee,{className:"align-label-radio",sx:{cursor:"pointer"},children:[e.jsx(ns,{checked:s.authorization===Pe.ANONYMOUS,onChange:j=>{h(Pe.ANONYMOUS),j.stopPropagation()}}),"Anonymous access"]})]}),s.authorization===Pe.ANONYMOUS&&s.methods.length>0&&e.jsxs(l,{sx:{marginTop:"10px",marginLeft:"10px"},children:[(t===Y.INSERT||t===Y.UPDATE||t===Y.DELETE)&&e.jsx(xe,{children:"This setting allows non-authorized users to modify this table"}),t===Y.SELECT&&e.jsx(xe,{children:"This setting allows non-authorized users to query this table"})]})]})]})})]})},sr=({dbs:s,tbl:t,typ:r,metaData:n,setIsUpdated:i})=>{var S,j,T,v;a.debug(s,t,r,n);const o=H(),m=k(I=>fe(I));a.debug(m);const g=k(I=>ms(I));a.debug(g);const[h,b]=d.useState(""),c=[];if(((j=(S=n==null?void 0:n.settings)==null?void 0:S.wp)==null?void 0:j.roles)!==void 0)for(const I in n.settings.wp.roles)c.push({key:I,value:n.settings.wp.roles[I]});a.debug(c);const u=[];if(((v=(T=n==null?void 0:n.settings)==null?void 0:T.wp)==null?void 0:v.users)!==void 0)for(const I in n.settings.wp.users)u.push({key:I,value:n.settings.wp.users[I]});return a.debug(u),e.jsxs(Se,{disableGutters:!0,slotProps:{transition:{unmountOnExit:!0}},children:[e.jsx(Ce,{expandIcon:e.jsx(le,{}),children:"REST API"}),e.jsx(Te,{children:e.jsxs(l,{children:[e.jsx(Ne,{control:e.jsx(De,{checked:m.rest_api!==null,onClick:I=>{m.rest_api!==null?o(Jt({})):o(Zt({})),i(!0),I.stopPropagation()}}),label:"Enable REST API",labelPlacement:"end"}),m.rest_api!==null&&e.jsxs(l,{sx:{marginTop:"20px"},children:[e.jsx(Qe,{restApi:m.rest_api.select,action:Y.SELECT,roles:c,users:u,setRestApi:I=>{const A={...m.rest_api};A[Y.SELECT]=I,o(Ue({rest_api:A})),i(!0)},expanded:h,setExpanded:b}),e.jsx(Qe,{restApi:m.rest_api.insert,action:Y.INSERT,roles:c,users:u,setRestApi:I=>{const A={...m.rest_api};A[Y.INSERT]=I,o(Ue({rest_api:A})),i(!0)},expanded:h,setExpanded:b}),e.jsx(Qe,{restApi:m.rest_api.update,action:Y.UPDATE,roles:c,users:u,setRestApi:I=>{const A={...m.rest_api};A[Y.UPDATE]=I,o(Ue({rest_api:A})),i(!0)},expanded:h,setExpanded:b}),e.jsx(Qe,{restApi:m.rest_api.delete,action:Y.DELETE,roles:c,users:u,setRestApi:I=>{const A={...m.rest_api};A[Y.DELETE]=I,o(Ue({rest_api:A})),i(!0)},expanded:h,setExpanded:b})]}),g[s]==="system"||g[s]==="wp"&&n.settings.wp.tables.includes(t)&&e.jsxs(xe,{sx:{display:"inline-grid",gridTemplateColumns:"20px auto",gridGap:"5px",marginTop:"20px",alignItems:"center","& svg":{fontSize:"20px"}},children:[e.jsx(Ds,{}),"We discourage enabling REST API services for WordPress and system tables"]})]})})]})},tr=({dbs:s,tbl:t,typ:r,metaData:n})=>{var B,te,Q,ke,Ve,ge,We,Ke;a.debug(s,t,r,n);const i=H(),[o,m]=d.useState("sql"),[g,h]=d.useState(!0),[b,c]=d.useState(""),[u,S]=d.useState(s),[j,T]=d.useState(""),[v,I]=d.useState(!0),[A,D]=d.useState(!1),[_,L]=d.useState(!1),[R,w]=d.useState(!1),[z,N]=d.useState(!1),F=fs();a.debug(F);const y=d.useMemo(()=>{const p=[];for(const X in F)p.push(X);return p},[F]);a.debug(y);const x=k(p=>ms(p));a.debug(x);const[f,C]=d.useState(F[s].pdsDbs===!0?((Q=(te=(B=n==null?void 0:n.settings)==null?void 0:B.wp)==null?void 0:te.connect)==null?void 0:Q.interval)??"":""),[E,M]=d.useState(F[s].pdsDbs===!0?((ge=(Ve=(ke=n==null?void 0:n.settings)==null?void 0:ke.wp)==null?void 0:Ve.connect)==null?void 0:ge.unit)??"":""),q=p=>{kn.post(n.settings.wp.homea+"?action=wpda_pds_update_interval",p,{headers:{"Content-Type":"multipart/form-data"}}).then(X=>{a.error(p,X)}).catch(X=>{a.error("error",X)})};return e.jsxs(e.Fragment,{children:[e.jsxs(l,{sx:{margin:0,padding:0,"& .pp-action":{display:"grid",gridTemplateColumns:"150px 1fr",alignItems:"center",margin:0,padding:"30px",borderBottom:"1px solid #ddd"},"& .pp-action button":{width:"120px"}},children:[r===K.TABLE&&e.jsxs(l,{className:"pp-action",children:[e.jsx(l,{children:e.jsxs("form",{action:n.settings.wp.home+"?action=wpda_export",method:"post",target:"_blank",children:[e.jsx("input",{type:"hidden",name:"type",value:"table"}),e.jsx("input",{type:"hidden",name:"wpdaschema_name",value:s}),e.jsx("input",{type:"hidden",name:"table_names",value:t}),e.jsx("input",{type:"hidden",name:"format_type",value:o}),e.jsx("input",{type:"hidden",name:"include_table_settings",value:o==="sql"&&g?"on":"off"}),e.jsx("input",{type:"hidden",name:"_wpnonce",value:n.settings.wp.aonce.split("-")[0]}),e.jsx(G,{variant:"contained",type:"submit",children:"Export"})]})}),e.jsxs(l,{sx:{display:"grid"},children:[e.jsxs(U,{children:[e.jsx(ts,{variant:"outlined",children:"Export to"}),e.jsxs(be,{MenuProps:{id:"pp-select-menu"},label:"Export to",value:o,onChange:p=>{m(p.target.value)},children:[e.jsx(W,{value:"sql",children:"SQL"},"sql"),e.jsx(W,{value:"csv",children:"CSV"},"csv"),e.jsx(W,{value:"json",children:"JSON"},"json"),e.jsx(W,{value:"excel",children:"Excel"},"excel"),e.jsx(W,{value:"xml",children:"XML"},"xml")]})]}),e.jsx(Ne,{sx:{visibility:o==="sql"?"visible":"hidden",height:o==="sql"?"auto":0,marginTop:o==="sql"?"10px":0,marginLeft:0},control:e.jsx(De,{checked:g,onClick:p=>{h(!g),p.stopPropagation()}}),label:"With table settings",labelPlacement:"end"})]})]}),x[s]!=="system"&&(x[s]!=="wp"||!n.settings.wp.tables.includes(t))&&e.jsxs(l,{className:"pp-action",children:[e.jsx(l,{children:e.jsx(G,{variant:"contained",onClick:()=>{t!==b&&b.trim()!==""?D(!0):P("Nothing to rename",{variant:"error"})},children:"Rename"})}),e.jsx(l,{children:e.jsx(ae,{label:r===K.TABLE?"New table name":"New view name",value:b,onChange:p=>{c(p.target.value)},fullWidth:!0})})]}),r===K.TABLE&&e.jsxs(l,{className:"pp-action",children:[e.jsxs(l,{children:[e.jsx(G,{variant:"contained",onClick:()=>{j.trim()!==""?(N(!0),Ha(s,u,t,j,v,p=>{if(a.debug(p),p!=null&&p.code&&(p==null?void 0:p.message)!==void 0)switch(p.code){case"ok":i(ze({dbs:s})),P(p.message,{variant:"success"});break;case"info":P(p.message,{variant:"info"});break;default:a.error(p),P(p.message??O.contactSupport,{variant:"error"})}else a.error(p),P(O.contactSupport,{variant:"error"});N(!1)},p=>{a.error("error",p),P(p??O.contactSupport,{variant:"error"}),N(!1)})):P("Nothing to rename",{variant:"error"})},children:"Copy"}),e.jsx(Ne,{control:e.jsx(De,{checked:v,onClick:p=>{I(!v),p.stopPropagation()}}),label:"Copy data",labelPlacement:"end",sx:{height:"56px"}}),e.jsx(l,{sx:{display:z?"block":"none","& > div":{marginRight:"30px"},"& span.MuiCircularProgress-root, svg":{height:"20px !important",width:"20px !important"}},children:e.jsx(hs,{title:"Copying..."})})]}),e.jsxs(l,{sx:{display:"grid",gridGap:"10px"},children:[e.jsxs(U,{fullWidth:!0,children:[e.jsx(ts,{variant:"outlined",children:"To database"}),e.jsxs(be,{MenuProps:{id:"pp-select-menu"},label:"To database",value:u,onChange:p=>{S(p.target.value)},children:[...y.map(p=>e.jsx(W,{value:p,children:p},p))]})]}),e.jsx(ae,{label:"To table name",value:j,onChange:p=>{T(p.target.value)},fullWidth:!0})]})]}),r===K.TABLE&&x[s]!=="system"&&(x[s]!=="wp"||!n.settings.wp.tables.includes(t))&&e.jsxs(l,{className:"pp-action",children:[e.jsx(l,{children:e.jsx(G,{variant:"contained",onClick:()=>{L(!0)},children:"Truncate"})}),e.jsxs(l,{sx:{display:"grid",gridGap:"5px"},children:[e.jsx("span",{children:"Deletes all data permanently."}),e.jsx("strong",{children:"This action cannot be undone!"})]})]}),x[s]!=="system"&&(x[s]!=="wp"||!n.settings.wp.tables.includes(t))&&e.jsxs(l,{className:"pp-action",children:[e.jsx(l,{children:e.jsx(G,{variant:"contained",onClick:()=>{w(!0)},children:"Drop"})}),e.jsxs(l,{sx:{display:"grid",gridGap:"5px"},children:[r==K.VIEW?e.jsx("span",{children:"Deletes view permanently."}):e.jsx("span",{children:"Deletes table and all data permanently."}),e.jsx("strong",{children:"This action cannot be undone!"})]})]}),r===K.TABLE&&e.jsxs(l,{className:"pp-action",children:[e.jsx(l,{children:e.jsxs("form",{method:"POST",action:n.settings.wp.home+"?page=wpda_designer",children:[e.jsx("input",{type:"hidden",name:"action",value:"edit"}),e.jsx("input",{type:"hidden",name:"action2",value:"init"}),e.jsx("input",{type:"hidden",name:"wpda_schema_name",value:s}),e.jsx("input",{type:"hidden",name:"wpda_schema_name_re",value:s}),e.jsx("input",{type:"hidden",name:"wpda_table_name",value:t}),e.jsx("input",{type:"hidden",name:"wpda_table_name_re",value:t}),e.jsx("input",{type:"hidden",name:"_wpnonce",value:n.settings.wp.alter}),e.jsx("input",{type:"hidden",name:"page_number",value:"1"}),e.jsx("input",{type:"hidden",name:"caller",value:"dataexplorer"}),e.jsx(G,{variant:"contained",type:"submit",children:"ALTER"})]})}),e.jsx(l,{sx:{display:"grid",gridGap:"5px"},children:"Loads table into the Data Designer."})]}),F[s].pdsDbs===!0&&((Ke=(We=n==null?void 0:n.settings)==null?void 0:We.wp)==null?void 0:Ke.connect)!==!1&&e.jsxs(l,{className:"pp-action",children:[e.jsx(l,{children:e.jsx(G,{variant:"contained",onClick:()=>{if(f!==""&&f>0&&E!==""){const p=new FormData;p.append("wpnonce",n.settings.wp.refresh),p.append("schema_name",s),p.append("table_name",t),p.append("interval",f.toString()),p.append("unit",E),q(p)}else P("Please enter valid scheduled update values",{variant:"error"})},children:"Refresh"})}),e.jsxs(l,{sx:{display:"grid",gridGap:"5px"},children:[e.jsx(l,{children:"Next scheduled update"}),e.jsxs(l,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",justifyContent:"start",alignItems:"center",gap:"5px"},children:[e.jsx(ae,{type:"number",inputProps:{min:0},value:f,autoComplete:"off",onChange:p=>{const X=p.target.value.replaceAll("-","");C(X===""?"":Number(X))}}),e.jsxs(be,{MenuProps:{id:"pp-select-menu"},value:E,onChange:p=>{M(p.target.value)},children:[e.jsx(W,{value:""}),e.jsx(W,{value:"hour",children:"hour"}),e.jsx(W,{value:"day",children:"day"})]})]}),e.jsx(U,{children:e.jsx(xe,{children:"Enter and press REFRESH to apply"})})]})]}),n.create!==""&&e.jsxs(l,{className:"pp-action",children:[e.jsx(l,{children:e.jsx(Zn,{text:n.create,onCopy:()=>{P("SQL was copied to your clipboard",{variant:"info"})},children:e.jsx(he,{title:"Copy SQL to clipboard",children:e.jsx(G,{variant:"contained",endIcon:e.jsx(oa,{}),sx:{display:"flex",alignItems:"flex-start","& svg":{width:"50%"}},children:"SQL"})})})}),e.jsx(l,{sx:{display:"grid",gridGap:"5px"},children:e.jsx(l,{sx:{whiteSpace:"pre-wrap",fontSize:"70%"},children:n.create})})]})]}),e.jsx(ue,{title:`Rename ${r===K.VIEW?"view":"table"}?`,message:"This can affect existing apps using this table!",open:A,setOpen:D,onConfirm:()=>{$a(s,t,b,p=>{if(a.debug(p),p!=null&&p.code&&(p==null?void 0:p.message)!==void 0)switch(p.code){case"ok":r===K.VIEW?i(Ze({dbs:s})):i(ze({dbs:s})),i(es({})),P(p.message,{variant:"success"});break;case"info":P(p.message,{variant:"info"});break;default:a.error(p),P(p.message??O.contactSupport,{variant:"error"})}else a.error(p),P(O.contactSupport,{variant:"error"})},p=>{a.error("error",p),P(p??O.contactSupport,{variant:"error"})})}}),e.jsx(ue,{title:"Truncate table?",message:"This action cannot be undone!",open:_,setOpen:L,onConfirm:()=>{Xs(s,t,p=>{if(a.debug(p),p!=null&&p.code&&(p==null?void 0:p.message)!==void 0)switch(p.code){case"ok":P(p.message,{variant:"success"});break;case"info":P(p.message,{variant:"info"});break;default:a.error(p),P(p.message??O.contactSupport,{variant:"error"})}else a.error(p),P(O.contactSupport,{variant:"error"})},p=>{a.error("error",p),P(p??O.contactSupport,{variant:"error"})})}}),e.jsx(ue,{title:`Drop ${r===K.VIEW?"view":"table"}?`,message:"This action cannot be undone!",open:R,setOpen:w,onConfirm:()=>{Js(s,t,r,p=>{if(a.debug(p),p!=null&&p.code&&(p==null?void 0:p.message)!==void 0)switch(p.code){case"ok":r===K.VIEW?i(Ze({dbs:s})):i(ze({dbs:s})),i(es({})),P(p.message,{variant:"success"});break;case"info":P(p.message,{variant:"info"});break;default:a.error(p),P(p.message??O.contactSupport,{variant:"error"})}else a.error(p),P(O.contactSupport,{variant:"error"})},p=>{a.error("error",p),P(p??O.contactSupport,{variant:"error"})})}})]})},nr=({dbs:s,tbl:t,typ:r})=>{var x,f;a.debug(s,t,r);const n=H(),[i,o]=d.useState(fe(cs.getState()));a.debug(i);const[m,g]=d.useState(""),[h,b]=d.useState(!1),[c,u]=d.useState({}),[S,j]=d.useState(!1),[T,v]=d.useState(!1);d.useEffect(()=>{h||I()},[s,t]);const I=()=>{la(s,t,!0,C=>{var M,q;const E=C==null?void 0:C.data;if(a.debug("response data",s,t,E),(M=E==null?void 0:E.access)!=null&&M.select&&Array.isArray(E.access.select)&&E.access.select.includes("POST")){const B={...E.settings};B.list_labels={...E.table_labels},B.form_labels={...E.form_labels},B.column_media={...E.wp_media},delete B.hyperlinks,delete B.ui,delete B.wp;const te={...E};u(te),n(en({settings:B,metaData:te})),b(!0)}else{let B=O.contactSupport;(q=C==null?void 0:C.data)!=null&&q.message&&(B=C.data.message+" - check console for more information"),a.error(B),g(B)}},C=>{a.error("error",C),g(C??O.contactSupport)})};d.useEffect(()=>{m!==""&&(n(Ls({error:m})),n(bs({})),n(es({})))},[m]);const A=k(C=>fe(C));a.debug(A);const D=((x=ne)==null?void 0:x.palette.mode)===sn.LIGHT?(f=ne)==null?void 0:f.palette.primary.main:"",_=C=>{n(tn({anchor:C}))},L=()=>{n(es({})),n(bs({}))},R=()=>{S?v(!0):L()},w=()=>{const C={...A};let E=!1;xn(s,t,C,M=>{if(M!=null&&M.code&&(M==null?void 0:M.message)!==void 0)switch(M.code){case"ok":P(M.message,{variant:"success"});break;case"info":P(M.message,{variant:"info"});break;default:a.error(M),P(M.message??O.contactSupport,{variant:"error"}),E=!0}else a.error(M),P(O.contactSupport,{variant:"error"}),E=!0},M=>{a.error(M),P(M??O.contactSupport,{variant:"error"}),E=!0}),E||o(fe(cs.getState())),j(!1)},z=()=>{S?(w(),setTimeout(()=>{L()},1e3)):L()},[N,F]=d.useState("1"),y=(C,E)=>{F(E)};return m!==""?null:e.jsxs(e.Fragment,{children:[e.jsxs(Hn,{closeDrawer:R,children:[e.jsx(as,{position:"static",elevation:4,sx:{borderRadius:0},children:e.jsxs(rs,{className:"pp-setting-toolbar",sx:{borderRadius:0},children:[e.jsxs(l,{sx:{flexGrow:1},children:[e.jsx(ye,{variant:"h5",noWrap:!0,component:"div",className:"unselectable",sx:{display:{xs:"none",sm:"block"},paddingLeft:"6px"},children:"Manage Table"}),e.jsxs(ye,{sx:{fontSize:"10px",display:{xs:"none",sm:"block"},paddingLeft:"10px"},children:[s," - ",t]})]}),e.jsx(Je,{title:"Dock to left",position:"bottom",children:e.jsx(oe,{onClick:()=>{_(ys.LEFT)},size:"large",color:"inherit",sx:{fontSize:"1em"},children:e.jsx(Un,{})})}),e.jsx(Je,{title:"Dock to right",position:"bottom",children:e.jsx(oe,{onClick:()=>{_(ys.RIGHT)},size:"large",color:"inherit",sx:{fontSize:"1em"},children:e.jsx(qn,{})})}),e.jsx(Je,{title:"Close",position:"bottom",children:e.jsx(oe,{onClick:R,size:"large",color:"inherit",sx:{fontSize:"1.4em"},children:e.jsx(zs,{})})})]})}),e.jsx(ps,{className:"pp-settings-container",children:e.jsx(us,{sx:{padding:0,margin:0},children:h?e.jsxs(Yn,{value:N,children:[e.jsxs(Qn,{variant:"fullWidth",textColor:"primary",onChange:y,sx:{width:"100%",height:"80px",padding:0,margin:0,backgroundColor:"rgb(242, 242, 242)"},children:[e.jsx(_s,{label:"Actions",value:"1",sx:{fontWeight:"bold",fontSize:"110%",height:"80px"}}),e.jsx(_s,{label:"Settings",value:"2",sx:{fontWeight:"bold",fontSize:"110%",height:"80px"}})]}),e.jsxs(l,{sx:{margin:0,padding:0,overflowY:"auto",height:"calc(100vh - 250px)","& > div.MuiTabPanel-root":{padding:0}},children:[e.jsx(Cs,{value:"1",children:e.jsx(tr,{dbs:s,tbl:t,typ:r,metaData:c})}),e.jsxs(Cs,{value:"2",children:[e.jsx(Za,{dbs:s,tbl:t,setIsUpdated:j}),e.jsx(er,{dbs:s,tbl:t,setIsUpdated:j}),e.jsx(sr,{dbs:s,tbl:t,typ:r,metaData:c,setIsUpdated:j}),e.jsx(Ja,{dbs:s,tbl:t})]})]})]}):e.jsx(l,{sx:{padding:"30px"},children:e.jsx(hs,{title:"Loading data..."})})})}),e.jsx(ps,{className:"pp-setting-footer",sx:{borderRadius:0,backgroundColor:D},children:e.jsxs(us,{className:"pp-setting-footer-buttons",sx:{borderRadius:0},children:[e.jsx(G,{variant:"outlined",className:"footer_action_button_apply",onClick:w,children:"Apply"}),e.jsx(G,{variant:"outlined",className:"footer_action_button",onClick:z,children:"OK"}),e.jsx(G,{variant:"outlined",className:"footer_action_button",onClick:R,children:"Cancel"})]})})]}),e.jsx(ue,{title:"Close Manage Table?",message:"All uncommitted changes will be lost!",open:T,setOpen:v,onConfirm:()=>{L()}})]})},ar=()=>{const s=k(t=>gs(t));return a.debug(s),e.jsx(e.Fragment,{children:s!==void 0&&s.action===pe.MANAGE&&e.jsx(nr,{dbs:s.dbs,tbl:s.tbl,typ:s.typ})})},Hr=()=>{const s=Xn();return e.jsx(Pn,{theme:s,children:e.jsxs(l,{sx:{"& > :nth-of-type(2)":{visibility:"hidden",position:"fixed"}},children:[e.jsx(Xa,{}),e.jsx(Qa,{}),e.jsx(ar,{})]})})};export{Hr as default};