import{$ as F,S as x,a as i,f as v,a4 as N,i as s,M as C,a2 as S,W as $,aA as O,n as z}from"./app-JmgyQoR0.js";import{F as g}from"./section-yxO0GkeZ.js";import{M}from"./MkKeyValue-qNXtpS4q.js";import{F as D}from"./split-mI9ZWkMh.js";import{b}from"./bytes-7YLXyrly.js";import{M as A}from"./MkChart-5f7_-vyZ.js";import{b as E,a as p,c as _,h as V,t as K,i as P,j as e,K as a,E as l,z as t,u as k,y as j,l as o,H as G,I as H,J}from"./vue-y3KLWBaS.js";import"./use-chart-tooltip-45ovlg1Q.js";import"./chartjs-adapter-date-fns.esm-ogm-isT_.js";const R=c=>(H("data-v-6310dd47"),c=c(),J(),c),T={class:"_formRoot"},W={class:"_formBlock uawsfosz"},q={class:"meter"},L=R(()=>k("i",{class:"ph-folder-notch-open ph-bold ph-lg"},null,-1)),Q=E({__name:"drive",setup(c){const h=p(!0),f=p(null),m=p(null),u=p(null);let y=p(F.alwaysMarkNsfw);const B=_(()=>({width:`${f.value/m.value*100}%`,background:x({h:180-f.value/m.value*180,s:.7,l:.5})})),w=_(i.makeGetterSetter("keepOriginalUploading"));v("drive").then(r=>{m.value=r.capacity,f.value=r.usage,h.value=!1}),i.state.uploadFolder&&v("drive/folders/show",{folderId:i.state.uploadFolder}).then(r=>{u.value=r});function I(){$(!1).then(async r=>{i.set("uploadFolder",r?r.id:null),O(),i.state.uploadFolder?u.value=await v("drive/folders/show",{folderId:i.state.uploadFolder}):u.value=null})}function U(){v("i/update",{alwaysMarkNsfw:!!y.value})}return _(()=>[]),_(()=>[]),N({title:s.ts.drive,icon:"ph-cloud ph-bold ph-lg"}),(r,d)=>(V(),K("div",T,[h.value?G("",!0):(V(),P(g,{key:0},{label:e(()=>[a(l(t(s).ts.usageAmount),1)]),default:e(()=>[k("div",W,[k("div",q,[k("div",{style:j(B.value)},null,4)])]),o(D,null,{default:e(()=>[o(M,{class:"_formBlock"},{key:e(()=>[a(l(t(s).ts.capacity),1)]),value:e(()=>[a(l(t(b)(m.value,1)),1)]),_:1}),o(M,{class:"_formBlock"},{key:e(()=>[a(l(t(s).ts.inUse),1)]),value:e(()=>[a(l(t(b)(f.value,1)),1)]),_:1})]),_:1})]),_:1})),o(g,null,{label:e(()=>[a(l(t(s).ts.statistics),1)]),default:e(()=>[o(A,{src:"per-user-drive",args:{user:t(F)},span:"day",limit:7*5,bar:!0,stacked:!0,detailed:!1,"aspect-ratio":6},null,8,["args"])]),_:1}),o(g,null,{default:e(()=>[o(C,{onClick:d[0]||(d[0]=n=>I())},{suffix:e(()=>[a(l(u.value?u.value.name:"-"),1)]),suffixIcon:e(()=>[L]),default:e(()=>[a(l(t(s).ts.uploadFolder)+" ",1)]),_:1}),o(S,{modelValue:w.value,"onUpdate:modelValue":d[1]||(d[1]=n=>w.value=n),class:"_formBlock"},{label:e(()=>[a(l(t(s).ts.keepOriginalUploading),1)]),caption:e(()=>[a(l(t(s).ts.keepOriginalUploadingDescription),1)]),_:1},8,["modelValue"]),o(S,{modelValue:y.value,"onUpdate:modelValue":[d[2]||(d[2]=n=>y.value=n),d[3]||(d[3]=n=>U())],class:"_formBlock"},{label:e(()=>[a(l(t(s).ts.alwaysMarkSensitive),1)]),_:1},8,["modelValue"])]),_:1})]))}}),re=z(Q,[["__scopeId","data-v-6310dd47"]]);export{re as default};
