import{d as y,ez as b,J as h,b as g,c as w,u as _}from"./outputWidgets.65926c1d.js";import{e as C,a as F,b as k}from"./icons.da7d27cd.js";import{a as x}from"./asyncComputed.4723d9b8.js";import{F as c}from"./forms.06ee06be.js";import{C as v}from"./CrudView.bb677fb8.js";import{a as D}from"./ant-design.14676eb3.js";import"./activeRecord.994400e6.js";import"./pubsub.dc5bec39.js";import"./index.2740d90e.js";import"./Title.2cced18a.js";import"./Form.47548ee6.js";import"./router.52af5430.js";import"./index.553ada1f.js";import"./url.bc2b44ba.js";import"./index.0312767e.js";import"./index.006c6212.js";import"./index.73801d39.js";import"./index.1bb9605d.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="0ff83f8f-efaf-4075-9ead-12542bb1f651",a._sentryDebugIdIdentifier="sentry-dbid-0ff83f8f-efaf-4075-9ead-12542bb1f651")}catch{}})();const q=y({__name:"Forms",setup(a){const r=b(),{loading:s,result:n,refetch:m}=x(()=>c.list()),l=({key:e})=>r.push({path:`/_editor/form/${encodeURIComponent(e)}`}),d=async({key:e})=>{var o,t;await((t=(o=n.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.duplicate()),m()},p=async()=>{const e=await c.create();l({key:e.path})},f=async({key:e})=>{var o,t;await D("Are you sure you want to delete this form?")&&(await((t=(o=n.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.delete()),m())},u=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/form/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:C,label:"Edit Form",onClick:l},{icon:F,label:"Duplicate",onClick:d},{icon:k,label:"Delete",onClick:f,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(v,{loading:_(s),title:"Dynamic Python forms",description:"Create forms with advanced logic, easy integrations and custom branding.","create-button-text":"Create Form","empty-title":"No forms here yet","video-url":"https://www.youtube.com/embed/p6xf8PxL2Yg",table:u.value,"entity-name":"Form",onCreate:p},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Forms.b24bebaf.js.map
