Newer
Older
osm-data / lib / ol6.14.1-dist / 382.ol.js
"use strict";(self.webpackChunkol=self.webpackChunkol||[]).push([[382],{165:function(r,e,n){function t(r,e){var n=r.length-e,t=0;do{for(var o=e;o>0;o--)r[t+e]+=r[t],t++;n-=e}while(n>0)}function o(r,e,n){for(var t=0,o=r.length,a=o/n;o>e;){for(var i=e;i>0;--i)r[t+e]+=r[t],++t;o-=e}for(var f=r.slice(),c=0;c<a;++c)for(var u=0;u<n;++u)r[n*c+u]=f[(n-u-1)*a+c]}function a(r,e,n,a,i,f){if(!e||1===e)return r;for(var c=0;c<i.length;++c){if(i[c]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[c]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var u=i[0]/8,s=2===f?1:i.length,v=0;v<a&&!(v*s*n*u>=r.byteLength);++v){var l=void 0;if(2===e){switch(i[0]){case 8:l=new Uint8Array(r,v*s*n*u,s*n*u);break;case 16:l=new Uint16Array(r,v*s*n*u,s*n*u/2);break;case 32:l=new Uint32Array(r,v*s*n*u,s*n*u/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}t(l,s)}else 3===e&&o(l=new Uint8Array(r,v*s*n*u,s*n*u),s,u)}return r}function i(r,e,n,t,o,a,i){try{var f=r[a](i),c=f.value}catch(r){return void n(r)}f.done?e(c):Promise.resolve(c).then(t,o)}function f(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,t.key,t)}}n.d(e,{Z:function(){return c}});var c=function(){function r(){!function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r)}var e,n,t,o,c;return e=r,(n=[{key:"decode",value:(o=regeneratorRuntime.mark((function r(e,n){var t,o,i,f,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.decodeBlock(n);case 2:if(t=r.sent,1===(o=e.Predictor||1)){r.next=9;break}return i=!e.StripOffsets,f=i?e.TileWidth:e.ImageWidth,c=i?e.TileLength:e.RowsPerStrip||e.ImageLength,r.abrupt("return",a(t,o,f,c,e.BitsPerSample,e.PlanarConfiguration));case 9:return r.abrupt("return",t);case 10:case"end":return r.stop()}}),r,this)})),c=function(){var r=this,e=arguments;return new Promise((function(n,t){var a=o.apply(r,e);function f(r){i(a,n,t,f,c,"next",r)}function c(r){i(a,n,t,f,c,"throw",r)}f(void 0)}))},function(r,e){return c.apply(this,arguments)})}])&&f(e.prototype,n),t&&f(e,t),Object.defineProperty(e,"prototype",{writable:!1}),r}()},382:function(r,e,n){n.r(e),n.d(e,{default:function(){return g}});var t=n(165);function o(r,e){return(o=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r})(r,e)}function a(r){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}();return function(){var n,t=f(r);if(e){var o=f(this).constructor;n=Reflect.construct(t,arguments,o)}else n=t.apply(this,arguments);return i(this,n)}}function i(r,e){if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}function f(r){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function c(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function u(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,t.key,t)}}function s(r,e,n){return e&&u(r.prototype,e),n&&u(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function v(r){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var l=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]),h=4017,w=799,d=3406,b=2276,y=1567,p=3784,m=5793,k=2896;function E(r,e){for(var n=0,t=[],o=16;o>0&&!r[o-1];)--o;t.push({children:[],index:0});for(var a,i=t[0],f=0;f<o;f++){for(var c=0;c<r[f];c++){for((i=t.pop()).children[i.index]=e[n];i.index>0;)i=t.pop();for(i.index++,t.push(i);t.length<=f;)t.push(a={children:[],index:0}),i.children[i.index]=a.children,i=a;n++}f+1<o&&(t.push(a={children:[],index:0}),i.children[i.index]=a.children,i=a)}return t[0].children}function j(r,e,n,t,o,a,i,f,c){var u=n.mcusPerLine,s=n.progressive,h=e,w=e,d=0,b=0;function y(){if(b>0)return b--,d>>b&1;if(255===(d=r[w++])){var e=r[w++];if(e)throw new Error("unexpected marker: ".concat((d<<8|e).toString(16)))}return b=7,d>>>7}function p(r){for(var e,n=r;null!==(e=y());){if("number"==typeof(n=n[e]))return n;if("object"!==v(n))throw new Error("invalid huffman sequence")}return null}function m(r){for(var e=r,n=0;e>0;){var t=y();if(null===t)return;n=n<<1|t,--e}return n}function k(r){var e=m(r);return e>=1<<r-1?e:e+(-1<<r)+1}var E=0;var j,A=0;function O(r,e,n,t,o){var a=n%u,i=(n/u|0)*r.v+t,f=a*r.h+o;e(r,r.blocks[i][f])}function g(r,e,n){var t=n/r.blocksPerLine|0,o=n%r.blocksPerLine;e(r,r.blocks[t][o])}var U,x,R,S,I,M,P=t.length;M=s?0===a?0===f?function(r,e){var n=p(r.huffmanTableDC),t=0===n?0:k(n)<<c;r.pred+=t,e[0]=r.pred}:function(r,e){e[0]|=y()<<c}:0===f?function(r,e){if(E>0)E--;else for(var n=a,t=i;n<=t;){var o=p(r.huffmanTableAC),f=15&o,u=o>>4;if(0===f){if(u<15){E=m(u)+(1<<u)-1;break}n+=16}else e[l[n+=u]]=k(f)*(1<<c),n++}}:function(r,e){for(var n=a,t=i,o=0;n<=t;){var f=l[n],u=e[f]<0?-1:1;switch(A){case 0:var s=p(r.huffmanTableAC),v=15&s;if(o=s>>4,0===v)o<15?(E=m(o)+(1<<o),A=4):(o=16,A=1);else{if(1!==v)throw new Error("invalid ACn encoding");j=k(v),A=o?2:3}continue;case 1:case 2:e[f]?e[f]+=(y()<<c)*u:0==--o&&(A=2===A?3:0);break;case 3:e[f]?e[f]+=(y()<<c)*u:(e[f]=j<<c,A=0);break;case 4:e[f]&&(e[f]+=(y()<<c)*u)}n++}4===A&&0==--E&&(A=0)}:function(r,e){var n=p(r.huffmanTableDC),t=0===n?0:k(n);r.pred+=t,e[0]=r.pred;for(var o=1;o<64;){var a=p(r.huffmanTableAC),i=15&a,f=a>>4;if(0===i){if(f<15)break;o+=16}else e[l[o+=f]]=k(i),o++}};var D,T,C=0;T=1===P?t[0].blocksPerLine*t[0].blocksPerColumn:u*n.mcusPerColumn;for(var B=o||T;C<T;){for(x=0;x<P;x++)t[x].pred=0;if(E=0,1===P)for(U=t[0],I=0;I<B;I++)g(U,M,C),C++;else for(I=0;I<B;I++){for(x=0;x<P;x++){var W=U=t[x],q=W.h,z=W.v;for(R=0;R<z;R++)for(S=0;S<q;S++)O(U,M,C,R,S)}if(++C===T)break}if(b=0,(D=r[w]<<8|r[w+1])<65280)throw new Error("marker was not found");if(!(D>=65488&&D<=65495))break;w+=2}return w-h}function A(r,e){var n=[],t=e.blocksPerLine,o=e.blocksPerColumn,a=t<<3,i=new Int32Array(64),f=new Uint8Array(64);function c(r,n,t){var o,a,i,f,c,u,s,v,l,E,j=e.quantizationTable,A=t;for(E=0;E<64;E++)A[E]=r[E]*j[E];for(E=0;E<8;++E){var O=8*E;0!==A[1+O]||0!==A[2+O]||0!==A[3+O]||0!==A[4+O]||0!==A[5+O]||0!==A[6+O]||0!==A[7+O]?(o=m*A[0+O]+128>>8,a=m*A[4+O]+128>>8,i=A[2+O],f=A[6+O],c=k*(A[1+O]-A[7+O])+128>>8,v=k*(A[1+O]+A[7+O])+128>>8,u=A[3+O]<<4,s=A[5+O]<<4,l=o-a+1>>1,o=o+a+1>>1,a=l,l=i*p+f*y+128>>8,i=i*y-f*p+128>>8,f=l,l=c-s+1>>1,c=c+s+1>>1,s=l,l=v+u+1>>1,u=v-u+1>>1,v=l,l=o-f+1>>1,o=o+f+1>>1,f=l,l=a-i+1>>1,a=a+i+1>>1,i=l,l=c*b+v*d+2048>>12,c=c*d-v*b+2048>>12,v=l,l=u*w+s*h+2048>>12,u=u*h-s*w+2048>>12,s=l,A[0+O]=o+v,A[7+O]=o-v,A[1+O]=a+s,A[6+O]=a-s,A[2+O]=i+u,A[5+O]=i-u,A[3+O]=f+c,A[4+O]=f-c):(l=m*A[0+O]+512>>10,A[0+O]=l,A[1+O]=l,A[2+O]=l,A[3+O]=l,A[4+O]=l,A[5+O]=l,A[6+O]=l,A[7+O]=l)}for(E=0;E<8;++E){var g=E;0!==A[8+g]||0!==A[16+g]||0!==A[24+g]||0!==A[32+g]||0!==A[40+g]||0!==A[48+g]||0!==A[56+g]?(o=m*A[0+g]+2048>>12,a=m*A[32+g]+2048>>12,i=A[16+g],f=A[48+g],c=k*(A[8+g]-A[56+g])+2048>>12,v=k*(A[8+g]+A[56+g])+2048>>12,u=A[24+g],s=A[40+g],l=o-a+1>>1,o=o+a+1>>1,a=l,l=i*p+f*y+2048>>12,i=i*y-f*p+2048>>12,f=l,l=c-s+1>>1,c=c+s+1>>1,s=l,l=v+u+1>>1,u=v-u+1>>1,v=l,l=o-f+1>>1,o=o+f+1>>1,f=l,l=a-i+1>>1,a=a+i+1>>1,i=l,l=c*b+v*d+2048>>12,c=c*d-v*b+2048>>12,v=l,l=u*w+s*h+2048>>12,u=u*h-s*w+2048>>12,s=l,A[0+g]=o+v,A[56+g]=o-v,A[8+g]=a+s,A[48+g]=a-s,A[16+g]=i+u,A[40+g]=i-u,A[24+g]=f+c,A[32+g]=f-c):(l=m*t[E+0]+8192>>14,A[0+g]=l,A[8+g]=l,A[16+g]=l,A[24+g]=l,A[32+g]=l,A[40+g]=l,A[48+g]=l,A[56+g]=l)}for(E=0;E<64;++E){var U=128+(A[E]+8>>4);n[E]=U<0?0:U>255?255:U}}for(var u=0;u<o;u++){for(var s=u<<3,v=0;v<8;v++)n.push(new Uint8Array(a));for(var l=0;l<t;l++){c(e.blocks[u][l],f,i);for(var E=0,j=l<<3,A=0;A<8;A++)for(var O=n[s+A],g=0;g<8;g++)O[j+g]=f[E++]}}return n}var O=function(){function r(){c(this,r),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return s(r,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(r){var e=0;function n(){var n=r[e]<<8|r[e+1];return e+=2,n}function t(r){var e,n,t=0,o=0;for(n in r.components)r.components.hasOwnProperty(n)&&(t<(e=r.components[n]).h&&(t=e.h),o<e.v&&(o=e.v));var a=Math.ceil(r.samplesPerLine/8/t),i=Math.ceil(r.scanLines/8/o);for(n in r.components)if(r.components.hasOwnProperty(n)){e=r.components[n];for(var f=Math.ceil(Math.ceil(r.samplesPerLine/8)*e.h/t),c=Math.ceil(Math.ceil(r.scanLines/8)*e.v/o),u=a*e.h,s=i*e.v,v=[],l=0;l<s;l++){for(var h=[],w=0;w<u;w++)h.push(new Int32Array(64));v.push(h)}e.blocksPerLine=f,e.blocksPerColumn=c,e.blocks=v}r.maxH=t,r.maxV=o,r.mcusPerLine=a,r.mcusPerColumn=i}var o,a,i=n();if(65496!==i)throw new Error("SOI not found");for(i=n();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:var f=(o=void 0,a=void 0,o=n(),a=r.subarray(e,e+o-2),e+=a.length,a);65504===i&&74===f[0]&&70===f[1]&&73===f[2]&&70===f[3]&&0===f[4]&&(this.jfif={version:{major:f[5],minor:f[6]},densityUnits:f[7],xDensity:f[8]<<8|f[9],yDensity:f[10]<<8|f[11],thumbWidth:f[12],thumbHeight:f[13],thumbData:f.subarray(14,14+3*f[12]*f[13])}),65518===i&&65===f[0]&&100===f[1]&&111===f[2]&&98===f[3]&&101===f[4]&&0===f[5]&&(this.adobe={version:f[6],flags0:f[7]<<8|f[8],flags1:f[9]<<8|f[10],transformCode:f[11]});break;case 65499:for(var c=n()+e-2;e<c;){var u=r[e++],s=new Int32Array(64);if(u>>4==0)for(var v=0;v<64;v++){s[l[v]]=r[e++]}else{if(u>>4!=1)throw new Error("DQT: invalid table spec");for(var h=0;h<64;h++){s[l[h]]=n()}}this.quantizationTables[15&u]=s}break;case 65472:case 65473:case 65474:n();for(var w={extended:65473===i,progressive:65474===i,precision:r[e++],scanLines:n(),samplesPerLine:n(),components:{},componentsOrder:[]},d=r[e++],b=void 0,y=0;y<d;y++){b=r[e];var p=r[e+1]>>4,m=15&r[e+1],k=r[e+2];w.componentsOrder.push(b),w.components[b]={h:p,v:m,quantizationIdx:k},e+=3}t(w),this.frames.push(w);break;case 65476:for(var A=n(),O=2;O<A;){for(var g=r[e++],U=new Uint8Array(16),x=0,R=0;R<16;R++,e++)U[R]=r[e],x+=U[R];for(var S=new Uint8Array(x),I=0;I<x;I++,e++)S[I]=r[e];O+=17+x,g>>4==0?this.huffmanTablesDC[15&g]=E(U,S):this.huffmanTablesAC[15&g]=E(U,S)}break;case 65501:n(),this.resetInterval=n();break;case 65498:n();for(var M=r[e++],P=[],D=this.frames[0],T=0;T<M;T++){var C=D.components[r[e++]],B=r[e++];C.huffmanTableDC=this.huffmanTablesDC[B>>4],C.huffmanTableAC=this.huffmanTablesAC[15&B],P.push(C)}var W=r[e++],q=r[e++],z=r[e++],L=j(r,e,D,P,this.resetInterval,W,q,z>>4,15&z);e+=L;break;case 65535:255!==r[e]&&e--;break;default:if(255===r[e-3]&&r[e-2]>=192&&r[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(i.toString(16)))}i=n()}}},{key:"getResult",value:function(){var r=this.frames;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(var e=0;e<this.frames.length;e++)for(var n=this.frames[e].components,t=0,o=Object.keys(n);t<o.length;t++){var a=o[t];n[a].quantizationTable=this.quantizationTables[n[a].quantizationIdx],delete n[a].quantizationIdx}for(var i=r[0],f=i.components,c=i.componentsOrder,u=[],s=i.samplesPerLine,v=i.scanLines,l=0;l<c.length;l++){var h=f[c[l]];u.push({lines:A(0,h),scaleX:h.h/i.maxH,scaleY:h.v/i.maxV})}for(var w=new Uint8Array(s*v*u.length),d=0,b=0;b<v;++b)for(var y=0;y<s;++y)for(var p=0;p<u.length;++p){var m=u[p];w[d]=m.lines[0|b*m.scaleY][0|y*m.scaleX],++d}return w}}]),r}(),g=function(r){!function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&o(r,e)}(n,r);var e=a(n);function n(r){var t;return c(this,n),(t=e.call(this)).reader=new O,r.JPEGTables&&t.reader.parse(r.JPEGTables),t}return s(n,[{key:"decodeBlock",value:function(r){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(r)),this.reader.getResult().buffer}}]),n}(t.Z)}}]);
//# sourceMappingURL=382.ol.js.map