import{d as f,eA as k,G as y,b as g,c as b,u as h}from"./outputWidgets.c4f3de67.js";import{e as _,d as w}from"./icons.49e74e71.js";import{a as H}from"./asyncComputed.c75b06d6.js";import{H as c}from"./hooks.12fdb61d.js";import{C}from"./CrudView.4072ea68.js";import{a as x}from"./ant-design.a1a552ac.js";import"./record.685c8ba7.js";import"./pubsub.1842fa2d.js";import"./Text.fcf8f28f.js";import"./Base.9ed9c296.js";import"./transButton.ebe60b80.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 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]="d461eec6-0635-431a-a813-c35c8ee72665",a._sentryDebugIdIdentifier="sentry-dbid-d461eec6-0635-431a-a813-c35c8ee72665")}catch{}})();const $=f({__name:"Hooks",setup(a){const r=k(),{loading:i,result:n,refetch:d}=H(()=>c.list()),s=({key:e})=>r.push({name:"hookEditor",params:{id:e}}),l=async()=>{const e=await c.create();s({key:e.id})},m=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()),d())},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:m,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),b(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:l},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Hooks.bdd3a8cc.js.map
