import{d as y,ez as b,J as h,b as g,c as _,u as w}from"./outputWidgets.541a6a3f.js";import{e as F,a as C,b as k}from"./icons.fbbc5318.js";import{a as x}from"./asyncComputed.6496ca6b.js";import{F as l}from"./forms.4ff36d50.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.af69973c.js";import{a as D}from"./ant-design.e75c36c7.js";import"./activeRecord.867c40fa.js";import"./pubsub.8482a29f.js";import"./index.07910c0e.js";import"./Title.3011141f.js";import"./Form.2a9acb85.js";import"./index.f20ad580.js";import"./index.c3edc651.js";import"./index.3cff0676.js";import"./index.1797b918.js";import"./index.33fb7a48.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="cf83a9f7-3ff8-483a-9ca2-43b7eaae37cb",a._sentryDebugIdIdentifier="sentry-dbid-cf83a9f7-3ff8-483a-9ca2-43b7eaae37cb")}catch{}})();const j=y({__name:"Forms",setup(a){const n=b(),{loading:s,result:r,refetch:c}=x(()=>l.list()),m=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),d=async({key:e})=>{var o,t;await((t=(o=r.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.duplicate()),c()},p=async()=>{const e=await l.create();m({key:e.path})},u=async({key:e})=>{var o,t;await D("Are you sure you want to delete this form?")&&(await((t=(o=r.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.delete()),c())},f=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=r.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:F,label:"Edit Form",onClick:m},{icon:C,label:"Duplicate",onClick:d},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),_(v,{loading:w(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.b2fc416f.js.map
