import{L as X,M as H,O as W,c as P,h as ee,ae as te,g as ie,r as le,bj as ne,m as ae,w as oe,bn as se,af as _,at as re,ah as u,d as a,ak as $,al as z,am as ce,E as V,an as A,B as O,V as Y,as as ue,ap as j,bJ as de,ag as Q,aG as fe,ai as E,C as me,aj as ge,bt as be,ar as pe,bm as he}from"./index.b1ea7675.js";import{Q as ye}from"./QLinearProgress.b1e9643a.js";import{u as ke}from"./use-dialog-plugin-component.b481e5a5.js";const Be=["text","rect","circle","QBtn","QBadge","QChip","QToolbar","QCheckbox","QRadio","QToggle","QSlider","QRange","QInput","QAvatar"],ve=["wave","pulse","pulse-x","pulse-y","fade","blink","none"];var Ge=X({name:"QSkeleton",props:{...H,tag:{type:String,default:"div"},type:{type:String,validator:l=>Be.includes(l),default:"rect"},animation:{type:String,validator:l=>ve.includes(l),default:"wave"},animationSpeed:{type:[String,Number],default:1500},square:Boolean,bordered:Boolean,size:String,width:String,height:String},setup(l,{slots:r}){const b=ie(),n=W(l,b.proxy.$q),d=P(()=>{const f=l.size!==void 0?[l.size,l.size]:[l.width,l.height];return{"--q-skeleton-speed":`${l.animationSpeed}ms`,width:f[0],height:f[1]}}),t=P(()=>`q-skeleton q-skeleton--${n.value===!0?"dark":"light"} q-skeleton--type-${l.type}`+(l.animation!=="none"?` q-skeleton--anim q-skeleton--anim-${l.animation}`:"")+(l.square===!0?" q-skeleton--square":"")+(l.bordered===!0?" q-skeleton--bordered":""));return()=>ee(l.tag,{class:t.value,style:d.value},te(r.default))}});/**
 * filesize
 *
 * @copyright 2022 Jason Mulligan <jason.mulligan@avoidwork.com>
 * @license BSD-3-Clause
 * @version 10.0.6
 */const Se="array",_e="bit",G="bits",xe="byte",K="bytes",h="",we="exponent",Qe="function",x="iec",Te="Invalid number",Ee="Invalid rounding method",B="jedec",Ie="object",L=".",Ne="round",Ce="s",Me="kbit",qe="kB",De=" ",Re="string",Pe="0",T={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function Ke(l,{bits:r=!1,pad:b=!1,base:n=-1,round:d=2,locale:t=h,localeOptions:f={},separator:y=h,spacer:c=De,symbols:s={},standard:o=h,output:m=Re,fullform:U=!1,fullforms:I=[],exponent:N=-1,roundingMethod:Z=Ne,precision:v=0}={}){let i=N,p=Number(l),e=[],g=0,w=h;n===-1&&o.length===0?(n=10,o=B):n===-1&&o.length>0?(o=o===x?x:B,n=o===x?2:10):(n=n===2?2:10,o=n===10||o===B?B:x);const S=n===10?1e3:1024,F=U===!0,C=p<0,M=Math[Z];if(typeof l!="bigint"&&isNaN(l))throw new TypeError(Te);if(typeof M!==Qe)throw new TypeError(Ee);if(C&&(p=-p),(i===-1||isNaN(i))&&(i=Math.floor(Math.log(p)/Math.log(S)),i<0&&(i=0)),i>8&&(v>0&&(v+=8-i),i=8),m===we)return i;if(p===0)e[0]=0,w=e[1]=T.symbol[o][r?G:K][i];else{g=p/(n===2?Math.pow(2,i*10):Math.pow(1e3,i)),r&&(g=g*8,g>=S&&i<8&&(g=g/S,i++));const k=Math.pow(10,i>0?d:0);e[0]=M(g*k)/k,e[0]===S&&i<8&&N===-1&&(e[0]=1,i++),w=e[1]=n===10&&i===1?r?Me:qe:T.symbol[o][r?G:K][i]}if(C&&(e[0]=-e[0]),v>0&&(e[0]=e[0].toPrecision(v)),e[1]=s[e[1]]||e[1],t===!0?e[0]=e[0].toLocaleString():t.length>0?e[0]=e[0].toLocaleString(t,f):y.length>0&&(e[0]=e[0].toString().replace(L,y)),b&&Number.isInteger(e[0])===!1&&d>0){const k=y||L,q=e[0].toString().split(k),D=q[1]||h,R=D.length,J=d-R;e[0]=`${q[0]}${k}${D.padEnd(R+J,Pe)}`}return F&&(e[1]=I[i]?I[i]:T.fullform[o][i]+(r?_e:xe)+(e[0]===1?h:Ce)),m===Se?e:m===Ie?{value:e[0],symbol:e[1],exponent:i,unit:w}:e.join(c)}const $e={key:0},ze={key:1,style:{height:"20px",width:"100%"},class:"fit"},Ve=E("br",null,null,-1),Ae={key:0,class:"pt-5 p-3 text-center font-bold bg-red-50 text-black border-[0.5px] rounded-lg"},Le={__name:"uploadFile",setup(l){const r=le(null),{onDialogOK:b,dialogRef:n}=ke(),d=ne(),t=ae({loading:!1,showInput:!1,files:[],err:null});oe(()=>t.files,c=>{c.length&&(t.err=null)});async function f(){t.loading=!0,t.err=null;var c=await he.upload(t.files).catch(s=>(t.err=String(s.error),null)).then(s=>s);t.loading=!1,c?t.files.length>1?b({hasMany:!0,data:c}):b({hasMany:!1,data:c}):(t.files=[],d.notify({message:"Service unaivalable"}))}function y(){t.files.length&&f()}return(c,s)=>{const o=se("van-uploader");return _(),re(pe,{ref_key:"dialogRef",ref:n},{default:u(()=>[a($,{style:{"min-width":"00px"}},{default:u(()=>[a(z,{class:"q-mx-md text-bold"},{default:u(()=>[a(ce,{class:"text-bold"},{default:u(()=>[V(" Add file ")]),_:1}),a(A),O(a(Y,{round:"",flat:"",icon:"mdi-close"},null,512),[[ue]])]),_:1}),a(j,{style:{"min-width":"400px"},class:"fit"},{default:u(()=>[a($,{style:de(`${t.loading?"":"min-width: 100%; border: 0.1px solid gray"}`),class:"box cursor-pointer flex flex-center",onClick:s[0]||(s[0]=m=>c.$refs.uploader.chooseFile())},{default:u(()=>[a(j,{class:"fit"},{default:u(()=>[t.loading?(_(),Q("div",ze,[E("div",null,[a(ye,{rounded:"",indeterminate:"",color:"primary","track-color":"primary",class:"q-mt-sm"})])])):(_(),Q("div",$e,[a(fe,{size:"sm",name:"mdi-file-plus"}),V(" Click to browse ")]))]),_:1})]),_:1},8,["style"]),O(E("div",null,[a(o,{"after-read":y,modelValue:t.files,"onUpdate:modelValue":s[1]||(s[1]=m=>t.files=m),multiple:"",ref_key:"uploader",ref:r,accept:"image/*,.zip,.apk,.pdf,video/*,audio/*,application/*,.aab",class:"flex flex-center"},null,8,["modelValue"])],512),[[me,t.showInput]]),Ve,t.err?(_(),Q("div",Ae,ge(t.err),1)):be("",!0)]),_:1}),a(z,null,{default:u(()=>[a(A),a(Y,{onClick:s[2]||(s[2]=m=>f()),loading:t.loading,color:"primary",label:"Done"},null,8,["loading"])]),_:1})]),_:1})]),_:1},512)}}};export{Ge as Q,Le as _,Ke as f};
