import{d as f,eA as k,G as y,b,c as g,u as h}from"./outputWidgets.e60ab380.js";import{e as _,d as w}from"./icons.6c1915db.js";import{a as H}from"./asyncComputed.7ba647bd.js";import{H as d}from"./hooks.feb81083.js";import{C}from"./CrudView.a4f4d47c.js";import{a as x}from"./ant-design.dc5fef0a.js";import"./record.04c6d5a0.js";import"./pubsub.e6733ea4.js";import"./Text.742cb8ec.js";import"./Base.0638c3f7.js";import"./transButton.1b3f66c8.js";import"./router.0cf2e70d.js";import"./Title.666a14b1.js";import"./index.1462457d.js";import"./url.7bd60adc.js";import"./index.ed25df4f.js";import"./index.aaa1fe24.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]="742d4203-2401-417f-a807-468116db738a",a._sentryDebugIdIdentifier="sentry-dbid-742d4203-2401-417f-a807-468116db738a")}catch{}})();const $=f({__name:"Hooks",setup(a){const r=k(),{loading:i,result:n,refetch:l}=H(()=>d.list()),s=({key:e})=>r.push({name:"hookEditor",params:{id:e}}),m=async()=>{const e=await d.create();s({key:e.id})},c=async({key:e})=>{var o,t;await x("Are you sure you want to delete this hook?")&&(await((t=(o=n.value)==null?void 0:o.find(u=>u.id===e))==null?void 0:t.delete()),l())},p=y(()=>{var e,o;return{columns:[{name:"Hook Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/hook/${encodeURIComponent(t.id)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Hook",onClick:s},{icon:w,label:"Delete",onClick:c,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(b(),g(C,{loading:h(i),title:"Hooks",description:"Trigger your Python scripts with a request.","create-button-text":"Create Hook","empty-title":"No hooks here yet",table:p.value,"entity-name":"Hook",onCreate:m},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Hooks.ac4d9d0f.js.map
