mirror of
https://github.com/meshcore-dev/flasher.meshcore.dev.git
synced 2026-04-20 22:13:50 +00:00
3 lines
174 KiB
JavaScript
3 lines
174 KiB
JavaScript
|
|
class A extends Error{}
|
||
|
|
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function t(A){let t=A.length;for(;--t>=0;)A[t]=0}const e=256,i=286,s=30,a=15,E=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=new Array(576);t(g);const o=new Array(60);t(o);const B=new Array(512);t(B);const w=new Array(256);t(w);const c=new Array(29);t(c);const C=new Array(s);function _(A,t,e,i,s){this.static_tree=A,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=s,this.has_stree=A&&A.length}let I,l,d;function D(A,t){this.dyn_tree=A,this.max_code=0,this.stat_desc=t}t(C);const S=A=>A<256?B[A]:B[256+(A>>>7)],R=(A,t)=>{A.pending_buf[A.pending++]=255&t,A.pending_buf[A.pending++]=t>>>8&255},M=(A,t,e)=>{A.bi_valid>16-e?(A.bi_buf|=t<<A.bi_valid&65535,R(A,A.bi_buf),A.bi_buf=t>>16-A.bi_valid,A.bi_valid+=e-16):(A.bi_buf|=t<<A.bi_valid&65535,A.bi_valid+=e)},Q=(A,t,e)=>{M(A,e[2*t],e[2*t+1])},f=(A,t)=>{let e=0;do{e|=1&A,A>>>=1,e<<=1}while(--t>0);return e>>>1},F=(A,t,e)=>{const i=new Array(16);let s,E,n=0;for(s=1;s<=a;s++)n=n+e[s-1]<<1,i[s]=n;for(E=0;E<=t;E++){let t=A[2*E+1];0!==t&&(A[2*E]=f(i[t]++,t))}},T=A=>{let t;for(t=0;t<i;t++)A.dyn_ltree[2*t]=0;for(t=0;t<s;t++)A.dyn_dtree[2*t]=0;for(t=0;t<19;t++)A.bl_tree[2*t]=0;A.dyn_ltree[512]=1,A.opt_len=A.static_len=0,A.sym_next=A.matches=0},u=A=>{A.bi_valid>8?R(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0},P=(A,t,e,i)=>{const s=2*t,a=2*e;return A[s]<A[a]||A[s]===A[a]&&i[t]<=i[e]},U=(A,t,e)=>{const i=A.heap[e];let s=e<<1;for(;s<=A.heap_len&&(s<A.heap_len&&P(t,A.heap[s+1],A.heap[s],A.depth)&&s++,!P(t,i,A.heap[s],A.depth));)A.heap[e]=A.heap[s],e=s,s<<=1;A.heap[e]=i},O=(A,t,i)=>{let s,a,r,h,g=0;if(0!==A.sym_next)do{s=255&A.pending_buf[A.sym_buf+g++],s+=(255&A.pending_buf[A.sym_buf+g++])<<8,a=A.pending_buf[A.sym_buf+g++],0===s?Q(A,a,t):(r=w[a],Q(A,r+e+1,t),h=E[r],0!==h&&(a-=c[r],M(A,a,h)),s--,r=S(s),Q(A,r,i),h=n[r],0!==h&&(s-=C[r],M(A,s,h)))}while(g<A.sym_next);Q(A,256,t)},p=(A,t)=>{const e=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,E=t.stat_desc.elems;let n,r,h,g=-1;for(A.heap_len=0,A.heap_max=573,n=0;n<E;n++)0!==e[2*n]?(A.heap[++A.heap_len]=g=n,A.depth[n]=0):e[2*n+1]=0;for(;A.heap_len<2;)h=A.heap[++A.heap_len]=g<2?++g:0,e[2*h]=1,A.depth[h]=0,A.opt_len--,s&&(A.static_len-=i[2*h+1]);for(t.max_code=g,n=A.heap_len>>1;n>=1;n--)U(A,e,n);h=E;do{n=A.heap[1],A.heap[1]=A.heap[A.heap_len--],U(A,e,1),r=A.heap[1],A.heap[--A.heap_max]=n,A.heap[--A.heap_max]=r,e[2*h]=e[2*n]+e[2*r],A.depth[h]=(A.depth[n]>=A.depth[r]?A.depth[n]:A.depth[r])+1,e[2*n+1]=e[2*r+1]=h,A.heap[1]=h++,U(A,e,1)}while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],((A,t)=>{const e=t.dyn_tree,i=t.max_code,s=t.stat_desc.static_tree,E=t.stat_desc.has_stree,n=t.stat_desc.extra_bits,r=t.stat_desc.extra_base,h=t.stat_desc.max_length;let g,o,B,w,c,C,_=0;for(w=0;w<=a;w++)A.bl_count[w]=0;for(e[2*A.heap[A.heap_max]+1]=0,g=A.heap_max+1;g<573;g++)o=A.heap[g],w=e[2*e[2*o+1]+1]+1,w>h&&(w=h,_++),e[2*o+1]=w,o>i||(A.bl_count[w]++,c=0,o>=r&&(c=n[o-r]),C=e[2*o],A.opt_len+=C*(w+c),E&&(A.static_len+=C*(s[2*o+1]+c)));if(0!==_){do{for(w=h-1;0===A.bl_count[w];)w--;A.bl_count[w]--,A.bl_count[w+1]+=2,A.bl_count[h]--,_-=2}while(_>0);for(w=h;0!==w;w--)for(o=A.bl_count[w];0!==o;)B=A.heap[--g],B>i||(e[2*B+1]!==w&&(A.opt_len+=(w-e[2*B+1])*e[2*B],e[2*B+1]=w),o--)}})(A,t),F(e,g,A.bl_count)},y=(A,t,e)=>{let i,s,a=-1,E=t[1],n=0,r=7,h=4;for(0===E&&(r=138,h=3),t[2*(e+1)+1]=65535,i=0;i<=e;i++)s=E,E=t[2*(i+1)+1],++n<r&&s===E||(n<h?A.bl_tree[2*s]+=n:0!==s?(s!==a&&A.bl_tree[2*s]++,A.bl_tree[32]++):n<=10?A.bl_tree[34]++:A.bl_tree[36]++,n=0,a=s,0===E?(r=138,h=3):s===E?(r=6,h=3):(r=7,h=4))},H=(A,t,e)=>{let i,s,a=-1,E=t[1],n=0,r=7,h=4;for(0===E&&(r=138,h=3),i=0;i<=e;i++)if(s=E,E=t[2*(i+1)+1],!(++n<r&&s===E)){if(n<h)do{Q(A,s,A.bl_tree)}while(0!=--n);else 0!==s?(s!==a&&(Q(A,s,A.bl_tree),n--),Q(A,16
|