hfs 0.56.0-alpha2 → 0.56.0-alpha3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- System.register(["./index-legacy-B70uZPX1.js"],(function(h,t){"use strict";var i,s;return{setters:[function(h){i=h.c,s=h.g}],execute:function(){function t(h,t){for(var i=function(){var i=t[s];if("string"!=typeof i&&!Array.isArray(i)){var r=function(t){if("default"!==t&&!(t in h)){var s=Object.getOwnPropertyDescriptor(i,t);s&&Object.defineProperty(h,t,s.get?s:{enumerable:!0,get:function(){return i[t]}})}};for(var e in i)r(e)}},s=0;s<t.length;s++)i();return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var r,e={exports:{}},n=(r||(r=1,function(h){!function(){var t="input is invalid type",s="object"==typeof window,r=s?window:{};r.JS_SHA512_NO_WINDOW&&(s=!1);var e=!s&&"object"==typeof self;!r.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=i:e&&(r=self);var n=!r.JS_SHA512_NO_COMMON_JS&&h.exports,o=!r.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],f=[24,16,8,0],c=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=["hex","array","digest","arrayBuffer"],y=[];!r.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(h){return"[object Array]"===Object.prototype.toString.call(h)}),!o||!r.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(h){return"object"==typeof h&&h.buffer&&h.buffer.constructor===ArrayBuffer});var p=function(h,t){return function(i){return new _(t,!0).update(i)[h]()}},d=function(h){var t=p("hex",h);t.create=function(){return new _(h)},t.update=function(h){return t.create().update(h)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=p(s,h)}return t},b=function(h,t){return function(i,s){return new w(i,t,!0).update(s)[h]()}},v=function(h){var t=b("hex",h);t.create=function(t){return new w(t,h)},t.update=function(h,i){return t.create(h).update(i)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=b(s,h)}return t};function _(h,t){t?(y[0]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=y[16]=y[17]=y[18]=y[19]=y[20]=y[21]=y[22]=y[23]=y[24]=y[25]=y[26]=y[27]=y[28]=y[29]=y[30]=y[31]=y[32]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==h?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==h?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==h?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=h,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function w(h,i,s){var r,e=typeof h;if("string"!==e){if("object"!==e)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);r=!0}var n=h.length;if(!r){for(var a,l=[],f=(n=h.length,0),c=0;c<n;++c)(a=h.charCodeAt(c))<128?l[f++]=a:a<2048?(l[f++]=192|a>>6,l[f++]=128|63&a):a<55296||a>=57344?(l[f++]=224|a>>12,l[f++]=128|a>>6&63,l[f++]=128|63&a):(a=65536+((1023&a)<<10|1023&h.charCodeAt(++c)),l[f++]=240|a>>18,l[f++]=128|a>>12&63,l[f++]=128|a>>6&63,l[f++]=128|63&a);h=l}h.length>128&&(h=new _(i,!0).update(h).array());var u=[],y=[];for(c=0;c<128;++c){var p=h[c]||0;u[c]=92^p,y[c]=54^p}_.call(this,i,s),this.update(y),this.oKeyPad=u,this.inner=!0,this.sharedMemory=s}_.prototype.update=function(h){if(this.finalized)throw new Error("finalize already called");var i,s=typeof h;if("string"!==s){if("object"!==s)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);i=!0}for(var r,e,n=0,a=h.length,l=this.blocks;n<a;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=l[16]=l[17]=l[18]=l[19]=l[20]=l[21]=l[22]=l[23]=l[24]=l[25]=l[26]=l[27]=l[28]=l[29]=l[30]=l[31]=l[32]=0),i)for(e=this.start;n<a&&e<128;++n)l[e>>2]|=h[n]<<f[3&e++];else for(e=this.start;n<a&&e<128;++n)(r=h.charCodeAt(n))<128?l[e>>2]|=r<<f[3&e++]:r<2048?(l[e>>2]|=(192|r>>6)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):r<55296||r>=57344?(l[e>>2]|=(224|r>>12)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):(r=65536+((1023&r)<<10|1023&h.charCodeAt(++n)),l[e>>2]|=(240|r>>18)<<f[3&e++],l[e>>2]|=(128|r>>12&63)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,e>=128?(this.block=l[32],this.start=e-128,this.hash(),this.hashed=!0):this.start=e}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,t=this.lastByteIndex;h[32]=this.block,h[t>>2]|=l[3&t],this.block=h[32],t>=112&&(this.hashed||this.hash(),h[0]=this.block,h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=h[16]=h[17]=h[18]=h[19]=h[20]=h[21]=h[22]=h[23]=h[24]=h[25]=h[26]=h[27]=h[28]=h[29]=h[30]=h[31]=h[32]=0),h[30]=this.hBytes<<3|this.bytes>>>29,h[31]=this.bytes<<3,this.hash()}},_.prototype.hash=function(){var h,t,i,s,r,e,n,o,a,l,f,u,y,p,d,b,v,_,w,A,g,S,B,U,O,k=this.h0h,x=this.h0l,z=this.h1h,j=this.h1l,E=this.h2h,N=this.h2l,m=this.h3h,J=this.h3l,P=this.h4h,H=this.h4l,I=this.h5h,R=this.h5l,V=this.h6h,C=this.h6l,D=this.h7h,K=this.h7l,M=this.blocks;for(h=32;h<160;h+=2)t=((A=M[h-30])>>>1|(g=M[h-29])<<31)^(A>>>8|g<<24)^A>>>7,i=(g>>>1|A<<31)^(g>>>8|A<<24)^(g>>>7|A<<25),s=((A=M[h-4])>>>19|(g=M[h-3])<<13)^(g>>>29|A<<3)^A>>>6,r=(g>>>19|A<<13)^(A>>>29|g<<3)^(g>>>6|A<<26),A=M[h-32],g=M[h-31],a=((S=M[h-14])>>>16)+(A>>>16)+(t>>>16)+(s>>>16)+((o=(65535&S)+(65535&A)+(65535&t)+(65535&s)+((n=((B=M[h-13])>>>16)+(g>>>16)+(i>>>16)+(r>>>16)+((e=(65535&B)+(65535&g)+(65535&i)+(65535&r))>>>16))>>>16))>>>16),M[h]=a<<16|65535&o,M[h+1]=n<<16|65535&e;var F=k,T=x,W=z,Y=j,q=E,G=N,L=m,Q=J,X=P,Z=H,$=I,hh=R,th=V,ih=C,sh=D,rh=K;for(b=W&q,v=Y&G,h=0;h<160;h+=8)t=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25),i=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25),s=(X>>>14|Z<<18)^(X>>>18|Z<<14)^(Z>>>9|X<<23),r=(Z>>>14|X<<18)^(Z>>>18|X<<14)^(X>>>9|Z<<23),_=(l=F&W)^F&q^b,w=(f=T&Y)^T&G^v,U=X&$^~X&th,O=Z&hh^~Z&ih,A=M[h],g=M[h+1],A=(a=((S=c[h])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(sh>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&sh)+((n=((B=c[h+1])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(rh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&rh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,sh=(a=(L>>>16)+(A>>>16)+((o=(65535&L)+(65535&A)+((n=(Q>>>16)+(g>>>16)+((e=(65535&Q)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,rh=n<<16|65535&e,t=((L=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Q=n<<16|65535&e)<<4)^(Q>>>2|L<<30)^(Q>>>7|L<<25),i=(Q>>>28|L<<4)^(L>>>2|Q<<30)^(L>>>7|Q<<25),s=(sh>>>14|rh<<18)^(sh>>>18|rh<<14)^(rh>>>9|sh<<23),r=(rh>>>14|sh<<18)^(rh>>>18|sh<<14)^(sh>>>9|rh<<23),_=(u=L&F)^L&W^l,w=(y=Q&T)^Q&Y^f,U=sh&X^~sh&$,O=rh&Z^~rh&hh,A=M[h+2],g=M[h+3],A=(a=((S=c[h+2])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(th>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&th)+((n=((B=c[h+3])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(ih>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&ih))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,th=(a=(q>>>16)+(A>>>16)+((o=(65535&q)+(65535&A)+((n=(G>>>16)+(g>>>16)+((e=(65535&G)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,ih=n<<16|65535&e,t=((q=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(G=n<<16|65535&e)<<4)^(G>>>2|q<<30)^(G>>>7|q<<25),i=(G>>>28|q<<4)^(q>>>2|G<<30)^(q>>>7|G<<25),s=(th>>>14|ih<<18)^(th>>>18|ih<<14)^(ih>>>9|th<<23),r=(ih>>>14|th<<18)^(ih>>>18|th<<14)^(th>>>9|ih<<23),_=(p=q&L)^q&F^u,w=(d=G&Q)^G&T^y,U=th&sh^~th&X,O=ih&rh^~ih&Z,A=M[h+4],g=M[h+5],A=(a=((S=c[h+4])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+($>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&$)+((n=((B=c[h+5])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(hh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&hh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,$=(a=(W>>>16)+(A>>>16)+((o=(65535&W)+(65535&A)+((n=(Y>>>16)+(g>>>16)+((e=(65535&Y)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,hh=n<<16|65535&e,t=((W=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Y=n<<16|65535&e)<<4)^(Y>>>2|W<<30)^(Y>>>7|W<<25),i=(Y>>>28|W<<4)^(W>>>2|Y<<30)^(W>>>7|Y<<25),s=($>>>14|hh<<18)^($>>>18|hh<<14)^(hh>>>9|$<<23),r=(hh>>>14|$<<18)^(hh>>>18|$<<14)^($>>>9|hh<<23),_=(b=W&q)^W&L^p,w=(v=Y&G)^Y&Q^d,U=$&th^~$&sh,O=hh&ih^~hh&rh,A=M[h+6],g=M[h+7],A=(a=((S=c[h+6])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(X>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&X)+((n=((B=c[h+7])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(Z>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,X=(a=(F>>>16)+(A>>>16)+((o=(65535&F)+(65535&A)+((n=(T>>>16)+(g>>>16)+((e=(65535&T)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,Z=n<<16|65535&e,F=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,T=n<<16|65535&e;a=(k>>>16)+(F>>>16)+((o=(65535&k)+(65535&F)+((n=(x>>>16)+(T>>>16)+((e=(65535&x)+(65535&T))>>>16))>>>16))>>>16),this.h0h=a<<16|65535&o,this.h0l=n<<16|65535&e,a=(z>>>16)+(W>>>16)+((o=(65535&z)+(65535&W)+((n=(j>>>16)+(Y>>>16)+((e=(65535&j)+(65535&Y))>>>16))>>>16))>>>16),this.h1h=a<<16|65535&o,this.h1l=n<<16|65535&e,a=(E>>>16)+(q>>>16)+((o=(65535&E)+(65535&q)+((n=(N>>>16)+(G>>>16)+((e=(65535&N)+(65535&G))>>>16))>>>16))>>>16),this.h2h=a<<16|65535&o,this.h2l=n<<16|65535&e,a=(m>>>16)+(L>>>16)+((o=(65535&m)+(65535&L)+((n=(J>>>16)+(Q>>>16)+((e=(65535&J)+(65535&Q))>>>16))>>>16))>>>16),this.h3h=a<<16|65535&o,this.h3l=n<<16|65535&e,a=(P>>>16)+(X>>>16)+((o=(65535&P)+(65535&X)+((n=(H>>>16)+(Z>>>16)+((e=(65535&H)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=a<<16|65535&o,this.h4l=n<<16|65535&e,a=(I>>>16)+($>>>16)+((o=(65535&I)+(65535&$)+((n=(R>>>16)+(hh>>>16)+((e=(65535&R)+(65535&hh))>>>16))>>>16))>>>16),this.h5h=a<<16|65535&o,this.h5l=n<<16|65535&e,a=(V>>>16)+(th>>>16)+((o=(65535&V)+(65535&th)+((n=(C>>>16)+(ih>>>16)+((e=(65535&C)+(65535&ih))>>>16))>>>16))>>>16),this.h6h=a<<16|65535&o,this.h6l=n<<16|65535&e,a=(D>>>16)+(sh>>>16)+((o=(65535&D)+(65535&sh)+((n=(K>>>16)+(rh>>>16)+((e=(65535&K)+(65535&rh))>>>16))>>>16))>>>16),this.h7h=a<<16|65535&o,this.h7l=n<<16|65535&e},_.prototype.hex=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,l=this.h4h,f=this.h4l,c=this.h5h,u=this.h5l,y=this.h6h,p=this.h6l,d=this.h7h,b=this.h7l,v=this.bits,_=a[h>>28&15]+a[h>>24&15]+a[h>>20&15]+a[h>>16&15]+a[h>>12&15]+a[h>>8&15]+a[h>>4&15]+a[15&h]+a[t>>28&15]+a[t>>24&15]+a[t>>20&15]+a[t>>16&15]+a[t>>12&15]+a[t>>8&15]+a[t>>4&15]+a[15&t]+a[i>>28&15]+a[i>>24&15]+a[i>>20&15]+a[i>>16&15]+a[i>>12&15]+a[i>>8&15]+a[i>>4&15]+a[15&i]+a[s>>28&15]+a[s>>24&15]+a[s>>20&15]+a[s>>16&15]+a[s>>12&15]+a[s>>8&15]+a[s>>4&15]+a[15&s]+a[r>>28&15]+a[r>>24&15]+a[r>>20&15]+a[r>>16&15]+a[r>>12&15]+a[r>>8&15]+a[r>>4&15]+a[15&r]+a[e>>28&15]+a[e>>24&15]+a[e>>20&15]+a[e>>16&15]+a[e>>12&15]+a[e>>8&15]+a[e>>4&15]+a[15&e]+a[n>>28&15]+a[n>>24&15]+a[n>>20&15]+a[n>>16&15]+a[n>>12&15]+a[n>>8&15]+a[n>>4&15]+a[15&n];return v>=256&&(_+=a[o>>28&15]+a[o>>24&15]+a[o>>20&15]+a[o>>16&15]+a[o>>12&15]+a[o>>8&15]+a[o>>4&15]+a[15&o]),v>=384&&(_+=a[l>>28&15]+a[l>>24&15]+a[l>>20&15]+a[l>>16&15]+a[l>>12&15]+a[l>>8&15]+a[l>>4&15]+a[15&l]+a[f>>28&15]+a[f>>24&15]+a[f>>20&15]+a[f>>16&15]+a[f>>12&15]+a[f>>8&15]+a[f>>4&15]+a[15&f]+a[c>>28&15]+a[c>>24&15]+a[c>>20&15]+a[c>>16&15]+a[c>>12&15]+a[c>>8&15]+a[c>>4&15]+a[15&c]+a[u>>28&15]+a[u>>24&15]+a[u>>20&15]+a[u>>16&15]+a[u>>12&15]+a[u>>8&15]+a[u>>4&15]+a[15&u]),512==v&&(_+=a[y>>28&15]+a[y>>24&15]+a[y>>20&15]+a[y>>16&15]+a[y>>12&15]+a[y>>8&15]+a[y>>4&15]+a[15&y]+a[p>>28&15]+a[p>>24&15]+a[p>>20&15]+a[p>>16&15]+a[p>>12&15]+a[p>>8&15]+a[p>>4&15]+a[15&p]+a[d>>28&15]+a[d>>24&15]+a[d>>20&15]+a[d>>16&15]+a[d>>12&15]+a[d>>8&15]+a[d>>4&15]+a[15&d]+a[b>>28&15]+a[b>>24&15]+a[b>>20&15]+a[b>>16&15]+a[b>>12&15]+a[b>>8&15]+a[b>>4&15]+a[15&b]),_},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,a=this.h4h,l=this.h4l,f=this.h5h,c=this.h5l,u=this.h6h,y=this.h6l,p=this.h7h,d=this.h7l,b=this.bits,v=[h>>24&255,h>>16&255,h>>8&255,255&h,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n];return b>=256&&v.push(o>>24&255,o>>16&255,o>>8&255,255&o),b>=384&&v.push(a>>24&255,a>>16&255,a>>8&255,255&a,l>>24&255,l>>16&255,l>>8&255,255&l,f>>24&255,f>>16&255,f>>8&255,255&f,c>>24&255,c>>16&255,c>>8&255,255&c),512==b&&v.push(u>>24&255,u>>16&255,u>>8&255,255&u,y>>24&255,y>>16&255,y>>8&255,255&y,p>>24&255,p>>16&255,p>>8&255,255&p,d>>24&255,d>>16&255,d>>8&255,255&d),v},_.prototype.array=_.prototype.digest,_.prototype.arrayBuffer=function(){this.finalize();var h=this.bits,t=new ArrayBuffer(h/8),i=new DataView(t);return i.setUint32(0,this.h0h),i.setUint32(4,this.h0l),i.setUint32(8,this.h1h),i.setUint32(12,this.h1l),i.setUint32(16,this.h2h),i.setUint32(20,this.h2l),i.setUint32(24,this.h3h),h>=256&&i.setUint32(28,this.h3l),h>=384&&(i.setUint32(32,this.h4h),i.setUint32(36,this.h4l),i.setUint32(40,this.h5h),i.setUint32(44,this.h5l)),512==h&&(i.setUint32(48,this.h6h),i.setUint32(52,this.h6l),i.setUint32(56,this.h7h),i.setUint32(60,this.h7l)),t},_.prototype.clone=function(){var h=new _(this.bits,!1);return this.copyTo(h),h},_.prototype.copyTo=function(h){var t=0,i=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<i.length;++t)h[i[t]]=this[i[t]];for(t=0;t<this.blocks.length;++t)h.blocks[t]=this.blocks[t]},w.prototype=new _,w.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();_.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(h),_.prototype.finalize.call(this)}},w.prototype.clone=function(){var h=new w([],this.bits,!1);this.copyTo(h),h.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)h.oKeyPad[t]=this.oKeyPad[t];return h};var A=d(512);A.sha512=A,A.sha384=d(384),A.sha512_256=d(256),A.sha512_224=d(224),A.sha512.hmac=v(512),A.sha384.hmac=v(384),A.sha512_256.hmac=v(256),A.sha512_224.hmac=v(224),n?h.exports=A:(r.sha512=A.sha512,r.sha384=A.sha384,r.sha512_256=A.sha512_256,r.sha512_224=A.sha512_224)}()}(e)),e.exports);
1
+ System.register(["./index-legacy-C2rsNh47.js"],(function(h,t){"use strict";var i,s;return{setters:[function(h){i=h.c,s=h.g}],execute:function(){function t(h,t){for(var i=function(){var i=t[s];if("string"!=typeof i&&!Array.isArray(i)){var r=function(t){if("default"!==t&&!(t in h)){var s=Object.getOwnPropertyDescriptor(i,t);s&&Object.defineProperty(h,t,s.get?s:{enumerable:!0,get:function(){return i[t]}})}};for(var e in i)r(e)}},s=0;s<t.length;s++)i();return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var r,e={exports:{}},n=(r||(r=1,function(h){!function(){var t="input is invalid type",s="object"==typeof window,r=s?window:{};r.JS_SHA512_NO_WINDOW&&(s=!1);var e=!s&&"object"==typeof self;!r.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=i:e&&(r=self);var n=!r.JS_SHA512_NO_COMMON_JS&&h.exports,o=!r.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],f=[24,16,8,0],c=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=["hex","array","digest","arrayBuffer"],y=[];!r.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(h){return"[object Array]"===Object.prototype.toString.call(h)}),!o||!r.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(h){return"object"==typeof h&&h.buffer&&h.buffer.constructor===ArrayBuffer});var p=function(h,t){return function(i){return new _(t,!0).update(i)[h]()}},d=function(h){var t=p("hex",h);t.create=function(){return new _(h)},t.update=function(h){return t.create().update(h)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=p(s,h)}return t},b=function(h,t){return function(i,s){return new w(i,t,!0).update(s)[h]()}},v=function(h){var t=b("hex",h);t.create=function(t){return new w(t,h)},t.update=function(h,i){return t.create(h).update(i)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=b(s,h)}return t};function _(h,t){t?(y[0]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=y[16]=y[17]=y[18]=y[19]=y[20]=y[21]=y[22]=y[23]=y[24]=y[25]=y[26]=y[27]=y[28]=y[29]=y[30]=y[31]=y[32]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==h?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==h?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==h?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=h,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function w(h,i,s){var r,e=typeof h;if("string"!==e){if("object"!==e)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);r=!0}var n=h.length;if(!r){for(var a,l=[],f=(n=h.length,0),c=0;c<n;++c)(a=h.charCodeAt(c))<128?l[f++]=a:a<2048?(l[f++]=192|a>>6,l[f++]=128|63&a):a<55296||a>=57344?(l[f++]=224|a>>12,l[f++]=128|a>>6&63,l[f++]=128|63&a):(a=65536+((1023&a)<<10|1023&h.charCodeAt(++c)),l[f++]=240|a>>18,l[f++]=128|a>>12&63,l[f++]=128|a>>6&63,l[f++]=128|63&a);h=l}h.length>128&&(h=new _(i,!0).update(h).array());var u=[],y=[];for(c=0;c<128;++c){var p=h[c]||0;u[c]=92^p,y[c]=54^p}_.call(this,i,s),this.update(y),this.oKeyPad=u,this.inner=!0,this.sharedMemory=s}_.prototype.update=function(h){if(this.finalized)throw new Error("finalize already called");var i,s=typeof h;if("string"!==s){if("object"!==s)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);i=!0}for(var r,e,n=0,a=h.length,l=this.blocks;n<a;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=l[16]=l[17]=l[18]=l[19]=l[20]=l[21]=l[22]=l[23]=l[24]=l[25]=l[26]=l[27]=l[28]=l[29]=l[30]=l[31]=l[32]=0),i)for(e=this.start;n<a&&e<128;++n)l[e>>2]|=h[n]<<f[3&e++];else for(e=this.start;n<a&&e<128;++n)(r=h.charCodeAt(n))<128?l[e>>2]|=r<<f[3&e++]:r<2048?(l[e>>2]|=(192|r>>6)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):r<55296||r>=57344?(l[e>>2]|=(224|r>>12)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):(r=65536+((1023&r)<<10|1023&h.charCodeAt(++n)),l[e>>2]|=(240|r>>18)<<f[3&e++],l[e>>2]|=(128|r>>12&63)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,e>=128?(this.block=l[32],this.start=e-128,this.hash(),this.hashed=!0):this.start=e}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,t=this.lastByteIndex;h[32]=this.block,h[t>>2]|=l[3&t],this.block=h[32],t>=112&&(this.hashed||this.hash(),h[0]=this.block,h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=h[16]=h[17]=h[18]=h[19]=h[20]=h[21]=h[22]=h[23]=h[24]=h[25]=h[26]=h[27]=h[28]=h[29]=h[30]=h[31]=h[32]=0),h[30]=this.hBytes<<3|this.bytes>>>29,h[31]=this.bytes<<3,this.hash()}},_.prototype.hash=function(){var h,t,i,s,r,e,n,o,a,l,f,u,y,p,d,b,v,_,w,A,g,S,B,U,O,k=this.h0h,x=this.h0l,z=this.h1h,j=this.h1l,E=this.h2h,N=this.h2l,m=this.h3h,J=this.h3l,P=this.h4h,H=this.h4l,I=this.h5h,R=this.h5l,V=this.h6h,C=this.h6l,D=this.h7h,K=this.h7l,M=this.blocks;for(h=32;h<160;h+=2)t=((A=M[h-30])>>>1|(g=M[h-29])<<31)^(A>>>8|g<<24)^A>>>7,i=(g>>>1|A<<31)^(g>>>8|A<<24)^(g>>>7|A<<25),s=((A=M[h-4])>>>19|(g=M[h-3])<<13)^(g>>>29|A<<3)^A>>>6,r=(g>>>19|A<<13)^(A>>>29|g<<3)^(g>>>6|A<<26),A=M[h-32],g=M[h-31],a=((S=M[h-14])>>>16)+(A>>>16)+(t>>>16)+(s>>>16)+((o=(65535&S)+(65535&A)+(65535&t)+(65535&s)+((n=((B=M[h-13])>>>16)+(g>>>16)+(i>>>16)+(r>>>16)+((e=(65535&B)+(65535&g)+(65535&i)+(65535&r))>>>16))>>>16))>>>16),M[h]=a<<16|65535&o,M[h+1]=n<<16|65535&e;var F=k,T=x,W=z,Y=j,q=E,G=N,L=m,Q=J,X=P,Z=H,$=I,hh=R,th=V,ih=C,sh=D,rh=K;for(b=W&q,v=Y&G,h=0;h<160;h+=8)t=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25),i=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25),s=(X>>>14|Z<<18)^(X>>>18|Z<<14)^(Z>>>9|X<<23),r=(Z>>>14|X<<18)^(Z>>>18|X<<14)^(X>>>9|Z<<23),_=(l=F&W)^F&q^b,w=(f=T&Y)^T&G^v,U=X&$^~X&th,O=Z&hh^~Z&ih,A=M[h],g=M[h+1],A=(a=((S=c[h])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(sh>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&sh)+((n=((B=c[h+1])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(rh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&rh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,sh=(a=(L>>>16)+(A>>>16)+((o=(65535&L)+(65535&A)+((n=(Q>>>16)+(g>>>16)+((e=(65535&Q)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,rh=n<<16|65535&e,t=((L=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Q=n<<16|65535&e)<<4)^(Q>>>2|L<<30)^(Q>>>7|L<<25),i=(Q>>>28|L<<4)^(L>>>2|Q<<30)^(L>>>7|Q<<25),s=(sh>>>14|rh<<18)^(sh>>>18|rh<<14)^(rh>>>9|sh<<23),r=(rh>>>14|sh<<18)^(rh>>>18|sh<<14)^(sh>>>9|rh<<23),_=(u=L&F)^L&W^l,w=(y=Q&T)^Q&Y^f,U=sh&X^~sh&$,O=rh&Z^~rh&hh,A=M[h+2],g=M[h+3],A=(a=((S=c[h+2])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(th>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&th)+((n=((B=c[h+3])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(ih>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&ih))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,th=(a=(q>>>16)+(A>>>16)+((o=(65535&q)+(65535&A)+((n=(G>>>16)+(g>>>16)+((e=(65535&G)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,ih=n<<16|65535&e,t=((q=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(G=n<<16|65535&e)<<4)^(G>>>2|q<<30)^(G>>>7|q<<25),i=(G>>>28|q<<4)^(q>>>2|G<<30)^(q>>>7|G<<25),s=(th>>>14|ih<<18)^(th>>>18|ih<<14)^(ih>>>9|th<<23),r=(ih>>>14|th<<18)^(ih>>>18|th<<14)^(th>>>9|ih<<23),_=(p=q&L)^q&F^u,w=(d=G&Q)^G&T^y,U=th&sh^~th&X,O=ih&rh^~ih&Z,A=M[h+4],g=M[h+5],A=(a=((S=c[h+4])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+($>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&$)+((n=((B=c[h+5])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(hh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&hh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,$=(a=(W>>>16)+(A>>>16)+((o=(65535&W)+(65535&A)+((n=(Y>>>16)+(g>>>16)+((e=(65535&Y)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,hh=n<<16|65535&e,t=((W=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Y=n<<16|65535&e)<<4)^(Y>>>2|W<<30)^(Y>>>7|W<<25),i=(Y>>>28|W<<4)^(W>>>2|Y<<30)^(W>>>7|Y<<25),s=($>>>14|hh<<18)^($>>>18|hh<<14)^(hh>>>9|$<<23),r=(hh>>>14|$<<18)^(hh>>>18|$<<14)^($>>>9|hh<<23),_=(b=W&q)^W&L^p,w=(v=Y&G)^Y&Q^d,U=$&th^~$&sh,O=hh&ih^~hh&rh,A=M[h+6],g=M[h+7],A=(a=((S=c[h+6])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(X>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&X)+((n=((B=c[h+7])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(Z>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,X=(a=(F>>>16)+(A>>>16)+((o=(65535&F)+(65535&A)+((n=(T>>>16)+(g>>>16)+((e=(65535&T)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,Z=n<<16|65535&e,F=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,T=n<<16|65535&e;a=(k>>>16)+(F>>>16)+((o=(65535&k)+(65535&F)+((n=(x>>>16)+(T>>>16)+((e=(65535&x)+(65535&T))>>>16))>>>16))>>>16),this.h0h=a<<16|65535&o,this.h0l=n<<16|65535&e,a=(z>>>16)+(W>>>16)+((o=(65535&z)+(65535&W)+((n=(j>>>16)+(Y>>>16)+((e=(65535&j)+(65535&Y))>>>16))>>>16))>>>16),this.h1h=a<<16|65535&o,this.h1l=n<<16|65535&e,a=(E>>>16)+(q>>>16)+((o=(65535&E)+(65535&q)+((n=(N>>>16)+(G>>>16)+((e=(65535&N)+(65535&G))>>>16))>>>16))>>>16),this.h2h=a<<16|65535&o,this.h2l=n<<16|65535&e,a=(m>>>16)+(L>>>16)+((o=(65535&m)+(65535&L)+((n=(J>>>16)+(Q>>>16)+((e=(65535&J)+(65535&Q))>>>16))>>>16))>>>16),this.h3h=a<<16|65535&o,this.h3l=n<<16|65535&e,a=(P>>>16)+(X>>>16)+((o=(65535&P)+(65535&X)+((n=(H>>>16)+(Z>>>16)+((e=(65535&H)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=a<<16|65535&o,this.h4l=n<<16|65535&e,a=(I>>>16)+($>>>16)+((o=(65535&I)+(65535&$)+((n=(R>>>16)+(hh>>>16)+((e=(65535&R)+(65535&hh))>>>16))>>>16))>>>16),this.h5h=a<<16|65535&o,this.h5l=n<<16|65535&e,a=(V>>>16)+(th>>>16)+((o=(65535&V)+(65535&th)+((n=(C>>>16)+(ih>>>16)+((e=(65535&C)+(65535&ih))>>>16))>>>16))>>>16),this.h6h=a<<16|65535&o,this.h6l=n<<16|65535&e,a=(D>>>16)+(sh>>>16)+((o=(65535&D)+(65535&sh)+((n=(K>>>16)+(rh>>>16)+((e=(65535&K)+(65535&rh))>>>16))>>>16))>>>16),this.h7h=a<<16|65535&o,this.h7l=n<<16|65535&e},_.prototype.hex=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,l=this.h4h,f=this.h4l,c=this.h5h,u=this.h5l,y=this.h6h,p=this.h6l,d=this.h7h,b=this.h7l,v=this.bits,_=a[h>>28&15]+a[h>>24&15]+a[h>>20&15]+a[h>>16&15]+a[h>>12&15]+a[h>>8&15]+a[h>>4&15]+a[15&h]+a[t>>28&15]+a[t>>24&15]+a[t>>20&15]+a[t>>16&15]+a[t>>12&15]+a[t>>8&15]+a[t>>4&15]+a[15&t]+a[i>>28&15]+a[i>>24&15]+a[i>>20&15]+a[i>>16&15]+a[i>>12&15]+a[i>>8&15]+a[i>>4&15]+a[15&i]+a[s>>28&15]+a[s>>24&15]+a[s>>20&15]+a[s>>16&15]+a[s>>12&15]+a[s>>8&15]+a[s>>4&15]+a[15&s]+a[r>>28&15]+a[r>>24&15]+a[r>>20&15]+a[r>>16&15]+a[r>>12&15]+a[r>>8&15]+a[r>>4&15]+a[15&r]+a[e>>28&15]+a[e>>24&15]+a[e>>20&15]+a[e>>16&15]+a[e>>12&15]+a[e>>8&15]+a[e>>4&15]+a[15&e]+a[n>>28&15]+a[n>>24&15]+a[n>>20&15]+a[n>>16&15]+a[n>>12&15]+a[n>>8&15]+a[n>>4&15]+a[15&n];return v>=256&&(_+=a[o>>28&15]+a[o>>24&15]+a[o>>20&15]+a[o>>16&15]+a[o>>12&15]+a[o>>8&15]+a[o>>4&15]+a[15&o]),v>=384&&(_+=a[l>>28&15]+a[l>>24&15]+a[l>>20&15]+a[l>>16&15]+a[l>>12&15]+a[l>>8&15]+a[l>>4&15]+a[15&l]+a[f>>28&15]+a[f>>24&15]+a[f>>20&15]+a[f>>16&15]+a[f>>12&15]+a[f>>8&15]+a[f>>4&15]+a[15&f]+a[c>>28&15]+a[c>>24&15]+a[c>>20&15]+a[c>>16&15]+a[c>>12&15]+a[c>>8&15]+a[c>>4&15]+a[15&c]+a[u>>28&15]+a[u>>24&15]+a[u>>20&15]+a[u>>16&15]+a[u>>12&15]+a[u>>8&15]+a[u>>4&15]+a[15&u]),512==v&&(_+=a[y>>28&15]+a[y>>24&15]+a[y>>20&15]+a[y>>16&15]+a[y>>12&15]+a[y>>8&15]+a[y>>4&15]+a[15&y]+a[p>>28&15]+a[p>>24&15]+a[p>>20&15]+a[p>>16&15]+a[p>>12&15]+a[p>>8&15]+a[p>>4&15]+a[15&p]+a[d>>28&15]+a[d>>24&15]+a[d>>20&15]+a[d>>16&15]+a[d>>12&15]+a[d>>8&15]+a[d>>4&15]+a[15&d]+a[b>>28&15]+a[b>>24&15]+a[b>>20&15]+a[b>>16&15]+a[b>>12&15]+a[b>>8&15]+a[b>>4&15]+a[15&b]),_},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,a=this.h4h,l=this.h4l,f=this.h5h,c=this.h5l,u=this.h6h,y=this.h6l,p=this.h7h,d=this.h7l,b=this.bits,v=[h>>24&255,h>>16&255,h>>8&255,255&h,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n];return b>=256&&v.push(o>>24&255,o>>16&255,o>>8&255,255&o),b>=384&&v.push(a>>24&255,a>>16&255,a>>8&255,255&a,l>>24&255,l>>16&255,l>>8&255,255&l,f>>24&255,f>>16&255,f>>8&255,255&f,c>>24&255,c>>16&255,c>>8&255,255&c),512==b&&v.push(u>>24&255,u>>16&255,u>>8&255,255&u,y>>24&255,y>>16&255,y>>8&255,255&y,p>>24&255,p>>16&255,p>>8&255,255&p,d>>24&255,d>>16&255,d>>8&255,255&d),v},_.prototype.array=_.prototype.digest,_.prototype.arrayBuffer=function(){this.finalize();var h=this.bits,t=new ArrayBuffer(h/8),i=new DataView(t);return i.setUint32(0,this.h0h),i.setUint32(4,this.h0l),i.setUint32(8,this.h1h),i.setUint32(12,this.h1l),i.setUint32(16,this.h2h),i.setUint32(20,this.h2l),i.setUint32(24,this.h3h),h>=256&&i.setUint32(28,this.h3l),h>=384&&(i.setUint32(32,this.h4h),i.setUint32(36,this.h4l),i.setUint32(40,this.h5h),i.setUint32(44,this.h5l)),512==h&&(i.setUint32(48,this.h6h),i.setUint32(52,this.h6l),i.setUint32(56,this.h7h),i.setUint32(60,this.h7l)),t},_.prototype.clone=function(){var h=new _(this.bits,!1);return this.copyTo(h),h},_.prototype.copyTo=function(h){var t=0,i=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<i.length;++t)h[i[t]]=this[i[t]];for(t=0;t<this.blocks.length;++t)h.blocks[t]=this.blocks[t]},w.prototype=new _,w.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();_.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(h),_.prototype.finalize.call(this)}},w.prototype.clone=function(){var h=new w([],this.bits,!1);this.copyTo(h),h.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)h.oKeyPad[t]=this.oKeyPad[t];return h};var A=d(512);A.sha512=A,A.sha384=d(384),A.sha512_256=d(256),A.sha512_224=d(224),A.sha512.hmac=v(512),A.sha384.hmac=v(384),A.sha512_256.hmac=v(256),A.sha512_224.hmac=v(224),n?h.exports=A:(r.sha512=A.sha512,r.sha384=A.sha384,r.sha512_256=A.sha512_256,r.sha512_224=A.sha512_224)}()}(e)),e.exports);
2
2
  /*
3
3
  * [js-sha512]{@link https://github.com/emn178/js-sha512}
4
4
  *
@@ -22,6 +22,6 @@
22
22
  document.getElementById('root').innerHTML = 'Loading...'
23
23
  </script>
24
24
  <script crossorigin id="vite-legacy-polyfill" src="/assets/polyfills-legacy-Ca1TOBqp.js"></script>
25
- <script crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-B70uZPX1.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
25
+ <script crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-C2rsNh47.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
26
26
  </body>
27
27
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfs",
3
- "version": "0.56.0-alpha2",
3
+ "version": "0.56.0-alpha3",
4
4
  "description": "HTTP File Server",
5
5
  "keywords": ["file server", "http server"],
6
6
  "homepage": "https://rejetto.com/hfs",
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // This file is part of HFS - Copyright 2021-2023, Massimo Melina <a@rejetto.com> - License https://www.gnu.org/licenses/gpl-3.0.txt
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.get_file_list = void 0;
4
+ exports.get_file_list = exports.paramsToFilter = void 0;
5
5
  const vfs_1 = require("./vfs");
6
6
  const apiMiddleware_1 = require("./apiMiddleware");
7
7
  const promises_1 = require("fs/promises");
@@ -14,15 +14,22 @@ const connections_1 = require("./connections");
14
14
  const adminApis_1 = require("./adminApis");
15
15
  const upload_1 = require("./upload");
16
16
  const SendList_1 = require("./SendList");
17
- const get_file_list = async ({ uri = '/', offset, limit, search, wild, c, onlyFolders, onlyFiles, admin }, ctx) => {
17
+ function paramsToFilter({ search, wild, searchComment }) {
18
+ search = String(search || '').toLocaleLowerCase();
19
+ searchComment = String(searchComment || '').toLocaleLowerCase();
20
+ return {
21
+ filterName: search > '' && (wild === 'no' ? (s) => s.includes(search) : (0, misc_1.pattern2filter)(search)),
22
+ filterComment: searchComment > '' && (wild === 'no' ? (s) => s.includes(searchComment) : (0, misc_1.pattern2filter)(searchComment))
23
+ };
24
+ }
25
+ exports.paramsToFilter = paramsToFilter;
26
+ const get_file_list = async ({ uri = '/', offset, limit, c, onlyFolders, onlyFiles, admin, ...rest }, ctx) => {
18
27
  var _a;
19
28
  const node = await (0, vfs_1.urlToNode)(uri, ctx);
20
29
  const list = ctx.get('accept') === 'text/event-stream' ? new SendList_1.SendListReadable() : undefined;
21
30
  if (!node)
22
31
  return fail(const_1.HTTP_NOT_FOUND);
23
32
  admin && (admin = (0, adminApis_1.ctxAdminAccess)(ctx)); // validate 'admin' flag
24
- if ((0, misc_1.dirTraversal)(search))
25
- return fail(const_1.HTTP_FOOL);
26
33
  if (await (0, vfs_1.hasDefaultFile)(node, ctx) || !await (0, vfs_1.nodeIsDirectory)(node)) // in case of files without permission, we are provided with the frontend, and the location is the file itself
27
34
  // so, we first check if you have a permission problem, to tell frontend to show login, otherwise we fall back to method_not_allowed, as it's proper for files.
28
35
  return fail(!admin && (0, vfs_1.statusCodeForMissingPerm)(node, 'can_read', ctx) ? undefined : const_1.HTTP_METHOD_NOT_ALLOWED);
@@ -30,10 +37,8 @@ const get_file_list = async ({ uri = '/', offset, limit, search, wild, c, onlyFo
30
37
  return fail();
31
38
  offset = Number(offset);
32
39
  limit = Number(limit);
33
- search = String(search || '').toLocaleLowerCase();
34
- const filter = wild === 'no' ? (s) => s.includes(search)
35
- : (0, misc_1.pattern2filter)(search);
36
- const walker = (0, vfs_1.walkNode)(node, { ctx: admin ? undefined : ctx, onlyFolders, onlyFiles, depth: search ? Infinity : 0 });
40
+ const { filterName, filterComment } = paramsToFilter(rest);
41
+ const walker = (0, vfs_1.walkNode)(node, { ctx: admin ? undefined : ctx, onlyFolders, onlyFiles, depth: filterName || filterComment ? Infinity : 0 });
37
42
  const onDirEntryHandlers = (0, plugins_1.mapPlugins)(plug => plug.onDirEntry);
38
43
  const can_upload = admin || (0, vfs_1.hasPermission)(node, 'can_upload', ctx);
39
44
  const fakeChild = await (0, vfs_1.applyParentToChild)({ source: 'dummy-file' }, node); // used to check permission; simple but but can produce false results
@@ -64,9 +69,8 @@ const get_file_list = async ({ uri = '/', offset, limit, search, wild, c, onlyFo
64
69
  for await (const sub of walker) {
65
70
  let name = (0, vfs_1.getNodeName)(sub);
66
71
  name = (0, path_1.basename)(name) || name; // on windows, basename('C:') === ''
67
- if (comments_1.descriptIon.get() && name === comments_1.DESCRIPT_ION)
68
- continue;
69
- if (!filter(name))
72
+ if (filterName && !filterName(name)
73
+ || filterComment && !filterComment(await (0, comments_1.getCommentFor)(sub.source) || ''))
70
74
  continue;
71
75
  const entry = await nodeToDirEntry(ctx, sub);
72
76
  if (!entry)
@@ -84,7 +88,7 @@ const get_file_list = async ({ uri = '/', offset, limit, search, wild, c, onlyFo
84
88
  --offset;
85
89
  continue;
86
90
  }
87
- if (!c) { // include c field?
91
+ if (c === 'no') { // allow excluding c for smaller payload
88
92
  if (!entry.m)
89
93
  entry.m = entry.c;
90
94
  if (entry.c)
package/src/api.vfs.js CHANGED
@@ -14,6 +14,7 @@ const const_1 = require("./const");
14
14
  const util_os_1 = require("./util-os");
15
15
  const listen_1 = require("./listen");
16
16
  const SendList_1 = require("./SendList");
17
+ const walkDir_1 = require("./walkDir");
17
18
  // to manipulate the tree we need the original node
18
19
  async function urlToNodeOriginal(uri) {
19
20
  const n = await (0, vfs_1.urlToNode)(uri);
@@ -186,14 +187,14 @@ const apis = {
186
187
  try {
187
188
  const matching = (0, misc_1.makeMatcher)(fileMask);
188
189
  path = (0, misc_1.isWindowsDrive)(path) ? path + '\\' : (0, path_1.resolve)(path || '/');
189
- for await (const entry of (0, misc_1.dirStream)(path)) {
190
+ await (0, walkDir_1.walkDir)(path, {}, async (entry) => {
190
191
  if (ctx.isAborted())
191
- return;
192
+ return null;
192
193
  const { path: name } = entry;
193
194
  const isDir = entry.isDirectory();
194
195
  if (!isDir)
195
196
  if (!files || fileMask && !matching(name))
196
- continue;
197
+ return;
197
198
  try {
198
199
  const stats = entry.stats || await (0, promises_1.stat)((0, path_1.join)(path, name));
199
200
  list.add({
@@ -205,7 +206,7 @@ const apis = {
205
206
  });
206
207
  }
207
208
  catch (_a) { } // just ignore entries we can't stat
208
- }
209
+ });
209
210
  await sendPropsAsap.catch(() => { });
210
211
  list.close();
211
212
  }
package/src/config.js CHANGED
@@ -198,10 +198,6 @@ const saveDebounced = (0, debounceAsync_1.debounceAsync)(async () => {
198
198
  const aWeekAgo = Date.now() - cross_1.DAY * 7;
199
199
  if (await (0, promises_1.stat)(bak).then(x => aWeekAgo > (x.mtimeMs || x.birthtimeMs), () => true))
200
200
  await (0, promises_1.copyFile)(filePath, bak).catch(() => { }); // ignore errors
201
- if (lodash_1.default.isEmpty(state)) {
202
- console.error('saving empty config');
203
- debugger;
204
- }
205
201
  await exports.configFile.save(stringify({ ...state, version: const_1.VERSION }))
206
202
  .catch(err => console.error('Failed at saving config file, please ensure it is writable.', String(err)));
207
203
  });
package/src/const.js CHANGED
@@ -39,7 +39,7 @@ const path_1 = require("path");
39
39
  const cross_1 = require("./cross");
40
40
  const argv_1 = require("./argv");
41
41
  __exportStar(require("./cross-const"), exports);
42
- exports.API_VERSION = 11;
42
+ exports.API_VERSION = 11.1;
43
43
  exports.COMPATIBLE_API_VERSION = 1; // while changes in the api are not breaking, this number stays the same, otherwise it is made equal to API_VERSION
44
44
  // you can add arguments with this file, currently used for the update process on mac/linux
45
45
  exports.ARGS_FILE = (0, path_1.join)((0, os_1.homedir)(), 'hfs-args');
@@ -54,7 +54,7 @@ exports.DEV = process.env.DEV || argv_1.argv.dev ? 'DEV' : '';
54
54
  exports.ORIGINAL_CWD = process.cwd();
55
55
  exports.HFS_STARTED = new Date();
56
56
  const PKG_PATH = (0, path_1.join)(__dirname, '..', 'package.json');
57
- exports.BUILD_TIMESTAMP = "2025-01-17T22:18:21.909Z";
57
+ exports.BUILD_TIMESTAMP = "2025-01-20T18:43:15.084Z";
58
58
  const pkg = JSON.parse(fs.readFileSync(PKG_PATH, 'utf8'));
59
59
  exports.VERSION = pkg.version;
60
60
  exports.RUNNING_BETA = exports.VERSION.includes('-');
package/src/cross.js CHANGED
@@ -44,7 +44,7 @@ exports.FRONTEND_OPTIONS = {
44
44
  auto_play_seconds: 5,
45
45
  disableTranslation: false,
46
46
  };
47
- exports.SORT_BY_OPTIONS = ['name', 'extension', 'size', 'time'];
47
+ exports.SORT_BY_OPTIONS = ['name', 'extension', 'size', 'time', 'creation'];
48
48
  exports.THEME_OPTIONS = { auto: '', light: 'light', dark: 'dark' };
49
49
  exports.CFG = constMap(['geo_enable', 'geo_allow', 'geo_list', 'geo_allow_unknown', 'dynamic_dns_url',
50
50
  'log', 'error_log', 'log_rotation', 'dont_log_net', 'log_gui', 'log_api', 'log_ua', 'log_spam', 'track_ips',
@@ -534,16 +534,3 @@ const BROWSERS = {
534
534
  Xbox: /xbox/i,
535
535
  UC: /UCBrowser/i,
536
536
  };
537
- Object.defineProperties(Object.prototype, {
538
- _L: {
539
- enumerable: false,
540
- writable: true,
541
- value(pause = false) {
542
- const val = this instanceof Number || this instanceof String || this instanceof Boolean ? this.valueOf() : this;
543
- if (pause)
544
- debugger;
545
- console.log('**', val);
546
- return val;
547
- }
548
- }
549
- });
@@ -208,7 +208,7 @@ exports.frontEndApis = {
208
208
  files++;
209
209
  partialFolderSize[id] = { bytes, files };
210
210
  }
211
- return (0, misc_1.popKey)(partialFolderSize, id);
211
+ return (0, misc_1.popKey)(partialFolderSize, id) || { bytes, files };
212
212
  },
213
213
  };
214
214
  function notifyClient(channel, name, data) {
@@ -158,6 +158,8 @@
158
158
  "allow_session_ip_change": "Permetti cambio IP in questa sessione",
159
159
  "focus_hint": "Scrivendo sulla tastiera cerchi tra gli elementi della lista.",
160
160
  "copy_links": "Copia i link",
161
- "Calculate": "Calcola"
161
+ "Calculate": "Calcola",
162
+ "Creation": "Creazione",
163
+ "creation": "creazione"
162
164
  }
163
165
  }
package/src/misc.js CHANGED
@@ -40,7 +40,7 @@ const lodash_1 = __importDefault(require("lodash"));
40
40
  function pattern2filter(pattern) {
41
41
  const matcher = (0, cross_1.makeMatcher)(pattern.includes('*') ? pattern // if you specify *, we'll respect its position
42
42
  : pattern.split('|').map(x => `*${x}*`).join('|'));
43
- return (s) => !s || !pattern || matcher((0, path_1.basename)(s));
43
+ return (s) => !pattern || matcher((0, path_1.basename)(s || ''));
44
44
  }
45
45
  exports.pattern2filter = pattern2filter;
46
46
  function isLocalHost(c) {
package/src/util-files.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.parseFile = exports.parseFileCache = exports.exists = exports.isValidFileName = exports.createFileWithPath = exports.prepareFolder = exports.unzip = exports.dirStream = exports.adjustStaticPathForGlob = exports.dirTraversal = exports.watchDir = exports.readFileBusy = exports.isDirectory = void 0;
7
+ exports.parseFile = exports.parseFileCache = exports.exists = exports.isValidFileName = exports.createFileWithPath = exports.prepareFolder = exports.unzip = exports.adjustStaticPathForGlob = exports.dirTraversal = exports.watchDir = exports.readFileBusy = exports.isDirectory = void 0;
8
8
  const promises_1 = require("fs/promises");
9
9
  const misc_1 = require("./misc");
10
10
  const fs_1 = require("fs");
@@ -12,7 +12,6 @@ const path_1 = require("path");
12
12
  const fast_glob_1 = __importDefault(require("fast-glob"));
13
13
  const const_1 = require("./const");
14
14
  const stream_1 = require("stream");
15
- const dirStream_1 = require("./dirStream");
16
15
  // @ts-ignore
17
16
  const unzip_stream_1 = __importDefault(require("unzip-stream"));
18
17
  async function isDirectory(path) {
@@ -79,17 +78,6 @@ function adjustStaticPathForGlob(path) {
79
78
  return fast_glob_1.default.escapePath(path.replace(/\\/g, '/'));
80
79
  }
81
80
  exports.adjustStaticPathForGlob = adjustStaticPathForGlob;
82
- async function* dirStream(path, { depth = 0, onlyFiles = false, onlyFolders = false, hidden = true } = {}) {
83
- if (!await isDirectory(path))
84
- throw Error('ENOTDIR');
85
- for await (const entry of (0, dirStream_1.createDirStream)(path, { depth, hidden })) {
86
- const dirent = entry;
87
- if (dirent.isDirectory() ? onlyFiles : (onlyFolders || !dirent.isFile()))
88
- continue;
89
- yield dirent;
90
- }
91
- }
92
- exports.dirStream = dirStream;
93
81
  async function unzip(stream, cb) {
94
82
  let pending = Promise.resolve();
95
83
  return new Promise((resolve, reject) => stream.pipe(unzip_stream_1.default.Parse())
package/src/util-os.js CHANGED
@@ -12,9 +12,11 @@ const csv_1 = __importDefault(require("@gregoranders/csv"));
12
12
  const node_process_1 = require("node:process");
13
13
  const util_1 = require("util");
14
14
  const const_1 = require("./const");
15
+ const promises_1 = require("fs/promises");
16
+ const promises_2 = require("node:fs/promises");
15
17
  const DF_TIMEOUT = 2000;
16
18
  function getDiskSpaceSync(path) {
17
- while (path && !(0, fs_1.existsSync)(path))
19
+ while (path && !(0, misc_1.isWindowsDrive)(path) && !(0, fs_1.existsSync)(path))
18
20
  path = (0, path_1.dirname)(path);
19
21
  const res = (0, fs_1.statfsSync)(path);
20
22
  return { free: res.bavail * res.bsize, total: res.blocks * res.bsize, name: path };
@@ -29,9 +31,9 @@ function cmdEscape(par) {
29
31
  }
30
32
  exports.cmdEscape = cmdEscape;
31
33
  async function getDiskSpace(path) {
32
- while (path && !(0, misc_1.isWindowsDrive)(path) && !(0, fs_1.existsSync)(path))
34
+ while (path && !(0, misc_1.isWindowsDrive)(path) && !(0, promises_1.access)(path))
33
35
  path = (0, path_1.dirname)(path);
34
- const res = (0, fs_1.statfsSync)(path);
36
+ const res = await (0, promises_2.statfs)(path);
35
37
  return { free: res.bavail * res.bsize, total: res.blocks * res.bsize, name: path };
36
38
  }
37
39
  exports.getDiskSpace = getDiskSpace;
package/src/vfs.js CHANGED
@@ -15,6 +15,9 @@ const events_1 = __importDefault(require("./events"));
15
15
  const perm_1 = require("./perm");
16
16
  const auth_1 = require("./auth");
17
17
  const fswin_1 = __importDefault(require("fswin"));
18
+ const comments_1 = require("./comments");
19
+ const walkDir_1 = require("./walkDir");
20
+ const node_stream_1 = require("node:stream");
18
21
  const showHiddenFiles = (0, config_1.defineConfig)('show_hidden_files', false);
19
22
  function permsFromParent(parent, child) {
20
23
  const ret = {};
@@ -90,7 +93,7 @@ async function urlToNode(url, ctx, parent = exports.vfs, getRest) {
90
93
  try {
91
94
  if (!showHiddenFiles.get() && await isHiddenFile(ret.source))
92
95
  throw 'hiddenFile';
93
- ret.isFolder = (await nodeStats(ret)).isDirectory(); // throws if doesn't exist on disk
96
+ ret.isFolder = (await nodeStats(ret)).isDirectory(); // throws if it doesn't exist on disk
94
97
  }
95
98
  catch (_a) {
96
99
  if (!getRest)
@@ -243,85 +246,115 @@ function statusCodeForMissingPerm(node, perm, ctx, assign = true) {
243
246
  exports.statusCodeForMissingPerm = statusCodeForMissingPerm;
244
247
  // it's responsibility of the caller to verify you have list permission on parent, as callers have different needs.
245
248
  async function* walkNode(parent, { ctx, depth = Infinity, prefixPath = '', requiredPerm, onlyFolders = false, onlyFiles = false, } = {}) {
246
- var _a, _b;
247
- const { children, source } = parent;
248
- const took = prefixPath ? undefined : new Set();
249
- const maskApplier = parentMaskApplier(parent);
250
- const parentsCache = new Map(); // we use this only if depth > 0
251
- if (children)
252
- for (const child of children) {
253
- if (await nodeIsDirectory(child) ? onlyFiles : onlyFolders)
254
- continue;
255
- const nodeName = getNodeName(child);
256
- const name = prefixPath + nodeName;
257
- took === null || took === void 0 ? void 0 : took.add(normalizeFilename(name));
258
- const item = { ...child, name };
259
- if (!await canSee(item))
260
- continue;
261
- if (item.source) // real items must be accessible
249
+ let started = false;
250
+ const stream = new node_stream_1.Readable({
251
+ objectMode: true,
252
+ async read() {
253
+ if (started)
254
+ return; // for simplicity, we care about starting, and never suspend
255
+ started = true;
256
+ const { children, source } = parent;
257
+ const taken = prefixPath ? undefined : new Set();
258
+ const maskApplier = parentMaskApplier(parent);
259
+ const parentsCache = new Map(); // we use this only if depth > 0
260
+ const visitLater = [];
261
+ if (children)
262
+ for (const child of children) {
263
+ const nodeName = getNodeName(child);
264
+ const name = prefixPath + nodeName;
265
+ taken === null || taken === void 0 ? void 0 : taken.add(normalizeFilename(name));
266
+ const item = { ...child, name };
267
+ if (await cantSee(item))
268
+ continue;
269
+ if (item.source) // real items must be accessible
270
+ try {
271
+ await promises_1.default.access(item.source);
272
+ }
273
+ catch (_a) {
274
+ continue;
275
+ }
276
+ const isFolder = await nodeIsDirectory(child);
277
+ if (onlyFiles ? !isFolder : (!onlyFolders || isFolder))
278
+ stream.push(item);
279
+ if (!depth || !isFolder || cantRecur(item))
280
+ continue;
281
+ parentsCache.set(name, item);
282
+ visitLater.push([item, name]); // prioritize siblings
283
+ }
284
+ try {
285
+ if (!source)
286
+ return;
287
+ if (requiredPerm && ctx // no permission, no reason to continue (at least for dynamic elements)
288
+ && !hasPermission(parent, requiredPerm, ctx)
289
+ && !masksCouldGivePermission(parent.masks, requiredPerm))
290
+ return;
262
291
  try {
263
- await promises_1.default.access(item.source);
292
+ let lastDir = prefixPath.slice(0, -1) || '.';
293
+ parentsCache.set(lastDir, parent);
294
+ await (0, walkDir_1.walkDir)(source, { depth, hidden: showHiddenFiles.get() }, async (entry) => {
295
+ var _a, _b;
296
+ if (ctx === null || ctx === void 0 ? void 0 : ctx.isAborted()) {
297
+ stream.push(null);
298
+ return null;
299
+ }
300
+ const { path } = entry;
301
+ const isFolder = entry.isDirectory();
302
+ const name = prefixPath + (((_a = parent.rename) === null || _a === void 0 ? void 0 : _a[path]) || path);
303
+ if (comments_1.descriptIon.get() && (0, path_1.basename)(name) === comments_1.DESCRIPT_ION)
304
+ return;
305
+ if (taken === null || taken === void 0 ? void 0 : taken.has(normalizeFilename(name))) // taken by vfs node above
306
+ return false; // false just in case it's a folder
307
+ if (depth) {
308
+ const dir = (0, path_1.dirname)(name);
309
+ if (dir !== lastDir)
310
+ parent = parentsCache.get(lastDir = dir);
311
+ }
312
+ const item = {
313
+ name,
314
+ isFolder,
315
+ source: (0, path_1.join)(source, path),
316
+ rename: renameUnderPath(parent.rename, path),
317
+ };
318
+ if (await cantSee(item)) // can't see: don't produce and don't recur
319
+ return false;
320
+ if (onlyFiles ? !isFolder : (!onlyFolders || isFolder))
321
+ stream.push(item);
322
+ if (cantRecur(item))
323
+ return false;
324
+ if (isFolder)
325
+ parentsCache.set(name, item);
326
+ (_b = entry.closingBranch) === null || _b === void 0 ? void 0 : _b.then(p => parentsCache.delete(p || '.'));
327
+ });
264
328
  }
265
- catch (_c) {
266
- continue;
329
+ catch (e) {
330
+ console.debug('walkNode', source, e); // ENOTDIR, or lacking permissions
267
331
  }
268
- yield item;
269
- if (!depth || !await nodeIsDirectory(child).catch(() => false))
270
- continue;
271
- parentsCache.set(name, item);
272
- inheritMasks(item, parent, nodeName);
273
- if (!ctx || hasPermission(item, 'can_list', ctx)) // check perm before recursion
274
- yield* walkNode(item, { ctx, depth: depth - 1, prefixPath: name + '/', requiredPerm, onlyFolders });
275
- }
276
- if (!source)
277
- return;
278
- if (requiredPerm && ctx // no permission, no reason to continue (at least for dynamic elements)
279
- && !hasPermission(parent, requiredPerm, ctx)
280
- && !masksCouldGivePermission(parent.masks, requiredPerm))
281
- return;
282
- try {
283
- let lastDir = prefixPath.slice(0, -1) || '.';
284
- parentsCache.set(lastDir, parent);
285
- for await (const entry of (0, misc_1.dirStream)(source, { depth, onlyFolders, hidden: showHiddenFiles.get() })) {
286
- if (ctx === null || ctx === void 0 ? void 0 : ctx.isAborted())
287
- break;
288
- const { path } = entry;
289
- const isFolder = entry.isDirectory();
290
- const name = prefixPath + (((_a = parent.rename) === null || _a === void 0 ? void 0 : _a[path]) || path);
291
- if (took === null || took === void 0 ? void 0 : took.has(normalizeFilename(name)))
292
- continue;
293
- if (depth) {
294
- const dir = (0, path_1.dirname)(name);
295
- if (dir !== lastDir)
296
- parent = parentsCache.get(lastDir = dir);
332
+ parentsCache.clear(); // hoping for faster GC
333
+ }
334
+ finally {
335
+ for (const [item, name] of visitLater)
336
+ for await (const x of walkNode(item, { ctx, depth: depth - 1, prefixPath: name + '/', requiredPerm, onlyFolders }))
337
+ stream.push(x);
338
+ stream.push(null);
339
+ }
340
+ function cantRecur(item) {
341
+ if (ctx && !hasPermission(item, 'can_list', ctx))
342
+ return true;
343
+ inheritMasks(item, parent);
344
+ }
345
+ // item will be changed, so be sure to pass a temp node
346
+ async function cantSee(item) {
347
+ await maskApplier(item);
348
+ inheritFromParent(parent, item);
349
+ if (ctx && !hasPermission(item, 'can_see', ctx))
350
+ return true;
351
+ item.isTemp = true;
297
352
  }
298
- const item = {
299
- name,
300
- isFolder,
301
- source: (0, path_1.join)(source, path),
302
- rename: renameUnderPath(parent.rename, path),
303
- };
304
- if (isFolder) // store it even if we can't see it (masks), as its children can be produced by dirStream
305
- parentsCache.set(name, item);
306
- if (!(onlyFiles && isFolder) && await canSee(item))
307
- yield item;
308
- (_b = entry.closingBranch) === null || _b === void 0 ? void 0 : _b.then(p => parentsCache.delete(p || '.'));
309
353
  }
310
- }
311
- catch (e) {
312
- console.debug('walkNode', source, e); // ENOTDIR, or lacking permissions
313
- }
314
- parentsCache.clear(); // hoping for faster GC
315
- // item will be changed, so be sure to pass a temp node
316
- async function canSee(item) {
317
- // we basename for depth>0 where we already have the rest of the path in the parent's url, and would be duplicated
318
- await maskApplier(item, (0, path_1.basename)(getNodeName(item)));
319
- inheritFromParent(parent, item);
320
- if (ctx && !hasPermission(item, 'can_see', ctx))
321
- return;
322
- item.isTemp = true;
323
- return item;
324
- }
354
+ });
355
+ // must use a stream to be able to work with the callback-based mechanism of walkDir, but Readable is not typed so we wrap it with a generator
356
+ for await (const item of stream)
357
+ yield item;
325
358
  }
326
359
  exports.walkNode = walkNode;
327
360
  function masksCouldGivePermission(masks, perm) {
@@ -345,7 +378,7 @@ function parentMaskApplier(parent) {
345
378
  k = k.startsWith('**/') ? k.slice(3) : !k.includes('/') ? k : ''; // ** globstar matches also zero subfolders, so this mask must be applied here too
346
379
  return k && { mods, matcher: (0, misc_1.makeMatcher)(k), mustBeFolder };
347
380
  }));
348
- return async (item, virtualBasename = getNodeName(item)) => {
381
+ return async (item, virtualBasename = (0, path_1.basename)(getNodeName(item))) => {
349
382
  let isFolder = undefined;
350
383
  for (const { matcher, mods, mustBeFolder } of matchers) {
351
384
  if (mustBeFolder !== undefined) {
@@ -361,7 +394,7 @@ function parentMaskApplier(parent) {
361
394
  };
362
395
  }
363
396
  exports.parentMaskApplier = parentMaskApplier;
364
- function inheritMasks(item, parent, virtualBasename) {
397
+ function inheritMasks(item, parent, virtualBasename = getNodeName(item)) {
365
398
  const { masks } = parent;
366
399
  if (!masks)
367
400
  return;