import{j as e}from"./cm-1.0.63-CSIRHMXC.js";import{r as l}from"./redux-1.0.63-Df-eBzJn.js";import{h as j}from"./index-1.0.63-oIDff4nA.js";import{l as g}from"./lib-1.0.63-DJZPtMem.js";import{C}from"./ConfirmDialog-1.0.63-eXgm3P8b.js";import{y as M,r as b}from"./index-1.0.63-Cr9ps5ft.js";import{I as y}from"./iconBase-1.0.63-CFvHhC4t.js";import{M as D}from"./Menu-1.0.63-DLh4HkF0.js";import{M as p}from"./MenuItem-1.0.63-Bvb3IjMP.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"./notistack-1.0.63-B49ULGrj.js";import"./loglevel-1.0.63-BZ7XahX3.js";import"./lodash-1.0.63-hMxolcpJ.js";import"./moment-1.0.63-C5S46NFB.js";import"./cjs-1.0.63-4A2xol4v.js";import"./AdminTheme-1.0.63-DhJ0rrw5.js";import"./DialogContent-1.0.63-B3W-DlSe.js";const N=({index:r,computedField:a,prepareComputedFieldUpdate:m,deleteComputedField:d})=>{g.debug(r,a);const[i,t]=l.useState(null),n=!!i,c=o=>{t(o.currentTarget),o.stopPropagation()},u=()=>{t(null)},f=o=>{m(r),t(null),o.stopPropagation()},h=o=>{s(!0),t(null),o.stopPropagation()},[x,s]=l.useState(!1);return e.jsxs("div",{children:[e.jsx(y,{id:"pp-computed-field-more-button","aria-controls":n?"pp-computed-field-more-menu":void 0,"aria-haspopup":"true","aria-expanded":n?"true":void 0,onClick:c,children:e.jsx(j,{})}),e.jsxs(D,{id:"pp-computed-field-more-menu",anchorEl:i,open:n,onClose:u,MenuListProps:{"aria-labelledby":"pp-computed-field-more-button"},sx:{zIndex:9999999999},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:[e.jsxs(p,{onClick:f,children:[e.jsx(M,{}),e.jsx("span",{style:{marginLeft:"10px"},children:"Edit"})]}),e.jsxs(p,{onClick:h,children:[e.jsx(b,{}),e.jsx("span",{style:{marginLeft:"10px"},children:"Delete"})]})]}),e.jsx(C,{title:"Delete computed field?",message:"Are you sure you want to delete this computed field? This action cannot be undone!",open:x,setOpen:s,onConfirm:()=>d(r)})]})};export{N as default};
