import{d as b,ey as f,G as y,b as D,c as w,u as g}from"./outputWidgets.24bc53e6.js";import{e as _,a as C,b as k}from"./icons.346b8028.js";import{a as v}from"./asyncComputed.e4b96939.js";import{D as c}from"./dashes.4af1e6b4.js";import{C as x}from"./CrudView.acebed42.js";import{a as I}from"./ant-design.3bddf1a0.js";import"./activeRecord.7f48ce0d.js";import"./pubsub.6b8c4d65.js";import"./runnerData.3021bf76.js";import"./Text.9efc0467.js";import"./Title.d959e45a.js";import"./transButton.082aab94.js";import"./router.5678fba5.js";import"./Form.026abd8d.js";import"./index.bf56aca1.js";import"./url.12ca99c5.js";import"./index.0ec384bd.js";import"./index.3a0ced65.js";import"./index.b19c9d88.js";import"./index.4b05c792.js";import"./index.d2b2175c.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[i]="b8ee2e6b-86bc-4266-b8af-2a7e4bdd728f",o._sentryDebugIdIdentifier="sentry-dbid-b8ee2e6b-86bc-4266-b8af-2a7e4bdd728f")}catch{}})();const K=b({__name:"Dashes",setup(o){const i=f(),{loading:r,result:s,refetch:d}=v(()=>c.list()),p=({key:e})=>i.push({name:"dashEditor",params:{dashPath:e}}),l=async({key:e})=>{var a,t;await((t=(a=s.value)==null?void 0:a.find(n=>n.path===e))==null?void 0:t.duplicate()),d()},m=async()=>{const e=await c.create();p({key:e.path})},u=async({key:e})=>{var a,t;await I("Are you sure you want to delete this dash?")&&(await((t=(a=s.value)==null?void 0:a.find(n=>n.path===e))==null?void 0:t.delete()),d())},h=y(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=s.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:p},{icon:C,label:"Duplicate",onClick:l},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:g(r),title:"Python Dashes",description:"Create a dashboard page with charts and inputs interacting with your python code.","create-button-text":"Create Dash","empty-title":"No dashes here yet","video-url":"https://www.youtube.com/embed/oYMptrk7QNE",table:h.value,"entity-name":"Dash",onCreate:m},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Dashes.c3d50e46.js.map
