import{$ as w,v as d,d as v,aA as x,b as o,M as N,a8 as h,S as C,W as I,at as D,_ as O}from"./app-QjDgb7aF.js";import{F as _}from"./section-Dbg05qO2.js";import{M as F}from"./MkKeyValue-BeApKcpm.js";import{F as $}from"./split-B5EOpoau.js";import{b}from"./bytes-C39hD0JB.js";import{M as z}from"./MkChart-Cg7t3SGL.js";import{b as A,a as c,f as M,j as V,p as P,g as R,i as e,q as k,t as j,k as r,J as l,D as t,u as a,H as q,I as E}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";import"./use-chart-tooltip-CwWaLiz4.js";const G={class:"_formRoot"},H={class:"_formBlock uawsfosz"},J={class:"meter"},K=A({__name:"drive",setup(T){const g=c(!0),f=c(null),m=c(null),n=c(null);let p=c(w.alwaysMarkNsfw);const B=M(()=>({width:`${f.value/m.value*100}%`,background:C({h:180-f.value/m.value*180,s:.7,l:.5})})),y=M(d.makeGetterSetter("keepOriginalUploading"));v("drive").then(i=>{m.value=i.capacity,f.value=i.usage,g.value=!1}),d.state.uploadFolder&&v("drive/folders/show",{folderId:d.state.uploadFolder}).then(i=>{n.value=i});function S(){I(!1).then(async i=>{d.set("uploadFolder",i?i.id:null),D(),d.state.uploadFolder?n.value=await v("drive/folders/show",{folderId:d.state.uploadFolder}):n.value=null})}function U(){v("i/update",{alwaysMarkNsfw:!!p.value})}return x({title:o.ts.drive,icon:"ph-cloud ph-bold ph-lg"}),(i,s)=>(V(),P("div",G,[g.value?q("",!0):(V(),R(_,{key:0},{label:e(()=>[l(t(a(o).ts.usageAmount),1)]),default:e(()=>[k("div",H,[k("div",J,[k("div",{style:j(B.value)},null,4)])]),r($,null,{default:e(()=>[r(F,{class:"_formBlock"},{key:e(()=>[l(t(a(o).ts.capacity),1)]),value:e(()=>[l(t(a(b)(m.value,1)),1)]),_:1}),r(F,{class:"_formBlock"},{key:e(()=>[l(t(a(o).ts.inUse),1)]),value:e(()=>[l(t(a(b)(f.value,1)),1)]),_:1})]),_:1})]),_:1})),r(_,null,{label:e(()=>[l(t(a(o).ts.statistics),1)]),default:e(()=>[r(z,{src:"per-user-drive",args:{user:a(w)},span:"day",limit:35,bar:!0,stacked:!0,detailed:!1,"aspect-ratio":6},null,8,["args"])]),_:1}),r(_,null,{default:e(()=>[r(N,{onClick:s[0]||(s[0]=u=>S())},{suffix:e(()=>[l(t(n.value?n.value.name:"-"),1)]),suffixIcon:e(()=>[...s[4]||(s[4]=[k("i",{class:"ph-folder-notch-open ph-bold ph-lg"},null,-1)])]),default:e(()=>[l(t(a(o).ts.uploadFolder)+" ",1)]),_:1}),r(h,{modelValue:y.value,"onUpdate:modelValue":s[1]||(s[1]=u=>y.value=u),class:"_formBlock"},{label:e(()=>[l(t(a(o).ts.keepOriginalUploading),1)]),caption:e(()=>[l(t(a(o).ts.keepOriginalUploadingDescription),1)]),_:1},8,["modelValue"]),r(h,{modelValue:a(p),"onUpdate:modelValue":[s[2]||(s[2]=u=>E(p)?p.value=u:p=u),s[3]||(s[3]=u=>U())],class:"_formBlock"},{label:e(()=>[l(t(a(o).ts.alwaysMarkSensitive),1)]),_:1},8,["modelValue"])]),_:1})]))}}),se=O(K,[["__scopeId","data-v-0c34ef6f"]]);export{se as default};
//# sourceMappingURL=drive-D0gGYLej.js.map
