import{_ as j}from"./DocsButton.vue_vue_type_script_setup_true_lang.de8ed59e.js";import{C as g}from"./ContentLayout.99fbdc50.js";import{f as C,F as v,s as $}from"./FilesNavigator.e11ce583.js";import{a as D}from"./asyncComputed.c4d23a56.js";import{d as F,ec as R,f as N,o as P,c as x,w as l,a as _,b as d,aG as p,u as i,dd as B,$ as U,db as S,eD as k,eE as A,a0 as T}from"./index.9cc3d5c7.js";import{C as r}from"./gateway.22c5659c.js";import"./tables.76f4fbaa.js";import"./BookOutlined.548b6b44.js";import"./popupNotifcation.37bbe14e.js";import"./ant-design.4e4293d3.js";import"./string.22f3398b.js";import"./PhFolder.vue.f5cc9667.js";import"./record.6b6ff6df.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="d2710e4a-b591-43ab-8c16-efb0e786bb09",o._sentryDebugIdIdentifier="sentry-dbid-d2710e4a-b591-43ab-8c16-efb0e786bb09")}catch{}})();class u{constructor(e){this.projectId=e}static fromProjectId(e){return new u(e)}async list(){return r.get(`projects/${this.projectId}/files`)}async upload(e,s){const a={"Content-Type":"multipart/form-data"},c=new File([new Blob(s?[s]:[])],C(e));return r.post(`projects/${this.projectId}/files/upload?path=${encodeURIComponent(e)}`,c,a)}async download(e){return r.getBlob(`projects/${this.projectId}/files/download?path=${encodeURIComponent(e)}`)}async delete(e){return r.delete(`projects/${this.projectId}/files?path=${encodeURIComponent(e)}`)}async move(e,s){return r.patch(`projects/${this.projectId}/files?path=${encodeURIComponent(e)}&newPath=${encodeURIComponent(s)}`,{})}}const V=o=>(k("data-v-59df18c9"),o=o(),A(),o),z={class:"files-layout"},E=V(()=>_("br",null,null,-1)),G=F({__name:"Files",setup(o){const s=R().params.projectId,a=u.fromProjectId(s),{loading:c,result:f,refetch:m}=D(()=>a.list()),h=N(()=>f.value?f.value.map(t=>({pathParts:t.path.split("/"),size:t.type==="file"?$(t.size):0,lastModified:t.date,type:t.type})):[]);async function y(t,n){const w=t.join("/");await a.upload(w,n),await m()}function b(t){const n=t.join("/");return a.download(n)}function I(t){const n=t.join("/");return a.delete(n)}return(t,n)=>(P(),x(g,null,{default:l(()=>[_("div",z,[d(i(B),null,{default:l(()=>[p("Files")]),_:1}),d(i(S),null,{default:l(()=>[p(" Here you can upload, download and delete files in your persistent dir."),E,p(" Files can be used in your scripts. "),d(j,{path:"cloud/files"}),U(t.$slots,"description",{},void 0,!0)]),_:3}),d(v,{files:h.value,loading:i(c),separator:"/",onCreate:y,onDownload:b,onDelete:I,onRefetch:i(m)},null,8,["files","loading","onRefetch"])])]),_:3}))}});const te=T(G,[["__scopeId","data-v-59df18c9"]]);export{te as default};
//# sourceMappingURL=Files.e4e24c0f.js.map
