import{d as y,ez as b,J as h,b as g,c as _,u as w}from"./outputWidgets.c072fe4e.js";import{e as F,a as C,b as k}from"./icons.158b4825.js";import{a as x}from"./asyncComputed.376cdc00.js";import{F as c}from"./forms.db17259c.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.9296340f.js";import{a as D}from"./ant-design.5cb2a38e.js";import"./activeRecord.fdc25b97.js";import"./pubsub.98ad9fe0.js";import"./index.4cff163b.js";import"./Title.e3dcb8ea.js";import"./Form.9f52866c.js";import"./index.4e6af937.js";import"./index.d9c3e0de.js";import"./index.2e3640f1.js";import"./index.e7c5574b.js";import"./index.ec8e038a.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]="6f31844f-6da4-4633-96ee-26fdade92ded",a._sentryDebugIdIdentifier="sentry-dbid-6f31844f-6da4-4633-96ee-26fdade92ded")}catch{}})();const j=y({__name:"Forms",setup(a){const n=b(),{loading:s,result:r,refetch:m}=x(()=>c.list()),d=({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()),m()},p=async()=>{const e=await c.create();d({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()),m())},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:d},{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{j as default};
//# sourceMappingURL=Forms.ade63ee9.js.map
