import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.9a4dffd5.js";import{e as _,a as C,b as k}from"./icons.d935dec9.js";import{a as v}from"./asyncComputed.947a021a.js";import{D as p}from"./dashes.8f97fb72.js";import{C as x}from"./CrudView.32e9e362.js";import{a as I}from"./ant-design.edc4db28.js";import"./activeRecord.6b2e89dc.js";import"./pubsub.25596209.js";import"./runnerData.8cacc2f4.js";import"./index.0d204717.js";import"./Title.72e90637.js";import"./Form.0ea0ca53.js";import"./router.e9c58c63.js";import"./index.a351ac5c.js";import"./url.152c5826.js";import"./index.c64df437.js";import"./index.c4327f7e.js";import"./index.d0b58c73.js";import"./index.3ecad98a.js";import"./index.0e22fd42.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]="4f7f81ab-445e-4ab0-9264-ac6c17661714",o._sentryDebugIdIdentifier="sentry-dbid-4f7f81ab-445e-4ab0-9264-ac6c17661714")}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.10b7a707.js.map
