import{d as b,K as h,b as g,t as w,z as d,H as _}from"./registerWidgets.89616af0.js";import{f as F,g as C,h as k}from"./icons.9cfdae6d.js";import{a as D}from"./asyncComputed.8ac91a75.js";import{F as m}from"./forms.59430d62.js";import{R as I}from"./RuntimeList.097a29c4.js";import"./activeRecord.3d3c7835.js";import"./pubsub.d7600aa1.js";import"./DropdownMenu.8f7fc9d3.js";import"./CircularLoading.0fb686c0.js";import"./lottie.fc57e5ac.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]="94232dea-87d9-4c04-8873-e402cb17109c",a._sentryDebugIdIdentifier="sentry-dbid-94232dea-87d9-4c04-8873-e402cb17109c")}catch{}})();const z=b({__name:"Forms",setup(a){const n=_(),{loading:i,result:r,refetch:c}=D(()=>m.list()),l=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),u=async({key:e})=>{var o,t;await((t=(o=r.value)==null?void 0:o.find(s=>s.path===e))==null?void 0:t.duplicate()),c()},p=async()=>{const e=await m.create();l({key:e.path})},f=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(s=>s.path===e))==null?void 0:t.delete()),c())},y=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,classes:["title","centered"],link:`/_editor/form/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",classes:["centered"],actions:[{icon:F,label:"Delete",onClick:f,dangerous:!0},{icon:C,label:"Edit Form",onClick:l},{icon:k,label:"Duplicate",onClick:u}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(I,{loading:d(i),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/tN7SRGmVPwc",table:d(y),onCreate:p},null,8,["loading","table"]))}});export{z as default};
//# sourceMappingURL=Forms.b27f8e52.js.map
