const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CodeFieldEditor-1.0.74-CQj6IPJI.js","./tanstack-1.0.74-aU0azVkW.js","./redux-1.0.74-D8bIc6ki.js","./vendor-1.0.74-CN03Eozo.js","./index-1.0.74-DxwH6OqZ.js","./CircularProgress-1.0.74-QfwfRJ7i.js","./lib-1.0.74-B5IEqfHg.js","./utils-1.0.74-7xWhx9mc.js","./ButtonBase-1.0.74-W6tAH7AI.js","./Typography-1.0.74-B4mhsevh.js","./useEnhancedEffect-1.0.74-B56M26dS.js","./ThemeProvider-1.0.74-4uzbYYLM.js","./Portal-1.0.74-BrUPeMX9.js","./iconBase-1.0.74-Cs0vntJu.js","./cmCore-1.0.74-RFmA52TM.js","./cmSql-1.0.74-bz4Itd-N.js","./cmRanges-1.0.74-BO9kgmIr.js","./cmJs-1.0.74-DJepcfpp.js","./cmHtml-1.0.74-br5LV8y2.js","./cmCss-1.0.74-BizOopoq.js","./Box-1.0.74-DEbuVvGV.js","./FormControlLabel-1.0.74-CdAG1Jo8.js","./Select-1.0.74-DHOnlEEH.js","./Menu-1.0.74-CdjCBJ4R.js","./isHostComponent-1.0.74-DVu5iVWx.js","./Modal-1.0.74-BfLid1bk.js","./createSvgIcon-1.0.74-Cw_ZFbxi.js","./Switch-1.0.74-IHNqKL8Y.js","./SwitchBase-1.0.74-pUYMwK3f.js"])))=>i.map(i=>d[i]);
import{_ as D}from"./RestApiError-1.0.74-Bb1un17k.js";import{j as i}from"./tanstack-1.0.74-aU0azVkW.js";import{r}from"./redux-1.0.74-D8bIc6ki.js";import{M as E}from"./index-1.0.74-DxwH6OqZ.js";import{D as w,a as M,b as T,d as B,B as n}from"./ConfirmDialog-1.0.74-CXu4CqK2.js";import{B as a}from"./Box-1.0.74-DEbuVvGV.js";import{I as F}from"./iconBase-1.0.74-Cs0vntJu.js";import{l as L}from"./lib-1.0.74-B5IEqfHg.js";import"./vendor-1.0.74-CN03Eozo.js";import"./CircularProgress-1.0.74-QfwfRJ7i.js";import"./ButtonBase-1.0.74-W6tAH7AI.js";import"./Typography-1.0.74-B4mhsevh.js";import"./useEnhancedEffect-1.0.74-B56M26dS.js";import"./ThemeProvider-1.0.74-4uzbYYLM.js";import"./Portal-1.0.74-BrUPeMX9.js";import"./utils-1.0.74-7xWhx9mc.js";import"./AdminTheme-1.0.74-BtTaJUu_.js";import"./Modal-1.0.74-BfLid1bk.js";const U=r.lazy(()=>D(()=>import("./CodeFieldEditor-1.0.74-CQj6IPJI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url)),b=({code:t,codeBefore:l="",codeAfter:o="",setCode:f,doPaste:p=!1,pasteValue:x=null,dialogTitle:u,buttonApply:d,buttonDelete:g,buttonOk:j,buttonCancel:h,buttonEditorOk:C,extension:s="js",isReadOnly:v=!1,initialHeight:_="200px",sqlSchema:I=void 0,saveCode:k=void 0,setFullScreen:e,fullScreen:c})=>i.jsxs(w,{open:!0,"aria-labelledby":"code-dialog",sx:{"& .MuiPaper-root":{width:"calc(100vw - 100px)",maxWidth:"calc(100vw - 100px)",height:"calc(calc(var(--ppViewHeight, 1vh) * 100) - 100px)",maxHeight:"calc(calc(var(--ppViewHeight, 1vh) * 100) - 100px)",margin:"50px"},"& .MuiBackdrop-root.MuiModal-backdrop":{backgroundColor:"rgba(0, 0, 0, 0.7)"}},children:[i.jsxs(M,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",alignItems:"center"},children:[i.jsx(a,{sx:{marginLeft:"10px"},children:"Code Editor"}),i.jsx(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:u}),i.jsx(a,{sx:{display:"flex",justifyContent:"end",alignItems:"center"},children:i.jsx(F,{onClick:()=>{e(!1)},children:i.jsx(E,{})})})]}),i.jsx(T,{sx:{padding:"20px"},children:i.jsx(r.Suspense,{children:i.jsx(U,{code:t,codeBefore:l,codeAfter:o,setCode:f,doPaste:p,pasteValue:x,extension:s,isReadOnly:v,initialHeight:_,sqlSchema:I,saveCode:k,setFullScreen:e,fullScreen:c})})}),i.jsxs(B,{sx:{padding:"0 20px 20px 20px",display:"grid",gridTemplateColumns:"auto auto",justifyContent:"space-between",alignItems:"center"},children:[i.jsx(a,{sx:{display:"flex",alignItems:"center",fontWeight:"bold"},children:s.toUpperCase()}),d!==void 0&&j!==void 0&&h!==void 0&&i.jsxs(a,{sx:{display:"grid",gridTemplateColumns:"100px 100px 100px",justifyContent:"end",alignItems:"center",gap:"20px"},children:[i.jsx(n,{variant:"outlined",onClick:()=>{d()},children:"Update"}),i.jsx(n,{variant:"contained",onClick:()=>{j()},children:"OK"}),i.jsx(n,{variant:"contained",onClick:()=>{h()},children:"Cancel"})]}),d!==void 0&&g!==void 0&&C!==void 0&&i.jsxs(a,{sx:{display:"grid",gridTemplateColumns:"100px 100px 100px 100px",justifyContent:"end",alignItems:"center",gap:"10px"},children:[i.jsx(n,{variant:"outlined",onClick:()=>{d()},children:"Update"}),i.jsx(n,{variant:"outlined",onClick:()=>{g()},children:"Delete"}),i.jsx(n,{variant:"contained",onClick:()=>{C(),e(!1)},children:"OK"}),i.jsx(n,{variant:"contained",onClick:()=>{e(!1)},children:"Cancel"})]})]})]}),z=r.lazy(()=>D(()=>import("./CodeFieldEditor-1.0.74-CQj6IPJI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url)),ii=({code:t,codeBefore:l="",codeAfter:o="",setCode:f,doPaste:p=!1,pasteValue:x=null,dialogTitle:u,buttonApply:d,buttonDelete:g,buttonOk:j,buttonCancel:h,buttonEditorOk:C,extension:s="js",isReadOnly:v=!1,initialHeight:_="200px",sqlSchema:I=void 0,saveCode:k=void 0,setFullScreenExternally:e,fullScreenExternally:c=void 0})=>{L.debug(t,l,o,p,x,u,s);const[m,y]=r.useState(!1);return r.useEffect(()=>{c!==void 0&&y(c)},[c]),r.useEffect(()=>{e&&e(m)},[m]),i.jsx(i.Fragment,{children:m?i.jsx(b,{code:t,codeBefore:l,codeAfter:o,setCode:f,doPaste:p,pasteValue:x,dialogTitle:u,buttonApply:d,buttonDelete:g,buttonOk:j,buttonCancel:h,buttonEditorOk:C,extension:s,isReadOnly:v,initialHeight:_,sqlSchema:I,saveCode:k,setFullScreen:y,fullScreen:m}):i.jsx(r.Suspense,{children:i.jsx(z,{code:t,codeBefore:l,codeAfter:o,setCode:f,doPaste:p,pasteValue:x,extension:s,isReadOnly:v,initialHeight:_,sqlSchema:I,saveCode:k,setFullScreen:y,fullScreen:m})})})};export{ii as default};
