import{d as b,ey as y,G as h,b as g,c as w,u as _}from"./outputWidgets.0fb707c7.js";import{e as C,a as F,b as k}from"./icons.24a85994.js";import{a as x}from"./asyncComputed.a0ca296c.js";import{F as l}from"./forms.d1706940.js";import{C as v}from"./CrudView.e365e55f.js";import{a as D}from"./ant-design.c18e1d39.js";import"./activeRecord.204186f3.js";import"./pubsub.7d8bce56.js";import"./Text.3ec0a64d.js";import"./Title.f00a58f9.js";import"./transButton.220177fb.js";import"./router.81de177d.js";import"./Form.0dcb97c0.js";import"./index.140c5bc8.js";import"./url.d43b75f5.js";import"./index.85d2f01b.js";import"./index.8dbf2994.js";import"./index.0d3d2205.js";import"./index.e8ef1073.js";import"./index.a2e845fd.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]="b1719fa4-c466-433f-9fb9-b78d044a0d18",a._sentryDebugIdIdentifier="sentry-dbid-b1719fa4-c466-433f-9fb9-b78d044a0d18")}catch{}})();const J=b({__name:"Forms",setup(a){const r=y(),{loading:s,result:n,refetch:m}=x(()=>l.list()),c=({key:t})=>r.push({path:`/_editor/form/${encodeURIComponent(t)}`}),d=async({key:t})=>{var o,e;await((e=(o=n.value)==null?void 0:o.find(i=>i.path===t))==null?void 0:e.duplicate()),m()},p=async()=>{const t=await l.create();c({key:t.path})},u=async({key:t})=>{var o,e;await D("Are you sure you want to delete this form?")&&(await((e=(o=n.value)==null?void 0:o.find(i=>i.path===t))==null?void 0:e.delete()),m())},f=h(()=>{var t,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(t=n.value)==null?void 0:t.map(e=>({key:e.path,cells:[{text:e.title,link:`/_editor/form/${encodeURIComponent(e.path)}`},{text:e.path},{text:"",actions:[{icon:C,label:"Edit Form",onClick:c},{icon:F,label:"Duplicate",onClick:d},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(t,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:f.value,"entity-name":"Form",onCreate:p},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Forms.db69e01b.js.map
