import{d as b,ex as y,H as h,b as _,c as g,u as w}from"./registerWidgets.1e9167ab.js";import{e as F,a as C,b as k}from"./icons.41af03d8.js";import{a as x}from"./asyncComputed.8a644895.js";import{F as d}from"./forms.5cb504dd.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.e0bf9fc2.js";import"./activeRecord.60b6bd01.js";import"./pubsub.09eafe35.js";import"./Modal.b646cd22.js";import"./Title.d1f45d59.js";import"./transButton.755e702e.js";import"./index.9165a659.js";import"./Text.c8d7b4c0.js";import"./index.32c7f8ee.js";import"./index.d74062f4.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]="b3cfdd24-c56f-4656-8adb-5d8bcb1eb206",a._sentryDebugIdIdentifier="sentry-dbid-b3cfdd24-c56f-4656-8adb-5d8bcb1eb206")}catch{}})();const T=b({__name:"Forms",setup(a){const n=y(),{loading:s,result:r,refetch:c}=x(()=>d.list()),m=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),l=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 d.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:l},{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.e3a99b32.js.map
