import{d as y,ez as w,G as g,b as h,c as F,u as _}from"./outputWidgets.6d6b4a37.js";import{F as d}from"./forms.11a3d85b.js";import{e as x,d as C}from"./icons.28d0d847.js";import{a as k}from"./asyncComputed.17a6198d.js";import{a as l}from"./ant-design.c99b7781.js";import{C as v}from"./CrudView.230a173f.js";import"./record.7835c07e.js";import"./pubsub.7d377b25.js";import"./index.f2a53bdb.js";import"./Title.b41b4f96.js";import"./Form.1ff54ed5.js";import"./router.4e9df257.js";import"./index.72c317ca.js";import"./index.0e216cc8.js";import"./url.b5fbb423.js";import"./index.9eddb8ae.js";import"./index.6f6e8ffd.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="2785c936-b33c-47b6-b60e-1790d27ee048",o._sentryDebugIdIdentifier="sentry-dbid-2785c936-b33c-47b6-b60e-1790d27ee048")}catch{}})();const $=y({__name:"Forms",setup(o){const a=w(),{loading:i,result:n,refetch:c}=k(()=>d.list()),s=({key:e})=>a.push({name:"formEditor",params:{id:e}}),u=async()=>{const e=await d.create();s({key:e.id})},p=async({key:e})=>{var t,m;const r=await l("Do you want to delete the .py file associated with this form?",{okText:"Yes",cancelText:"No"});await l("Are you sure you want to delete this form?")&&(await((m=(t=n.value)==null?void 0:t.find(b=>b.id===e))==null?void 0:m.delete(r)),c())},f=g(()=>{var e,r;return{columns:[{name:"Form Name"},{name:"Path"},{name:"File"},{name:"Actions",align:"right"}],rows:(r=(e=n.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/form/${encodeURIComponent(t.id)}`},{text:t.path},{text:t.file},{text:"",actions:[{icon:x,label:"Edit Form",onClick:s},{icon:C,label:"Delete",onClick:p,dangerous:!0}]}]})))!=null?r:[]}});return(e,r)=>(h(),F(v,{loading:_(i),title:"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:u},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Forms.b90d860e.js.map
