import{d as b,ex as y,H as h,b as _,c as g,u as w}from"./registerWidgets.faec4901.js";import{e as F,a as C,b as k}from"./icons.4b27c20b.js";import{a as x}from"./asyncComputed.04758d6d.js";import{F as l}from"./forms.c3e90e83.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.3dfdcdc3.js";import"./activeRecord.64153c3d.js";import"./pubsub.c32c984e.js";import"./Modal.c4a3eb37.js";import"./Title.38629c7e.js";import"./transButton.389d0ba4.js";import"./index.bd454869.js";import"./Text.8913855c.js";import"./index.353431e1.js";import"./index.da74220a.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]="4deeb9f8-d8b6-452b-a3ba-cc3ce819ac4f",a._sentryDebugIdIdentifier="sentry-dbid-4deeb9f8-d8b6-452b-a3ba-cc3ce819ac4f")}catch{}})();const T=b({__name:"Forms",setup(a){const n=y(),{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;confirm("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:"Form Actions"}],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{T as default};
//# sourceMappingURL=Forms.d9ee8266.js.map
