import{d as b,ey as y,H as h,b as g,c as w,u as _}from"./outputWidgets.a4629ff8.js";import{e as C,a as F,b as k}from"./icons.73bff2ab.js";import{a as x}from"./asyncComputed.fb8b9ba6.js";import{F as l}from"./forms.e81bb060.js";import{C as v}from"./CrudView.a5b1a4eb.js";import{a as D}from"./ant-design.523e8417.js";import"./activeRecord.a2b7d343.js";import"./pubsub.25dc8c41.js";import"./Text.eb216708.js";import"./Title.cf2a531e.js";import"./Form.ab59726f.js";import"./router.ab2ac3ba.js";import"./index.339c7421.js";import"./url.d6a620b9.js";import"./index.874565bb.js";import"./index.48817ebe.js";import"./index.0f6dde5f.js";import"./index.46db6cb2.js";import"./index.56cfba6d.js";import"./index.fda4c602.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]="4704f7ac-0dbf-4fe6-bce3-a3eb9d264a4e",a._sentryDebugIdIdentifier="sentry-dbid-4704f7ac-0dbf-4fe6-bce3-a3eb9d264a4e")}catch{}})();const J=b({__name:"Forms",setup(a){const r=y(),{loading:s,result:n,refetch:m}=x(()=>l.list()),c=({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 l.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:d},{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.71e9be23.js.map
