import{d as b,ey as y,H as h,b as g,c as w,u as _}from"./outputWidgets.7bdcec0a.js";import{e as C,a as F,b as k}from"./icons.6934ad19.js";import{a as x}from"./asyncComputed.cfb98789.js";import{F as d}from"./forms.8c9f59fc.js";import{C as v}from"./CrudView.82a1bc5a.js";import{a as D}from"./ant-design.b9d9c398.js";import"./activeRecord.84d52553.js";import"./pubsub.c455bec9.js";import"./Text.94a8ea41.js";import"./Title.9c0d0c5f.js";import"./Form.f84b91b7.js";import"./router.3986149f.js";import"./index.15e46fc6.js";import"./url.5caacc63.js";import"./index.fa2fc691.js";import"./index.125aa6b3.js";import"./index.d2a75d88.js";import"./index.a9a6d5a2.js";import"./index.a2310446.js";import"./index.23129d61.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="5f1fdb4d-1cb9-4517-bcc5-d3fd51598239",a._sentryDebugIdIdentifier="sentry-dbid-5f1fdb4d-1cb9-4517-bcc5-d3fd51598239")}catch{}})();const J=b({__name:"Forms",setup(a){const r=y(),{loading:s,result:n,refetch:m}=x(()=>d.list()),c=({key:t})=>r.push({path:`/_editor/form/${encodeURIComponent(t)}`}),l=async({key:t})=>{var o,e;await((e=(o=n.value)==null?void 0:o.find(i=>i.path===t))==null?void 0:e.duplicate()),m()},p=async()=>{const t=await d.create();c({key:t.path})},u=async({key:t})=>{var o,e;await D("Are you sure you want to delete this form?")&&(await((e=(o=n.value)==null?void 0:o.find(i=>i.path===t))==null?void 0:e.delete()),m())},f=h(()=>{var t,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(t=n.value)==null?void 0:t.map(e=>({key:e.path,cells:[{text:e.title,link:`/_editor/form/${encodeURIComponent(e.path)}`},{text:e.path},{text:"",actions:[{icon:C,label:"Edit Form",onClick:c},{icon:F,label:"Duplicate",onClick:l},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(g(),w(v,{loading:_(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.a2b71d83.js.map
