UNPKG

ry-vue-map

Version:

ry公共组件库

1 lines 10.4 kB
(("undefined"!==typeof self?self:this)["webpackJsonpryui"]=("undefined"!==typeof self?self:this)["webpackJsonpryui"]||[]).push([[2],{2624:function(e,n,t){"use strict";t.r(n),t.d(n,"default",(function(){return w}));var r=t("b3f7");const s=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),o=4017,i=799,a=3406,c=2276,l=1567,f=3784,h=5793,u=2896;function d(e,n){let t=0;const r=[];let s=16;while(s>0&&!e[s-1])--s;r.push({children:[],index:0});let o,i=r[0];for(let a=0;a<s;a++){for(let s=0;s<e[a];s++){i=r.pop(),i.children[i.index]=n[t];while(i.index>0)i=r.pop();i.index++,r.push(i);while(r.length<=a)r.push(o={children:[],index:0}),i.children[i.index]=o.children,i=o;t++}a+1<s&&(r.push(o={children:[],index:0}),i.children[i.index]=o.children,i=o)}return r[0].children}function m(e,n,t,r,o,i,a,c,l){const{mcusPerLine:f,progressive:h}=t,u=n;let d=n,m=0,b=0;function p(){if(b>0)return b--,m>>b&1;if(m=e[d++],255===m){const n=e[d++];if(n)throw new Error("unexpected marker: "+(m<<8|n).toString(16))}return b=7,m>>>7}function w(e){let n,t=e;while(null!==(n=p())){if(t=t[n],"number"===typeof t)return t;if("object"!==typeof t)throw new Error("invalid huffman sequence")}return null}function k(e){let n=e,t=0;while(n>0){const e=p();if(null===e)return;t=t<<1|e,--n}return t}function y(e){const n=k(e);return n>=1<<e-1?n:n+(-1<<e)+1}function g(e,n){const t=w(e.huffmanTableDC),r=0===t?0:y(t);e.pred+=r,n[0]=e.pred;let o=1;while(o<64){const t=w(e.huffmanTableAC),r=15&t,i=t>>4;if(0===r){if(i<15)break;o+=16}else{o+=i;const e=s[o];n[e]=y(r),o++}}}function P(e,n){const t=w(e.huffmanTableDC),r=0===t?0:y(t)<<l;e.pred+=r,n[0]=e.pred}function T(e,n){n[0]|=p()<<l}let A=0;function C(e,n){if(A>0)return void A--;let t=i;const r=a;while(t<=r){const r=w(e.huffmanTableAC),o=15&r,i=r>>4;if(0===o){if(i<15){A=k(i)+(1<<i)-1;break}t+=16}else{t+=i;const e=s[t];n[e]=y(o)*(1<<l),t++}}}let v,x=0;function L(e,n){let t=i;const r=a;let o=0;while(t<=r){const r=s[t],i=n[r]<0?-1:1;switch(x){case 0:{const n=w(e.huffmanTableAC),t=15&n;if(o=n>>4,0===t)o<15?(A=k(o)+(1<<o),x=4):(o=16,x=1);else{if(1!==t)throw new Error("invalid ACn encoding");v=y(t),x=o?2:3}continue}case 1:case 2:n[r]?n[r]+=(p()<<l)*i:(o--,0===o&&(x=2===x?3:0));break;case 3:n[r]?n[r]+=(p()<<l)*i:(n[r]=v<<l,x=0);break;case 4:n[r]&&(n[r]+=(p()<<l)*i);break;default:break}t++}4===x&&(A--,0===A&&(x=0))}function E(e,n,t,r,s){const o=t/f|0,i=t%f,a=o*e.v+r,c=i*e.h+s;n(e,e.blocks[a][c])}function I(e,n,t){const r=t/e.blocksPerLine|0,s=t%e.blocksPerLine;n(e,e.blocks[r][s])}const U=r.length;let D,q,z,O,M,S;S=h?0===i?0===c?P:T:0===c?C:L:g;let j,J,W=0;J=1===U?r[0].blocksPerLine*r[0].blocksPerColumn:f*t.mcusPerColumn;const B=o||J;while(W<J){for(q=0;q<U;q++)r[q].pred=0;if(A=0,1===U)for(D=r[0],M=0;M<B;M++)I(D,S,W),W++;else for(M=0;M<B;M++){for(q=0;q<U;q++){D=r[q];const{h:e,v:n}=D;for(z=0;z<n;z++)for(O=0;O<e;O++)E(D,S,W,z,O)}if(W++,W===J)break}if(b=0,j=e[d]<<8|e[d+1],j<65280)throw new Error("marker was not found");if(!(j>=65488&&j<=65495))break;d+=2}return d-u}function b(e,n){const t=[],{blocksPerLine:r,blocksPerColumn:s}=n,d=r<<3,m=new Int32Array(64),b=new Uint8Array(64);function p(e,t,r){const s=n.quantizationTable;let d,m,b,p,w,k,y,g,P;const T=r;let A;for(A=0;A<64;A++)T[A]=e[A]*s[A];for(A=0;A<8;++A){const e=8*A;0!==T[1+e]||0!==T[2+e]||0!==T[3+e]||0!==T[4+e]||0!==T[5+e]||0!==T[6+e]||0!==T[7+e]?(d=h*T[0+e]+128>>8,m=h*T[4+e]+128>>8,b=T[2+e],p=T[6+e],w=u*(T[1+e]-T[7+e])+128>>8,g=u*(T[1+e]+T[7+e])+128>>8,k=T[3+e]<<4,y=T[5+e]<<4,P=d-m+1>>1,d=d+m+1>>1,m=P,P=b*f+p*l+128>>8,b=b*l-p*f+128>>8,p=P,P=w-y+1>>1,w=w+y+1>>1,y=P,P=g+k+1>>1,k=g-k+1>>1,g=P,P=d-p+1>>1,d=d+p+1>>1,p=P,P=m-b+1>>1,m=m+b+1>>1,b=P,P=w*c+g*a+2048>>12,w=w*a-g*c+2048>>12,g=P,P=k*i+y*o+2048>>12,k=k*o-y*i+2048>>12,y=P,T[0+e]=d+g,T[7+e]=d-g,T[1+e]=m+y,T[6+e]=m-y,T[2+e]=b+k,T[5+e]=b-k,T[3+e]=p+w,T[4+e]=p-w):(P=h*T[0+e]+512>>10,T[0+e]=P,T[1+e]=P,T[2+e]=P,T[3+e]=P,T[4+e]=P,T[5+e]=P,T[6+e]=P,T[7+e]=P)}for(A=0;A<8;++A){const e=A;0!==T[8+e]||0!==T[16+e]||0!==T[24+e]||0!==T[32+e]||0!==T[40+e]||0!==T[48+e]||0!==T[56+e]?(d=h*T[0+e]+2048>>12,m=h*T[32+e]+2048>>12,b=T[16+e],p=T[48+e],w=u*(T[8+e]-T[56+e])+2048>>12,g=u*(T[8+e]+T[56+e])+2048>>12,k=T[24+e],y=T[40+e],P=d-m+1>>1,d=d+m+1>>1,m=P,P=b*f+p*l+2048>>12,b=b*l-p*f+2048>>12,p=P,P=w-y+1>>1,w=w+y+1>>1,y=P,P=g+k+1>>1,k=g-k+1>>1,g=P,P=d-p+1>>1,d=d+p+1>>1,p=P,P=m-b+1>>1,m=m+b+1>>1,b=P,P=w*c+g*a+2048>>12,w=w*a-g*c+2048>>12,g=P,P=k*i+y*o+2048>>12,k=k*o-y*i+2048>>12,y=P,T[0+e]=d+g,T[56+e]=d-g,T[8+e]=m+y,T[48+e]=m-y,T[16+e]=b+k,T[40+e]=b-k,T[24+e]=p+w,T[32+e]=p-w):(P=h*r[A+0]+8192>>14,T[0+e]=P,T[8+e]=P,T[16+e]=P,T[24+e]=P,T[32+e]=P,T[40+e]=P,T[48+e]=P,T[56+e]=P)}for(A=0;A<64;++A){const e=128+(T[A]+8>>4);t[A]=e<0?0:e>255?255:e}}for(let o=0;o<s;o++){const e=o<<3;for(let n=0;n<8;n++)t.push(new Uint8Array(d));for(let s=0;s<r;s++){p(n.blocks[o][s],b,m);let r=0;const i=s<<3;for(let n=0;n<8;n++){const s=t[e+n];for(let e=0;e<8;e++)s[i+e]=b[r++]}}}return t}class p{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let n=0;function t(){const t=e[n]<<8|e[n+1];return n+=2,t}function r(){const r=t(),s=e.subarray(n,n+r-2);return n+=s.length,s}function o(e){let n,t,r=0,s=0;for(t in e.components)e.components.hasOwnProperty(t)&&(n=e.components[t],r<n.h&&(r=n.h),s<n.v&&(s=n.v));const o=Math.ceil(e.samplesPerLine/8/r),i=Math.ceil(e.scanLines/8/s);for(t in e.components)if(e.components.hasOwnProperty(t)){n=e.components[t];const a=Math.ceil(Math.ceil(e.samplesPerLine/8)*n.h/r),c=Math.ceil(Math.ceil(e.scanLines/8)*n.v/s),l=o*n.h,f=i*n.v,h=[];for(let e=0;e<f;e++){const e=[];for(let n=0;n<l;n++)e.push(new Int32Array(64));h.push(e)}n.blocksPerLine=a,n.blocksPerColumn=c,n.blocks=h}e.maxH=r,e.maxV=s,e.mcusPerLine=o,e.mcusPerColumn=i}let i=t();if(65496!==i)throw new Error("SOI not found");i=t();while(65497!==i){switch(i){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const e=r();65504===i&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===i&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const r=t(),o=r+n-2;while(n<o){const r=e[n++],o=new Int32Array(64);if(r>>4===0)for(let t=0;t<64;t++){const r=s[t];o[r]=e[n++]}else{if(r>>4!==1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++){const n=s[e];o[n]=t()}}this.quantizationTables[15&r]=o}break}case 65472:case 65473:case 65474:{t();const r={extended:65473===i,progressive:65474===i,precision:e[n++],scanLines:t(),samplesPerLine:t(),components:{},componentsOrder:[]},s=e[n++];let a;for(let t=0;t<s;t++){a=e[n];const t=e[n+1]>>4,s=15&e[n+1],o=e[n+2];r.componentsOrder.push(a),r.components[a]={h:t,v:s,quantizationIdx:o},n+=3}o(r),this.frames.push(r);break}case 65476:{const r=t();for(let t=2;t<r;){const r=e[n++],s=new Uint8Array(16);let o=0;for(let t=0;t<16;t++,n++)s[t]=e[n],o+=s[t];const i=new Uint8Array(o);for(let t=0;t<o;t++,n++)i[t]=e[n];t+=17+o,r>>4===0?this.huffmanTablesDC[15&r]=d(s,i):this.huffmanTablesAC[15&r]=d(s,i)}break}case 65501:t(),this.resetInterval=t();break;case 65498:{t();const r=e[n++],s=[],o=this.frames[0];for(let t=0;t<r;t++){const t=o.components[e[n++]],r=e[n++];t.huffmanTableDC=this.huffmanTablesDC[r>>4],t.huffmanTableAC=this.huffmanTablesAC[15&r],s.push(t)}const i=e[n++],a=e[n++],c=e[n++],l=m(e,n,o,s,this.resetInterval,i,a,c>>4,15&c);n+=l;break}case 65535:255!==e[n]&&n--;break;default:if(255===e[n-3]&&e[n-2]>=192&&e[n-2]<=254){n-=3;break}throw new Error("unknown JPEG marker "+i.toString(16))}i=t()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let l=0;l<this.frames.length;l++){const e=this.frames[l].components;for(const n of Object.keys(e))e[n].quantizationTable=this.quantizationTables[e[n].quantizationIdx],delete e[n].quantizationIdx}const n=e[0],{components:t,componentsOrder:r}=n,s=[],o=n.samplesPerLine,i=n.scanLines;for(let l=0;l<r.length;l++){const e=t[r[l]];s.push({lines:b(n,e),scaleX:e.h/n.maxH,scaleY:e.v/n.maxV})}const a=new Uint8Array(o*i*s.length);let c=0;for(let l=0;l<i;++l)for(let e=0;e<o;++e)for(let n=0;n<s.length;++n){const t=s[n];a[c]=t.lines[0|l*t.scaleY][0|e*t.scaleX],++c}return a}}class w extends r["a"]{constructor(e){super(),this.reader=new p,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}},b3f7:function(e,n,t){"use strict";function r(e,n){let t=e.length-n,r=0;do{for(let t=n;t>0;t--)e[r+n]+=e[r],r++;t-=n}while(t>0)}function s(e,n,t){let r=0,s=e.length;const o=s/t;while(s>n){for(let t=n;t>0;--t)e[r+n]+=e[r],++r;s-=n}const i=e.slice();for(let a=0;a<o;++a)for(let n=0;n<t;++n)e[t*a+n]=i[(t-n-1)*o+a]}function o(e,n,t,o,i,a){if(!n||1===n)return e;for(let r=0;r<i.length;++r){if(i[r]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[r]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const c=i[0]/8,l=2===a?1:i.length;for(let f=0;f<o;++f){if(f*l*t*c>=e.byteLength)break;let o;if(2===n){switch(i[0]){case 8:o=new Uint8Array(e,f*l*t*c,l*t*c);break;case 16:o=new Uint16Array(e,f*l*t*c,l*t*c/2);break;case 32:o=new Uint32Array(e,f*l*t*c,l*t*c/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}r(o,l,c)}else 3===n&&(o=new Uint8Array(e,f*l*t*c,l*t*c),s(o,l,c))}return e}t.d(n,"a",(function(){return i}));class i{async decode(e,n){const t=await this.decodeBlock(n),r=e.Predictor||1;if(1!==r){const n=!e.StripOffsets,s=n?e.TileWidth:e.ImageWidth,i=n?e.TileLength:e.RowsPerStrip||e.ImageLength;return o(t,r,s,i,e.BitsPerSample,e.PlanarConfiguration)}return t}}}}]);