import{j as i,I as C,n as k,o as s}from"./vendor-mui-69397583.js";import{r as S}from"./vendor-react-ece1c85f.js";import{ca as g,bW as D,cb as x,cc as A,cd as P,ce as v,al as z,cf as u,cg as h,ch as y,ci as I,cj as F,aZ as b,ck as E,cl as U,cm as j,cn as w}from"./index-c62ac197.js";const R=e=>{var c,r,d;const[o,l]=S.useState(null),m=t=>{l(t.currentTarget)},n=(t,f)=>{e.buttonClick(t,f),l(null)},a=Object.values(e.actions).some(t=>t===!0);return i.jsxs("div",{className:"actions",style:{zIndex:9992},children:[i.jsx(C,{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:a?m:void 0,disabled:!a,size:"small",sx:{backgroundColor:"rgba(0,0,0,0.06)","&:hover":{backgroundColor:"rgba(0,0,0,0.12)"}},children:i.jsx(g,{style:{fontSize:"18px",color:"gray"}})}),i.jsxs(k,{keepMounted:!0,id:"simple-menu",anchorEl:o,open:!!o,onClose:n,children:[e.actions.view&&i.jsxs(s,{onClick:()=>n(e.row,"View"),children:[i.jsx(D,{style:{fontSize:"18px"}}),"   View"]}),e.actions.edit&&i.jsxs(s,{onClick:()=>n(e.row,"Edit"),children:[i.jsx(x,{style:{fontSize:"18px"}}),"   Edit"]}),e.actions.activity&&i.jsxs(s,{onClick:()=>n(e.row,"Activity"),children:[i.jsx(A,{style:{fontSize:"18px"}}),"   Activity"]}),e.actions.sendForSignature&&((c=e==null?void 0:e.row)==null?void 0:c.partyCount)>0&&i.jsxs(s,{onClick:()=>n(e.row,"sendForSignature"),children:[i.jsx(P,{style:{fontSize:"18px"}}),"   Send Sign Request"]}),e.actions.changePassword&&i.jsxs(s,{onClick:()=>n(e.row,"changePassword"),children:[i.jsx(x,{style:{fontSize:"18px"}}),"   Change Password"]}),e.actions.resetPassword&&i.jsxs(s,{onClick:()=>n(e.row,"resetPassword"),children:[i.jsx(v,{style:{fontSize:"18px"}}),"   Send Password Reset Link"]}),e.actions.delete&&i.jsxs(s,{onClick:()=>n(e.row,"Delete"),children:[i.jsx(z,{style:{fontSize:"18px"}}),"   Delete"]}),e.actions.unarchive&&i.jsxs(s,{onClick:()=>n(e.row,"Unarchive"),children:[i.jsx(u,{style:{fontSize:"18px"}}),"   UnArchive"]}),e.actions.download&&i.jsxs(s,{onClick:()=>n(e.row,"Download"),children:[i.jsx(h,{style:{fontSize:"18px"}}),"   Download"]}),e.actions.askQuestion&&i.jsxs(s,{onClick:()=>n(e.row,"Ask Question"),children:[i.jsx(y,{style:{fontSize:"18px"}}),"   Ask Question"]}),e.actions.compareFiles&&i.jsxs(s,{onClick:()=>n(e.row,"Compare"),children:[i.jsx(I,{style:{fontSize:"18px"}}),"   Compare"]}),e.actions.loginAsUser&&((r=e.row)==null?void 0:r.role)==="Customer"&&i.jsxs(s,{onClick:()=>n(e.row,"LoginAsUser"),children:[i.jsx(F,{style:{fontSize:"18px"}}),"   Login As User"]}),e.actions.isApprove&&i.jsxs(s,{onClick:()=>n(e.row,"IsApprove"),children:[i.jsx(b,{style:{fontSize:"18px"}}),"   Approve"]}),e.actions.affiliate&&i.jsxs(s,{onClick:()=>n(e.row,"Affiliate"),children:[i.jsx(E,{style:{fontSize:"18px"}}),"    Affiliate link"]}),e.actions.import&&i.jsxs(s,{onClick:()=>n(e.row,"Import"),children:[i.jsx(U,{style:{fontSize:"18px"}}),"    Import Data"]}),e.actions.archive&&i.jsxs(s,{onClick:()=>n(e.row,"Delete"),children:[i.jsx(u,{style:{fontSize:"18px"}}),"   Archive"]}),e.actions.sync&&i.jsxs(s,{onClick:()=>n(e.row,"sync"),children:[i.jsx(j,{style:{fontSize:"18px"}}),"   Process Now"]}),e.actions.template&&i.jsxs(s,{onClick:()=>n(e.row,"template"),children:[i.jsx(j,{style:{fontSize:"18px"}}),"    Save as template"]}),e.actions.signedDoc&&((d=e==null?void 0:e.row)==null?void 0:d.status)==="Completed"&&i.jsxs(s,{onClick:()=>n(e.row,"signedDoc"),children:[i.jsx(h,{style:{fontSize:"18px"}}),"    Download Signed Document"]}),e.actions.fileImport&&i.jsxs(s,{onClick:()=>n(e.row,"fileImport"),children:[i.jsx(w,{style:{fontSize:"18px"}}),"    Manage File"]}),e.actions.assign&&i.jsxs(s,{onClick:()=>n(e.row,"Assign"),children:[i.jsx(w,{style:{fontSize:"18px"}}),"    Assign Menu"]})]})]})};var L=(e=>(e.edit="Edit",e.view="View",e.delete="Delete",e.download="Download",e.askQuestion="Ask Question",e.compareFiles="Compare",e.archive="Archive",e.unarchive="Unarchive",e.loginAsUser="LoginAsUser",e.isApprove="IsApprove",e.changePassword="changePassword",e.resetPassword="resetPassword",e.import="Import",e.affiliate="Affiliate",e.activity="Activity",e.sendForSignature="sendForSignature",e.sync="sync",e.template="template",e.signedDoc="signedDoc",e.fileImport="fileImport",e.assign="Assign",e))(L||{});export{R as A,L as T};
