import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.17e2270d.js";import{e as _,a as C,b as k}from"./icons.ae606380.js";import{a as v}from"./asyncComputed.c8589796.js";import{D as p}from"./dashes.f7f3f911.js";import{C as x}from"./CrudView.0a7d7224.js";import{a as I}from"./ant-design.8d97eacb.js";import"./activeRecord.1230459a.js";import"./pubsub.52f6192d.js";import"./runnerData.07784255.js";import"./index.23cb8791.js";import"./Title.7b6ce571.js";import"./Form.0e9953f6.js";import"./router.845058a4.js";import"./index.4787064b.js";import"./url.6c73df07.js";import"./index.29151007.js";import"./index.4b3be88e.js";import"./index.cfd05648.js";import"./index.bedec2c6.js";import"./index.34b7172c.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="710429c0-0c04-4c5f-aacc-6996740388ae",o._sentryDebugIdIdentifier="sentry-dbid-710429c0-0c04-4c5f-aacc-6996740388ae")}catch{}})();const J=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:i,refetch:c}=v(()=>p.list()),l=({key:t})=>s.push({name:"dashEditor",params:{dashPath:t}}),d=async({key:t})=>{var a,e;await((e=(a=i.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.duplicate()),c()},m=async()=>{const t=await p.create();l({key:t.path})},u=async({key:t})=>{var a,e;await I("Are you sure you want to delete this dash?")&&(await((e=(a=i.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.delete()),c())},h=b(()=>{var t,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=i.value)==null?void 0:t.map(e=>({key:e.path,cells:[{text:e.title,link:`/_editor/dash/${encodeURIComponent(e.path)}`},{text:e.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:l},{icon:C,label:"Duplicate",onClick:d},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(t,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{J as default};
//# sourceMappingURL=Dashes.9b101db9.js.map
