import{d as y,ey as b,H as h,b as g,c as w,u as _}from"./outputWidgets.d6334d0e.js";import{e as C,a as F,b as k}from"./icons.09e1f108.js";import{a as x}from"./asyncComputed.95fd0999.js";import{F as d}from"./forms.7ea2277d.js";import{C as v}from"./CrudView.a040df87.js";import{a as D}from"./ant-design.765336cf.js";import"./activeRecord.aa738a85.js";import"./pubsub.9d7d329e.js";import"./Text.2f6a30da.js";import"./Title.132c3f7f.js";import"./transButton.97ae4a5a.js";import"./router.c9839d0e.js";import"./Form.afe8a620.js";import"./index.85dd1fea.js";import"./url.dce42ecb.js";import"./index.9476b093.js";import"./index.e0fb68fa.js";import"./index.98d66b02.js";import"./index.2221e01c.js";import"./index.6da051f8.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]="537455ae-77ec-4d8f-87c4-7eea03d06f3d",a._sentryDebugIdIdentifier="sentry-dbid-537455ae-77ec-4d8f-87c4-7eea03d06f3d")}catch{}})();const J=y({__name:"Forms",setup(a){const r=b(),{loading:s,result:n,refetch:m}=x(()=>d.list()),c=({key:e})=>r.push({path:`/_editor/form/${encodeURIComponent(e)}`}),l=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 d.create();c({key:e.path})},u=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())},f=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:c},{icon:F,label:"Duplicate",onClick:l},{icon:k,label:"Delete",onClick:u,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:f.value,"entity-name":"Form",onCreate:p},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Forms.2148dbb5.js.map
