import{d as f,ez as y,J as b,b as D,c as w,u as g}from"./outputWidgets.f120b477.js";import{e as _,a as C,b as k}from"./icons.c367c256.js";import{a as v}from"./asyncComputed.5ccd4614.js";import{D as c}from"./dashes.4d7eaf1c.js";import{C as x}from"./CrudView.87b341af.js";import{a as I}from"./ant-design.13a5e655.js";import"./activeRecord.d87d7ef2.js";import"./pubsub.4681462f.js";import"./index.5818bfb2.js";import"./index.3ab4f365.js";import"./Title.3dc4e32d.js";import"./Form.ec892c10.js";import"./router.e3ecb487.js";import"./url.8af07297.js";import"./index.b96fbbd8.js";import"./index.3801d49d.js";import"./index.de46e6db.js";import"./index.54e8798a.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]="43192781-f2b5-4735-a473-8360ee38a79b",o._sentryDebugIdIdentifier="sentry-dbid-43192781-f2b5-4735-a473-8360ee38a79b")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:l}=v(()=>c.list()),d=({key:e})=>s.push({name:"dashEditor",params:{dashPath:e}}),p=async({key:e})=>{var a,t;await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.duplicate()),l()},u=async()=>{const e=await c.create();d({key:e.path})},m=async({key:e})=>{var a,t;await I("Are you sure you want to delete this dash?")&&(await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.delete()),l())},h=b(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=n.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:d},{icon:C,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:m,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:u},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Dashes.ecfedb9b.js.map
