import{d as f,ez as y,J as b,b as D,c as w,u as _}from"./outputWidgets.c072fe4e.js";import{e as g,a as k,b as C}from"./icons.158b4825.js";import{a as v}from"./asyncComputed.376cdc00.js";import{D as l}from"./dashes.6f548a30.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.9296340f.js";import{a as I}from"./ant-design.5cb2a38e.js";import"./activeRecord.fdc25b97.js";import"./pubsub.98ad9fe0.js";import"./index.00103e26.js";import"./index.4cff163b.js";import"./Title.e3dcb8ea.js";import"./Form.9f52866c.js";import"./index.4e6af937.js";import"./index.d9c3e0de.js";import"./index.2e3640f1.js";import"./index.e7c5574b.js";import"./index.ec8e038a.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]="739db5db-41f9-4e7e-9389-e1fc0684cefd",o._sentryDebugIdIdentifier="sentry-dbid-739db5db-41f9-4e7e-9389-e1fc0684cefd")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:d}=v(()=>l.list()),c=({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()),d()},m=async()=>{const e=await l.create();c({key:e.path})},u=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()),d())},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:g,label:"Edit Dash",onClick:c},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:_(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{q as default};
//# sourceMappingURL=Dashes.c836aa35.js.map
