import{d as p,eA as b,G as y,b as g,c as w,u as _}from"./outputWidgets.c4f3de67.js";import{F as m}from"./forms.38b9632f.js";import{e as F,d as h}from"./icons.49e74e71.js";import{a as C}from"./asyncComputed.c75b06d6.js";import{a as k}from"./ant-design.a1a552ac.js";import{C as x}from"./CrudView.4072ea68.js";import"./record.685c8ba7.js";import"./pubsub.1842fa2d.js";import"./transButton.ebe60b80.js";import"./Text.fcf8f28f.js";import"./Base.9ed9c296.js";import"./router.88734ca5.js";import"./Title.345a4775.js";import"./index.db3809d7.js";import"./url.d2782274.js";import"./index.c4339fad.js";import"./index.b168b141.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="b5f7a395-7f02-4fea-9f23-1220eb412018",r._sentryDebugIdIdentifier="sentry-dbid-b5f7a395-7f02-4fea-9f23-1220eb412018")}catch{}})();const $=p({__name:"Forms",setup(r){const a=b(),{loading:n,result:i,refetch:d}=C(()=>m.list()),s=({key:e})=>a.push({name:"formEditor",params:{id:e}}),l=async()=>{const e=await m.create();s({key:e.id})},c=async({key:e})=>{var o,t;await k("Are you sure you want to delete this form?")&&(await((t=(o=i.value)==null?void 0:o.find(f=>f.id===e))==null?void 0:t.delete()),d())},u=y(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=i.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/form/${encodeURIComponent(t.id)}`},{text:t.path},{text:"",actions:[{icon:F,label:"Edit Form",onClick:s},{icon:h,label:"Delete",onClick:c,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(x,{loading:_(n),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:u.value,"entity-name":"Form",onCreate:l},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Forms.f5417bb9.js.map
