You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
konova/templates/map/client/libs/geopackage/4.2.3/geopackage.min.js

3 lines
1014 KiB
JavaScript

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

/*! For license information please see geopackage.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(function(){try{return require("better-sqlite3")}catch(t){}}()):"function"==typeof define&&define.amd?define(["better-sqlite3"],e):"object"==typeof exports?exports.GeoPackage=e(function(){try{return require("better-sqlite3")}catch(t){}}()):t.GeoPackage=e(t["better-sqlite3"])}(self,(function(__WEBPACK_EXTERNAL_MODULE__3730__){return(()=>{var __webpack_modules__={8927:(t,e,n)=>{var r,i=n(3085).Buffer,o=n(4155),a=n(5108),s=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,s,u,l;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){s=t,u=e})),(l=e).Ud=l.Ud||[],l.Ud.push((function(){l.MakeSWCanvasSurface=function(t){var e=t;if("CANVAS"!==e.tagName&&!(e=document.getElementById(t)))throw"Canvas with id "+t+" was not found";return(t=l.MakeSurface(e.width,e.height))&&(t.Hd=e),t},l.MakeCanvasSurface||(l.MakeCanvasSurface=l.MakeSWCanvasSurface),l.MakeSurface=function(t,e){var n={width:t,height:e,colorType:l.ColorType.RGBA_8888,alphaType:l.AlphaType.Unpremul,colorSpace:l.ColorSpace.SRGB},r=t*e*4,i=l._malloc(r);return(n=l.Surface._makeRasterDirect(n,i,4*t))&&(n.Hd=null,n.zf=t,n.wf=e,n.yf=r,n.$e=i,n.getCanvas().clear(l.TRANSPARENT)),n},l.MakeRasterDirectSurface=function(t,e,n){return l.Surface._makeRasterDirect(t,e.byteOffset,n)},l.Surface.prototype.flush=function(t){if(this._flush(),this.Hd){var e=new Uint8ClampedArray(l.HEAPU8.buffer,this.$e,this.yf);e=new ImageData(e,this.zf,this.wf),t?this.Hd.getContext("2d").putImageData(e,0,0,t[0],t[1],t[2]-t[0],t[3]-t[1]):this.Hd.getContext("2d").putImageData(e,0,0)}},l.Surface.prototype.dispose=function(){this.$e&&l._free(this.$e),this.delete()},l.currentContext=l.currentContext||function(){},l.setCurrentContext=l.setCurrentContext||function(){}})),function(t){t.Ud=t.Ud||[],t.Ud.push((function(){function e(t,e,n){return t&&t.hasOwnProperty(e)?t[e]:n}t.GetWebGLContext=function(t,n){if(!t)throw"null canvas passed into makeWebGLContext";var r={alpha:e(n,"alpha",1),depth:e(n,"depth",1),stencil:e(n,"stencil",8),antialias:e(n,"antialias",0),premultipliedAlpha:e(n,"premultipliedAlpha",1),preserveDrawingBuffer:e(n,"preserveDrawingBuffer",0),preferLowPowerToHighPerformance:e(n,"preferLowPowerToHighPerformance",0),failIfMajorPerformanceCaveat:e(n,"failIfMajorPerformanceCaveat",0),enableExtensionsByDefault:e(n,"enableExtensionsByDefault",1),explicitSwapControl:e(n,"explicitSwapControl",0),renderViaOffscreenBackBuffer:e(n,"renderViaOffscreenBackBuffer",0)};if(r.majorVersion=n&&n.majorVersion?n.majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1,r.explicitSwapControl)throw"explicitSwapControl is not supported";return t=function(t,e){t.rf||(t.rf=t.getContext,t.getContext=function(e,n){return"webgl"==e==(n=t.rf(e,n))instanceof WebGLRenderingContext?n:null});var n=1<e.majorVersion?t.getContext("webgl2",e):t.getContext("webgl",e);return n?function(t,e){var n=Be(Pe),r={Rf:n,attributes:e,version:e.majorVersion,Ce:t};return t.canvas&&(t.canvas.jf=r),Pe[n]=r,(void 0===e.Gf||e.Gf)&&function(t){if(t||(t=We),!t.Tf){t.Tf=!0;var e=t.Ce;!function(t){var e=t.getExtension("ANGLE_instanced_arrays");e&&(t.vertexAttribDivisor=function(t,n){e.vertexAttribDivisorANGLE(t,n)},t.drawArraysInstanced=function(t,n,r,i){e.drawArraysInstancedANGLE(t,n,r,i)},t.drawElementsInstanced=function(t,n,r,i,o){e.drawElementsInstancedANGLE(t,n,r,i,o)})}(e),function(t){var e=t.getExtension("OES_vertex_array_object");e&&(t.createVertexArray=function(){return e.createVertexArrayOES()},t.deleteVertexArray=function(t){e.deleteVertexArrayOES(t)},t.bindVertexArray=function(t){e.bindVertexArrayOES(t)},t.isVertexArray=function(t){return e.isVertexArrayOES(t)})}(e),function(t){var e=t.getExtension("WEBGL_draw_buffers");e&&(t.drawBuffers=function(t,n){e.drawBuffersWEBGL(t,n)})}(e),e.nf=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),e.sf=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"),2<=t.version&&(e.pf=e.getExtension("EXT_disjoint_timer_query_webgl2")),(2>t.version||!e.pf)&&(e.pf=e.getExtension("EXT_disjoint_timer_query")),e.tg=e.getExtension("WEBGL_multi_draw"),(e.getSupportedExtensions()||[]).forEach((function(t){t.includes("lose_context")||t.includes("debug")||e.getExtension(t)}))}}(r),n}(n,e):0}(t,r),t?(je(t),t):0},t.deleteContext=function(t){We===Pe[t]&&(We=null),"object"==typeof JSEvents&&JSEvents.wg(Pe[t].Ce.canvas),Pe[t]&&Pe[t].Ce.canvas&&(Pe[t].Ce.canvas.jf=void 0),Pe[t]=null},t.MakeWebGLCanvasSurface=function(e,n,r){n=n||null;var i=e,o="undefined"!=typeof OffscreenCanvas&&i instanceof OffscreenCanvas;if(!("undefined"!=typeof HTMLCanvasElement&&i instanceof HTMLCanvasElement||o||(i=document.getElementById(e),i)))throw"Canvas with id "+e+" was not found";if(!(e=this.GetWebGLContext(i,r))||0>e)throw"failed to create webgl context: err "+e;return r=this.MakeGrContext(e),(n=this.MakeOnScreenGLSurface(r,i.width,i.height,n))?(n.he=e,n.grContext=r,n.openGLversion=i.jf.version,n):(n=i.cloneNode(!0),i.parentNode.replaceChild(n,i),n.classList.add("ck-replaced"),t.MakeSWCanvasSurface(n))},t.MakeCanvasSurface=t.MakeWebGLCanvasSurface}))}(e),function(t){function e(t,e,n,r,i){for(var o=0;o<t.length;o++)e[o*n+(o*i+r+n)%n]=t[o];return e}function n(t){for(var e=t*t,n=Array(e);e--;)n[e]=0==e%(t+1)?1:0;return n}function r(t){return!!t&&t.constructor===Float32Array&&4===t.length}function o(t){return(u(255*t[3])<<24|u(255*t[0])<<16|u(255*t[1])<<8|u(255*t[2])<<0)>>>0}function a(t){if(t instanceof Float32Array){for(var e=Math.floor(t.length/4),n=new Uint32Array(e),r=0;r<e;r++)n[r]=o(t.slice(4*r,4*(r+1)));return n}return t instanceof Uint32Array?t:t instanceof Array&&t[0]instanceof Float32Array?t.map(o):void 0}function s(t){if(void 0===t)return 1;var e=parseFloat(t);return t&&-1!==t.indexOf("%")?e/100:e}function u(t){return Math.round(Math.max(0,Math.min(t||0,255)))}function l(e,n){n&&!n._ck&&t._free(e)}function c(e,n,r){if(!e||!e.length)return X;if(e._ck)return e.byteOffset;var i=t[n].BYTES_PER_ELEMENT;return r||(r=t._malloc(e.length*i)),t[n].set(e,r/i),r}function h(e){var n={Zd:X,count:e.length,Je:t.ColorType.RGBA_F32};if(e instanceof Float32Array)n.Zd=c(e,"HEAPF32"),n.count=e.length/4;else if(e instanceof Uint32Array)n.Zd=c(e,"HEAPU32"),n.Je=t.ColorType.RGBA_8888;else{if(!(e instanceof Array))throw"Invalid argument to copyFlexibleColorArray, Not a color array "+typeof e;if(e&&e.length){for(var r=t._malloc(16*e.length),i=0,o=r/4,a=0;a<e.length;a++)for(var s=0;4>s;s++)t.HEAPF32[o+i]=e[a][s],i++;e=r}else e=X;n.Zd=e}return n}function f(e){if(!e)return X;if(e.length){if(6===e.length||9===e.length)return c(e,"HEAPF32",P),6===e.length&&t.HEAPF32.set(z,6+P/4),P;if(16===e.length){var n=E.toTypedArray();return n[0]=e[0],n[1]=e[1],n[2]=e[3],n[3]=e[4],n[4]=e[5],n[5]=e[7],n[6]=e[12],n[7]=e[13],n[8]=e[15],P}throw"invalid matrix size"}return(n=E.toTypedArray())[0]=e.m11,n[1]=e.m21,n[2]=e.m41,n[3]=e.m12,n[4]=e.m22,n[5]=e.m42,n[6]=e.m14,n[7]=e.m24,n[8]=e.m44,P}function p(e){for(var n=Array(16),r=0;16>r;r++)n[r]=t.HEAPF32[e/4+r];return n}function d(t,e){return c(t,"HEAPF32",e||L)}function y(t,e,n,r){var i=x.toTypedArray();return i[0]=t,i[1]=e,i[2]=n,i[3]=r,L}function m(e){for(var n=new Float32Array(4),r=0;4>r;r++)n[r]=t.HEAPF32[e/4+r];return n}function g(t,e){return c(t,"HEAPF32",e||F)}function _(t,e){return c(t,"HEAPF32",e||q)}function b(){for(var t=0,e=0;e<arguments.length-1;e+=2)t+=arguments[e]*arguments[e+1];return t}function v(t,e,n){for(var r=Array(t.length),i=0;i<n;i++)for(var o=0;o<n;o++){for(var a=0,s=0;s<n;s++)a+=t[n*i+s]*e[n*s+o];r[i*n+o]=a}return r}function T(t,e){for(var n=v(e[0],e[1],t),r=2;r<e.length;)n=v(n,e[r],t),r++;return n}t.Color=function(e,n,r,i){return void 0===i&&(i=1),t.Color4f(u(e)/255,u(n)/255,u(r)/255,i)},t.ColorAsInt=function(t,e,n,r){return void 0===r&&(r=255),(u(r)<<24|u(t)<<16|u(e)<<8|u(n)<<0&268435455)>>>0},t.Color4f=function(t,e,n,r){return void 0===r&&(r=1),Float32Array.of(t,e,n,r)},Object.defineProperty(t,"TRANSPARENT",{get:function(){return t.Color4f(0,0,0,0)}}),Object.defineProperty(t,"BLACK",{get:function(){return t.Color4f(0,0,0,1)}}),Object.defineProperty(t,"WHITE",{get:function(){return t.Color4f(1,1,1,1)}}),Object.defineProperty(t,"RED",{get:function(){return t.Color4f(1,0,0,1)}}),Object.defineProperty(t,"GREEN",{get:function(){return t.Color4f(0,1,0,1)}}),Object.defineProperty(t,"BLUE",{get:function(){return t.Color4f(0,0,1,1)}}),Object.defineProperty(t,"YELLOW",{get:function(){return t.Color4f(1,1,0,1)}}),Object.defineProperty(t,"CYAN",{get:function(){return t.Color4f(0,1,1,1)}}),Object.defineProperty(t,"MAGENTA",{get:function(){return t.Color4f(1,0,1,1)}}),t.getColorComponents=function(t){return[Math.floor(255*t[0]),Math.floor(255*t[1]),Math.floor(255*t[2]),t[3]]},t.parseColorString=function(e,n){if((e=e.toLowerCase()).startsWith("#")){switch(n=255,e.length){case 9:n=parseInt(e.slice(7,9),16);case 7:var r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);break;case 5:n=17*parseInt(e.slice(4,5),16);case 4:r=17*parseInt(e.slice(1,2),16),i=17*parseInt(e.slice(2,3),16),o=17*parseInt(e.slice(3,4),16)}return t.Color(r,i,o,n/255)}return e.startsWith("rgba")?(e=(e=e.slice(5,-1)).split(","),t.Color(+e[0],+e[1],+e[2],s(e[3]))):e.startsWith("rgb")?(e=(e=e.slice(4,-1)).split(","),t.Color(+e[0],+e[1],+e[2],s(e[3]))):e.startsWith("gray(")||e.startsWith("hsl")||!n||void 0===(e=n[e])?t.BLACK:e},t.multiplyByAlpha=function(t,e){return(t=t.slice())[3]=Math.max(0,Math.min(t[3]*e,1)),t},t.Malloc=function(e,n){var r=t._malloc(n*e.BYTES_PER_ELEMENT);return{_ck:!0,length:n,byteOffset:r,je:null,subarray:function(t,e){return(t=this.toTypedArray().subarray(t,e))._ck=!0,t},toTypedArray:function(){return this.je&&this.je.length||(this.je=new e(t.HEAPU8.buffer,r,n),this.je._ck=!0),this.je}}},t.Free=function(e){t._free(e.byteOffset),e.byteOffset=X,e.toTypedArray=null,e.je=null};var E,w,x,C,M,S,N,O,A,I,P=X,R=X,L=X,F=X,U=X,j=X,G=X,W=X,q=X,H=X,z=Float32Array.of(0,0,1),V={};t.ke=function(){this.ge=[],this.Od=null,Object.defineProperty(this,"length",{enumerable:!0,get:function(){return this.ge.length/4}})},t.ke.prototype.push=function(t,e,n,r){this.Od||this.ge.push(t,e,n,r)},t.ke.prototype.set=function(e,n,r,i,o){0>e||e>=this.ge.length/4||(e*=4,this.Od?(e=this.Od/4+e,t.HEAPF32[e]=n,t.HEAPF32[e+1]=r,t.HEAPF32[e+2]=i,t.HEAPF32[e+3]=o):(this.ge[e]=n,this.ge[e+1]=r,this.ge[e+2]=i,this.ge[e+3]=o))},t.ke.prototype.build=function(){return this.Od?this.Od:this.Od=c(this.ge,"HEAPF32")},t.ke.prototype.delete=function(){this.Od&&(t._free(this.Od),this.Od=null)},t.De=function(){this.Ie=[],this.Od=null,Object.defineProperty(this,"length",{enumerable:!0,get:function(){return this.Ie.length}})},t.De.prototype.push=function(t){this.Od||this.Ie.push(t)},t.De.prototype.set=function(e,n){0>e||e>=this.Ie.length||(e*=4,this.Od?t.HEAPU32[this.Od/4+e]=n:this.Ie[e]=n)},t.De.prototype.build=function(){return this.Od?this.Od:this.Od=c(this.Ie,"HEAPU32")},t.De.prototype.delete=function(){this.Od&&(t._free(this.Od),this.Od=null)},t.RectBuilder=t.ke,t.RSXFormBuilder=t.ke,t.ColorBuilder=t.De;var X=0,Y=!new Function("try {return this===window;}catch(e){ return false;}")();t.onRuntimeInitialized=function(){function e(e,n,r,i,o,a){a||(a=4*i.width,i.colorType===t.ColorType.RGBA_F16?a*=2:i.colorType===t.ColorType.RGBA_F32&&(a*=4));var s=a*i.height,u=o?o.byteOffset:t._malloc(s);if(!e._readPixels(i,u,a,n,r))return o||t._free(u),null;if(o)return o.toTypedArray();switch(i.colorType){case t.ColorType.RGBA_8888:case t.ColorType.RGBA_F16:e=new Uint8Array(t.HEAPU8.buffer,u,s).slice();break;case t.ColorType.RGBA_F32:e=new Float32Array(t.HEAPU8.buffer,u,s).slice();break;default:return null}return t._free(u),e}x=t.Malloc(Float32Array,4),L=x.byteOffset,w=t.Malloc(Float32Array,16),R=w.byteOffset,E=t.Malloc(Float32Array,9),P=E.byteOffset,A=t.Malloc(Float32Array,12),q=A.byteOffset,I=t.Malloc(Float32Array,12),H=I.byteOffset,C=t.Malloc(Float32Array,4),F=C.byteOffset,M=t.Malloc(Float32Array,4),U=M.byteOffset,S=t.Malloc(Float32Array,3),j=S.byteOffset,N=t.Malloc(Float32Array,3),G=N.byteOffset,O=t.Malloc(Int32Array,4),W=O.byteOffset,t.ColorSpace.SRGB=t.ColorSpace._MakeSRGB(),t.ColorSpace.DISPLAY_P3=t.ColorSpace._MakeDisplayP3(),t.ColorSpace.ADOBE_RGB=t.ColorSpace._MakeAdobeRGB(),t.Path.MakeFromCmds=function(e){for(var n=0,r=0;r<e.length;r++)n+=e[r].length;if(V[n])var i=V[n];else i=new Float32Array(n),V[n]=i;var o=0;for(r=0;r<e.length;r++)for(var a=0;a<e[r].length;a++)i[o]=e[r][a],o++;return e=[c(i,"HEAPF32"),n],n=t.Path._MakeFromCmds(e[0],e[1]),t._free(e[0]),n},t.Path.MakeFromVerbsPointsWeights=function(e,n,r){var i=c(e,"HEAPU8"),o=c(n,"HEAPF32"),a=c(r,"HEAPF32"),s=t.Path._MakeFromVerbsPointsWeights(i,e.length,o,n.length,a,r&&r.length||0);return l(i,e),l(o,n),l(a,r),s},t.Path.prototype.addArc=function(t,e,n){return t=g(t),this._addArc(t,e,n),this},t.Path.prototype.addOval=function(t,e,n){return void 0===n&&(n=1),t=g(t),this._addOval(t,!!e,n),this},t.Path.prototype.addPath=function(){var t=Array.prototype.slice.call(arguments),e=t[0],n=!1;if("boolean"==typeof t[t.length-1]&&(n=t.pop()),1===t.length)this._addPath(e,1,0,0,0,1,0,0,0,1,n);else if(2===t.length)t=t[1],this._addPath(e,t[0],t[1],t[2],t[3],t[4],t[5],t[6]||0,t[7]||0,t[8]||1,n);else{if(7!==t.length&&10!==t.length)return null;this._addPath(e,t[1],t[2],t[3],t[4],t[5],t[6],t[7]||0,t[8]||0,t[9]||1,n)}return this},t.Path.prototype.addPoly=function(t,e){var n=c(t,"HEAPF32");return this._addPoly(n,t.length/2,e),l(n,t),this},t.Path.prototype.addRect=function(t,e){return t=g(t),this._addRect(t,!!e),this},t.Path.prototype.addRRect=function(t,e){return t=_(t),this._addRRect(t,!!e),this},t.Path.prototype.addVerbsPointsWeights=function(t,e,n){var r=c(t,"HEAPU8"),i=c(e,"HEAPF32"),o=c(n,"HEAPF32");this._addVerbsPointsWeights(r,t.length,i,e.length,o,n&&n.length||0),l(r,t),l(i,e),l(o,n)},t.Path.prototype.arc=function(e,n,r,i,o,a){return e=t.LTRBRect(e-r,n-r,e+r,n+r),o=(o-i)/Math.PI*180-360*!!a,(a=new t.Path).addArc(e,i/Math.PI*180,o),this.addPath(a,!0),a.delete(),this},t.Path.prototype.arcToOval=function(t,e,n,r){return t=g(t),this._arcToOval(t,e,n,r),this},t.Path.prototype.arcToRotated=function(t,e,n,r,i,o,a){return this._arcToRotated(t,e,n,!!r,!!i,o,a),this},t.Path.prototype.arcToTangent=function(t,e,n,r,i){return this._arcToTangent(t,e,n,r,i),this},t.Path.prototype.close=function(){return this._close(),this},t.Path.prototype.conicTo=function(t,e,n,r,i){return this._conicTo(t,e,n,r,i),this},t.Path.prototype.computeTightBounds=function(t){this._computeTightBounds(F);var e=C.toTypedArray();return t?(t.set(e),t):e.slice()},t.Path.prototype.cubicTo=function(t,e,n,r,i,o){return this._cubicTo(t,e,n,r,i,o),this},t.Path.prototype.dash=function(t,e,n){return this._dash(t,e,n)?this:null},t.Path.prototype.getBounds=function(t){this._getBounds(F);var e=C.toTypedArray();return t?(t.set(e),t):e.slice()},t.Path.prototype.lineTo=function(t,e){return this._lineTo(t,e),this},t.Path.prototype.moveTo=function(t,e){return this._moveTo(t,e),this},t.Path.prototype.offset=function(t,e){return this._transform(1,0,t,0,1,e,0,0,1),this},t.Path.prototype.quadTo=function(t,e,n,r){return this._quadTo(t,e,n,r),this},t.Path.prototype.rArcTo=function(t,e,n,r,i,o,a){return this._rArcTo(t,e,n,r,i,o,a),this},t.Path.prototype.rConicTo=function(t,e,n,r,i){return this._rConicTo(t,e,n,r,i),this},t.Path.prototype.rCubicTo=function(t,e,n,r,i,o){return this._rCubicTo(t,e,n,r,i,o),this},t.Path.prototype.rLineTo=function(t,e){return this._rLineTo(t,e),this},t.Path.prototype.rMoveTo=function(t,e){return this._rMoveTo(t,e),this},t.Path.prototype.rQuadTo=function(t,e,n,r){return this._rQuadTo(t,e,n,r),this},t.Path.prototype.stroke=function(e){return(e=e||{}).width=e.width||1,e.miter_limit=e.miter_limit||4,e.cap=e.cap||t.StrokeCap.Butt,e.join=e.join||t.StrokeJoin.Miter,e.precision=e.precision||1,this._stroke(e)?this:null},t.Path.prototype.transform=function(){if(1===arguments.length){var t=arguments[0];this._transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6]||0,t[7]||0,t[8]||1)}else{if(6!==arguments.length&&9!==arguments.length)throw"transform expected to take 1 or 9 arguments. Got "+arguments.length;t=arguments,this._transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6]||0,t[7]||0,t[8]||1)}return this},t.Path.prototype.trim=function(t,e,n){return this._trim(t,e,!!n)?this:null},t.Image.prototype.makeShaderCubic=function(t,e,n,r,i){return i=f(i),this._makeShaderCubic(t,e,n,r,i)},t.Image.prototype.makeShaderOptions=function(t,e,n,r,i){return i=f(i),this._makeShaderOptions(t,e,n,r,i)},t.Image.prototype.readPixels=function(t,n,r,i,o){return e(this,t,n,r,i,o)},t.Canvas.prototype.clear=function(t){t=d(t),this._clear(t)},t.Canvas.prototype.clipRRect=function(t,e,n){t=_(t),this._clipRRect(t,e,n)},t.Canvas.prototype.clipRect=function(t,e,n){t=g(t),this._clipRect(t,e,n)},t.Canvas.prototype.concat=function(t){t=function(t){if(!t)return X;var e=w.toTypedArray();if(t.length){if(16!==t.length&&6!==t.length&&9!==t.length)throw"invalid matrix size";return 16===t.length?c(t,"HEAPF32",R):(e.fill(0),e[0]=t[0],e[1]=t[1],e[3]=t[2],e[4]=t[3],e[5]=t[4],e[7]=t[5],e[12]=t[6],e[13]=t[7],e[15]=t[8],6===t.length&&(e[12]=0,e[13]=0,e[15]=1),R)}return e[0]=t.m11,e[1]=t.m21,e[2]=t.m31,e[3]=t.m41,e[4]=t.m12,e[5]=t.m22,e[6]=t.m32,e[7]=t.m42,e[8]=t.m13,e[9]=t.m23,e[10]=t.m33,e[11]=t.m43,e[12]=t.m14,e[13]=t.m24,e[14]=t.m34,e[15]=t.m44,R}(t),this._concat(t)},t.Canvas.prototype.drawArc=function(t,e,n,r,i){t=g(t),this._drawArc(t,e,n,r,i)},t.Canvas.prototype.drawAtlas=function(e,n,r,i,o,s,u){if(e&&i&&n&&r&&n.length===r.length){o||(o=t.BlendMode.SrcOver);var h=n.build?n.build():c(n,"HEAPF32");if(r.build)var f=r.build(),p=r.length;else f=c(r,"HEAPF32"),p=r.length/4;var d=X;if(s&&(d=s.build?s.build():c(a(s),"HEAPU32")),u&&"B"in u&&"C"in u)this._drawAtlasCubic(e,f,h,d,p,o,u.B,u.C,i);else{let n=t.FilterMode.Linear,r=t.MipmapMode.None;u&&(n=u.filter,"mipmap"in u&&(r=u.mipmap)),this._drawAtlasOptions(e,f,h,d,p,o,n,r,i)}h&&!n.build&&l(h,n),f&&!r.build&&l(f,r),d&&!s.build&&l(d,s)}},t.Canvas.prototype.drawColor=function(t,e){t=d(t),void 0!==e?this._drawColor(t,e):this._drawColor(t)},t.Canvas.prototype.drawColorComponents=function(t,e,n,r,i){t=y(t,e,n,r),void 0!==i?this._drawColor(t,i):this._drawColor(t)},t.Canvas.prototype.drawDRRect=function(t,e,n){t=_(t,q),e=_(e,H),this._drawDRRect(t,e,n)},t.Canvas.prototype.drawImageNine=function(t,e,n,r,i){e=c(e,"HEAP32",W),n=g(n),this._drawImageNine(t,e,n,r,i||null)},t.Canvas.prototype.drawImageRect=function(t,e,n,r,i){g(e,F),g(n,U),this._drawImageRect(t,F,U,r,!!i)},t.Canvas.prototype.drawImageRectCubic=function(t,e,n,r,i,o){g(e,F),g(n,U),this._drawImageRectCubic(t,F,U,r,i,o||null)},t.Canvas.prototype.drawImageRectOptions=function(t,e,n,r,i,o){g(e,F),g(n,U),this._drawImageRectOptions(t,F,U,r,i,o||null)},t.Canvas.prototype.drawOval=function(t,e){t=g(t),this._drawOval(t,e)},t.Canvas.prototype.drawPoints=function(t,e,n){var r=c(e,"HEAPF32");this._drawPoints(t,r,e.length/2,n),l(r,e)},t.Canvas.prototype.drawRRect=function(t,e){t=_(t),this._drawRRect(t,e)},t.Canvas.prototype.drawRect=function(t,e){t=g(t),this._drawRect(t,e)},t.Canvas.prototype.drawShadow=function(t,e,n,r,i,o,a){var s=c(i,"HEAPF32"),u=c(o,"HEAPF32");e=c(e,"HEAPF32",j),n=c(n,"HEAPF32",G),this._drawShadow(t,e,n,r,s,u,a),l(s,i),l(u,o)},t.getShadowLocalBounds=function(t,e,n,r,i,o,a){return t=f(t),n=c(n,"HEAPF32",j),r=c(r,"HEAPF32",G),this._getShadowLocalBounds(t,e,n,r,i,o,F)?(e=C.toTypedArray(),a?(a.set(e),a):e.slice()):null},t.Canvas.prototype.getLocalToDevice=function(){return this._getLocalToDevice(R),p(R)},t.Canvas.prototype.findMarkedCTM=function(t){return this._findMarkedCTM(t,R)?p(R):null},t.Canvas.prototype.getTotalMatrix=function(){this._getTotalMatrix(P);for(var e=Array(9),n=0;9>n;n++)e[n]=t.HEAPF32[P/4+n];return e},t.Canvas.prototype.readPixels=function(t,n,r,i,o){return e(this,t,n,r,i,o)},t.Canvas.prototype.saveLayer=function(t,e,n,r){return e=g(e),this._saveLayer(t||null,e,n||null,r||0)},t.Canvas.prototype.writePixels=function(e,n,r,i,o,a,s,u){if(e.byteLength%(n*r))throw"pixels length must be a multiple of the srcWidth * srcHeight";var h=e.byteLength/(n*r);a=a||t.AlphaType.Unpremul,s=s||t.ColorType.RGBA_8888,u=u||t.ColorSpace.SRGB;var f=h*n;return h=c(e,"HEAPU8"),n=this._writePixels({width:n,height:r,colorType:s,alphaType:a,colorSpace:u},h,f,i,o),l(h,e),n},t.ColorFilter.MakeBlend=function(e,n){return e=d(e),t.ColorFilter._MakeBlend(e,n)},t.ColorFilter.MakeMatrix=function(e){if(!e||20!==e.length)throw"invalid color matrix";var n=c(e,"HEAPF32"),r=t.ColorFilter._makeMatrix(n);return l(n,e),r},t.ContourMeasure.prototype.getPosTan=function(t,e){return this._getPosTan(t,F),t=C.toTypedArray(),e?(e.set(t),e):t.slice()},t.ImageFilter.MakeMatrixTransform=function(e,n,r){return e=f(e),t.ImageFilter._MakeMatrixTransform(e,n,r)},t.Paint.prototype.getColor=function(){return this._getColor(L),m(L)},t.Paint.prototype.setColor=function(t,e){e=e||null,t=d(t),this._setColor(t,e)},t.Paint.prototype.setColorComponents=function(t,e,n,r,i){i=i||null,t=y(t,e,n,r),this._setColor(t,i)},t.Path.prototype.getPoint=function(t,e){return this._getPoint(t,F),t=C.toTypedArray(),e?(e[0]=t[0],e[1]=t[1],e):t.slice(0,2)},t.PictureRecorder.prototype.beginRecording=function(t){return t=g(t),this._beginRecording(t)},t.Surface.prototype.makeImageSnapshot=function(t){return t=c(t,"HEAP32",W),this._makeImageSnapshot(t)},t.Surface.prototype.requestAnimationFrame=function(e,n){this.Ee||(this.Ee=this.getCanvas()),requestAnimationFrame(function(){void 0!==this.he&&t.setCurrentContext(this.he),e(this.Ee),this.flush(n)}.bind(this))},t.Surface.prototype.drawOnce=function(e,n){this.Ee||(this.Ee=this.getCanvas()),requestAnimationFrame(function(){void 0!==this.he&&t.setCurrentContext(this.he),e(this.Ee),this.flush(n),this.dispose()}.bind(this))},t.PathEffect.MakeDash=function(e,n){if(n||(n=0),!e.length||1==e.length%2)throw"Intervals array must have even length";var r=c(e,"HEAPF32");return n=t.PathEffect._MakeDash(r,e.length,n),l(r,e),n},t.Shader.MakeColor=function(e,n){return n=n||null,e=d(e),t.Shader._MakeColor(e,n)},t.Shader.Blend=t.Shader.MakeBlend,t.Shader.Color=t.Shader.MakeColor,t.Shader.Lerp=t.Shader.MakeLerp,t.Shader.MakeLinearGradient=function(e,n,r,i,o,a,s,u){u=u||null;var p=h(r),d=c(i,"HEAPF32");s=s||0,a=f(a);var y=C.toTypedArray();return y.set(e),y.set(n,2),e=t.Shader._MakeLinearGradient(F,p.Zd,p.Je,d,p.count,o,s,a,u),l(p.Zd,r),i&&l(d,i),e},t.Shader.MakeRadialGradient=function(e,n,r,i,o,a,s,u){u=u||null;var p=h(r),d=c(i,"HEAPF32");return s=s||0,a=f(a),e=t.Shader._MakeRadialGradient(e[0],e[1],n,p.Zd,p.Je,d,p.count,o,s,a,u),l(p.Zd,r),i&&l(d,i),e},t.Shader.MakeSweepGradient=function(e,n,r,i,o,a,s,u,p,d){d=d||null;var y=h(r),m=c(i,"HEAPF32");return s=s||0,u=u||0,p=p||360,a=f(a),e=t.Shader._MakeSweepGradient(e,n,y.Zd,y.Je,m,y.count,o,u,p,s,a,d),l(y.Zd,r),i&&l(m,i),e},t.Shader.MakeTwoPointConicalGradient=function(e,n,r,i,o,a,s,u,p,d){d=d||null;var y=h(o),m=c(a,"HEAPF32");p=p||0,u=f(u);var g=C.toTypedArray();return g.set(e),g.set(r,2),e=t.Shader._MakeTwoPointConicalGradient(F,n,i,y.Zd,y.Je,m,y.count,s,p,u,d),l(y.Zd,o),a&&l(m,a),e},t.Vertices.prototype.bounds=function(t){this._bounds(F);var e=C.toTypedArray();return t?(t.set(e),t):e.slice()},t.Ud&&t.Ud.forEach((function(t){t()}))},t.computeTonalColors=function(t){var e=c(t.ambient,"HEAPF32"),n=c(t.spot,"HEAPF32");this._computeTonalColors(e,n);var r={ambient:m(e),spot:m(n)};return l(e,t.ambient),l(n,t.spot),r},t.LTRBRect=function(t,e,n,r){return Float32Array.of(t,e,n,r)},t.XYWHRect=function(t,e,n,r){return Float32Array.of(t,e,t+n,e+r)},t.LTRBiRect=function(t,e,n,r){return Int32Array.of(t,e,n,r)},t.XYWHiRect=function(t,e,n,r){return Int32Array.of(t,e,t+n,e+r)},t.RRectXY=function(t,e,n){return Float32Array.of(t[0],t[1],t[2],t[3],e,n,e,n,e,n,e,n)},t.MakeAnimatedImageFromEncoded=function(e){e=new Uint8Array(e);var n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),(e=t._decodeAnimatedImage(n,e.byteLength))?e:null},t.MakeImageFromEncoded=function(e){e=new Uint8Array(e);var n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),(e=t._decodeImage(n,e.byteLength))?e:null};var Z=null;t.MakeImageFromCanvasImageSource=function(e){var n=e.width,r=e.height;Z||(Z=document.createElement("canvas")),Z.width=n,Z.height=r;var i=Z.getContext("2d");return i.drawImage(e,0,0),e=i.getImageData(0,0,n,r),t.MakeImage({width:n,height:r,alphaType:t.AlphaType.Unpremul,colorType:t.ColorType.RGBA_8888,colorSpace:t.ColorSpace.SRGB},e.data,4*n)},t.MakeImage=function(e,n,r){var i=t._malloc(n.length);return t.HEAPU8.set(n,i),t._MakeImage(e,i,n.length,r)},t.MakeVertices=function(e,n,r,i,o,s){var u=o&&o.length||0,l=0;if(r&&r.length&&(l|=1),i&&i.length&&(l|=2),void 0===s||s||(l|=4),c(n,"HEAPF32",(e=new t._VerticesBuilder(e,n.length/2,u,l)).positions()),e.texCoords()&&c(r,"HEAPF32",e.texCoords()),e.colors()){if(i.build)throw"Color builder not accepted by MakeVertices, use array of ints";c(a(i),"HEAPU32",e.colors())}return e.indices()&&c(o,"HEAPU16",e.indices()),e.detach()},t.Matrix={},t.Matrix.identity=function(){return n(3)},t.Matrix.invert=function(t){var e=t[0]*t[4]*t[8]+t[1]*t[5]*t[6]+t[2]*t[3]*t[7]-t[2]*t[4]*t[6]-t[1]*t[3]*t[8]-t[0]*t[5]*t[7];return e?[(t[4]*t[8]-t[5]*t[7])/e,(t[2]*t[7]-t[1]*t[8])/e,(t[1]*t[5]-t[2]*t[4])/e,(t[5]*t[6]-t[3]*t[8])/e,(t[0]*t[8]-t[2]*t[6])/e,(t[2]*t[3]-t[0]*t[5])/e,(t[3]*t[7]-t[4]*t[6])/e,(t[1]*t[6]-t[0]*t[7])/e,(t[0]*t[4]-t[1]*t[3])/e]:null},t.Matrix.mapPoints=function(t,e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1],o=t[6]*r+t[7]*i+t[8],a=t[3]*r+t[4]*i+t[5];e[n]=(t[0]*r+t[1]*i+t[2])/o,e[n+1]=a/o}return e},t.Matrix.multiply=function(){return T(3,arguments)},t.Matrix.rotated=function(t,e,n){e=e||0,n=n||0;var r=Math.sin(t);return[t=Math.cos(t),-r,b(r,n,1-t,e),r,t,b(-r,e,1-t,n),0,0,1]},t.Matrix.scaled=function(t,r,i,o){i=i||0,o=o||0;var a=e([t,r],n(3),3,0,1);return e([i-t*i,o-r*o],a,3,2,0)},t.Matrix.skewed=function(t,r,i,o){i=i||0,o=o||0;var a=e([t,r],n(3),3,1,-1);return e([-t*i,-r*o],a,3,2,0)},t.Matrix.translated=function(t,r){return e(arguments,n(3),3,2,0)},t.Vector={},t.Vector.dot=function(t,e){return t.map((function(t,n){return t*e[n]})).reduce((function(t,e){return t+e}))},t.Vector.lengthSquared=function(e){return t.Vector.dot(e,e)},t.Vector.length=function(e){return Math.sqrt(t.Vector.lengthSquared(e))},t.Vector.mulScalar=function(t,e){return t.map((function(t){return t*e}))},t.Vector.add=function(t,e){return t.map((function(t,n){return t+e[n]}))},t.Vector.sub=function(t,e){return t.map((function(t,n){return t-e[n]}))},t.Vector.dist=function(e,n){return t.Vector.length(t.Vector.sub(e,n))},t.Vector.normalize=function(e){return t.Vector.mulScalar(e,1/t.Vector.length(e))},t.Vector.cross=function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]},t.M44={},t.M44.identity=function(){return n(4)},t.M44.translated=function(t){return e(t,n(4),4,3,0)},t.M44.scaled=function(t){return e(t,n(4),4,0,1)},t.M44.rotated=function(e,n){return t.M44.rotatedUnitSinCos(t.Vector.normalize(e),Math.sin(n),Math.cos(n))},t.M44.rotatedUnitSinCos=function(t,e,n){var r=t[0],i=t[1],o=1-n;return[o*r*r+n,o*r*i-e*(t=t[2]),o*r*t+e*i,0,o*r*i+e*t,o*i*i+n,o*i*t-e*r,0,o*r*t-e*i,o*i*t+e*r,o*t*t+n,0,0,0,0,1]},t.M44.lookat=function(n,r,i){r=t.Vector.normalize(t.Vector.sub(r,n)),i=t.Vector.normalize(i),i=t.Vector.normalize(t.Vector.cross(r,i));var o=t.M44.identity();return e(i,o,4,0,0),e(t.Vector.cross(i,r),o,4,1,0),e(t.Vector.mulScalar(r,-1),o,4,2,0),e(n,o,4,3,0),null===(n=t.M44.invert(o))?t.M44.identity():n},t.M44.perspective=function(t,e,n){var r=1/(e-t);return n/=2,[n=Math.cos(n)/Math.sin(n),0,0,0,0,n,0,0,0,0,(e+t)*r,2*e*t*r,0,0,-1,1]},t.M44.rc=function(t,e,n){return t[4*e+n]},t.M44.multiply=function(){return T(4,arguments)},t.M44.invert=function(t){var e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],u=t[13],l=t[2],c=t[6],h=t[10],f=t[14],p=t[3],d=t[7],y=t[11],m=e*a-n*o,g=e*s-r*o,_=e*u-i*o,b=n*s-r*a,v=n*u-i*a,T=r*u-i*s,E=l*d-c*p,w=l*y-h*p,x=l*(t=t[15])-f*p,C=c*y-h*d,M=c*t-f*d,S=h*t-f*y,N=m*S-g*M+_*C+b*x-v*w+T*E,O=1/N;return 0===N||1/0===O?null:(e=[a*(S*=O)-s*(M*=O)+u*(C*=O),s*(x*=O)-o*S-u*(w*=O),o*M-a*x+u*(E*=O),a*w-o*C-s*E,r*M-n*S-i*C,e*S-r*x+i*w,n*x-e*M-i*E,e*C-n*w+r*E,d*(T*=O)-y*(v*=O)+t*(b*=O),y*(_*=O)-p*T-t*(g*=O),p*v-d*_+t*(m*=O),d*g-p*b-y*m,h*v-c*T-f*b,l*T-h*_+f*g,c*_-l*v-f*m,l*b-c*g+h*m]).every((function(t){return!isNaN(t)&&1/0!==t&&-1/0!==t}))?e:null},t.M44.transpose=function(t){return[t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]},t.M44.mustInvert=function(e){if(null===(e=t.M44.invert(e)))throw"Matrix not invertible";return e},t.M44.setupCamera=function(e,n,r){var i=t.M44.lookat(r.eye,r.coa,r.up);return r=t.M44.perspective(r.near,r.far,r.angle),n=[(e[2]-e[0])/2,(e[3]-e[1])/2,n],e=t.M44.multiply(t.M44.translated([(e[0]+e[2])/2,(e[1]+e[3])/2,0]),t.M44.scaled(n)),t.M44.multiply(e,r,i,t.M44.mustInvert(e))},t.ColorMatrix={},t.ColorMatrix.identity=function(){var t=new Float32Array(20);return t[0]=1,t[6]=1,t[12]=1,t[18]=1,t},t.ColorMatrix.scaled=function(t,e,n,r){var i=new Float32Array(20);return i[0]=t,i[6]=e,i[12]=n,i[18]=r,i};var Q=[[6,7,11,12],[0,10,2,12],[0,1,5,6]];t.ColorMatrix.rotated=function(e,n,r){var i=t.ColorMatrix.identity();return i[(e=Q[e])[0]]=r,i[e[1]]=n,i[e[2]]=-n,i[e[3]]=r,i},t.ColorMatrix.postTranslate=function(t,e,n,r,i){return t[4]+=e,t[9]+=n,t[14]+=r,t[19]+=i,t},t.ColorMatrix.concat=function(t,e){for(var n=new Float32Array(20),r=0,i=0;20>i;i+=5){for(var o=0;4>o;o++)n[r++]=t[i]*e[o]+t[i+1]*e[o+5]+t[i+2]*e[o+10]+t[i+3]*e[o+15];n[r++]=t[i]*e[4]+t[i+1]*e[9]+t[i+2]*e[14]+t[i+3]*e[19]+t[i+4]}return n},t.Ud=t.Ud||[],t.Ud.push((function(){t.Path.prototype.op=function(t,e){return this._op(t,e)?this:null},t.Path.prototype.simplify=function(){return this._simplify()?this:null}})),t.Ud=t.Ud||[],t.Ud.push((function(){t.Canvas.prototype.drawText=function(e,n,r,i,o){var a=k(e),s=t._malloc(a+1);D(e,B,s,a+1),this._drawSimpleText(s,a,n,r,o,i),t._free(s)},t.Font.prototype.getGlyphBounds=function(e,n,r){var i=c(e,"HEAPU16"),o=t._malloc(16*e.length);return this._getGlyphWidthBounds(i,e.length,X,o,n||null),n=new Float32Array(t.HEAPU8.buffer,o,4*e.length),l(i,e),r?(r.set(n),t._free(o),r):(e=Float32Array.from(n),t._free(o),e)},t.Font.prototype.getGlyphIDs=function(e,n,r){n||(n=e.length);var i=k(e)+1,o=t._malloc(i);return D(e,B,o,i),e=t._malloc(2*n),n=this._getGlyphIDs(o,i-1,n,e),t._free(o),0>n?(t._free(e),null):(o=new Uint16Array(t.HEAPU8.buffer,e,n),r?(r.set(o),t._free(e),r):(r=Uint32Array.from(o),t._free(e),r))},t.Font.prototype.getGlyphWidths=function(e,n,r){var i=c(e,"HEAPU16"),o=t._malloc(4*e.length);return this._getGlyphWidthBounds(i,e.length,o,X,n||null),n=new Float32Array(t.HEAPU8.buffer,o,e.length),l(i,e),r?(r.set(n),t._free(o),r):(e=Float32Array.from(n),t._free(o),e)},t.FontMgr.FromData=function(){if(!arguments.length)return null;var e=arguments;if(1===e.length&&Array.isArray(e[0])&&(e=arguments[0]),!e.length)return null;for(var n=[],r=[],i=0;i<e.length;i++){var o=new Uint8Array(e[i]),a=c(o,"HEAPU8");n.push(a),r.push(o.byteLength)}return n=c(n,"HEAPU32"),r=c(r,"HEAPU32"),e=t.FontMgr._fromData(n,r,e.length),t._free(n),t._free(r),e},t.FontMgr.prototype.MakeTypefaceFromData=function(t){var e=c(t=new Uint8Array(t),"HEAPU8");return(t=this._makeTypefaceFromData(e,t.byteLength))?t:null},t.TextBlob.MakeOnPath=function(e,n,r,i){if(e&&e.length&&n&&n.countPoints()){if(1===n.countPoints())return this.MakeFromText(e,r);i||(i=0);var o=r.getGlyphIDs(e),a=r.getGlyphWidths(o);o=new t.RSXFormBuilder;for(var s=(n=new t.ContourMeasureIter(n,!1,1)).next(),u=new Float32Array(4),l=0;l<e.length&&s;l++){var c=a[l];if((i+=c/2)>s.length()){if(s.delete(),!(s=n.next())){e=e.substring(0,l);break}i=c/2}s.getPosTan(i,u);var h=u[2],f=u[3];o.push(h,f,u[0]-c/2*h,u[1]-c/2*f),i+=c/2}return e=this.MakeFromRSXform(e,o,r),o.delete(),s&&s.delete(),n.delete(),e}},t.TextBlob.MakeFromRSXform=function(e,n,r){var i=k(e)+1,o=t._malloc(i);return D(e,B,o,i),e=n.build?n.build():c(n,"HEAPF32"),r=t.TextBlob._MakeFromRSXform(o,i-1,e,r),t._free(o),r||null},t.TextBlob.MakeFromRSXformGlyphs=function(e,n,r){var i=c(e,"HEAPU16");return n=n.build?n.build():c(n,"HEAPF32"),r=t.TextBlob._MakeFromRSXformGlyphs(i,2*e.length,n,r),l(i,e),r||null},t.TextBlob.MakeFromGlyphs=function(e,n){var r=c(e,"HEAPU16");return n=t.TextBlob._MakeFromGlyphs(r,2*e.length,n),l(r,e),n||null},t.TextBlob.MakeFromText=function(e,n){var r=k(e)+1,i=t._malloc(r);return D(e,B,i,r),e=t.TextBlob._MakeFromText(i,r-1,n),t._free(i),e||null},t.MallocGlyphIDs=function(e){return t.Malloc(Uint16Array,e)}})),function(){function e(t){for(var e=0;e<t.length;e++)if(void 0!==t[e]&&!Number.isFinite(t[e]))return!1;return!0}function n(e){var n=t.getColorComponents(e);e=n[0];var r=n[1],i=n[2];return 1===(n=n[3])?(e=e.toString(16).toLowerCase(),r=r.toString(16).toLowerCase(),i=i.toString(16).toLowerCase(),"#"+(e=1===e.length?"0"+e:e)+(r=1===r.length?"0"+r:r)+(i=1===i.length?"0"+i:i)):"rgba("+e+", "+r+", "+i+", "+(n=0===n||1===n?n:n.toFixed(8))+")"}function o(e){return t.parseColorString(e,b)}function a(t){if(!(t=v.exec(t)))return null;var e=parseFloat(t[4]),n=16;switch(t[5]){case"em":case"rem":case"pc":n=16*e;break;case"pt":n=4*e/3;break;case"px":n=e;break;case"in":n=96*e;break;case"cm":n=96*e/2.54;break;case"mm":n=96/25.4*e;break;case"q":n=96/25.4/4*e;break;case"%":n=16/75*e}return{style:t[1],variant:t[2],weight:t[3],sizePx:n,family:t[6].trim()}}function s(i){this.Hd=i,this.Jd=new t.Paint,this.Jd.setAntiAlias(!0),this.Jd.setStrokeMiter(10),this.Jd.setStrokeCap(t.StrokeCap.Butt),this.Jd.setStrokeJoin(t.StrokeJoin.Miter),this.Oe="10px monospace",this.ne=new t.Font(null,10),this.ne.setSubpixel(!0),this.Wd=this.be=t.BLACK,this.qe=0,this.Ge=t.TRANSPARENT,this.se=this.re=0,this.He=this.de=1,this.Fe=0,this.pe=[],this.Id=t.BlendMode.SrcOver,this.Jd.setStrokeWidth(this.He),this.Jd.setBlendMode(this.Id),this.Ld=new t.Path,this.Nd=t.Matrix.identity(),this.kf=[],this.we=[],this.fe=function(){this.Ld.delete(),this.Jd.delete(),this.ne.delete(),this.we.forEach((function(t){t.fe()}))},Object.defineProperty(this,"currentTransform",{enumerable:!0,get:function(){return{a:this.Nd[0],c:this.Nd[1],e:this.Nd[2],b:this.Nd[3],d:this.Nd[4],f:this.Nd[5]}},set:function(t){t.a&&this.setTransform(t.a,t.b,t.c,t.d,t.e,t.f)}}),Object.defineProperty(this,"fillStyle",{enumerable:!0,get:function(){return r(this.Wd)?n(this.Wd):this.Wd},set:function(t){"string"==typeof t?this.Wd=o(t):t.oe&&(this.Wd=t)}}),Object.defineProperty(this,"font",{enumerable:!0,get:function(){return this.Oe},set:function(t){var e=a(t),n=e.family;e.typeface=T[n]?T[n][(e.style||"normal")+"|"+(e.variant||"normal")+"|"+(e.weight||"normal")]||T[n]["*"]:null,e&&(this.ne.setSize(e.sizePx),this.ne.setTypeface(e.typeface),this.Oe=t)}}),Object.defineProperty(this,"globalAlpha",{enumerable:!0,get:function(){return this.de},set:function(t){!isFinite(t)||0>t||1<t||(this.de=t)}}),Object.defineProperty(this,"globalCompositeOperation",{enumerable:!0,get:function(){switch(this.Id){case t.BlendMode.SrcOver:return"source-over";case t.BlendMode.DstOver:return"destination-over";case t.BlendMode.Src:return"copy";case t.BlendMode.Dst:return"destination";case t.BlendMode.Clear:return"clear";case t.BlendMode.SrcIn:return"source-in";case t.BlendMode.DstIn:return"destination-in";case t.BlendMode.SrcOut:return"source-out";case t.BlendMode.DstOut:return"destination-out";case t.BlendMode.SrcATop:return"source-atop";case t.BlendMode.DstATop:return"destination-atop";case t.BlendMode.Xor:return"xor";case t.BlendMode.Plus:return"lighter";case t.BlendMode.Multiply:return"multiply";case t.BlendMode.Screen:return"screen";case t.BlendMode.Overlay:return"overlay";case t.BlendMode.Darken:return"darken";case t.BlendMode.Lighten:return"lighten";case t.BlendMode.ColorDodge:return"color-dodge";case t.BlendMode.ColorBurn:return"color-burn";case t.BlendMode.HardLight:return"hard-light";case t.BlendMode.SoftLight:return"soft-light";case t.BlendMode.Difference:return"difference";case t.BlendMode.Exclusion:return"exclusion";case t.BlendMode.Hue:return"hue";case t.BlendMode.Saturation:return"saturation";case t.BlendMode.Color:return"color";case t.BlendMode.Luminosity:return"luminosity"}},set:function(e){switch(e){case"source-over":this.Id=t.BlendMode.SrcOver;break;case"destination-over":this.Id=t.BlendMode.DstOver;break;case"copy":this.Id=t.BlendMode.Src;break;case"destination":this.Id=t.BlendMode.Dst;break;case"clear":this.Id=t.BlendMode.Clear;break;case"source-in":this.Id=t.BlendMode.SrcIn;break;case"destination-in":this.Id=t.BlendMode.DstIn;break;case"source-out":this.Id=t.BlendMode.SrcOut;break;case"destination-out":this.Id=t.BlendMode.DstOut;break;case"source-atop":this.Id=t.BlendMode.SrcATop;break;case"destination-atop":this.Id=t.BlendMode.DstATop;break;case"xor":this.Id=t.BlendMode.Xor;break;case"lighter":case"plus-lighter":this.Id=t.BlendMode.Plus;break;case"plus-darker":throw"plus-darker is not supported";case"multiply":this.Id=t.BlendMode.Multiply;break;case"screen":this.Id=t.BlendMode.Screen;break;case"overlay":this.Id=t.BlendMode.Overlay;break;case"darken":this.Id=t.BlendMode.Darken;break;case"lighten":this.Id=t.BlendMode.Lighten;break;case"color-dodge":this.Id=t.BlendMode.ColorDodge;break;case"color-burn":this.Id=t.BlendMode.ColorBurn;break;case"hard-light":this.Id=t.BlendMode.HardLight;break;case"soft-light":this.Id=t.BlendMode.SoftLight;break;case"difference":this.Id=t.BlendMode.Difference;break;case"exclusion":this.Id=t.BlendMode.Exclusion;break;case"hue":this.Id=t.BlendMode.Hue;break;case"saturation":this.Id=t.BlendMode.Saturation;break;case"color":this.Id=t.BlendMode.Color;break;case"luminosity":this.Id=t.BlendMode.Luminosity;break;default:return}this.Jd.setBlendMode(this.Id)}}),Object.defineProperty(this,"imageSmoothingEnabled",{enumerable:!0,get:function(){return!0},set:function(){}}),Object.defineProperty(this,"imageSmoothingQuality",{enumerable:!0,get:function(){return"high"},set:function(){}}),Object.defineProperty(this,"lineCap",{enumerable:!0,get:function(){switch(this.Jd.getStrokeCap()){case t.StrokeCap.Butt:return"butt";case t.StrokeCap.Round:return"round";case t.StrokeCap.Square:return"square"}},set:function(e){switch(e){case"butt":this.Jd.setStrokeCap(t.StrokeCap.Butt);break;case"round":this.Jd.setStrokeCap(t.StrokeCap.Round);break;case"square":this.Jd.setStrokeCap(t.StrokeCap.Square)}}}),Object.defineProperty(this,"lineDashOffset",{enumerable:!0,get:function(){return this.Fe},set:function(t){isFinite(t)&&(this.Fe=t)}}),Object.defineProperty(this,"lineJoin",{enumerable:!0,get:function(){switch(this.Jd.getStrokeJoin()){case t.StrokeJoin.Miter:return"miter";case t.StrokeJoin.Round:return"round";case t.StrokeJoin.Bevel:return"bevel"}},set:function(e){switch(e){case"miter":this.Jd.setStrokeJoin(t.StrokeJoin.Miter);break;case"round":this.Jd.setStrokeJoin(t.StrokeJoin.Round);break;case"bevel":this.Jd.setStrokeJoin(t.StrokeJoin.Bevel)}}}),Object.defineProperty(this,"lineWidth",{enumerable:!0,get:function(){return this.Jd.getStrokeWidth()},set:function(t){0>=t||!t||(this.He=t,this.Jd.setStrokeWidth(t))}}),Object.defineProperty(this,"miterLimit",{enumerable:!0,get:function(){return this.Jd.getStrokeMiter()},set:function(t){0>=t||!t||this.Jd.setStrokeMiter(t)}}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,get:function(){return this.qe},set:function(t){0>t||!isFinite(t)||(this.qe=t)}}),Object.defineProperty(this,"shadowColor",{enumerable:!0,get:function(){return n(this.Ge)},set:function(t){this.Ge=o(t)}}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,get:function(){return this.re},set:function(t){isFinite(t)&&(this.re=t)}}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,get:function(){return this.se},set:function(t){isFinite(t)&&(this.se=t)}}),Object.defineProperty(this,"strokeStyle",{enumerable:!0,get:function(){return n(this.be)},set:function(t){"string"==typeof t?this.be=o(t):t.oe&&(this.be=t)}}),this.arc=function(t,e,n,r,i,o){d(this.Ld,t,e,n,n,0,r,i,o)},this.arcTo=function(t,e,n,r,i){h(this.Ld,t,e,n,r,i)},this.beginPath=function(){this.Ld.delete(),this.Ld=new t.Path},this.bezierCurveTo=function(t,n,r,i,o,a){var s=this.Ld;e([t,n,r,i,o,a])&&(s.isEmpty()&&s.moveTo(t,n),s.cubicTo(t,n,r,i,o,a))},this.clearRect=function(e,n,r,i){this.Jd.setStyle(t.PaintStyle.Fill),this.Jd.setBlendMode(t.BlendMode.Clear),this.Hd.drawRect(t.XYWHRect(e,n,r,i),this.Jd),this.Jd.setBlendMode(this.Id)},this.clip=function(e,n){"string"==typeof e?(n=e,e=this.Ld):e&&e.Ze&&(e=e.Pd),e||(e=this.Ld),e=e.copy(),n&&"evenodd"===n.toLowerCase()?e.setFillType(t.FillType.EvenOdd):e.setFillType(t.FillType.Winding),this.Hd.clipPath(e,t.ClipOp.Intersect,!0),e.delete()},this.closePath=function(){f(this.Ld)},this.createImageData=function(){if(1===arguments.length){var t=arguments[0];return new l(new Uint8ClampedArray(4*t.width*t.height),t.width,t.height)}if(2===arguments.length){t=arguments[0];var e=arguments[1];return new l(new Uint8ClampedArray(4*t*e),t,e)}throw"createImageData expects 1 or 2 arguments, got "+arguments.length},this.createLinearGradient=function(t,n,r,i){if(e(arguments)){var o=new c(t,n,r,i);return this.we.push(o),o}},this.createPattern=function(t,e){return t=new g(t,e),this.we.push(t),t},this.createRadialGradient=function(t,n,r,i,o,a){if(e(arguments)){var s=new _(t,n,r,i,o,a);return this.we.push(s),s}},this.drawImage=function(e){var n=this.Ne();if(3===arguments.length||5===arguments.length)var r=t.XYWHRect(arguments[1],arguments[2],arguments[3]||e.width(),arguments[4]||e.height()),i=t.XYWHRect(0,0,e.width(),e.height());else{if(9!==arguments.length)throw"invalid number of args for drawImage, need 3, 5, or 9; got "+arguments.length;r=t.XYWHRect(arguments[5],arguments[6],arguments[7],arguments[8]),i=t.XYWHRect(arguments[1],arguments[2],arguments[3],arguments[4])}this.Hd.drawImageRect(e,i,r,n,!1),n.dispose()},this.ellipse=function(t,e,n,r,i,o,a,s){d(this.Ld,t,e,n,r,i,o,a,s)},this.Ne=function(){var e=this.Jd.copy();if(e.setStyle(t.PaintStyle.Fill),r(this.Wd)){var n=t.multiplyByAlpha(this.Wd,this.de);e.setColor(n)}else n=this.Wd.oe(this.Nd),e.setColor(t.Color(0,0,0,this.de)),e.setShader(n);return e.dispose=function(){this.delete()},e},this.fill=function(e,n){if("string"==typeof e?(n=e,e=this.Ld):e&&e.Ze&&(e=e.Pd),"evenodd"===n)this.Ld.setFillType(t.FillType.EvenOdd);else{if("nonzero"!==n&&n)throw"invalid fill rule";this.Ld.setFillType(t.FillType.Winding)}e||(e=this.Ld),n=this.Ne();var r=this.te(n);r&&(this.Hd.save(),this.le(),this.Hd.drawPath(e,r),this.Hd.restore(),r.dispose()),this.Hd.drawPath(e,n),n.dispose()},this.fillRect=function(e,n,r,i){var o=this.Ne(),a=this.te(o);a&&(this.Hd.save(),this.le(),this.Hd.drawRect(t.XYWHRect(e,n,r,i),a),this.Hd.restore(),a.dispose()),this.Hd.drawRect(t.XYWHRect(e,n,r,i),o),o.dispose()},this.fillText=function(e,n,r){var i=this.Ne();e=t.TextBlob.MakeFromText(e,this.ne);var o=this.te(i);o&&(this.Hd.save(),this.le(),this.Hd.drawTextBlob(e,n,r,o),this.Hd.restore(),o.dispose()),this.Hd.drawTextBlob(e,n,r,i),e.delete(),i.dispose()},this.getImageData=function(e,n,r,i){return(e=this.Hd.readPixels(e,n,{width:r,height:i,colorType:t.ColorType.RGBA_8888,alphaType:t.AlphaType.Unpremul,colorSpace:t.ColorSpace.SRGB}))?new l(new Uint8ClampedArray(e.buffer),r,i):null},this.getLineDash=function(){return this.pe.slice()},this.lf=function(e){var n=t.Matrix.invert(this.Nd);return t.Matrix.mapPoints(n,e),e},this.isPointInPath=function(e,n,r){var i=arguments;if(3===i.length)var o=this.Ld;else{if(4!==i.length)throw"invalid arg count, need 3 or 4, got "+i.length;o=i[0],e=i[1],n=i[2],r=i[3]}return!(!isFinite(e)||!isFinite(n))&&("nonzero"===(r=r||"nonzero")||"evenodd"===r)&&(e=(i=this.lf([e,n]))[0],n=i[1],o.setFillType("nonzero"===r?t.FillType.Winding:t.FillType.EvenOdd),o.contains(e,n))},this.isPointInStroke=function(e,n){var r=arguments;if(2===r.length)var i=this.Ld;else{if(3!==r.length)throw"invalid arg count, need 2 or 3, got "+r.length;i=r[0],e=r[1],n=r[2]}return!(!isFinite(e)||!isFinite(n))&&(e=(r=this.lf([e,n]))[0],n=r[1],(i=i.copy()).setFillType(t.FillType.Winding),i.stroke({width:this.lineWidth,miter_limit:this.miterLimit,cap:this.Jd.getStrokeCap(),join:this.Jd.getStrokeJoin(),precision:.3}),r=i.contains(e,n),i.delete(),r)},this.lineTo=function(t,e){y(this.Ld,t,e)},this.measureText=function(){throw Error("Clients wishing to properly measure text should use the Paragraph API")},this.moveTo=function(t,n){var r=this.Ld;e([t,n])&&r.moveTo(t,n)},this.putImageData=function(n,r,i,o,a,s,u){if(e([r,i,o,a,s,u]))if(void 0===o)this.Hd.writePixels(n.data,n.width,n.height,r,i);else if(o=o||0,a=a||0,s=s||n.width,u=u||n.height,0>s&&(o+=s,s=Math.abs(s)),0>u&&(a+=u,u=Math.abs(u)),0>o&&(s+=o,o=0),0>a&&(u+=a,a=0),!(0>=s||0>=u)){n=t.MakeImage({width:n.width,height:n.height,alphaType:t.AlphaType.Unpremul,colorType:t.ColorType.RGBA_8888,colorSpace:t.ColorSpace.SRGB},n.data,4*n.width);var l=t.XYWHRect(o,a,s,u);r=t.XYWHRect(r+o,i+a,s,u),i=t.Matrix.invert(this.Nd),this.Hd.save(),this.Hd.concat(i),this.Hd.drawImageRect(n,l,r,null,!1),this.Hd.restore(),n.delete()}},this.quadraticCurveTo=function(t,n,r,i){var o=this.Ld;e([t,n,r,i])&&(o.isEmpty()&&o.moveTo(t,n),o.quadTo(t,n,r,i))},this.rect=function(n,r,i,o){var a=this.Ld;e(n=t.XYWHRect(n,r,i,o))&&a.addRect(n)},this.resetTransform=function(){this.Ld.transform(this.Nd);var e=t.Matrix.invert(this.Nd);this.Hd.concat(e),this.Nd=this.Hd.getTotalMatrix()},this.restore=function(){var e=this.kf.pop();if(e){var n=t.Matrix.multiply(this.Nd,t.Matrix.invert(e.Cf));this.Ld.transform(n),this.Jd.delete(),this.Jd=e.Zf,this.pe=e.Vf,this.He=e.lg,this.be=e.kg,this.Wd=e.fs,this.re=e.ig,this.se=e.jg,this.qe=e.cg,this.Ge=e.hg,this.de=e.Jf,this.Id=e.Kf,this.Fe=e.Wf,this.Oe=e.If,this.Hd.restore(),this.Nd=this.Hd.getTotalMatrix()}},this.rotate=function(e){if(isFinite(e)){var n=t.Matrix.rotated(-e);this.Ld.transform(n),this.Hd.rotate(e/Math.PI*180,0,0),this.Nd=this.Hd.getTotalMatrix()}},this.save=function(){if(this.Wd.me){var t=this.Wd.me();this.we.push(t)}else t=this.Wd;if(this.be.me){var e=this.be.me();this.we.push(e)}else e=this.be;this.kf.push({Cf:this.Nd.slice(),Vf:this.pe.slice(),lg:this.He,kg:e,fs:t,ig:this.re,jg:this.se,cg:this.qe,hg:this.Ge,Jf:this.de,Wf:this.Fe,Kf:this.Id,Zf:this.Jd.copy(),If:this.Oe}),this.Hd.save()},this.scale=function(n,r){if(e(arguments)){var i=t.Matrix.scaled(1/n,1/r);this.Ld.transform(i),this.Hd.scale(n,r),this.Nd=this.Hd.getTotalMatrix()}},this.setLineDash=function(t){for(var e=0;e<t.length;e++)if(!isFinite(t[e])||0>t[e])return;1==t.length%2&&Array.prototype.push.apply(t,t),this.pe=t},this.setTransform=function(t,n,r,i,o,a){e(arguments)&&(this.resetTransform(),this.transform(t,n,r,i,o,a))},this.le=function(){var e=t.Matrix.invert(this.Nd);this.Hd.concat(e),this.Hd.concat(t.Matrix.translated(this.re,this.se)),this.Hd.concat(this.Nd)},this.te=function(e){var n=t.multiplyByAlpha(this.Ge,this.de);if(!t.getColorComponents(n)[3]||!(this.qe||this.se||this.re))return null;(e=e.copy()).setColor(n);var r=t.MaskFilter.MakeBlur(t.BlurStyle.Normal,this.qe/2,!1);return e.setMaskFilter(r),e.dispose=function(){r.delete(),this.delete()},e},this.af=function(){var e=this.Jd.copy();if(e.setStyle(t.PaintStyle.Stroke),r(this.be)){var n=t.multiplyByAlpha(this.be,this.de);e.setColor(n)}else n=this.be.oe(this.Nd),e.setColor(t.Color(0,0,0,this.de)),e.setShader(n);if(e.setStrokeWidth(this.He),this.pe.length){var i=t.PathEffect.MakeDash(this.pe,this.Fe);e.setPathEffect(i)}return e.dispose=function(){i&&i.delete(),this.delete()},e},this.stroke=function(t){t=t?t.Pd:this.Ld;var e=this.af(),n=this.te(e);n&&(this.Hd.save(),this.le(),this.Hd.drawPath(t,n),this.Hd.restore(),n.dispose()),this.Hd.drawPath(t,e),e.dispose()},this.strokeRect=function(e,n,r,i){var o=this.af(),a=this.te(o);a&&(this.Hd.save(),this.le(),this.Hd.drawRect(t.XYWHRect(e,n,r,i),a),this.Hd.restore(),a.dispose()),this.Hd.drawRect(t.XYWHRect(e,n,r,i),o),o.dispose()},this.strokeText=function(e,n,r){var i=this.af();e=t.TextBlob.MakeFromText(e,this.ne);var o=this.te(i);o&&(this.Hd.save(),this.le(),this.Hd.drawTextBlob(e,n,r,o),this.Hd.restore(),o.dispose()),this.Hd.drawTextBlob(e,n,r,i),e.delete(),i.dispose()},this.translate=function(n,r){if(e(arguments)){var i=t.Matrix.translated(-n,-r);this.Ld.transform(i),this.Hd.translate(n,r),this.Nd=this.Hd.getTotalMatrix()}},this.transform=function(e,n,r,i,o,a){e=[e,r,o,n,i,a,0,0,1],n=t.Matrix.invert(e),this.Ld.transform(n),this.Hd.concat(e),this.Nd=this.Hd.getTotalMatrix()},this.addHitRegion=function(){},this.clearHitRegions=function(){},this.drawFocusIfNeeded=function(){},this.removeHitRegion=function(){},this.scrollPathIntoView=function(){},Object.defineProperty(this,"canvas",{value:null,writable:!1})}function u(e){this.bf=e,this.he=new s(e.getCanvas()),this.Pe=[],this.vf=t.FontMgr.RefDefault(),this.decodeImage=function(e){if(!(e=t.MakeImageFromEncoded(e)))throw"Invalid input";return this.Pe.push(e),e},this.loadFont=function(t,e){if(!(t=this.vf.MakeTypefaceFromData(t)))return null;this.Pe.push(t);var n=(e.style||"normal")+"|"+(e.variant||"normal")+"|"+(e.weight||"normal");e=e.family,T[e]||(T[e]={"*":t}),T[e][n]=t},this.makePath2D=function(t){return t=new m(t),this.Pe.push(t.Pd),t},this.getContext=function(t){return"2d"===t?this.he:null},this.toDataURL=function(e,n){this.bf.flush();var r=this.bf.makeImageSnapshot();if(r){e=e||"image/png";var o=t.ImageFormat.PNG;if("image/jpeg"===e&&(o=t.ImageFormat.JPEG),n=r.encodeToBytes(o,n||.92)){if(r.delete(),e="data:"+e+";base64,",Y)n=i.from(n).toString("base64");else{r=0,o=n.length;for(var a,s="";r<o;)a=n.slice(r,Math.min(r+32768,o)),s+=String.fromCharCode.apply(null,a),r+=32768;n=btoa(s)}return e+n}}},this.dispose=function(){this.he.fe(),this.Pe.forEach((function(t){t.delete()})),this.bf.dispose()}}function l(t,e,n){if(!e||0===n)throw"invalid dimensions, width and height must be non-zero";if(t.length%4)throw"arr must be a multiple of 4";n=n||t.length/(4*e),Object.defineProperty(this,"data",{value:t,writable:!1}),Object.defineProperty(this,"height",{value:n,writable:!1}),Object.defineProperty(this,"width",{value:e,writable:!1})}function c(e,n,r,i){this.Rd=null,this.Yd=[],this.Td=[],this.addColorStop=function(t,e){if(0>t||1<t||!isFinite(t))throw"offset must be between 0 and 1 inclusively";e=o(e);var n=this.Td.indexOf(t);if(-1!==n)this.Yd[n]=e;else{for(n=0;n<this.Td.length&&!(this.Td[n]>t);n++);this.Td.splice(n,0,t),this.Yd.splice(n,0,e)}},this.me=function(){var t=new c(e,n,r,i);return t.Yd=this.Yd.slice(),t.Td=this.Td.slice(),t},this.fe=function(){this.Rd&&(this.Rd.delete(),this.Rd=null)},this.oe=function(o){var a=[e,n,r,i];t.Matrix.mapPoints(o,a),o=a[0];var s=a[1],u=a[2];return a=a[3],this.fe(),this.Rd=t.Shader.MakeLinearGradient([o,s],[u,a],this.Yd,this.Td,t.TileMode.Clamp)}}function h(t,n,r,i,o,a){if(e([n,r,i,o,a])){if(0>a)throw"radii cannot be negative";t.isEmpty()&&t.moveTo(n,r),t.arcToTangent(n,r,i,o,a)}}function f(t){if(!t.isEmpty()){var e=t.getBounds();(e[3]-e[1]||e[2]-e[0])&&t.close()}}function p(e,n,r,i,o,a,s){s=(s-a)/Math.PI*180,a=a/Math.PI*180,n=t.LTRBRect(n-i,r-o,n+i,r+o),1e-5>Math.abs(Math.abs(s)-360)?(r=s/2,e.arcToOval(n,a,r,!1),e.arcToOval(n,a+r,r,!1)):e.arcToOval(n,a,s,!1)}function d(n,r,i,o,a,s,u,l,c){if(e([r,i,o,a,s,u,l])){if(0>o||0>a)throw"radii cannot be negative";var h=2*Math.PI,f=u%h;0>f&&(f+=h);var d=f-u;u=f,l+=d,!c&&l-u>=h?l=u+h:c&&u-l>=h?l=u-h:!c&&u>l?l=u+(h-(u-l)%h):c&&u<l&&(l=u-(h-(l-u)%h)),s?(c=t.Matrix.rotated(s,r,i),s=t.Matrix.rotated(-s,r,i),n.transform(s),p(n,r,i,o,a,u,l),n.transform(c)):p(n,r,i,o,a,u,l)}}function y(t,n,r){e([n,r])&&(t.isEmpty()&&t.moveTo(n,r),t.lineTo(n,r))}function m(n){this.Pd=null,this.Pd="string"==typeof n?t.Path.MakeFromSVGString(n):n&&n.Ze?n.Pd.copy():new t.Path,this.Ze=function(){return this.Pd},this.addPath=function(t,e){e||(e={a:1,c:0,e:0,b:0,d:1,f:0}),this.Pd.addPath(t.Pd,[e.a,e.c,e.e,e.b,e.d,e.f])},this.arc=function(t,e,n,r,i,o){d(this.Pd,t,e,n,n,0,r,i,o)},this.arcTo=function(t,e,n,r,i){h(this.Pd,t,e,n,r,i)},this.bezierCurveTo=function(t,n,r,i,o,a){var s=this.Pd;e([t,n,r,i,o,a])&&(s.isEmpty()&&s.moveTo(t,n),s.cubicTo(t,n,r,i,o,a))},this.closePath=function(){f(this.Pd)},this.ellipse=function(t,e,n,r,i,o,a,s){d(this.Pd,t,e,n,r,i,o,a,s)},this.lineTo=function(t,e){y(this.Pd,t,e)},this.moveTo=function(t,n){var r=this.Pd;e([t,n])&&r.moveTo(t,n)},this.quadraticCurveTo=function(t,n,r,i){var o=this.Pd;e([t,n,r,i])&&(o.isEmpty()&&o.moveTo(t,n),o.quadTo(t,n,r,i))},this.rect=function(n,r,i,o){var a=this.Pd;e(n=t.XYWHRect(n,r,i,o))&&a.addRect(n)}}function g(n,r){switch(this.Rd=null,this.xf=n,this._transform=t.Matrix.identity(),""===r&&(r="repeat"),r){case"repeat-x":this.ue=t.TileMode.Repeat,this.ve=t.TileMode.Decal;break;case"repeat-y":this.ue=t.TileMode.Decal,this.ve=t.TileMode.Repeat;break;case"repeat":this.ve=this.ue=t.TileMode.Repeat;break;case"no-repeat":this.ve=this.ue=t.TileMode.Decal;break;default:throw"invalid repetition mode "+r}this.setTransform=function(t){e(t=[t.a,t.c,t.e,t.b,t.d,t.f,0,0,1])&&(this._transform=t)},this.me=function(){var t=new g;return t.ue=this.ue,t.ve=this.ve,t},this.fe=function(){this.Rd&&(this.Rd.delete(),this.Rd=null)},this.oe=function(){return this.fe(),this.Rd=this.xf.makeShaderCubic(this.ue,this.ve,1/3,1/3,this._transform)}}function _(e,n,r,i,a,s){this.Rd=null,this.Yd=[],this.Td=[],this.addColorStop=function(t,e){if(0>t||1<t||!isFinite(t))throw"offset must be between 0 and 1 inclusively";e=o(e);var n=this.Td.indexOf(t);if(-1!==n)this.Yd[n]=e;else{for(n=0;n<this.Td.length&&!(this.Td[n]>t);n++);this.Td.splice(n,0,t),this.Yd.splice(n,0,e)}},this.me=function(){var t=new _(e,n,r,i,a,s);return t.Yd=this.Yd.slice(),t.Td=this.Td.slice(),t},this.fe=function(){this.Rd&&(this.Rd.delete(),this.Rd=null)},this.oe=function(o){var u=[e,n,i,a];t.Matrix.mapPoints(o,u);var l=u[0],c=u[1],h=u[2];u=u[3];var f=(Math.abs(o[0])+Math.abs(o[4]))/2;return o=r*f,f*=s,this.fe(),this.Rd=t.Shader.MakeTwoPointConicalGradient([l,c],o,[h,u],f,this.Yd,this.Td,t.TileMode.Clamp)}}t._testing={};var b={aliceblue:Float32Array.of(.941,.973,1,1),antiquewhite:Float32Array.of(.98,.922,.843,1),aqua:Float32Array.of(0,1,1,1),aquamarine:Float32Array.of(.498,1,.831,1),azure:Float32Array.of(.941,1,1,1),beige:Float32Array.of(.961,.961,.863,1),bisque:Float32Array.of(1,.894,.769,1),black:Float32Array.of(0,0,0,1),blanchedalmond:Float32Array.of(1,.922,.804,1),blue:Float32Array.of(0,0,1,1),blueviolet:Float32Array.of(.541,.169,.886,1),brown:Float32Array.of(.647,.165,.165,1),burlywood:Float32Array.of(.871,.722,.529,1),cadetblue:Float32Array.of(.373,.62,.627,1),chartreuse:Float32Array.of(.498,1,0,1),chocolate:Float32Array.of(.824,.412,.118,1),coral:Float32Array.of(1,.498,.314,1),cornflowerblue:Float32Array.of(.392,.584,.929,1),cornsilk:Float32Array.of(1,.973,.863,1),crimson:Float32Array.of(.863,.078,.235,1),cyan:Float32Array.of(0,1,1,1),darkblue:Float32Array.of(0,0,.545,1),darkcyan:Float32Array.of(0,.545,.545,1),darkgoldenrod:Float32Array.of(.722,.525,.043,1),darkgray:Float32Array.of(.663,.663,.663,1),darkgreen:Float32Array.of(0,.392,0,1),darkgrey:Float32Array.of(.663,.663,.663,1),darkkhaki:Float32Array.of(.741,.718,.42,1),darkmagenta:Float32Array.of(.545,0,.545,1),darkolivegreen:Float32Array.of(.333,.42,.184,1),darkorange:Float32Array.of(1,.549,0,1),darkorchid:Float32Array.of(.6,.196,.8,1),darkred:Float32Array.of(.545,0,0,1),darksalmon:Float32Array.of(.914,.588,.478,1),darkseagreen:Float32Array.of(.561,.737,.561,1),darkslateblue:Float32Array.of(.282,.239,.545,1),darkslategray:Float32Array.of(.184,.31,.31,1),darkslategrey:Float32Array.of(.184,.31,.31,1),darkturquoise:Float32Array.of(0,.808,.82,1),darkviolet:Float32Array.of(.58,0,.827,1),deeppink:Float32Array.of(1,.078,.576,1),deepskyblue:Float32Array.of(0,.749,1,1),dimgray:Float32Array.of(.412,.412,.412,1),dimgrey:Float32Array.of(.412,.412,.412,1),dodgerblue:Float32Array.of(.118,.565,1,1),firebrick:Float32Array.of(.698,.133,.133,1),floralwhite:Float32Array.of(1,.98,.941,1),forestgreen:Float32Array.of(.133,.545,.133,1),fuchsia:Float32Array.of(1,0,1,1),gainsboro:Float32Array.of(.863,.863,.863,1),ghostwhite:Float32Array.of(.973,.973,1,1),gold:Float32Array.of(1,.843,0,1),goldenrod:Float32Array.of(.855,.647,.125,1),gray:Float32Array.of(.502,.502,.502,1),green:Float32Array.of(0,.502,0,1),greenyellow:Float32Array.of(.678,1,.184,1),grey:Float32Array.of(.502,.502,.502,1),honeydew:Float32Array.of(.941,1,.941,1),hotpink:Float32Array.of(1,.412,.706,1),indianred:Float32Array.of(.804,.361,.361,1),indigo:Float32Array.of(.294,0,.51,1),ivory:Float32Array.of(1,1,.941,1),khaki:Float32Array.of(.941,.902,.549,1),lavender:Float32Array.of(.902,.902,.98,1),lavenderblush:Float32Array.of(1,.941,.961,1),lawngreen:Float32Array.of(.486,.988,0,1),lemonchiffon:Float32Array.of(1,.98,.804,1),lightblue:Float32Array.of(.678,.847,.902,1),lightcoral:Float32Array.of(.941,.502,.502,1),lightcyan:Float32Array.of(.878,1,1,1),lightgoldenrodyellow:Float32Array.of(.98,.98,.824,1),lightgray:Float32Array.of(.827,.827,.827,1),lightgreen:Float32Array.of(.565,.933,.565,1),lightgrey:Float32Array.of(.827,.827,.827,1),lightpink:Float32Array.of(1,.714,.757,1),lightsalmon:Float32Array.of(1,.627,.478,1),lightseagreen:Float32Array.of(.125,.698,.667,1),lightskyblue:Float32Array.of(.529,.808,.98,1),lightslategray:Float32Array.of(.467,.533,.6,1),lightslategrey:Float32Array.of(.467,.533,.6,1),lightsteelblue:Float32Array.of(.69,.769,.871,1),lightyellow:Float32Array.of(1,1,.878,1),lime:Float32Array.of(0,1,0,1),limegreen:Float32Array.of(.196,.804,.196,1),linen:Float32Array.of(.98,.941,.902,1),magenta:Float32Array.of(1,0,1,1),maroon:Float32Array.of(.502,0,0,1),mediumaquamarine:Float32Array.of(.4,.804,.667,1),mediumblue:Float32Array.of(0,0,.804,1),mediumorchid:Float32Array.of(.729,.333,.827,1),mediumpurple:Float32Array.of(.576,.439,.859,1),mediumseagreen:Float32Array.of(.235,.702,.443,1),mediumslateblue:Float32Array.of(.482,.408,.933,1),mediumspringgreen:Float32Array.of(0,.98,.604,1),mediumturquoise:Float32Array.of(.282,.82,.8,1),mediumvioletred:Float32Array.of(.78,.082,.522,1),midnightblue:Float32Array.of(.098,.098,.439,1),mintcream:Float32Array.of(.961,1,.98,1),mistyrose:Float32Array.of(1,.894,.882,1),moccasin:Float32Array.of(1,.894,.71,1),navajowhite:Float32Array.of(1,.871,.678,1),navy:Float32Array.of(0,0,.502,1),oldlace:Float32Array.of(.992,.961,.902,1),olive:Float32Array.of(.502,.502,0,1),olivedrab:Float32Array.of(.42,.557,.137,1),orange:Float32Array.of(1,.647,0,1),orangered:Float32Array.of(1,.271,0,1),orchid:Float32Array.of(.855,.439,.839,1),palegoldenrod:Float32Array.of(.933,.91,.667,1),palegreen:Float32Array.of(.596,.984,.596,1),paleturquoise:Float32Array.of(.686,.933,.933,1),palevioletred:Float32Array.of(.859,.439,.576,1),papayawhip:Float32Array.of(1,.937,.835,1),peachpuff:Float32Array.of(1,.855,.725,1),peru:Float32Array.of(.804,.522,.247,1),pink:Float32Array.of(1,.753,.796,1),plum:Float32Array.of(.867,.627,.867,1),powderblue:Float32Array.of(.69,.878,.902,1),purple:Float32Array.of(.502,0,.502,1),rebeccapurple:Float32Array.of(.4,.2,.6,1),red:Float32Array.of(1,0,0,1),rosybrown:Float32Array.of(.737,.561,.561,1),royalblue:Float32Array.of(.255,.412,.882,1),saddlebrown:Float32Array.of(.545,.271,.075,1),salmon:Float32Array.of(.98,.502,.447,1),sandybrown:Float32Array.of(.957,.643,.376,1),seagreen:Float32Array.of(.18,.545,.341,1),seashell:Float32Array.of(1,.961,.933,1),sienna:Float32Array.of(.627,.322,.176,1),silver:Float32Array.of(.753,.753,.753,1),skyblue:Float32Array.of(.529,.808,.922,1),slateblue:Float32Array.of(.416,.353,.804,1),slategray:Float32Array.of(.439,.502,.565,1),slategrey:Float32Array.of(.439,.502,.565,1),snow:Float32Array.of(1,.98,.98,1),springgreen:Float32Array.of(0,1,.498,1),steelblue:Float32Array.of(.275,.51,.706,1),tan:Float32Array.of(.824,.706,.549,1),teal:Float32Array.of(0,.502,.502,1),thistle:Float32Array.of(.847,.749,.847,1),tomato:Float32Array.of(1,.388,.278,1),transparent:Float32Array.of(0,0,0,0),turquoise:Float32Array.of(.251,.878,.816,1),violet:Float32Array.of(.933,.51,.933,1),wheat:Float32Array.of(.961,.871,.702,1),white:Float32Array.of(1,1,1,1),whitesmoke:Float32Array.of(.961,.961,.961,1),yellow:Float32Array.of(1,1,0,1),yellowgreen:Float32Array.of(.604,.804,.196,1)};t._testing.parseColor=o,t._testing.colorToString=n;var v=/(italic|oblique|normal|)\s*(small-caps|normal|)\s*(bold|bolder|lighter|[1-9]00|normal|)\s*([\d\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q)(.+)/,T={"Noto Mono":{"*":null},monospace:{"*":null}};t._testing.parseFontString=a,t.MakeCanvas=function(e,n){return(e=t.MakeSurface(e,n))?new u(e):null},t.ImageData=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new l(new Uint8ClampedArray(4*t*e),t,e)}if(3===arguments.length){var n=arguments[0];if(n.prototype.constructor!==Uint8ClampedArray)throw"bytes must be given as a Uint8ClampedArray";if(n%4)throw"bytes must be given in a multiple of 4";if(n%(t=arguments[1]))throw"bytes must divide evenly by width";if((e=arguments[2])&&e!==n/(4*t))throw"invalid height given";return new l(n,t,n/(4*t))}throw"invalid number of arguments - takes 2 or 3, saw "+arguments.length}}()}(e);var c,h={};for(c in e)e.hasOwnProperty(c)&&(h[c]=e[c]);var f,p,d,y,m="./this.program";function g(t,e){throw e}f="object"==typeof window,p="function"==typeof importScripts,d="object"==typeof o&&"object"==typeof o.versions&&"string"==typeof o.versions.node,y=!f&&!d&&!p;var _,b,v,T,E,w="";d?(w=p?n(3935).dirname(w)+"/":"//",_=function(t,e){return T||(T=n(5699)),E||(E=n(3935)),t=E.normalize(t),T.readFileSync(t,e?null:"utf8")},v=function(t){return(t=_(t,!0)).buffer||(t=new Uint8Array(t)),I(t.buffer),t},1<o.argv.length&&(m=o.argv[1].replace(/\\/g,"/")),o.argv.slice(2),o.on("uncaughtException",(function(t){if(!(t instanceof xn))throw t})),o.on("unhandledRejection",ut),g=function(t){o.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):y?("undefined"!=typeof read&&(_=function(t){return read(t)}),v=function(t){return"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(I("object"==typeof(t=read(t,"binary"))),t)},"function"==typeof quit&&(g=function(t){quit(t)}),"undefined"!=typeof print&&(void 0===a&&(a={}),a.log=print,a.warn=a.error="undefined"!=typeof printErr?printErr:print)):(f||p)&&(p?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),r&&(w=r),w=0!==w.indexOf("blob:")?w.substr(0,w.lastIndexOf("/")+1):"",_=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},p&&(v=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),b=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var x=e.print||a.log.bind(a),C=e.printErr||a.warn.bind(a);for(c in h)h.hasOwnProperty(c)&&(e[c]=h[c]);h=null,e.thisProgram&&(m=e.thisProgram),e.quit&&(g=e.quit);var M,S=0;e.wasmBinary&&(M=e.wasmBinary);var N=e.noExitRuntime||!0;"object"!=typeof WebAssembly&&ut("no native wasm support detected");var O,A=!1;function I(t,e){t||ut("Assertion failed: "+e)}var P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=e+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.subarray&&P)return P.decode(t.subarray(e,n));for(r="";e<n;){var i=t[e++];if(128&i){var o=63&t[e++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|o);else{var a=63&t[e++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function L(t,e){return t?R(B,t,e):""}function D(t,e,n,r){if(!(0<r))return 0;var i=n;r=n+r-1;for(var o=0;o<t.length;++o){var a=t.charCodeAt(o);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++]=a}else{if(2047>=a){if(n+1>=r)break;e[n++]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++]=224|a>>12}else{if(n+3>=r)break;e[n++]=240|a>>18,e[n++]=128|a>>12&63}e[n++]=128|a>>6&63}e[n++]=128|63&a}}return e[n]=0,n-i}function k(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++n)),127>=r?++e:e=2047>=r?e+2:65535>=r?e+3:e+4}return e}var F,U,B,j,G,W,q,H,z,V="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function X(t,e){for(var n=t>>1,r=n+e/2;!(n>=r)&&G[n];)++n;if(32<(n<<=1)-t&&V)return V.decode(B.subarray(t,n));for(n="",r=0;!(r>=e/2);++r){var i=j[t+2*r>>1];if(0==i)break;n+=String.fromCharCode(i)}return n}function Y(t,e,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=e;n=(n-=2)<2*t.length?n/2:t.length;for(var i=0;i<n;++i)j[e>>1]=t.charCodeAt(i),e+=2;return j[e>>1]=0,e-r}function Z(t){return 2*t.length}function Q(t,e){for(var n=0,r="";!(n>=e/4);){var i=W[t+4*n>>2];if(0==i)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r}function K(t,e,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=e;n=r+n-4;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),W[e>>2]=o,(e+=4)+4>n)break}return W[e>>2]=0,e-r}function J(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&++n,e+=4}return e}function $(){var t=O.buffer;F=t,e.HEAP8=U=new Int8Array(t),e.HEAP16=j=new Int16Array(t),e.HEAP32=W=new Int32Array(t),e.HEAPU8=B=new Uint8Array(t),e.HEAPU16=G=new Uint16Array(t),e.HEAPU32=q=new Uint32Array(t),e.HEAPF32=H=new Float32Array(t),e.HEAPF64=z=new Float64Array(t)}var tt,et=[],nt=[],rt=[];function it(){var t=e.preRun.shift();et.unshift(t)}var ot=0,at=null,st=null;function ut(t){throw e.onAbort&&e.onAbort(t),C(t),A=!0,t=new WebAssembly.RuntimeError("abort("+t+"). Build with -s ASSERTIONS=1 for more info."),u(t),t}function lt(){return ct.startsWith("data:application/octet-stream;base64,")}e.preloadedImages={},e.preloadedAudios={};var ct="canvaskit.wasm";if(!lt()){var ht=ct;ct=e.locateFile?e.locateFile(ht,w):w+ht}function ft(){var t=ct;try{if(t==ct&&M)return new Uint8Array(M);if(v)return v(t);throw"both async and sync fetching of the wasm failed"}catch(t){ut(t)}}function pt(t){for(;0<t.length;){var n=t.shift();if("function"==typeof n)n(e);else{var r=n.sg;"number"==typeof r?void 0===n.cf?tt.get(r)():tt.get(r)(n.cf):r(void 0===n.cf?null:n.cf)}}}var dt={},yt=[null,[],[]],mt={},gt={};function _t(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function bt(t){return this.fromWireType(q[t>>2])}var vt={},Tt={},Et={};function wt(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+t:t}function xt(t,e){return t=wt(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function Ct(t){var e=Error,n=xt(t,(function(e){this.name=t,this.message=e,void 0!==(e=Error(e).stack)&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var Mt=void 0;function St(t){throw new Mt(t)}function Nt(t,e,n){function r(e){(e=n(e)).length!==t.length&&St("Mismatched type converter count");for(var r=0;r<t.length;++r)Lt(t[r],e[r])}t.forEach((function(t){Et[t]=e}));var i=Array(e.length),o=[],a=0;e.forEach((function(t,e){Tt.hasOwnProperty(t)?i[e]=Tt[t]:(o.push(t),vt.hasOwnProperty(t)||(vt[t]=[]),vt[t].push((function(){i[e]=Tt[t],++a===o.length&&r(i)})))})),0===o.length&&r(i)}function Ot(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var At=void 0;function It(t){for(var e="";B[t];)e+=At[B[t++]];return e}var Pt=void 0;function Rt(t){throw new Pt(t)}function Lt(t,e,n){if(n=n||{},!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=e.name;if(t||Rt('type "'+r+'" must have a positive integer typeid pointer'),Tt.hasOwnProperty(t)){if(n.Sf)return;Rt("Cannot register type '"+r+"' twice")}Tt[t]=e,delete Et[t],vt.hasOwnProperty(t)&&(e=vt[t],delete vt[t],e.forEach((function(t){t()})))}function Dt(t){Rt(t.Gd.Qd.Kd.name+" instance already deleted")}var kt=!1;function Ft(){}function Ut(t){--t.count.value,0===t.count.value&&(t.Xd?t.ae.ee(t.Xd):t.Qd.Kd.ee(t.Md))}function Bt(t){return"undefined"==typeof FinalizationGroup?(Bt=function(t){return t},t):(kt=new FinalizationGroup((function(t){for(var e=t.next();!e.done;e=t.next())(e=e.value).Md?Ut(e):a.warn("object already deleted: "+e.Md)})),Ft=function(t){kt.unregister(t.Gd)},(Bt=function(t){return kt.register(t,t.Gd,t.Gd),t})(t))}var jt=void 0,Gt=[];function Wt(){for(;Gt.length;){var t=Gt.pop();t.Gd.ze=!1,t.delete()}}function qt(){}var Ht={};function zt(t,e,n){if(void 0===t[e].Sd){var r=t[e];t[e]=function(){return t[e].Sd.hasOwnProperty(arguments.length)||Rt("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].Sd+")!"),t[e].Sd[arguments.length].apply(this,arguments)},t[e].Sd=[],t[e].Sd[r.xe]=r}}function Vt(t,n,r){e.hasOwnProperty(t)?((void 0===r||void 0!==e[t].Sd&&void 0!==e[t].Sd[r])&&Rt("Cannot register public name '"+t+"' twice"),zt(e,t,t),e.hasOwnProperty(r)&&Rt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),e[t].Sd[r]=n):(e[t]=n,void 0!==r&&(e[t].ug=r))}function Xt(t,e,n,r,i,o,a,s){this.name=t,this.constructor=e,this.Ae=n,this.ee=r,this.ce=i,this.Lf=o,this.Me=a,this.Ff=s,this.ag=[]}function Yt(t,e,n){for(;e!==n;)e.Me||Rt("Expected null or instance of "+n.name+", got an instance of "+e.name),t=e.Me(t),e=e.ce;return t}function Zt(t,e){return null===e?(this.ef&&Rt("null is not a valid "+this.name),0):(e.Gd||Rt('Cannot pass "'+me(e)+'" as a '+this.name),e.Gd.Md||Rt("Cannot pass deleted object as a pointer of type "+this.name),Yt(e.Gd.Md,e.Gd.Qd.Kd,this.Kd))}function Qt(t,e){if(null===e){if(this.ef&&Rt("null is not a valid "+this.name),this.Re){var n=this.ff();return null!==t&&t.push(this.ee,n),n}return 0}if(e.Gd||Rt('Cannot pass "'+me(e)+'" as a '+this.name),e.Gd.Md||Rt("Cannot pass deleted object as a pointer of type "+this.name),!this.Qe&&e.Gd.Qd.Qe&&Rt("Cannot convert argument of type "+(e.Gd.ae?e.Gd.ae.name:e.Gd.Qd.name)+" to parameter type "+this.name),n=Yt(e.Gd.Md,e.Gd.Qd.Kd,this.Kd),this.Re)switch(void 0===e.Gd.Xd&&Rt("Passing raw pointer to smart pointer is illegal"),this.gg){case 0:e.Gd.ae===this?n=e.Gd.Xd:Rt("Cannot convert argument of type "+(e.Gd.ae?e.Gd.ae.name:e.Gd.Qd.name)+" to parameter type "+this.name);break;case 1:n=e.Gd.Xd;break;case 2:if(e.Gd.ae===this)n=e.Gd.Xd;else{var r=e.clone();n=this.bg(n,pe((function(){r.delete()}))),null!==t&&t.push(this.ee,n)}break;default:Rt("Unsupporting sharing policy")}return n}function Kt(t,e){return null===e?(this.ef&&Rt("null is not a valid "+this.name),0):(e.Gd||Rt('Cannot pass "'+me(e)+'" as a '+this.name),e.Gd.Md||Rt("Cannot pass deleted object as a pointer of type "+this.name),e.Gd.Qd.Qe&&Rt("Cannot convert argument of type "+e.Gd.Qd.name+" to parameter type "+this.name),Yt(e.Gd.Md,e.Gd.Qd.Kd,this.Kd))}function Jt(t,e,n){return e===n?t:void 0===n.ce||null===(t=Jt(t,e,n.ce))?null:n.Ff(t)}var $t={};function te(t,e){return e.Qd&&e.Md||St("makeClassHandle requires ptr and ptrType"),!!e.ae!=!!e.Xd&&St("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Bt(Object.create(t,{Gd:{value:e}}))}function ee(t,e,n,r,i,o,a,s,u,l,c){this.name=t,this.Kd=e,this.ef=n,this.Qe=r,this.Re=i,this.$f=o,this.gg=a,this.tf=s,this.ff=u,this.bg=l,this.ee=c,i||void 0!==e.ce?this.toWireType=Qt:(this.toWireType=r?Zt:Kt,this.$d=null)}function ne(t,n,r){e.hasOwnProperty(t)||St("Replacing nonexistant public symbol"),void 0!==e[t].Sd&&void 0!==r?e[t].Sd[r]=n:(e[t]=n,e[t].xe=r)}function re(t,n){var r=(t=It(t)).includes("j")?function(t,n){var r=[];return function(){r.length=arguments.length;for(var i=0;i<arguments.length;i++)r[i]=arguments[i];return t.includes("j")?(i=e["dynCall_"+t],i=r&&r.length?i.apply(null,[n].concat(r)):i.call(null,n)):i=tt.get(n).apply(null,r),i}}(t,n):tt.get(n);return"function"!=typeof r&&Rt("unknown function pointer with signature "+t+": "+n),r}var ie=void 0;function oe(t){var e=It(t=_n(t));return mn(t),e}function ae(t,e){var n=[],r={};throw e.forEach((function t(e){r[e]||Tt[e]||(Et[e]?Et[e].forEach(t):(n.push(e),r[e]=!0))})),new ie(t+": "+n.map(oe).join([", "]))}function se(t){var e=Function;if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=xt(e.name||"unknownFunctionName",(function(){}));return n.prototype=e.prototype,n=new n,(t=e.apply(n,t))instanceof Object?t:n}function ue(t,e,n,r,i){var o=e.length;2>o&&Rt("argTypes array size mismatch! Must at least get return value and 'this' types!");var a=null!==e[1]&&null!==n,s=!1;for(n=1;n<e.length;++n)if(null!==e[n]&&void 0===e[n].$d){s=!0;break}var u="void"!==e[0].name,l="",c="";for(n=0;n<o-2;++n)l+=(0!==n?", ":"")+"arg"+n,c+=(0!==n?", ":"")+"arg"+n+"Wired";t="return function "+wt(t)+"("+l+") {\nif (arguments.length !== "+(o-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(o-2)+" args!');\n}\n",s&&(t+="var destructors = [];\n");var h=s?"destructors":"null";for(l="throwBindingError invoker fn runDestructors retType classParam".split(" "),r=[Rt,r,i,_t,e[0],e[1]],a&&(t+="var thisWired = classParam.toWireType("+h+", this);\n"),n=0;n<o-2;++n)t+="var arg"+n+"Wired = argType"+n+".toWireType("+h+", arg"+n+"); // "+e[n+2].name+"\n",l.push("argType"+n),r.push(e[n+2]);if(a&&(c="thisWired"+(0<c.length?", ":"")+c),t+=(u?"var rv = ":"")+"invoker(fn"+(0<c.length?", ":"")+c+");\n",s)t+="runDestructors(destructors);\n";else for(n=a?1:2;n<e.length;++n)o=1===n?"thisWired":"arg"+(n-2)+"Wired",null!==e[n].$d&&(t+=o+"_dtor("+o+"); // "+e[n].name+"\n",l.push(o+"_dtor"),r.push(e[n].$d));return u&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),l.push(t+"}\n"),se(l).apply(null,r)}function le(t,e){for(var n=[],r=0;r<t;r++)n.push(W[(e>>2)+r]);return n}var ce=[],he=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function fe(t){4<t&&0==--he[t].gf&&(he[t]=void 0,ce.push(t))}function pe(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=ce.length?ce.pop():he.length;return he[e]={gf:1,value:t},e}}function de(t,e,n){switch(e){case 0:return function(t){return this.fromWireType((n?U:B)[t])};case 1:return function(t){return this.fromWireType((n?j:G)[t>>1])};case 2:return function(t){return this.fromWireType((n?W:q)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function ye(t,e){var n=Tt[t];return void 0===n&&Rt(e+" has unknown type "+oe(t)),n}function me(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function ge(t,e){switch(e){case 2:return function(t){return this.fromWireType(H[t>>2])};case 3:return function(t){return this.fromWireType(z[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function _e(t,e,n){switch(e){case 0:return n?function(t){return U[t]}:function(t){return B[t]};case 1:return n?function(t){return j[t>>1]}:function(t){return G[t>>1]};case 2:return n?function(t){return W[t>>2]}:function(t){return q[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var be={};function ve(t){var e=be[t];return void 0===e?It(t):e}var Te,Ee=[];function we(t){return t||Rt("Cannot use deleted val. handle = "+t),he[t].value}Te=d?function(){var t=o.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var xe=1,Ce=[],Me=[],Se=[],Ne=[],Oe=[],Ae=[],Ie=[],Pe=[],Re=[],Le=[],De={},ke={},Fe=4;function Ue(t){Ge||(Ge=t)}function Be(t){for(var e=xe++,n=t.length;n<e;n++)t[n]=null;return e}function je(t){return We=Pe[t],e.rg=ln=We&&We.Ce,!(t&&!ln)}var Ge,We,qe=[];function He(t,e,n,r){for(var i=0;i<t;i++){var o=ln[n](),a=o&&Be(r);o?(o.name=a,r[a]=o):Ue(1282),W[e+4*i>>2]=a}}function ze(t,e){if(e){var n=void 0;switch(t){case 36346:n=1;break;case 36344:return;case 34814:case 36345:n=0;break;case 34466:var r=ln.getParameter(34467);n=r?r.length:0;break;case 33309:if(2>We.version)return void Ue(1282);n=2*(ln.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>We.version)return void Ue(1280);n=33307==t?3:0}if(void 0===n)switch(r=ln.getParameter(t),typeof r){case"number":n=r;break;case"boolean":n=r?1:0;break;case"string":return void Ue(1280);case"object":if(null===r)switch(t){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Ue(1280)}else{if(r instanceof Float32Array||r instanceof Uint32Array||r instanceof Int32Array||r instanceof Array){for(t=0;t<r.length;++t)W[e+4*t>>2]=r[t];return}try{n=0|r.name}catch(e){return Ue(1280),void C("GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter("+t+")! (error: "+e+")")}}break;default:return Ue(1280),void C("GL_INVALID_ENUM in glGet0v: Native code calling glGet0v("+t+") and it returns "+r+" of type "+typeof r+"!")}W[e>>2]=n}else Ue(1281)}function Ve(t){var e=k(t)+1,n=gn(e);return D(t,B,n,e),n}function Xe(t){return 0==(t-=5120)?U:1==t?B:2==t?j:4==t?W:6==t?H:5==t||28922==t||28520==t||30779==t||30782==t?q:G}function Ye(t,e,n,r,i){t=Xe(t);var o=31-Math.clz32(t.BYTES_PER_ELEMENT),a=Fe;return t.subarray(i>>o,i+r*(n*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1)*(1<<o)+a-1&-a)>>o)}function Ze(t){var e=ln.Df,n=e.Ye[t];return 0<=n&&(e.Ye[t]=n=ln.getUniformLocation(e,e.uf[t]+(0<n?"["+n+"]":""))),n}var Qe,Ke=[],Je=[],$e={};function tn(){if(!Qe){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in $e)e[t]=$e[t];var n=[];for(t in e)n.push(t+"="+e[t]);Qe=n}return Qe}function en(t){return 0==t%4&&(0!=t%100||0==t%400)}function nn(t,e){for(var n=0,r=0;r<=e;n+=t[r++]);return n}var rn=[31,29,31,30,31,30,31,31,30,31,30,31],on=[31,28,31,30,31,30,31,31,30,31,30,31];function an(t,e){for(t=new Date(t.getTime());0<e;){var n=t.getMonth(),r=(en(t.getFullYear())?rn:on)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}Mt=e.InternalError=Ct("InternalError");for(var sn=Array(256),un=0;256>un;++un)sn[un]=String.fromCharCode(un);At=sn,Pt=e.BindingError=Ct("BindingError"),qt.prototype.isAliasOf=function(t){if(!(this instanceof qt&&t instanceof qt))return!1;var e=this.Gd.Qd.Kd,n=this.Gd.Md,r=t.Gd.Qd.Kd;for(t=t.Gd.Md;e.ce;)n=e.Me(n),e=e.ce;for(;r.ce;)t=r.Me(t),r=r.ce;return e===r&&n===t},qt.prototype.clone=function(){if(this.Gd.Md||Dt(this),this.Gd.Ke)return this.Gd.count.value+=1,this;var t=Bt,e=Object,n=e.create,r=Object.getPrototypeOf(this),i=this.Gd;return(t=t(n.call(e,r,{Gd:{value:{count:i.count,ze:i.ze,Ke:i.Ke,Md:i.Md,Qd:i.Qd,Xd:i.Xd,ae:i.ae}}}))).Gd.count.value+=1,t.Gd.ze=!1,t},qt.prototype.delete=function(){this.Gd.Md||Dt(this),this.Gd.ze&&!this.Gd.Ke&&Rt("Object already scheduled for deletion"),Ft(this),Ut(this.Gd),this.Gd.Ke||(this.Gd.Xd=void 0,this.Gd.Md=void 0)},qt.prototype.isDeleted=function(){return!this.Gd.Md},qt.prototype.deleteLater=function(){return this.Gd.Md||Dt(this),this.Gd.ze&&!this.Gd.Ke&&Rt("Object already scheduled for deletion"),Gt.push(this),1===Gt.length&&jt&&jt(Wt),this.Gd.ze=!0,this},ee.prototype.Mf=function(t){return this.tf&&(t=this.tf(t)),t},ee.prototype.mf=function(t){this.ee&&this.ee(t)},ee.prototype.argPackAdvance=8,ee.prototype.readValueFromPointer=bt,ee.prototype.deleteObject=function(t){null!==t&&t.delete()},ee.prototype.fromWireType=function(t){function e(){return this.Re?te(this.Kd.Ae,{Qd:this.$f,Md:n,ae:this,Xd:t}):te(this.Kd.Ae,{Qd:this,Md:t})}var n=this.Mf(t);if(!n)return this.mf(t),null;var r=function(t,e){for(void 0===e&&Rt("ptr should not be undefined");t.ce;)e=t.Me(e),t=t.ce;return $t[e]}(this.Kd,n);if(void 0!==r)return 0===r.Gd.count.value?(r.Gd.Md=n,r.Gd.Xd=t,r.clone()):(r=r.clone(),this.mf(t),r);if(r=this.Kd.Lf(n),!(r=Ht[r]))return e.call(this);r=this.Qe?r.Bf:r.pointerType;var i=Jt(n,this.Kd,r.Kd);return null===i?e.call(this):this.Re?te(r.Kd.Ae,{Qd:r,Md:i,ae:this,Xd:t}):te(r.Kd.Ae,{Qd:r,Md:i})},e.getInheritedInstanceCount=function(){return Object.keys($t).length},e.getLiveInheritedInstances=function(){var t,e=[];for(t in $t)$t.hasOwnProperty(t)&&e.push($t[t]);return e},e.flushPendingDeletes=Wt,e.setDelayFunction=function(t){jt=t,Gt.length&&jt&&jt(Wt)},ie=e.UnboundTypeError=Ct("UnboundTypeError"),e.count_emval_handles=function(){for(var t=0,e=5;e<he.length;++e)void 0!==he[e]&&++t;return t},e.get_first_emval=function(){for(var t=5;t<he.length;++t)if(void 0!==he[t])return he[t];return null};for(var ln,cn=0;32>cn;++cn)qe.push(Array(cn));var hn=new Float32Array(288);for(cn=0;288>cn;++cn)Ke[cn]=hn.subarray(0,cn+1);var fn=new Int32Array(288);for(cn=0;288>cn;++cn)Je[cn]=fn.subarray(0,cn+1);var pn={F:function(){return 0},xb:function(){},zb:function(){return 0},vb:function(t,e,n,r,i,o){return o<<=12,0!=(16&r)&&0!=t%65536?e=-28:0!=(32&r)?(t=wn(65536,e))?(dn(t,0,e),dt[t]={Yf:t,Xf:e,Af:!0,fd:i,vg:n,flags:r,offset:o},e=t):e=-48:e=-52,e},ub:function(t,e){if(-1==(0|t)||0===e)t=-28;else{var n=dt[t];n&&e===n.Xf&&(dt[t]=null,n.Af&&mn(n.Yf)),t=0}return t},Bb:function(){},wb:function(){},E:function(t){var e=gt[t];delete gt[t];var n=e.ff,r=e.ee,i=e.qf;Nt([t],i.map((function(t){return t.Qf})).concat(i.map((function(t){return t.eg}))),(function(t){var o={};return i.forEach((function(e,n){var r=t[n],a=e.Of,s=e.Pf,u=t[n+i.length],l=e.dg,c=e.fg;o[e.Hf]={read:function(t){return r.fromWireType(a(s,t))},write:function(t,e){var n=[];l(c,t,u.toWireType(n,e)),_t(n)}}})),[{name:e.name,fromWireType:function(t){var e,n={};for(e in o)n[e]=o[e].read(t);return r(t),n},toWireType:function(t,e){for(var i in o)if(!(i in e))throw new TypeError('Missing field: "'+i+'"');var a=n();for(i in o)o[i].write(a,e[i]);return null!==t&&t.push(r,a),a},argPackAdvance:8,readValueFromPointer:bt,$d:r}]}))},nb:function(){},Db:function(t,e,n,r,i){var o=Ot(n);Lt(t,{name:e=It(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===n)var r=U;else if(2===n)r=j;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+e);r=W}return this.fromWireType(r[t>>o])},$d:null})},k:function(t,e,n,r,i,o,a,s,u,l,c,h,f){c=It(c),o=re(i,o),s&&(s=re(a,s)),l&&(l=re(u,l)),f=re(h,f);var p=wt(c);Vt(p,(function(){ae("Cannot construct "+c+" due to unbound types",[r])})),Nt([t,e,n],r?[r]:[],(function(e){if(e=e[0],r)var n=e.Kd,i=n.Ae;else i=qt.prototype;e=xt(p,(function(){if(Object.getPrototypeOf(this)!==a)throw new Pt("Use 'new' to construct "+c);if(void 0===u.ie)throw new Pt(c+" has no accessible constructor");var t=u.ie[arguments.length];if(void 0===t)throw new Pt("Tried to invoke ctor of "+c+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.ie).toString()+") parameters instead!");return t.apply(this,arguments)}));var a=Object.create(i,{constructor:{value:e}});e.prototype=a;var u=new Xt(c,e,a,f,n,o,s,l);n=new ee(c,u,!0,!1,!1),i=new ee(c+"*",u,!1,!1,!1);var h=new ee(c+" const*",u,!1,!0,!1);return Ht[t]={pointerType:i,Bf:h},ne(p,e),[n,i,h]}))},f:function(t,e,n,r,i,o,a){var s=le(n,r);e=It(e),o=re(i,o),Nt([],[t],(function(t){function r(){ae("Cannot call "+i+" due to unbound types",s)}var i=(t=t[0]).name+"."+e,u=t.Kd.constructor;return void 0===u[e]?(r.xe=n-1,u[e]=r):(zt(u,e,i),u[e].Sd[n-1]=r),Nt([],s,(function(t){return t=[t[0],null].concat(t.slice(1)),t=ue(i,t,null,o,a),void 0===u[e].Sd?(t.xe=n-1,u[e]=t):u[e].Sd[n-1]=t,[]})),[]}))},t:function(t,e,n,r,i,o){I(0<e);var a=le(e,n);i=re(r,i);var s=[o],u=[];Nt([],[t],(function(t){var n="constructor "+(t=t[0]).name;if(void 0===t.Kd.ie&&(t.Kd.ie=[]),void 0!==t.Kd.ie[e-1])throw new Pt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.Kd.ie[e-1]=function(){ae("Cannot construct "+t.name+" due to unbound types",a)},Nt([],a,(function(r){return t.Kd.ie[e-1]=function(){arguments.length!==e-1&&Rt(n+" called with "+arguments.length+" arguments, expected "+(e-1)),u.length=0,s.length=e;for(var t=1;t<e;++t)s[t]=r[t].toWireType(u,arguments[t-1]);return t=i.apply(null,s),_t(u),r[0].fromWireType(t)},[]})),[]}))},c:function(t,e,n,r,i,o,a,s){var u=le(n,r);e=It(e),o=re(i,o),Nt([],[t],(function(t){function r(){ae("Cannot call "+i+" due to unbound types",u)}var i=(t=t[0]).name+"."+e;s&&t.Kd.ag.push(e);var l=t.Kd.Ae,c=l[e];return void 0===c||void 0===c.Sd&&c.className!==t.name&&c.xe===n-2?(r.xe=n-2,r.className=t.name,l[e]=r):(zt(l,e,i),l[e].Sd[n-2]=r),Nt([],u,(function(r){return r=ue(i,r,t,o,a),void 0===l[e].Sd?(r.xe=n-2,l[e]=r):l[e].Sd[n-2]=r,[]})),[]}))},O:function(t,n,r){t=It(t),Nt([],[n],(function(n){return n=n[0],e[t]=n.fromWireType(r),[]}))},Cb:function(t,e){Lt(t,{name:e=It(e),fromWireType:function(t){var e=he[t].value;return fe(t),e},toWireType:function(t,e){return pe(e)},argPackAdvance:8,readValueFromPointer:bt,$d:null})},m:function(t,e,n,r){function i(){}n=Ot(n),e=It(e),i.values={},Lt(t,{name:e,constructor:i,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,e){return e.value},argPackAdvance:8,readValueFromPointer:de(e,n,r),$d:null}),Vt(e,i)},l:function(t,e,n){var r=ye(t,"enum");e=It(e),t=r.constructor,r=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:xt(r.name+"_"+e,(function(){}))}}),t.values[n]=r,t[e]=r},I:function(t,e,n){n=Ot(n),Lt(t,{name:e=It(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+me(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:ge(e,n),$d:null})},r:function(t,e,n,r,i,o){var a=le(e,n);t=It(t),i=re(r,i),Vt(t,(function(){ae("Cannot call "+t+" due to unbound types",a)}),e-1),Nt([],a,(function(n){return n=[n[0],null].concat(n.slice(1)),ne(t,ue(t,n,null,i,o),e-1),[]}))},u:function(t,e,n,r,i){function o(t){return t}e=It(e),-1===i&&(i=4294967295);var a=Ot(n);if(0===r){var s=32-8*n;o=function(t){return t<<s>>>s}}var u=e.includes("unsigned");Lt(t,{name:e,fromWireType:o,toWireType:function(t,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+me(n)+'" to '+this.name);if(n<r||n>i)throw new TypeError('Passing a number "'+me(n)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+r+", "+i+"]!");return u?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:_e(e,a,0!==r),$d:null})},s:function(t,e,n){function r(t){var e=q;return new i(F,e[1+(t>>=2)],e[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];Lt(t,{name:n=It(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Sf:!0})},p:function(t,e,n,r,i,o,a,s,u,l,c,h){n=It(n),o=re(i,o),s=re(a,s),l=re(u,l),h=re(c,h),Nt([t],[e],(function(t){return t=t[0],[new ee(n,t.Kd,!1,!1,!0,t,r,o,s,l,h)]}))},J:function(t,e){var n="std::string"===(e=It(e));Lt(t,{name:e,fromWireType:function(t){var e=q[t>>2];if(n)for(var r=t+4,i=0;i<=e;++i){var o=t+4+i;if(i==e||0==B[o]){if(r=L(r,o-r),void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=o+1}}else{for(a=Array(e),i=0;i<e;++i)a[i]=String.fromCharCode(B[t+4+i]);a=a.join("")}return mn(t),a},toWireType:function(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;r||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||Rt("Cannot pass non-string to std::string");var i=(n&&r?function(){return k(e)}:function(){return e.length})(),o=gn(4+i+1);if(q[o>>2]=i,n&&r)D(e,B,o+4,i+1);else if(r)for(r=0;r<i;++r){var a=e.charCodeAt(r);255<a&&(mn(o),Rt("String has UTF-16 code units that do not fit in 8 bits")),B[o+4+r]=a}else for(r=0;r<i;++r)B[o+4+r]=e[r];return null!==t&&t.push(mn,o),o},argPackAdvance:8,readValueFromPointer:bt,$d:function(t){mn(t)}})},B:function(t,e,n){if(n=It(n),2===e)var r=X,i=Y,o=Z,a=function(){return G},s=1;else 4===e&&(r=Q,i=K,o=J,a=function(){return q},s=2);Lt(t,{name:n,fromWireType:function(t){for(var n,i=q[t>>2],o=a(),u=t+4,l=0;l<=i;++l){var c=t+4+l*e;l!=i&&0!=o[c>>s]||(u=r(u,c-u),void 0===n?n=u:(n+=String.fromCharCode(0),n+=u),u=c+e)}return mn(t),n},toWireType:function(t,r){"string"!=typeof r&&Rt("Cannot pass non-string to C++ string type "+n);var a=o(r),u=gn(4+a+e);return q[u>>2]=a>>s,i(r,u+4,a+e),null!==t&&t.push(mn,u),u},argPackAdvance:8,readValueFromPointer:bt,$d:function(t){mn(t)}})},N:function(t,e,n,r,i,o){gt[t]={name:It(e),ff:re(n,r),ee:re(i,o),qf:[]}},w:function(t,e,n,r,i,o,a,s,u,l){gt[t].qf.push({Hf:It(e),Qf:n,Of:re(r,i),Pf:o,eg:a,dg:re(s,u),fg:l})},Eb:function(t,e){Lt(t,{Uf:!0,name:e=It(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},jb:function(t,e,n,r,i){t=Ee[t],e=we(e),n=ve(n);var o=[];return W[r>>2]=pe(o),t(e,n,o,i)},x:function(t,e,n,r){(t=Ee[t])(e=we(e),n=ve(n),null,r)},_:fe,v:function(t,e){e=function(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=ye(W[(e>>2)+r],"parameter "+r);return n}(t,e);for(var n=e[0],r=n.name+"_$"+e.slice(1).map((function(t){return t.name})).join("_")+"$",i=["retType"],o=[n],a="",s=0;s<t-1;++s)a+=(0!==s?", ":"")+"arg"+s,i.push("argType"+s),o.push(e[1+s]);r="return function "+wt("methodCaller_"+r)+"(handle, name, destructors, args) {\n";var u=0;for(s=0;s<t-1;++s)r+=" var arg"+s+" = argType"+s+".readValueFromPointer(args"+(u?"+"+u:"")+");\n",u+=e[s+1].argPackAdvance;for(r+=" var rv = handle[name]("+a+");\n",s=0;s<t-1;++s)e[s+1].deleteObject&&(r+=" argType"+s+".deleteObject(arg"+s+");\n");return n.Uf||(r+=" return retType.toWireType(destructors, rv);\n"),i.push(r+"};\n"),function(t){var e=Ee.length;return Ee.push(t),e}(t=se(i).apply(null,o))},kb:function(t){4<t&&(he[t].gf+=1)},ja:function(){return pe([])},ua:function(t){return pe(ve(t))},hb:function(){return pe({})},ib:function(t){_t(he[t].value),fe(t)},A:function(t,e,n){t=we(t),e=we(e),n=we(n),t[e]=n},y:function(t,e){return pe(t=(t=ye(t,"_emval_take_value")).readValueFromPointer(e))},d:function(){ut()},pb:function(t,e){if(0===t)t=Date.now();else{if(1!==t&&4!==t)return W[yn()>>2]=28,-1;t=Te()}return W[e>>2]=t/1e3|0,W[e+4>>2]=t%1e3*1e6|0,0},Yc:function(t){ln.activeTexture(t)},Q:function(t,e){ln.attachShader(Me[t],Ae[e])},R:function(t,e,n){ln.bindAttribLocation(Me[t],e,L(n))},S:function(t,e){35051==t?ln.df=e:35052==t&&(ln.ye=e),ln.bindBuffer(t,Ce[e])},$b:function(t,e){ln.bindFramebuffer(t,Se[e])},ac:function(t,e){ln.bindRenderbuffer(t,Ne[e])},Nb:function(t,e){ln.bindSampler(t,Re[e])},T:function(t,e){ln.bindTexture(t,Oe[e])},uc:function(t){ln.bindVertexArray(Ie[t])},xc:function(t){ln.bindVertexArray(Ie[t])},U:function(t,e,n,r){ln.blendColor(t,e,n,r)},V:function(t){ln.blendEquation(t)},W:function(t,e){ln.blendFunc(t,e)},Ub:function(t,e,n,r,i,o,a,s,u,l){ln.blitFramebuffer(t,e,n,r,i,o,a,s,u,l)},X:function(t,e,n,r){2<=We.version?n?ln.bufferData(t,B,r,n,e):ln.bufferData(t,e,r):ln.bufferData(t,n?B.subarray(n,n+e):e,r)},Y:function(t,e,n,r){2<=We.version?ln.bufferSubData(t,e,B,r,n):ln.bufferSubData(t,e,B.subarray(r,r+n))},bc:function(t){return ln.checkFramebufferStatus(t)},Z:function(t){ln.clear(t)},$:function(t,e,n,r){ln.clearColor(t,e,n,r)},aa:function(t){ln.clearStencil(t)},eb:function(t,e,n,r){return ln.clientWaitSync(Le[t],e,(n>>>0)+4294967296*r)},ba:function(t,e,n,r){ln.colorMask(!!t,!!e,!!n,!!r)},ca:function(t){ln.compileShader(Ae[t])},da:function(t,e,n,r,i,o,a,s){2<=We.version?ln.ye?ln.compressedTexImage2D(t,e,n,r,i,o,a,s):ln.compressedTexImage2D(t,e,n,r,i,o,B,s,a):ln.compressedTexImage2D(t,e,n,r,i,o,s?B.subarray(s,s+a):null)},ea:function(t,e,n,r,i,o,a,s,u){2<=We.version?ln.ye?ln.compressedTexSubImage2D(t,e,n,r,i,o,a,s,u):ln.compressedTexSubImage2D(t,e,n,r,i,o,a,B,u,s):ln.compressedTexSubImage2D(t,e,n,r,i,o,a,u?B.subarray(u,u+s):null)},fa:function(t,e,n,r,i,o,a,s){ln.copyTexSubImage2D(t,e,n,r,i,o,a,s)},ga:function(){var t=Be(Me),e=ln.createProgram();return e.name=t,e.Ue=e.Se=e.Te=0,e.hf=1,Me[t]=e,t},ha:function(t){var e=Be(Ae);return Ae[e]=ln.createShader(t),e},ia:function(t){ln.cullFace(t)},ka:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=Ce[r];i&&(ln.deleteBuffer(i),i.name=0,Ce[r]=null,r==ln.df&&(ln.df=0),r==ln.ye&&(ln.ye=0))}},cc:function(t,e){for(var n=0;n<t;++n){var r=W[e+4*n>>2],i=Se[r];i&&(ln.deleteFramebuffer(i),i.name=0,Se[r]=null)}},la:function(t){if(t){var e=Me[t];e?(ln.deleteProgram(e),e.name=0,Me[t]=null):Ue(1281)}},dc:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=Ne[r];i&&(ln.deleteRenderbuffer(i),i.name=0,Ne[r]=null)}},Ob:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=Re[r];i&&(ln.deleteSampler(i),i.name=0,Re[r]=null)}},ma:function(t){if(t){var e=Ae[t];e?(ln.deleteShader(e),Ae[t]=null):Ue(1281)}},Wb:function(t){if(t){var e=Le[t];e?(ln.deleteSync(e),e.name=0,Le[t]=null):Ue(1281)}},na:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=Oe[r];i&&(ln.deleteTexture(i),i.name=0,Oe[r]=null)}},vc:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2];ln.deleteVertexArray(Ie[r]),Ie[r]=null}},yc:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2];ln.deleteVertexArray(Ie[r]),Ie[r]=null}},oa:function(t){ln.depthMask(!!t)},pa:function(t){ln.disable(t)},qa:function(t){ln.disableVertexAttribArray(t)},ra:function(t,e,n){ln.drawArrays(t,e,n)},sc:function(t,e,n,r){ln.drawArraysInstanced(t,e,n,r)},qc:function(t,e,n,r,i){ln.nf.drawArraysInstancedBaseInstanceWEBGL(t,e,n,r,i)},oc:function(t,e){for(var n=qe[t],r=0;r<t;r++)n[r]=W[e+4*r>>2];ln.drawBuffers(n)},sa:function(t,e,n,r){ln.drawElements(t,e,n,r)},tc:function(t,e,n,r,i){ln.drawElementsInstanced(t,e,n,r,i)},rc:function(t,e,n,r,i,o,a){ln.nf.drawElementsInstancedBaseVertexBaseInstanceWEBGL(t,e,n,r,i,o,a)},ic:function(t,e,n,r,i,o){ln.drawElements(t,r,i,o)},ta:function(t){ln.enable(t)},va:function(t){ln.enableVertexAttribArray(t)},Sb:function(t,e){return(t=ln.fenceSync(t,e))?(e=Be(Le),t.name=e,Le[e]=t,e):0},wa:function(){ln.finish()},xa:function(){ln.flush()},ec:function(t,e,n,r){ln.framebufferRenderbuffer(t,e,n,Ne[r])},fc:function(t,e,n,r,i){ln.framebufferTexture2D(t,e,n,Oe[r],i)},ya:function(t){ln.frontFace(t)},za:function(t,e){He(t,e,"createBuffer",Ce)},gc:function(t,e){He(t,e,"createFramebuffer",Se)},hc:function(t,e){He(t,e,"createRenderbuffer",Ne)},Pb:function(t,e){He(t,e,"createSampler",Re)},Aa:function(t,e){He(t,e,"createTexture",Oe)},wc:function(t,e){He(t,e,"createVertexArray",Ie)},zc:function(t,e){He(t,e,"createVertexArray",Ie)},Xb:function(t){ln.generateMipmap(t)},Ba:function(t,e,n){n?W[n>>2]=ln.getBufferParameter(t,e):Ue(1281)},Ca:function(){var t=ln.getError()||Ge;return Ge=0,t},Yb:function(t,e,n,r){((t=ln.getFramebufferAttachmentParameter(t,e,n))instanceof WebGLRenderbuffer||t instanceof WebGLTexture)&&(t=0|t.name),W[r>>2]=t},cb:function(t,e){ze(t,e)},Da:function(t,e,n,r){null===(t=ln.getProgramInfoLog(Me[t]))&&(t="(unknown error)"),e=0<e&&r?D(t,B,r,e):0,n&&(W[n>>2]=e)},Ea:function(t,e,n){if(n)if(t>=xe)Ue(1281);else if(t=Me[t],35716==e)null===(t=ln.getProgramInfoLog(t))&&(t="(unknown error)"),W[n>>2]=t.length+1;else if(35719==e){if(!t.Ue)for(e=0;e<ln.getProgramParameter(t,35718);++e)t.Ue=Math.max(t.Ue,ln.getActiveUniform(t,e).name.length+1);W[n>>2]=t.Ue}else if(35722==e){if(!t.Se)for(e=0;e<ln.getProgramParameter(t,35721);++e)t.Se=Math.max(t.Se,ln.getActiveAttrib(t,e).name.length+1);W[n>>2]=t.Se}else if(35381==e){if(!t.Te)for(e=0;e<ln.getProgramParameter(t,35382);++e)t.Te=Math.max(t.Te,ln.getActiveUniformBlockName(t,e).length+1);W[n>>2]=t.Te}else W[n>>2]=ln.getProgramParameter(t,e);else Ue(1281)},Zb:function(t,e,n){n?W[n>>2]=ln.getRenderbufferParameter(t,e):Ue(1281)},Fa:function(t,e,n,r){null===(t=ln.getShaderInfoLog(Ae[t]))&&(t="(unknown error)"),e=0<e&&r?D(t,B,r,e):0,n&&(W[n>>2]=e)},Kb:function(t,e,n,r){t=ln.getShaderPrecisionFormat(t,e),W[n>>2]=t.rangeMin,W[n+4>>2]=t.rangeMax,W[r>>2]=t.precision},Ga:function(t,e,n){n?35716==e?(null===(t=ln.getShaderInfoLog(Ae[t]))&&(t="(unknown error)"),W[n>>2]=t?t.length+1:0):35720==e?(t=ln.getShaderSource(Ae[t]),W[n>>2]=t?t.length+1:0):W[n>>2]=ln.getShaderParameter(Ae[t],e):Ue(1281)},D:function(t){var e=De[t];if(!e){switch(t){case 7939:e=Ve((e=(e=ln.getSupportedExtensions()||[]).concat(e.map((function(t){return"GL_"+t})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:(e=ln.getParameter(t))||Ue(1280),e=e&&Ve(e);break;case 7938:e=ln.getParameter(7938),e=Ve(e=2<=We.version?"OpenGL ES 3.0 ("+e+")":"OpenGL ES 2.0 ("+e+")");break;case 35724:var n=(e=ln.getParameter(35724)).match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==n&&(3==n[1].length&&(n[1]+="0"),e="OpenGL ES GLSL ES "+n[1]+" ("+e+")"),e=Ve(e);break;default:Ue(1280)}De[t]=e}return e},db:function(t,e){if(2>We.version)return Ue(1282),0;var n=ke[t];return n?0>e||e>=n.length?(Ue(1281),0):n[e]:7939===t?(n=(n=(n=ln.getSupportedExtensions()||[]).concat(n.map((function(t){return"GL_"+t})))).map((function(t){return Ve(t)})),n=ke[t]=n,0>e||e>=n.length?(Ue(1281),0):n[e]):(Ue(1280),0)},Ha:function(t,e){function n(t){return"]"==t.slice(-1)&&t.lastIndexOf("[")}e=L(e);var r,i=(t=Me[t]).Ye,o=t.qg,a=0,s=e,u=n(e);if(!i)for(t.Ye=i={},t.uf={},r=0;r<ln.getProgramParameter(t,35718);++r){var l=ln.getActiveUniform(t,r),c=l.name;l=l.size;var h=n(c);h=0<h?c.slice(0,h):c;var f=t.hf;for(t.hf+=l,o[h]=[l,f],c=0;c<l;++c)i[f]=c,t.uf[f++]=h}return 0<u&&(a=parseInt(e.slice(u+1))>>>0,s=e.slice(0,u)),(o=o[s])&&a<o[0]&&(i[a+=o[1]]=i[a]||ln.getUniformLocation(t,e))?a:-1},Lb:function(t,e,n){for(var r=qe[e],i=0;i<e;i++)r[i]=W[n+4*i>>2];ln.invalidateFramebuffer(t,r)},Mb:function(t,e,n,r,i,o,a){for(var s=qe[e],u=0;u<e;u++)s[u]=W[n+4*u>>2];ln.invalidateSubFramebuffer(t,s,r,i,o,a)},Tb:function(t){return ln.isSync(Le[t])},Ia:function(t){return(t=Oe[t])?ln.isTexture(t):0},Ja:function(t){ln.lineWidth(t)},Ka:function(t){t=Me[t],ln.linkProgram(t),t.Ye=0,t.qg={}},mc:function(t,e,n,r,i,o){ln.sf.multiDrawArraysInstancedBaseInstanceWEBGL(t,W,e>>2,W,n>>2,W,r>>2,q,i>>2,o)},nc:function(t,e,n,r,i,o,a,s){ln.sf.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(t,W,e>>2,n,W,r>>2,W,i>>2,W,o>>2,q,a>>2,s)},La:function(t,e){3317==t&&(Fe=e),ln.pixelStorei(t,e)},pc:function(t){ln.readBuffer(t)},Ma:function(t,e,n,r,i,o,a){if(2<=We.version)if(ln.df)ln.readPixels(t,e,n,r,i,o,a);else{var s=Xe(o);ln.readPixels(t,e,n,r,i,o,s,a>>31-Math.clz32(s.BYTES_PER_ELEMENT))}else(a=Ye(o,i,n,r,a))?ln.readPixels(t,e,n,r,i,o,a):Ue(1280)},_b:function(t,e,n,r){ln.renderbufferStorage(t,e,n,r)},Vb:function(t,e,n,r,i){ln.renderbufferStorageMultisample(t,e,n,r,i)},Qb:function(t,e,n){ln.samplerParameteri(Re[t],e,n)},Rb:function(t,e,n){ln.samplerParameteri(Re[t],e,W[n>>2])},Na:function(t,e,n,r){ln.scissor(t,e,n,r)},Oa:function(t,e,n,r){for(var i="",o=0;o<e;++o){var a=r?W[r+4*o>>2]:-1;i+=L(W[n+4*o>>2],0>a?void 0:a)}ln.shaderSource(Ae[t],i)},Pa:function(t,e,n){ln.stencilFunc(t,e,n)},Qa:function(t,e,n,r){ln.stencilFuncSeparate(t,e,n,r)},Ra:function(t){ln.stencilMask(t)},Sa:function(t,e){ln.stencilMaskSeparate(t,e)},Ta:function(t,e,n){ln.stencilOp(t,e,n)},Ua:function(t,e,n,r){ln.stencilOpSeparate(t,e,n,r)},Va:function(t,e,n,r,i,o,a,s,u){if(2<=We.version)if(ln.ye)ln.texImage2D(t,e,n,r,i,o,a,s,u);else if(u){var l=Xe(s);ln.texImage2D(t,e,n,r,i,o,a,s,l,u>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else ln.texImage2D(t,e,n,r,i,o,a,s,null);else ln.texImage2D(t,e,n,r,i,o,a,s,u?Ye(s,a,r,i,u):null)},Wa:function(t,e,n){ln.texParameterf(t,e,n)},Xa:function(t,e,n){ln.texParameterf(t,e,H[n>>2])},Ya:function(t,e,n){ln.texParameteri(t,e,n)},_a:function(t,e,n){ln.texParameteri(t,e,W[n>>2])},jc:function(t,e,n,r,i){ln.texStorage2D(t,e,n,r,i)},$a:function(t,e,n,r,i,o,a,s,u){if(2<=We.version)if(ln.ye)ln.texSubImage2D(t,e,n,r,i,o,a,s,u);else if(u){var l=Xe(s);ln.texSubImage2D(t,e,n,r,i,o,a,s,l,u>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else ln.texSubImage2D(t,e,n,r,i,o,a,s,null);else l=null,u&&(l=Ye(s,a,i,o,u)),ln.texSubImage2D(t,e,n,r,i,o,a,s,l)},ab:function(t,e){ln.uniform1f(Ze(t),e)},bb:function(t,e,n){if(2<=We.version)ln.uniform1fv(Ze(t),H,n>>2,e);else{if(288>=e)for(var r=Ke[e-1],i=0;i<e;++i)r[i]=H[n+4*i>>2];else r=H.subarray(n>>2,n+4*e>>2);ln.uniform1fv(Ze(t),r)}},Uc:function(t,e){ln.uniform1i(Ze(t),e)},Vc:function(t,e,n){if(2<=We.version)ln.uniform1iv(Ze(t),W,n>>2,e);else{if(288>=e)for(var r=Je[e-1],i=0;i<e;++i)r[i]=W[n+4*i>>2];else r=W.subarray(n>>2,n+4*e>>2);ln.uniform1iv(Ze(t),r)}},Wc:function(t,e,n){ln.uniform2f(Ze(t),e,n)},Xc:function(t,e,n){if(2<=We.version)ln.uniform2fv(Ze(t),H,n>>2,2*e);else{if(144>=e)for(var r=Ke[2*e-1],i=0;i<2*e;i+=2)r[i]=H[n+4*i>>2],r[i+1]=H[n+(4*i+4)>>2];else r=H.subarray(n>>2,n+8*e>>2);ln.uniform2fv(Ze(t),r)}},Tc:function(t,e,n){ln.uniform2i(Ze(t),e,n)},Sc:function(t,e,n){if(2<=We.version)ln.uniform2iv(Ze(t),W,n>>2,2*e);else{if(144>=e)for(var r=Je[2*e-1],i=0;i<2*e;i+=2)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2];else r=W.subarray(n>>2,n+8*e>>2);ln.uniform2iv(Ze(t),r)}},Rc:function(t,e,n,r){ln.uniform3f(Ze(t),e,n,r)},Qc:function(t,e,n){if(2<=We.version)ln.uniform3fv(Ze(t),H,n>>2,3*e);else{if(96>=e)for(var r=Ke[3*e-1],i=0;i<3*e;i+=3)r[i]=H[n+4*i>>2],r[i+1]=H[n+(4*i+4)>>2],r[i+2]=H[n+(4*i+8)>>2];else r=H.subarray(n>>2,n+12*e>>2);ln.uniform3fv(Ze(t),r)}},Pc:function(t,e,n,r){ln.uniform3i(Ze(t),e,n,r)},Oc:function(t,e,n){if(2<=We.version)ln.uniform3iv(Ze(t),W,n>>2,3*e);else{if(96>=e)for(var r=Je[3*e-1],i=0;i<3*e;i+=3)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2],r[i+2]=W[n+(4*i+8)>>2];else r=W.subarray(n>>2,n+12*e>>2);ln.uniform3iv(Ze(t),r)}},Nc:function(t,e,n,r,i){ln.uniform4f(Ze(t),e,n,r,i)},Mc:function(t,e,n){if(2<=We.version)ln.uniform4fv(Ze(t),H,n>>2,4*e);else{if(72>=e){var r=Ke[4*e-1],i=H;n>>=2;for(var o=0;o<4*e;o+=4){var a=n+o;r[o]=i[a],r[o+1]=i[a+1],r[o+2]=i[a+2],r[o+3]=i[a+3]}}else r=H.subarray(n>>2,n+16*e>>2);ln.uniform4fv(Ze(t),r)}},Ac:function(t,e,n,r,i){ln.uniform4i(Ze(t),e,n,r,i)},Bc:function(t,e,n){if(2<=We.version)ln.uniform4iv(Ze(t),W,n>>2,4*e);else{if(72>=e)for(var r=Je[4*e-1],i=0;i<4*e;i+=4)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2],r[i+2]=W[n+(4*i+8)>>2],r[i+3]=W[n+(4*i+12)>>2];else r=W.subarray(n>>2,n+16*e>>2);ln.uniform4iv(Ze(t),r)}},Cc:function(t,e,n,r){if(2<=We.version)ln.uniformMatrix2fv(Ze(t),!!n,H,r>>2,4*e);else{if(72>=e)for(var i=Ke[4*e-1],o=0;o<4*e;o+=4)i[o]=H[r+4*o>>2],i[o+1]=H[r+(4*o+4)>>2],i[o+2]=H[r+(4*o+8)>>2],i[o+3]=H[r+(4*o+12)>>2];else i=H.subarray(r>>2,r+16*e>>2);ln.uniformMatrix2fv(Ze(t),!!n,i)}},Dc:function(t,e,n,r){if(2<=We.version)ln.uniformMatrix3fv(Ze(t),!!n,H,r>>2,9*e);else{if(32>=e)for(var i=Ke[9*e-1],o=0;o<9*e;o+=9)i[o]=H[r+4*o>>2],i[o+1]=H[r+(4*o+4)>>2],i[o+2]=H[r+(4*o+8)>>2],i[o+3]=H[r+(4*o+12)>>2],i[o+4]=H[r+(4*o+16)>>2],i[o+5]=H[r+(4*o+20)>>2],i[o+6]=H[r+(4*o+24)>>2],i[o+7]=H[r+(4*o+28)>>2],i[o+8]=H[r+(4*o+32)>>2];else i=H.subarray(r>>2,r+36*e>>2);ln.uniformMatrix3fv(Ze(t),!!n,i)}},Ec:function(t,e,n,r){if(2<=We.version)ln.uniformMatrix4fv(Ze(t),!!n,H,r>>2,16*e);else{if(18>=e){var i=Ke[16*e-1],o=H;r>>=2;for(var a=0;a<16*e;a+=16){var s=r+a;i[a]=o[s],i[a+1]=o[s+1],i[a+2]=o[s+2],i[a+3]=o[s+3],i[a+4]=o[s+4],i[a+5]=o[s+5],i[a+6]=o[s+6],i[a+7]=o[s+7],i[a+8]=o[s+8],i[a+9]=o[s+9],i[a+10]=o[s+10],i[a+11]=o[s+11],i[a+12]=o[s+12],i[a+13]=o[s+13],i[a+14]=o[s+14],i[a+15]=o[s+15]}}else i=H.subarray(r>>2,r+64*e>>2);ln.uniformMatrix4fv(Ze(t),!!n,i)}},Fc:function(t){t=Me[t],ln.useProgram(t),ln.Df=t},Gc:function(t,e){ln.vertexAttrib1f(t,e)},Hc:function(t,e){ln.vertexAttrib2f(t,H[e>>2],H[e+4>>2])},Ic:function(t,e){ln.vertexAttrib3f(t,H[e>>2],H[e+4>>2],H[e+8>>2])},Jc:function(t,e){ln.vertexAttrib4f(t,H[e>>2],H[e+4>>2],H[e+8>>2],H[e+12>>2])},kc:function(t,e){ln.vertexAttribDivisor(t,e)},lc:function(t,e,n,r,i){ln.vertexAttribIPointer(t,e,n,r,i)},Kc:function(t,e,n,r,i,o){ln.vertexAttribPointer(t,e,n,!!r,i,o)},Lc:function(t,e,n,r){ln.viewport(t,e,n,r)},fb:function(t,e,n,r){ln.waitSync(Le[t],e,(n>>>0)+4294967296*r)},e:function(t,e){throw En(t,e||1),"longjmp"},ob:function(t){var e=B.length;if(2147483648<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296),0<(r=Math.max(t,r))%65536&&(r+=65536-r%65536);t:{try{O.grow(Math.min(2147483648,r)-F.byteLength+65535>>>16),$();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},Zc:function(){return We?We.Rf:0},P:function(t){return je(t)?0:-5},sb:function(t,e){var n=0;return tn().forEach((function(r,i){var o=e+n;for(i=W[t+4*i>>2]=o,o=0;o<r.length;++o)U[i++>>0]=r.charCodeAt(o);U[i>>0]=0,n+=r.length+1})),0},tb:function(t,e){var n=tn();W[t>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),W[e>>2]=r,0},Fb:function(t){N||(e.onExit&&e.onExit(t),A=!0),g(t,new xn(t))},H:function(){return 0},rb:function(t,e){return t=1==t||2==t?2:ut(),U[e>>0]=t,0},mb:function(t,e,n,r,i,o){return t=mt.Nf(t),e=mt.Ef(t,e,n,r),W[o>>2]=e,0},yb:function(t,e,n,r){return t=mt.Nf(t),e=mt.Ef(t,e,n),W[r>>2]=e,0},lb:function(){},G:function(t,e,n,r){for(var i=0,o=0;o<n;o++){for(var a=W[e+8*o>>2],s=W[e+(8*o+4)>>2],u=0;u<s;u++){var l=B[a+u],c=yt[t];0===l||10===l?((1===t?x:C)(R(c,0)),c.length=0):c.push(l)}i+=s}return W[r>>2]=i,0},a:function(){return S},_c:function(t,e){ln.bindFramebuffer(t,Se[e])},Za:function(t){ln.clear(t)},Ab:function(t,e,n,r){ln.clearColor(t,e,n,r)},gb:function(t){ln.clearStencil(t)},C:function(t,e){ze(t,e)},i:function(t,e){var n=vn();try{return tt.get(t)(e)}catch(t){if(Tn(n),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},n:function(t,e,n){var r=vn();try{return tt.get(t)(e,n)}catch(t){if(Tn(r),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},g:function(t,e,n,r){var i=vn();try{return tt.get(t)(e,n,r)}catch(t){if(Tn(i),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},z:function(t,e,n,r,i){var o=vn();try{return tt.get(t)(e,n,r,i)}catch(t){if(Tn(o),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Jb:function(t,e,n,r,i,o){var a=vn();try{return tt.get(t)(e,n,r,i,o)}catch(t){if(Tn(a),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},M:function(t,e,n,r,i,o,a){var s=vn();try{return tt.get(t)(e,n,r,i,o,a)}catch(t){if(Tn(s),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},L:function(t,e,n,r,i,o,a,s,u,l){var c=vn();try{return tt.get(t)(e,n,r,i,o,a,s,u,l)}catch(t){if(Tn(c),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},K:function(t){var e=vn();try{tt.get(t)()}catch(t){if(Tn(e),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},j:function(t,e){var n=vn();try{tt.get(t)(e)}catch(t){if(Tn(n),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},q:function(t,e,n){var r=vn();try{tt.get(t)(e,n)}catch(t){if(Tn(r),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},h:function(t,e,n,r){var i=vn();try{tt.get(t)(e,n,r)}catch(t){if(Tn(i),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},o:function(t,e,n,r,i){var o=vn();try{tt.get(t)(e,n,r,i)}catch(t){if(Tn(o),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Ib:function(t,e,n,r,i,o){var a=vn();try{tt.get(t)(e,n,r,i,o)}catch(t){if(Tn(a),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Gb:function(t,e,n,r,i,o,a){var s=vn();try{tt.get(t)(e,n,r,i,o,a)}catch(t){if(Tn(s),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Hb:function(t,e,n,r,i,o,a,s,u,l){var c=vn();try{tt.get(t)(e,n,r,i,o,a,s,u,l)}catch(t){if(Tn(c),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},b:function(t){S=t},qb:function(t,e,n,r){return function(t,e,n,r){function i(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function o(t,e){return i(t,e,"0")}function a(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function u(t){t=an(new Date(t.Vd+1900,0,1),t.Xe);var e=new Date(t.getFullYear()+1,0,4),n=s(new Date(t.getFullYear(),0,4));return e=s(e),0>=a(n,t)?0>=a(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var l=W[r+40>>2];for(var c in r={og:W[r>>2],ng:W[r+4>>2],Ve:W[r+8>>2],Le:W[r+12>>2],Be:W[r+16>>2],Vd:W[r+20>>2],We:W[r+24>>2],Xe:W[r+28>>2],xg:W[r+32>>2],mg:W[r+36>>2],pg:l?L(l):""},n=L(n),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),l[c]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),f="January February March April May June July August September October November December".split(" ");for(c in l={"%a":function(t){return h[t.We].substring(0,3)},"%A":function(t){return h[t.We]},"%b":function(t){return f[t.Be].substring(0,3)},"%B":function(t){return f[t.Be]},"%C":function(t){return o((t.Vd+1900)/100|0,2)},"%d":function(t){return o(t.Le,2)},"%e":function(t){return i(t.Le,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return o(t.Ve,2)},"%I":function(t){return 0==(t=t.Ve)?t=12:12<t&&(t-=12),o(t,2)},"%j":function(t){return o(t.Le+nn(en(t.Vd+1900)?rn:on,t.Be-1),3)},"%m":function(t){return o(t.Be+1,2)},"%M":function(t){return o(t.ng,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.Ve&&12>t.Ve?"AM":"PM"},"%S":function(t){return o(t.og,2)},"%t":function(){return"\t"},"%u":function(t){return t.We||7},"%U":function(t){var e=new Date(t.Vd+1900,0,1),n=0===e.getDay()?e:an(e,7-e.getDay());return 0>a(n,t=new Date(t.Vd+1900,t.Be,t.Le))?o(Math.ceil((31-n.getDate()+(nn(en(t.getFullYear())?rn:on,t.getMonth()-1)-31)+t.getDate())/7),2):0===a(n,e)?"01":"00"},"%V":function(t){var e=new Date(t.Vd+1901,0,4),n=s(new Date(t.Vd+1900,0,4));e=s(e);var r=an(new Date(t.Vd+1900,0,1),t.Xe);return 0>a(r,n)?"53":0>=a(e,r)?"01":o(Math.ceil((n.getFullYear()<t.Vd+1900?t.Xe+32-n.getDate():t.Xe+1-n.getDate())/7),2)},"%w":function(t){return t.We},"%W":function(t){var e=new Date(t.Vd,0,1),n=1===e.getDay()?e:an(e,0===e.getDay()?1:7-e.getDay()+1);return 0>a(n,t=new Date(t.Vd+1900,t.Be,t.Le))?o(Math.ceil((31-n.getDate()+(nn(en(t.getFullYear())?rn:on,t.getMonth()-1)-31)+t.getDate())/7),2):0===a(n,e)?"01":"00"},"%y":function(t){return(t.Vd+1900).toString().substring(2)},"%Y":function(t){return t.Vd+1900},"%z":function(t){var e=0<=(t=t.mg);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.pg},"%%":function(){return"%"}})n.includes(c)&&(n=n.replace(new RegExp(c,"g"),l[c](r)));return c=function(t){var e=Array(k(t)+1);return D(t,e,0,e.length),e}(n),c.length>e?0:(U.set(c,t),c.length-1)}(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.$c,$(),tt=e.asm.cd,nt.unshift(e.asm.ad),ot--,e.monitorRunDependencies&&e.monitorRunDependencies(ot),0==ot&&(null!==at&&(clearInterval(at),at=null),st&&(t=st,st=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!M&&(f||p)){if("function"==typeof fetch&&!ct.startsWith("file://"))return fetch(ct,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+ct+"'";return t.arrayBuffer()})).catch((function(){return ft()}));if(b)return new Promise((function(t,e){b(ct,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ft()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then(t,(function(t){C("failed to asynchronously prepare wasm: "+t),ut(t)}))}var i={a:pn};if(ot++,e.monitorRunDependencies&&e.monitorRunDependencies(ot),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return C("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||lt()||ct.startsWith("file://")||"function"!=typeof fetch?r(n):fetch(ct,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return C("wasm streaming compile failed: "+t),C("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(u)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.ad).apply(null,arguments)};var dn=e._memset=function(){return(dn=e._memset=e.asm.bd).apply(null,arguments)},yn=e.___errno_location=function(){return(yn=e.___errno_location=e.asm.dd).apply(null,arguments)},mn=e._free=function(){return(mn=e._free=e.asm.ed).apply(null,arguments)},gn=e._malloc=function(){return(gn=e._malloc=e.asm.fd).apply(null,arguments)},_n=e.___getTypeName=function(){return(_n=e.___getTypeName=e.asm.gd).apply(null,arguments)};e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.hd).apply(null,arguments)};var bn,vn=e.stackSave=function(){return(vn=e.stackSave=e.asm.id).apply(null,arguments)},Tn=e.stackRestore=function(){return(Tn=e.stackRestore=e.asm.jd).apply(null,arguments)},En=e._setThrew=function(){return(En=e._setThrew=e.asm.kd).apply(null,arguments)},wn=e._memalign=function(){return(wn=e._memalign=e.asm.ld).apply(null,arguments)};function xn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Cn(){function t(){if(!bn&&(bn=!0,e.calledRun=!0,!A)){if(pt(nt),s(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();rt.unshift(t)}pt(rt)}}if(!(0<ot)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)it();pt(et),0<ot||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.dynCall_viji=function(){return(e.dynCall_viji=e.asm.md).apply(null,arguments)},e.dynCall_vijiii=function(){return(e.dynCall_vijiii=e.asm.nd).apply(null,arguments)},e.dynCall_viiiiij=function(){return(e.dynCall_viiiiij=e.asm.od).apply(null,arguments)},e.dynCall_ji=function(){return(e.dynCall_ji=e.asm.pd).apply(null,arguments)},e.dynCall_jii=function(){return(e.dynCall_jii=e.asm.qd).apply(null,arguments)},e.dynCall_viijii=function(){return(e.dynCall_viijii=e.asm.rd).apply(null,arguments)},e.dynCall_iiij=function(){return(e.dynCall_iiij=e.asm.sd).apply(null,arguments)},e.dynCall_iiiij=function(){return(e.dynCall_iiiij=e.asm.td).apply(null,arguments)},e.dynCall_viij=function(){return(e.dynCall_viij=e.asm.ud).apply(null,arguments)},e.dynCall_viiij=function(){return(e.dynCall_viiij=e.asm.vd).apply(null,arguments)},e.dynCall_iij=function(){return(e.dynCall_iij=e.asm.wd).apply(null,arguments)},e.dynCall_vij=function(){return(e.dynCall_vij=e.asm.xd).apply(null,arguments)},e.dynCall_jiiii=function(){return(e.dynCall_jiiii=e.asm.yd).apply(null,arguments)},e.dynCall_jiiiiii=function(){return(e.dynCall_jiiiiii=e.asm.zd).apply(null,arguments)},e.dynCall_jiiiiji=function(){return(e.dynCall_jiiiiji=e.asm.Ad).apply(null,arguments)},e.dynCall_iijj=function(){return(e.dynCall_iijj=e.asm.Bd).apply(null,arguments)},e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.Cd).apply(null,arguments)},e.dynCall_iiiiij=function(){return(e.dynCall_iiiiij=e.asm.Dd).apply(null,arguments)},e.dynCall_iiiiijj=function(){return(e.dynCall_iiiiijj=e.asm.Ed).apply(null,arguments)},e.dynCall_iiiiiijj=function(){return(e.dynCall_iiiiiijj=e.asm.Fd).apply(null,arguments)},st=function t(){bn||Cn(),bn||(st=t)},e.run=Cn,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Cn(),t.ready});t.exports=s},2331:(t,e,n)=>{let r=n(4472);r="default"in r?r.default:r,t.exports=function(t){const e=JSON.parse(t.tilePieceBoundingBox),n=JSON.parse(t.tileBoundingBox),i=t.height,o=t.width,a=new Uint8ClampedArray(o*i*4),s=new Uint8ClampedArray(t.sourceImageData);let u,l;try{null==r.defs(t.projectionTo)&&r.defs(t.projectionTo,t.projectionToDefinition),null==r.defs(t.projectionFrom)&&r.defs(t.projectionFrom,t.projectionFromDefinition),u=r(t.projectionTo,t.projectionFrom)}catch(e){throw new Error("Error creating projection conversion between "+t.projectionTo+" and "+t.projectionFrom+".")}for(let r=0;r<i;r++){l=n._maxLatitude-r*t.tileHeightUnitsPerPixel;for(let i=0;i<o;i++){const c=n._minLongitude+i*t.tileWidthUnitsPerPixel,h=u.forward([c,l]),f=h[0],p=h[1],d=t.tile_width-Math.round((e._maxLongitude-f)/t.pixel_x_size),y=Math.round((e._maxLatitude-p)/t.pixel_y_size);if(d>=0&&d<t.tile_width&&y>=0&&y<t.tile_height){const e=y*t.tile_width*4+4*d,n=s.slice(e,e+4);a.set(n,r*o*4+4*i)}}}return a.buffer}},824:(t,e,n)=>{"use strict";n.r(e),n.d(e,{TileUtilities:()=>o});var r=n(1375),i=n(5604);class o{static getPiecePosition(t,e,n,o,a,s,u,l,c,h,f,p){let d;try{null==i.Projection.hasProjection(a)&&i.Projection.loadProjection(a,s),null==i.Projection.hasProjection(u)&&i.Projection.loadProjection(u,l),d=i.Projection.getConverter(a,u)}catch(t){throw new Error("Error creating projection conversion between "+a+" and "+u+".")}let y=t.maxLatitude,m=t.minLatitude,g=t.minLongitude-f,_=t.maxLongitude+f;a.toUpperCase()===r.ProjectionConstants.EPSG_3857&&u.toUpperCase()===r.ProjectionConstants.EPSG_4326&&(y=y>r.ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE?r.ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE:y,m=m<r.ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE?r.ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE:m,g=g<r.ProjectionConstants.WEB_MERCATOR_MIN_LON_RANGE?r.ProjectionConstants.WEB_MERCATOR_MIN_LON_RANGE:g,_=_>r.ProjectionConstants.WEB_MERCATOR_MAX_LON_RANGE?r.ProjectionConstants.WEB_MERCATOR_MAX_LON_RANGE:_);const b=i.Projection.convertCoordinates(r.ProjectionConstants.EPSG_4326,a,[-180,0]),v=i.Projection.convertCoordinates(r.ProjectionConstants.EPSG_4326,a,[180,0]);g=g<b[0]?b[0]:g,_=_>v[0]?v[0]:_;const T=d.inverse([g,m]),E=d.inverse([_,y]),w=isNaN(T[1])?e.minLatitude:T[1],x=isNaN(E[1])?e.maxLatitude:E[1],C=T[0],M=E[0];return{startY:Math.max(0,Math.floor((e.maxLatitude-x)/c)),startX:Math.max(0,Math.floor((C-e.minLongitude)/h)),endY:Math.min(n,n-Math.floor((w-e.minLatitude)/c)),endX:Math.min(o,o-Math.floor((e.maxLongitude-M)/h))}}}},7591:(t,e,n)=>{var r=n(5108);const i=n(2331);function o(t){const e=t.data,n=i(e);this.postMessage(n),this.close()}t.exports=function(t){t.onmessage=o,t.onerror=function(t){r.log("error",t)}}},9705:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}i.default=i,e.default=i},3809:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611);e.default=function(t){for(var e,n,i=r.getCoords(t),o=0,a=1;a<i.length;)e=n||i[0],o+=((n=i[a])[0]-e[0])*(n[1]+e[1]),a++;return o>0}},8147:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611);function i(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var a=e[i][0],s=e[i][1],u=e[o][0],l=e[o][1];if(t[1]*(a-u)+s*(u-t[0])+l*(t[0]-a)==0&&(a-t[0])*(u-t[0])<=0&&(s-t[1])*(l-t[1])<=0)return!n;s>t[1]!=l>t[1]&&t[0]<(u-a)*(t[1]-s)/(l-s)+a&&(r=!r)}return r}e.default=function(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=r.getCoord(t),a=r.getGeom(e),s=a.type,u=e.bbox,l=a.coordinates;if(u&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(o,u))return!1;"Polygon"===s&&(l=[l]);for(var c=!1,h=0;h<l.length&&!c;h++)if(i(o,l[h][0],n.ignoreBoundary)){for(var f=!1,p=1;p<l[h].length&&!f;)i(o,l[h][p],!n.ignoreBoundary)&&(f=!0),p++;f||(c=!0)}return c}},2793:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611);function i(t,e,n,r,i){var o=n[0],a=n[1],s=t[0],u=t[1],l=e[0],c=e[1],h=l-s,f=c-u,p=(n[0]-s)*f-(n[1]-u)*h;if(null!==i){if(Math.abs(p)>i)return!1}else if(0!==p)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(f)?h>0?s<o&&o<=l:l<=o&&o<s:f>0?u<a&&a<=c:c<=a&&a<u:"end"===r?Math.abs(h)>=Math.abs(f)?h>0?s<=o&&o<l:l<o&&o<=s:f>0?u<=a&&a<c:c<a&&a<=u:"both"===r&&(Math.abs(h)>=Math.abs(f)?h>0?s<o&&o<l:l<o&&o<s:f>0?u<a&&a<c:c<a&&a<u):Math.abs(h)>=Math.abs(f)?h>0?s<=o&&o<=l:l<=o&&o<=s:f>0?u<=a&&a<=c:c<=a&&a<=u}e.default=function(t,e,n){void 0===n&&(n={});for(var o=r.getCoord(t),a=r.getCoords(e),s=0;s<a.length-1;s++){var u=!1;if(n.ignoreEndVertices&&(0===s&&(u="start"),s===a.length-2&&(u="end"),0===s&&s+1===a.length-1&&(u="both")),i(a[s],a[s+1],o,u,void 0===n.epsilon?null:n.epsilon))return!0}return!1}},5184:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(7906)),o=r(n(2793)),a=r(n(8147)),s=n(611);function u(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function l(t,e){return t[0]===e[0]&&t[1]===e[1]}e.default=function(t,e){var n=s.getGeom(t),r=s.getGeom(e),c=n.type,h=r.type;switch(c){case"Point":switch(h){case"MultiPoint":return function(t,e){var n,r=!1;for(n=0;n<e.coordinates.length;n++)if(l(e.coordinates[n],t.coordinates)){r=!0;break}return r}(n,r);case"LineString":return o.default(n,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return a.default(n,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+h+" geometry not supported")}case"MultiPoint":switch(h){case"MultiPoint":return function(t,e){for(var n=0;n<t.coordinates.length;n++){for(var r=!1,i=0;i<e.coordinates.length;i++)l(t.coordinates[n],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}(n,r);case"LineString":return function(t,e){for(var n=!1,r=0;r<t.coordinates.length;r++){if(!o.default(t.coordinates[r],e))return!1;n||(n=o.default(t.coordinates[r],e,{ignoreEndVertices:!0}))}return n}(n,r);case"Polygon":case"MultiPolygon":return function(t,e){for(var n=!0,r=!1,i=0;i<t.coordinates.length;i++){if(!(r=a.default(t.coordinates[1],e))){n=!1;break}r=a.default(t.coordinates[1],e,{ignoreBoundary:!0})}return n&&r}(n,r);default:throw new Error("feature2 "+h+" geometry not supported")}case"LineString":switch(h){case"LineString":return function(t,e){for(var n=0;n<t.coordinates.length;n++)if(!o.default(t.coordinates[n],e))return!1;return!0}(n,r);case"Polygon":case"MultiPolygon":return function(t,e){var n,r;if(!u(i.default(e),i.default(t)))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!a.default(t.coordinates[s],e))return!1;if(o||(o=a.default(t.coordinates[s],e,{ignoreBoundary:!0})),!o){var l=(n=t.coordinates[s],r=t.coordinates[s+1],[(n[0]+r[0])/2,(n[1]+r[1])/2]);o=a.default(l,e,{ignoreBoundary:!0})}}return o}(n,r);default:throw new Error("feature2 "+h+" geometry not supported")}case"Polygon":switch(h){case"Polygon":case"MultiPolygon":return function(t,e){var n=i.default(t);if(!u(i.default(e),n))return!1;for(var r=0;r<t.coordinates[0].length;r++)if(!a.default(t.coordinates[0][r],e))return!1;return!0}(n,r);default:throw new Error("feature2 "+h+" geometry not supported")}default:throw new Error("feature1 "+c+" geometry not supported")}}},7906:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}i.default=i,e.default=i},1013:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611),i=n(4102);e.default=function(t,e,n){void 0===n&&(n={});var o=r.getCoord(t),a=r.getCoord(e),s=i.degreesToRadians(a[1]-o[1]),u=i.degreesToRadians(a[0]-o[0]),l=i.degreesToRadians(o[1]),c=i.degreesToRadians(a[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(l)*Math.cos(c);return i.radiansToLength(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),n.units)}},4102:(t,e)=>{"use strict";function n(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function r(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(t[0])||!p(t[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:t},e,r)}function i(t,e,r){void 0===r&&(r={});for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function a(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function s(t,e,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:t},e,r)}function u(t,e,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:t},e,r)}function l(t,e,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:t},e,r)}function c(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function h(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function f(t){return t%(2*Math.PI)*180/Math.PI}function p(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=n,e.geometry=function(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return r(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return i(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return s(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},e.point=r,e.points=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return r(t,e)})),n)},e.polygon=i,e.polygons=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return i(t,e)})),n)},e.lineString=o,e.lineStrings=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return o(t,e)})),n)},e.featureCollection=a,e.multiLineString=s,e.multiPoint=u,e.multiPolygon=l,e.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:t},e,r)},e.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return f(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=f,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=p,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!p(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},4170:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(4102),o=n(611),a=r(n(2676));e.default=function(t,e,n){void 0===n&&(n={});var r=o.getGeom(t),s=o.getGeom(e),u=a.default.intersection(r.coordinates,s.coordinates);return 0===u.length?null:1===u.length?i.polygon(u[0],n.properties):i.multiPolygon(u,n.properties)}},611:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102);e.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")},e.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},e.containsNumber=function t(e){if(e.length>1&&r.isNumber(e[0])&&r.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=t.features;r<i.length;r++){var o=i[r];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type)}},e.getGeom=function(t){return"Feature"===t.type?t.geometry:t},e.getType=function(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}},3663:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(4102),o=n(611),a=r(n(4590)),s=n(1540),u=r(n(1787));function l(t,e){var n=o.getCoords(t),r=o.getCoords(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var a=n[0][0],s=n[0][1],u=n[1][0],l=n[1][1],c=r[0][0],h=r[0][1],f=r[1][0],p=r[1][1],d=(p-h)*(u-a)-(f-c)*(l-s);if(0===d)return null;var y=((f-c)*(s-h)-(p-h)*(a-c))/d,m=((u-a)*(s-h)-(l-s)*(a-c))/d;if(y>=0&&y<=1&&m>=0&&m<=1){var g=a+y*(u-a),_=s+y*(l-s);return i.point([g,_])}return null}e.default=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=i.feature(t)),"LineString"===e.type&&(e=i.feature(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var c=l(t,e);return c&&r.push(c),i.featureCollection(r)}var h=u.default();return h.load(a.default(e)),s.featureEach(a.default(t),(function(t){s.featureEach(h.search(t),(function(e){var i=l(t,e);if(i){var a=o.getCoords(i).join(",");n[a]||(n[a]=!0,r.push(i))}}))})),i.featureCollection(r)}},4590:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102),i=n(611),o=n(1540);e.default=function(t){if(!t)throw new Error("geojson is required");var e=[];return o.flattenEach(t,(function(t){!function(t,e){var n=[],o=t.geometry;if(null!==o){switch(o.type){case"Polygon":n=i.getCoords(o);break;case"LineString":n=[i.getCoords(o)]}n.forEach((function(n){var i=function(t,e){var n=[];return t.reduce((function(t,i){var o,a,s,u,l,c,h=r.lineString([t,i],e);return h.bbox=(a=i,s=(o=t)[0],u=o[1],[s<(l=a[0])?s:l,u<(c=a[1])?u:c,s>l?s:l,u>c?u:c]),n.push(h),i})),n}(n,t.properties);i.forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),r.featureCollection(e)}},1540:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102);function i(t,e,n){if(null!==t)for(var r,o,a,s,u,l,c,h,f=0,p=0,d=t.type,y="FeatureCollection"===d,m="Feature"===d,g=y?t.features.length:1,_=0;_<g;_++){u=(h=!!(c=y?t.features[_].geometry:m?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var b=0;b<u;b++){var v=0,T=0;if(null!==(s=h?c.geometries[b]:c)){l=s.coordinates;var E=s.type;switch(f=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":if(!1===e(l,p,_,v,T))return!1;p++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],p,_,v,T))return!1;p++,"MultiPoint"===E&&v++}"LineString"===E&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-f;o++){if(!1===e(l[r][o],p,_,v,T))return!1;p++}"MultiLineString"===E&&v++,"Polygon"===E&&T++}"Polygon"===E&&v++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(T=0,o=0;o<l[r].length;o++){for(a=0;a<l[r][o].length-f;a++){if(!1===e(l[r][o][a],p,_,v,T))return!1;p++}T++}v++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===i(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function s(t,e){var n,r,i,o,a,s,u,l,c,h,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,y=p?t.features.length:1;for(n=0;n<y;n++){for(s=p?t.features[n].geometry:d?t.geometry:t,l=p?t.features[n].properties:d?t.properties:{},c=p?t.features[n].bbox:d?t.bbox:void 0,h=p?t.features[n].id:d?t.id:void 0,a=(u=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=u?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,c,h))return!1;f++}}function u(t,e){s(t,(function(t,n,i,o,a){var s,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature(t,i,{bbox:o,id:a}),n,0)&&void 0}switch(u){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c={type:s,coordinates:t.coordinates[l]};if(!1===e(r.feature(c,i),n,l))return!1}}))}function l(t,e){u(t,(function(t,n,o){var a=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var u,l=0,c=0,h=0;return!1!==i(t,(function(i,s,f,p,d){if(void 0===u||n>l||p>c||d>h)return u=i,l=n,c=p,h=d,void(a=0);var y=r.lineString([u,i],t.properties);if(!1===e(y,n,o,d,a))return!1;a++,u=i}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(!1===e(r.lineString(a[s],t.properties),n,i,s))return!1}}}))}e.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,(function(t,r,i,a,s){o=0===r&&void 0===n?t:e(o,t,r,i,a,s)}),r),o},e.featureEach=a,e.featureReduce=function(t,e,n){var r=n;return a(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.findPoint=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return r.point(l,u,e);case"MultiPoint":return o<0&&(o=l.length+o),r.point(l[o],u,e);case"LineString":return s<0&&(s=l.length+s),r.point(l[s],u,e);case"Polygon":return a<0&&(a=l.length+a),s<0&&(s=l[a].length+s),r.point(l[a][s],u,e);case"MultiLineString":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),r.point(l[o][s],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),s<0&&(s=l[o][a].length-s),r.point(l[o][a][s],u,e)}throw new Error("geojson is invalid")},e.findSegment=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,a=e.geometryIndex||0,s=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),r.lineString([l[s],l[s+1]],u,e);case"Polygon":return a<0&&(a=l.length+a),s<0&&(s=l[a].length+s-1),r.lineString([l[a][s],l[a][s+1]],u,e);case"MultiLineString":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),r.lineString([l[o][s],l[o][s+1]],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),s<0&&(s=l[o][a].length-s-1),r.lineString([l[o][a][s],l[o][a][s+1]],u,e)}throw new Error("geojson is invalid")},e.flattenEach=u,e.flattenReduce=function(t,e,n){var r=n;return u(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r},e.geomEach=s,e.geomReduce=function(t,e,n){var r=n;return s(t,(function(t,i,o,a,s){r=0===i&&void 0===n?t:e(r,t,i,o,a,s)})),r},e.lineEach=c,e.lineReduce=function(t,e,n){var r=n;return c(t,(function(t,i,o,a){r=0===i&&void 0===n?t:e(r,t,i,o,a)})),r},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.segmentEach=l,e.segmentReduce=function(t,e,n){var r=n,i=!1;return l(t,(function(t,o,a,s,u){r=!1===i&&void 0===n?t:e(r,t,o,a,s,u),i=!0})),r}},3892:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(1013)),o=n(4102),a=n(611),s=n(1540),u=r(n(6213));function l(t,e){return t[0]*e[0]+t[1]*e[1]}function c(t,e,n){return"planar"===n.method?u.default(t,e,n):i.default(t,e,n)}e.default=function(t,e,n){if(void 0===n&&(n={}),n.method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=o.point(t):"Point"===t.type?t=o.feature(t):a.featureOf(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=o.lineString(e):"LineString"===e.type?e=o.feature(e):a.featureOf(e,"LineString","line");var r=1/0,i=t.geometry.coordinates;return s.segmentEach(e,(function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],a=function(t,e,n,r){var i=[n[0]-e[0],n[1]-e[1]],o=l([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return c(t,e,{method:r.method,units:"degrees"});var a=l(i,i);if(a<=o)return c(t,n,{method:r.method,units:"degrees"});var s=o/a;return c(t,[e[0]+s*i[0],e[1]+s*i[1]],{method:r.method,units:"degrees"})}(i,e,o,n);a<r&&(r=a)})),o.convertLength(r,"degrees",n.units)}},7383:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102),i=n(611);function o(t,e){return void 0===e&&(e={}),s(i.getGeom(t).coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function a(t,e){void 0===e&&(e={});var n=i.getGeom(t).coordinates,o=e.properties?e.properties:"Feature"===t.type?t.properties:{},a=[];return n.forEach((function(t){a.push(s(t,o))})),r.featureCollection(a)}function s(t,e){return t.length>1?r.multiLineString(t,e):r.lineString(t[0],e)}e.default=function(t,e){void 0===e&&(e={});var n=i.getGeom(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return o(n,e);case"MultiPolygon":return a(n,e);default:throw new Error("invalid poly")}},e.polygonToLine=o,e.multiPolygonToLine=a,e.coordsToLine=s},6213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102),i=n(611);e.default=function(t,e,n){void 0===n&&(n={});var o=i.getCoord(t),a=i.getCoord(e);a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0;var s=function(t,e,n){var i=n=void 0===n?r.earthRadius:Number(n),o=t[1]*Math.PI/180,a=e[1]*Math.PI/180,s=a-o,u=Math.abs(e[0]-t[0])*Math.PI/180;u>Math.PI&&(u-=2*Math.PI);var l=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),c=Math.abs(l)>1e-11?s/l:Math.cos(o);return Math.sqrt(s*s+c*c*u*u)*i}(o,a);return r.convertLength(s,"meters",n.units)}},8583:(t,e,n)=>{"use strict";var r=n(7418);function i(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0}function o(t){return n.g.Buffer&&"function"==typeof n.g.Buffer.isBuffer?n.g.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=n(69),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,l="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function h(t){return!o(t)&&"function"==typeof n.g.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer)))}var f=t.exports=_,p=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(a.isFunction(t)){if(l)return t.name;var e=t.toString().match(p);return e&&e[1]}}function y(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function m(t){if(l||!a.isFunction(t))return a.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function g(t,e,n,r,i){throw new f.AssertionError({message:n,actual:t,expected:e,operator:r,stackStartFunction:i})}function _(t,e){t||g(t,!0,e,"==",f.ok)}function b(t,e,n,r){if(t===e)return!0;if(o(t)&&o(e))return 0===i(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(h(t)&&h(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(o(t)!==o(e))return!1;var s=(r=r||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===r.expected.indexOf(e)||(r.actual.push(t),r.expected.push(e),function(t,e,n,r){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(n&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=v(t),o=v(e);if(i&&!o||!i&&o)return!1;if(i)return b(t=u.call(t),e=u.call(e),n);var s,l,c=w(t),h=w(e);if(c.length!==h.length)return!1;for(c.sort(),h.sort(),l=c.length-1;l>=0;l--)if(c[l]!==h[l])return!1;for(l=c.length-1;l>=0;l--)if(!b(t[s=c[l]],e[s],n,r))return!1;return!0}(t,e,n,r))}return n?t===e:t==e}function v(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function T(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function E(t,e,n,r){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&g(i,n,"Missing expected exception"+r);var o="string"==typeof r,s=!t&&i&&!n;if((!t&&a.isError(i)&&o&&T(i,n)||s)&&g(i,n,"Got unwanted exception"+r),t&&i&&n&&!T(i,n)||!t&&i)throw i}f.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return y(m(t.actual),128)+" "+t.operator+" "+y(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=d(e),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(f.AssertionError,Error),f.fail=g,f.ok=_,f.equal=function(t,e,n){t!=e&&g(t,e,n,"==",f.equal)},f.notEqual=function(t,e,n){t==e&&g(t,e,n,"!=",f.notEqual)},f.deepEqual=function(t,e,n){b(t,e,!1)||g(t,e,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,n){b(t,e,!0)||g(t,e,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,n){b(t,e,!1)&&g(t,e,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,n,r){b(e,n,!0)&&g(e,n,r,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,n){t!==e&&g(t,e,n,"===",f.strictEqual)},f.notStrictEqual=function(t,e,n){t===e&&g(t,e,n,"!==",f.notStrictEqual)},f.throws=function(t,e,n){E(!0,t,e,n)},f.doesNotThrow=function(t,e,n){E(!1,t,e,n)},f.ifError=function(t){if(t)throw t},f.strict=r((function t(e,n){e||g(e,!0,n,"==",t)}),f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var w=Object.keys||function(t){var e=[];for(var n in t)s.call(t,n)&&e.push(n);return e}},6076:t=>{"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},2014:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},69:(t,e,n)=>{var r=n(4155),i=n(5108),o=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(u(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),s=r[n];n<i;s=r[++n])m(s)||!T(s)?a+=" "+s:a+=" "+u(s);return a},e.deprecate=function(t,o){if(b(n.g.process))return function(){return e.deprecate(t,o).apply(this,arguments)};if(!0===r.noDeprecation)return t;var a=!1;return function(){if(!a){if(r.throwDeprecation)throw new Error(o);r.traceDeprecation?i.trace(o):i.error(o),a=!0}return t.apply(this,arguments)}};var a,s={};function u(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&e._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),h(r,t,r.depth)}function l(t,e){var n=u.styles[e];return n?"["+u.colors[n][0]+"m"+t+"["+u.colors[n][1]+"m":t}function c(t,e){return t}function h(t,n,r){if(t.customInspect&&n&&x(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return _(i)||(i=h(t,i,r)),i}var o=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return g(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,n);if(o)return o;var a=Object.keys(n),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),w(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(x(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(v(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return t.stylize(Date.prototype.toString.call(n),"date");if(w(n))return f(n)}var l,c="",T=!1,C=["{","}"];return d(n)&&(T=!0,C=["[","]"]),x(n)&&(c=" [Function"+(n.name?": "+n.name:"")+"]"),v(n)&&(c=" "+RegExp.prototype.toString.call(n)),E(n)&&(c=" "+Date.prototype.toUTCString.call(n)),w(n)&&(c=" "+f(n)),0!==a.length||T&&0!=n.length?r<0?v(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),l=T?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)O(e,String(a))?o.push(p(t,e,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(t,e,n,r,i,!0))})),o}(t,n,r,s,a):a.map((function(e){return p(t,n,r,s,e,T)})),t.seen.pop(),function(t,e,n){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(l,c,C)):C[0]+c+C[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),O(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(n)?h(t,u.value,null):h(t,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return void 0===t}function v(t){return T(t)&&"[object RegExp]"===C(t)}function T(t){return"object"==typeof t&&null!==t}function E(t){return T(t)&&"[object Date]"===C(t)}function w(t){return T(t)&&("[object Error]"===C(t)||t instanceof Error)}function x(t){return"function"==typeof t}function C(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(b(a)&&(a=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!s[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=r.pid;s[t]=function(){var r=e.format.apply(e,arguments);i.error("%s %d: %s",t,n,r)}}else s[t]=function(){};return s[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=_,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=v,e.isObject=T,e.isDate=E,e.isError=w,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(2014);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){i.log("%s - %s",N(),e.format.apply(e,arguments))},e.inherits=n(6076),e._extend=function(t,e){if(!e||!T(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,o=u(t),a=o[0],s=o[1],l=new i(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),c=0,h=s>0?a-4:a;for(n=0;n<h;n+=4)e=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],l[c++]=e>>16&255,l[c++]=e>>8&255,l[c++]=255&e;return 2===s&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[c++]=255&e),1===s&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e),l},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=16383,s=0,u=r-i;s<u;s+=a)o.push(l(t,s,s+a>u?u:s+a));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,r){for(var i,o,a=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:(t,e,n)=>{"use strict";var r=n(5108),i=n(9742),o=n(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50;var s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|m(t,e),r=u(n),i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){var e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return d(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return d(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return l.from(r,e,n);var i=function(t){if(l.isBuffer(t)){var e=0|y(t.length),n=u(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?u(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),u(t<0?0:0|y(t))}function p(t){for(var e=t.length<0?0:0|y(t.length),n=u(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function d(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,l.prototype),r}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(i)return r?-1:B(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return O(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return M(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=n;o<s;o++)if(l(t,o)===l(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(l(t,o+f)!==l(e,f)){h=!1;break}if(h)return o}return-1}function T(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(q(s))return a;t[n+a]=s}return a}function E(t,e,n,r){return G(B(e,t.length-n),t,n,r)}function w(t,e,n,r){return G(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return G(j(e),t,n,r)}function C(t,e,n,r){return G(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(n=t.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function M(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,l=t[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(t){var e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=N));return n}(r)}e.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||void 0===r||"function"!=typeof r.error||r.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,e,n){return c(t,e,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,e,n){return function(t,e,n){return h(t),t<=0?u(t):void 0!==e?"string"==typeof n?u(t).fill(e,n):u(t).fill(e):u(t)}(t,e,n)},l.allocUnsafe=function(t){return f(t)},l.allocUnsafeSlow=function(t){return f(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(W(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=l.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(W(o,Uint8Array))i+o.length>r.length?l.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},l.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(t,e,n,r,i){if(W(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return b(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return b(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return w(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function O(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function A(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function I(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=H[t[o]];return i}function P(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function k(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function F(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,n){return k(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return k(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var i=t.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=l.isBuffer(t)?t:l.from(t,r),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var U=/[^+/0-9A-Za-z-_]/g;function B(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var H=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)e[r+i]=t[n]+t[i];return e}()},584:t=>{t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},5108:(t,e,n)=>{var r=n(9539),i=n(8583);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==n.g&&n.g.console?n.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var l=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=o()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var n=o()-e;a.log(t+": "+n+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=r.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(r.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);i.ok(!1,r.format.apply(null,e))}},"assert"]],c=0;c<l.length;c++){var h=l[c],f=h[0],p=h[1];a[p]||(a[p]=f)}t.exports=a},7187:(t,e,n)=>{var r=n(5108),i=Object.create||function(t){var e=function(){};return e.prototype=t,new e},o=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return n},a=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=i(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;var u,l=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),u=0===c.x}catch(t){u=!1}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function f(t,e,n){if(e)t.call(n);else for(var r=t.length,i=E(t,r),o=0;o<r;++o)i[o].call(n)}function p(t,e,n,r){if(e)t.call(n,r);else for(var i=t.length,o=E(t,i),a=0;a<i;++a)o[a].call(n,r)}function d(t,e,n,r,i){if(e)t.call(n,r,i);else for(var o=t.length,a=E(t,o),s=0;s<o;++s)a[s].call(n,r,i)}function y(t,e,n,r,i,o){if(e)t.call(n,r,i,o);else for(var a=t.length,s=E(t,a),u=0;u<a;++u)s[u].call(n,r,i,o)}function m(t,e,n,r){if(e)t.apply(n,r);else for(var i=t.length,o=E(t,i),a=0;a<i;++a)o[a].apply(n,r)}function g(t,e,n,o){var a,s,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=t._events)?(s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),u=s[e]):(s=t._events=i(null),t._eventsCount=0),u){if("function"==typeof u?u=s[e]=o?[n,u]:[u,n]:o?u.unshift(n):u.push(n),!u.warned&&(a=h(t))&&a>0&&u.length>a){u.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+u.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=u.length,"object"==typeof r&&r.warn&&r.warn("%s: %s",l.name,l.message)}}else u=s[e]=n,++t._eventsCount;return t}function _(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function b(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=a.call(_,r);return i.listener=n,r.wrapFn=i,i}function v(t,e,n){var r=t._events;if(!r)return[];var i=r[e];return i?"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):E(i,i.length):[]}function T(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function E(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}u?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');l=t}}):s.defaultMaxListeners=l,s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return h(this)},s.prototype.emit=function(t){var e,n,r,i,o,a,s="error"===t;if(a=this._events)s=s&&null==a.error;else if(!s)return!1;if(s){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var u=new Error('Unhandled "error" event. ('+e+")");throw u.context=e,u}if(!(n=a[t]))return!1;var l="function"==typeof n;switch(r=arguments.length){case 1:f(n,l,this);break;case 2:p(n,l,this,arguments[1]);break;case 3:d(n,l,this,arguments[1],arguments[2]);break;case 4:y(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];m(n,l,this,i)}return!0},s.prototype.addListener=function(t,e){return g(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return g(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,b(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,b(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,o,a,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=i(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===e||n[a].listener===e){s=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(t,e){for(var n=e,r=n+1,i=t.length;r<i;n+=1,r+=1)t[n]=t[r];t.pop()}(n,o),1===n.length&&(r[t]=n[0]),r.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.removeAllListeners=function(t){var e,n,r;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=i(null),this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=i(null):delete n[t]),this;if(0===arguments.length){var a,s=o(n);for(r=0;r<s.length;++r)"removeListener"!==(a=s[r])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=i(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return v(this,t,!0)},s.prototype.rawListeners=function(t){return v(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):T.call(t,e)},s.prototype.listenerCount=T,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},7769:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";var Buffer=__webpack_require__(3085).Buffer;const{multiByteIndexOf,stringToBytes,readUInt64LE,tarHeaderChecksumMatches,uint8ArrayUtf8ByteString}=__webpack_require__(6188),supported=__webpack_require__(9898),xpiZipFilename=stringToBytes("META-INF/mozilla.rsa"),oxmlContentTypes=stringToBytes("[Content_Types].xml"),oxmlRels=stringToBytes("_rels/.rels"),fileType=t=>{if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||Buffer.isBuffer(t)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof t}\``);const e=t instanceof Uint8Array?t:new Uint8Array(t);if(!(e&&e.length>1))return;const n=(t,n)=>{n={offset:0,...n};for(let r=0;r<t.length;r++)if(n.mask){if(t[r]!==(n.mask[r]&e[r+n.offset]))return!1}else if(t[r]!==e[r+n.offset])return!1;return!0},r=(t,e)=>n(stringToBytes(t),e);if(n([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(n([137,80,78,71,13,10,26,10])){const t=33,n=e.findIndex(((n,r)=>r>=t&&73===e[r]&&68===e[r+1]&&65===e[r+2]&&84===e[r+3])),r=e.subarray(t,n);return r.findIndex(((t,e)=>97===r[e]&&99===r[e+1]&&84===r[e+2]&&76===r[e+3]))>=0?{ext:"apng",mime:"image/apng"}:{ext:"png",mime:"image/png"}}if(n([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(n([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((n([73,73,42,0])||n([77,77,0,42]))&&n([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(n([73,73,42,0])&&(n([16,251,134,1],{offset:4})||n([8,0,0,0],{offset:4}))&&n([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9}))return{ext:"arw",mime:"image/x-sony-arw"};if(n([73,73,42,0,8,0,0,0])&&(n([45,0,254,0],{offset:8})||n([39,0,254,0],{offset:8})))return{ext:"dng",mime:"image/x-adobe-dng"};if(n([73,73,42,0])&&n([28,0,254,0],{offset:8}))return{ext:"nef",mime:"image/x-nikon-nef"};if(n([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(n([73,73,42,0])||n([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n([66,77]))return{ext:"bmp",mime:"image/bmp"};if(n([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(n([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};const i=[80,75,3,4];if(n(i)){if(n([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(n(xpiZipFilename,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(r("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(r("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};let t,o=0,a=!1;do{const s=o+30;if(a||(a=n(oxmlContentTypes,{offset:s})||n(oxmlRels,{offset:s})),t||(r("word/",{offset:s})?t={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:r("ppt/",{offset:s})?t={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:r("xl/",{offset:s})&&(t={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),a&&t)return t;o=multiByteIndexOf(e,i,s)}while(o>=0);if(t)return t}if(n([80,75])&&(3===e[2]||5===e[2]||7===e[2])&&(4===e[3]||6===e[3]||8===e[3]))return{ext:"zip",mime:"application/zip"};if(n([48,48,48,48,48,48],{offset:148,mask:[248,248,248,248,248,248]})&&tarHeaderChecksumMatches(e))return{ext:"tar",mime:"application/x-tar"};if(n([82,97,114,33,26,7])&&(0===e[6]||1===e[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(n([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(n([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(n([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(n([102,114,101,101],{offset:4})||n([109,100,97,116],{offset:4})||n([109,111,111,118],{offset:4})||n([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(n([102,116,121,112],{offset:4})&&0!=(96&e[8])&&0!=(96&e[9])&&0!=(96&e[10])&&0!=(96&e[11])){const t=uint8ArrayUtf8ByteString(e,8,12);switch(t){case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt ":return{ext:"mov",mime:"video/quicktime"};case"M4V ":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P ":return{ext:"m4p",mime:"video/mp4"};case"M4B ":return{ext:"m4b",mime:"audio/mp4"};case"M4A ":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V ":return{ext:"f4v",mime:"video/mp4"};case"F4P ":return{ext:"f4p",mime:"video/mp4"};case"F4A ":return{ext:"f4a",mime:"audio/mp4"};case"F4B ":return{ext:"f4b",mime:"audio/mp4"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(n([26,69,223,163])){const t=e.subarray(4,4100),n=t.findIndex(((t,e,n)=>66===n[e]&&130===n[e+1]));if(-1!==n){const e=n+3,r=n=>[...n].every(((n,r)=>t[e+r]===n.charCodeAt(0)));if(r("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(r("webm"))return{ext:"webm",mime:"video/webm"}}}if(n([82,73,70,70])){if(n([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(n([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(n([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(n([48,38,178,117,142,102,207,17,166,217])){let t=30;do{const r=readUInt64LE(e,t+16);if(n([145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101],{offset:t})){if(n([64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wma",mime:"audio/x-ms-wma"};if(n([192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wmv",mime:"video/x-ms-asf"};break}t+=r}while(t+24<=e.length);return{ext:"asf",mime:"application/vnd.ms-asf"}}if(n([0,0,1,186])||n([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};for(let t=0;t<2&&t<e.length-16;t++){if(n([73,68,51],{offset:t})||n([255,226],{offset:t,mask:[255,230]}))return{ext:"mp3",mime:"audio/mpeg"};if(n([255,228],{offset:t,mask:[255,230]}))return{ext:"mp2",mime:"audio/mpeg"};if(n([255,248],{offset:t,mask:[255,252]}))return{ext:"mp2",mime:"audio/mpeg"};if(n([255,240],{offset:t,mask:[255,252]}))return{ext:"mp4",mime:"audio/mpeg"}}if(n([79,112,117,115,72,101,97,100],{offset:28}))return{ext:"opus",mime:"audio/opus"};if(n([79,103,103,83]))return n([128,116,104,101,111,114,97],{offset:28})?{ext:"ogv",mime:"video/ogg"}:n([1,118,105,100,101,111,0],{offset:28})?{ext:"ogm",mime:"video/ogg"}:n([127,70,76,65,67],{offset:28})?{ext:"oga",mime:"audio/ogg"}:n([83,112,101,101,120,32,32],{offset:28})?{ext:"spx",mime:"audio/ogg"}:n([1,118,111,114,98,105,115],{offset:28})?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"};if(n([102,76,97,67]))return{ext:"flac",mime:"audio/x-flac"};if(n([77,65,67,32]))return{ext:"ape",mime:"audio/ape"};if(n([119,118,112,107]))return{ext:"wv",mime:"audio/wavpack"};if(n([35,33,65,77,82,10]))return{ext:"amr",mime:"audio/amr"};if(n([37,80,68,70]))return{ext:"pdf",mime:"application/pdf"};if(n([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if((67===e[0]||70===e[0])&&n([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(n([123,92,114,116,102]))return{ext:"rtf",mime:"application/rtf"};if(n([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(n([119,79,70,70])&&(n([0,1,0,0],{offset:4})||n([79,84,84,79],{offset:4})))return{ext:"woff",mime:"font/woff"};if(n([119,79,70,50])&&(n([0,1,0,0],{offset:4})||n([79,84,84,79],{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(n([76,80],{offset:34})&&(n([0,0,1],{offset:8})||n([1,0,2],{offset:8})||n([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(n([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(n([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(n([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(n([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(n([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(n([37,33]))return{ext:"ps",mime:"application/postscript"};if(n([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(n([83,81,76,105]))return{ext:"sqlite",mime:"application/x-sqlite3"};if(n([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(n([67,114,50,52]))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(n([77,83,67,70])||n([73,83,99,40]))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(n([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121]))return{ext:"deb",mime:"application/x-deb"};if(n([33,60,97,114,99,104,62]))return{ext:"ar",mime:"application/x-unix-archive"};if(n([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(n([31,160])||n([31,157]))return{ext:"Z",mime:"application/x-compress"};if(n([76,90,73,80]))return{ext:"lz",mime:"application/x-lzip"};if(n([208,207,17,224,161,177,26,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62]))return{ext:"msi",mime:"application/x-msi"};if(n([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(n([71],{offset:4})&&(n([71],{offset:192})||n([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(n([66,76,69,78,68,69,82]))return{ext:"blend",mime:"application/x-blender"};if(n([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(n([0,0,0,12,106,80,32,32,13,10,135,10])){if(n([106,112,50,32],{offset:20}))return{ext:"jp2",mime:"image/jp2"};if(n([106,112,120,32],{offset:20}))return{ext:"jpx",mime:"image/jpx"};if(n([106,112,109,32],{offset:20}))return{ext:"jpm",mime:"image/jpm"};if(n([109,106,112,50],{offset:20}))return{ext:"mj2",mime:"image/mj2"}}return n([70,79,82,77])?{ext:"aif",mime:"audio/aiff"}:r("<?xml ")?{ext:"xml",mime:"application/xml"}:n([66,79,79,75,77,79,66,73],{offset:60})?{ext:"mobi",mime:"application/x-mobipocket-ebook"}:n([171,75,84,88,32,49,49,187,13,10,26,10])?{ext:"ktx",mime:"image/ktx"}:n([68,73,67,77],{offset:128})?{ext:"dcm",mime:"application/dicom"}:n([77,80,43])||n([77,80,67,75])?{ext:"mpc",mime:"audio/x-musepack"}:n([66,69,71,73,78,58])?{ext:"ics",mime:"text/calendar"}:n([103,108,84,70,2,0,0,0])?{ext:"glb",mime:"model/gltf-binary"}:n([212,195,178,161])||n([161,178,195,212])?{ext:"pcap",mime:"application/vnd.tcpdump.pcap"}:n([68,83,68,32])?{ext:"dsf",mime:"audio/x-dsf"}:n([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70])?{ext:"lnk",mime:"application/x.ms.shortcut"}:n([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0])?{ext:"alias",mime:"application/x.apple.alias"}:r("Creative Voice File")?{ext:"voc",mime:"audio/x-voc"}:n([11,119])?{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"}:(n([126,16,4])||n([126,24,4]))&&n([48,77,73,69],{offset:4})?{ext:"mie",mime:"application/x-mie"}:n([65,82,82,79,87,49,0,0])?{ext:"arrow",mime:"application/x-apache-arrow"}:n([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2})?{ext:"shp",mime:"application/x-esri-shape"}:void 0};module.exports=fileType,Object.defineProperty(fileType,"minimumBytes",{value:4100}),fileType.stream=readableStream=>new Promise(((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",(()=>{const t=new stream.PassThrough,e=readableStream.read(module.exports.minimumBytes)||readableStream.read();try{t.fileType=fileType(e)}catch(t){reject(t)}readableStream.unshift(e),stream.pipeline?resolve(stream.pipeline(readableStream,t,(()=>{}))):resolve(readableStream.pipe(t))}))})),Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)})},9898:t=>{"use strict";t.exports={extensions:["jpg","png","apng","gif","webp","flif","cr2","orf","arw","dng","nef","rw2","raf","tif","bmp","jxr","psd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","msi","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","wmv","wma","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-canon-cr2","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-wma","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-msi","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/ktx","application/dicom","audio/x-musepack","text/calendar","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape"]}},6188:(t,e,n)=>{"use strict";var r=n(3085).Buffer;e.stringToBytes=t=>[...t].map((t=>t.charCodeAt(0)));const i=(t,e,n)=>String.fromCharCode(...t.slice(e,n));e.readUInt64LE=(t,e=0)=>{let n=t[e],r=1,i=0;for(;++i<8;)r*=256,n+=t[e+i]*r;return n},e.tarHeaderChecksumMatches=t=>{if(t.length<512)return!1;let e=256,n=0;for(let r=0;r<148;r++){const i=t[r];e+=i,n+=128&i}for(let r=156;r<512;r++){const i=t[r];e+=i,n+=128&i}const r=parseInt(i(t,148,154),8);return r===e||r===e-(n<<1)},e.multiByteIndexOf=(t,e,n=0)=>{if(r&&r.isBuffer(t))return t.indexOf(r.from(e),n);const i=(t,e,n)=>{for(let r=1;r<e.length;r++)if(e[r]!==t[n+r])return!1;return!0};let o=t.indexOf(e[0],n);for(;o>=0;){if(i(t,e,o))return o;o=t.indexOf(e[0],o+1)}return-1},e.uint8ArrayUtf8ByteString=i},1787:(t,e,n)=>{var r=n(2582),i=n(4102),o=n(1540),a=n(9705).default,s=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function l(t){var e=new r(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),r.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.remove.call(this,t,e)},e.clear=function(){return r.prototype.clear.call(this)},e.search=function(t){var e=r.prototype.search.call(this,this.toBBox(t));return u(e)},e.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=r.prototype.all.call(this);return u(t)},e.toJSON=function(){return r.prototype.toJSON.call(this)},e.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=l,t.exports.default=l},645:(t,e)=>{e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+p]=255&a,p+=d,a/=256,l-=8);t[n+p-d]|=128*y}},8849:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(9126),i=Object.keys(r.typeHandlers),o={56:"psd",66:"bmp",68:"dds",71:"gif",73:"tiff",77:"tiff",82:"webp",105:"icns",137:"png",255:"jpg"};e.detector=function(t){const e=t[0];if(e in o){const n=o[e];if(r.typeHandlers[n].validate(t))return n}return i.find((e=>r.typeHandlers[e].validate(t)))}},9248:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(8497);if(!("promises"in r)){class t{constructor(t){this.fd=t}stat(){return new Promise(((t,e)=>{r.fstat(this.fd,((n,r)=>{n?e(n):t(r)}))}))}read(t,e,n,i){return new Promise(((o,a)=>{r.read(this.fd,t,e,n,i,(t=>{t?a(t):o()}))}))}close(){return new Promise(((t,e)=>{r.close(this.fd,(n=>{n?e(n):t()}))}))}}Object.defineProperty(r,"promises",{value:{open:(e,n)=>new Promise(((i,o)=>{r.open(e,n,((e,n)=>{e?o(e):i(new t(n))}))}))},writable:!1})}},7935:function(t,e,n){"use strict";var r=n(3085).Buffer,i=n(4155),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const a=n(8497),s=n(3935),u=n(9189),l=n(9126),c=n(8849);n(9248);const h=524288,f=new u.default({concurrency:100,autostart:!0});function p(t,e){const n=c.detector(t);if(n&&n in l.typeHandlers){const r=l.typeHandlers[n].calculate(t,e);if(void 0!==r)return r.type=n,r}throw new TypeError("unsupported file type: "+n+" (file: "+e+")")}function d(t,e){if(r.isBuffer(t))return p(t);if("string"!=typeof t)throw new TypeError("invalid invocation");const n=s.resolve(t);if("function"!=typeof e){const t=function(t){const e=a.openSync(t,"r"),n=a.fstatSync(e).size,i=Math.min(n,h),o=r.alloc(i);return a.readSync(e,o,0,i,0),a.closeSync(e),o}(n);return p(t,n)}f.push((()=>function(t){return o(this,void 0,void 0,(function*(){const e=yield a.promises.open(t,"r"),{size:n}=yield e.stat();if(n<=0)throw new Error("Empty file");const i=Math.min(n,h),o=r.alloc(i);return yield e.read(o,0,i,0),yield e.close(),o}))}(n).then((t=>i.nextTick(e,null,p(t,n)))).catch(e)))}t.exports=e=d,e.imageSize=d,e.setConcurrency=t=>{f.concurrency=t},e.types=Object.keys(l.typeHandlers)},8557:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.readUInt=function(t,e,n,r){return n=n||0,t["readUInt"+e+(r?"BE":"LE")].call(t,n)}},9126:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(3645),i=n(3552),o=n(1680),a=n(1542),s=n(7163),u=n(7800),l=n(6625),c=n(1558),h=n(2229),f=n(4663),p=n(6221),d=n(7851),y=n(2602),m=n(8531),g=n(9948),_=n(5236);e.typeHandlers={bmp:r.BMP,cur:i.CUR,dds:o.DDS,gif:a.GIF,icns:s.ICNS,ico:u.ICO,j2c:l.J2C,jp2:c.JP2,jpg:h.JPG,ktx:f.KTX,png:p.PNG,pnm:d.PNM,psd:y.PSD,svg:m.SVG,tiff:g.TIFF,webp:_.WEBP}},3645:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BMP={validate:t=>"BM"===t.toString("ascii",0,2),calculate:t=>({height:Math.abs(t.readInt32LE(22)),width:t.readUInt32LE(18)})}},3552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(7800);e.CUR={validate:t=>0===t.readUInt16LE(0)&&2===t.readUInt16LE(2),calculate:t=>r.ICO.calculate(t)}},1680:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DDS={validate:t=>542327876===t.readUInt32LE(0),calculate:t=>({height:t.readUInt32LE(12),width:t.readUInt32LE(16)})}},1542:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=/^GIF8[79]a/;e.GIF={validate(t){const e=t.toString("ascii",0,6);return n.test(e)},calculate:t=>({height:t.readUInt16LE(8),width:t.readUInt16LE(6)})}},7163:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n={ICON:32,"ICN#":32,"icm#":16,icm4:16,icm8:16,"ics#":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function r(t,e){const n=e+4;return[t.toString("ascii",e,n),t.readUInt32BE(n)]}function i(t){const e=n[t];return{width:e,height:e,type:t}}e.ICNS={validate:t=>"icns"===t.toString("ascii",0,4),calculate(t){const e=t.length,n=t.readUInt32BE(4);let o=8,a=r(t,o),s=i(a[0]);if(o+=a[1],o===n)return s;const u={height:s.height,images:[s],width:s.width};for(;o<n&&o<e;)a=r(t,o),s=i(a[0]),o+=a[1],u.images.push(s);return u}}},7800:(t,e)=>{"use strict";function n(t,e){const n=t.readUInt8(e);return 0===n?256:n}function r(t,e){const r=6+16*e;return{height:n(t,r+1),width:n(t,r)}}Object.defineProperty(e,"__esModule",{value:!0}),e.ICO={validate:t=>0===t.readUInt16LE(0)&&1===t.readUInt16LE(2),calculate(t){const e=t.readUInt16LE(4),n=r(t,0);if(1===e)return n;const i=[n];for(let n=1;n<e;n+=1)i.push(r(t,n));return{height:n.height,images:i,width:n.width}}}},6625:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.J2C={validate:t=>"ff4fff51"===t.toString("hex",0,4),calculate:t=>({height:t.readUInt32BE(12),width:t.readUInt32BE(8)})}},1558:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t=>({height:t.readUInt32BE(4),width:t.readUInt32BE(8)});e.JP2={validate(t){const e=t.toString("hex",4,8),n=t.readUInt32BE(0);if("6a502020"!==e||n<1)return!1;const r=n+4,i=t.readUInt32BE(n);return"66747970"===t.slice(r,r+i).toString("hex",0,4)},calculate(t){const e=t.readUInt32BE(0);let r=e+4+t.readUInt16BE(e+2);switch(t.toString("hex",r,r+4)){case"72726571":return r=r+4+4+(t=>{const e=t.readUInt8(0);let n=1+2*e;return n=n+2+t.readUInt16BE(n)*(2+e),n+2+t.readUInt16BE(n)*(16+e)})(t.slice(r+4)),n(t.slice(r+8,r+24));case"6a703268":return n(t.slice(r+8,r+24));default:throw new TypeError("Unsupported header found: "+t.toString("ascii",r,r+4))}}}},2229:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(8557);function i(t){return"45786966"===t.toString("hex",2,6)}function o(t,e){return{height:t.readUInt16BE(e),width:t.readUInt16BE(e+2)}}function a(t,e){const n=t.slice(2,e),i=n.toString("hex",6,8),o="4d4d"===i;if(o||"4949"===i)return function(t,e){const n=r.readUInt(t,16,14,e);for(let i=0;i<n;i++){const n=16+12*i,o=n+12;if(n>t.length)return;const a=t.slice(n,o);if(274===r.readUInt(a,16,0,e)){if(3!==r.readUInt(a,16,2,e))return;if(1!==r.readUInt(a,32,4,e))return;return r.readUInt(a,16,8,e)}}}(n,o)}function s(t,e){if(e>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(255!==t[e])throw new TypeError("Invalid JPG, marker table corrupted")}e.JPG={validate:t=>"ffd8"===t.toString("hex",0,2),calculate(t){let e,n;for(t=t.slice(4);t.length;){const r=t.readUInt16BE(0);if(i(t)&&(e=a(t,r)),s(t,r),n=t[r+1],192===n||193===n||194===n){const n=o(t,r+5);return e?{height:n.height,orientation:e,width:n.width}:n}t=t.slice(r+2)}throw new TypeError("Invalid JPG, no size found")}}},4663:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KTX={validate:t=>"KTX 11"===t.toString("ascii",1,7),calculate:t=>({height:t.readUInt32LE(40),width:t.readUInt32LE(36)})}},6221:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n="CgBI";e.PNG={validate(t){if("PNG\r\n\n"===t.toString("ascii",1,8)){let e=t.toString("ascii",12,16);if(e===n&&(e=t.toString("ascii",28,32)),"IHDR"!==e)throw new TypeError("Invalid PNG");return!0}return!1},calculate:t=>t.toString("ascii",12,16)===n?{height:t.readUInt32BE(36),width:t.readUInt32BE(32)}:{height:t.readUInt32BE(20),width:t.readUInt32BE(16)}}},7851:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n={P1:"pbm/ascii",P2:"pgm/ascii",P3:"ppm/ascii",P4:"pbm",P5:"pgm",P6:"ppm",P7:"pam",PF:"pfm"},r=Object.keys(n),i={default:t=>{let e=[];for(;t.length>0;){const n=t.shift();if("#"!==n[0]){e=n.split(" ");break}}if(2===e.length)return{height:parseInt(e[1],10),width:parseInt(e[0],10)};throw new TypeError("Invalid PNM")},pam:t=>{const e={};for(;t.length>0;){const n=t.shift();if(n.length>16||n.charCodeAt(0)>128)continue;const[r,i]=n.split(" ");if(r&&i&&(e[r.toLowerCase()]=parseInt(i,10)),e.height&&e.width)break}if(e.height&&e.width)return{height:e.height,width:e.width};throw new TypeError("Invalid PAM")}};e.PNM={validate(t){const e=t.toString("ascii",0,2);return r.includes(e)},calculate(t){const e=t.toString("ascii",0,2),r=n[e],o=t.toString("ascii",3).split(/[\r\n]+/);return(i[r]||i.default)(o)}}},2602:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PSD={validate:t=>"8BPS"===t.toString("ascii",0,4),calculate:t=>({height:t.readUInt32BE(14),width:t.readUInt32BE(18)})}},8531:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=/<svg\s([^>"']|"[^"]*"|'[^']*')*>/,r={height:/\sheight=(['"])([^%]+?)\1/,root:n,viewbox:/\sviewBox=(['"])(.+?)\1/,width:/\swidth=(['"])([^%]+?)\1/},i=2.54,o={cm:96/i,em:16,ex:8,m:96/i*100,mm:96/i/10,pc:96/72/12,pt:96/72};function a(t){const e=/([0-9.]+)([a-z]*)/.exec(t);if(e)return Math.round(parseFloat(e[1])*(o[e[2]]||1))}function s(t){const e=t.split(" ");return{height:a(e[3]),width:a(e[2])}}e.SVG={validate(t){const e=String(t);return n.test(e)},calculate(t){const e=t.toString("utf8").match(r.root);if(e){const t=function(t){const e=t.match(r.width),n=t.match(r.height),i=t.match(r.viewbox);return{height:n&&a(n[2]),viewbox:i&&s(i[2]),width:e&&a(e[2])}}(e[0]);if(t.width&&t.height)return function(t){return{height:t.height,width:t.width}}(t);if(t.viewbox)return function(t,e){const n=e.width/e.height;return t.width?{height:Math.floor(t.width/n),width:t.width}:t.height?{height:t.height,width:Math.floor(t.height*n)}:{height:e.height,width:e.width}}(t,t.viewbox)}throw new TypeError("Invalid SVG")}}},9948:(t,e,n)=>{"use strict";var r=n(3085).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const i=n(7990),o=n(8557);function a(t,e){const n=o.readUInt(t,16,8,e);return(o.readUInt(t,16,10,e)<<16)+n}function s(t){if(t.length>24)return t.slice(12)}const u=["49492a00","4d4d002a"];e.TIFF={validate:t=>u.includes(t.toString("hex",0,4)),calculate(t,e){if(!e)throw new TypeError("Tiff doesn't support buffer");const n="BE"===function(t){const e=t.toString("ascii",0,2);return"II"===e?"LE":"MM"===e?"BE":void 0}(t),u=function(t,e,n){const a=o.readUInt(t,32,4,n);let s=1024;const u=i.statSync(e).size;a+s>u&&(s=u-a-10);const l=r.alloc(s),c=i.openSync(e,"r");return i.readSync(c,l,0,s,a),l.slice(2)}(t,e,n),l=function(t,e){const n={};let r=t;for(;r&&r.length;){const t=o.readUInt(r,16,0,e),i=o.readUInt(r,16,2,e),u=o.readUInt(r,32,4,e);if(0===t)break;1!==u||3!==i&&4!==i||(n[t]=a(r,e)),r=s(r)}return n}(u,n),c=l[256],h=l[257];if(!c||!h)throw new TypeError("Invalid Tiff. Missing tags");return{height:h,width:c}}}},5236:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WEBP={validate(t){const e="RIFF"===t.toString("ascii",0,4),n="WEBP"===t.toString("ascii",8,12),r="VP8"===t.toString("ascii",12,15);return e&&n&&r},calculate(t){const e=t.toString("ascii",12,16);if(t=t.slice(20,30),"VP8X"===e){const e=t[0],n=0==(1&e);if(0==(192&e)&&n)return function(t){return{height:1+t.readUIntLE(7,3),width:1+t.readUIntLE(4,3)}}(t);throw new TypeError("Invalid WebP")}if("VP8 "===e&&47!==t[0])return function(t){return{height:16383&t.readInt16LE(8),width:16383&t.readInt16LE(6)}}(t);const n=t.toString("hex",3,6);if("VP8L"===e&&"9d012a"!==n)return function(t){return{height:1+((15&t[4])<<10|t[3]<<2|(192&t[2])>>6),width:1+((63&t[2])<<8|t[1])}}(t);throw new TypeError("Invalid WebP")}}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},8552:(t,e,n)=>{var r=n(852)(n(5639),"DataView");t.exports=r},1989:(t,e,n)=>{var r=n(1789),i=n(401),o=n(7667),a=n(1327),s=n(1866);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},8407:(t,e,n)=>{var r=n(7040),i=n(4125),o=n(2117),a=n(7518),s=n(4705);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},7071:(t,e,n)=>{var r=n(852)(n(5639),"Map");t.exports=r},3369:(t,e,n)=>{var r=n(4785),i=n(1285),o=n(6e3),a=n(9916),s=n(5265);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},3818:(t,e,n)=>{var r=n(852)(n(5639),"Promise");t.exports=r},8525:(t,e,n)=>{var r=n(852)(n(5639),"Set");t.exports=r},8668:(t,e,n)=>{var r=n(3369),i=n(619),o=n(2385);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},6384:(t,e,n)=>{var r=n(8407),i=n(7465),o=n(3779),a=n(7599),s=n(4758),u=n(4309);function l(t){var e=this.__data__=new r(t);this.size=e.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,t.exports=l},2705:(t,e,n)=>{var r=n(5639).Symbol;t.exports=r},1149:(t,e,n)=>{var r=n(5639).Uint8Array;t.exports=r},577:(t,e,n)=>{var r=n(852)(n(5639),"WeakMap");t.exports=r},4963:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},4636:(t,e,n)=>{var r=n(2545),i=n(5694),o=n(1469),a=n(4144),s=n(5776),u=n(6719),l=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),c=!n&&i(t),h=!n&&!c&&a(t),f=!n&&!c&&!h&&u(t),p=n||c||h||f,d=p?r(t.length,String):[],y=d.length;for(var m in t)!e&&!l.call(t,m)||p&&("length"==m||h&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,y))||d.push(m);return d}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},2488:t=>{t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},2908:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},8866:(t,e,n)=>{var r=n(2488),i=n(1469);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},4239:(t,e,n)=>{var r=n(2705),i=n(9607),o=n(2333),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},9454:(t,e,n)=>{var r=n(4239),i=n(7005);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},939:(t,e,n)=>{var r=n(2492),i=n(7005);t.exports=function t(e,n,o,a,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,s))}},2492:(t,e,n)=>{var r=n(6384),i=n(7114),o=n(8351),a=n(6096),s=n(4160),u=n(1469),l=n(4144),c=n(6719),h="[object Arguments]",f="[object Array]",p="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,y,m,g){var _=u(t),b=u(e),v=_?f:s(t),T=b?f:s(e),E=(v=v==h?p:v)==p,w=(T=T==h?p:T)==p,x=v==T;if(x&&l(t)){if(!l(e))return!1;_=!0,E=!1}if(x&&!E)return g||(g=new r),_||c(t)?i(t,e,n,y,m,g):o(t,e,v,n,y,m,g);if(!(1&n)){var C=E&&d.call(t,"__wrapped__"),M=w&&d.call(e,"__wrapped__");if(C||M){var S=C?t.value():t,N=M?e.value():e;return g||(g=new r),m(S,N,n,y,g)}}return!!x&&(g||(g=new r),a(t,e,n,y,m,g))}},8458:(t,e,n)=>{var r=n(3560),i=n(5346),o=n(3218),a=n(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,h=l.hasOwnProperty,f=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?f:s).test(a(t))}},8749:(t,e,n)=>{var r=n(4239),i=n(1780),o=n(7005),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},280:(t,e,n)=>{var r=n(5726),i=n(6916),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},4949:(t,e,n)=>{var r=n(7226),i=n(6557),o=n(3448);t.exports=function(t,e,n){var a=0,s=null==t?a:t.length;if("number"==typeof e&&e==e&&s<=2147483647){for(;a<s;){var u=a+s>>>1,l=t[u];null!==l&&!o(l)&&(n?l<=e:l<e)?a=u+1:s=u}return s}return r(t,e,i,n)}},7226:(t,e,n)=>{var r=n(3448),i=Math.floor,o=Math.min;t.exports=function(t,e,n,a){var s=0,u=null==t?0:t.length;if(0===u)return 0;for(var l=(e=n(e))!=e,c=null===e,h=r(e),f=void 0===e;s<u;){var p=i((s+u)/2),d=n(t[p]),y=void 0!==d,m=null===d,g=d==d,_=r(d);if(l)var b=a||g;else b=f?g&&(a||y):c?g&&y&&(a||!m):h?g&&y&&!m&&(a||!_):!m&&!_&&(a?d<=e:d<e);b?s=p+1:u=p}return o(u,4294967294)}},2545:t=>{t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},1717:t=>{t.exports=function(t){return function(e){return t(e)}}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4757:t=>{t.exports=function(t,e){return t.has(e)}},4429:(t,e,n)=>{var r=n(5639)["__core-js_shared__"];t.exports=r},7114:(t,e,n)=>{var r=n(8668),i=n(2908),o=n(4757);t.exports=function(t,e,n,a,s,u){var l=1&n,c=t.length,h=e.length;if(c!=h&&!(l&&h>c))return!1;var f=u.get(t),p=u.get(e);if(f&&p)return f==e&&p==t;var d=-1,y=!0,m=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++d<c;){var g=t[d],_=e[d];if(a)var b=l?a(_,g,d,e,t,u):a(g,_,d,t,e,u);if(void 0!==b){if(b)continue;y=!1;break}if(m){if(!i(e,(function(t,e){if(!o(m,e)&&(g===t||s(g,t,n,a,u)))return m.push(e)}))){y=!1;break}}else if(g!==_&&!s(g,_,n,a,u)){y=!1;break}}return u.delete(t),u.delete(e),y}},8351:(t,e,n)=>{var r=n(2705),i=n(1149),o=n(7813),a=n(7114),s=n(8776),u=n(1814),l=r?r.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(t,e,n,r,l,h,f){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!h(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var p=s;case"[object Set]":var d=1&r;if(p||(p=u),t.size!=e.size&&!d)return!1;var y=f.get(t);if(y)return y==e;r|=2,f.set(t,e);var m=a(p(t),p(e),r,l,h,f);return f.delete(t),m;case"[object Symbol]":if(c)return c.call(t)==c.call(e)}return!1}},6096:(t,e,n)=>{var r=n(8234),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,s){var u=1&n,l=r(t),c=l.length;if(c!=r(e).length&&!u)return!1;for(var h=c;h--;){var f=l[h];if(!(u?f in e:i.call(e,f)))return!1}var p=s.get(t),d=s.get(e);if(p&&d)return p==e&&d==t;var y=!0;s.set(t,e),s.set(e,t);for(var m=u;++h<c;){var g=t[f=l[h]],_=e[f];if(o)var b=u?o(_,g,f,e,t,s):o(g,_,f,t,e,s);if(!(void 0===b?g===_||a(g,_,n,o,s):b)){y=!1;break}m||(m="constructor"==f)}if(y&&!m){var v=t.constructor,T=e.constructor;v==T||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof T&&T instanceof T||(y=!1)}return s.delete(t),s.delete(e),y}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},8234:(t,e,n)=>{var r=n(8866),i=n(9551),o=n(3674);t.exports=function(t){return r(t,o,i)}},5050:(t,e,n)=>{var r=n(7019);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},852:(t,e,n)=>{var r=n(8458),i=n(7801);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},9607:(t,e,n)=>{var r=n(2705),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},9551:(t,e,n)=>{var r=n(4963),i=n(479),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},4160:(t,e,n)=>{var r=n(8552),i=n(7071),o=n(3818),a=n(8525),s=n(577),u=n(4239),l=n(346),c="[object Map]",h="[object Promise]",f="[object Set]",p="[object WeakMap]",d="[object DataView]",y=l(r),m=l(i),g=l(o),_=l(a),b=l(s),v=u;(r&&v(new r(new ArrayBuffer(1)))!=d||i&&v(new i)!=c||o&&v(o.resolve())!=h||a&&v(new a)!=f||s&&v(new s)!=p)&&(v=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?l(n):"";if(r)switch(r){case y:return d;case m:return c;case g:return h;case _:return f;case b:return p}return e}),t.exports=v},7801:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},1789:(t,e,n)=>{var r=n(4536);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},7667:(t,e,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},1327:(t,e,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},1866:(t,e,n)=>{var r=n(4536);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},5776:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},7019:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},5346:(t,e,n)=>{var r,i=n(4429),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},5726:t=>{var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},4785:(t,e,n)=>{var r=n(1989),i=n(8407),o=n(7071);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},1285:(t,e,n)=>{var r=n(5050);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},6e3:(t,e,n)=>{var r=n(5050);t.exports=function(t){return r(this,t).get(t)}},9916:(t,e,n)=>{var r=n(5050);t.exports=function(t){return r(this,t).has(t)}},5265:(t,e,n)=>{var r=n(5050);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},8776:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},4536:(t,e,n)=>{var r=n(852)(Object,"create");t.exports=r},6916:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1167:(t,e,n)=>{t=n.nmd(t);var r=n(1957),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5639:(t,e,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},619:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},2385:t=>{t.exports=function(t){return this.__data__.has(t)}},1814:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},7465:(t,e,n)=>{var r=n(8407);t.exports=function(){this.__data__=new r,this.size=0}},3779:t=>{t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},7599:t=>{t.exports=function(t){return this.__data__.get(t)}},4758:t=>{t.exports=function(t){return this.__data__.has(t)}},4309:(t,e,n)=>{var r=n(8407),i=n(7071),o=n(3369);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},346:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},6557:t=>{t.exports=function(t){return t}},5694:(t,e,n)=>{var r=n(9454),i=n(7005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),i=n(1780);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},4144:(t,e,n)=>{t=n.nmd(t);var r=n(5639),i=n(5062),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},8446:(t,e,n)=>{var r=n(939);t.exports=function(t,e){return r(t,e)}},3560:(t,e,n)=>{var r=n(4239),i=n(3218);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},4293:t=>{t.exports=function(t){return null==t}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},3448:(t,e,n)=>{var r=n(4239),i=n(7005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},6719:(t,e,n)=>{var r=n(8749),i=n(1717),o=n(1167),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},3674:(t,e,n)=>{var r=n(4636),i=n(280),o=n(8612);t.exports=function(t){return o(t)?r(t):i(t)}},1159:(t,e,n)=>{var r=n(4949);t.exports=function(t,e){return r(t,e)}},5871:(t,e,n)=>{var r=n(4949),i=n(7813);t.exports=function(t,e){var n=null==t?0:t.length;if(n){var o=r(t,e);if(o<n&&i(t[o],e))return o}return-1}},479:t=>{t.exports=function(){return[]}},5062:t=>{t.exports=function(){return!1}},2628:(t,e,n)=>{var r=n(7415),i=n(3674);t.exports=function(t){return null==t?[]:r(t,i(t))}},3085:(t,e,n)=>{"use strict";var r=n(5108);const i=n(9742),o=n(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|m(t,e);let r=u(n);const i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Q(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Q(t,ArrayBuffer)||t&&Q(t.buffer,ArrayBuffer))return d(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(Q(t,SharedArrayBuffer)||t&&Q(t.buffer,SharedArrayBuffer)))return d(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return l.from(r,e,n);const i=function(t){if(l.isBuffer(t)){const e=0|y(t.length),n=u(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||K(t.length)?u(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),u(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),n=u(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function d(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,l.prototype),r}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(i)return r?-1:X(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return O(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return M(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),K(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){let o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let r=-1;for(o=n;o<s;o++)if(l(t,o)===l(e,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(l(t,o+r)!==l(e,r)){n=!1;break}if(n)return o}return-1}function T(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=e.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(e.substr(2*a,2),16);if(K(r))return a;t[n+a]=r}return a}function E(t,e,n,r){return Z(X(e,t.length-n),t,n,r)}function w(t,e,n,r){return Z(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return Z(Y(e),t,n,r)}function C(t,e,n,r){return Z(function(t,e){let n,r,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function M(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:e<128&&(o=e);break;case 2:n=t[i+1],128==(192&n)&&(u=(31&e)<<6|63&n,u>127&&(o=u));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(u=(15&e)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=t[i+1],r=t[i+2],s=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(t){const e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=N));return n}(r)}e.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||void 0===r||"function"!=typeof r.error||r.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,e,n){return c(t,e,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,e,n){return function(t,e,n){return h(t),t<=0?u(t):void 0!==e?"string"==typeof n?u(t).fill(e,n):u(t).fill(e):u(t)}(t,e,n)},l.allocUnsafe=function(t){return f(t)},l.allocUnsafeSlow=function(t){return f(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=l.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(Q(e,Uint8Array))i+e.length>r.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)_(this,e,e+1);return this},l.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},l.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},l.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(t,e,n,r,i){if(Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0);const s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n);for(let t=0;t<s;++t)if(u[t]!==c[t]){o=u[t],a=c[t];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return b(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return b(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return w(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function O(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function A(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function I(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=e;r<n;++r)i+=J[t[r]];return i}function P(t,e,n){const r=t.slice(e,n);let i="";for(let t=0;t<r.length-1;t+=2)i+=String.fromCharCode(r[t]+256*r[t+1]);return i}function R(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function D(t,e,n,r,i){q(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function k(t,e,n,r,i){q(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function F(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,i){return e=+e,n>>>=0,i||F(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,i){return e=+e,n>>>=0,i||F(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=$((function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=$((function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=e,i=1,o=this[t+--r];for(;r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=$((function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),l.prototype.readBigInt64BE=$((function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),l.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=$((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=$((function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,t,e,n,r-1,-r)}let i=0,o=1,a=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,t,e,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=$((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=$((function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const o=l.isBuffer(t)?t:l.from(t,r),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=o[i%a]}return this};const j={};function G(t,e,n){j[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function W(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function q(t,e,n,r,i,o){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||z(e,t.length-(n+1))}(r,i,o)}function H(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,n){if(Math.floor(t)!==t)throw H(t,n),new j.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}G("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),G("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),G("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=W(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function X(t,e){let n;e=e||1/0;const r=t.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Y(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function K(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function $(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},3935:(t,e,n)=>{"use strict";var r=n(4155);function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var n,r="",i=0,o=-1,a=0,s=0;s<=t.length;++s){if(s<t.length)n=t.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(o===s-1||1===a);else if(o!==s-1&&2===a){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){-1===u?(r="",i=0):i=(r=r.slice(0,u)).length-1-r.lastIndexOf("/"),o=s,a=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=s,a=0;continue}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(o+1,s):r=t.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===n&&-1!==a?++a:a=-1}return r}var a={resolve:function(){for(var t,e="",n=!1,a=arguments.length-1;a>=-1&&!n;a--){var s;a>=0?s=arguments[a]:(void 0===t&&(t=r.cwd()),s=t),i(s),0!==s.length&&(e=s+"/"+e,n=47===s.charCodeAt(0))}return e=o(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];i(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":a.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=a.resolve(t))===(e=a.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var r=t.length,o=r-n,s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var u=e.length-s,l=o<u?o:u,c=-1,h=0;h<=l;++h){if(h===l){if(u>l){if(47===e.charCodeAt(s+h))return e.slice(s+h+1);if(0===h)return e.slice(s+h)}else o>l&&(47===t.charCodeAt(n+h)?c=h:0===h&&(c=0));break}var f=t.charCodeAt(n+h);if(f!==e.charCodeAt(s+h))break;47===f&&(c=h)}var p="";for(h=n+c+1;h<=r;++h)h!==r&&47!==t.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(s+c):(s+=c,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,r=-1,o=!0,a=t.length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!o){r=a;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"//":t.slice(0,r)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var n,r=0,o=-1,a=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,u=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!a){r=n+1;break}}else-1===u&&(a=!1,u=n+1),s>=0&&(l===e.charCodeAt(s)?-1==--s&&(o=n):(s=-1,o=u))}return r===o?o=u:-1===o&&(o=t.length),t.slice(r,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){r=n+1;break}}else-1===o&&(a=!1,o=n+1);return-1===o?"":t.slice(r,o)},extname:function(t){i(t);for(var e=-1,n=0,r=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(47!==u)-1===r&&(o=!1,r=s+1),46===u?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!o){n=s+1;break}}return-1===e||-1===r||0===a||1===a&&e===r-1&&e===n+1?"":t.slice(e,r)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var n=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+r:n+"/"+r:r}(0,t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,r=t.charCodeAt(0),o=47===r;o?(e.root="/",n=1):n=0;for(var a=-1,s=0,u=-1,l=!0,c=t.length-1,h=0;c>=n;--c)if(47!==(r=t.charCodeAt(c)))-1===u&&(l=!1,u=c+1),46===r?-1===a?a=c:1!==h&&(h=1):-1!==a&&(h=-1);else if(!l){s=c+1;break}return-1===a||-1===u||0===h||1===h&&a===u-1&&a===s+1?-1!==u&&(e.base=e.name=0===s&&o?t.slice(1,u):t.slice(s,u)):(0===s&&o?(e.name=t.slice(1,a),e.base=t.slice(1,u)):(e.name=t.slice(s,a),e.base=t.slice(s,u)),e.ext=t.slice(a,u)),s>0?e.dir=t.slice(0,s-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,t.exports=a},7418:t=>{"use strict";var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,o){for(var a,s,u=i(t),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))n.call(a,c)&&(u[c]=a[c]);if(e){s=e(a);for(var h=0;h<s.length;h++)r.call(a,s[h])&&(u[s[h]]=a[s[h]])}}return u}},7435:(t,e)=>{e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},2676:function(t,e,n){var r=n(4155);t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}var i=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function o(t,e){return t>e?1:t<e?-1:0}function a(t,e,n){for(var r=new i(null,null),o=r,a=r;;){var s=n(t,e.key);if(s<0){if(null===e.left)break;if(n(t,e.left.key)<0){var u=e.left;if(e.left=u.right,u.right=e,null===(e=u).left)break}a.left=e,a=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(n(t,e.right.key)>0&&(u=e.right,e.right=u.left,u.left=e,null===(e=u).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,a.left=e.right,e.left=r.right,e.right=r.left,e}function s(t,e,n,r){var o=new i(t,e);if(null===n)return o.left=o.right=null,o;var s=r(t,(n=a(t,n,r)).key);return s<0?(o.left=n.left,o.right=n,n.left=null):s>=0&&(o.right=n.right,o.left=n,n.right=null),o}function u(t,e,n){var r=null,i=null;if(e){var o=n((e=a(t,e,n)).key,t);0===o?(r=e.left,i=e.right):o<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function l(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&l(t.left,o,!1,r,i),t.right&&l(t.right,o,!0,r,i)}}var c=function(){function t(t){void 0===t&&(t=o),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=s(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new i(t,e);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=a(t,this._root,r),s=r(t,o.key);return 0===s?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r;return null===e?null:0===n(t,(e=a(t,e,n)).key)?(null===e.left?r=e.right:(r=a(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=a(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=a(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&n.call(r,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,n=[],r=!1,o=new i(null,null),a=o;!r;)e?(n.push(e),e=e.left):n.length>0?e=(e=a=a.next=n.pop()).right:r=!0;return a.next=null,o.next}(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,o=this._comparator;if(n&&p(t,e,0,r-1,o),null===this._root)this._root=h(t,e,0,r),this._size=r;else{var a=function(t,e,n){for(var r=new i(null,null),o=r,a=t,s=e;null!==a&&null!==s;)n(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),r.next}(this.toList(),function(t,e){for(var n=new i(null,null),r=n,o=0;o<t.length;o++)r=r.next=new i(t[o],e[o]);return r.next=null,n.next}(t,e),o);r=this._size+r,this._root=f({head:a},0,r)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return l(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,n){var r=this._comparator,i=u(t,this._root,r),o=i.left,l=i.right;r(t,e)<0?l=s(e,n,l,r):o=s(e,n,o,r),this._root=function(t,e,n){return null===e?t:(null===t||((e=a(t.key,e,n)).left=t),e)}(o,l,r)},t.prototype.split=function(t){return u(t,this._root,this._comparator)},t}();function h(t,e,n,r){var o=r-n;if(o>0){var a=n+Math.floor(o/2),s=t[a],u=e[a],l=new i(s,u);return l.left=h(t,e,n,a),l.right=h(t,e,a+1,r),l}return null}function f(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=f(t,e,i),a=t.head;return a.left=o,t.head=t.head.next,a.right=f(t,i+1,n),a}return null}function p(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],a=n-1,s=r+1;;){do{a++}while(i(t[a],o)<0);do{s--}while(i(t[s],o)>0);if(a>=s)break;var u=t[a];t[a]=t[s],t[s]=u,u=e[a],e[a]=e[s],e[s]=u}p(t,e,n,s,i),p(t,e,s+1,r,i)}}var d=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},y=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},m=Number.EPSILON;void 0===m&&(m=Math.pow(2,-52));var g=m*m,_=function(t,e){if(-m<t&&t<m&&-m<e&&e<m)return 0;var n=t-e;return n*n<g*t*e?0:t<e?-1:1},b=function(){function e(){t(this,e),this.reset()}return n(e,[{key:"reset",value:function(){this.xRounder=new v,this.yRounder=new v}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),e}(),v=function(){function e(){t(this,e),this.tree=new c,this.round(0)}return n(e,[{key:"round",value:function(t){var e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===_(e.key,n.key))return this.tree.remove(t),n.key;var r=this.tree.next(e);return null!==r&&0===_(e.key,r.key)?(this.tree.remove(t),r.key):t}}]),e}(),T=new b,E=function(t,e){return t.x*e.y-t.y*e.x},w=function(t,e){return t.x*e.x+t.y*e.y},x=function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y},o=E(r,i);return _(o,0)},C=function(t){return Math.sqrt(w(t,t))},M=function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return w(i,r)/C(i)/C(r)},S=function(t,e,n){return 0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},N=function(t,e,n){return 0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},O=function(){function e(n,r){t(this,e),void 0===n.events?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=r}return n(e,null,[{key:"compare",value:function(t,n){var r=e.comparePoints(t.point,n.point);return 0!==r?r:(t.point!==n.point&&t.link(n),t.isLeft!==n.isLeft?t.isLeft?1:-1:I.compare(t.segment,n.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),n(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n<r;n++){var i=e[n];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var n=this.point.events[e];if(void 0===n.segment.consumedBy)for(var r=e+1;r<t;r++){var i=this.point.events[r];void 0===i.consumedBy&&n.otherSE.point.events===i.otherSE.point.events&&n.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,n=this.point.events.length;e<n;e++){var r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,n=new Map,r=function(r){var i,o,a,s,u,l=r.otherSE;n.set(r,{sine:(i=e.point,o=t.point,a=l.point,s={x:o.x-i.x,y:o.y-i.y},u={x:a.x-i.x,y:a.y-i.y},E(u,s)/C(u)/C(s)),cosine:M(e.point,t.point,l.point)})};return function(t,e){n.has(t)||r(t),n.has(e)||r(e);var i=n.get(t),o=i.sine,a=i.cosine,s=n.get(e),u=s.sine,l=s.cosine;return o>=0&&u>=0?a<l?1:a>l?-1:0:o<0&&u<0?a<l?-1:a>l?1:0:u<o?-1:u>o?1:0}}}]),e}(),A=0,I=function(){function e(n,r,i,o){t(this,e),this.id=++A,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=o}return n(e,null,[{key:"compare",value:function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n<r){if(s<a&&s<u)return 1;if(s>a&&s>u)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n>r){if(a<s&&a<l)return-1;if(a>s&&a>l)return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var p=t.comparePoint(e.rightSE.point);return p<0?1:p>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(i<o){var d=e.comparePoint(t.rightSE.point);if(0!==d)return d}if(i>o){var y=t.comparePoint(e.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(i!==o){var m=u-a,g=i-n,_=l-s,b=o-r;if(m>g&&_<b)return 1;if(m<g&&_>b)return-1}return i>o?1:i<o||u<l?-1:u>l?1:t.id<e.id?-1:t.id>e.id?1:0}}]),n(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;var i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;var a=(t.x-e.x)/r.x,s=e.y+a*r.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),n=t.bbox(),r=y(e,n);if(null===r)return null;var i=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,u=d(e,a)&&0===this.comparePoint(a),l=d(n,i)&&0===t.comparePoint(i),c=d(e,s)&&0===this.comparePoint(s),h=d(n,o)&&0===t.comparePoint(o);if(l&&u)return h&&!c?o:!h&&c?s:null;if(l)return c&&i.x===s.x&&i.y===s.y?null:i;if(u)return h&&o.x===a.x&&o.y===a.y?null:a;if(h&&c)return null;if(h)return o;if(c)return s;var f=function(t,e,n,r){if(0===e.x)return N(n,r,t.x);if(0===r.x)return N(t,e,n.x);if(0===e.y)return S(n,r,t.y);if(0===r.y)return S(t,e,n.y);var i=E(e,r);if(0==i)return null;var o={x:n.x-t.x,y:n.y-t.y},a=E(o,e)/i,s=E(o,r)/i;return{x:(t.x+s*e.x+(n.x+a*r.x))/2,y:(t.y+s*e.y+(n.y+a*r.y))/2}}(i,this.vector(),a,t.vector());return null===f?null:d(r,f)?T.round(f.x,f.y):null}},{key:"split",value:function(t){var n=[],r=void 0!==t.events,i=new O(t,!0),o=new O(t,!1),a=this.rightSE;this.replaceRightSE(o),n.push(o),n.push(i);var s=new e(i,a,this.rings.slice(),this.windings.slice());return O.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),O.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}},{key:"consume",value:function(t){for(var n=this,r=t;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=e.compare(n,r);if(0!==i){if(i>0){var o=n;n=r,r=o}if(n.prev===r){var a=n;n=r,r=a}for(var s=0,u=r.rings.length;s<u;s++){var l=r.rings[s],c=r.windings[s],h=n.rings.indexOf(l);-1===h?(n.rings.push(l),n.windings.push(c)):n.windings[h]+=c}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys,i=0,o=this.rings.length;i<o;i++){var a=this.rings[i],s=this.windings[i],u=e.indexOf(a);-1===u?(e.push(a),n.push(s)):n[u]+=s}for(var l=[],c=[],h=0,f=e.length;h<f;h++)if(0!==n[h]){var p=e[h],d=p.poly;if(-1===c.indexOf(d))if(p.isExterior)l.push(d);else{-1===c.indexOf(d)&&c.push(d);var y=l.indexOf(p.poly);-1!==y&&l.splice(y,1)}}for(var m=0,g=l.length;m<g;m++){var _=l[m].multiPoly;-1===r.indexOf(_)&&r.push(_)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(G.type){case"union":var n=0===t.length,r=0===e.length;this._isInResult=n!==r;break;case"intersection":var i,o;t.length<e.length?(i=t.length,o=e.length):(i=e.length,o=t.length),this._isInResult=o===G.numMultiPolys&&i<o;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(G.type))}return this._isInResult}}],[{key:"fromRing",value:function(t,n,r){var i,o,a,s=O.comparePoints(t,n);if(s<0)i=t,o=n,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=n,o=t,a=-1}return new e(new O(i,!0),new O(o,!1),[r],[a])}}]),e}(),P=function(){function e(n,r,i){if(t(this,e),!Array.isArray(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!=typeof n[0][0]||"number"!=typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=T.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,u=n.length;s<u;s++){if("number"!=typeof n[s][0]||"number"!=typeof n[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=T.round(n[s][0],n[s][1]);l.x===a.x&&l.y===a.y||(this.segments.push(I.fromRing(a,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),a=l)}o.x===a.x&&o.y===a.y||this.segments.push(I.fromRing(a,o,this))}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.segments.length;e<n;e++){var r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}}]),e}(),R=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new P(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,o=n.length;i<o;i++){var a=new P(n[i],this,!1);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=r}return n(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;e<n;e++)for(var r=this.interiorRings[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}]),e}(),L=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof n[0][0][0]&&(n=[n])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,o=n.length;i<o;i++){var a=new R(n[i],this);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=r}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++)for(var r=this.polys[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}]),e}(),D=function(){function e(n){t(this,e),this.events=n;for(var r=0,i=n.length;r<i;r++)n[r].segment.ringOut=this;this.poly=null}return n(e,null,[{key:"factory",value:function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];if(o.isInResult()&&!o.ringOut){for(var a=null,s=o.leftSE,u=o.rightSE,l=[s],c=s.point,h=[];a=s,s=u,l.push(s),s.point!==c;)for(;;){var f=s.getAvailableLinkedEvents();if(0===f.length){var p=l[0].point,d=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(d.x,", ").concat(d.y,"]."))}if(1===f.length){u=f[0].otherSE;break}for(var y=null,m=0,g=h.length;m<g;m++)if(h[m].point===s.point){y=m;break}if(null===y){h.push({index:l.length,point:s.point});var _=s.getLeftmostComparator(a);u=f.sort(_)[0].otherSE;break}var b=h.splice(y)[0],v=l.splice(b.index);v.unshift(v[0].otherSE),n.push(new e(v.reverse()))}n.push(new e(l))}}return n}}]),n(e,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point,o=this.events[n+1].point;0!==x(i,t,o)&&(e.push(i),t=i)}if(1===e.length)return null;var a=e[0],s=e[1];0===x(a,t,s)&&e.shift(),e.push(e[0]);for(var u=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:e.length-1,c=this.isExteriorRing()?e.length:-1,h=[],f=l;f!=c;f+=u)h.push([e[f].x,e[f].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,n=this.events.length;e<n;e++){var r=this.events[e];O.compare(t,r)>0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),e}(),k=function(){function e(n){t(this,e),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return n(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e<n;e++){var r=this.interiorRings[e].getGeom();null!==r&&t.push(r)}return t}}]),e}(),F=function(){function e(n){t(this,e),this.rings=n,this.polys=this._composePolys(n)}return n(e,[{key:"getGeom",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++){var r=this.polys[e].getGeom();null!==r&&t.push(r)}return t}},{key:"_composePolys",value:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];if(!i.poly)if(i.isExteriorRing())e.push(new k(i));else{var o=i.enclosingRing();o.poly||e.push(new k(o)),o.poly.addInterior(i)}}return e}}]),e}(),U=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.compare;t(this,e),this.queue=n,this.tree=new c(r),this.segments=[]}return n(e,[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var l=a.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!a.isAnEndpoint(l)))for(var c=this._splitSafely(a,l),h=0,f=c.length;h<f;h++)n.push(c[h])}var p=null;if(s){var d=s.getIntersection(e);if(null!==d&&(e.isAnEndpoint(d)||(p=d),!s.isAnEndpoint(d)))for(var y=this._splitSafely(s,d),m=0,g=y.length;m<g;m++)n.push(y[m])}if(null!==u||null!==p){var _;_=null===u?p:null===p||O.comparePoints(u,p)<=0?u:p,this.queue.remove(e.rightSE),n.push(e.rightSE);for(var b=e.split(_),v=0,T=b.length;v<T;v++)n.push(b[v])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var E=a.getIntersection(s);if(null!==E){if(!a.isAnEndpoint(E))for(var w=this._splitSafely(a,E),x=0,C=w.length;x<C;x++)n.push(w[x]);if(!s.isAnEndpoint(E))for(var M=this._splitSafely(s,E),S=0,N=M.length;S<N;S++)n.push(M[S])}}this.tree.remove(e)}return n}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var n=t.rightSE;this.queue.remove(n);var r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.insert(t),r}}]),e}(),B=void 0!==r&&r.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,j=void 0!==r&&r.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,G=new(function(){function e(){t(this,e)}return n(e,[{key:"run",value:function(t,e,n){G.type=t,T.reset();for(var r=[new L(e,!0)],i=0,o=n.length;i<o;i++)r.push(new L(n[i],!1));if(G.numMultiPolys=r.length,"difference"===G.type)for(var a=r[0],s=1;s<r.length;)null!==y(r[s].bbox,a.bbox)?s++:r.splice(s,1);if("intersection"===G.type)for(var u=0,l=r.length;u<l;u++)for(var h=r[u],f=u+1,p=r.length;f<p;f++)if(null===y(h.bbox,r[f].bbox))return[];for(var d=new c(O.compare),m=0,g=r.length;m<g;m++)for(var _=r[m].getSweepEvents(),b=0,v=_.length;b<v;b++)if(d.insert(_[b]),d.size>B)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var E=new U(d),w=d.size,x=d.pop();x;){var C=x.key;if(d.size===w){var M=C.segment;throw new Error("Unable to pop() ".concat(C.isLeft?"left":"right"," SweepEvent ")+"[".concat(C.point.x,", ").concat(C.point.y,"] from segment #").concat(M.id," ")+"[".concat(M.leftSE.point.x,", ").concat(M.leftSE.point.y,"] -> ")+"[".concat(M.rightSE.point.x,", ").concat(M.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>B)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(E.segments.length>j)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=E.process(C),N=0,A=S.length;N<A;N++){var I=S[N];void 0===I.consumedBy&&d.insert(I)}w=d.size,x=d.pop()}T.reset();var P=D.factory(E.segments);return new F(P).getGeom()}}]),e}());return{union:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return G.run("union",t,n)},intersection:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return G.run("intersection",t,n)},xor:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return G.run("xor",t,n)},difference:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return G.run("difference",t,n)}}}()},4155:t=>{var e,n,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,u=[],l=!1,c=-1;function h(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&f())}function f(){if(!l){var t=a(h);l=!0;for(var e=u.length;e;){for(s=u,u=[];++c<e;)s&&s[c].run();c=-1,e=u.length}s=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new p(t,e)),1!==u.length||l||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=d,r.addListener=d,r.once=d,r.off=d,r.removeListener=d,r.removeAllListeners=d,r.emit=d,r.prependListener=d,r.prependOnceListener=d,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},4472:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>Ve});var r=6378137,i=.0066943799901413165,o=484813681109536e-20,a=Math.PI/2,s=1e-10,u=.017453292519943295,l=57.29577951308232,c=Math.PI/4,h=2*Math.PI,f=3.14159265359,p={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const d={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var y=/[\s_\-\/\(\)]/g;function m(t,e){if(t[e])return t[e];for(var n,r=Object.keys(t),i=e.toLowerCase().replace(y,""),o=-1;++o<r.length;)if((n=r[o]).toLowerCase().replace(y,"")===i)return t[n]}function g(t){var e,n,r,i={},o=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t}),{}),a={proj:"projName",datum:"datumCode",rf:function(t){i.rf=parseFloat(t)},lat_0:function(t){i.lat0=t*u},lat_1:function(t){i.lat1=t*u},lat_2:function(t){i.lat2=t*u},lat_ts:function(t){i.lat_ts=t*u},lon_0:function(t){i.long0=t*u},lon_1:function(t){i.long1=t*u},lon_2:function(t){i.long2=t*u},alpha:function(t){i.alpha=parseFloat(t)*u},gamma:function(t){i.rectified_grid_angle=parseFloat(t)},lonc:function(t){i.longc=t*u},x_0:function(t){i.x0=parseFloat(t)},y_0:function(t){i.y0=parseFloat(t)},k_0:function(t){i.k0=parseFloat(t)},k:function(t){i.k0=parseFloat(t)},a:function(t){i.a=parseFloat(t)},b:function(t){i.b=parseFloat(t)},r_a:function(){i.R_A=!0},zone:function(t){i.zone=parseInt(t,10)},south:function(){i.utmSouth=!0},towgs84:function(t){i.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){i.to_meter=parseFloat(t)},units:function(t){i.units=t;var e=m(d,t);e&&(i.to_meter=e.to_meter)},from_greenwich:function(t){i.from_greenwich=t*u},pm:function(t){var e=m(p,t);i.from_greenwich=(e||parseFloat(t))*u},nadgrids:function(t){"@null"===t?i.datumCode="none":i.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(i.axis=t)},approx:function(){i.approx=!0}};for(e in o)n=o[e],e in a?"function"==typeof(r=a[e])?r(n):i[r]=n:i[e]=n;return"string"==typeof i.datumCode&&"WGS84"!==i.datumCode&&(i.datumCode=i.datumCode.toLowerCase()),i}var _=/\s/,b=/[A-Za-z]/,v=/[A-Za-z84_]/,T=/[,\]]/,E=/[\d\.E\-\+]/;function w(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function x(t,e,n){Array.isArray(e)&&(n.unshift(e),e=null);var r=e?{}:t,i=n.reduce((function(t,e){return C(e,t),t}),r);e&&(t[e]=i)}function C(t,e){if(Array.isArray(t)){var n=t.shift();if("PARAMETER"===n&&(n=t.shift()),1===t.length)return Array.isArray(t[0])?(e[n]={},void C(t[0],e[n])):void(e[n]=t[0]);if(t.length)if("TOWGS84"!==n){if("AXIS"===n)return n in e||(e[n]=[]),void e[n].push(t);var r;switch(Array.isArray(n)||(e[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[n]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&C(t[2],e[n]));case"SPHEROID":case"ELLIPSOID":return e[n]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&C(t[3],e[n]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void x(e,n,t);default:for(r=-1;++r<t.length;)if(!Array.isArray(t[r]))return C(t,e[n]);return x(e,n,t)}}else e[n]=t;else e[n]=!0}else e[t]=!0}function M(t){return.017453292519943295*t}function S(t){var e=new w(t).output(),n=e.shift(),r=e.shift();e.unshift(["name",r]),e.unshift(["type",n]);var i={};return C(e,i),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var e="",n=0,r=t.AXIS.length;n<r;++n){var i=[t.AXIS[n][0].toLowerCase(),t.AXIS[n][1].toLowerCase()];-1!==i[0].indexOf("north")||("y"===i[0]||"lat"===i[0])&&"north"===i[1]?e+="n":-1!==i[0].indexOf("south")||("y"===i[0]||"lat"===i[0])&&"south"===i[1]?e+="s":-1!==i[0].indexOf("east")||("x"===i[0]||"lon"===i[0])&&"east"===i[1]?e+="e":-1===i[0].indexOf("west")&&("x"!==i[0]&&"lon"!==i[0]||"west"!==i[1])||(e+="w")}2===e.length&&(e+="u"),3===e.length&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;function a(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",M],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",M],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",M],["lat0","latitude_of_origin",M],["lat0","standard_parallel_1",M],["lat1","standard_parallel_1",M],["lat2","standard_parallel_2",M],["azimuth","Azimuth"],["alpha","azimuth",M],["srsCode","name"]].forEach((function(e){return function(t,e){var n=e[0],r=e[1];!(n in t)&&r in t&&(t[n]=t[r],3===e.length&&(t[n]=e[2](t[n])))}(t,e)})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=M(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(i),i}w.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;_.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},w.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(T.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},w.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},w.prototype.number=function(t){if(!E.test(t)){if(T.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},w.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},w.prototype.keyword=function(t){if(v.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!T.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},w.prototype.neutral=function(t){if(b.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(E.test(t))return this.word=t,void(this.state=3);if(!T.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},w.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var N=n(5108);function O(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?O[t]=g(arguments[1]):O[t]=S(arguments[1]):O[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?O.apply(e,t):O(t)}));if("string"==typeof t){if(t in O)return O[t]}else"EPSG"in t?O["EPSG:"+t.EPSG]=t:"ESRI"in t?O["ESRI:"+t.ESRI]=t:"IAU2000"in t?O["IAU2000:"+t.IAU2000]=t:N.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(O);const A=O;var I=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],P=["3857","900913","3785","102113"];function R(t,e){var n,r;if(t=t||{},!e)return t;for(r in e)void 0!==(n=e[r])&&(t[r]=n);return t}function L(t,e,n){var r=t*e;return n/Math.sqrt(1-r*r)}function D(t){return t<0?-1:1}function k(t){return Math.abs(t)<=f?t:t-D(t)*h}function F(t,e,n){var r=t*n,i=.5*t;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(a-e))/r}function U(t,e){for(var n,r,i=.5*t,o=a-2*Math.atan(e),s=0;s<=15;s++)if(n=t*Math.sin(o),o+=r=a-2*Math.atan(e*Math.pow((1-n)/(1+n),i))-o,Math.abs(r)<=1e-10)return o;return-9999}const B={init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=L(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,n,r=t.x,i=t.y;if(i*l>90&&i*l<-90&&r*l>180&&r*l<-180)return null;if(Math.abs(Math.abs(i)-a)<=s)return null;if(this.sphere)e=this.x0+this.a*this.k0*k(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(c+.5*i));else{var o=Math.sin(i),u=F(this.e,i,o);e=this.x0+this.a*this.k0*k(r-this.long0),n=this.y0-this.a*this.k0*Math.log(u)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,i=t.y-this.y0;if(this.sphere)n=a-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(n=U(this.e,o)))return null}return e=k(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]};function j(t){return t}const G={init:function(){},forward:j,inverse:j,names:["longlat","identity"]};var W=n(5108),q=[B,G],H={},z=[];function V(t,e){var n=z.length;return t.names?(z[n]=t,t.names.forEach((function(t){H[t.toLowerCase()]=n})),this):(W.log(e),!0)}const X={start:function(){q.forEach(V)},add:V,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==H[e]&&z[H[e]]?z[H[e]]:void 0}};var Y={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Z=Y.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Y.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Q={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var K=n(5108),J={};function $(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:J[t]||null,isNull:!1}}function tt(t){return t/3600*Math.PI/180}function et(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function nt(t){return t.map((function(t){return[tt(t.longitudeShift),tt(t.latitudeShift)]}))}function rt(t,e,n){return{name:et(t,e+8,e+16).trim(),parent:et(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function it(t,e,n,r){for(var i=e+176,o=[],a=0;a<n.gridNodeCount;a++){var s={latitudeShift:t.getFloat32(i+16*a,r),longitudeShift:t.getFloat32(i+16*a+4,r),latitudeAccuracy:t.getFloat32(i+16*a+8,r),longitudeAccuracy:t.getFloat32(i+16*a+12,r)};o.push(s)}return o}function ot(t,e){if(!(this instanceof ot))return new ot(t);e=e||function(t){if(t)throw t};var n=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in A}(t))return A[t];if(function(t){return I.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=S(t);if(function(t){var e=m(t,"authority");if(e){var n=m(e,"epsg");return n&&P.indexOf(n)>-1}}(e))return A["EPSG:3857"];var n=function(t){var e=m(t,"extension");if(e)return m(e,"proj4")}(e);return n?g(n):e}return function(t){return"+"===t[0]}(t)?g(t):void 0}(t);if("object"==typeof n){var r=ot.projections.get(n.projName);if(r){if(n.datumCode&&"none"!==n.datumCode){var i=m(Q,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(","):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var a,u,l,c,h,f,p=function(t,e,n,r,i){if(!t){var o=m(Y,r);o||(o=Z),t=o.a,e=o.b,n=o.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<s)&&(i=!0,e=t),{a:t,b:e,rf:n,sphere:i}}(n.a,n.b,n.rf,n.ellps,n.sphere),d=(a=p.a,u=p.b,p.rf,h=((l=a*a)-(c=u*u))/l,f=0,n.R_A?(l=(a*=1-h*(.16666666666666666+h*(.04722222222222222+.022156084656084655*h)))*a,h=0):f=Math.sqrt(h),{es:h,e:f,ep2:(l-c)/c}),y=function(t){return void 0===t?null:t.split(",").map($)}(n.nadgrids),_=n.datum||function(t,e,n,r,i,a,s){var u={};return u.datum_type=void 0===t||"none"===t?5:4,e&&(u.datum_params=e.map(parseFloat),0===u.datum_params[0]&&0===u.datum_params[1]&&0===u.datum_params[2]||(u.datum_type=1),u.datum_params.length>3&&(0===u.datum_params[3]&&0===u.datum_params[4]&&0===u.datum_params[5]&&0===u.datum_params[6]||(u.datum_type=2,u.datum_params[3]*=o,u.datum_params[4]*=o,u.datum_params[5]*=o,u.datum_params[6]=u.datum_params[6]/1e6+1))),s&&(u.datum_type=3,u.grids=s),u.a=n,u.b=r,u.es=i,u.ep2=a,u}(n.datumCode,n.datum_params,p.a,p.b,d.es,d.ep2,y);R(this,n),R(this,r),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=d.es,this.e=d.e,this.ep2=d.ep2,this.datum=_,this.init(),e(null,this)}else e(t)}else e(t)}ot.projections=X,ot.projections.start();const at=ot;function st(t,e,n){var r,i,o,s,u=t.x,l=t.y,c=t.z?t.z:0;if(l<-a&&l>-1.001*a)l=-a;else if(l>a&&l<1.001*a)l=a;else{if(l<-a)return{x:-1/0,y:-1/0,z:t.z};if(l>a)return{x:1/0,y:1/0,z:t.z}}return u>Math.PI&&(u-=2*Math.PI),i=Math.sin(l),s=Math.cos(l),o=i*i,{x:((r=n/Math.sqrt(1-e*o))+c)*s*Math.cos(u),y:(r+c)*s*Math.sin(u),z:(r*(1-e)+c)*i}}function ut(t,e,n,r){var i,o,a,s,u,l,c,h,f,p,d,y,m,g,_,b=t.x,v=t.y,T=t.z?t.z:0;if(i=Math.sqrt(b*b+v*v),o=Math.sqrt(b*b+v*v+T*T),i/n<1e-12){if(g=0,o/n<1e-12)return _=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(v,b);a=T/o,h=(s=i/o)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*s*s)),f=a*u,m=0;do{m++,l=e*(c=n/Math.sqrt(1-e*f*f))/(c+(_=i*h+T*f-c*(1-e*f*f))),y=(d=a*(u=1/Math.sqrt(1-l*(2-l)*s*s)))*h-(p=s*(1-l)*u)*f,h=p,f=d}while(y*y>1e-24&&m<30);return{x:g,y:Math.atan(d/Math.abs(p)),z:_}}var lt=n(5108);function ct(t){return 1===t||2===t}function ht(t,e,n){if(null===t.grids||0===t.grids.length)return lt.log("Grid shift grids not found"),-1;for(var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},o=[],a=0;a<t.grids.length;a++){var s=t.grids[a];if(o.push(s.name),s.isNull){i=r;break}if(s.mandatory,null!==s.grid){var u=s.grid.subgrids[0],c=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,h=u.ll[0]-c,f=u.ll[1]-c,p=u.ll[0]+(u.lim[0]-1)*u.del[0]+c,d=u.ll[1]+(u.lim[1]-1)*u.del[1]+c;if(!(f>r.y||h>r.x||d<r.y||p<r.x||(i=ft(r,e,u),isNaN(i.x))))break}else if(s.mandatory)return lt.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(i.x)?(lt.log("Failed to find a grid shift table for location '"+-r.x*l+" "+r.y*l+" tried: '"+o+"'"),-1):(n.x=-i.x,n.y=i.y,0)}function ft(t,e,n){var r={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return r;var i={x:t.x,y:t.y};i.x-=n.ll[0],i.y-=n.ll[1],i.x=k(i.x-Math.PI)+Math.PI;var o=pt(i,n);if(e){if(isNaN(o.x))return r;o.x=i.x-o.x,o.y=i.y-o.y;var a,s,u=9;do{if(s=pt(o,n),isNaN(s.x)){lt.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}a={x:i.x-(s.x+o.x),y:i.y-(s.y+o.y)},o.x+=a.x,o.y+=a.y}while(u--&&Math.abs(a.x)>1e-12&&Math.abs(a.y)>1e-12);if(u<0)return lt.log("Inverse grid shift iterator failed to converge."),r;r.x=k(o.x+n.ll[0]),r.y=o.y+n.ll[1]}else isNaN(o.x)||(r.x=t.x+o.x,r.y=t.y+o.y);return r}function pt(t,e){var n,r={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(r.x),o=Math.floor(r.y),a=r.x-1*i,s=r.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;n=o*e.lim[0]+i;var l=e.cvs[n][0],c=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],d=e.cvs[n][1];n--;var y=e.cvs[n][0],m=e.cvs[n][1],g=a*s,_=a*(1-s),b=(1-a)*(1-s),v=(1-a)*s;return u.x=b*l+_*h+v*y+g*p,u.y=b*c+_*f+v*m+g*d,u}function dt(t,e,n){var r,i,o,a=n.x,s=n.y,u=n.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(r=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(r=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(r=u,i="z"),t.axis[o]){case"e":case"n":l[i]=r;break;case"w":case"s":l[i]=-r;break;case"u":void 0!==n[i]&&(l.z=r);break;case"d":void 0!==n[i]&&(l.z=-r);break;default:return null}return l}function yt(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function mt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function gt(t,e,n,o){var a;if(Array.isArray(n)&&(n=yt(n)),function(t){mt(t.x),mt(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=gt(t,a=new at("WGS84"),n,o),t=a),o&&"enu"!==t.axis&&(n=dt(t,!1,n)),"longlat"===t.projName)n={x:n.x*u,y:n.y*u,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=function(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var o=t.a,a=t.es;if(3===t.datum_type){if(0!==ht(t,!1,n))return;o=r,a=i}var s=e.a,u=e.b,l=e.es;return 3===e.datum_type&&(s=r,u=6356752.314,l=i),a!==l||o!==s||ct(t.datum_type)||ct(e.datum_type)?(n=st(n,a,o),ct(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6];return{x:l*(t.x-u*t.y+s*t.z)+r,y:l*(u*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(n,t.datum_type,t.datum_params)),ct(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=(t.x-r)/l,h=(t.y-i)/l,f=(t.z-o)/l;return{x:c+u*h-s*f,y:-u*c+h+a*f,z:s*c-a*h+f}}}(n,e.datum_type,e.datum_params)),n=ut(n,l,s,u),3!==e.datum_type||0===ht(e,!0,n)?n:void 0):n}(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*l,y:n.y*l,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),o&&"enu"!==e.axis?dt(e,!0,n):n}var _t=at("WGS84");function bt(t,e,n,r){var i,o,a;return Array.isArray(n)?(i=gt(t,e,n,r)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(n.splice(3)):[i.x,i.y,n[2]].concat(n.splice(3)):[i.x,i.y].concat(n.splice(2)):[i.x,i.y]):(o=gt(t,e,n,r),2===(a=Object.keys(n)).length||a.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;o[r]=n[r]})),o)}function vt(t){return t instanceof at?t:t.oProj?t.oProj:at(t)}const Tt=function(t,e,n){t=vt(t);var r,i=!1;return void 0===e?(e=t,t=_t,i=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=_t,i=!0),e=vt(e),n?bt(t,e,n):(r={forward:function(n,r){return bt(t,e,n,r)},inverse:function(n,r){return bt(e,t,n,r)}},i&&(r.oProj=e),r)};var Et="AJSAJS",wt="AFAFAF",xt=65,Ct=73,Mt=79;const St={forward:Nt,inverse:function(t){var e=Pt(Lt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Ot};function Nt(t,e){return e=e||5,function(t,e){var n,r,i,o,a,s,u,l,c,h,f,p="00000"+t.easting,d="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,h=t.northing,f=Rt(t.zoneNumber),n=Math.floor(c/1e5),r=Math.floor(h/1e5)%20,o=Et.charCodeAt(i=f-1),a=wt.charCodeAt(i),l=!1,(s=o+n-1)>90&&(s=s-90+xt-1,l=!0),(s===Ct||o<Ct&&s>Ct||(s>Ct||o<Ct)&&l)&&s++,(s===Mt||o<Mt&&s>Mt||(s>Mt||o<Mt)&&l)&&++s===Ct&&s++,s>90&&(s=s-90+xt-1),(u=a+r)>86?(u=u-86+xt-1,l=!0):l=!1,(u===Ct||a<Ct&&u>Ct||(u>Ct||a<Ct)&&l)&&u++,(u===Mt||a<Mt&&u>Mt||(u>Mt||a<Mt)&&l)&&++u===Ct&&u++,u>86&&(u=u-86+xt-1),String.fromCharCode(s)+String.fromCharCode(u))+p.substr(p.length-5,e)+d.substr(d.length-5,e)}(function(t){var e,n,r,i,o,a,s,u=t.lat,l=t.lon,c=6378137,h=.00669438,f=.9996,p=At(u),d=At(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60),u>=56&&u<64&&l>=3&&l<12&&(s=32),u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37)),a=At(6*(s-1)-180+3),e=.006739496752268451,n=c/Math.sqrt(1-h*Math.sin(p)*Math.sin(p)),r=Math.tan(p)*Math.tan(p),i=e*Math.cos(p)*Math.cos(p);var y,m,g=f*n*((o=Math.cos(p)*(d-a))+(1-r+i)*o*o*o/6+(5-18*r+r*r+72*i-58*e)*o*o*o*o*o/120)+5e5,_=f*(c*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+n*Math.tan(p)*(o*o/2+(5-r+9*i+4*i*i)*o*o*o*o/24+(61-58*r+r*r+600*i-2.2240339282485886)*o*o*o*o*o*o/720));return u<0&&(_+=1e7),{northing:Math.round(_),easting:Math.round(g),zoneNumber:s,zoneLetter:(y=u,m="Z",84>=y&&y>=72?m="X":72>y&&y>=64?m="W":64>y&&y>=56?m="V":56>y&&y>=48?m="U":48>y&&y>=40?m="T":40>y&&y>=32?m="S":32>y&&y>=24?m="R":24>y&&y>=16?m="Q":16>y&&y>=8?m="P":8>y&&y>=0?m="N":0>y&&y>=-8?m="M":-8>y&&y>=-16?m="L":-16>y&&y>=-24?m="K":-24>y&&y>=-32?m="J":-32>y&&y>=-40?m="H":-40>y&&y>=-48?m="G":-48>y&&y>=-56?m="F":-56>y&&y>=-64?m="E":-64>y&&y>=-72?m="D":-72>y&&y>=-80&&(m="C"),m)}}({lat:t[1],lon:t[0]}),e)}function Ot(t){var e=Pt(Lt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function At(t){return t*(Math.PI/180)}function It(t){return t/Math.PI*180}function Pt(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,l,c,h,f,p,d=.9996,y=6378137,m=.00669438,g=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=n-5e5,b=e;r<"N"&&(b-=1e7),h=6*(i-1)-180+3,o=.006739496752268451,p=(f=b/d/6367449.145945056)+(3*g/2-27*g*g*g/32)*Math.sin(2*f)+(21*g*g/16-55*g*g*g*g/32)*Math.sin(4*f)+151*g*g*g/96*Math.sin(6*f),a=y/Math.sqrt(1-m*Math.sin(p)*Math.sin(p)),s=Math.tan(p)*Math.tan(p),u=o*Math.cos(p)*Math.cos(p),l=.99330562*y/Math.pow(1-m*Math.sin(p)*Math.sin(p),1.5),c=_/(a*d);var v=p-a*Math.tan(p)/l*(c*c/2-(5+3*s+10*u-4*u*u-9*o)*c*c*c*c/24+(61+90*s+298*u+45*s*s-1.6983531815716497-3*u*u)*c*c*c*c*c*c/720);v=It(v);var T,E=(c-(1+2*s+u)*c*c*c/6+(5-2*u+28*s-3*u*u+8*o+24*s*s)*c*c*c*c*c/120)/Math.cos(p);if(E=h+It(E),t.accuracy){var w=Pt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});T={top:w.lat,right:w.lon,bottom:v,left:E}}else T={lat:v,lon:E};return T}function Rt(t){var e=t%6;return 0===e&&(e=6),e}function Lt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;r=t.substring(o,o+=2);for(var u=Rt(a),l=function(t,e){for(var n=Et.charCodeAt(e-1),r=1e5,i=!1;n!==t.charCodeAt(0);){if(++n===Ct&&n++,n===Mt&&n++,n>90){if(i)throw"Bad character: "+t;n=xt,i=!0}r+=1e5}return r}(r.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var n=wt.charCodeAt(e-1),r=0,i=!1;n!==t.charCodeAt(0);){if(++n===Ct&&n++,n===Mt&&n++,n>86){if(i)throw"Bad character: "+t;n=xt,i=!0}r+=1e5}return r}(r.charAt(1),u);c<Dt(s);)c+=2e6;var h=n-o;if(h%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,p,d,y=h/2,m=0,g=0;return y>0&&(f=1e5/Math.pow(10,y),p=t.substring(o,o+y),m=parseFloat(p)*f,d=t.substring(o+y),g=parseFloat(d)*f),{easting:m+l,northing:g+c,zoneLetter:s,zoneNumber:a,accuracy:f}}function Dt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}var kt=n(5108);function Ft(t,e,n){if(!(this instanceof Ft))return new Ft(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=n||0;kt.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ft.fromMGRS=function(t){return new Ft(Ot(t))},Ft.prototype.toMGRS=function(t){return Nt([this.x,this.y],t)};const Ut=Ft;var Bt=.046875,jt=.01953125,Gt=.01068115234375;function Wt(t){var e=[];e[0]=1-t*(.25+t*(Bt+t*(jt+t*Gt))),e[1]=t*(.75-t*(Bt+t*(jt+t*Gt)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e}function qt(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}function Ht(t,e,n){for(var r=1/(1-e),i=t,o=20;o;--o){var a=Math.sin(i),u=1-e*a*a;if(i-=u=(qt(i,a,Math.cos(i),n)-t)*(u*Math.sqrt(u))*r,Math.abs(u)<s)return i}return i}const zt={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Wt(this.es),this.ml0=qt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,r,i=t.x,o=t.y,a=k(i-this.long0),u=Math.sin(o),l=Math.cos(o);if(this.es){var c=l*a,h=Math.pow(c,2),f=this.ep2*Math.pow(l,2),p=Math.pow(f,2),d=Math.abs(l)>s?Math.tan(o):0,y=Math.pow(d,2),m=Math.pow(y,2);e=1-this.es*Math.pow(u,2),c/=Math.sqrt(e);var g=qt(o,u,l,this.en);n=this.a*(this.k0*c*(1+h/6*(1-y+f+h/20*(5-18*y+m+14*f-58*y*f+h/42*(61+179*m-m*y-479*y)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+u*a*c/2*(1+h/12*(5-y+9*f+4*p+h/30*(61+m-58*y+270*f-330*y*f+h/56*(1385+543*m-m*y-3111*y))))))+this.y0}else{var _=l*Math.sin(a);if(Math.abs(Math.abs(_)-1)<s)return 93;if(n=.5*this.a*this.k0*Math.log((1+_)/(1-_))+this.x0,r=l*Math.cos(a)/Math.sqrt(1-Math.pow(_,2)),(_=Math.abs(r))>=1){if(_-1>s)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,i,o=(t.x-this.x0)*(1/this.a),u=(t.y-this.y0)*(1/this.a);if(this.es)if(n=Ht(e=this.ml0+u/this.k0,this.es,this.en),Math.abs(n)<a){var l=Math.sin(n),c=Math.cos(n),h=Math.abs(c)>s?Math.tan(n):0,f=this.ep2*Math.pow(c,2),p=Math.pow(f,2),d=Math.pow(h,2),y=Math.pow(d,2);e=1-this.es*Math.pow(l,2);var m=o*Math.sqrt(e)/this.k0,g=Math.pow(m,2);r=n-(e*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*d-9*f*d+f-4*p-g/30*(61+90*d-252*f*d+45*y+46*f-g/56*(1385+3633*d+4095*y+1574*y*d)))),i=k(this.long0+m*(1-g/6*(1+2*d+f-g/20*(5+28*d+24*y+8*f*d+6*f-g/42*(61+662*d+1320*y+720*y*d))))/c)}else r=a*D(u),i=0;else{var _=Math.exp(o/this.k0),b=.5*(_-1/_),v=this.lat0+u/this.k0,T=Math.cos(v);e=Math.sqrt((1-Math.pow(T,2))/(1+Math.pow(b,2))),r=Math.asin(e),u<0&&(r=-r),i=0===b&&0===T?0:k(Math.atan2(b,T)+this.long0)}return t.x=i,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Vt(t){var e=Math.exp(t);return(e-1/e)/2}function Xt(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))}function Yt(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return e+n*Math.sin(2*e)}function Zt(t,e,n){for(var r,i,o=Math.sin(e),a=Math.cos(e),s=Vt(n),u=function(t){var e=Math.exp(t);return(e+1/e)/2}(n),l=2*a*u,c=-2*o*s,h=t.length-1,f=t[h],p=0,d=0,y=0;--h>=0;)r=d,i=p,f=l*(d=f)-r-c*(p=y)+t[h],y=c*d-i+l*p;return[(l=o*u)*f-(c=a*s)*y,l*y+c*f]}const Qt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(zt.init.apply(this),this.forward=zt.forward,this.inverse=zt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=Yt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=k(t.x-this.long0),n=t.y;n=Yt(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),o=Math.sin(e),a=Math.cos(e);n=Math.atan2(r,a*i),e=Math.atan2(o*i,Xt(r,i*a)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(Xt(1,e)+1))),t<0?-e:e}(Math.tan(e));var s,u,l=Zt(this.gtu,2*n,2*e);return n+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=Zt(this.utg,2*i,2*r);i+=o[0],r+=o[1],r=Math.atan(Vt(r));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(r),l=Math.cos(r);i=Math.atan2(a*l,Xt(u,l*s)),e=k((r=Math.atan2(u,l*s))+this.long0),n=Yt(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Kt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(k(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*u,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Qt.init.apply(this),this.forward=Qt.forward,this.inverse=Qt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Jt(t,e){return Math.pow((1-t)/(1+t),e)}const $t={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+c)/(Math.pow(Math.tan(.5*this.lat0+c),this.C)*Jt(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+c),this.C)*Jt(this.e*Math.sin(n),this.ratexp))-a,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+c)/this.K,1/this.C),i=20;i>0&&(n=2*Math.atan(r*Jt(this.e*Math.sin(t.y),-.5*this.e))-a,!(Math.abs(n-t.y)<1e-14));--i)t.y=n;return i?(t.x=e,t.y=n,t):null},names:["gauss"]},te={init:function(){$t.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,r,i;return t.x=k(t.x-this.long0),$t.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Math.sqrt(t.x*t.x+t.y*t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),n=Math.cos(a),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,$t.inverse.apply(this,[t]),t.x=k(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ee={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=s&&(this.k0=.5*(1+D(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=s&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=s&&(this.k0=.5*this.cons*L(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/F(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=L(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,i,o,u,l=t.x,c=t.y,h=Math.sin(c),f=Math.cos(c),p=k(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=s&&Math.abs(c+this.lat0)<=s?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*h+this.coslat0*f*Math.cos(p)),t.x=this.a*e*f*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*h-this.sinlat0*f*Math.cos(p))+this.y0,t):(n=2*Math.atan(this.ssfn_(c,h,this.e))-a,i=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=s?(o=F(this.e,c*this.con,this.con*h),u=2*this.a*this.k0*o/this.cons,t.x=this.x0+u*Math.sin(l-this.long0),t.y=this.y0-this.con*u*Math.cos(l-this.long0),t):(Math.abs(this.sinlat0)<s?(e=2*this.a*this.k0/(1+i*Math.cos(p)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*i*Math.cos(p))),t.y=e*(this.cosX0*r-this.sinX0*i*Math.cos(p))+this.y0),t.x=e*i*Math.sin(p)+this.x0,t))},inverse:function(t){var e,n,r,i,o;t.x-=this.x0,t.y-=this.y0;var u=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var l=2*Math.atan(u/(2*this.a*this.k0));return e=this.long0,n=this.lat0,u<=s?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(l)*this.sinlat0+t.y*Math.sin(l)*this.coslat0/u),e=Math.abs(this.coslat0)<s?this.lat0>0?k(this.long0+Math.atan2(t.x,-1*t.y)):k(this.long0+Math.atan2(t.x,t.y)):k(this.long0+Math.atan2(t.x*Math.sin(l),u*this.coslat0*Math.cos(l)-t.y*this.sinlat0*Math.sin(l))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=s){if(u<=s)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=u*this.cons/(2*this.a*this.k0),n=this.con*U(this.e,r),e=this.con*k(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(u*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,u<=s?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/u),e=k(this.long0+Math.atan2(t.x*Math.sin(i),u*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),n=-1*U(this.e,Math.tan(.5*(a+o)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(a+t))*Math.pow((1-e)/(1+e),.5*n)}},ne={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),o=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,l=o,c=-1e3,h=0;Math.abs(l-c)>1e-7;){if(++h>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]};var re=1e-7;const ie={init:function(){var t,e,n,r,i,o,l,f,p,d,y,m,g,_=0,b=0,v=0,T=0,E=0,w=0,x=0;this.no_off=(g="object"==typeof(m=this).PROJECTION?Object.keys(m.PROJECTION)[0]:m.PROJECTION,"no_uoff"in m||"no_off"in m||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var M=!1;if("rectified_grid_angle"in this&&(M=!0),C&&(x=this.alpha),M&&(_=this.rectified_grid_angle*u),C||M)b=this.longc;else if(v=this.long1,E=this.lat1,T=this.long2,w=this.lat2,Math.abs(E-w)<=re||(t=Math.abs(E))<=re||Math.abs(t-a)<=re||Math.abs(Math.abs(this.lat0)-a)<=re||Math.abs(Math.abs(w)-a)<=re)throw new Error;var S=1-this.es;e=Math.sqrt(S),Math.abs(this.lat0)>s?(f=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*f*f,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*e/t,(i=(r=this.B*e/(n*Math.sqrt(t)))*r-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(F(this.e,this.lat0,f),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=i=1),C||M?(C?(y=Math.asin(Math.sin(x)/r),M||(_=x)):(y=_,x=Math.asin(r*Math.sin(y))),this.lam0=b-Math.asin(.5*(i-1/i)*Math.tan(y))/this.B):(o=Math.pow(F(this.e,E,Math.sin(E)),this.B),l=Math.pow(F(this.e,w,Math.sin(w)),this.B),i=this.E/o,p=(l-o)/(l+o),d=((d=this.E*this.E)-l*o)/(d+l*o),(t=v-T)<-Math.pi?T-=h:t>Math.pi&&(T+=h),this.lam0=k(.5*(v+T)-Math.atan(d*Math.tan(.5*this.B*(v-T))/p)/this.B),y=Math.atan(2*Math.sin(this.B*k(v-this.lam0))/(i-1/i)),_=x=Math.asin(r*Math.sin(y))),this.singam=Math.sin(y),this.cosgam=Math.cos(y),this.sinrot=Math.sin(_),this.cosrot=Math.cos(_),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*y,this.v_pole_n=this.ArB*Math.log(Math.tan(c-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(c+i))},forward:function(t){var e,n,r,i,o,u,l,c,h={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-a)>s){if(e=.5*((o=this.E/Math.pow(F(this.e,t.y,Math.sin(t.y)),this.B))-(u=1/o)),n=.5*(o+u),i=Math.sin(this.B*t.x),r=(e*this.singam-i*this.cosgam)/n,Math.abs(Math.abs(r)-1)<s)throw new Error;c=.5*this.ArB*Math.log((1-r)/(1+r)),u=Math.cos(this.B*t.x),l=Math.abs(u)<re?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+i*this.singam,u)}else c=t.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(h.x=l,h.y=c):(l-=this.u_0,h.x=c*this.cosrot+l*this.sinrot,h.y=l*this.cosrot-c*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(t){var e,n,r,i,o,u,l,c={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((r=Math.exp(-this.BrA*n))-1/r),o=.5*(r+1/r),l=((u=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(l)-1)<s)c.x=0,c.y=l<0?-a:a;else{if(c.y=this.E/Math.sqrt((1+l)/(1-l)),c.y=U(this.e,Math.pow(c.y,1/this.B)),c.y===1/0)throw new Error;c.x=-this.rB*Math.atan2(i*this.cosgam-u*this.singam,Math.cos(this.BrA*e))}return c.x+=this.lam0,c},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},oe={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<s)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),r=L(this.e,e,n),i=F(this.e,this.lat1,e),o=Math.sin(this.lat2),a=Math.cos(this.lat2),u=L(this.e,o,a),l=F(this.e,this.lat2,o),c=F(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>s?this.ns=Math.log(r/u)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=s&&(n=D(n)*(a-2e-10));var r,i,o=Math.abs(Math.abs(n)-a);if(o>s)r=F(this.e,n,Math.sin(n)),i=this.a*this.f0*Math.pow(r,this.ns);else{if((o=n*this.ns)<=0)return null;i=0}var u=this.ns*k(e-this.long0);return t.x=this.k0*(i*Math.sin(u))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(u))+this.y0,t},inverse:function(t){var e,n,r,i,o,s=(t.x-this.x0)/this.k0,u=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+u*u),n=1):(e=-Math.sqrt(s*s+u*u),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*s,n*u)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(i=U(this.e,r)))return null}else i=-a;return o=k(l/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},ae={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y,c=k(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),r=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function se(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function ue(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function le(t){return.375*t*(1+.25*t*(1+.46875*t))}function ce(t){return.05859375*t*t*(1+.75*t)}function he(t){return t*t*t*(35/3072)}function fe(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)}function pe(t){return Math.abs(t)<a?t:t-D(t)*Math.PI}function de(t,e,n,r,i){var o,a;o=t/e;for(var s=0;s<15;s++)if(o+=a=(t-(e*o-n*Math.sin(2*o)+r*Math.sin(4*o)-i*Math.sin(6*o)))/(e-2*n*Math.cos(2*o)+4*r*Math.cos(4*o)-6*i*Math.cos(6*o)),Math.abs(a)<=1e-10)return o;return NaN}const ye={init:function(){this.sphere||(this.e0=ue(this.es),this.e1=le(this.es),this.e2=ce(this.es),this.e3=he(this.es),this.ml0=this.a*se(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,n,r=t.x,i=t.y;if(r=k(r-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var o=Math.sin(i),a=Math.cos(i),s=fe(this.a,this.e,o),u=Math.tan(i)*Math.tan(i),l=r*Math.cos(i),c=l*l,h=this.es*a*a/(1-this.es);e=s*l*(1-c*u*(1/6-(8-u+8*h)*c/120)),n=this.a*se(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+s*o/a*c*(.5+(5-u+6*h)*c/24)}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r=t.x/this.a,i=t.y/this.a;if(this.sphere){var o=i+this.lat0;e=Math.asin(Math.sin(o)*Math.cos(r)),n=Math.atan2(Math.tan(r),Math.cos(o))}else{var u=de(this.ml0/this.a+i,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(u)-a)<=s)return t.x=this.long0,t.y=a,i<0&&(t.y*=-1),t;var l=fe(this.a,this.e,Math.sin(u)),c=l*l*l/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(u),2),f=r*this.a/l,p=f*f;e=u-l*Math.tan(u)/c*f*f*(.5-(1+3*h)*f*f/24),n=f*(1-p*(h/3+(1+3*h)*h*p/15))/Math.cos(u)}return t.x=k(n+this.long0),t.y=pe(e),t},names:["Cassini","Cassini_Soldner","cass"]};function me(t,e){var n;return t>1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e}const ge={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-a)<s?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<s?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=me(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=.3333333333333333*t,e=t*t,n[0]+=.17222222222222222*e,n[1]=.06388888888888888*e,e*=t,n[0]+=.10257936507936508*e,n[1]+=.0664021164021164*e,n[2]=.016415012942191543*e,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=me(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,r,i,o,u,l,h,f,p,d=t.x,y=t.y;if(d=k(d-this.long0),this.sphere){if(o=Math.sin(y),p=Math.cos(y),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+p*r:1+this.sinph0*o+this.cosph0*p*r)<=s)return null;e=(n=Math.sqrt(2/n))*p*Math.sin(d),n*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*p*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(y+this.lat0)<s)return null;n=c-.5*y,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(d),n*=r}}else{switch(l=0,h=0,f=0,r=Math.cos(d),i=Math.sin(d),o=Math.sin(y),u=me(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(l=u/this.qp,h=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:f=1+this.sinb1*l+this.cosb1*h*r;break;case this.EQUIT:f=1+h*r;break;case this.N_POLE:f=a+y,u=this.qp-u;break;case this.S_POLE:f=y-a,u=this.qp+u}if(Math.abs(f)<s)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f),n=this.mode===this.OBLIQ?this.ymf*f*(this.cosb1*l-this.sinb1*h*r):(f=Math.sqrt(2/(1+h*r)))*l*this.ymf,e=this.xmf*f*h*i;break;case this.N_POLE:case this.S_POLE:u>=0?(e=(f=Math.sqrt(u))*i,n=r*(this.mode===this.S_POLE?f:-f)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,i,o,u,l,c,h,f,p=t.x/this.a,d=t.y/this.a;if(this.sphere){var y,m=0,g=0;if((n=.5*(y=Math.sqrt(p*p+d*d)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(n),m=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(y)<=s?0:Math.asin(d*g/y),p*=g,d=m*y;break;case this.OBLIQ:n=Math.abs(y)<=s?this.lat0:Math.asin(m*this.sinph0+d*g*this.cosph0/y),p*=g*this.cosph0,d=(m-Math.sin(n)*this.sinph0)*y;break;case this.N_POLE:d=-d,n=a-n;break;case this.S_POLE:n-=a}e=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,d):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,d*=this.dd,(u=Math.sqrt(p*p+d*d))<s)return t.x=this.long0,t.y=this.lat0,t;i=2*Math.asin(.5*u/this.rq),r=Math.cos(i),p*=i=Math.sin(i),this.mode===this.OBLIQ?(l=r*this.sinb1+d*i*this.cosb1/u,o=this.qp*l,d=u*this.cosb1*r-d*this.sinb1*i):(l=d*i/u,o=this.qp*l,d=u*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),!(o=p*p+d*d))return t.x=this.long0,t.y=this.lat0,t;l=1-o/this.qp,this.mode===this.S_POLE&&(l=-l)}e=Math.atan2(p,d),f=(c=Math.asin(l))+c,n=c+(h=this.apa)[0]*Math.sin(f)+h[1]*Math.sin(f+f)+h[2]*Math.sin(f+f+f)}return t.x=k(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function _e(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const be={init:function(){Math.abs(this.lat1+this.lat2)<s||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=L(this.e3,this.sin_po,this.cos_po),this.qs1=me(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=L(this.e3,this.sin_po,this.cos_po),this.qs2=me(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=me(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>s?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=me(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*k(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,n)),o=k(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,o,a=_e(.5*e);if(t<s)return a;for(var u=t*t,l=1;l<=25;l++)if(a+=o=.5*(i=1-(r=t*(n=Math.sin(a)))*r)*i/Math.cos(a)*(e/(1-u)-n/i+.5/t*Math.log((1-r)/(1+r))),Math.abs(o)<=1e-7)return a;return null}},ve={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,r,i,o,a,u,l=t.x,c=t.y;return r=k(l-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),(o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=s?(a=this.x0+1*this.a*n*Math.sin(r)/o,u=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/o):(a=this.x0+this.infinity_dist*n*Math.sin(r),u=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=u,t},inverse:function(t){var e,n,r,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),n=Math.sin(i),a=_e((r=Math.cos(i))*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),o=k(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]},Te={init:function(){this.sphere||(this.k0=L(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,o=k(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=me(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,n=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=k(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*a:a;for(var r,i,o,s,u=Math.asin(.5*e),l=0;l<30;l++)if(i=Math.sin(u),o=Math.cos(u),s=t*i,u+=r=Math.pow(1-s*s,2)/(2*o)*(e/(1-t*t)-i/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(r)<=1e-10)return u;return NaN}(this.e,2*t.y*this.k0/this.a),e=k(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]},Ee={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,r=k(e-this.long0),i=pe(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=k(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=pe(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},we={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ue(this.es),this.e1=le(this.es),this.e2=ce(this.es),this.e3=he(this.es),this.ml0=this.a*se(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,o=t.y,a=k(i-this.long0);if(r=a*Math.sin(o),this.sphere)Math.abs(o)<=s?(e=this.a*a,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),n=this.a*(pe(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=s)e=this.a*a,n=-1*this.ml0;else{var u=fe(this.a,this.e,Math.sin(o))/Math.tan(o);e=u*Math.sin(r),n=this.a*se(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+u*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,o,a,u,l,c;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=s)e=k(r/this.a+this.long0),n=0;else{var h;for(a=this.lat0+i/this.a,u=r*r/this.a/this.a+a*a,l=a,o=20;o;--o)if(l+=c=-1*(a*(l*(h=Math.tan(l))+1)-l-.5*(l*l+u)*h)/((l-a)/h-1),Math.abs(c)<=s){n=l;break}e=k(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=s)n=0,e=k(this.long0+r/this.a);else{var f,p,d,y,m;for(a=(this.ml0+i)/this.a,u=r*r/this.a/this.a+a*a,l=a,o=20;o;--o)if(m=this.e*Math.sin(l),f=Math.sqrt(1-m*m)*Math.tan(l),p=this.a*se(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(a*(f*(y=p/this.a)+1)-y-.5*f*(y*y+u))/(this.es*Math.sin(2*l)*(y*y+u-2*a*y)/(4*f)+(a-y)*(f*d-2/Math.sin(2*l))-d),Math.abs(c)<=s){n=l;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=k(this.long0+Math.asin(r*f/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","poly"]},xe={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,r=t.y-this.lat0,i=n-this.long0,a=r/o*1e-5,s=i,u=1,l=0;for(e=1;e<=10;e++)u*=a,l+=this.A[e]*u;var c,h=l,f=s,p=1,d=0,y=0,m=0;for(e=1;e<=6;e++)c=d*h+p*f,p=p*h-d*f,d=c,y=y+this.B_re[e]*p-this.B_im[e]*d,m=m+this.B_im[e]*p+this.B_re[e]*d;return t.x=m*this.a+this.x0,t.y=y*this.a+this.y0,t},inverse:function(t){var e,n,r=t.x,i=t.y,a=r-this.x0,s=(i-this.y0)/this.a,u=a/this.a,l=1,c=0,h=0,f=0;for(e=1;e<=6;e++)n=c*s+l*u,l=l*s-c*u,c=n,h=h+this.C_re[e]*l-this.C_im[e]*c,f=f+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p<this.iterations;p++){var d,y=h,m=f,g=s,_=u;for(e=2;e<=6;e++)d=m*h+y*f,y=y*h-m*f,m=d,g+=(e-1)*(this.B_re[e]*y-this.B_im[e]*m),_+=(e-1)*(this.B_im[e]*y+this.B_re[e]*m);y=1,m=0;var b=this.B_re[1],v=this.B_im[1];for(e=2;e<=6;e++)d=m*h+y*f,y=y*h-m*f,m=d,b+=e*(this.B_re[e]*y-this.B_im[e]*m),v+=e*(this.B_im[e]*y+this.B_re[e]*m);var T=b*b+v*v;h=(g*b+_*v)/T,f=(_*b-g*v)/T}var E=h,w=f,x=1,C=0;for(e=1;e<=9;e++)x*=E,C+=this.D[e]*x;var M=this.lat0+C*o*1e5,S=this.long0+w;return t.x=S,t.y=M,t},names:["New_Zealand_Map_Grid","nzmg"]},Ce={init:function(){},forward:function(t){var e=t.x,n=t.y,r=k(e-this.long0),i=this.x0+this.a*r,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=i,t.y=o,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=k(this.long0+t.x/this.a),n=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=n,t},names:["Miller_Cylindrical","mill"]},Me={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Wt(this.es)},forward:function(t){var e,n,r=t.x,i=t.y;if(r=k(r-this.long0),this.sphere){if(this.m)for(var o=this.n*Math.sin(i),a=20;a;--a){var u=(this.m*i+Math.sin(i)-o)/(this.m+Math.cos(i));if(i-=u,Math.abs(u)<s)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;e=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var l=Math.sin(i),c=Math.cos(i);n=this.a*qt(i,l,c,this.en),e=this.a*r*c/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r;return t.x-=this.x0,n=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,n/=this.C_x*(this.m+Math.cos(e)),this.m?e=_e((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=_e(Math.sin(e)/this.n)),n=k(n+this.long0),e=pe(e)):(e=Ht(t.y/this.a,this.es,this.en),(r=Math.abs(e))<a?(r=Math.sin(e),n=k(this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(e)))):r-s<a&&(n=this.long0)),t.x=n,t.y=e,t},names:["Sinusoidal","sinu"]},Se={init:function(){},forward:function(t){for(var e=t.x,n=t.y,r=k(e-this.long0),i=n,o=Math.PI*Math.sin(n);;){var a=-(i+Math.sin(i)-o)/(1+Math.cos(i));if(i+=a,Math.abs(a)<s)break}i/=2,Math.PI/2-Math.abs(n)<s&&(r=0);var u=.900316316158*this.a*r*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=u,t.y=l,t},inverse:function(t){var e,n;t.x-=this.x0,t.y-=this.y0,n=t.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),e=Math.asin(n);var r=k(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]},Ne={init:function(){Math.abs(this.lat1+this.lat2)<s||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ue(this.es),this.e1=le(this.es),this.e2=ce(this.es),this.e3=he(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=L(this.e,this.sinphi,this.cosphi),this.ml1=se(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<s?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=L(this.e,this.sinphi,this.cosphi),this.ml2=se(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=se(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var i=se(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-i)}var o=this.ns*k(n-this.long0),a=this.x0+e*Math.sin(o),s=this.y0+this.rh-e*Math.cos(o);return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;return 0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=k(this.long0+o/this.ns),r=pe(this.g-n/this.a),t.x=i,t.y=r,t):(r=de(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=k(this.long0+o/this.ns),t.x=i,t.y=r,t)},names:["Equidistant_Conic","eqdc"]},Oe={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,i=t.y,o=k(r-this.long0);Math.abs(i)<=s&&(e=this.x0+this.R*o,n=this.y0);var u=_e(2*Math.abs(i/Math.PI));(Math.abs(o)<=s||Math.abs(Math.abs(i)-a)<=s)&&(e=this.x0,n=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*u):this.y0+Math.PI*this.R*-Math.tan(.5*u));var l=.5*Math.abs(Math.PI/o-o/Math.PI),c=l*l,h=Math.sin(u),f=Math.cos(u),p=f/(h+f-1),d=p*p,y=p*(2/h-1),m=y*y,g=Math.PI*this.R*(l*(p-m)+Math.sqrt(c*(p-m)*(p-m)-(m+c)*(d-m)))/(m+c);o<0&&(g=-g),e=this.x0+g;var _=c+p;return g=Math.PI*this.R*(y*_-l*Math.sqrt((m+c)*(c+1)-_*_))/(m+c),n=i>=0?this.y0+g:this.y0-g,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,o,a,u,l,c,h,f,p;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,o=(r=t.x/f)*r+(i=t.y/f)*i,f=3*(i*i/(l=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(u=a-2*i*i+r*r)*u*u/l/l/l-9*a*u/l/l)/27)/(c=(a-u*u/3/l)/l)/(h=2*Math.sqrt(-c/3)),Math.abs(f)>1&&(f=f>=0?1:-1),p=Math.acos(f)/3,n=t.y>=0?(-h*Math.cos(p+Math.PI/3)-u/3/l)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-u/3/l)*Math.PI,e=Math.abs(r)<s?this.long0:k(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-i*i)+o*o))/2/r),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},Ae={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,u,l,c,h,f,p,d,y,m,g,_,b,v,T,E,w,x,C=t.x,M=t.y,S=Math.sin(t.y),N=Math.cos(t.y),O=k(C-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=s?(t.x=this.x0+this.a*(a-M)*Math.sin(O),t.y=this.y0-this.a*(a-M)*Math.cos(O),t):Math.abs(this.sin_p12+1)<=s?(t.x=this.x0+this.a*(a+M)*Math.sin(O),t.y=this.y0+this.a*(a+M)*Math.cos(O),t):(v=this.sin_p12*S+this.cos_p12*N*Math.cos(O),b=(_=Math.acos(v))?_/Math.sin(_):1,t.x=this.x0+this.a*b*N*Math.sin(O),t.y=this.y0+this.a*b*(this.cos_p12*S-this.sin_p12*N*Math.cos(O)),t):(e=ue(this.es),n=le(this.es),r=ce(this.es),i=he(this.es),Math.abs(this.sin_p12-1)<=s?(o=this.a*se(e,n,r,i,a),u=this.a*se(e,n,r,i,M),t.x=this.x0+(o-u)*Math.sin(O),t.y=this.y0-(o-u)*Math.cos(O),t):Math.abs(this.sin_p12+1)<=s?(o=this.a*se(e,n,r,i,a),u=this.a*se(e,n,r,i,M),t.x=this.x0+(o+u)*Math.sin(O),t.y=this.y0+(o+u)*Math.cos(O),t):(l=S/N,c=fe(this.a,this.e,this.sin_p12),h=fe(this.a,this.e,S),f=Math.atan((1-this.es)*l+this.es*c*this.sin_p12/(h*N)),T=0===(p=Math.atan2(Math.sin(O),this.cos_p12*Math.tan(f)-this.sin_p12*Math.cos(O)))?Math.asin(this.cos_p12*Math.sin(f)-this.sin_p12*Math.cos(f)):Math.abs(Math.abs(p)-Math.PI)<=s?-Math.asin(this.cos_p12*Math.sin(f)-this.sin_p12*Math.cos(f)):Math.asin(Math.sin(O)*Math.cos(f)/Math.sin(p)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),_=c*T*(1-(E=T*T)*(g=(y=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es))*y)*(1-g)/6+(w=E*T)/8*(m=d*y)*(1-2*g)+(x=w*T)/120*(g*(4-7*g)-3*d*d*(1-7*g))-x*T/48*m),t.x=this.x0+_*Math.sin(p),t.y=this.y0+_*Math.cos(p),t))},inverse:function(t){var e,n,r,i,o,u,l,c,h,f,p,d,y,m,g,_,b,v,T,E,w,x,C;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*a*this.a)return;return n=e/this.a,r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(e)<=s?u=this.lat0:(u=_e(i*this.sin_p12+t.y*r*this.cos_p12/e),l=Math.abs(this.lat0)-a,o=Math.abs(l)<=s?this.lat0>=0?k(this.long0+Math.atan2(t.x,-t.y)):k(this.long0-Math.atan2(-t.x,t.y)):k(this.long0+Math.atan2(t.x*r,e*this.cos_p12*i-t.y*this.sin_p12*r))),t.x=o,t.y=u,t}return c=ue(this.es),h=le(this.es),f=ce(this.es),p=he(this.es),Math.abs(this.sin_p12-1)<=s?(u=de(((d=this.a*se(c,h,f,p,a))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,c,h,f,p),o=k(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=u,t):Math.abs(this.sin_p12+1)<=s?(d=this.a*se(c,h,f,p,a),u=de(((e=Math.sqrt(t.x*t.x+t.y*t.y))-d)/this.a,c,h,f,p),o=k(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=u,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),g=Math.atan2(t.x,t.y),y=fe(this.a,this.e,this.sin_p12),_=Math.cos(g),v=-(b=this.e*this.cos_p12*_)*b/(1-this.es),T=3*this.es*(1-v)*this.sin_p12*this.cos_p12*_/(1-this.es),x=1-v*(w=(E=e/y)-v*(1+v)*Math.pow(E,3)/6-T*(1+3*v)*Math.pow(E,4)/24)*w/2-E*w*w*w/6,m=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*_),o=k(this.long0+Math.asin(Math.sin(g)*Math.sin(w)/Math.cos(m))),C=Math.sin(m),u=Math.atan2((C-this.es*x*this.sin_p12)*Math.tan(m),C*(1-this.es)),t.x=o,t.y=u,t)},names:["Azimuthal_Equidistant","aeqd"]},Ie={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,a,u,l=t.x,c=t.y;return r=k(l-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),((o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=s)&&(a=1*this.a*n*Math.sin(r),u=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=u,t},inverse:function(t){var e,n,r,i,o,u,l;return t.x-=this.x0,t.y-=this.y0,n=_e((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),r=Math.sin(n),i=Math.cos(n),u=this.long0,Math.abs(e)<=s?(l=this.lat0,t.x=u,t.y=l,t):(l=_e(i*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.abs(this.lat0)-a,Math.abs(o)<=s?(u=this.lat0>=0?k(this.long0+Math.atan2(t.x,-t.y)):k(this.long0-Math.atan2(-t.x,t.y)),t.x=u,t.y=l,t):(u=k(this.long0+Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r)),t.x=u,t.y=l,t))},names:["ortho"]};function Pe(t,e,n,r){var i;return t<s?(r.value=1,i=0):(i=Math.atan2(e,n),Math.abs(i)<=c?r.value=1:i>c&&i<=a+c?(r.value=2,i-=a):i>a+c||i<=-(a+c)?(r.value=3,i=i>=0?i-f:i+f):(r.value=4,i+=a)),i}function Re(t,e){var n=t+e;return n<-f?n+=h:n>+f&&(n-=h),n}const Le={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=a-c/2?this.face=5:this.lat0<=-(a-c/2)?this.face=6:Math.abs(this.long0)<=c?this.face=1:Math.abs(this.long0)<=a+c?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,r,i,o,s,u={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,5===this.face)i=a-e,n>=c&&n<=a+c?(l.value=1,r=n-a):n>a+c||n<=-(a+c)?(l.value=2,r=n>0?n-f:n+f):n>-(a+c)&&n<=-c?(l.value=3,r=n+a):(l.value=4,r=n);else if(6===this.face)i=a+e,n>=c&&n<=a+c?(l.value=1,r=-n+a):n<c&&n>=-c?(l.value=2,r=-n):n<-c&&n>=-(a+c)?(l.value=3,r=-n-a):(l.value=4,r=n>0?-n+f:-n-f);else{var h,p,d,y,m,g;2===this.face?n=Re(n,+a):3===this.face?n=Re(n,+f):4===this.face&&(n=Re(n,-a)),y=Math.sin(e),m=Math.cos(e),g=Math.sin(n),h=m*Math.cos(n),p=m*g,d=y,1===this.face?r=Pe(i=Math.acos(h),d,p,l):2===this.face?r=Pe(i=Math.acos(p),d,-h,l):3===this.face?r=Pe(i=Math.acos(-h),d,-p,l):4===this.face?r=Pe(i=Math.acos(-p),d,h,l):(i=r=0,l.value=1)}return s=Math.atan(12/f*(r+Math.acos(Math.sin(r)*Math.cos(c))-a)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(r))))),2===l.value?s+=a:3===l.value?s+=f:4===l.value&&(s+=1.5*f),u.x=o*Math.cos(s),u.y=o*Math.sin(s),u.x=u.x*this.a+this.x0,u.y=u.y*this.a+this.y0,t.x=u.x,t.y=u.y,t},inverse:function(t){var e,n,r,i,o,s,u,l,c,h,p,d,y={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=2,e-=a):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=3,e=e<0?e+f:e-f):(m.value=4,e+=a),c=f/12*Math.tan(e),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),s=Math.atan(o),(u=1-(r=Math.cos(e))*r*(i=Math.tan(n))*i*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?u=-1:u>1&&(u=1),5===this.face)l=Math.acos(u),y.phi=a-l,1===m.value?y.lam=s+a:2===m.value?y.lam=s<0?s+f:s-f:3===m.value?y.lam=s-a:y.lam=s;else if(6===this.face)l=Math.acos(u),y.phi=l-a,1===m.value?y.lam=-s+a:2===m.value?y.lam=-s:3===m.value?y.lam=-s-a:y.lam=s<0?-s-f:-s+f;else{var g,_,b;c=(g=u)*g,_=(c+=(b=c>=1?0:Math.sqrt(1-c)*Math.sin(s))*b)>=1?0:Math.sqrt(1-c),2===m.value?(c=_,_=-b,b=c):3===m.value?(_=-_,b=-b):4===m.value&&(c=_,_=b,b=-c),2===this.face?(c=g,g=-_,_=c):3===this.face?(g=-g,_=-_):4===this.face&&(c=g,g=_,_=-c),y.phi=Math.acos(-b)-a,y.lam=Math.atan2(_,g),2===this.face?y.lam=Re(y.lam,-a):3===this.face?y.lam=Re(y.lam,-f):4===this.face&&(y.lam=Re(y.lam,+a))}return 0!==this.es&&(h=y.phi<0?1:0,p=Math.tan(y.phi),d=this.b/Math.sqrt(p*p+this.one_minus_f_squared),y.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),h&&(y.phi=-y.phi)),y.lam+=this.long0,t.x=y.lam,t.y=y.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var De=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],ke=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Fe=.8487,Ue=1.3523,Be=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const je={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=k(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(11.459155902616464*n);r<0?r=0:r>=18&&(r=17);var i={x:Be(De[r],n=l*(n-.08726646259971647*r))*e,y:Be(ke[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*Fe+this.x0,i.y=i.y*this.a*Ue+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*Fe),y:Math.abs(t.y-this.y0)/(this.a*Ue)};if(e.y>=1)e.x/=De[18][0],e.y=t.y<0?-a:a;else{var n=Math.floor(18*e.y);for(n<0?n=0:n>=18&&(n=17);;)if(ke[n][0]>e.y)--n;else{if(!(ke[n+1][0]<=e.y))break;++n}var r=ke[n],i=5*(e.y-r[0])/(ke[n+1][0]-r[0]);i=function(t,e,n,r){for(var i=e;r;--r){var o=t(i);if(i-=o,Math.abs(o)<1e-10)break}return i}((function(t){return(Be(r,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(r,t)}),i,0,100),e.x/=Be(De[n],i),e.y=(5*n+i)*u,t.y<0&&(e.y=-e.y)}return e.x=k(e.x+this.long0),e},names:["Robinson","robin"]},Ge={init:function(){this.name="geocent"},forward:function(t){return st(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var We={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const qe={init:function(){if(Object.keys(We).forEach(function(t){if(void 0===this[t])this[t]=We[t].def;else{if(We[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);We[t].num&&(this[t]=parseFloat(this[t]))}We[t].degrees&&(this[t]=this[t]*u)}.bind(this)),Math.abs(Math.abs(this.lat0)-a)<s?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<s?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,n,r,i,o=Math.sin(t.y),a=Math.cos(t.y),s=Math.cos(t.x);switch(this.mode){case 3:n=this.sinph0*o+this.cosph0*a*s;break;case 2:n=a*s;break;case 1:n=-o;break;case 0:n=o}switch(e=(n=this.pn1/(this.p-n))*a*Math.sin(t.x),this.mode){case 3:n*=this.cosph0*o-this.sinph0*a*s;break;case 2:n*=o;break;case 0:n*=-a*s;break;case 1:n*=a*s}return i=1/((r=n*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-n*this.sg)*this.cw*i,n=r*i,t.x=e*this.a,t.y=n*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,n,r,i={x:t.x,y:t.y};r=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*r,n=this.pn1*t.y*this.cw*r,t.x=e*this.cg+n*this.sg,t.y=n*this.cg-e*this.sg;var o=Xt(t.x,t.y);if(Math.abs(o)<s)i.x=0,i.y=t.y;else{var a,u;switch(u=1-o*o*this.pfact,u=(this.p-Math.sqrt(u))/(this.pn1/o+o/this.pn1),a=Math.sqrt(1-u*u),this.mode){case 3:i.y=Math.asin(a*this.sinph0+t.y*u*this.cosph0/o),t.y=(a-this.sinph0*Math.sin(i.y))*o,t.x*=u*this.cosph0;break;case 2:i.y=Math.asin(t.y*u/o),t.y=a*o,t.x*=u;break;case 0:i.y=Math.asin(a),t.y=-t.y;break;case 1:i.y=-Math.asin(a)}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t},names:["Tilted_Perspective","tpers"]},He={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,n,r,i,o=t.x,a=t.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/Xt(this.radius_p*Math.cos(a),Math.sin(a));if(n=s*Math.cos(o)*Math.cos(a),r=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-n)*n-r*r-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Xt(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Xt(r,e)))}else"sphere"===this.shape&&(e=Math.cos(a),n=Math.cos(o)*e,r=Math.sin(o)*e,i=Math.sin(a),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Xt(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Xt(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,r,i,o=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Xt(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Xt(1,a));var u=s/this.radius_p;if(e=a*a+u*u+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var ze;Tt.defaultDatum="WGS84",Tt.Proj=at,Tt.WGS84=new Tt.Proj("WGS84"),Tt.Point=Ut,Tt.toPoint=yt,Tt.defs=A,Tt.nadgrid=function(t,e){var n=new DataView(e),r=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&K.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(n),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:et(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(n,r);i.nSubgrids>1&&K.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var o=function(t,e,n){for(var r=[],i=0;i<e.nSubgrids;i++){var o=rt(t,176,n),a=it(t,176,o,n),s=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),u=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);r.push({ll:[tt(o.lowerLongitude),tt(o.lowerLatitude)],del:[tt(o.longitudeInterval),tt(o.latitudeInterval)],lim:[s,u],count:o.gridNodeCount,cvs:nt(a)})}return r}(n,i,r),a={header:i,subgrids:o};return J[t]=a,a},Tt.transform=gt,Tt.mgrs=St,Tt.version="__VERSION__",(ze=Tt).Proj.projections.add(zt),ze.Proj.projections.add(Qt),ze.Proj.projections.add(Kt),ze.Proj.projections.add(te),ze.Proj.projections.add(ee),ze.Proj.projections.add(ne),ze.Proj.projections.add(ie),ze.Proj.projections.add(oe),ze.Proj.projections.add(ae),ze.Proj.projections.add(ye),ze.Proj.projections.add(ge),ze.Proj.projections.add(be),ze.Proj.projections.add(ve),ze.Proj.projections.add(Te),ze.Proj.projections.add(Ee),ze.Proj.projections.add(we),ze.Proj.projections.add(xe),ze.Proj.projections.add(Ce),ze.Proj.projections.add(Me),ze.Proj.projections.add(Se),ze.Proj.projections.add(Ne),ze.Proj.projections.add(Oe),ze.Proj.projections.add(Ae),ze.Proj.projections.add(Ie),ze.Proj.projections.add(Le),ze.Proj.projections.add(je),ze.Proj.projections.add(Ge),ze.Proj.projections.add(qe),ze.Proj.projections.add(He);const Ve=Tt},2587:t=>{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,n,r,i){n=n||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(n);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u=t.length;s>0&&u>s&&(u=s);for(var l=0;l<u;++l){var c,h,f,p,d=t[l].replace(a,"%20"),y=d.indexOf(r);y>=0?(c=d.substr(0,y),h=d.substr(y+1)):(c=d,h=""),f=decodeURIComponent(c),p=decodeURIComponent(h),e(o,f)?Array.isArray(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}},2361:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,n,r,i){return n=n||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var o=encodeURIComponent(e(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return o+encodeURIComponent(e(t))})).join(n):o+encodeURIComponent(e(t[i]))})).join(n):i?encodeURIComponent(e(i))+r+encodeURIComponent(e(t)):""}},7673:(t,e,n)=>{"use strict";e.decode=e.parse=n(2587),e.encode=e.stringify=n(2361)},9189:(t,e,n)=>{var r=n(5717),i=n(7187).EventEmitter;function o(t){if(!(this instanceof o))return new o(t);i.call(this),t=t||{},this.concurrency=t.concurrency||1/0,this.timeout=t.timeout||0,this.autostart=t.autostart||!1,this.results=t.results||null,this.pending=0,this.session=0,this.running=!1,this.jobs=[],this.timers={}}function a(){for(var t in this.timers){var e=this.timers[t];delete this.timers[t],clearTimeout(e)}}function s(t){var e=this;function n(t){e.end(t)}this.on("error",n),this.on("end",(function r(i){e.removeListener("error",n),e.removeListener("end",r),t(i,this.results)}))}function u(t){this.session++,this.running=!1,this.emit("end",t)}t.exports=o,t.exports.default=o,r(o,i),["pop","shift","indexOf","lastIndexOf"].forEach((function(t){o.prototype[t]=function(){return Array.prototype[t].apply(this.jobs,arguments)}})),o.prototype.slice=function(t,e){return this.jobs=this.jobs.slice(t,e),this},o.prototype.reverse=function(){return this.jobs.reverse(),this},["push","unshift","splice"].forEach((function(t){o.prototype[t]=function(){var e=Array.prototype[t].apply(this.jobs,arguments);return this.autostart&&this.start(),e}})),Object.defineProperty(o.prototype,"length",{get:function(){return this.pending+this.jobs.length}}),o.prototype.start=function(t){if(t&&s.call(this,t),this.running=!0,!(this.pending>=this.concurrency))if(0!==this.jobs.length){var e=this,n=this.jobs.shift(),r=!0,i=this.session,o=null,a=!1,l=null,c=n.timeout||this.timeout;c&&(o=setTimeout((function(){a=!0,e.listeners("timeout").length>0?e.emit("timeout",f,n):f()}),c),this.timers[o]=o),this.results&&(l=this.results.length,this.results[l]=null),this.pending++,e.emit("start",n);var h=n(f);h&&h.then&&"function"==typeof h.then&&h.then((function(t){return f(null,t)})).catch((function(t){return f(t||!0)})),this.running&&this.jobs.length>0&&this.start()}else 0===this.pending&&u.call(this);function f(t,s){r&&e.session===i&&(r=!1,e.pending--,null!==o&&(delete e.timers[o],clearTimeout(o)),t?e.emit("error",t,n):!1===a&&(null!==l&&(e.results[l]=Array.prototype.slice.call(arguments,1)),e.emit("success",s,n)),e.session===i&&(0===e.pending&&0===e.jobs.length?u.call(e):e.running&&e.start()))}},o.prototype.stop=function(){this.running=!1},o.prototype.end=function(t){a.call(this),this.jobs.length=0,this.pending=0,u.call(this,t)}},2582:function(t){t.exports=function(){"use strict";function t(t,r,i,o,a){!function t(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var f=n[r],p=i,d=o;for(e(n,i,r),a(n[o],f)>0&&e(n,i,o);p<d;){for(e(n,p,d),p++,d--;a(n[p],f)<0;)p++;for(;a(n[d],f)>0;)d--}0===a(n[i],f)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(t,r,i||0,o||t.length-1,a||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,r,i){i||(i=d(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];s(i,t.leaf?r(a):a)}return i}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!p(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;p(t,s)&&(e.leaf?n.push(a):f(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!p(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(p(t,o)){if(e.leaf||f(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=d([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=l.pop(),o=!0),a.leaf){var c=i(t,a.children,e);if(-1!==c)return a.children.splice(c,1),u.push(a),this._condense(u),this}o||a.leaf||!f(a,s)?r?(n++,a=r.children[n],o=!1):a=null:(u.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(a<=s)return o(i=d(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(i=d([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));y(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var h=Math.min(c+l-1,n);y(t,c,h,u,this.compareMinY);for(var f=c;f<=h;f+=u){var p=Math.min(f+u-1,h);i.children.push(this._build(t,f,p,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var u=e.children[s],l=c(u),h=(f=t,p=u,(Math.max(p.maxX,f.maxX)-Math.min(p.minX,f.minX))*(Math.max(p.maxY,f.maxY)-Math.min(p.minY,f.minY))-l);h<o?(o=h,i=l<i?l:i,a=u):h===o&&l<i&&(i=l,a=u)}e=a||e.children[0]}var f,p;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),s(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=d(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,s,u,l,h,f=1/0,p=1/0,d=e;d<=n-e;d++){var y=a(t,0,d,this.toBBox),m=a(t,d,n,this.toBBox),g=(i=y,o=m,void 0,void 0,void 0,void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,h-u)),_=c(y)+c(m);g<f?(f=g,r=d,p=_<p?_:p):g===f&&_<p&&(p=_,r=d)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=a(t,0,e,i),u=a(t,n-e,n,i),l=h(o)+h(u),c=e;c<n-e;c++){var f=t.children[c];s(o,t.leaf?i(f):f),l+=h(o)}for(var p=n-e-1;p>=e;p--){var d=t.children[p];s(u,t.leaf?i(d):d),l+=h(u)}return l},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)s(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},6102:(t,e,n)=>{"use strict";var r=n(4472).hasOwnProperty("default")?n(4472).default:n(4472);function i(t,e){return(n=t).length>=2&&"number"==typeof n[0]&&"number"==typeof n[1]?e(t):t.map((function(t){return i(t,e)}));var n}function o(t,e,n){if(null==n)return n;var r=function(t){if(null==t||"object"!=typeof t)return t;var e=t.constructor();for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(n),i=o.bind(this,t,e);switch(n.type){case"Feature":r.geometry=i(n.geometry);break;case"FeatureCollection":r.features=r.features.map(i);break;case"GeometryCollection":r.geometries=r.geometries.map(i);break;default:t(r)}return e&&e(r),r}function a(t,e){var n,r=t.crs;if(void 0===r)throw new Error('Unable to detect CRS, GeoJSON has no "crs" property.');if("name"===r.type?n=e[r.properties.name]:"EPSG"===r.type&&(n=e["EPSG:"+r.properties.code]),!n)throw new Error("CRS defined in crs section could not be identified: "+JSON.stringify(r));return n}function s(t,e){return"string"==typeof t||t instanceof String?e[t]||r.Proj(t):t}function u(t,e,n,u){u=u||{},e=e?s(e,u):a(t,u),n=s(n,u);var l=r(e,n).forward.bind(l);function c(t){var e=l(t);return 3===t.length&&void 0!==t[2]&&void 0===e[2]&&(e[2]=t[2]),e}return o((function(t){t.crs&&delete t.crs,t.coordinates=i(t.coordinates,c)}),(function(t){t.bbox&&(t.bbox=function(t){var e=[Number.MAX_VALUE,Number.MAX_VALUE],n=[-Number.MAX_VALUE,-Number.MAX_VALUE];return o((function(t){i(t.coordinates,(function(t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),n[0]=Math.max(n[0],t[0]),n[1]=Math.max(n[1],t[1])}))}),null,t),[e[0],e[1],n[0],n[1]]}(t))}),t)}t.exports={detectCrs:a,reproject:u,reverse:function(t){return o((function(t){t.coordinates=i(t.coordinates,(function(t){return[t[1],t[0]]}))}),null,t)},toWgs84:function(t,e,n){return u(t,e,r.WGS84,n)}}},3686:function(t,e){var n=void 0,r=function(e){return n||(n=new Promise((function(n,r){var i,o=void 0!==e?e:{},a=o.onAbort;o.onAbort=function(t){r(new Error(t)),a&&a(t)},o.postRun=o.postRun||[],o.postRun.push((function(){n(o)})),t=void 0,i||(i=void 0!==o?o:{}),i.onRuntimeInitialized=function(){function t(t,e){this.Ka=t,this.db=e,this.Ia=1,this.cb=[]}function e(t,e){if(this.db=e,e=W(t)+1,this.Xa=xe(e),null===this.Xa)throw Error("Unable to allocate memory for the SQL string");G(t,R,this.Xa,e),this.bb=this.Xa,this.Ta=this.hb=null}function n(t){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),null!=t){var e=this.filename,n="/",i=e;if(n&&(n="string"==typeof n?n:It(n),i=e?ut(n+"/"+e):n),e=ue(!0,!0),i=Ht(i,4095&(void 0!==e?e:438)|32768,0),t){if("string"==typeof t){n=Array(t.length);for(var o=0,s=t.length;o<s;++o)n[o]=t.charCodeAt(o);t=n}$t(i,146|e),n=ee(i,577),oe(n,t,0,t.length,0,void 0),ne(n),$t(i,e)}}this.handleError(a(this.filename,r)),this.db=M(r,"i32"),nt(this.db),this.Ya={},this.Qa={}}var r=Ae(4),o=i.cwrap,a=o("sqlite3_open","number",["string","number"]),s=o("sqlite3_close_v2","number",["number"]),u=o("sqlite3_exec","number",["number","string","number","number","number"]),l=o("sqlite3_changes","number",["number"]),c=o("sqlite3_prepare_v2","number",["number","string","number","number","number"]),h=o("sqlite3_sql","string",["number"]),f=o("sqlite3_normalized_sql","string",["number"]),p=o("sqlite3_prepare_v2","number",["number","number","number","number","number"]),d=o("sqlite3_bind_text","number",["number","number","number","number","number"]),y=o("sqlite3_bind_blob","number",["number","number","number","number","number"]),m=o("sqlite3_bind_double","number",["number","number","number"]),g=o("sqlite3_bind_int","number",["number","number","number"]),_=o("sqlite3_bind_parameter_index","number",["number","string"]),b=o("sqlite3_step","number",["number"]),v=o("sqlite3_errmsg","string",["number"]),E=o("sqlite3_column_count","number",["number"]),S=o("sqlite3_data_count","number",["number"]),N=o("sqlite3_column_double","number",["number","number"]),O=o("sqlite3_column_text","string",["number","number"]),I=o("sqlite3_column_blob","number",["number","number"]),L=o("sqlite3_column_bytes","number",["number","number"]),D=o("sqlite3_column_type","number",["number","number"]),k=o("sqlite3_column_name","string",["number","number"]),F=o("sqlite3_reset","number",["number"]),U=o("sqlite3_clear_bindings","number",["number"]),B=o("sqlite3_finalize","number",["number"]),q=o("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),H=o("sqlite3_value_type","number",["number"]),V=o("sqlite3_value_bytes","number",["number"]),X=o("sqlite3_value_text","string",["number"]),Y=o("sqlite3_value_blob","number",["number"]),Z=o("sqlite3_value_double","number",["number"]),Q=o("sqlite3_result_double","",["number","number"]),K=o("sqlite3_result_null","",["number"]),J=o("sqlite3_result_text","",["number","string","number","number"]),$=o("sqlite3_result_blob","",["number","number","number","number"]),tt=o("sqlite3_result_int","",["number","number"]),et=o("sqlite3_result_error","",["number","string","number"]),nt=o("RegisterExtensionFunctions","number",["number"]);t.prototype.bind=function(t){if(!this.Ka)throw"Statement closed";return this.reset(),Array.isArray(t)?this.wb(t):null==t||"object"!=typeof t||this.xb(t)},t.prototype.step=function(){if(!this.Ka)throw"Statement closed";this.Ia=1;var t=b(this.Ka);switch(t){case 100:return!0;case 101:return!1;default:throw this.db.handleError(t)}},t.prototype.rb=function(t){return null==t&&(t=this.Ia,this.Ia+=1),N(this.Ka,t)},t.prototype.Bb=function(t){if(null==t&&(t=this.Ia,this.Ia+=1),t=O(this.Ka,t),"function"!=typeof BigInt)throw Error("BigInt is not supported");return BigInt(t)},t.prototype.Cb=function(t){return null==t&&(t=this.Ia,this.Ia+=1),O(this.Ka,t)},t.prototype.getBlob=function(t){null==t&&(t=this.Ia,this.Ia+=1);var e=L(this.Ka,t);t=I(this.Ka,t);for(var n=new Uint8Array(e),r=0;r<e;r+=1)n[r]=P[t+r];return n},t.prototype.get=function(t,e){e=e||{},null!=t&&this.bind(t)&&this.step(),t=[];for(var n=S(this.Ka),r=0;r<n;r+=1)switch(D(this.Ka,r)){case 1:var i=e.useBigInt?this.Bb(r):this.rb(r);t.push(i);break;case 2:t.push(this.rb(r));break;case 3:t.push(this.Cb(r));break;case 4:t.push(this.getBlob(r));break;default:t.push(null)}return t},t.prototype.getColumnNames=function(){for(var t=[],e=E(this.Ka),n=0;n<e;n+=1)t.push(k(this.Ka,n));return t},t.prototype.getAsObject=function(t,e){t=this.get(t,e),e=this.getColumnNames();for(var n={},r=0;r<e.length;r+=1)n[e[r]]=t[r];return n},t.prototype.getSQL=function(){return h(this.Ka)},t.prototype.getNormalizedSQL=function(){return f(this.Ka)},t.prototype.run=function(t){return null!=t&&this.bind(t),this.step(),this.reset()},t.prototype.mb=function(t,e){null==e&&(e=this.Ia,this.Ia+=1);var n=A(t=Te(t));this.cb.push(n),this.db.handleError(d(this.Ka,e,n,t.length-1,0))},t.prototype.vb=function(t,e){null==e&&(e=this.Ia,this.Ia+=1);var n=A(t);this.cb.push(n),this.db.handleError(y(this.Ka,e,n,t.length,0))},t.prototype.lb=function(t,e){null==e&&(e=this.Ia,this.Ia+=1),this.db.handleError((t===(0|t)?g:m)(this.Ka,e,t))},t.prototype.yb=function(t){null==t&&(t=this.Ia,this.Ia+=1),y(this.Ka,t,0,0,0)},t.prototype.nb=function(t,e){switch(null==e&&(e=this.Ia,this.Ia+=1),typeof t){case"string":return void this.mb(t,e);case"number":return void this.lb(t,e);case"bigint":return void this.mb(t.toString(),e);case"boolean":return void this.lb(t+0,e);case"object":if(null===t)return void this.yb(e);if(null!=t.length)return void this.vb(t,e)}throw"Wrong API use : tried to bind a value of an unknown type ("+t+")."},t.prototype.xb=function(t){var e=this;return Object.keys(t).forEach((function(n){var r=_(e.Ka,n);0!==r&&e.nb(t[n],r)})),!0},t.prototype.wb=function(t){for(var e=0;e<t.length;e+=1)this.nb(t[e],e+1);return!0},t.prototype.reset=function(){return this.freemem(),0===U(this.Ka)&&0===F(this.Ka)},t.prototype.freemem=function(){for(var t;void 0!==(t=this.cb.pop());)Ce(t)},t.prototype.free=function(){this.freemem();var t=0===B(this.Ka);return delete this.db.Ya[this.Ka],this.Ka=0,t},e.prototype.next=function(){if(null===this.Xa)return{done:!0};if(null!==this.Ta&&(this.Ta.free(),this.Ta=null),!this.db.db)throw this.fb(),Error("Database closed");var e=Ne(),n=Ae(4);C(r),C(n);try{this.db.handleError(p(this.db.db,this.bb,-1,r,n)),this.bb=M(n,"i32");var i=M(r,"i32");return 0===i?(this.fb(),{done:!0}):(this.Ta=new t(i,this.db),this.db.Ya[i]=this.Ta,{value:this.Ta,done:!1})}catch(t){throw this.hb=j(this.bb),this.fb(),t}finally{Oe(e)}},e.prototype.fb=function(){Ce(this.Xa),this.Xa=null},e.prototype.getRemainingSQL=function(){return null!==this.hb?this.hb:j(this.bb)},"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(e.prototype[Symbol.iterator]=function(){return this}),n.prototype.run=function(t,e){if(!this.db)throw"Database closed";if(e){t=this.prepare(t,e);try{t.step()}finally{t.free()}}else this.handleError(u(this.db,t,0,0,r));return this},n.prototype.exec=function(e,n,i){if(!this.db)throw"Database closed";var o=Ne(),a=null;try{var s=W(e)+1,u=Ae(s);G(e,P,u,s);var l=u,c=Ae(4);for(e=[];0!==M(l,"i8");){C(r),C(c),this.handleError(p(this.db,l,-1,r,c));var h=M(r,"i32");if(l=M(c,"i32"),0!==h){for(s=null,a=new t(h,this),null!=n&&a.bind(n);a.step();)null===s&&(s={columns:a.getColumnNames(),values:[]},e.push(s)),s.values.push(a.get(null,i));a.free()}}return e}catch(t){throw a&&a.free(),t}finally{Oe(o)}},n.prototype.each=function(t,e,n,r,i){"function"==typeof e&&(r=n,n=e,e=void 0),t=this.prepare(t,e);try{for(;t.step();)n(t.getAsObject(null,i))}finally{t.free()}if("function"==typeof r)return r()},n.prototype.prepare=function(e,n){if(C(r),this.handleError(c(this.db,e,-1,r,0)),0===(e=M(r,"i32")))throw"Nothing to prepare";var i=new t(e,this);return null!=n&&i.bind(n),this.Ya[e]=i},n.prototype.iterateStatements=function(t){return new e(t,this)},n.prototype.export=function(){Object.values(this.Ya).forEach((function(t){t.free()})),Object.values(this.Qa).forEach(x),this.Qa={},this.handleError(s(this.db));var t=ae(this.filename);return this.handleError(a(this.filename,r)),this.db=M(r,"i32"),t},n.prototype.close=function(){null!==this.db&&(Object.values(this.Ya).forEach((function(t){t.free()})),Object.values(this.Qa).forEach(x),this.Qa={},this.handleError(s(this.db)),Zt("/"+this.filename),this.db=null)},n.prototype.handleError=function(t){if(0===t)return null;throw t=v(this.db),Error(t)},n.prototype.getRowsModified=function(){return l(this.db)},n.prototype.create_function=function(t,e){Object.prototype.hasOwnProperty.call(this.Qa,t)&&(x(this.Qa[t]),delete this.Qa[t]);var n=function(t){if(!T){T=new WeakMap;for(var e=z.length,n=0;n<0+e;n++){var r=z.get(n);r&&T.set(r,n)}}if(T.has(t))return T.get(t);if(w.length)e=w.pop();else{try{z.grow(1)}catch(t){if(!(t instanceof RangeError))throw t;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}e=z.length-1}try{z.set(e,t)}catch(o){if(!(o instanceof TypeError))throw o;if("function"==typeof WebAssembly.Function){r={i:"i32",j:"i64",f:"f32",d:"f64"};var i={parameters:[],results:[]};for(n=1;4>n;++n)i.parameters.push(r["viii"[n]]);n=new WebAssembly.Function(i,t)}else{for(i={i:127,j:126,f:125,d:124},(r=[1,0,1,96]).push(3),n=0;3>n;++n)r.push(i["iii"[n]]);r.push(0),r[1]=r.length-2,n=new Uint8Array([0,97,115,109,1,0,0,0].concat(r,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),n=new WebAssembly.Module(n),n=new WebAssembly.Instance(n,{e:{f:t}}).exports.f}z.set(e,n)}return T.set(t,e),e}((function(t,n,r){for(var i,o=[],a=0;a<n;a+=1){var s=M(r+4*a,"i32"),u=H(s);if(1===u||2===u)s=Z(s);else if(3===u)s=X(s);else if(4===u){s=V(u=s),u=Y(u);for(var l=new Uint8Array(s),c=0;c<s;c+=1)l[c]=P[u+c];s=l}else s=null;o.push(s)}try{i=e.apply(null,o)}catch(e){return void et(t,e,-1)}switch(typeof i){case"boolean":tt(t,i?1:0);break;case"number":Q(t,i);break;case"string":J(t,i,-1,-1);break;case"object":null===i?K(t):null!=i.length?(n=A(i),$(t,n,i.length,-1),Ce(n)):et(t,"Wrong API use : tried to return a value of an unknown type ("+i+").",-1);break;default:K(t)}}));return this.Qa[t]=n,this.handleError(q(this.db,t,e.length,1,0,n,0,0,0)),this},i.Database=n};var s,u,l,c,h,f,p=Object.assign({},i),d="./this.program",y="object"==typeof window,m="function"==typeof importScripts,g="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";g?(_=m?require("path").dirname(_)+"/":__dirname+"/",f=()=>{h||(c=require("fs"),h=require("path"))},s=function(t,e){return f(),t=h.normalize(t),c.readFileSync(t,e?void 0:"utf8")},l=t=>((t=s(t,!0)).buffer||(t=new Uint8Array(t)),t),u=(t,e,n)=>{f(),t=h.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(d=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),void 0!==t&&(t.exports=i),i.inspect=function(){return"[Emscripten Module object]"}):(y||m)&&(m?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},m&&(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),u=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var b=i.print||console.log.bind(console),v=i.printErr||console.warn.bind(console);Object.assign(i,p),p=null,i.thisProgram&&(d=i.thisProgram);var T,E,w=[];function x(t){T.delete(z.get(t)),w.push(t)}function C(t){var e="i32";switch("*"===e.charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":P[t>>0]=0;break;case"i16":L[t>>1]=0;break;case"i32":D[t>>2]=0;break;case"i64":J=[0,(K=0,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[t>>2]=J[0],D[t+4>>2]=J[1];break;case"float":k[t>>2]=0;break;case"double":F[t>>3]=0;break;default:nt("invalid type for setValue: "+e)}}function M(t,e="i8"){switch("*"===e.charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return P[t>>0];case"i16":return L[t>>1];case"i32":case"i64":return D[t>>2];case"float":return k[t>>2];case"double":return Number(F[t>>3]);default:nt("invalid type for getValue: "+e)}return null}i.wasmBinary&&(E=i.wasmBinary),i.noExitRuntime,"object"!=typeof WebAssembly&&nt("no native wasm support detected");var S,N=!1;function O(t,e,n,r){var o={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);e=Ae(n),G(t,R,e,n)}return e},array:function(t){var e=Ae(t.length);return P.set(t,e),e}};t=i["_"+t];var a,s=[],u=0;if(r)for(var l=0;l<r.length;l++){var c=o[n[l]];c?(0===u&&(u=Ne()),s[l]=c(r[l])):s[l]=r[l]}return a=n=t.apply(null,s),0!==u&&Oe(u),"string"===e?j(a):"boolean"===e?!!a:a}function A(t){var e=xe(t.length);return t.subarray||t.slice||(t=new Uint8Array(t)),R.set(t,e),e}var I,P,R,L,D,k,F,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(t,e,n){var r=e+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&U)return U.decode(t.subarray(e,n));for(r="";e<n;){var i=t[e++];if(128&i){var o=63&t[e++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|o);else{var a=63&t[e++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function j(t,e){return t?B(R,t,e):""}function G(t,e,n,r){if(!(0<r))return 0;var i=n;r=n+r-1;for(var o=0;o<t.length;++o){var a=t.charCodeAt(o);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++]=a}else{if(2047>=a){if(n+1>=r)break;e[n++]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++]=224|a>>12}else{if(n+3>=r)break;e[n++]=240|a>>18,e[n++]=128|a>>12&63}e[n++]=128|a>>6&63}e[n++]=128|63&a}}return e[n]=0,n-i}function W(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++n)),127>=r?++e:e=2047>=r?e+2:65535>=r?e+3:e+4}return e}function q(t){var e=W(t)+1,n=xe(e);return n&&G(t,P,n,e),n}function H(){var t=S.buffer;I=t,i.HEAP8=P=new Int8Array(t),i.HEAP16=L=new Int16Array(t),i.HEAP32=D=new Int32Array(t),i.HEAPU8=R=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=new Uint32Array(t),i.HEAPF32=k=new Float32Array(t),i.HEAPF64=F=new Float64Array(t)}var z,V=[],X=[],Y=[];function Z(){var t=i.preRun.shift();V.unshift(t)}var Q,K,J,$=0,tt=null,et=null;function nt(t){throw i.onAbort&&i.onAbort(t),v(t="Aborted("+t+")"),N=!0,new WebAssembly.RuntimeError(t+". Build with -s ASSERTIONS=1 for more info.")}function rt(){return Q.startsWith("data:application/octet-stream;base64,")}if(i.preloadedImages={},i.preloadedAudios={},Q="sql-wasm.wasm",!rt()){var it=Q;Q=i.locateFile?i.locateFile(it,_):_+it}function ot(){var t=Q;try{if(t==Q&&E)return new Uint8Array(E);if(l)return l(t);throw"both async and sync fetching of the wasm failed"}catch(t){nt(t)}}function at(t){for(;0<t.length;){var e=t.shift();if("function"==typeof e)e(i);else{var n=e.Ib;"number"==typeof n?void 0===e.eb?z.get(n)():z.get(n)(e.eb):n(void 0===e.eb?null:e.eb)}}}function st(t,e){for(var n=0,r=t.length-1;0<=r;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n;n--)t.unshift("..");return t}function ut(t){var e="/"===t.charAt(0),n="/"===t.substr(-1);return(t=st(t.split("/").filter((function(t){return!!t})),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t}function lt(t){var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&(e=e.substr(0,e.length-1)),t+e):"."}function ct(t){if("/"===t)return"/";var e=(t=(t=ut(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)}function ht(){for(var t="",e=!1,n=arguments.length-1;-1<=n&&!e;n--){if("string"!=typeof(e=0<=n?arguments[n]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!e)return"";t=e+"/"+t,e="/"===e.charAt(0)}return(e?"/":"")+(t=st(t.split("/").filter((function(t){return!!t})),!e).join("/"))||"."}var ft=[];function pt(t,e){ft[t]={input:[],output:[],Wa:e},Wt(t,_t)}var dt,yt,mt,gt,_t={open:function(t){var e=ft[t.node.rdev];if(!e)throw new Nt(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.Wa.flush(t.tty)},flush:function(t){t.tty.Wa.flush(t.tty)},read:function(t,e,n,r){if(!t.tty||!t.tty.Wa.sb)throw new Nt(60);for(var i=0,o=0;o<r;o++){try{var a=t.tty.Wa.sb(t.tty)}catch(t){throw new Nt(29)}if(void 0===a&&0===i)throw new Nt(6);if(null==a)break;i++,e[n+o]=a}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,n,r){if(!t.tty||!t.tty.Wa.ib)throw new Nt(60);try{for(var i=0;i<r;i++)t.tty.Wa.ib(t.tty,e[n+i])}catch(t){throw new Nt(29)}return r&&(t.node.timestamp=Date.now()),i}},bt={sb:function(t){if(!t.input.length){var e=null;if(g){var n=Buffer.alloc(256),r=0;try{r=c.readSync(process.stdin.fd,n,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}e=0<r?n.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=Te(e,!0)}return t.input.shift()},ib:function(t,e){null===e||10===e?(b(B(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&0<t.output.length&&(b(B(t.output,0)),t.output=[])}},vt={ib:function(t,e){null===e||10===e?(v(B(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&0<t.output.length&&(v(B(t.output,0)),t.output=[])}},Tt={Oa:null,Pa:function(){return Tt.createNode(null,"/",16895,0)},createNode:function(t,e,n,r){if(24576==(61440&n)||4096==(61440&n))throw new Nt(63);return Tt.Oa||(Tt.Oa={dir:{node:{Na:Tt.Fa.Na,Ma:Tt.Fa.Ma,lookup:Tt.Fa.lookup,Za:Tt.Fa.Za,rename:Tt.Fa.rename,unlink:Tt.Fa.unlink,rmdir:Tt.Fa.rmdir,readdir:Tt.Fa.readdir,symlink:Tt.Fa.symlink},stream:{Sa:Tt.Ga.Sa}},file:{node:{Na:Tt.Fa.Na,Ma:Tt.Fa.Ma},stream:{Sa:Tt.Ga.Sa,read:Tt.Ga.read,write:Tt.Ga.write,kb:Tt.Ga.kb,$a:Tt.Ga.$a,ab:Tt.Ga.ab}},link:{node:{Na:Tt.Fa.Na,Ma:Tt.Fa.Ma,readlink:Tt.Fa.readlink},stream:{}},ob:{node:{Na:Tt.Fa.Na,Ma:Tt.Fa.Ma},stream:Gt}}),16384==(61440&(n=Dt(t,e,n,r)).mode)?(n.Fa=Tt.Oa.dir.node,n.Ga=Tt.Oa.dir.stream,n.Ha={}):32768==(61440&n.mode)?(n.Fa=Tt.Oa.file.node,n.Ga=Tt.Oa.file.stream,n.La=0,n.Ha=null):40960==(61440&n.mode)?(n.Fa=Tt.Oa.link.node,n.Ga=Tt.Oa.link.stream):8192==(61440&n.mode)&&(n.Fa=Tt.Oa.ob.node,n.Ga=Tt.Oa.ob.stream),n.timestamp=Date.now(),t&&(t.Ha[e]=n,t.timestamp=n.timestamp),n},Jb:function(t){return t.Ha?t.Ha.subarray?t.Ha.subarray(0,t.La):new Uint8Array(t.Ha):new Uint8Array(0)},pb:function(t,e){var n=t.Ha?t.Ha.length:0;n>=e||(e=Math.max(e,n*(1048576>n?2:1.125)>>>0),0!=n&&(e=Math.max(e,256)),n=t.Ha,t.Ha=new Uint8Array(e),0<t.La&&t.Ha.set(n.subarray(0,t.La),0))},Fb:function(t,e){if(t.La!=e)if(0==e)t.Ha=null,t.La=0;else{var n=t.Ha;t.Ha=new Uint8Array(e),n&&t.Ha.set(n.subarray(0,Math.min(e,t.La))),t.La=e}},Fa:{Na:function(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,16384==(61440&t.mode)?e.size=4096:32768==(61440&t.mode)?e.size=t.La:40960==(61440&t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.zb=4096,e.blocks=Math.ceil(e.size/e.zb),e},Ma:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&Tt.Fb(t,e.size)},lookup:function(){throw Ot[44]},Za:function(t,e,n,r){return Tt.createNode(t,e,n,r)},rename:function(t,e,n){if(16384==(61440&t.mode)){try{var r=Lt(e,n)}catch(t){}if(r)for(var i in r.Ha)throw new Nt(55)}delete t.parent.Ha[t.name],t.parent.timestamp=Date.now(),t.name=n,e.Ha[n]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.Ha[e],t.timestamp=Date.now()},rmdir:function(t,e){var n,r=Lt(t,e);for(n in r.Ha)throw new Nt(55);delete t.Ha[e],t.timestamp=Date.now()},readdir:function(t){var e,n=[".",".."];for(e in t.Ha)t.Ha.hasOwnProperty(e)&&n.push(e);return n},symlink:function(t,e,n){return(t=Tt.createNode(t,e,41471,0)).link=n,t},readlink:function(t){if(40960!=(61440&t.mode))throw new Nt(28);return t.link}},Ga:{read:function(t,e,n,r,i){var o=t.node.Ha;if(i>=t.node.La)return 0;if(8<(t=Math.min(t.node.La-i,r))&&o.subarray)e.set(o.subarray(i,i+t),n);else for(r=0;r<t;r++)e[n+r]=o[i+r];return t},write:function(t,e,n,r,i,o){if(e.buffer===P.buffer&&(o=!1),!r)return 0;if((t=t.node).timestamp=Date.now(),e.subarray&&(!t.Ha||t.Ha.subarray)){if(o)return t.Ha=e.subarray(n,n+r),t.La=r;if(0===t.La&&0===i)return t.Ha=e.slice(n,n+r),t.La=r;if(i+r<=t.La)return t.Ha.set(e.subarray(n,n+r),i),r}if(Tt.pb(t,i+r),t.Ha.subarray&&e.subarray)t.Ha.set(e.subarray(n,n+r),i);else for(o=0;o<r;o++)t.Ha[i+o]=e[n+o];return t.La=Math.max(t.La,i+r),r},Sa:function(t,e,n){if(1===n?e+=t.position:2===n&&32768==(61440&t.node.mode)&&(e+=t.node.La),0>e)throw new Nt(28);return e},kb:function(t,e,n){Tt.pb(t.node,e+n),t.node.La=Math.max(t.node.La,e+n)},$a:function(t,e,n,r,i,o){if(0!==e)throw new Nt(28);if(32768!=(61440&t.node.mode))throw new Nt(43);if(t=t.node.Ha,2&o||t.buffer!==I){if((0<r||r+n<t.length)&&(t=t.subarray?t.subarray(r,r+n):Array.prototype.slice.call(t,r,r+n)),r=!0,n=65536*Math.ceil(n/65536),(o=Se(65536,n))?(R.fill(0,o,o+n),n=o):n=0,!n)throw new Nt(48);P.set(t,n)}else r=!1,n=t.byteOffset;return{Eb:n,ub:r}},ab:function(t,e,n,r,i){if(32768!=(61440&t.node.mode))throw new Nt(43);return 2&i||Tt.Ga.write(t,e,0,r,n,!1),0}}},Et=null,wt={},xt=[],Ct=1,Mt=null,St=!0,Nt=null,Ot={},At=(t,e={})=>{if(!(t=ht("/",t)))return{path:"",node:null};if(8<(e=Object.assign({qb:!0,jb:0},e)).jb)throw new Nt(32);t=st(t.split("/").filter((t=>!!t)),!1);for(var n=Et,r="/",i=0;i<t.length;i++){var o=i===t.length-1;if(o&&e.parent)break;if(n=Lt(n,t[i]),r=ut(r+"/"+t[i]),n.Ua&&(!o||o&&e.qb)&&(n=n.Ua.root),!o||e.Ra)for(o=0;40960==(61440&n.mode);)if(n=Qt(r),r=ht(lt(r),n),n=At(r,{jb:e.jb+1}).node,40<o++)throw new Nt(32)}return{path:r,node:n}},It=t=>{for(var e;;){if(t===t.parent)return t=t.Pa.tb,e?"/"!==t[t.length-1]?t+"/"+e:t+e:t;e=e?t.name+"/"+e:t.name,t=t.parent}},Pt=(t,e)=>{for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return(t+n>>>0)%Mt.length},Rt=t=>{var e=Pt(t.parent.id,t.name);if(Mt[e]===t)Mt[e]=t.Va;else for(e=Mt[e];e;){if(e.Va===t){e.Va=t.Va;break}e=e.Va}},Lt=(t,e)=>{var n;if(n=(n=Ut(t,"x"))?n:t.Fa.lookup?0:2)throw new Nt(n,t);for(n=Mt[Pt(t.id,e)];n;n=n.Va){var r=n.name;if(n.parent.id===t.id&&r===e)return n}return t.Fa.lookup(t,e)},Dt=(t,e,n,r)=>(t=new ve(t,e,n,r),e=Pt(t.parent.id,t.name),t.Va=Mt[e],Mt[e]=t),kt={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Ft=t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},Ut=(t,e)=>St?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2,Bt=(t,e)=>{try{return Lt(t,e),20}catch(t){}return Ut(t,"wx")},jt=(t,e,n)=>{try{var r=Lt(t,e)}catch(t){return t.Ja}if(t=Ut(t,"wx"))return t;if(n){if(16384!=(61440&r.mode))return 54;if(r===r.parent||"/"===It(r))return 10}else if(16384==(61440&r.mode))return 31;return 0},Gt={open:t=>{t.Ga=wt[t.node.rdev].Ga,t.Ga.open&&t.Ga.open(t)},Sa:()=>{throw new Nt(70)}},Wt=(t,e)=>{wt[t]={Ga:e}},qt=(t,e)=>{var n="/"===e,r=!e;if(n&&Et)throw new Nt(10);if(!n&&!r){var i=At(e,{qb:!1});if(e=i.path,(i=i.node).Ua)throw new Nt(10);if(16384!=(61440&i.mode))throw new Nt(54)}e={type:t,Kb:{},tb:e,Db:[]},(t=t.Pa(e)).Pa=e,e.root=t,n?Et=t:i&&(i.Ua=e,i.Pa&&i.Pa.Db.push(e))},Ht=(t,e,n)=>{var r=At(t,{parent:!0}).node;if(!(t=ct(t))||"."===t||".."===t)throw new Nt(28);var i=Bt(r,t);if(i)throw new Nt(i);if(!r.Fa.Za)throw new Nt(63);return r.Fa.Za(r,t,e,n)},zt=(t,e)=>Ht(t,1023&(void 0!==e?e:511)|16384,0),Vt=(t,e,n)=>{void 0===n&&(n=e,e=438),Ht(t,8192|e,n)},Xt=(t,e)=>{if(!ht(t))throw new Nt(44);var n=At(e,{parent:!0}).node;if(!n)throw new Nt(44);e=ct(e);var r=Bt(n,e);if(r)throw new Nt(r);if(!n.Fa.symlink)throw new Nt(63);n.Fa.symlink(n,e,t)},Yt=t=>{var e=At(t,{parent:!0}).node;t=ct(t);var n=Lt(e,t),r=jt(e,t,!0);if(r)throw new Nt(r);if(!e.Fa.rmdir)throw new Nt(63);if(n.Ua)throw new Nt(10);e.Fa.rmdir(e,t),Rt(n)},Zt=t=>{var e=At(t,{parent:!0}).node;if(!e)throw new Nt(44);t=ct(t);var n=Lt(e,t),r=jt(e,t,!1);if(r)throw new Nt(r);if(!e.Fa.unlink)throw new Nt(63);if(n.Ua)throw new Nt(10);e.Fa.unlink(e,t),Rt(n)},Qt=t=>{if(!(t=At(t).node))throw new Nt(44);if(!t.Fa.readlink)throw new Nt(28);return ht(It(t.parent),t.Fa.readlink(t))},Kt=(t,e)=>{if(!(t=At(t,{Ra:!e}).node))throw new Nt(44);if(!t.Fa.Na)throw new Nt(63);return t.Fa.Na(t)},Jt=t=>Kt(t,!0),$t=(t,e)=>{if(!(t="string"==typeof t?At(t,{Ra:!0}).node:t).Fa.Ma)throw new Nt(63);t.Fa.Ma(t,{mode:4095&e|-4096&t.mode,timestamp:Date.now()})},te=(t,e)=>{if(0>e)throw new Nt(28);if(!(t="string"==typeof t?At(t,{Ra:!0}).node:t).Fa.Ma)throw new Nt(63);if(16384==(61440&t.mode))throw new Nt(31);if(32768!=(61440&t.mode))throw new Nt(28);var n=Ut(t,"w");if(n)throw new Nt(n);t.Fa.Ma(t,{size:e,timestamp:Date.now()})},ee=(t,e,n,r)=>{if(""===t)throw new Nt(44);if("string"==typeof e){var o=kt[e];if(void 0===o)throw Error("Unknown file open mode: "+e);e=o}if(n=64&e?4095&(void 0===n?438:n)|32768:0,"object"==typeof t)var a=t;else{t=ut(t);try{a=At(t,{Ra:!(131072&e)}).node}catch(t){}}if(o=!1,64&e)if(a){if(128&e)throw new Nt(20)}else a=Ht(t,n,0),o=!0;if(!a)throw new Nt(44);if(8192==(61440&a.mode)&&(e&=-513),65536&e&&16384!=(61440&a.mode))throw new Nt(54);if(!o&&(n=a?40960==(61440&a.mode)?32:16384==(61440&a.mode)&&("r"!==Ft(e)||512&e)?31:Ut(a,Ft(e)):44))throw new Nt(n);return 512&e&&te(a,0),e&=-131713,(r=((t,e)=>(mt||((mt=function(){}).prototype={}),t=Object.assign(new mt,t),e=((t=0,e=4096)=>{for(;t<=e;t++)if(!xt[t])return t;throw new Nt(33)})(e,void 0),t.fd=e,xt[e]=t))({node:a,path:It(a),flags:e,seekable:!0,position:0,Ga:a.Ga,Hb:[],error:!1},r)).Ga.open&&r.Ga.open(r),!i.logReadFiles||1&e||(gt||(gt={}),t in gt||(gt[t]=1)),r},ne=t=>{if(null===t.fd)throw new Nt(8);t.gb&&(t.gb=null);try{t.Ga.close&&t.Ga.close(t)}catch(t){throw t}finally{xt[t.fd]=null}t.fd=null},re=(t,e,n)=>{if(null===t.fd)throw new Nt(8);if(!t.seekable||!t.Ga.Sa)throw new Nt(70);if(0!=n&&1!=n&&2!=n)throw new Nt(28);t.position=t.Ga.Sa(t,e,n),t.Hb=[]},ie=(t,e,n,r,i)=>{if(0>r||0>i)throw new Nt(28);if(null===t.fd)throw new Nt(8);if(1==(2097155&t.flags))throw new Nt(8);if(16384==(61440&t.node.mode))throw new Nt(31);if(!t.Ga.read)throw new Nt(28);var o=void 0!==i;if(o){if(!t.seekable)throw new Nt(70)}else i=t.position;return e=t.Ga.read(t,e,n,r,i),o||(t.position+=e),e},oe=(t,e,n,r,i,o)=>{if(0>r||0>i)throw new Nt(28);if(null===t.fd)throw new Nt(8);if(0==(2097155&t.flags))throw new Nt(8);if(16384==(61440&t.node.mode))throw new Nt(31);if(!t.Ga.write)throw new Nt(28);t.seekable&&1024&t.flags&&re(t,0,2);var a=void 0!==i;if(a){if(!t.seekable)throw new Nt(70)}else i=t.position;return e=t.Ga.write(t,e,n,r,i,o),a||(t.position+=e),e},ae=t=>{var e,n=ee(t,n||0);t=Kt(t).size;var r=new Uint8Array(t);return ie(n,r,0,t,0),e=r,ne(n),e},se=()=>{Nt||((Nt=function(t,e){this.node=e,this.Gb=function(t){this.Ja=t},this.Gb(t),this.message="FS error"}).prototype=Error(),Nt.prototype.constructor=Nt,[44].forEach((t=>{Ot[t]=new Nt(t),Ot[t].stack="<generic error, no stack>"})))},ue=(t,e)=>{var n=0;return t&&(n|=365),e&&(n|=146),n},le=(t,e,n)=>{t=ut("/dev/"+t);var r=ue(!!e,!!n);yt||(yt=64);var i=yt++<<8|0;Wt(i,{open:t=>{t.seekable=!1},close:()=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,n,r,i)=>{for(var o=0,a=0;a<i;a++){try{var s=e()}catch(t){throw new Nt(29)}if(void 0===s&&0===o)throw new Nt(6);if(null==s)break;o++,n[r+a]=s}return o&&(t.node.timestamp=Date.now()),o},write:(t,e,r,i)=>{for(var o=0;o<i;o++)try{n(e[r+o])}catch(t){throw new Nt(29)}return i&&(t.node.timestamp=Date.now()),o}}),Vt(t,r,i)},ce={};function he(t,e,n){if("/"===e[0])return e;if(-100===t)t="/";else{if(!(t=xt[t]))throw new Nt(8);t=t.path}if(0==e.length){if(!n)throw new Nt(44);return t}return ut(t+"/"+e)}function fe(t,e,n){try{var r=t(e)}catch(t){if(t&&t.node&&ut(e)!==ut(It(t.node)))return-54;throw t}return D[n>>2]=r.dev,D[n+4>>2]=0,D[n+8>>2]=r.ino,D[n+12>>2]=r.mode,D[n+16>>2]=r.nlink,D[n+20>>2]=r.uid,D[n+24>>2]=r.gid,D[n+28>>2]=r.rdev,D[n+32>>2]=0,J=[r.size>>>0,(K=r.size,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[n+40>>2]=J[0],D[n+44>>2]=J[1],D[n+48>>2]=4096,D[n+52>>2]=r.blocks,D[n+56>>2]=r.atime.getTime()/1e3|0,D[n+60>>2]=0,D[n+64>>2]=r.mtime.getTime()/1e3|0,D[n+68>>2]=0,D[n+72>>2]=r.ctime.getTime()/1e3|0,D[n+76>>2]=0,J=[r.ino>>>0,(K=r.ino,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[n+80>>2]=J[0],D[n+84>>2]=J[1],0}var pe,de=void 0;function ye(){return D[(de+=4)-4>>2]}function me(t){if(!(t=xt[t]))throw new Nt(8);return t}pe=g?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now();var ge,_e={};function be(){if(!ge){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(t in _e)void 0===_e[t]?delete e[t]:e[t]=_e[t];var n=[];for(t in e)n.push(t+"="+e[t]);ge=n}return ge}function ve(t,e,n,r){t||(t=this),this.parent=t,this.Pa=t.Pa,this.Ua=null,this.id=Ct++,this.name=e,this.mode=n,this.Fa={},this.Ga={},this.rdev=r}function Te(t,e){var n=Array(W(t)+1);return t=G(t,n,0,n.length),e&&(n.length=t),n}Object.defineProperties(ve.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}}}),se(),Mt=Array(4096),qt(Tt,"/"),zt("/tmp"),zt("/home"),zt("/home/web_user"),(()=>{zt("/dev"),Wt(259,{read:()=>0,write:(t,e,n,r)=>r}),Vt("/dev/null",259),pt(1280,bt),pt(1536,vt),Vt("/dev/tty",1280),Vt("/dev/tty1",1536);var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(g)try{var e=require("crypto");return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){nt("randomDevice")}}();le("random",t),le("urandom",t),zt("/dev/shm"),zt("/dev/shm/tmp")})(),(()=>{zt("/proc");var t=zt("/proc/self");zt("/proc/self/fd"),qt({Pa:()=>{var e=Dt(t,"fd",16895,73);return e.Fa={lookup:(t,e)=>{var n=xt[+e];if(!n)throw new Nt(8);return(t={parent:null,Pa:{tb:"fake"},Fa:{readlink:()=>n.path}}).parent=t}},e}},"/proc/self/fd")})();var Ee={a:function(t,e,n,r){nt("Assertion failed: "+j(t)+", at: "+[e?j(e):"unknown filename",n,r?j(r):"unknown function"])},h:function(t,e){try{return t=j(t),$t(t,e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},H:function(t,e,n){try{if(e=he(t,e=j(e)),-8&n)var r=-28;else{var i=At(e,{Ra:!0}).node;i?(t="",4&n&&(t+="r"),2&n&&(t+="w"),1&n&&(t+="x"),r=t&&Ut(i,t)?-2:0):r=-44}return r}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},i:function(t,e){try{var n=xt[t];if(!n)throw new Nt(8);return $t(n.node,e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},g:function(t){try{var e=xt[t];if(!e)throw new Nt(8);var n=e.node,r="string"==typeof n?At(n,{Ra:!0}).node:n;if(!r.Fa.Ma)throw new Nt(63);return r.Fa.Ma(r,{timestamp:Date.now()}),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},b:function(t,e,n){de=n;try{var r=me(t);switch(e){case 0:var i=ye();return 0>i?-28:ee(r.path,r.flags,0,i).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:return i=ye(),r.flags|=i,0;case 5:return i=ye(),L[i+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return D[we()>>2]=28,-1}}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},G:function(t,e){try{var n=me(t);return fe(Kt,n.path,e)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},B:function(t,e){try{var n=xt[t];if(!n)throw new Nt(8);if(0==(2097155&n.flags))throw new Nt(28);return te(n.node,e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},A:function(t,e){try{return 0===e?-28:e<W("/")+1?-68:(G("/",R,t,e),t)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},E:function(t,e){try{return t=j(t),fe(Jt,t,e)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},x:function(t,e){try{return"/"===(t=ut(t=j(t)))[t.length-1]&&(t=t.substr(0,t.length-1)),zt(t,e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},D:function(t,e,n,r){try{e=j(e);var i=256&r;return e=he(t,e,4096&r),fe(i?Jt:Kt,e,n)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},u:function(t,e,n,r){de=r;try{e=he(t,e=j(e));var i=r?ye():0;return ee(e,n,i).fd}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},s:function(t,e,n,r){try{if(e=he(t,e=j(e)),0>=r)var i=-28;else{var o=Qt(e),a=Math.min(r,W(o)),s=P[n+a];G(o,R,n,r+1),P[n+a]=s,i=a}return i}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},r:function(t){try{return t=j(t),Yt(t),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},F:function(t,e){try{return t=j(t),fe(Kt,t,e)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},o:function(t,e,n){try{return e=he(t,e=j(e)),0===n?Zt(e):512===n?Yt(e):nt("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},m:function(t,e,n){try{if(e=he(t,e=j(e),!0),n){var r=D[n>>2],i=D[n+4>>2];o=1e3*r+i/1e6,a=1e3*(r=D[(n+=8)>>2])+(i=D[n+4>>2])/1e6}else var o=Date.now(),a=o;t=o;var s=At(e,{Ra:!0}).node;return s.Fa.Ma(s,{timestamp:Math.max(t,a)}),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},e:function(){return Date.now()},j:function(t,e){t=new Date(1e3*D[t>>2]),D[e>>2]=t.getSeconds(),D[e+4>>2]=t.getMinutes(),D[e+8>>2]=t.getHours(),D[e+12>>2]=t.getDate(),D[e+16>>2]=t.getMonth(),D[e+20>>2]=t.getFullYear()-1900,D[e+24>>2]=t.getDay();var n=new Date(t.getFullYear(),0,1);D[e+28>>2]=(t.getTime()-n.getTime())/864e5|0,D[e+36>>2]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),D[e+32>>2]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},v:function(t,e,n,r,i,o,a){try{var s=xt[i];if(!s)return-8;if(0!=(2&n)&&0==(2&r)&&2!=(2097155&s.flags))throw new Nt(2);if(1==(2097155&s.flags))throw new Nt(2);if(!s.Ga.$a)throw new Nt(43);var u=s.Ga.$a(s,t,e,o,n,r),l=u.Eb;return D[a>>2]=u.ub,l}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},w:function(t,e,n,r,i,o){try{var a=xt[i];if(a&&2&n){var s=R.slice(t,t+e);a&&a.Ga.ab&&a.Ga.ab(a,s,o,e,r)}}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},n:function t(e,n,r){t.Ab||(t.Ab=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var i=(new Date).getFullYear(),o=new Date(i,0,1),a=new Date(i,6,1);i=o.getTimezoneOffset();var s=a.getTimezoneOffset();D[t>>2]=60*Math.max(i,s),D[e>>2]=Number(i!=s),t=r(o),e=r(a),t=q(t),e=q(e),s<i?(D[n>>2]=t,D[n+4>>2]=e):(D[n>>2]=e,D[n+4>>2]=t)}(e,n,r))},p:function(){return 2147483648},d:pe,c:function(t){var e=R.length;if(2147483648<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var i=Math;r=Math.max(t,r),i=i.min.call(i,2147483648,r+(65536-r%65536)%65536);t:{try{S.grow(i-I.byteLength+65535>>>16),H();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},y:function(t,e){var n=0;return be().forEach((function(r,i){var o=e+n;for(i=D[t+4*i>>2]=o,o=0;o<r.length;++o)P[i++>>0]=r.charCodeAt(o);P[i>>0]=0,n+=r.length+1})),0},z:function(t,e){var n=be();D[t>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),D[e>>2]=r,0},f:function(t){try{var e=me(t);return ne(e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},l:function(t,e){try{var n=me(t);return P[e>>0]=n.tty?2:16384==(61440&n.mode)?3:40960==(61440&n.mode)?7:4,0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},t:function(t,e,n,r){try{t:{for(var i=me(t),o=t=0;o<n;o++){var a=D[e+(8*o+4)>>2],s=ie(i,P,D[e+8*o>>2],a,void 0);if(0>s){var u=-1;break t}if(t+=s,s<a)break}u=t}return D[r>>2]=u,0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},k:function(t,e,n,r,i){try{var o=me(t);return-9007199254740992>=(t=4294967296*n+(e>>>0))||9007199254740992<=t?-61:(re(o,t,r),J=[o.position>>>0,(K=o.position,1<=+Math.abs(K)?0<K?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[i>>2]=J[0],D[i+4>>2]=J[1],o.gb&&0===t&&0===r&&(o.gb=null),0)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},C:function(t){try{var e=me(t);return e.Ga&&e.Ga.fsync?-e.Ga.fsync(e):0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},q:function(t,e,n,r){try{t:{for(var i=me(t),o=t=0;o<n;o++){var a=oe(i,P,D[e+8*o>>2],D[e+(8*o+4)>>2],void 0);if(0>a){var s=-1;break t}t+=a}s=t}return D[r>>2]=s,0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}}};!function(){function t(t){i.asm=t.exports,S=i.asm.I,H(),z=i.asm.za,X.unshift(i.asm.J),$--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==tt&&(clearInterval(tt),tt=null),et&&(t=et,et=null,t()))}function e(e){t(e.instance)}function n(t){return function(){if(!E&&(y||m)){if("function"==typeof fetch&&!Q.startsWith("file://"))return fetch(Q,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Q+"'";return t.arrayBuffer()})).catch((function(){return ot()}));if(u)return new Promise((function(t,e){u(Q,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){v("failed to asynchronously prepare wasm: "+t),nt(t)}))}var r={a:Ee};if($++,i.monitorRunDependencies&&i.monitorRunDependencies($),i.instantiateWasm)try{return i.instantiateWasm(r,t)}catch(t){return v("Module.instantiateWasm callback failed with error: "+t),!1}E||"function"!=typeof WebAssembly.instantiateStreaming||rt()||Q.startsWith("file://")||"function"!=typeof fetch?n(e):fetch(Q,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return v("wasm streaming compile failed: "+t),v("falling back to ArrayBuffer instantiation"),n(e)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.J).apply(null,arguments)},i._sqlite3_free=function(){return(i._sqlite3_free=i.asm.K).apply(null,arguments)},i._sqlite3_value_double=function(){return(i._sqlite3_value_double=i.asm.L).apply(null,arguments)},i._sqlite3_value_text=function(){return(i._sqlite3_value_text=i.asm.M).apply(null,arguments)};var we=i.___errno_location=function(){return(we=i.___errno_location=i.asm.N).apply(null,arguments)};i._sqlite3_prepare_v2=function(){return(i._sqlite3_prepare_v2=i.asm.O).apply(null,arguments)},i._sqlite3_step=function(){return(i._sqlite3_step=i.asm.P).apply(null,arguments)},i._sqlite3_finalize=function(){return(i._sqlite3_finalize=i.asm.Q).apply(null,arguments)},i._sqlite3_reset=function(){return(i._sqlite3_reset=i.asm.R).apply(null,arguments)},i._sqlite3_value_int=function(){return(i._sqlite3_value_int=i.asm.S).apply(null,arguments)},i._sqlite3_clear_bindings=function(){return(i._sqlite3_clear_bindings=i.asm.T).apply(null,arguments)},i._sqlite3_value_blob=function(){return(i._sqlite3_value_blob=i.asm.U).apply(null,arguments)},i._sqlite3_value_bytes=function(){return(i._sqlite3_value_bytes=i.asm.V).apply(null,arguments)},i._sqlite3_value_type=function(){return(i._sqlite3_value_type=i.asm.W).apply(null,arguments)},i._sqlite3_result_blob=function(){return(i._sqlite3_result_blob=i.asm.X).apply(null,arguments)},i._sqlite3_result_double=function(){return(i._sqlite3_result_double=i.asm.Y).apply(null,arguments)},i._sqlite3_result_error=function(){return(i._sqlite3_result_error=i.asm.Z).apply(null,arguments)},i._sqlite3_result_int=function(){return(i._sqlite3_result_int=i.asm._).apply(null,arguments)},i._sqlite3_result_int64=function(){return(i._sqlite3_result_int64=i.asm.$).apply(null,arguments)},i._sqlite3_result_null=function(){return(i._sqlite3_result_null=i.asm.aa).apply(null,arguments)},i._sqlite3_result_text=function(){return(i._sqlite3_result_text=i.asm.ba).apply(null,arguments)},i._sqlite3_sql=function(){return(i._sqlite3_sql=i.asm.ca).apply(null,arguments)},i._sqlite3_column_count=function(){return(i._sqlite3_column_count=i.asm.da).apply(null,arguments)},i._sqlite3_data_count=function(){return(i._sqlite3_data_count=i.asm.ea).apply(null,arguments)},i._sqlite3_column_blob=function(){return(i._sqlite3_column_blob=i.asm.fa).apply(null,arguments)},i._sqlite3_column_bytes=function(){return(i._sqlite3_column_bytes=i.asm.ga).apply(null,arguments)},i._sqlite3_column_double=function(){return(i._sqlite3_column_double=i.asm.ha).apply(null,arguments)},i._sqlite3_column_text=function(){return(i._sqlite3_column_text=i.asm.ia).apply(null,arguments)},i._sqlite3_column_type=function(){return(i._sqlite3_column_type=i.asm.ja).apply(null,arguments)},i._sqlite3_column_name=function(){return(i._sqlite3_column_name=i.asm.ka).apply(null,arguments)},i._sqlite3_bind_blob=function(){return(i._sqlite3_bind_blob=i.asm.la).apply(null,arguments)},i._sqlite3_bind_double=function(){return(i._sqlite3_bind_double=i.asm.ma).apply(null,arguments)},i._sqlite3_bind_int=function(){return(i._sqlite3_bind_int=i.asm.na).apply(null,arguments)},i._sqlite3_bind_text=function(){return(i._sqlite3_bind_text=i.asm.oa).apply(null,arguments)},i._sqlite3_bind_parameter_index=function(){return(i._sqlite3_bind_parameter_index=i.asm.pa).apply(null,arguments)},i._sqlite3_normalized_sql=function(){return(i._sqlite3_normalized_sql=i.asm.qa).apply(null,arguments)},i._sqlite3_errmsg=function(){return(i._sqlite3_errmsg=i.asm.ra).apply(null,arguments)},i._sqlite3_exec=function(){return(i._sqlite3_exec=i.asm.sa).apply(null,arguments)},i._sqlite3_changes=function(){return(i._sqlite3_changes=i.asm.ta).apply(null,arguments)},i._sqlite3_close_v2=function(){return(i._sqlite3_close_v2=i.asm.ua).apply(null,arguments)},i._sqlite3_create_function_v2=function(){return(i._sqlite3_create_function_v2=i.asm.va).apply(null,arguments)},i._sqlite3_open=function(){return(i._sqlite3_open=i.asm.wa).apply(null,arguments)};var xe=i._malloc=function(){return(xe=i._malloc=i.asm.xa).apply(null,arguments)},Ce=i._free=function(){return(Ce=i._free=i.asm.ya).apply(null,arguments)};i._RegisterExtensionFunctions=function(){return(i._RegisterExtensionFunctions=i.asm.Aa).apply(null,arguments)};var Me,Se=i._emscripten_builtin_memalign=function(){return(Se=i._emscripten_builtin_memalign=i.asm.Ba).apply(null,arguments)},Ne=i.stackSave=function(){return(Ne=i.stackSave=i.asm.Ca).apply(null,arguments)},Oe=i.stackRestore=function(){return(Oe=i.stackRestore=i.asm.Da).apply(null,arguments)},Ae=i.stackAlloc=function(){return(Ae=i.stackAlloc=i.asm.Ea).apply(null,arguments)};function Ie(){function t(){if(!Me&&(Me=!0,i.calledRun=!0,!N)){if(i.noFSInit||dt||(dt=!0,se(),i.stdin=i.stdin,i.stdout=i.stdout,i.stderr=i.stderr,i.stdin?le("stdin",i.stdin):Xt("/dev/tty","/dev/stdin"),i.stdout?le("stdout",null,i.stdout):Xt("/dev/tty","/dev/stdout"),i.stderr?le("stderr",null,i.stderr):Xt("/dev/tty1","/dev/stderr"),ee("/dev/stdin",0),ee("/dev/stdout",1),ee("/dev/stderr",1)),St=!1,at(X),i.onRuntimeInitialized&&i.onRuntimeInitialized(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;){var t=i.postRun.shift();Y.unshift(t)}at(Y)}}if(!(0<$)){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)Z();at(V),0<$||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t())}}if(i.cwrap=function(t,e,n,r){var o=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&o&&!r?i["_"+t]:function(){return O(t,e,n,arguments)}},i.UTF8ToString=j,i.stackSave=Ne,i.stackRestore=Oe,i.stackAlloc=Ae,et=function t(){Me||Ie(),Me||(et=t)},i.run=Ie,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);0<i.preInit.length;)i.preInit.pop()();return Ie(),o})),n)};"object"==typeof e&&"object"==typeof t?(t.exports=r,t.exports.default=r):"function"==typeof define&&define.amd?define([],(function(){return r})):"object"==typeof e&&(e.Module=r)},9509:(t,e,n)=>{var r=n(8764),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function a(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},a.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},6479:(t,e,n)=>{var r;!function(){"use strict";function i(t,e,n){var r=e.x,i=e.y,o=n.x-r,a=n.y-i;if(0!==o||0!==a){var s=((t.x-r)*o+(t.y-i)*a)/(o*o+a*a);s>1?(r=n.x,i=n.y):s>0&&(r+=o*s,i+=a*s)}return(o=t.x-r)*o+(a=t.y-i)*a}function o(t,e,n,r,a){for(var s,u=r,l=e+1;l<n;l++){var c=i(t[l],t[e],t[n]);c>u&&(s=l,u=c)}u>r&&(s-e>1&&o(t,e,s,r,a),a.push(t[s]),n-s>1&&o(t,s,n,r,a))}function a(t,e){var n=t.length-1,r=[t[0]];return o(t,0,n,e,r),r.push(t[n]),r}function s(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r,i,o,a,s=t[0],u=[s],l=1,c=t.length;l<c;l++)i=s,void 0,void 0,(o=(r=n=t[l]).x-i.x)*o+(a=r.y-i.y)*a>e&&(u.push(n),s=n);return s!==n&&u.push(n),u}(t,r),a(t,r)}void 0===(r=function(){return s}.call(e,n,e,t))||(t.exports=r)}()},8501:(t,e,n)=>{var r=n(3570),i=n(5676),o=n(7529),a=n(584),s=n(8575),u=e;u.request=function(t,e){t="string"==typeof t?s.parse(t):o(t);var i=-1===n.g.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||i,u=t.hostname||t.host,l=t.port,c=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?a+"//"+u:"")+(l?":"+l:"")+c,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var h=new r(t);return e&&h.on("response",e),h},u.get=function(t,e){var n=u.request(t,e);return n.end(),n},u.ClientRequest=r,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},8725:(t,e,n)=>{var r;function i(){if(void 0!==r)return r;if(n.g.XMLHttpRequest){r=new n.g.XMLHttpRequest;try{r.open("GET",n.g.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function o(t){var e=i();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function a(t){return"function"==typeof t}e.fetch=a(n.g.fetch)&&a(n.g.ReadableStream),e.writableStream=a(n.g.WritableStream),e.abortController=a(n.g.AbortController),e.arraybuffer=e.fetch||o("arraybuffer"),e.msstream=!e.fetch&&o("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!i()&&a(i().overrideMimeType),r=null},3570:(t,e,n)=>{var r=n(3085).Buffer,i=n(4155),o=n(8725),a=n(5717),s=n(5676),u=n(925),l=s.IncomingMessage,c=s.readyStates,h=t.exports=function(t){var e,n=this;u.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+r.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){n.setHeader(e,t.headers[e])}));var i=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!o.abortController)i=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!o.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}n._mode=function(t,e){return o.fetch&&e?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&t?"arraybuffer":"text"}(e,i),n._fetchTimer=null,n._socketTimeout=null,n._socketTimer=null,n.on("finish",(function(){n._onFinish()}))};a(h,u.Writable),h.prototype.setHeader=function(t,e){var n=t.toLowerCase();-1===f.indexOf(n)&&(this._headers[n]={name:t,value:e})},h.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},h.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},h.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&0!==e.timeout&&t.setTimeout(e.timeout);var r=t._headers,a=null;"GET"!==e.method&&"HEAD"!==e.method&&(a=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var s=[];if(Object.keys(r).forEach((function(t){var e=r[t].name,n=r[t].value;Array.isArray(n)?n.forEach((function(t){s.push([e,t])})):s.push([e,n])})),"fetch"===t._mode){var u=null;if(o.abortController){var l=new AbortController;u=l.signal,t._fetchAbortController=l,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=n.g.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}n.g.fetch(t._opts.url,{method:t._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:u}).then((function(e){t._fetchResponse=e,t._resetTimers(!1),t._connect()}),(function(e){t._resetTimers(!0),t._destroyed||t.emit("error",e)}))}else{var h=t._xhr=new n.g.XMLHttpRequest;try{h.open(t._opts.method,t._opts.url,!0)}catch(e){return void i.nextTick((function(){t.emit("error",e)}))}"responseType"in h&&(h.responseType=t._mode),"withCredentials"in h&&(h.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in h&&h.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(h.timeout=e.requestTimeout,h.ontimeout=function(){t.emit("requestTimeout")}),s.forEach((function(t){h.setRequestHeader(t[0],t[1])})),t._response=null,h.onreadystatechange=function(){switch(h.readyState){case c.LOADING:case c.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(h.onprogress=function(){t._onXHRProgress()}),h.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{h.send(a)}catch(e){return void i.nextTick((function(){t.emit("error",e)}))}}}},h.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))},h.prototype._connect=function(){var t=this;t._destroyed||(t._response=new l(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},h.prototype._write=function(t,e,n){this._body.push(t),n()},h.prototype._resetTimers=function(t){var e=this;n.g.clearTimeout(e._socketTimer),e._socketTimer=null,t?(n.g.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=n.g.setTimeout((function(){e.emit("timeout")}),e._socketTimeout))},h.prototype.abort=h.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)},h.prototype.end=function(t,e,n){"function"==typeof t&&(n=t,t=void 0),u.Writable.prototype.end.call(this,t,e,n)},h.prototype.setTimeout=function(t,e){var n=this;e&&n.once("timeout",e),n._socketTimeout=t,n._resetTimers(!1)},h.prototype.flushHeaders=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},5676:(t,e,n)=>{var r=n(4155),i=n(3085).Buffer,o=n(8725),a=n(5717),s=n(925),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=e.IncomingMessage=function(t,e,n,a){var u=this;if(s.Readable.call(u),u._mode=n,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){r.nextTick((function(){u.emit("close")}))})),"fetch"===n){if(u._fetchResponse=e,u.url=e.url,u.statusCode=e.status,u.statusMessage=e.statusText,e.headers.forEach((function(t,e){u.headers[e.toLowerCase()]=t,u.rawHeaders.push(e,t)})),o.writableStream){var l=new WritableStream({write:function(t){return a(!1),new Promise((function(e,n){u._destroyed?n():u.push(i.from(t))?e():u._resumeFetch=e}))},close:function(){a(!0),u._destroyed||u.push(null)},abort:function(t){a(!0),u._destroyed||u.emit("error",t)}});try{return void e.body.pipeTo(l).catch((function(t){a(!0),u._destroyed||u.emit("error",t)}))}catch(t){}}var c=e.body.getReader();!function t(){c.read().then((function(e){u._destroyed||(a(e.done),e.done?u.push(null):(u.push(i.from(e.value)),t()))})).catch((function(t){a(!0),u._destroyed||u.emit("error",t)}))}()}else if(u._xhr=t,u._pos=0,u.url=t.responseURL,u.statusCode=t.status,u.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===u.headers[n]&&(u.headers[n]=[]),u.headers[n].push(e[2])):void 0!==u.headers[n]?u.headers[n]+=", "+e[2]:u.headers[n]=e[2],u.rawHeaders.push(e[1],e[2])}})),u._charset="x-user-defined",!o.overrideMimeType){var h=u.rawHeaders["mime-type"];if(h){var f=h.match(/;\s*charset=([^;])(;|$)/);f&&(u._charset=f[1].toLowerCase())}u._charset||(u._charset="utf-8")}};a(l,s.Readable),l.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},l.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,o=null;switch(e._mode){case"text":if((o=r.responseText).length>e._pos){var a=o.substr(e._pos);if("x-user-defined"===e._charset){for(var s=i.alloc(a.length),l=0;l<a.length;l++)s[l]=255&a.charCodeAt(l);e.push(s)}else e.push(a,e._charset);e._pos=o.length}break;case"arraybuffer":if(r.readyState!==u.DONE||!r.response)break;o=r.response,e.push(i.from(new Uint8Array(o)));break;case"moz-chunked-arraybuffer":if(o=r.response,r.readyState!==u.LOADING||!o)break;e.push(i.from(new Uint8Array(o)));break;case"ms-stream":if(o=r.response,r.readyState!==u.LOADING)break;var c=new n.g.MSStreamReader;c.onprogress=function(){c.result.byteLength>e._pos&&(e.push(i.from(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){t(!0),e.push(null)},c.readAsArrayBuffer(o)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}},7303:t=>{"use strict";var e={};function n(t,n,r){r||(r=Error);var i=function(t){var e,r;function i(e,r,i){return t.call(this,function(t,e,r){return"string"==typeof n?n:n(t,e,r)}(e,r,i))||this}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=t,e[t]=i}function r(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,o,a,s,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(r(e,"type"));else{var l=("number"!=typeof u&&(u=0),u+".".length>(s=t).length||-1===s.indexOf(".",u)?"argument":"property");a='The "'.concat(t,'" ').concat(l," ").concat(i," ").concat(r(e,"type"))}return a+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},9560:(t,e,n)=>{"use strict";var r=n(4155),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var o=n(4002),a=n(3313);n(5717)(c,o);for(var s=i(a.prototype),u=0;u<s.length;u++){var l=s[u];c.prototype[l]||(c.prototype[l]=a.prototype[l])}function c(t){if(!(this instanceof c))return new c(t);o.call(this,t),a.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||r.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},4842:(t,e,n)=>{"use strict";t.exports=i;var r=n(1846);function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}n(5717)(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},4002:(t,e,n)=>{"use strict";var r,i=n(4155);t.exports=C,C.ReadableState=x,n(7187).EventEmitter;var o,a=function(t,e){return t.listeners(e).length},s=n(1463),u=n(8764).Buffer,l=n.g.Uint8Array||function(){},c=n(3646);o=c&&c.debuglog?c.debuglog("stream"):function(){};var h,f,p,d=n(6641),y=n(4910),m=n(7855).getHighWaterMark,g=n(7303).q,_=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,T=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(5717)(C,s);var E=y.errorOrDestroy,w=["error","close","destroy","pause","resume"];function x(t,e,i){r=r||n(9560),t=t||{},"boolean"!=typeof i&&(i=e instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=n(2553).s),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function C(t){if(r=r||n(9560),!(this instanceof C))return new C(t);var e=this instanceof r;this._readableState=new x(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function M(t,e,n,r,i){o("readableAddChunk",e);var a,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?A(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,s);else if(i||(a=function(t,e){var n,r;return r=e,u.isBuffer(r)||r instanceof l||"string"==typeof e||void 0===e||t.objectMode||(n=new _("chunk",["string","Buffer","Uint8Array"],e)),n}(s,e)),a)E(t,a);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),r)s.endEmitted?E(t,new T):S(t,s,e,!0);else if(s.ended)E(t,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?S(t,s,e,!1):P(t,s)):S(t,s,e,!1)}else r||(s.reading=!1,P(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function S(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&A(t)),P(t,e)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),C.prototype.destroy=y.destroy,C.prototype._undestroy=y.undestroy,C.prototype._destroy=function(t,e){e(t)},C.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=u.from(t,e),e=""),n=!0),M(this,t,e,!1,n)},C.prototype.unshift=function(t){return M(this,t,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(t){h||(h=n(2553).s);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var N=1073741824;function O(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=N?t=N:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function A(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,F(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(o("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function L(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function D(t){o("readable nexttick read 0"),t.read(0)}function k(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),F(t),e.flowing&&!e.reading&&t.read(0)}function F(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function U(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(j,e,t))}function j(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function G(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}C.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):A(this),null;if(0===(t=O(t,e))&&e.ended)return 0===e.length&&B(this),null;var r,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&o("length less than watermark",i=!0),e.ended||e.reading?o("reading or ended",i=!1):i&&(o("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=O(n,e))),null===(r=t>0?U(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&B(this)),null!==r&&this.emit("data",r),r},C.prototype._read=function(t){E(this,new v("_read()"))},C.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,o("pipe count=%d opts=%j",r.pipesCount,e);var s=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}r.endEmitted?i.nextTick(s):n.once("end",s),t.on("unpipe",(function e(i,a){o("onunpipe"),i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",l),t.removeListener("error",f),t.removeListener("unpipe",e),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",h),c=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}));var l=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,F(t))}}(n);t.on("drain",l);var c=!1;function h(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==G(r.pipes,t))&&!c&&(o("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(e){o("onerror",e),y(),t.removeListener("error",f),0===a(t,"error")&&E(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(n):t._events.error=[n,t._events.error]:t.on(e,n)}(t,"error",f),t.once("close",p),t.once("finish",d),t.emit("pipe",n),r.flowing||(o("pipe resume"),n.resume()),t},C.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=G(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},C.prototype.on=function(t,e){var n=s.prototype.on.call(this,t,e),r=this._readableState;return"data"===t?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,o("on readable",r.length,r.reading),r.length?A(this):r.reading||i.nextTick(D,this))),n},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(t,e){var n=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(L,this),n},C.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(L,this),e},C.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(k,t,e))}(this,t)),t.paused=!1,this},C.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a<w.length;a++)t.on(w[a],this.emit.bind(this,w[a]));return this._read=function(e){o("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=n(6819)),f(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),C._fromList=U,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(C.from=function(t,e){return void 0===p&&(p=n(8869)),p(C,t,e)})},1846:(t,e,n)=>{"use strict";t.exports=c;var r=n(7303).q,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(9560);function l(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);u.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(e,n){f(t,e,n)}))}function f(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new s;if(t._transformState.transforming)throw new a;return t.push(null)}n(5717)(c,u),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,n){n(new i("_transform()"))},c.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},3313:(t,e,n)=>{"use strict";var r,i=n(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(undefined),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=C,C.WritableState=x;var a,s={deprecate:n(4927)},u=n(1463),l=n(8764).Buffer,c=n.g.Uint8Array||function(){},h=n(4910),f=n(7855).getHighWaterMark,p=n(7303).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,m=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,_=p.ERR_STREAM_DESTROYED,b=p.ERR_STREAM_NULL_VALUES,v=p.ERR_STREAM_WRITE_AFTER_END,T=p.ERR_UNKNOWN_ENCODING,E=h.errorOrDestroy;function w(){}function x(t,e,a){r=r||n(9560),t=t||{},"boolean"!=typeof a&&(a=e instanceof r),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,o){--e.pendingcb,n?(i.nextTick(o,r),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,E(t,r)):(o(r),t._writableState.errorEmitted=!0,E(t,r),I(t,e))}(t,n,r,e,o);else{var a=O(n)||t.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||N(t,n),r?i.nextTick(S,t,n,a,o):S(t,n,a,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function C(t){var e=this instanceof(r=r||n(9560));if(!e&&!a.call(C,this))return new C(t);this._writableState=new x(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function M(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new _("write")):n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function S(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),I(t,e)}function N(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),a=e.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,M(t,e,!0,e.length,i,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,h=n.callback;if(M(t,e,!1,e.objectMode?1:l.length,l,c,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function O(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function A(t,e){t._final((function(n){e.pendingcb--,n&&E(t,n),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var n=O(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(A,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return n}n(5717)(C,u),x.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(x.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===C&&t&&t._writableState instanceof x}})):a=function(t){return t instanceof this},C.prototype.pipe=function(){E(this,new g)},C.prototype.write=function(t,e,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=t,l.isBuffer(r)||r instanceof c);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof n&&(n=w),o.ending?function(t,e){var n=new v;E(t,n),i.nextTick(e,n)}(this,n):(s||function(t,e,n,r){var o;return null===n?o=new b:"string"==typeof n||e.objectMode||(o=new d("chunk",["string","Buffer"],n)),!o||(E(t,o),i.nextTick(r,o),!1)}(this,o,t,n))&&(o.pendingcb++,a=function(t,e,n,r,i,o){if(!n){var a=function(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,n)),e}(e,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=e.objectMode?1:r.length;e.length+=s;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else M(t,e,!1,s,r,i,o);return u}(this,o,s,t,e,n)),a},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||N(this,t))},C.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new T(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new y("_write()"))},C.prototype._writev=null,C.prototype.end=function(t,e,n){var r=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,n){e.ending=!0,I(t,e),n&&(e.finished?i.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,r,n),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.prototype._destroy=function(t,e){e(t)}},6819:(t,e,n)=>{"use strict";var r,i=n(4155);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=n(5467),s=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[s];if(null!==e){var n=t[p].read();null!==n&&(t[h]=null,t[s]=null,t[u]=null,e(d(n,!1)))}}function m(t){i.nextTick(y,t)}var g=Object.getPrototypeOf((function(){})),_=Object.setPrototypeOf((o(r={get stream(){return this[p]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,n){i.nextTick((function(){t[l]?n(t[l]):e(d(void 0,!0))}))}));var n,r=this[h];if(r)n=new Promise(function(t,e){return function(n,r){t.then((function(){e[c]?n(d(void 0,!0)):e[f](n,r)}),r)}}(r,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));n=new Promise(this[f])}return this[h]=n,n}},Symbol.asyncIterator,(function(){return this})),o(r,"return",(function(){var t=this;return new Promise((function(e,n){t[p].destroy(null,(function(t){t?n(t):e(d(void 0,!0))}))}))})),r),g);t.exports=function(t){var e,n=Object.create(_,(o(e={},p,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,l,{value:null,writable:!0}),o(e,c,{value:t._readableState.endEmitted,writable:!0}),o(e,f,{value:function(t,e){var r=n[p].read();r?(n[h]=null,n[s]=null,n[u]=null,t(d(r,!1))):(n[s]=t,n[u]=e)},writable:!0}),e));return n[h]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[u];return null!==e&&(n[h]=null,n[s]=null,n[u]=null,e(t)),void(n[l]=t)}var r=n[s];null!==r&&(n[h]=null,n[s]=null,n[u]=null,r(d(void 0,!0))),n[c]=!0})),t.on("readable",m.bind(null,n)),n}},6641:(t,e,n)=>{"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=n(8764).Buffer,s=n(1408).inspect,u=s&&s.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,n;return e=t,n=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,n,r,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,n=i,r=s,a.prototype.copy.call(e,n,r),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,n=1,r=e.data;for(t-=r.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?r+=i:r+=i.slice(0,t),0==(t-=o)){o===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,e}},{key:u,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],n&&o(e.prototype,n),t}()},4910:(t,e,n)=>{"use strict";var r=n(4155);function i(t,e){a(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(a,this,t)):r.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?n._writableState?n._writableState.errorEmitted?r.nextTick(o,n):(n._writableState.errorEmitted=!0,r.nextTick(i,n,t)):r.nextTick(i,n,t):e?(r.nextTick(o,n),e(t)):r.nextTick(o,n)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}},5467:(t,e,n)=>{"use strict";var r=n(7303).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(o||i);var a=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,u=function(){e.writable||c()},l=e._writableState&&e._writableState.finished,c=function(){s=!1,l=!0,a||o.call(e)},h=e._readableState&&e._readableState.endEmitted,f=function(){a=!1,h=!0,s||o.call(e)},p=function(t){o.call(e,t)},d=function(){var t;return a&&!h?(e._readableState&&e._readableState.ended||(t=new r),o.call(e,t)):s&&!l?(e._writableState&&e._writableState.ended||(t=new r),o.call(e,t)):void 0},y=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",d),e.req?y():e.on("request",y)):s&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",f),e.on("finish",c),!1!==n.error&&e.on("error",p),e.on("close",d),function(){e.removeListener("complete",c),e.removeListener("abort",d),e.removeListener("request",y),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",f),e.removeListener("error",p),e.removeListener("close",d)}}},8869:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9689:(t,e,n)=>{"use strict";var r,i=n(7303).q,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===r&&(r=n(5467)),r(t,{readable:e,writable:i},(function(t){if(t)return o(t);s=!0,o()}));var u=!1;return function(e){if(!s&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function l(t){t()}function c(t,e){return t.pipe(e)}function h(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=h(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var a=e.map((function(t,n){var o=n<e.length-1;return u(t,o,n>0,(function(t){r||(r=t),t&&a.forEach(l),o||(a.forEach(l),i(r))}))}));return e.reduce(c)}},7855:(t,e,n)=>{"use strict";var r=n(7303).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var o=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},1463:(t,e,n)=>{t.exports=n(7187).EventEmitter},925:(t,e,n)=>{(e=t.exports=n(4002)).Stream=e,e.Readable=e,e.Writable=n(3313),e.Duplex=n(9560),e.Transform=n(1846),e.PassThrough=n(4842),e.finished=n(5467),e.pipeline=n(9689)},2553:(t,e,n)=>{"use strict";var r=n(9509).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=l,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"<22>";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"<22>";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"<22>"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function c(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"<22>":e},o.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=a(e[r]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--r<n||-2===i?0:(i=a(e[r]))>=0?(i>0&&(t.lastNeed=i-2),i):--r<n||-2===i?0:(i=a(e[r]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},1191:function(t,e,n){"use strict";var r=n(4155),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageAPI=void 0;var s=n(4325),u=n(5116),l=n(4275),c=n(3437),h=a(n(3935)),f=a(n(2203)),p=function(){function t(){}return t.open=function(t){return i(this,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:if("string"==typeof t&&("string"!=typeof t||0!==t.indexOf("http")&&l.GeoPackageValidate.validateGeoPackageExtension(t)))throw new Error("Invalid GeoPackage - Invalid GeoPackage Extension");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,c.Canvas.initializeAdapter()];case 2:return r.sent(),[3,4];case 3:throw r.sent(),new Error("Unable to initialize canvas.");case 4:return r.trys.push([4,6,,7]),[4,u.GeoPackageConnection.connect(t)];case 5:return n=r.sent(),e=t&&"string"==typeof t?new s.GeoPackage(h.default.basename(t),t,n):new s.GeoPackage("geopackage",void 0,n),[3,7];case 6:throw r.sent(),new Error("Unable to open GeoPackage.");case 7:return[2,e]}}))}))},t.create=function(t){return i(this,void 0,void 0,(function(){var e,n;return o(this,(function(i){switch(i.label){case 0:if("string"==typeof t&&("string"!=typeof t||l.GeoPackageValidate.validateGeoPackageExtension(t)))throw new Error("Invalid GeoPackage");if(void 0!==r&&r.version&&t)try{f.default.mkdirSync(h.default.dirname(t))}catch(t){}i.label=1;case 1:return i.trys.push([1,3,,4]),[4,c.Canvas.initializeAdapter()];case 2:return i.sent(),[3,4];case 3:throw i.sent(),new Error("Unable to initialize canvas.");case 4:return i.trys.push([4,7,,8]),[4,u.GeoPackageConnection.connect(t)];case 5:return(n=i.sent()).setApplicationId(),[4,(e=t?new s.GeoPackage(h.default.basename(t),t,n):new s.GeoPackage("geopackage",void 0,n)).createRequiredTables()];case 6:return i.sent(),e.createSupportedExtensions(),[3,8];case 7:throw i.sent(),new Error("Unable to create GeoPackage.");case 8:return[2,e]}}))}))},t.version="3.0.0",t}();e.GeoPackageAPI=p},8375:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AttributesColumn=void 0;var o=n(5865),a=n(7319),s=n(5071),u=function(t){function e(e,n,r,i,o,a,s,u){var l=t.call(this,e,n,r,i,o,a,s,u)||this;if(null===r)throw new Error("Data type is required to create column: "+n);return l}return i(e,t),e.createColumn=function(t,n,r,i,o,a,s){return void 0===i&&(i=!1),new e(t,n,r,a,i,o,!1,s)},e.createPrimaryKeyColumn=function(t,n,r){return void 0===r&&(r=s.UserTableDefaults.DEFAULT_AUTOINCREMENT),new e(t,n,a.GeoPackageDataType.INTEGER,void 0,void 0,void 0,!0,r)},e.prototype.copy=function(){return new e(this.index,this.name,this.dataType,this.max,this.notNull,this.defaultValue,this.primaryKey,this.autoincrement)},e}(o.UserColumn);e.AttributesColumn=u},6863:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AttributesColumns=void 0;var o=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.updateColumns(),i}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getColumns(),this.isCustom())},e}(n(2114).UserColumns);e.AttributesColumns=o},8008:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AttributesDao=void 0;var o=n(4668),a=n(6861),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;if(!n.contents)throw new Error("Attributes table has null Contents");return r.contents=n.contents,r}return i(e,t),Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.newRow=function(t,e){return new a.AttributesRow(this.table,t,e)},e.readTable=function(t,e){return t.getAttributeDao(e)},e}(o.UserDao);e.AttributesDao=s},6861:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AttributesRow=void 0;var o=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return i(e,t),e}(n(2224).UserRow);e.AttributesRow=o},3931:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AttributesTable=void 0;var o=n(8018),a=n(6863),s=n(9971),u=function(t){function e(e,n){return t.call(this,new a.AttributesColumns(e,n,!1))||this}return i(e,t),e.prototype.setContents=function(t){if(this.contents=t,t.data_type!==s.ContentsDataType.ATTRIBUTES)throw new Error("The Contents of an Attributes Table must have a data type of ".concat(s.ContentsDataType.ATTRIBUTES));return!0},e}(o.UserTable);e.AttributesTable=u},464:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AttributesTableReader=void 0;var o=n(4880),a=n(3931),s=n(8375),u=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.readAttributeTable=function(t){return this.readTable(t.database)},e.prototype.createTable=function(t,e){return new a.AttributesTable(t,e)},e.prototype.createColumn=function(t){return new s.AttributesColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,t.autoincrement)},e}(o.UserTableReader);e.AttributesTableReader=u},2527:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BoundingBox=void 0;var r=n(5604),i=n(1375),o=function(){function t(e,n,r,i){e instanceof t?(this.minLongitude=e.minLongitude,this.maxLongitude=e.maxLongitude,this.minLatitude=e.minLatitude,this.maxLatitude=e.maxLatitude):(this.minLongitude=e,this.maxLongitude=n,this.minLatitude=r,this.maxLatitude=i)}return Object.defineProperty(t.prototype,"minLongitude",{get:function(){return this._minLongitude},set:function(t){this._minLongitude=t,this.width=this.maxLongitude-this.minLongitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLongitude",{get:function(){return this._maxLongitude},set:function(t){this._maxLongitude=t,this.width=this.maxLongitude-this.minLongitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minLatitude",{get:function(){return this._minLatitude},set:function(t){this._minLatitude=t,this.height=this.maxLatitude-this.minLatitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLatitude",{get:function(){return this._maxLatitude},set:function(t){this._maxLatitude=t,this.height=this.maxLatitude-this.minLatitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),t.prototype.buildEnvelope=function(){return{minY:this.minLatitude,minX:this.minLongitude,maxY:this.maxLatitude,maxX:this.maxLongitude}},t.prototype.toGeoJSON=function(){return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[this.minLongitude,this.minLatitude],[this.maxLongitude,this.minLatitude],[this.maxLongitude,this.maxLatitude],[this.minLongitude,this.maxLatitude],[this.minLongitude,this.minLatitude]]]}}},t.prototype.equals=function(t){return!!t&&(this===t||this.maxLatitude===t.maxLatitude&&this.minLatitude===t.minLatitude&&this.maxLongitude===t.maxLongitude&&this.maxLatitude===t.maxLatitude)},t.prototype.projectBoundingBox=function(e,n){var o=this.minLatitude,a=this.maxLatitude,s=this.minLongitude,u=this.maxLongitude;if(e&&"undefined"!==e&&n&&"undefined"!==n){r.Projection.isWebMercator(n)&&r.Projection.isWGS84(e)&&(a=Math.min(a,i.ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE),o=Math.max(o,i.ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE),u=Math.min(u,i.ProjectionConstants.WEB_MERCATOR_MAX_LON_RANGE),s=Math.max(s,i.ProjectionConstants.WEB_MERCATOR_MIN_LON_RANGE));var l=void 0;l=r.Projection.isConverter(n)?n:r.Projection.getConverter(n);var c=void 0;if(c=r.Projection.isConverter(e)?e:r.Projection.getConverter(e),r.Projection.convertersMatch(l,c))return new t(s,u,o,a);var h=l.forward(c.inverse([s,o])),f=l.forward(c.inverse([u,a])),p=l.forward(c.inverse([u,o])),d=l.forward(c.inverse([s,a]));return new t(Math.min(h[0],d[0]),Math.max(f[0],p[0]),Math.min(h[1],p[1]),Math.max(f[1],p[1]))}return this},t}();e.BoundingBox=o},3437:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Canvas=void 0;var i=function(){function t(){}return t.registerCanvasAdapter=function(e){t.adapter=new e},t.adapterInitialized=function(){return null!=t.adapter&&t.adapter.isInitialized()},t.initializeAdapter=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return t.adapter.isInitialized()?[3,2]:[4,t.adapter.initialize()];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.checkCanvasAdapter=function(){if(!t.adapter)throw new Error("Canvas adapter not registered.");if(!t.adapter.isInitialized())throw new Error("Canvas adapter not initialized.")},t.create=function(e,n){return t.checkCanvasAdapter(),t.adapter.create(e,n)},t.createImage=function(e,i){return void 0===i&&(i="image/png"),n(this,void 0,void 0,(function(){return r(this,(function(n){return t.checkCanvasAdapter(),[2,t.adapter.createImage(e,i)]}))}))},t.createImageData=function(e,n){return t.checkCanvasAdapter(),t.adapter.createImageData(e,n)},t.disposeCanvas=function(e){t.checkCanvasAdapter(),t.adapter.disposeCanvas(e)},t.measureText=function(e,n,r,i){return t.checkCanvasAdapter(),t.adapter.measureText(e,n,r,i)},t.drawText=function(e,n,r,i,o,a){return t.checkCanvasAdapter(),t.adapter.drawText(e,n,r,i,o,a)},t.scaleImage=function(e,n){return t.checkCanvasAdapter(),t.adapter.scaleImage(e,n)},t.scaleImageToDimensions=function(e,n,r){return t.checkCanvasAdapter(),t.adapter.scaleImageToDimensions(e,n,r)},t.toDataURL=function(e,i){return void 0===i&&(i="image/png"),n(this,void 0,void 0,(function(){return r(this,(function(n){return t.checkCanvasAdapter(),[2,t.adapter.toDataURL(e,i)]}))}))},t.disposeImage=function(e){t.checkCanvasAdapter(),t.adapter.disposeImage(e)},t.adapter=void 0,t}();e.Canvas=i},8038:function(t,e,n){"use strict";var r=n(3085).Buffer,i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasKitCanvasAdapter=void 0;var s=a(n(3935)),u=a(n(4919)),l=a(n(8501)),c=a(n(8927)),h=n(1048),f=function(){function t(){}return t.setCanvasKitWasmLocateFile=function(e){t.canvasKitWasmLocateFile=e},t.setCanvasKit=function(e){t.CanvasKit=e,t.initialized=!0},t.prototype.initialize=function(){return new Promise((function(e,n){try{(0,c.default)({locateFile:t.canvasKitWasmLocateFile}).then((function(n){t.CanvasKit=n,t.initialized=!0,e()})).catch((function(){n("Failed to load the CanvasKit WebAssembly file at "+t.canvasKitWasmLocateFile("canvaskit.wasm")+".\nUpdate file locator function using NodeCanvasAdapter.setCanvasKitWasmLocateFile.")}))}catch(e){n("Failed to load the CanvasKit WebAssembly file at "+t.canvasKitWasmLocateFile("canvaskit.wasm")+".\nUpdate file locator function using NodeCanvasAdapter.setCanvasKitWasmLocateFile.")}}))},t.prototype.isInitialized=function(){return t.initialized},t.prototype.create=function(e,n){return t.CanvasKit.MakeCanvas(e,n)},t.prototype.createImage=function(e,n){return i(this,void 0,void 0,(function(){var n,i,a,s;return o(this,(function(o){switch(o.label){case 0:n=e,o.label=1;case 1:return o.trys.push([1,7,,8]),"string"!=typeof e?[3,6]:/^\s*data:/.test(e)?(n=h.CanvasUtils.base64toUInt8Array(e.split(",")[1]),[3,6]):[3,2];case 2:return/^\s*https?:\/\//.test(e)?[4,new Promise((function(t,n){l.default.get(e,(function(e){var i=[];200===e.statusCode?e.on("data",(function(t){i.push(t)})).on("end",(function(){t(r.concat(i).buffer)})).on("error",(function(t){n(t)})):n("Code: "+e.statusCode)}))}))]:[3,4];case 3:return n=o.sent(),[3,6];case 4:return[4,new Promise((function(t,n){u.default.readFile(e,(function(e,r){e?n(e):t(r)}))}))];case 5:n=o.sent(),o.label=6;case 6:return null!=(i=t.CanvasKit.MakeImageFromEncoded(n))&&(a=i.width(),s=i.height()),[3,8];case 7:throw o.sent(),new Error("Failed to create image.");case 8:if(null==i)throw new Error("Failed to create image.");return[2,{image:i,width:a,height:s}]}}))}))},t.prototype.createImageData=function(e,n){return new t.CanvasKit.ImageData(e,n)},t.prototype.disposeCanvas=function(t){null!=t&&(t.dispose(),t=null)},t.prototype.measureText=function(e,n,r,i){var o=new t.CanvasKit.Font(null,r),a=o.getGlyphIDs(i),s=new t.CanvasKit.Paint;s.setStyle(t.CanvasKit.PaintStyle.Fill);var u=o.getGlyphWidths(a,s).reduce((function(t,e){return t+e}),0);return s.delete(),u},t.prototype.drawText=function(t,e,n,r,i,o){t.save(),t.fillStyle=o,t.font=i+"px '"+r+"'",t.textBaseline="middle";var a=this.measureText(t,r,i,e);t.fillText(e,n[0]-a/2,n[1]+i/4),t.restore()},t.prototype.toDataURL=function(t,e){return void 0===e&&(e="image/png"),Promise.resolve(t.toDataURL(e))},t.prototype.scaleImage=function(t,e){return i(this,void 0,void 0,(function(){var n,r;return o(this,(function(i){return n=Math.round(e*t.width),r=Math.round(e*t.height),[2,this.scaleImageToDimensions(t,n,r)]}))}))},t.prototype.scaleImageToDimensions=function(t,e,n){return i(this,void 0,void 0,(function(){var r,i,a;return o(this,(function(o){switch(o.label){case 0:return(r=this.create(e,n)).getContext("2d").drawImage(t.image,0,0,e,n),a=this.createImage,[4,this.toDataURL(r,"image/png")];case 1:return[4,a.apply(this,[o.sent(),"image/png"])];case 2:return i=o.sent(),this.disposeCanvas(r),[2,i]}}))}))},t.prototype.disposeImage=function(t){null!=t&&t.image&&t.image.delete&&(t.image.delete(),t.image=null)},t.initialized=!1,t.canvasKitWasmLocateFile=function(t){return s.default.join("/","..","..","canvaskit",t)},t}();e.CanvasKitCanvasAdapter=f},1048:(t,e,n)=>{"use strict";var r=n(3085).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasUtils=void 0;var i=function(){function t(){}return t.base64toUInt8Array=function(t){for(var e=r.from(t,"base64").toString("binary"),n=e.length,i=new Uint8Array(n);n--;)i[n]=e.charCodeAt(n);return i},t}();e.CanvasUtils=i},2807:function(t,e,n){"use strict";var r=n(3085).Buffer,i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.HtmlCanvasAdapter=void 0;var a=function(){function t(){}return t.prototype.initialize=function(){return new Promise((function(e){t.initialized=!0,e()}))},t.prototype.isInitialized=function(){return t.initialized},t.prototype.create=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,n},t.prototype.createImage=function(t,e){return new Promise((function(n,i){var o=t;(t instanceof r||"[object Uint8Array]"===Object.prototype.toString.call(t))&&(o=URL.createObjectURL(new Blob([t],{type:e})));var a=new Image;a.onload=function(){var t={image:a,width:a.width,height:a.height};n(t)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=o}))},t.prototype.createImageData=function(t,e){return new ImageData(t,e)},t.prototype.disposeCanvas=function(t){},t.prototype.measureText=function(t,e,n,r){t.save(),t.font=n+"px"+(null!=e?" '"+e+"'":""),t.textBaseline="middle",t.textAlign="center";var i=t.measureText(r).width;return t.restore(),i},t.prototype.drawText=function(t,e,n,r,i,o){t.save(),t.font=i+"px"+(null!=r?" '"+r+"'":""),t.fillStyle=o,t.textBaseline="middle",t.textAlign="center",t.fillText(e,n[0],n[1]),t.restore()},t.prototype.scaleImage=function(t,e){return i(this,void 0,void 0,(function(){var n,r;return o(this,(function(i){return 1===e?[2,t]:(n=Math.round(e*t.width),r=Math.round(e*t.height),[2,this.scaleImageToDimensions(t,n,r)])}))}))},t.prototype.scaleImageToDimensions=function(t,e,n){return i(this,void 0,void 0,(function(){var r,i,a;return o(this,(function(o){switch(o.label){case 0:return(r=this.create(e,n)).getContext("2d").drawImage(t.image,0,0,e,n),a=this.createImage,[4,this.toDataURL(r,"image/png")];case 1:return[4,a.apply(this,[o.sent(),"image/png"])];case 2:return i=o.sent(),this.disposeCanvas(r),[2,i]}}))}))},t.prototype.toDataURL=function(t,e){return void 0===e&&(e="image/png"),Promise.resolve(t.toDataURL(e))},t.prototype.disposeImage=function(t){},t.initialized=!1,t}();e.HtmlCanvasAdapter=a},342:function(t,e,n){"use strict";var r=n(3085).Buffer,i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.OffscreenCanvasAdapter=void 0;var a=n(1048),s=function(){function t(){}return t.prototype.initialize=function(){return new Promise((function(e){t.initialized=!0,e()}))},t.prototype.isInitialized=function(){return t.initialized},t.prototype.create=function(t,e){return new OffscreenCanvas(t,e)},t.prototype.createImage=function(t,e){return void 0===e&&(e="image/png"),new Promise((function(n,i){var o=t;t instanceof r||"[object Uint8Array]"===Object.prototype.toString.call(t)?o=new Blob([t],{type:e}):"string"==typeof t&&(o=new Blob([a.CanvasUtils.base64toUInt8Array(t.split(",")[1])],{type:e})),createImageBitmap(o).then((function(t){n({image:t,width:t.width,height:t.height})})).catch((function(t){i(t)}))}))},t.prototype.createImageData=function(t,e){return new ImageData(t,e)},t.prototype.disposeCanvas=function(t){},t.prototype.measureText=function(t,e,n,r){t.save(),t.font=n+"px"+(null!=e?" '"+e+"'":""),t.textBaseline="middle",t.textAlign="center";var i=t.measureText(r).width;return t.restore(),i},t.prototype.drawText=function(t,e,n,r,i,o){t.save(),t.font=i+"px"+(null!=r?" '"+r+"'":""),t.fillStyle=o,t.textBaseline="middle",t.textAlign="center",t.fillText(e,n[0],n[1]),t.restore()},t.prototype.scaleImage=function(t,e){return i(this,void 0,void 0,(function(){var n,r;return o(this,(function(i){return 1===e?[2,t]:(n=Math.round(e*t.width),r=Math.round(e*t.height),[2,this.scaleImageToDimensions(t,n,r)])}))}))},t.prototype.scaleImageToDimensions=function(t,e,n){return i(this,void 0,void 0,(function(){var r,i;return o(this,(function(o){return(r=this.create(e,n)).getContext("2d").drawImage(t.image,0,0,e,n),i={image:r.transferToImageBitmap(),width:e,height:n},this.disposeCanvas(r),[2,i]}))}))},t.prototype.toDataURL=function(t,e){return void 0===e&&(e="image/png"),new Promise((function(n){t.convertToBlob({type:e}).then((function(t){var e=new FileReader;e.addEventListener("load",(function(){var t=e.result;n(t)})),e.readAsDataURL(t)}))}))},t.prototype.disposeImage=function(t){},t.initialized=!1,t}();e.OffscreenCanvasAdapter=s},1150:function(t,e,n){"use strict";var r=n(5108),i=n(4155),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var s=n(4777),u=n(922),l=n(5849),c=n(3437),h=n(8038),f=n(2807),p=n(342),d=function(){function t(){}return t.initializeContext=function(){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,c.Canvas.initializeAdapter()];case 1:return t.sent(),[2]}}))}))},t.registerSqliteAdapter=function(){try{n(3730),s.Db.registerDbAdapter(u.SqliteAdapter)}catch(t){r.error("Unable to register SqliteAdapter. The better-sqlite3 module was not found. Falling back to SqljsAdapter."),s.Db.registerDbAdapter(l.SqljsAdapter)}},t.setupNodeContext=function(){t.registerSqliteAdapter(),c.Canvas.registerCanvasAdapter(h.CanvasKitCanvasAdapter)},t.setupBrowserContext=function(){s.Db.registerDbAdapter(l.SqljsAdapter),c.Canvas.registerCanvasAdapter(f.HtmlCanvasAdapter)},t.setupWebWorkerContext=function(){s.Db.registerDbAdapter(l.SqljsAdapter),c.Canvas.registerCanvasAdapter(p.OffscreenCanvasAdapter)},t.setupCustomContext=function(t,e){s.Db.registerDbAdapter(t),c.Canvas.registerCanvasAdapter(e)},t.setupDefaultContext=function(){t.isNode?t.setupNodeContext():t.isBrowser?t.setupBrowserContext():t.isWebWorker&&t.setupWebWorkerContext()},t.isNode=void 0!==i&&null!=i.versions&&null!=i.versions.node,t.isBrowser="undefined"!=typeof window&&void 0!==window.document,t.isWebWorker="undefined"!=typeof importScripts,t}();e.Context=d},5897:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Contents=void 0;var n=function(){function t(){}return t.prototype.copy=function(){var e=new t;return e.table_name=this.table_name,e.data_type=this.data_type,e.identifier=this.identifier,e.description=this.description,e.min_x=this.min_x,e.max_x=this.max_x,e.min_y=this.min_y,e.max_y=this.max_y,e.srs_id=this.srs_id,e},t.prototype.getTableName=function(){return this.table_name},t}();e.Contents=n},6638:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsDao=void 0;var a=n(4115),s=n(3506),u=n(5925),l=n(1968),c=n(5897),h=n(8572),f=n(2527),p=n(9971),d=n(1375),y=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_PK],n}return i(e,t),e.prototype.createObject=function(t){var e=new c.Contents;return t&&(e.table_name=t.table_name,e.data_type=t.data_type,e.identifier=t.identifier,e.description=t.description,e.last_change=t.last_change,e.min_y=t.min_y,e.max_y=t.max_y,e.min_x=t.min_x,e.max_x=t.max_x,e.srs_id=t.srs_id),e},e.prototype.getTables=function(t){var n;if(t){var r=new h.ColumnValues;r.addColumn(e.COLUMN_DATA_TYPE,t),n=this.queryForColumns("table_name",r)}else n=this.queryForColumns("table_name");for(var i=[],o=0;o<n.length;o++)i.push(n[o].table_name);return i},e.prototype.getContentsForTableType=function(t,n){var r,i;void 0===n&&(n=!1);var a=[];if(t){var s=new h.ColumnValues;s.addColumn(e.COLUMN_DATA_TYPE,t);try{for(var u=o(this.queryForFieldValues(s)),l=u.next();!l.done;l=u.next()){var c=l.value;if(n){var p=new f.BoundingBox(c.min_x,c.max_x,c.min_y,c.max_y).projectBoundingBox(this.getProjection(c),d.ProjectionConstants.EPSG_4326);c.min_x=p.minLongitude,c.max_x=p.maxLongitude,c.min_y=p.minLatitude,c.max_y=p.maxLatitude}a.push(c)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}return a},e.prototype.getProjection=function(t){var e=this.getSrs(t);return this.geoPackage.spatialReferenceSystemDao.getProjection(e)},e.prototype.getSrs=function(t){return this.geoPackage.spatialReferenceSystemDao.queryForId(t.srs_id)},e.prototype.getGeometryColumns=function(t){var e=this.geoPackage.geometryColumnsDao,n=e.queryForAllEq(l.GeometryColumnsDao.COLUMN_TABLE_NAME,t.table_name);if(null==n?void 0:n.length)return e.createObject(n[0])},e.prototype.getTileMatrixSet=function(t){var e=this.geoPackage.tileMatrixSetDao,n=e.queryForAllEq(u.TileMatrixSetDao.COLUMN_TABLE_NAME,t.table_name);if(null==n?void 0:n.length)return e.createObject(n[0])},e.prototype.getTileMatrix=function(t){var e=this.geoPackage.tileMatrixDao,n=e.queryForAllEq(s.TileMatrixDao.COLUMN_TABLE_NAME,t.table_name);if(n&&n.length){for(var r=[],i=0;i<n.length;i++){var o=e.createObject(n[i]);r.push(o)}return r}},e.prototype.deleteCascadeContents=function(t){var e=0;if(null!=t){var n=p.ContentsDataType.fromName(t.data_type);if(null!=n)switch(n){case p.ContentsDataType.FEATURES:var r=this.geoPackage.geometryColumnsDao;if(r.isTableExists()){var i=this.getGeometryColumns(t);null!=i&&r.deleteByMultiId([i.table_name,i.column_name])}break;case p.ContentsDataType.TILES:var o=this.geoPackage.tileMatrixDao;if(o.isTableExists()){var a=this.getTileMatrix(t);null!=a&&a.length>0&&a.forEach((function(t){o.deleteByMultiId([t.table_name,t.zoom_level])}))}var s=this.geoPackage.tileMatrixSetDao;if(s.isTableExists()){var u=this.getTileMatrixSet(t);null!=u&&s.deleteById(u.table_name)}break;case p.ContentsDataType.ATTRIBUTES:this.dropTableWithTableName(t.table_name)}else this.dropTableWithTableName(t.table_name);e=this.delete(t)}return e},e.prototype.deleteCascade=function(t,e){var n=this.deleteCascadeContents(t);return e&&this.dropTableWithTableName(t.table_name),n},e.prototype.deleteByIdCascade=function(t,e){var n=0;if(null!=t){var r=this.queryForId(t);null!=r?n=this.deleteCascade(r,e):e&&this.dropTableWithTableName(t)}return n},e.prototype.deleteTable=function(t){try{this.deleteByIdCascade(t,!0)}catch(e){throw new Error("Failed to delete table: "+t)}},e.TABLE_NAME="gpkg_contents",e.COLUMN_PK="table_name",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_DATA_TYPE="data_type",e.COLUMN_IDENTIFIER="identifier",e.COLUMN_DESCRIPTION="description",e.COLUMN_LAST_CHANGE="last_change",e.COLUMN_MIN_X="min_x",e.COLUMN_MIN_Y="min_y",e.COLUMN_MAX_X="max_x",e.COLUMN_MAX_Y="max_y",e.COLUMN_SRS_ID="srs_id",e}(a.Dao);e.ContentsDao=y},9971:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsDataType=void 0,(n=e.ContentsDataType||(e.ContentsDataType={})).FEATURES="features",n.TILES="tiles",n.ATTRIBUTES="attributes",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){var n=null;if(null!=e)switch(e.toLowerCase()){case t.FEATURES:n=t.FEATURES;break;case t.TILES:n=t.TILES;break;case t.ATTRIBUTES:n=t.ATTRIBUTES}return n}}(e.ContentsDataType||(e.ContentsDataType={}))},341:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SpatialReferenceSystem=void 0;var r=n(5604),i=n(1375),o=function(){function t(){}return Object.defineProperty(t.prototype,"projection",{get:function(){return"NONE"===this.organization?null:!this.organization||this.organization.toUpperCase()!==i.ProjectionConstants.EPSG||this.organization_coordsys_id!==i.ProjectionConstants.EPSG_CODE_4326&&this.organization_coordsys_id!==i.ProjectionConstants.EPSG_CODE_3857?this.definition_12_063&&""!==this.definition_12_063&&"undefined"!==this.definition_12_063?r.Projection.getConverter(this.definition_12_063):this.definition&&""!==this.definition&&"undefined"!==this.definition?r.Projection.getConverter(this.definition):null:r.Projection.getEPSGConverter(this.organization_coordsys_id)},enumerable:!1,configurable:!0}),t.TABLE_NAME="gpkg_spatial_ref_sys",t}();e.SpatialReferenceSystem=o},5965:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SpatialReferenceSystemDao=void 0;var o=n(4115),a=n(341),s=n(8572),u=n(1375),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.idColumns=[e.COLUMN_SRS_ID],n.gpkgTableName=e.TABLE_NAME,n}return i(e,t),e.prototype.createObject=function(t){var e=new a.SpatialReferenceSystem;return t&&(e.srs_name=t.srs_name,e.srs_id=t.srs_id,e.organization=t.organization,e.organization_coordsys_id=t.organization_coordsys_id,e.definition=t.definition,e.definition_12_063=t.definition,e.description=t.description),e},e.prototype.getAllSpatialReferenceSystems=function(){var t=[];if(null!=this.connection&&this.isTableExists()){var e=this.queryForAll();if(e&&e.length)for(var n=0;n<e.length;n++)t.push(this.createObject(e[n]))}return t},e.prototype.getByOrganizationAndCoordSysId=function(t,e){var n=new s.ColumnValues;n.addColumn("organization",t),n.addColumn("organization_coordsys_id",e);var r=this.queryForAll(this.buildWhere(n),this.buildWhereArgs(n));if(r&&r.length)return this.createObject(r[0])},e.prototype.getBySrsId=function(t){return this.queryForId(t)},e.prototype.getProjection=function(t){return t.projection},e.prototype.createWgs84=function(){var t=this.getBySrsId(u.ProjectionConstants.EPSG_CODE_4326);return t?t.srs_id:((t=new a.SpatialReferenceSystem).srs_name="WGS 84 geodetic",t.srs_id=u.ProjectionConstants.EPSG_CODE_4326,t.organization="EPSG",t.organization_coordsys_id=u.ProjectionConstants.EPSG_CODE_4326,t.definition='GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',t.description="longitude/latitude coordinates in decimal degrees on the WGS 84 spheroid",this.connection.columnAndTableExists("gpkg_spatial_ref_sys","definition_12_063")&&(t.definition_12_063='GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]'),this.create(t))},e.prototype.createUndefinedCartesian=function(){var t=this.getBySrsId(-1);return t?t.srs_id:((t=new a.SpatialReferenceSystem).srs_name="Undefined cartesian SRS",t.srs_id=-1,t.organization="NONE",t.organization_coordsys_id=-1,t.definition="undefined",t.description="undefined cartesian coordinate reference system",this.connection.columnAndTableExists("gpkg_spatial_ref_sys","definition_12_063")&&(t.definition_12_063="undefined"),this.create(t))},e.prototype.createUndefinedGeographic=function(){var t=this.getBySrsId(0);return t?t.srs_id:((t=new a.SpatialReferenceSystem).srs_name="Undefined geographic SRS",t.srs_id=0,t.organization="NONE",t.organization_coordsys_id=0,t.definition="undefined",t.description="undefined geographic coordinate reference system",this.connection.columnAndTableExists("gpkg_spatial_ref_sys","definition_12_063")&&(t.definition_12_063="undefined"),this.create(t))},e.prototype.createWebMercator=function(){var t=this.getByOrganizationAndCoordSysId(u.ProjectionConstants.EPSG,u.ProjectionConstants.EPSG_CODE_3857);return t?t.srs_id:((t=new a.SpatialReferenceSystem).srs_name="WGS 84 / Pseudo-Mercator",t.srs_id=u.ProjectionConstants.EPSG_CODE_3857,t.organization="EPSG",t.organization_coordsys_id=u.ProjectionConstants.EPSG_CODE_3857,t.definition='PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]',t.description="Spherical Mercator projection coordinate system",this.connection.columnAndTableExists("gpkg_spatial_ref_sys","definition_12_063")&&(t.definition_12_063='PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]'),this.create(t))},e.TABLE_NAME="gpkg_spatial_ref_sys",e.COLUMN_SRS_NAME="srs_name",e.COLUMN_SRS_ID="srs_id",e.COLUMN_ID=e.COLUMN_SRS_ID,e.COLUMN_ORGANIZATION="organization",e.COLUMN_ORGANIZATION_COORDSYS_ID="organization_coordsys_id",e.COLUMN_DEFINITION="definition",e.COLUMN_DESCRIPTION="description",e}(o.Dao);e.SpatialReferenceSystemDao=l},8572:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColumnValues=void 0;var n=function(){function t(){this.values={},this.columns=[]}return t.prototype.addColumn=function(t,e){this.columns.push(t),this.values[t]=e},t.prototype.getValue=function(t){return this.values[t]},t}();e.ColumnValues=n},4115:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dao=void 0;var r=n(8572),i=n(8877),o=n(5042),a=function(){function t(t){this.geoPackage=t,this.connection=t.database}return t.prototype.isTableExists=function(){return this.connection.isTableExists(this.gpkgTableName)},t.prototype.refresh=function(t){return this.queryForSameId(t)},t.prototype.queryForId=function(t){var e=this.buildPkWhere(t),n=this.buildPkWhereArgs(t),r=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,e),o=this.connection.get(r,n);if(o)return this.createObject(o)},t.prototype.queryForSameId=function(t){var e=this.getMultiId(t);return this.queryForMultiId(e)},t.prototype.getMultiId=function(t){for(var e=[],n=0;n<this.idColumns.length;n++){var r=t.values?t.values[this.idColumns[n]]:t[this.idColumns[n]];void 0!==r&&e.push(r)}return e},t.prototype.queryForMultiId=function(t){var e=this.buildPkWhere(t),n=this.buildPkWhereArgs(t),r=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,e),o=this.connection.get(r,n);if(o)return this.createObject(o)},t.prototype.queryForAll=function(t,e){var n=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,t);return this.connection.all(n,e)},t.prototype.queryForLike=function(t,e){var n=new r.ColumnValues;n.addColumn(t,e);var o=this.buildWhereLike(n),a=this.buildWhereArgs(e),s=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,o);return this.connection.all(s,a)},t.prototype.queryForColumns=function(t,e){var n=void 0,r=null;e&&(n=this.buildWhere(e),r=this.buildWhereArgs(e));var o=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",[t],n);return this.connection.all(o,r)},t.prototype.queryForChunk=function(t,e){var n=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,void 0,void 0,void 0,void 0,this.idColumns[0],t,e*t);return this.connection.all(n)},t.prototype.queryForEach=function(t,e,n,r,o,a){if(t){var s=this.buildWhereWithFieldAndValue(t,e),u=this.buildWhereArgs(e);return l=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,s,void 0,n,r,o),this.connection.each(l,u)}var l=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",a,void 0,void 0,n,r,o);return this.connection.each(l)},t.prototype.queryForFieldValues=function(t){var e=this.buildWhere(t),n=this.buildWhereArgs(t),r=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,e);return this.connection.each(r,n)},t.prototype.queryJoinWhereWithArgs=function(t,e,n,r){var o=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",r,e,t);return this.connection.each(o,n)},t.prototype.countJoinWhereWithArgs=function(t,e,n){var r="select COUNT(*) as count from '"+this.gpkgTableName+"' "+t+" where "+e,i=this.connection.get(r,n);return null==i?void 0:i.count},t.prototype.queryWhereWithArgsDistinct=function(t,e){var n=i.SqliteQueryBuilder.buildQuery(!0,"'"+this.gpkgTableName+"'",void 0,t);return this.connection.each(n,e)},t.prototype.queryWhere=function(t,e,n,r,o,a){var s=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,t,void 0,n,r,o,a);return this.connection.each(s,e)},t.prototype.buildPkWhere=function(t){if(Array.isArray(t)){for(var e=t,n=new r.ColumnValues,i=0;i<e.length;i++)n.addColumn(this.idColumns[i],e[i]);return this.buildWhere(n)}return this.buildWhereWithFieldAndValue(this.idColumns[0],t)},t.prototype.buildPkWhereArgs=function(t){if(Array.isArray(t)){for(var e=t,n=[],r=0;r<e.length;r++)n=n.concat(this.buildWhereArgs(e[r]));return n}return this.buildWhereArgs(t)},t.prototype.buildWhereLike=function(t,e){for(var n="",r=0;r<t.columns.length;r++){var i=t.columns[r];r&&(n+=" "+e+" "),n+=this.buildWhereWithFieldAndValue(i,t.getValue(i),"like")}return n},t.prototype.buildWhere=function(t,e){void 0===e&&(e="and");for(var n="",r=0;r<t.columns.length;r++){var i=t.columns[r];r&&(n+=" "+e+" "),n+=this.buildWhereWithFieldAndValue(i,t.getValue(i))}return n},t.prototype.buildWhereArgs=function(t){var e=[];return Array.isArray(t)?e=this._buildWhereArgsWithArray(t):t instanceof r.ColumnValues?e=this._buildWhereArgsWithColumnValues(t):null!=t&&e.push(t),e.length?e:null},t.prototype._buildWhereArgsWithArray=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];null!=r&&e.push(r)}return e},t.prototype._buildWhereArgsWithColumnValues=function(t){for(var e=[],n=0;n<t.columns.length;n++){var r=t.columns[n],i=t.getValue(r);null!=i&&e.push(i)}return e},t.prototype.buildWhereWithFieldAndValue=function(t,e,n){return void 0===n&&(n="="),t+" "+(null==e?"is null":n+" ?")},t.prototype.queryForAllEq=function(t,e,n,r,o){var a=this.buildWhereWithFieldAndValue(t,e),s=this.buildWhereArgs(e),u=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,a,void 0,n,r,o);return this.connection.all(u,s)},t.prototype.count=function(t,e){if(!t)return this.connection.count(this.gpkgTableName);var n,o,a;if(t instanceof r.ColumnValues)n=this.buildWhere(t,"and"),o=this.buildWhereArgs(t),a=i.SqliteQueryBuilder.buildCount("'"+this.gpkgTableName+"'",n);else{var s=this.buildWhereWithFieldAndValue(t,e);o=this.buildWhereArgs(e),a=i.SqliteQueryBuilder.buildCount("'"+this.gpkgTableName+"'",s)}var u=this.connection.get(a,o);return null==u?void 0:u.count},t.prototype.countWhere=function(t,e){var n=i.SqliteQueryBuilder.buildCount("'"+this.gpkgTableName+"'",t),r=this.connection.get(n,e);return null==r?void 0:r.count},t.prototype.minOfColumn=function(t,e,n){return this.connection.minOfColumn("'"+this.gpkgTableName+"'",t,e,n)},t.prototype.maxOfColumn=function(t,e,n){return this.connection.maxOfColumn("'"+this.gpkgTableName+"'",t,e,n)},t.prototype.delete=function(t){return"function"==typeof t.getId?this.deleteById(t.getId()):this.deleteByMultiId(this.getMultiId(t))},t.prototype.deleteById=function(t){var e=this.buildPkWhere(t),n=this.buildPkWhereArgs(t);return this.connection.delete("'"+this.gpkgTableName+"'",e,n)},t.prototype.deleteByMultiId=function(t){var e=this.buildPkWhere(t),n=this.buildPkWhereArgs(t);return this.connection.delete("'"+this.gpkgTableName+"'",e,n)},t.prototype.deleteWhere=function(t,e){return this.connection.delete("'"+this.gpkgTableName+"'",t,e)},t.prototype.deleteAll=function(){return this.connection.delete("'"+this.gpkgTableName+"'","",[])},t.prototype.create=function(t){var e=i.SqliteQueryBuilder.buildInsert("'"+this.gpkgTableName+"'",t),n=i.SqliteQueryBuilder.buildUpdateOrInsertObject(t);return this.connection.insert(e,n)},t.prototype.updateWithValues=function(t,e,n){var r=i.SqliteQueryBuilder.buildUpdate("'"+this.gpkgTableName+"'",t,e,n);return this.connection.run(r.sql,r.args)},t.prototype.update=function(t){var e=i.SqliteQueryBuilder.buildUpdateOrInsertObject(t),n=i.SqliteQueryBuilder.buildObjectUpdate("'"+this.gpkgTableName+"'",t),r=this.getMultiId(t);if(r.length){for(var o=" where ",a=0;a<r.length;a++)o+='"'+this.idColumns[a]+'" = $'+i.SqliteQueryBuilder.fixColumnName(this.idColumns[a]),e[i.SqliteQueryBuilder.fixColumnName(this.idColumns[a])]=r[a];n+=o}return this.connection.run(n,e)},t.prototype.createOrUpdate=function(t){return this.queryForSameId(t)?this.update(t).changes:this.create(t)},t.prototype.dropTable=function(){return this.connection.dropTable(this.gpkgTableName)},t.prototype.dropTableWithTableName=function(t){o.CoreSQLUtils.dropTable(this.geoPackage.connection,t)},t.prototype.rename=function(t){this.connection.run("ALTER TABLE '"+this.gpkgTableName+"' RENAME TO '"+t+"'"),this.gpkgTableName=t},t}();e.Dao=a},8590:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumnConstraints=void 0;e.DataColumnConstraints=function(){}},7175:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumnConstraintsDao=void 0;var o=n(4115),a=n(8590),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_CONSTRAINT_NAME,e.COLUMN_CONSTRAINT_TYPE,e.COLUMN_VALUE],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.DataColumnConstraints;return t&&(e.constraint_name=t.constraint_name,e.constraint_type=t.constraint_type,e.value=t.value,e.min=t.min,e.max=t.max,e.min_is_inclusive=t.min_is_inclusive,e.max_is_inclusive=t.max_is_inclusive,e.description=t.description),e},e.prototype.queryByConstraintName=function(t){return this.queryForEach(e.COLUMN_CONSTRAINT_NAME,t)},e.prototype.queryUnique=function(t,e,n){var r=new a.DataColumnConstraints;return r.constraint_name=t,r.constraint_type=e,r.value=n,this.queryForSameId(r)},e.TABLE_NAME="gpkg_data_column_constraints",e.COLUMN_CONSTRAINT_NAME="constraint_name",e.COLUMN_CONSTRAINT_TYPE="constraint_type",e.COLUMN_VALUE="value",e.COLUMN_MIN="min",e.COLUMN_MIN_IS_INCLUSIVE="min_is_inclusive",e.COLUMN_MAX="max",e.COLUMN_MAX_IS_INCLUSIVE="max_is_inclusive",e.COLUMN_DESCRIPTION="description",e.ENUM_TYPE="enum",e.GLOB_TYPE="glob",e.RANGE_TYPE="range",e}(o.Dao);e.DataColumnConstraintsDao=s},8133:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumns=void 0;e.DataColumns=function(t){t=t||{},this.table_name=t.table_name,this.column_name=t.column_name,this.name=t.name,this.title=t.title,this.description=t.description,this.mime_type=t.mime_type,this.constraint_name=t.constraint_name}},4941:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumnsDao=void 0;var a=n(4115),s=n(6638),u=n(8133),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_PK1,e.COLUMN_PK2],n}return i(e,t),e.prototype.createObject=function(t){var e=new u.DataColumns;return t&&(e.table_name=t.table_name,e.column_name=t.column_name,e.name=t.name,e.title=t.title,e.description=t.description,e.mime_type=t.mime_type,e.constraint_name=t.constraint_name),e},e.prototype.getContents=function(t){return new s.ContentsDao(this.geoPackage).queryForId(t.table_name)},e.prototype.queryByConstraintName=function(t){return this.queryForEach(e.COLUMN_CONSTRAINT_NAME,t)},e.prototype.getDataColumns=function(t,n){var r,i;if(this.isTableExists()){var a,s=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t)+" and "+this.buildWhereWithFieldAndValue(e.COLUMN_COLUMN_NAME,n),u=[t,n];try{for(var l=o(this.queryWhere(s,u)),c=l.next();!c.done;c=l.next()){var h=c.value;a=this.createObject(h)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return a}},e.prototype.deleteByTableName=function(t){var n="";n+=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t);var r=this.buildWhereArgs(t);return this.deleteWhere(n,r)},e.TABLE_NAME="gpkg_data_columns",e.COLUMN_PK1="table_name",e.COLUMN_PK2="column_name",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_NAME="name",e.COLUMN_TITLE="title",e.COLUMN_DESCRIPTION="description",e.COLUMN_MIME_TYPE="mime_type",e.COLUMN_CONSTRAINT_NAME="constraint_name",e}(a.Dao);e.DataColumnsDao=l},8314:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.AlterTable=void 0;var i=n(362),o=n(5042),a=n(5329),s=n(2431),u=n(2841),l=n(1133),c=n(7043),h=n(175),f=n(8934),p=n(1078),d=n(735),y=function(){function t(){}return t.alterTableSQL=function(t){return"ALTER TABLE "+a.StringUtils.quoteWrap(t)},t.renameTable=function(e,n,r){var i=t.renameTableSQL(n,r);e.run(i)},t.renameTableSQL=function(e,n){return t.alterTableSQL(e)+" RENAME TO "+a.StringUtils.quoteWrap(n)},t.renameColumn=function(e,n,r,i){var o=t.renameColumnSQL(n,r,i);e.run(o)},t.renameColumnSQL=function(e,n,r){return t.alterTableSQL(e)+" RENAME COLUMN "+a.StringUtils.quoteWrap(n)+" TO "+a.StringUtils.quoteWrap(r)},t.addColumn=function(e,n,r,i){var o=t.addColumnSQL(n,r,i);e.run(o)},t.addColumnSQL=function(e,n,r){return t.alterTableSQL(e)+" ADD COLUMN "+a.StringUtils.quoteWrap(n)+" "+r},t.dropColumnForUserTable=function(e,n,r){t.dropColumnsForUserTable(e,n,[r])},t.dropColumnsForUserTable=function(e,n,r){var i=n.copy();r.forEach((function(t){i.dropColumnWithName(t)}));var o=new s.TableMapping(i.getTableName(),i.getTableName(),i.getUserColumns().getColumns());r.forEach((function(t){o.addDroppedColumn(t)})),t.alterTableWithTableMapping(e,i,o),r.forEach((function(t){n.dropColumnWithName(t)}))},t.dropColumn=function(e,n,r){t.dropColumns(e,n,[r])},t.dropColumns=function(e,n,r){var o=new i.UserCustomTableReader(n).readTable(e);t.dropColumnsForUserTable(e,o,r)},t.alterColumnForTable=function(e,n,r){t.alterColumnsForTable(e,n,[r])},t.alterColumnsForTable=function(e,n,r){var i=n.copy();r.forEach((function(t){i.alterColumn(t)})),t.alterTable(e,i),r.forEach((function(t){n.alterColumn(t)}))},t.alterColumn=function(e,n,r){t.alterColumns(e,n,[r])},t.alterColumns=function(e,n,r){var o=new i.UserCustomTableReader(n).readTable(e);t.alterColumnsForTable(e,o,r)},t.copyTable=function(e,n,r,i){void 0===i&&(i=!0);var o=new s.TableMapping(n.getTableName(),r,n.getUserColumns().getColumns());o.transferContent=i,t.alterTableWithTableMapping(e,n,o)},t.copyTableWithName=function(e,n,r,o){void 0===o&&(o=!0);var a=new i.UserCustomTableReader(n).readTable(e);t.copyTable(e,a,r,o)},t.alterTable=function(e,n){var r=new s.TableMapping(n.getTableName(),n.getTableName(),n.getUserColumns().getColumns());t.alterTableWithTableMapping(e,n,r)},t.alterTableWithTableMapping=function(e,n,r){n.getUserColumns().getColumns().forEach((function(t){t.clearConstraints().forEach((function(e){var n=o.CoreSQLUtils.modifySQL(null,e.name,e.buildSql(),r);null!=n&&t.addConstraint(new u.RawConstraint(e.type,l.ConstraintParser.getName(n),n))}))})),n.clearConstraints().forEach((function(t){var e=o.CoreSQLUtils.modifySQL(null,t.name,t.buildSql(),r);null!=e&&n.addConstraint(new u.RawConstraint(t.type,t.name,e))}));var i=o.CoreSQLUtils.createTableSQL(n);t.alterTableWithSQLAndTableMapping(e,i,r)},t.alterTableWithSQLAndTableMapping=function(e,n,i){var a=i.fromTable,s=i.isNewTable(),u=o.CoreSQLUtils.setForeignKeys(e,!1);e.transaction((function(){try{var l=c.SQLiteMaster.queryViewsOnTable(e,[h.SQLiteMasterColumn.NAME,h.SQLiteMasterColumn.SQL],a);if(!s)for(var y=0;y<l.count();y++){var m=l.getName(y);try{o.CoreSQLUtils.dropView(e,m)}catch(t){r.warn("Failed to drop view: "+m+", table: "+a,t)}}var g=c.SQLiteMaster.query(e,[h.SQLiteMasterColumn.NAME,h.SQLiteMasterColumn.TYPE,h.SQLiteMasterColumn.SQL],[f.SQLiteMasterType.INDEX,f.SQLiteMasterType.TRIGGER],p.SQLiteMasterQuery.createForColumnValue(h.SQLiteMasterColumn.TBL_NAME,a)),_=void 0;for(s?_=i.toTable:(_=o.CoreSQLUtils.tempTableName(e,"new",a),i.toTable=_),n=n.replace('"'+a+'"','"'+_+'"'),e.run(n),i.isTransferContent()&&o.CoreSQLUtils.transferTableContentForTableMapping(e,i),s||(o.CoreSQLUtils.dropTable(e,a),t.renameTable(e,_,a),i.toTable=a),y=0;y<g.count();y++){var b=!s;if(b||(b=g.getType(y)!=f.SQLiteMasterType.TRIGGER||!g.getName(y).startsWith(d.RTreeIndexDao.PREFIX)),b){var v=g.getSql(y);if(null!=v&&null!=(v=o.CoreSQLUtils.modifySQL(e,g.getName(y),v,i)))try{e.run(v)}catch(t){r.warn("Failed to recreate "+g.getType(y)+" after table alteration. table: "+i.toTable+", sql: "+v,t)}}}for(y=0;y<l.count();y++){var T=l.getSql(y);if(null!=T&&null!=(T=o.CoreSQLUtils.modifySQL(e,l.getName(y),T,i)))try{e.run(T)}catch(t){r.warn("Failed to recreate view: "+l.getName(y)+", table: "+i.toTable+", sql: "+T,t)}}u&&t.foreignKeyCheck(e)}catch(t){}})),u&&o.CoreSQLUtils.setForeignKeys(e,!0)},t.foreignKeyCheck=function(t){var e=o.CoreSQLUtils.foreignKeyCheck(t);if(e.length>0){for(var n=[],r=0;r<e.length;r++){r>0&&(n=n.concat(" ")),n=n.concat(r+1).concat(": ");for(var i=e[r],a=0;a<i.length;a++)a>0&&(n=n.concat(", ")),n=n.concat(i.get(a))}throw new Error("Foreign Key Check Violations: "+n)}},t}();e.AlterTable=y},5042:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CoreSQLUtils=void 0;var r=n(5329),i=n(2431),o=n(5045),a=n(7043),s=n(1078),u=n(175),l=function(){function t(){}return t.createTableSQL=function(e){var n="";n=n.concat("CREATE TABLE ").concat(r.StringUtils.quoteWrap(e.getTableName())).concat(" (");for(var i=e.getUserColumns().getColumns(),o=0;o<i.length;o++){var a=i[o];o>0&&(n=n.concat(",")),n=(n=n.concat("\n ")).concat(t.columnSQL(a))}return e.getConstraints().all().forEach((function(t){n=(n=n.concat(",\n ")).concat(t.buildSql())})),n=n.concat("\n);")},t.columnSQL=function(e){return r.StringUtils.quoteWrap(e.getName())+" "+t.columnDefinition(e)},t.columnDefinition=function(t){var e="";return e=e.concat(t.getType()),t.hasMax()&&(e=e.concat("(").concat(t.getMax().toString()).concat(")")),t.getConstraints().all().forEach((function(n){e=(e=e.concat(" ")).concat(t.buildConstraintSql(n))})),e.toString()},t.foreignKeys=function(t){var e=t.get("PRAGMA foreign_keys",null)[0];return null!=e&&e},t.setForeignKeys=function(e,n){var r=t.foreignKeys(e);if(r!==n){var i=t.foreignKeysSQL(n);e.run(i)}return r},t.foreignKeysSQL=function(t){return"PRAGMA foreign_keys = "+t},t.foreignKeyCheck=function(e){var n=t.foreignKeyCheckSQL(null);return e.all(n,null)},t.foreignKeyCheckForTable=function(e,n){var r=t.foreignKeyCheckSQL(n);return e.all(r,null)},t.foreignKeyCheckSQL=function(t){return"PRAGMA foreign_key_check"+(null!=t?"("+r.StringUtils.quoteWrap(t)+")":"")},t.integrityCheckSQL=function(){return"PRAGMA integrity_check"},t.quickCheckSQL=function(){return"PRAGMA quick_check"},t.dropTable=function(e,n){var r=t.dropTableSQL(n);e.run(r)},t.dropTableSQL=function(t){return"DROP TABLE IF EXISTS "+r.StringUtils.quoteWrap(t)},t.dropView=function(e,n){var r=t.dropViewSQL(n);e.run(r)},t.dropViewSQL=function(t){return"DROP VIEW IF EXISTS "+r.StringUtils.quoteWrap(t)},t.transferTableContentForTableMapping=function(e,n){var r=t.transferTableContentSQL(n);e.run(r)},t.transferTableContentSQL=function(t){var e="INSERT INTO ";e=(e=e.concat(r.StringUtils.quoteWrap(t.toTable))).concat(" (");var n="",i="";t.hasWhere()&&(i=i.concat(t.where));var o=t.getColumns();return t.getColumnNames().forEach((function(t){var a=t,s=o[t];n.length>0&&(e=e.concat(", "),n=n.concat(", ")),e=e.concat(r.StringUtils.quoteWrap(a)),s.hasConstantValue()?n=n.concat(s.getConstantValueAsString()):(s.hasDefaultValue()&&(n=n.concat("ifnull(")),n=n.concat(r.StringUtils.quoteWrap(s.fromColumn)),s.hasDefaultValue()&&(n=(n=(n=n.concat(",")).concat(s.getDefaultValueAsString())).concat(")"))),s.hasWhereValue()&&(i.length>0&&(i=i.concat(" AND ")),i=(i=(i=(i=(i=i.concat(r.StringUtils.quoteWrap(s.fromColumn))).concat(" ")).concat(s.whereOperator)).concat(" ")).concat(s.getWhereValueAsString()))})),e=(e=(e=(e=e.concat(") SELECT ")).concat(n)).concat(" FROM ")).concat(r.StringUtils.quoteWrap(t.fromTable)),i.length>0&&(e=(e=e.concat(" WHERE ")).concat(i)),e.toString()},t.transferTableContent=function(e,n,r,a,s,u){var l=o.TableInfo.info(e,n),c=i.TableMapping.fromTableInfo(l);null!=u&&c.removeColumn(u);var h=c.getColumn(r);h.constantValue=a,h.whereValue=s,t.transferTableContentForTableMapping(e,c)},t.tempTableName=function(t,e,n){for(var r=e+"_"+n,i=0;t.tableExists(r);)r=e+ ++i+"_"+n;return r},t.modifySQL=function(e,n,r,i){var o=r;if(null!=n&&i.isNewTable()){var a=t.createName(e,n,i.fromTable,i.toTable),s=t.replaceName(o,n,a);null!=s&&(o=s);var u=t.replaceName(o,i.fromTable,i.toTable);null!=u&&(o=u)}return t.modifySQLWithTableMapping(o,i)},t.modifySQLWithTableMapping=function(e,n){for(var r=e,i=Array.from(n.droppedColumns),o=0;o<i.length;o++){var a=i[o];if(null!=t.replaceName(r,a," ")){r=null;break}}return null!=r&&n.getMappedColumns().forEach((function(e){if(e.hasNewName()){var n=t.replaceName(r,e.fromColumn,e.toColumn);null!=n&&(r=n)}})),r},t.replaceName=function(t,e,n){var r=null;if(t.indexOf(e)>=0){for(var i=!1,o="",a=t.split(e),s=0;s<=a.length;s++){if(s>0){var u="_",l=a[s-1];0===l.length?1==s&&(u=" "):u=l.substring(l.length-1);var c="_";if(s<a.length){var h=a[s];0!==h.length&&(c=h.substring(0,1))}else{if(!t.endsWith(e))break;c=" "}u.match("\\W").length>0&&c.match("\\W").length>0?(o=o.concat(n),i=!0):o=o.concat(e)}s<a.length&&(o=o.concat(a[s]))}i&&(r=o.toString())}return r},t.createName=function(e,n,r,i){var o=n.replace(new RegExp(r),i);if(o===n){var l=o,c=1,h=l.lastIndexOf("_");if(h>=0&&h+1<l.length){var f=l.substring(h+1);f.match(t.NUMBER_PATTERN).length>0&&(l=l.substring(0,h),c=parseInt(f))}if(o=l+"_"+ ++c,null!=e)for(;a.SQLiteMaster.count(e,null,s.SQLiteMasterQuery.createForColumnValue(u.SQLiteMasterColumn.NAME,o))>0;)o=l+"_"+ ++c}return o},t.vacuum=function(t){t.run("VACUUM")},t.NUMBER_PATTERN="\\d+",t}();e.CoreSQLUtils=l},4777:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Db=void 0;var n=function(){function t(){}return t.registerDbAdapter=function(e){t.adapterCreator=e},t.create=function(e){return new t.adapterCreator(e)},t.adapterCreator=void 0,t}();e.Db=n},5116:function(t,e,n){"use strict";var r=n(5108),i=n(3085).Buffer,o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageConnection=void 0;var s=n(4777),u=n(1506),l=function(){function t(t){this.filePath=t,this.registeredFunctions=[]}return t.prototype.init=function(){return o(this,void 0,void 0,(function(){var t;return a(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.adapter=s.Db.create(this.filePath),[4,this.adapter.initialize()];case 1:return e.sent(),[3,3];case 2:throw t=e.sent(),r.log("Failed to create adapter",t),t;case 3:return[2,this]}}))}))},t.prototype.transaction=function(t){this.adapter.transaction(t)},t.prototype.close=function(){this.adapter.close()},t.prototype.export=function(){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this.adapter.export()]}))}))},t.prototype.getDBConnection=function(){return this.adapter.db},t.prototype.setDBConnection=function(t){this.adapter=s.Db.create(),this.adapter.db=t},t.prototype.registerFunction=function(t,e){return-1===this.registeredFunctions.indexOf(t)&&(this.registeredFunctions.push(t),this.adapter.registerFunction(t,e)),this.adapter},t.prototype.get=function(t,e){return this.adapter.get(t,e)},t.prototype.isTableExists=function(t){return this.adapter.isTableExists(t)},t.prototype.run=function(t,e){return this.adapter.run(t,e)},t.prototype.all=function(t,e){return this.adapter.all(t,e)},t.prototype.each=function(t,e){return this.adapter.each(t,e)},t.prototype.minOfColumn=function(t,e,n,r){var i="select min("+e+") as min from "+t;return n&&(i+=" ",n.indexOf("where")&&(n="where "+n),i+=n),this.adapter.get(i,r).min},t.prototype.maxOfColumn=function(t,e,n,r){var i="select max("+e+") as max from "+t;return n&&(i+=" ",n.indexOf("where")&&(n="where "+n),i+=n),this.adapter.get(i,r).max},t.prototype.count=function(t,e,n){return this.adapter.count(t,e,n)},t.prototype.insert=function(t,e){return this.adapter.insert(t,e)},t.prototype.delete=function(t,e,n){var r="DELETE FROM "+t;return e&&(r+=" WHERE "+e),this.adapter.delete(r,n)},t.prototype.dropTable=function(t){return this.adapter.dropTable(t)},t.prototype.tableExists=function(t){return this.adapter.isTableExists(t)},t.prototype.columnAndTableExists=function(t,e){for(var n=this.adapter.all("PRAGMA table_info('"+t+"')"),r=0;r<n.length;r++)if(n[r].name===e)return!0;return!1},t.prototype.setApplicationId=function(){var t=i.from(u.GeoPackageConstants.APPLICATION_ID).readUInt32BE(0);this.adapter.run("PRAGMA application_id = "+t),this.adapter.run("PRAGMA user_version = "+u.GeoPackageConstants.USER_VERSION)},t.prototype.getApplicationId=function(){return this.adapter.get("PRAGMA application_id").application_id},t.connect=function(e){return new t(e).init()},t.connectWithDatabase=function(e){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return[4,new t(void 0).init()];case 1:return(n=r.sent()).setDBConnection(e),[2,n]}}))}))},t}();e.GeoPackageConnection=l},7319:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageDataType=void 0,(n=e.GeoPackageDataType||(e.GeoPackageDataType={}))[n.BOOLEAN=0]="BOOLEAN",n[n.TINYINT=1]="TINYINT",n[n.SMALLINT=2]="SMALLINT",n[n.MEDIUMINT=3]="MEDIUMINT",n[n.INT=4]="INT",n[n.INTEGER=5]="INTEGER",n[n.FLOAT=6]="FLOAT",n[n.DOUBLE=7]="DOUBLE",n[n.REAL=8]="REAL",n[n.TEXT=9]="TEXT",n[n.BLOB=10]="BLOB",n[n.DATE=11]="DATE",n[n.DATETIME=12]="DATETIME",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]},t.columnDefaultValue=function(e,n){var r=null;if(null!=e){if(null!=n)switch(n){case t.BOOLEAN:var i=null;if("boolean"==typeof e)i=e;else if("string"==typeof e)switch(e){case"0":case"false":i=!1;break;case"1":case"true":i=!0}null!=i&&(r=i?"1":"0");break;case t.TEXT:(r=e.toString()).startsWith("'")&&r.endsWith("'")||(r="'"+r+"'")}null==r&&(r=e.toString())}return r}}(e.GeoPackageDataType||(e.GeoPackageDataType={}))},1790:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MappedColumn=void 0;var i=n(7319),o=r(n(4293)),a=r(n(8446)),s=function(){function t(t,e,n,r){this._toColumn=t,this._fromColumn=e,this._defaultValue=n,this._dataType=r}return Object.defineProperty(t.prototype,"toColumn",{get:function(){return this._toColumn},set:function(t){this._toColumn=t},enumerable:!1,configurable:!0}),t.prototype.hasNewName=function(){return!(0,o.default)(this._fromColumn)&&!(0,a.default)(this._fromColumn,this._toColumn)},Object.defineProperty(t.prototype,"fromColumn",{get:function(){return this._fromColumn},set:function(t){this._fromColumn=t},enumerable:!1,configurable:!0}),t.prototype.hasDefaultValue=function(){return!(0,o.default)(this._defaultValue)},Object.defineProperty(t.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(t){this._defaultValue=t},enumerable:!1,configurable:!0}),t.prototype.getDefaultValueAsString=function(){return i.GeoPackageDataType.columnDefaultValue(this._defaultValue,this._dataType)},Object.defineProperty(t.prototype,"dataType",{get:function(){return this._dataType},set:function(t){this._dataType=t},enumerable:!1,configurable:!0}),t.prototype.hasConstantValue=function(){return!(0,o.default)(this._constantValue)},Object.defineProperty(t.prototype,"constantValue",{get:function(){return this._constantValue},set:function(t){this._constantValue=t},enumerable:!1,configurable:!0}),t.prototype.getConstantValueAsString=function(){return i.GeoPackageDataType.columnDefaultValue(this._constantValue,this._dataType)},t.prototype.hasWhereValue=function(){return!(0,o.default)(this._whereValue)},Object.defineProperty(t.prototype,"whereValue",{get:function(){return this._whereValue},set:function(t){this._whereValue=t},enumerable:!1,configurable:!0}),t.prototype.getWhereValueAsString=function(){return i.GeoPackageDataType.columnDefaultValue(this._whereValue,this._dataType)},t.prototype.setWhereValueAndOperator=function(t,e){this._whereValue=t,this.whereOperator=e},Object.defineProperty(t.prototype,"whereOperator",{get:function(){return(0,o.default)(this._whereOperator)?"=":this._whereOperator},set:function(t){this._whereOperator=t},enumerable:!1,configurable:!0}),t}();e.MappedColumn=s},7043:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.SQLiteMaster=void 0;var o=n(175),a=n(8934),s=n(4980),u=n(1133),l=n(1078),c=function(){function t(t,e){if(this._columns={},null!=e&&e.length>0){this._results=t,this._count=t.length;for(var n=0;n<e.length;n++)this._columns[o.SQLiteMasterColumn.nameFromType(e[n])]=n}else this._results=[],this._count=t[0].cnt}return t.prototype.count=function(){return this._count},t.prototype.columns=function(){return Object.keys(this._columns).map((function(t){return o.SQLiteMasterColumn.fromName(t)}))},t.prototype.getType=function(t){return a.SQLiteMasterType.fromName(this.getTypeString(t).toUpperCase())},t.prototype.getTypeString=function(t){return this.getValueForRowAndColumn(t,o.SQLiteMasterColumn.TYPE)},t.prototype.getName=function(t){return this.getValueForRowAndColumn(t,o.SQLiteMasterColumn.NAME)},t.prototype.getTableName=function(t){return this.getValueForRowAndColumn(t,o.SQLiteMasterColumn.TBL_NAME)},t.prototype.getRootpage=function(t){return this.getValueForRowAndColumn(t,o.SQLiteMasterColumn.ROOTPAGE)},t.prototype.getSql=function(t){return this.getValueForRowAndColumn(t,o.SQLiteMasterColumn.SQL)},t.prototype.getValueForRowAndColumn=function(e,n){return t.getValue(this.getRow(e),n)},t.prototype.getRow=function(t){if(t<0||t>=this._results.length){var e;throw e=0===this._results.length?"Results are empty":"Row index: "+t+", not within range 0 to "+(this._results.length-1),new Error(e)}return this._results[t]},t.getValue=function(t,e){return t[o.SQLiteMasterColumn.nameFromType(e).toLowerCase()]},t.prototype.getConstraints=function(t){var e=new s.TableConstraints;if(this.getType(t)===a.SQLiteMasterType.TABLE){var n=this.getSql(t);null!=n&&(e=u.ConstraintParser.getConstraints(n))}return e},t.count=function(e,n,r){return t.query(e,null,n,r).count()},t.query=function(e,n,s,u){var l="SELECT ",c=[];if(null!=n&&n.length>0)for(var h=0;h<n.length;h++)h>0&&(l=l.concat(", ")),l=l.concat(o.SQLiteMasterColumn.nameFromType(n[h]).toLowerCase());else l=l.concat("count(*) as cnt");l=(l=l.concat(" FROM ")).concat(t.TABLE_NAME);var f=null!=u&&u.has(),p=null!=s&&s.length>0;if((f||p)&&(l=l.concat(" WHERE "),f&&(l=l.concat(u.buildSQL()),c.push.apply(c,i([],r(u.getArguments()),!1))),p)){for(f&&(l=l.concat(" AND")),l=l.concat(" type IN ("),h=0;h<s.length;h++)h>0&&(l=l.concat(", ")),l=l.concat("?"),c.push(a.SQLiteMasterType.nameFromType(s[h]).toLowerCase());l=l.concat(")")}return new t(e.all(l,c),n)},t.queryViewsOnTable=function(e,n,r){return t.query(e,n,[a.SQLiteMasterType.VIEW],l.SQLiteMasterQuery.createTableViewQuery(r))},t.countViewsOnTable=function(e,n){return t.count(e,[a.SQLiteMasterType.VIEW],l.SQLiteMasterQuery.createTableViewQuery(n))},t.queryForConstraints=function(e,n){for(var r=new s.TableConstraints,i=t.query(e,[o.SQLiteMasterColumn.TYPE,o.SQLiteMasterColumn.NAME,o.SQLiteMasterColumn.TBL_NAME,o.SQLiteMasterColumn.ROOTPAGE,o.SQLiteMasterColumn.SQL],[a.SQLiteMasterType.TABLE],l.SQLiteMasterQuery.createForColumnValue(o.SQLiteMasterColumn.TBL_NAME,n)),u=0;u<i.count();u++)r.addTableConstraints(i.getConstraints(u).constraints);return r},t.TABLE_NAME="sqlite_master",t}();e.SQLiteMaster=c},175:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SQLiteMasterColumn=void 0,(n=e.SQLiteMasterColumn||(e.SQLiteMasterColumn={}))[n.TYPE=0]="TYPE",n[n.NAME=1]="NAME",n[n.TBL_NAME=2]="TBL_NAME",n[n.ROOTPAGE=3]="ROOTPAGE",n[n.SQL=4]="SQL",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]},t.asArray=function(){return[t.TYPE,t.NAME,t.TBL_NAME,t.ROOTPAGE,t.SQL]}}(e.SQLiteMasterColumn||(e.SQLiteMasterColumn={}))},1078:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SQLiteMasterQuery=void 0;var r=n(175),i=n(5329),o=function(){function t(t){this.queries=[],this.arguments=[],this.combineOperation=t}return t.prototype.add=function(t,e,n){this.validateAdd(),this.queries.push("LOWER("+i.StringUtils.quoteWrap(r.SQLiteMasterColumn.nameFromType(t).toLowerCase())+") "+e+" LOWER(?)"),this.arguments.push(n)},t.prototype.addIsNull=function(t){this.validateAdd(),this.queries.push(i.StringUtils.quoteWrap(r.SQLiteMasterColumn.nameFromType(t).toLowerCase())+" IS NULL")},t.prototype.addIsNotNull=function(t){this.validateAdd(),this.queries.push(i.StringUtils.quoteWrap(r.SQLiteMasterColumn.nameFromType(t).toLowerCase())+" IS NOT NULL")},t.prototype.validateAdd=function(){if((null===this.combineOperation||void 0===this.combineOperation)&&0!==this.queries.length)throw new Error("Query without a combination operation supports only a single query")},t.prototype.has=function(){return 0!==this.queries.length},t.prototype.buildSQL=function(){var t="";this.queries.length>1&&(t=t.concat("( "));for(var e=0;e<this.queries.length;e++)e>0&&(t=(t=(t=t.concat(" ")).concat(this.combineOperation)).concat(" ")),t=t.concat(this.queries[e]);return this.queries.length>1&&(t=t.concat(" )")),t},t.prototype.getArguments=function(){return this.arguments},t.create=function(){return new t(null)},t.createOr=function(){return new t("OR")},t.createAnd=function(){return new t("AND")},t.createForColumnValue=function(t,e){var n=this.create();return n.add(t,"=",e),n},t.createForOperationAndColumnValue=function(t,e,n){var r=this.create();return r.add(t,e,n),r},t.createOrForColumnValue=function(t,e){var n=this.createOr();return e.forEach((function(e){n.add(t,"=",e)})),n},t.createOrForOperationAndColumnValue=function(t,e,n){var r=this.createOr();return n.forEach((function(n){r.add(t,e,n)})),r},t.createAndForColumnValue=function(t,e){var n=this.createAnd();return e.forEach((function(e){n.add(t,"=",e)})),n},t.createAndForOperationAndColumnValue=function(t,e,n){var r=this.createAnd();return n.forEach((function(n){r.add(t,e,n)})),r},t.createTableViewQuery=function(e){var n=[];return n.push('%"'+e+'"%'),n.push("% "+e+" %"),n.push("%,"+e+" %"),n.push("% "+e+",%"),n.push("%,"+e+",%"),n.push("% "+e),n.push("%,"+e),t.createOrForOperationAndColumnValue(r.SQLiteMasterColumn.SQL,"LIKE",n)},t}();e.SQLiteMasterQuery=o},8934:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SQLiteMasterType=void 0,(n=e.SQLiteMasterType||(e.SQLiteMasterType={}))[n.TABLE=0]="TABLE",n[n.INDEX=1]="INDEX",n[n.VIEW=2]="VIEW",n[n.TRIGGER=3]="TRIGGER",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]}}(e.SQLiteMasterType||(e.SQLiteMasterType={}))},922:function(t,e,n){"use strict";var r=n(5108),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SqliteAdapter=void 0;var s=a(n(1929)),u=a(n(3935)),l=a(n(8501)),c=a(n(7435)),h=function(){function t(t){this.filePath=t}return t.prototype.initialize=function(){return i(this,void 0,void 0,(function(){var t,e,i,a,h=this;return o(this,(function(o){try{return t=n(3730),this.filePath&&"string"==typeof this.filePath?0===this.filePath.indexOf("http")?(e=this.filePath,[2,new Promise((function(n,i){l.default.get(e,(function(e){200!==e.statusCode&&i(new Error("Unable to reach url: "+h.filePath));var o=u.default.join(c.default.tmpdir(),Date.now()+Math.floor(100*Math.random())+".gpkg"),a=s.default.createWriteStream(o);e.pipe(a),a.on("close",(function(){try{h.db=new t(o),h.db.pragma("journal_mode = WAL"),h.filePath=o,n(h)}catch(t){r.log("error",t),i(t)}}))})).on("error",(function(t){i(t)}))}))]):(this.db=new t(this.filePath),[2,this]):this.filePath?(i=this.filePath,a=u.default.join(c.default.tmpdir(),Date.now()+".gpkg"),[2,new Promise((function(e,n){s.default.writeFile(a,i,(function(){h.db=new t(a);try{h.db.pragma("journal_mode = WAL")}catch(t){r.log("error",t),n(t)}h.filePath=a,e(h)}))}))]):(r.log("create in memory"),this.db=new t(":memory:"),[2,this])}catch(t){throw r.log("Error opening database",t),t}return[2]}))}))},t.prototype.close=function(){this.db.pragma("wal_autocheckpoint=0"),this.db.pragma("wal_checkpoint(RESTART)"),this.db.close()},t.prototype.getDBConnection=function(){return this.db},t.prototype.getFunctionList=function(){return this.db.pragma("function_list")},t.prototype.export=function(){return i(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return[2,new Promise((function(e){return s.default.readFile(t.filePath,(function(t,n){e(n)}))}))]}))}))},t.prototype.registerFunction=function(t,e){return this.db.function(t,e),this},t.prototype.get=function(t,e){var n=this.db.prepare(t);return e?n.get(e):n.get()},t.prototype.isTableExists=function(t){return!!this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=:name").get({name:t})},t.prototype.all=function(t,e){var n=this.db.prepare(t);return e?n.all(e):n.all()},t.prototype.each=function(t,e){var n=this.db.prepare(t);return e?n.iterate(e):n.iterate()},t.prototype.run=function(t,e){var n=this.db.prepare(t);return e?n.run(e):n.run()},t.prototype.insert=function(t,e){return this.db.prepare(t).run(e).lastInsertRowid},t.prototype.prepareStatement=function(t){return this.db.prepare(t)},t.prototype.bindAndInsert=function(t,e){return t.run(e).lastInsertRowid},t.prototype.closeStatement=function(t){},t.prototype.delete=function(t,e){return this.db.prepare(t).run(e).changes},t.prototype.dropTable=function(t){try{var e=this.db.prepare('DROP TABLE IF EXISTS "'+t+'"').run();return this.db.prepare("VACUUM").run(),0===e.changes}catch(t){return r.log("Drop Table Error",t),!1}},t.prototype.count=function(t,e,n){var r='SELECT COUNT(*) as count FROM "'+t+'"';e&&(r+=" where "+e);var i=this.db.prepare(r);return n?i.get(n).count:i.get().count},t.prototype.transaction=function(t){this.db.transaction(t)()},t}();e.SqliteAdapter=h},8877:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SqliteQueryBuilder=void 0;var n=function(){function t(){}return t.fixColumnName=function(t){return t.replace(/\W+/g,"_")},t.buildQuery=function(e,n,r,i,o,a,s,u,l,c){var h="";if(t.isEmpty(a)&&!t.isEmpty(s))throw new Error("Illegal Arguments: having clauses require a groupBy clause");return h+="select ",e&&(h+="distinct "),r&&r.length?h=t.appendColumnsToString(r,h):h+="* ",h+="from "+n,o&&(h+=" "+o),h=t.appendClauseToString(h," where ",i),h=t.appendClauseToString(h," group by ",a),h=t.appendClauseToString(h," having ",s),h=t.appendClauseToString(h," order by ",u),h=t.appendClauseToString(h," limit ",l),t.appendClauseToString(h," offset ",c)},t.buildCount=function(e,n){var r="select count(*) as count from "+e;return t.appendClauseToString(r," where ",n)},t.buildInsert=function(e,n){if(n.columnNames)return t.buildInsertFromColumnNames(e,n);var r="insert into "+e+" (",i="",o="",a=!0;for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&void 0!==n[s]&&(a||(i+=",",o+=","),a=!1,i+=s,o+="$"+t.fixColumnName(s));return r+(i+") values (")+o+")"},t.buildInsertFromColumnNames=function(e,n){for(var r="insert into "+e+" (",i="",o="",a=!0,s=n.columnNames,u=0;u<s.length;u++){var l=s[u];a||(i+=",",o+=","),a=!1,i+='"'+l+'"',o+="$"+t.fixColumnName(l)}return r+(i+") values (")+o+")"},t.buildUpdateOrInsertObject=function(e){var n={};if(e.columnNames)for(var r=e.columnNames,i=0;i<r.length;i++)n[t.fixColumnName(r[i])]=e.toDatabaseValue(r[i]);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&void 0!==e[o]&&(e.toDatabaseValue?n[t.fixColumnName(o)]=e.toDatabaseValue(o):"boolean"==typeof e[o]?n[t.fixColumnName(o)]=e[o]?1:0:e[o]instanceof Date?n[t.fixColumnName(o)]=new Date(e[o]).toISOString():n[t.fixColumnName(o)]=e[o]);return n},t.buildUpdate=function(t,e,n,r){var i=[],o="update "+t+" set ",a=!0;for(var s in e)a||(o+=", "),a=!1,o+='"'+s+'"',i.push(e[s]),o+="=?";if(r)if(r instanceof Array)for(var u=0;u<r.length;u++)i.push(r[u]);else i.push(r);return n&&(o+=" where ",o+=n),{sql:o,args:i}},t.buildObjectUpdate=function(e,n){var r="update "+e+" set ",i=!0;if(n.columnNames)for(var o=n.columnNames,a=0;a<o.length;a++){var s=o[a];i||(r+=", "),i=!1,r+='"'+s+'"=',r+="$"+t.fixColumnName(s)}else for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(i||(r+=", "),i=!1,r+='"'+u+'"=',r+="$"+t.fixColumnName(u));return r},t.appendClauseToString=function(t,e,n){return n&&(t+=e+n),t},t.appendColumnsToString=function(e,n){if(!e||!e.length)return n;n+=t.columnToAppend(e[0]);for(var r=1;r<e.length;r++)n+=", "+t.columnToAppend(e[r]);return n+" "},t.columnToAppend=function(t){return-1!==t.indexOf("*")?t:'"'+t+'"'},t.isEmpty=function(t){return!t||0===t.length},t}();e.SqliteQueryBuilder=n},5849:function(t,e,n){"use strict";var r=n(4155),i=n(3085).Buffer,o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},s=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SqljsAdapter=void 0;var l=u(n(3686)),c=function(){function t(t){this.filePath=t}return t.setSqljsWasmLocateFile=function(e){t.sqljsWasmLocateFile=e},t.prototype.initialize=function(){var e=this;return new Promise((function(o,a){new Promise((function(e){null==t.SQL?(0,l.default)({locateFile:t.sqljsWasmLocateFile}).then((function(n){t.SQL=n,e(n)})).catch((function(t){a(t)})):e(t.SQL)})).then((function(t){if(!e.filePath||"string"!=typeof e.filePath){if(e.filePath){var s=e.filePath;return e.db=new t.Database(s),o(e)}return e.db=new t.Database,o(e)}if(void 0!==r&&r.version){var u=n(1929);if(0!==e.filePath.indexOf("http")){try{u.statSync(e.filePath)}catch(n){return e.db=new t.Database,o(e)}var l=u.readFileSync(e.filePath),c=new Uint8Array(l);return e.db=new t.Database(c),o(e)}n(8501).get(e.filePath,(function(n){if(200!==n.statusCode)return a(new Error("Unable to reach url: "+e.filePath));var r=[];n.on("data",(function(t){return r.push(t)})),n.on("end",(function(){var n=new Uint8Array(i.concat(r));e.db=new t.Database(n),o(e)}))})).on("error",(function(t){return a(t)}))}else{var h=new XMLHttpRequest;h.open("GET",e.filePath,!0),h.responseType="arraybuffer",h.onload=function(){if(200!==h.status)return a(new Error("Unable to reach url: "+e.filePath));var n=new Uint8Array(h.response);return e.db=new t.Database(n),o(e)},h.onerror=function(){return a(new Error("Error reaching url: "+e.filePath))},h.send()}})).catch((function(t){a(t)}))}))},t.prototype.close=function(){this.db.close()},t.prototype.getDBConnection=function(){return this.db},t.prototype.export=function(){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this.db.export()]}))}))},t.prototype.registerFunction=function(t,e){return this.db.create_function(t,e),this},t.prototype.get=function(t,e){e=e||[];var n,r=this.db.prepare(t);return r.bind(e),r.step()&&(n=r.getAsObject()),r.free(),n},t.prototype.isTableExists=function(t){var e,n=this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=:name");return n.bind([t]),n.step()&&(e=n.getAsObject()),n.free(),!!e},t.prototype.all=function(t,e){var n,r,i=[],o=this.each(t,e);try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var l=u.value;i.push(l)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.prototype.each=function(t,e){var n,r=this.db.prepare(t);return r.bind(e),(n={})[Symbol.iterator]=function(){return this},n.next=function(){return r.step()?{value:r.getAsObject(),done:!1}:(r.free(),{value:void 0,done:!0})},n},t.prototype.run=function(t,e){if(e&&!(e instanceof Array))for(var n in e)e["$"+n]=e[n];this.db.run(t,e);var r,i=this.db.exec("select last_insert_rowid();");return i&&(r=i[0].values[0][0]),{lastInsertRowid:r,changes:this.db.getRowsModified()}},t.prototype.insert=function(t,e){if(e&&!(e instanceof Array))for(var n in e)e["$"+n]=e[n];var r=this.db.prepare(t,e);r.step(),r.free();var i=this.db.exec("select last_insert_rowid();");return i?i[0].values[0][0]:void 0},t.prototype.prepareStatement=function(t){return this.db.prepare(t)},t.prototype.bindAndInsert=function(t,e){if(e&&!(e instanceof Array))for(var n in e)e["$"+n]=e[n];return t.run(e).lastInsertRowid},t.prototype.closeStatement=function(t){t.free()},t.prototype.delete=function(t,e){var n,r=this.db.prepare(t,e);return r.step(),n=this.db.getRowsModified(),r.free(),n},t.prototype.dropTable=function(t){var e=this.db.exec('DROP TABLE IF EXISTS "'+t+'"');return this.db.exec("VACUUM"),!!e},t.prototype.count=function(t,e,n){var r='SELECT COUNT(*) as count FROM "'+t+'"';return e&&(r+=" where "+e),this.get(r,n).count},t.prototype.transaction=function(t){this.db.exec("BEGIN TRANSACTION");try{t(),this.db.exec("COMMIT TRANSACTION")}catch(t){throw this.db.exec("ROLLBACK TRANSACTION"),t}},t.sqljsWasmLocateFile=function(t){return t},t}();e.SqljsAdapter=c},5329:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StringUtils=void 0;var n=function(){function t(){}return t.quoteWrap=function(t){var e=null;return null!==t&&(e=t.startsWith('"')&&t.endsWith('"')?t:'"'+t+'"'),e},t.quoteUnwrap=function(t){var e=null;return null!=t&&(e=t.startsWith('"')&&t.endsWith('"')?t.substring(1,t.length-1):t),e},t}();e.StringUtils=n},3765:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColumnConstraints=void 0;var r=n(7686),i=function(){function t(t){this.name=t,this.constraints=new r.Constraints}return t.prototype.addConstraint=function(t){this.constraints.add(t)},t.prototype.addConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.getConstraints=function(){return this.constraints},t.prototype.getConstraint=function(t){return t>=this.constraints.size()?null:this.constraints.get(t)},t.prototype.numConstraints=function(){return this.constraints.size()},t.prototype.addColumnConstraints=function(t){null!=t&&this.addConstraints(t.getConstraints())},t.prototype.hasConstraints=function(){return this.constraints.has()},t}();e.ColumnConstraints=i},8007:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constraint=void 0;var r=n(5329),i=function(){function t(t,e,n){void 0===n&&(n=Number.MAX_SAFE_INTEGER),this.type=t,this.name=e,this.order=n}return t.prototype.buildNameSql=function(){var e="";return null!==this.name&&void 0!==this.name&&(e=t.CONSTRAINT+" "+r.StringUtils.quoteWrap(this.name)+" "),e},t.prototype.buildSql=function(){return""},t.prototype.copy=function(){return new t(this.type,this.name)},t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.compareTo=function(t){return this.getOrder(this.order)-this.getOrder(t.order)<=0?-1:1},t.prototype.getOrder=function(t){return null!=t?t:Number.MAX_VALUE},t.CONSTRAINT="CONSTRAINT",t}();e.Constraint=i},1133:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConstraintParser=void 0;var r=n(4980),i=n(3765),o=n(8007),a=n(91),s=n(2841),u=n(5329),l=function(){function t(){}return t.getConstraints=function(e){var n=new r.TableConstraints,i=-1,o=-1;if(null!=e&&(i=e.indexOf("("),o=e.lastIndexOf(")")),i>=0&&o>=0){for(var a=e.substring(i+1,o).trim(),s=0,u=0,l=0;l<a.length;l++){var c=a.charAt(l);if("("===c)s++;else if(")"===c)s--;else if(","===c&&0===s){var h=a.substring(u,l);t.addConstraints(n,h),u=l+1}}u<a.length&&(h=a.substring(u,a.length),t.addConstraints(n,h))}return n},t.addConstraints=function(e,n){var r=t.getTableConstraint(n);if(null!=r)e.addTableConstraint(r);else{var i=t.getColumnConstraints(n);i.hasConstraints()&&e.addColumnConstraints(i)}},t.getColumnConstraints=function(e){for(var n=e.trim().split(/\s+/),r=u.StringUtils.quoteUnwrap(n[0]),s=new i.ColumnConstraints(r),l=-1,c=null,h=1;h<n.length;h++){var f=n[h];if(o.Constraint.CONSTRAINT===f.toUpperCase())null!=c&&(s.addConstraint(t.createConstraint(n,l,h,c)),c=null),l=h;else{var p=a.ConstraintType.getColumnType(f);null!=p&&(null!=c&&(s.addConstraint(t.createConstraint(n,l,h,c)),l=-1),l<0&&(l=h),c=p)}}return null!=c&&s.addConstraint(t.createConstraint(n,l,n.length,c)),s},t.createConstraint=function(e,n,r,i){for(var o="",a=n;a<r;a++)o.length>0&&(o=o.concat(" ")),o=o.concat(e[a]);var u=t.getName(o);return new s.RawConstraint(i,u,o)},t.getConstraint=function(e,n){var r=null,i=t.getNameAndDefinition(e),o=i[1];if(null!=o){var u,l=o.split(/\s+/)[0];null!=(u=n?a.ConstraintType.getTableType(l):a.ConstraintType.getColumnType(l))&&(r=new s.RawConstraint(u,i[0],e.trim()))}return r},t.getTableConstraint=function(e){return t.getConstraint(e,!0)},t.isTableConstraint=function(e){return null!==t.getTableConstraint(e)},t.getTableType=function(e){var n=null,r=t.getTableConstraint(e);return null!=r&&(n=r.type),n},t.isTableType=function(e,n){var r=!1,i=t.getTableType(n);return null!=i&&(r=e===i),r},t.getColumnConstraint=function(e){return t.getConstraint(e,!1)},t.isColumnConstraint=function(e){return null!=t.getColumnConstraint(e)},t.getColumnType=function(e){var n=null,r=t.getColumnConstraint(e);return null!=r&&(n=r.type),n},t.isColumnType=function(e,n){var r=!1,i=t.getColumnType(n);return null!=i&&(r=e==i),r},t.getTableOrColumnConstraint=function(e){var n=t.getTableConstraint(e);return null==n&&(n=t.getColumnConstraint(e)),n},t.isConstraint=function(e){return null!==t.getTableOrColumnConstraint(e)},t.getType=function(e){var n=null,r=t.getTableOrColumnConstraint(e);return null!=r&&(n=r.getType()),n},t.isType=function(e,n){var r=!1,i=t.getType(n);return null!=i&&(r=e===i),r},t.getName=function(e){var n=null,r=t.NAME_PATTERN(e);return null!==r&&r.length>t.NAME_PATTERN_NAME_GROUP&&(n=u.StringUtils.quoteUnwrap(r[t.NAME_PATTERN_NAME_GROUP])),n},t.getNameAndDefinition=function(e){var n=[null,e],r=t.CONSTRAINT_PATTERN(e.trim());if(null!==r&&r.length>t.CONSTRAINT_PATTERN_DEFINITION_GROUP){var i=u.StringUtils.quoteUnwrap(r[t.CONSTRAINT_PATTERN_NAME_GROUP]);null!=i&&(i=i.trim());var o=r[t.CONSTRAINT_PATTERN_DEFINITION_GROUP];null!=o&&(o=o.trim()),n=[i,o]}return n},t.NAME_PATTERN=function(t){return t.match(/CONSTRAINT\s+("[\s\S]+"|\S+)\s/i)},t.NAME_PATTERN_NAME_GROUP=1,t.CONSTRAINT_PATTERN=function(t){return t.match(/(CONSTRAINT\s+("[\s\S]+"|\S+)\s)?([\s\S]*)/i)},t.CONSTRAINT_PATTERN_NAME_GROUP=2,t.CONSTRAINT_PATTERN_DEFINITION_GROUP=3,t}();e.ConstraintParser=l},91:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ConstraintType=void 0,(n=e.ConstraintType||(e.ConstraintType={}))[n.PRIMARY_KEY=0]="PRIMARY_KEY",n[n.UNIQUE=1]="UNIQUE",n[n.CHECK=2]="CHECK",n[n.FOREIGN_KEY=3]="FOREIGN_KEY",n[n.NOT_NULL=4]="NOT_NULL",n[n.DEFAULT=5]="DEFAULT",n[n.COLLATE=6]="COLLATE",n[n.AUTOINCREMENT=7]="AUTOINCREMENT",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]},t.TABLE_CONSTRAINTS=new Set([t.PRIMARY_KEY,t.UNIQUE,t.CHECK,t.FOREIGN_KEY]),t.COLUMN_CONSTRAINTS=new Set([t.PRIMARY_KEY,t.NOT_NULL,t.UNIQUE,t.CHECK,t.DEFAULT,t.COLLATE,t.FOREIGN_KEY,t.AUTOINCREMENT]);var e=new Map;Array.from(t.TABLE_CONSTRAINTS).forEach((function(t){r(e,t)}));var n=new Map;function r(e,n){var r=t.nameFromType(n),i=r.split("_");e.set(i[0],n),i.length>0&&e.set(r.replace("_"," "),n)}function i(t){return e.get(t.toUpperCase())}function o(t){return n.get(t.toUpperCase())}Array.from(t.COLUMN_CONSTRAINTS).forEach((function(t){r(n,t)})),t.getTableType=i,t.getColumnType=o,t.getType=function(t){var e=i(t);return null==e&&(e=o(t)),e}}(e.ConstraintType||(e.ConstraintType={}))},7686:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Constraints=void 0;var i=r(n(1159)),o=function(){function t(){this.constraints=[],this.typedConstraints={}}return t.prototype.add=function(t){var e=this.constraints.map((function(t){return t.order})).lastIndexOf(t.order),n=e+1;-1===e&&(n=(0,i.default)(this.constraints.map((function(t){return t.order})),t.order)),n===this.constraints.length?this.constraints.push(t):this.constraints.splice(n,0,t),null!==this.typedConstraints[t.getType()]&&void 0!==this.typedConstraints[t.getType()]||(this.typedConstraints[t.getType()]=[]),this.typedConstraints[t.getType()].push(t)},t.prototype.addConstraintArray=function(t){for(var e=0;e<t.length;e++)this.add(t[e])},t.prototype.addConstraints=function(t){this.addConstraintArray(t.all())},t.prototype.has=function(){return this.constraints.length>0},t.prototype.hasType=function(t){return 0!==this.getConstraintsForType(t).length},t.prototype.all=function(){return this.constraints},t.prototype.get=function(t){return this.constraints[t]},t.prototype.getConstraintsForType=function(t){var e=this.typedConstraints[t];return null==e&&(e=[]),e},t.prototype.clear=function(){var t=this.constraints.slice();return this.constraints=[],this.typedConstraints={},t},t.prototype.clearConstraintsByType=function(t){var e=this.typedConstraints[t];return delete this.typedConstraints[t],null===e?e=[]:0===e.length&&(this.constraints=this.constraints.filter((function(e){return e.getType()!==t}))),e},t.prototype.copy=function(){var e=new t;return e.addConstraints(this),e},t.prototype.size=function(){return this.constraints.length},t}();e.Constraints=o},2841:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RawConstraint=void 0;var o=n(8007),a=function(t){function e(e,n,r,i){void 0===i&&(i=null);var o=t.call(this,e,n,i)||this;return o.sql=r,o}return i(e,t),e.prototype.buildSql=function(){var t=this.sql;return t.toUpperCase().startsWith(o.Constraint.CONSTRAINT)||(t=this.buildNameSql()+t),t},e}(o.Constraint);e.RawConstraint=a},4033:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableColumn=void 0;var n=function(){function t(t,e,n,r,i,o,a,s,u,l){this.index=t,this.name=e,this.type=n,this.dataType=r,this.max=i,this.notNull=o,this.defaultValueString=a,this.defaultValue=s,this.primaryKey=u,this.autoincrement=l}return t.prototype.getIndex=function(){return this.index},t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getDataType=function(){return this.dataType},t.prototype.isDataType=function(t){return this.dataType===t},t.prototype.getMax=function(){return this.max},t.prototype.isNotNull=function(){return this.notNull},t.prototype.getDefaultValueString=function(){return this.defaultValueString},t.prototype.getDefaultValue=function(){return this.defaultValue},t.prototype.isPrimaryKey=function(){return this.primaryKey},t.prototype.isAutoIncrement=function(){return this.autoincrement},t}();e.TableColumn=n},4980:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableConstraints=void 0;var r=n(3765),i=n(7686),o=function(){function t(){this.constraints=new i.Constraints,this.columnConstraints={}}return t.prototype.addTableConstraint=function(t){this.constraints.add(t)},t.prototype.addTableConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.getTableConstraints=function(){return this.constraints},t.prototype.getTableConstraint=function(t){return t>=this.constraints.size()?null:this.constraints.get(t)},t.prototype.numTableConstraints=function(){return this.constraints.size()},t.prototype.addColumnConstraint=function(t,e){this.getOrCreateColumnConstraints(t).addConstraint(e)},t.prototype.addConstraints=function(t,e){this.getOrCreateColumnConstraints(t).addConstraints(e)},t.prototype.addColumnConstraints=function(t){this.getOrCreateColumnConstraints(t.name).addColumnConstraints(t)},t.prototype.getOrCreateColumnConstraints=function(t){var e=this.columnConstraints[t];return null==e&&(e=new r.ColumnConstraints(t),this.columnConstraints[t]=e),e},t.prototype.addColumnConstraintsMap=function(t){var e=this;t.forEach((function(t){e.addColumnConstraints(t)}))},t.prototype.getColumnConstraintsMap=function(){return this.columnConstraints},t.prototype.getColumnsWithConstraints=function(){return Array.from(Object.keys(this.columnConstraints))},t.prototype.getColumnConstraints=function(t){return this.columnConstraints[t]},t.prototype.getColumnConstraint=function(t,e){var n=null,r=this.getColumnConstraints(t);return null!=r&&(n=r.getConstraint(e)),n},t.prototype.numColumnConstraints=function(t){var e=0,n=this.getColumnConstraints(t);return null!=n&&(e=n.numConstraints()),e},t.prototype.addAllConstraints=function(t){null!=t&&(this.addTableConstraints(t.getTableConstraints()),this.addColumnConstraintsMap(t.getColumnConstraintsMap()))},t.prototype.hasConstraints=function(){return this.hasTableConstraints()||this.hasColumnConstraints()},t.prototype.hasTableConstraints=function(){return this.constraints.has()},t.prototype.hasColumnConstraints=function(){return Object.keys(this.columnConstraints).length>0},t.prototype.hasColumnConstraintsForColumn=function(t){return this.numColumnConstraints(t)>0},t}();e.TableConstraints=o},5045:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.TableInfo=void 0;var i=n(4033),o=n(7319),a=n(9211),s=n(7043),u=n(175),l=n(5329),c=function(){function t(t,e){var n=this;this.namesToColumns=new Map,this.primaryKeys=[],this.tableName=t,this.columns=e,e.forEach((function(t){n.namesToColumns.set(t.getName(),t),t.isPrimaryKey()&&n.primaryKeys.push(t)}))}return t.prototype.getTableName=function(){return this.tableName},t.prototype.numColumns=function(){return this.columns.length},t.prototype.getColumns=function(){return this.columns.slice()},t.prototype.getColumnAtIndex=function(t){if(t<0||t>=this.columns.length)throw new Error("Column index: "+t+", not within range 0 to "+(this.columns.length-1));return this.columns[t]},t.prototype.hasColumn=function(t){return null!==this.getColumn(t)&&void 0!==this.getColumn(t)},t.prototype.getColumn=function(t){return this.namesToColumns.get(t)},t.prototype.hasPrimaryKey=function(){return 0!==this.primaryKeys.length},t.prototype.getPrimaryKeys=function(){return this.primaryKeys.slice()},t.prototype.getPrimaryKey=function(){var t=null;return this.hasPrimaryKey()&&(t=this.primaryKeys[0]),t},t.info=function(e,n){var o="PRAGMA table_info("+l.StringUtils.quoteWrap(n)+")",a=e.all(o,null),c=[];a.forEach((function(o){var a=o.cid,l=o.name,h=o.type,f=1===o.notnull,p=o.dflt_value,d=1===o.pk,y=!1;d&&(y=1===e.all("SELECT tbl_name FROM "+s.SQLiteMaster.TABLE_NAME+" WHERE "+u.SQLiteMasterColumn.nameFromType(u.SQLiteMasterColumn.TBL_NAME)+"=? AND "+u.SQLiteMasterColumn.nameFromType(u.SQLiteMasterColumn.SQL)+" LIKE ?",[n,"%AUTOINCREMENT%"]).length);var m=null;if(null!=h&&h.endsWith(")")){var g=h.indexOf("(");if(g>-1){var _=h.substring(g+1,h.length-1);if(0!==_.length)try{m=parseInt(_),h=h.substring(0,g)}catch(t){r.error(t)}}}var b=t.getDataType(h),v=void 0;o.dflt_value&&(v=o.dflt_value.replace(/\\'/g,""));var T=new i.TableColumn(a,l,h,b,m,f,p,v,d,y);c.push(T)}));var h=null;return 0!==c.length&&(h=new t(n,c)),h},t.getDataType=function(t){var e=o.GeoPackageDataType.fromName(t);null==e&&(null!=a.GeometryType.fromName(t)&&(e=o.GeoPackageDataType.BLOB));return e},t.CID="cid",t.NAME="name",t.TYPE="type",t.NOT_NULL="notnull",t.DFLT_VALUE="dflt_value",t.PK="pk",t.DEFAULT_NULL="NULL",t}();e.TableInfo=c},1648:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.UniqueConstraint=void 0;var s=n(91),u=function(t){function e(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=t.call(this,s.ConstraintType.UNIQUE,e)||this;return i.columns=[],i.add.apply(i,a([],o(n),!1)),i}return i(e,t),e.prototype.buildSql=function(){var t="";t=(t=(t=t.concat(this.buildNameSql())).concat(e.UNIQUE)).concat(" (");for(var n=0;n<this.columns.length;n++){var r=this.columns[n];n>0&&(t=t.concat(", ")),t=t.concat(r.getName())}return t.concat(")")},e.prototype.copy=function(){return new(e.bind.apply(e,a([void 0,this.name],o(this.columns),!1)))},e.prototype.add=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){t.columns.push(e)}))},e.prototype.getColumns=function(){return this.columns},e.UNIQUE="UNIQUE",e}(n(8007).Constraint);e.UniqueConstraint=u},1459:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableCreator=void 0;var r=n(5965),i=n(5042),o=function(){function t(t){this.geopackage=t,this.connection=t.database}return t.prototype.createRequired=function(){var t=new r.SpatialReferenceSystemDao(this.geopackage);return this.createSpatialReferenceSystem(),this.createContents(),t.createUndefinedGeographic(),t.createWgs84(),t.createUndefinedCartesian(),t.createWebMercator(),!0},t.prototype.createSpatialReferenceSystem=function(){return this.createTable("spatial_reference_system")},t.prototype.createContents=function(){return this.createTable("contents")},t.prototype.createGeometryColumns=function(){return this.createTable("geometry_columns")},t.prototype.createTileMatrixSet=function(){return this.createTable("tile_matrix_set")},t.prototype.createTileMatrix=function(){return this.createTable("tile_matrix")},t.prototype.createDataColumns=function(){return this.createTable("data_columns")},t.prototype.createDataColumnConstraints=function(){return this.createTable("data_column_constraints")},t.prototype.createMetadata=function(){return this.createTable("metadata")},t.prototype.createMetadataReference=function(){return this.createTable("metadata_reference")},t.prototype.createExtensions=function(){return this.createTable("extensions")},t.prototype.createTableIndex=function(){return this.createTable("table_index")},t.prototype.createGeometryIndex=function(){return this.createTable("geometry_index")},t.prototype.createFeatureTileLink=function(){return this.createTable("feature_tile_link")},t.prototype.createExtendedRelations=function(){return this.createTable("extended_relations")},t.prototype.createContentsId=function(){return this.createTable("contents_id")},t.prototype.createTileScaling=function(){return this.createTable("tile_scaling")},t.prototype.createTable=function(e){for(var n=!0,r=t.tableCreationScripts[e],i=0;i<r.length;i++){var o=r[i];try{n=n&&!!this.connection.run(o)}catch(t){if(-1===t.message.indexOf("already exists"))throw t}}return n},t.prototype.createUserTable=function(t){var e=this.connection;if(e.tableExists(t.getTableName()))throw new Error("Table already exists and cannot be created: "+t.getTableName());var n=i.CoreSQLUtils.createTableSQL(t);return e.run(n)},t.prototype.dropTable=function(t){i.CoreSQLUtils.dropTable(this.connection,t)},t.tableCreationScripts={spatial_reference_system:['CREATE TABLE gpkg_spatial_ref_sys ( srs_name TEXT NOT NULL, srs_id INTEGER NOT NULL PRIMARY KEY, organization TEXT NOT NULL, organization_coordsys_id INTEGER NOT NULL, definition TEXT NOT NULL, description TEXT, definition_12_063 TEXT NOT NULL DEFAULT "undefined")',"CREATE VIEW st_spatial_ref_sys AS SELECT srs_name, srs_id, organization, organization_coordsys_id, definition, description FROM gpkg_spatial_ref_sys","CREATE VIEW spatial_ref_sys AS SELECT srs_id AS srid, organization AS auth_name, organization_coordsys_id AS auth_srid, definition AS srtext FROM gpkg_spatial_ref_sys"],contents:["CREATE TABLE gpkg_contents ( table_name TEXT NOT NULL PRIMARY KEY, data_type TEXT NOT NULL, identifier TEXT UNIQUE, description TEXT DEFAULT '', last_change DATETIME NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')), min_x DOUBLE, min_y DOUBLE, max_x DOUBLE, max_y DOUBLE, srs_id INTEGER, CONSTRAINT fk_gc_r_srs_id FOREIGN KEY (srs_id) REFERENCES gpkg_spatial_ref_sys(srs_id))"],geometry_columns:["CREATE TABLE gpkg_geometry_columns ( table_name TEXT NOT NULL, column_name TEXT NOT NULL, geometry_type_name TEXT NOT NULL, srs_id INTEGER NOT NULL, z TINYINT NOT NULL, m TINYINT NOT NULL, CONSTRAINT pk_geom_cols PRIMARY KEY (table_name, column_name), CONSTRAINT uk_gc_table_name UNIQUE (table_name), CONSTRAINT fk_gc_tn FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name), CONSTRAINT fk_gc_srs FOREIGN KEY (srs_id) REFERENCES gpkg_spatial_ref_sys (srs_id))","CREATE VIEW st_geometry_columns AS SELECT table_name, column_name, 'ST_' || geometry_type_name AS geometry_type_name, g.srs_id, srs_name FROM gpkg_geometry_columns as g JOIN gpkg_spatial_ref_sys AS s WHERE g.srs_id = s.srs_id","CREATE VIEW geometry_columns AS SELECT table_name AS f_table_name, column_name AS f_geometry_column, (CASE geometry_type_name WHEN 'GEOMETRY' THEN 0 WHEN 'POINT' THEN 1 WHEN 'LINESTRING' THEN 2 WHEN 'POLYGON' THEN 3 WHEN 'MULTIPOINT' THEN 4 WHEN 'MULTILINESTRING' THEN 5 WHEN 'MULTIPOLYGON' THEN 6 WHEN 'GEOMETRYCOLLECTION' THEN 7 WHEN 'CIRCULARSTRING' THEN 8 WHEN 'COMPOUNDCURVE' THEN 9 WHEN 'CURVEPOLYGON' THEN 10 WHEN 'MULTICURVE' THEN 11 WHEN 'MULTISURFACE' THEN 12 WHEN 'CURVE' THEN 13 WHEN 'SURFACE' THEN 14 WHEN 'POLYHEDRALSURFACE' THEN 15 WHEN 'TIN' THEN 16 WHEN 'TRIANGLE' THEN 17 ELSE 0 END) AS geometry_type, 2 + (CASE z WHEN 1 THEN 1 WHEN 2 THEN 1 ELSE 0 END) + (CASE m WHEN 1 THEN 1 WHEN 2 THEN 1 ELSE 0 END) AS coord_dimension, srs_id AS srid FROM gpkg_geometry_columns"],tile_matrix_set:["CREATE TABLE gpkg_tile_matrix_set ( table_name TEXT NOT NULL PRIMARY KEY, srs_id INTEGER NOT NULL, min_x DOUBLE NOT NULL, min_y DOUBLE NOT NULL, max_x DOUBLE NOT NULL, max_y DOUBLE NOT NULL, CONSTRAINT fk_gtms_table_name FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name), CONSTRAINT fk_gtms_srs FOREIGN KEY (srs_id) REFERENCES gpkg_spatial_ref_sys (srs_id))"],tile_matrix:["CREATE TABLE gpkg_tile_matrix ( table_name TEXT NOT NULL, zoom_level INTEGER NOT NULL, matrix_width INTEGER NOT NULL, matrix_height INTEGER NOT NULL, tile_width INTEGER NOT NULL, tile_height INTEGER NOT NULL, pixel_x_size DOUBLE NOT NULL, pixel_y_size DOUBLE NOT NULL, CONSTRAINT pk_ttm PRIMARY KEY (table_name, zoom_level), CONSTRAINT fk_tmm_table_name FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name))","CREATE TRIGGER 'gpkg_tile_matrix_zoom_level_insert'BEFORE INSERT ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table ''gpkg_tile_matrix'' violates constraint: zoom_level cannot be less than 0')WHERE (NEW.zoom_level < 0);END","CREATE TRIGGER 'gpkg_tile_matrix_zoom_level_update'BEFORE UPDATE of zoom_level ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table ''gpkg_tile_matrix'' violates constraint: zoom_level cannot be less than 0')WHERE (NEW.zoom_level < 0);END","CREATE TRIGGER 'gpkg_tile_matrix_matrix_width_insert'BEFORE INSERT ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table ''gpkg_tile_matrix'' violates constraint: matrix_width cannot be less than 1')WHERE (NEW.matrix_width < 1);END","CREATE TRIGGER 'gpkg_tile_matrix_matrix_width_update'BEFORE UPDATE OF matrix_width ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table ''gpkg_tile_matrix'' violates constraint: matrix_width cannot be less than 1')WHERE (NEW.matrix_width < 1);END","CREATE TRIGGER 'gpkg_tile_matrix_matrix_height_insert'BEFORE INSERT ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table ''gpkg_tile_matrix'' violates constraint: matrix_height cannot be less than 1')WHERE (NEW.matrix_height < 1);END","CREATE TRIGGER 'gpkg_tile_matrix_matrix_height_update'BEFORE UPDATE OF matrix_height ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table ''gpkg_tile_matrix'' violates constraint: matrix_height cannot be less than 1')WHERE (NEW.matrix_height < 1);END","CREATE TRIGGER 'gpkg_tile_matrix_pixel_x_size_insert'BEFORE INSERT ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table ''gpkg_tile_matrix'' violates constraint: pixel_x_size must be greater than 0')WHERE NOT (NEW.pixel_x_size > 0);END","CREATE TRIGGER 'gpkg_tile_matrix_pixel_x_size_update'BEFORE UPDATE OF pixel_x_size ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table ''gpkg_tile_matrix'' violates constraint: pixel_x_size must be greater than 0')WHERE NOT (NEW.pixel_x_size > 0);END","CREATE TRIGGER 'gpkg_tile_matrix_pixel_y_size_insert'BEFORE INSERT ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table ''gpkg_tile_matrix'' violates constraint: pixel_y_size must be greater than 0')WHERE NOT (NEW.pixel_y_size > 0);END","CREATE TRIGGER 'gpkg_tile_matrix_pixel_y_size_update'BEFORE UPDATE OF pixel_y_size ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table ''gpkg_tile_matrix'' violates constraint: pixel_y_size must be greater than 0')WHERE NOT (NEW.pixel_y_size > 0);END"],data_columns:["CREATE TABLE gpkg_data_columns ( table_name TEXT NOT NULL, column_name TEXT NOT NULL, name TEXT, title TEXT, description TEXT, mime_type TEXT, constraint_name TEXT, CONSTRAINT pk_gdc PRIMARY KEY (table_name, column_name), CONSTRAINT gdc_tn UNIQUE (table_name, name))"],data_column_constraints:['CREATE TABLE gpkg_data_column_constraints ( constraint_name TEXT NOT NULL, constraint_type TEXT NOT NULL, /* "range" | "enum" | "glob" */ value TEXT, min NUMERIC, min_is_inclusive BOOLEAN, /* 0 = false, 1 = true */ max NUMERIC, max_is_inclusive BOOLEAN, /* 0 = false, 1 = true */ description TEXT, CONSTRAINT gdcc_ntv UNIQUE (constraint_name, constraint_type, value))'],metadata:['CREATE TABLE gpkg_metadata ( id INTEGER CONSTRAINT m_pk PRIMARY KEY ASC NOT NULL, md_scope TEXT NOT NULL DEFAULT "dataset", md_standard_uri TEXT NOT NULL, mime_type TEXT NOT NULL DEFAULT "text/xml", metadata TEXT NOT NULL)',"CREATE TRIGGER 'gpkg_metadata_md_scope_insert' BEFORE INSERT ON 'gpkg_metadata' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata violates constraint: md_scope must be one of undefined | fieldSession | collectionSession | series | dataset | featureType | feature | attributeType | attribute | tile | model | catalogue | schema | taxonomy software | service | collectionHardware | nonGeographicDataset | dimensionGroup') WHERE NOT(NEW.md_scope IN ('undefined','fieldSession','collectionSession','series','dataset', 'featureType','feature','attributeType','attribute','tile','model', 'catalogue','schema','taxonomy','software','service', 'collectionHardware','nonGeographicDataset','dimensionGroup')); END","CREATE TRIGGER 'gpkg_metadata_md_scope_update' BEFORE UPDATE OF 'md_scope' ON 'gpkg_metadata' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata violates constraint: md_scope must be one of undefined | fieldSession | collectionSession | series | dataset | featureType | feature | attributeType | attribute | tile | model | catalogue | schema | taxonomy software | service | collectionHardware | nonGeographicDataset | dimensionGroup') WHERE NOT(NEW.md_scope IN ('undefined','fieldSession','collectionSession','series','dataset', 'featureType','feature','attributeType','attribute','tile','model', 'catalogue','schema','taxonomy','software','service', 'collectionHardware','nonGeographicDataset','dimensionGroup')); END"],metadata_reference:["CREATE TABLE gpkg_metadata_reference ( reference_scope TEXT NOT NULL, table_name TEXT, column_name TEXT, row_id_value INTEGER, timestamp DATETIME NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')), md_file_id INTEGER NOT NULL, md_parent_id INTEGER, CONSTRAINT crmr_mfi_fk FOREIGN KEY (md_file_id) REFERENCES gpkg_metadata(id), CONSTRAINT crmr_mpi_fk FOREIGN KEY (md_parent_id) REFERENCES gpkg_metadata(id))","CREATE TRIGGER 'gpkg_metadata_reference_reference_scope_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: reference_scope must be one of \"geopackage\", table\", \"column\", \"row\", \"row/col\"') WHERE NOT NEW.reference_scope IN ('geopackage','table','column','row','row/col'); END","CREATE TRIGGER 'gpkg_metadata_reference_reference_scope_update' BEFORE UPDATE OF 'reference_scope' ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: referrence_scope must be one of \"geopackage\", \"table\", \"column\", \"row\", \"row/col\"') WHERE NOT NEW.reference_scope IN ('geopackage','table','column','row','row/col'); END","CREATE TRIGGER 'gpkg_metadata_reference_column_name_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: column name must be NULL when reference_scope is \"geopackage\", \"table\" or \"row\"') WHERE (NEW.reference_scope IN ('geopackage','table','row') AND NEW.column_name IS NOT NULL); SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: column name must be defined for the specified table when reference_scope is \"column\" or \"row/col\"') WHERE (NEW.reference_scope IN ('column','row/col') AND NOT NEW.table_name IN ( SELECT name FROM SQLITE_MASTER WHERE type = 'table' AND name = NEW.table_name AND sql LIKE ('%' || NEW.column_name || '%'))); END","CREATE TRIGGER 'gpkg_metadata_reference_column_name_update' BEFORE UPDATE OF column_name ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: column name must be NULL when reference_scope is \"geopackage\", \"table\" or \"row\"') WHERE (NEW.reference_scope IN ('geopackage','table','row') AND NEW.column_nameIS NOT NULL); SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: column name must be defined for the specified table when reference_scope is \"column\" or \"row/col\"') WHERE (NEW.reference_scope IN ('column','row/col') AND NOT NEW.table_name IN ( SELECT name FROM SQLITE_MASTER WHERE type = 'table' AND name = NEW.table_name AND sql LIKE ('%' || NEW.column_name || '%'))); END","CREATE TRIGGER 'gpkg_metadata_reference_row_id_value_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: row_id_value must be NULL when reference_scope is \"geopackage\", \"table\" or \"column\"') WHERE NEW.reference_scope IN ('geopackage','table','column') AND NEW.row_id_value IS NOT NULL; END ","CREATE TRIGGER 'gpkg_metadata_reference_row_id_value_update' BEFORE UPDATE OF 'row_id_value' ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: row_id_value must be NULL when reference_scope is \"geopackage\", \"table\" or \"column\"') WHERE NEW.reference_scope IN ('geopackage','table','column') AND NEW.row_id_value IS NOT NULL; END","CREATE TRIGGER 'gpkg_metadata_reference_timestamp_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: timestamp must be a valid time in ISO 8601 \"yyyy-mm-ddThh:mm:ss.cccZ\" form') WHERE NOT (NEW.timestamp GLOB '[1-2][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9]Z' AND strftime('%s',NEW.timestamp) NOT NULL); END","CREATE TRIGGER 'gpkg_metadata_reference_timestamp_update' BEFORE UPDATE OF 'timestamp' ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: timestamp must be a valid time in ISO 8601 \"yyyy-mm-ddThh:mm:ss.cccZ\" form') WHERE NOT (NEW.timestamp GLOB '[1-2][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9]Z' AND strftime('%s',NEW.timestamp) NOT NULL); END "],extensions:["CREATE TABLE gpkg_extensions ( table_name TEXT, column_name TEXT, extension_name TEXT NOT NULL, definition TEXT NOT NULL, scope TEXT NOT NULL, CONSTRAINT ge_tce UNIQUE (table_name, column_name, extension_name))"],table_index:["CREATE TABLE nga_table_index ( table_name TEXT NOT NULL PRIMARY KEY, last_indexed DATETIME)"],geometry_index:["CREATE TABLE nga_geometry_index ( table_name TEXT NOT NULL, geom_id INTEGER NOT NULL, min_x DOUBLE NOT NULL, max_x DOUBLE NOT NULL, min_y DOUBLE NOT NULL, max_y DOUBLE NOT NULL, min_z DOUBLE, max_z DOUBLE, min_m DOUBLE, max_m DOUBLE, CONSTRAINT pk_ngi PRIMARY KEY (table_name, geom_id), CONSTRAINT fk_ngi_nti_tn FOREIGN KEY (table_name) REFERENCES nga_table_index(table_name))"],feature_tile_link:["CREATE TABLE nga_feature_tile_link ( feature_table_name TEXT NOT NULL, tile_table_name TEXT NOT NULL, CONSTRAINT pk_nftl PRIMARY KEY (feature_table_name, tile_table_name))"],extended_relations:["CREATE TABLE gpkgext_relations ( id INTEGER PRIMARY KEY AUTOINCREMENT, base_table_name TEXT NOT NULL, base_primary_column TEXT NOT NULL DEFAULT 'id', related_table_name TEXT NOT NULL, related_primary_column TEXT NOT NULL DEFAULT 'id', relation_name TEXT NOT NULL, mapping_table_name TEXT NOT NULL UNIQUE)"],contents_id:["CREATE TABLE nga_contents_id ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, table_name TEXT NOT NULL, CONSTRAINT uk_nci_table_name UNIQUE (table_name), CONSTRAINT fk_nci_gc_tn FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name))"],tile_scaling:["CREATE TABLE nga_tile_scaling ( table_name TEXT PRIMARY KEY NOT NULL, scaling_type TEXT NOT NULL, zoom_in INTEGER, zoom_out INTEGER, CONSTRAINT fk_nts_gtms_tn FOREIGN KEY (table_name) REFERENCES gpkg_tile_matrix_set (table_name), CHECK (scaling_type in ('in','out','in_out','out_in','closest_in_out','closest_out_in')))"]},t}();e.TableCreator=o},2431:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TableMapping=void 0;var i=r(n(4293)),o=r(n(8446)),a=r(n(3674)),s=r(n(2628)),u=n(1790),l=function(){function t(t,e,n){var r=this;this._transferContent=!0,this._columns={},this._droppedColumns=new Set,this._fromTable=t,this._toTable=e,n.forEach((function(t){r.addMappedColumn(new u.MappedColumn(t.name,t.name,t.defaultValue,t.dataType))}))}return t.fromTableInfo=function(e){var n=new t(e.getTableName(),e.getTableName(),[]);return e.getColumns().forEach((function(t){n.addMappedColumn(new u.MappedColumn(t.getName(),t.getName(),t.getDefaultValue(),t.getDataType()))})),n},Object.defineProperty(t.prototype,"fromTable",{get:function(){return this._fromTable},set:function(t){this._fromTable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toTable",{get:function(){return this._toTable},set:function(t){this._toTable=t},enumerable:!1,configurable:!0}),t.prototype.isNewTable=function(){return!(0,i.default)(this._toTable)&&!(0,o.default)(this._toTable,this._fromTable)},t.prototype.isTransferContent=function(){return this._transferContent},Object.defineProperty(t.prototype,"transferContent",{set:function(t){this._transferContent=t},enumerable:!1,configurable:!0}),t.prototype.addMappedColumn=function(t){this._columns[t.toColumn]=t},t.prototype.addColumnWithName=function(t){this._columns[t]=new u.MappedColumn(t,null,null,null)},t.prototype.removeColumn=function(t){var e=this._columns[t];return delete this._columns[t],e},t.prototype.getColumnNames=function(){return(0,a.default)(this._columns)},t.prototype.getColumns=function(){return this._columns},t.prototype.getMappedColumns=function(){return(0,s.default)(this._columns)},t.prototype.getColumn=function(t){return this._columns[t]},t.prototype.addDroppedColumn=function(t){this._droppedColumns.add(t)},t.prototype.removeDroppedColumn=function(t){return this._droppedColumns.delete(t)},Object.defineProperty(t.prototype,"droppedColumns",{get:function(){return this._droppedColumns},enumerable:!1,configurable:!0}),t.prototype.isDroppedColumn=function(t){return this._droppedColumns.has(t)},t.prototype.hasWhere=function(){return!(0,i.default)(this._where)},Object.defineProperty(t.prototype,"where",{get:function(){return this._where},set:function(t){this._where=t},enumerable:!1,configurable:!0}),t}();e.TableMapping=l},8140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseExtension=void 0;var r=n(624),i=function(){function t(t){this.geoPackage=t,this.connection=t.connection,this.extensionsDao=t.extensionDao}return t.prototype.getOrCreate=function(t,e,n,r,i){var o=this.getExtension(t,e,n);return o.length?o[0]:(this.extensionsDao.createTable(),this.createExtension(t,e,n,r,i),this.getExtension(t,e,n)[0])},t.prototype.getExtension=function(t,e,n){return this.extensionsDao.isTableExists()?this.extensionsDao.queryByExtensionAndTableNameAndColumnName(t,e,n):[]},t.prototype.hasExtension=function(t,e,n){return!!this.getExtension(t,e,n).length},t.prototype.hasExtensions=function(t){return 0!==this.extensionsDao.queryAllByExtension(t).length},t.prototype.createExtension=function(t,e,n,i,o){var a=new r.Extension;return a.table_name=e,a.column_name=n,a.extension_name=t,a.definition=i,a.scope=o,this.extensionsDao.create(a)},t}();e.BaseExtension=i},4650:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsId=void 0;e.ContentsId=function(){}},7092:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsIdDao=void 0;var o=n(4115),a=n(4650),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=["id"],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.ContentsId;return t&&(e.id=t.id,e.table_name=t.table_name),e},e.prototype.createTable=function(){return this.geoPackage.getTableCreator().createContentsId()},e.prototype.getTableNames=function(){for(var t=[],e=this.queryForColumns("table_name"),n=0;n<e.length;n++)t.push(e[n].table_name);return t},e.prototype.queryForTableName=function(t){var n=this.queryForAll(this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t),this.buildWhereArgs(t));return n.length>0?n[0]:null},e.prototype.deleteByTableName=function(t){return this.deleteWhere(this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t),this.buildWhereArgs(t))},e.TABLE_NAME="nga_contents_id",e.COLUMN_ID="id",e.COLUMN_TABLE_NAME="table_name",e}(o.Dao);e.ContentsIdDao=s},1314:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsIdExtension=void 0;var o=n(8140),a=n(624),s=n(7092),u=n(6638),l=function(t){function e(e){var n=t.call(this,e)||this;return n.contentsIdDao=e.contentsIdDao,n}return i(e,t),e.prototype.getOrCreateExtension=function(){var t=this.getOrCreate(e.EXTENSION_NAME,null,null,e.EXTENSION_DEFINITION,a.Extension.READ_WRITE);return this.contentsIdDao.createTable(),t},Object.defineProperty(e.prototype,"dao",{get:function(){return this.contentsIdDao},enumerable:!1,configurable:!0}),e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,null,null)&&this.contentsIdDao.isTableExists()},e.prototype.get=function(t){var e=null;return t&&t.table_name&&(e=this.getByTableName(t.table_name)),e},e.prototype.getByTableName=function(t){var e=null;return this.contentsIdDao.isTableExists()&&(e=this.contentsIdDao.queryForTableName(t)),e},e.prototype.getId=function(t){var e=null;return t&&t.table_name&&(e=this.getIdByTableName(t.table_name)),e},e.prototype.getIdByTableName=function(t){var e=null;if(this.contentsIdDao.isTableExists()){var n=this.contentsIdDao.queryForTableName(t);n&&(e=n.id)}return e},e.prototype.create=function(t){var e=null;return t&&t.table_name&&(e=this.createWithTableName(t.table_name)),e},e.prototype.createWithTableName=function(t){var e=this.contentsIdDao.createObject();return e.table_name=t,e.id=this.contentsIdDao.create(e),e},e.prototype.createId=function(t){var e=null;return t&&t.table_name&&(e=this.createIdWithTableName(t.table_name)),e},e.prototype.createIdWithTableName=function(t){return this.createWithTableName(t)},e.prototype.getOrCreateId=function(t){var e=null;return t&&t.table_name&&(e=this.getOrCreateIdByTableName(t.table_name)),e},e.prototype.getOrCreateIdByTableName=function(t){var e=this.getByTableName(t);return null==e&&(e=this.createWithTableName(t)),e},e.prototype.deleteId=function(t){var e=0;return t&&t.table_name&&(e=this.deleteIdByTableName(t.table_name)),e},e.prototype.deleteIdByTableName=function(t){return this.contentsIdDao.deleteByTableName(t)},e.prototype.count=function(){var t=0;return this.has()&&(t=this.contentsIdDao.count()),t},e.prototype.createIds=function(t){void 0===t&&(t="");for(var e=this.getMissing(t),n=0;n<e.length;n++)this.getOrCreateIdByTableName(e[n].table_name);return e.length},e.prototype.deleteIds=function(t){void 0===t&&(t="");var e=0;if(this.has())if(0===t.length)e=this.contentsIdDao.deleteAll();else for(var n=this.getIdsByType(t),r=0;r<n.length;r++)e+=this.contentsIdDao.deleteById(n[r].id);return e},e.prototype.getIdsByType=function(t){void 0===t&&(t="");var e=[];if(this.has()){var n="SELECT ";n+=s.ContentsIdDao.COLUMN_ID,n+=", ",n+=s.ContentsIdDao.COLUMN_TABLE_NAME,n+=" FROM "+s.ContentsIdDao.TABLE_NAME,n+=" WHERE ",n+=s.ContentsIdDao.COLUMN_TABLE_NAME,n+=" IN (SELECT ",n+=u.ContentsDao.COLUMN_TABLE_NAME,n+=" FROM ",n+=u.ContentsDao.TABLE_NAME;var r="",i=[];null!=t&&t.length>0&&(r+=u.ContentsDao.COLUMN_DATA_TYPE,r+=" = ?",i.push(t)),r.length>0&&(n+=" WHERE "+r),n+=")",e=this.connection.all(n,i)}return e},e.prototype.getMissing=function(t){void 0===t&&(t="");var e="SELECT "+u.ContentsDao.COLUMN_TABLE_NAME+" FROM "+u.ContentsDao.TABLE_NAME,n="",r=[];return null!=t&&t.length>0&&(n+=u.ContentsDao.COLUMN_DATA_TYPE,n+=" = ?",r.push(t)),this.has()&&(n.length>0&&(n+=" AND "),n+=u.ContentsDao.COLUMN_TABLE_NAME,n+=" NOT IN (SELECT ",n+=s.ContentsIdDao.COLUMN_TABLE_NAME,n+=" FROM ",n+=s.ContentsIdDao.TABLE_NAME,n+=")"),n.length>0&&(e+=" WHERE "+n),this.connection.all(e,r)},e.prototype.removeExtension=function(){this.contentsIdDao.isTableExists()&&this.geoPackage.deleteTable(s.ContentsIdDao.TABLE_NAME),this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)},e.EXTENSION_NAME="nga_contents_id",e.EXTENSION_AUTHOR="nga",e.EXTENSION_NAME_NO_AUTHOR="contents_id",e.EXTENSION_DEFINITION="http://ngageoint.github.io/GeoPackage/docs/extensions/contents-id.html",e}(o.BaseExtension);e.ContentsIdExtension=l},5306:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CrsWktExtension=void 0;var o=n(624),a=function(t){function e(n){var r=t.call(this,n)||this;return r.extensionName=e.EXTENSION_NAME,r.extensionDefinition=e.EXTENSION_CRS_WKT_DEFINITION,r}return i(e,t),e.prototype.getOrCreateExtension=function(){return this.getOrCreate(this.extensionName,null,null,this.extensionDefinition,o.Extension.READ_WRITE)},e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,null,null)},e.prototype.removeExtension=function(){try{this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)}catch(t){throw new Error("Failed to delete CrsWkt extension. GeoPackage: "+this.geoPackage.name)}},e.EXTENSION_NAME="gpkg_crs_wkt",e.EXTENSION_CRS_WKT_AUTHOR="gpkg",e.EXTENSION_CRS_WKT_NAME_NO_AUTHOR="crs_wkt",e.EXTENSION_CRS_WKT_DEFINITION="http://www.geopackage.org/spec/#extension_crs_wkt",e}(n(8140).BaseExtension);e.CrsWktExtension=a},624:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extension=void 0;var n=function(){function t(){}return t.prototype.setExtensionName=function(e,n){this.extension_name=t.buildExtensionName(e,n)},Object.defineProperty(t.prototype,"author",{get:function(){return t.getAuthorWithExtensionName(this.extension_name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensionNameNoAuthor",{get:function(){return t.getExtensionNameNoAuthor(this.extension_name)},enumerable:!1,configurable:!0}),t.buildExtensionName=function(e,n){return e+t.EXTENSION_NAME_DIVIDER+n},t.getAuthorWithExtensionName=function(e){return e.split(t.EXTENSION_NAME_DIVIDER)[0]},t.getExtensionNameNoAuthor=function(e){return e.slice(e.indexOf(t.EXTENSION_NAME_DIVIDER)+1)},t.prototype.getTableName=function(){return this.table_name},t.prototype.setTableName=function(t){this.table_name=t,null==t&&(this.column_name=null)},t.EXTENSION_NAME_DIVIDER="_",t.READ_WRITE="read-write",t.WRITE_ONLY="write-only",t}();e.Extension=n},5698:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionDao=void 0;var a=n(624),s=n(4115),u=n(8572),l=n(1459),c=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_TABLE_NAME,e.COLUMN_COLUMN_NAME,e.COLUMN_EXTENSION_NAME],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.Extension;return e.table_name=t.table_name,e.column_name=t.column_name,e.extension_name=t.extension_name,e.definition=t.definition,e.scope=t.scope,e},e.prototype.queryByExtension=function(t){var n=this.queryForAllEq(e.COLUMN_EXTENSION_NAME,t);if(n[0])return this.createObject(n[0])},e.prototype.queryAllByExtension=function(t){var n,r,i=[];try{for(var a=o(this.queryForAllEq(e.COLUMN_EXTENSION_NAME,t)),s=a.next();!s.done;s=a.next()){var u=s.value,l=this.createObject(u);i.push(l)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.queryByExtensionAndTableName=function(t,n){var r,i,a=new u.ColumnValues;a.addColumn(e.COLUMN_EXTENSION_NAME,t),a.addColumn(e.COLUMN_TABLE_NAME,n);var s=[];try{for(var l=o(this.queryForFieldValues(a)),c=l.next();!c.done;c=l.next()){var h=c.value;s.push(this.createObject(h))}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s},e.prototype.queryByExtensionAndTableNameAndColumnName=function(t,n,r){var i,a,s=new u.ColumnValues;s.addColumn(e.COLUMN_EXTENSION_NAME,t),null!=n&&s.addColumn(e.COLUMN_TABLE_NAME,n),null!=r&&s.addColumn(e.COLUMN_COLUMN_NAME,r);var l=[];try{for(var c=o(this.queryForFieldValues(s)),h=c.next();!h.done;h=c.next()){var f=h.value,p=this.createObject(f);l.push(p)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}return l},e.prototype.createTable=function(){return new l.TableCreator(this.geoPackage).createExtensions()},e.prototype.deleteByExtension=function(t){var n=new u.ColumnValues;return n.addColumn(e.COLUMN_EXTENSION_NAME,t),this.deleteWhere(this.buildWhere(n,"="),this.buildWhereArgs(n))},e.prototype.deleteByExtensionAndTableName=function(t,n){var r=new u.ColumnValues;return r.addColumn(e.COLUMN_EXTENSION_NAME,t),r.addColumn(e.COLUMN_TABLE_NAME,n),this.deleteWhere(this.buildWhere(r,"and"),this.buildWhereArgs(r))},e.prototype.deleteByExtensionAndTableNameAndColumnName=function(t,n,r){var i=new u.ColumnValues;return i.addColumn(e.COLUMN_EXTENSION_NAME,t),i.addColumn(e.COLUMN_TABLE_NAME,n),i.addColumn(e.COLUMN_COLUMN_NAME,r),this.deleteWhere(this.buildWhere(i,"and"),this.buildWhereArgs(i))},e.TABLE_NAME="gpkg_extensions",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_EXTENSION_NAME="extension_name",e.COLUMN_DEFINITION="definition",e.COLUMN_SCOPE="scope",e}(s.Dao);e.ExtensionDao=c},9406:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageExtensions=void 0;var i=n(6131),o=n(5859),a=n(1832),s=n(5045),u=n(5042),l=n(362),c=n(8314),h=n(2431),f=n(8904),p=n(8116),d=n(4941),y=n(1459),m=n(1133),g=n(3501),_=n(2056),b=n(5306),v=function(){function t(){}return t.deleteTableExtensions=function(e,n){i.NGAExtensions.deleteTableExtensions(e,n),t.deleteRTreeSpatialIndex(e,n),t.deleteRelatedTables(e,n),t.deleteSchema(e,n),t.deleteMetadata(e,n),t.deleteExtensionForTable(e,n)},t.deleteExtensions=function(t){i.NGAExtensions.deleteExtensions(t),this.deleteRTreeSpatialIndexExtension(t),this.deleteRelatedTablesExtension(t),this.deleteSchemaExtension(t),this.deleteMetadataExtension(t),this.deleteCrsWktExtension(t),this.delete(t)},t.copyTableExtensions=function(e,n,o){try{t.copyRTreeSpatialIndex(e,n,o),t.copyRelatedTables(e,n,o),t.copySchema(e,n,o),t.copyMetadata(e,n,o),i.NGAExtensions.copyTableExtensions(e,n,o)}catch(t){r.warn("Failed to copy extensions for table: "+o+", copied from table: "+n,t)}},t.deleteExtensionForTable=function(t,e){var n=t.extensionDao;try{n.isTableExists()&&n.deleteByExtension(e)}catch(n){throw new Error("Failed to delete Table extensions. GeoPackage: "+t.name+", Table: "+e)}},t.delete=function(t){var e=t.extensionDao;try{e.isTableExists()&&t.dropTable(e.gpkgTableName)}catch(e){throw new Error("Failed to delete all extensions. GeoPackage: "+t.name)}},t.deleteRTreeSpatialIndex=function(e,n){var r=t.getRTreeIndexExtension(e);r.has(n)&&r.deleteTable(n)},t.deleteRTreeSpatialIndexExtension=function(e){var n=t.getRTreeIndexExtension(e);n.has()&&n.deleteAll()},t.copyRTreeSpatialIndex=function(e,n,i){try{var o=t.getRTreeIndexExtension(e);if(o.has(n)){var a=e.geometryColumnsDao.queryForTableName(i);if(null!=a){var u=s.TableInfo.info(e.connection,i);if(null!=u){var l=u.getPrimaryKey().getName();o.createWithParameters(i,a.column_name,l)}}}}catch(t){r.warn("Failed to create RTree for table: "+i+", copied from table: "+n,t)}},t.getRTreeIndexExtension=function(t){return new o.RTreeIndex(t,null)},t.deleteRelatedTables=function(e,n){var r=t.getRelatedTableExtension(e);r.has()&&r.removeRelationships(n)},t.deleteRelatedTablesExtension=function(e){var n=t.getRelatedTableExtension(e);n.has()&&n.removeExtension()},t.copyRelatedTables=function(e,n,i){try{var o=t.getRelatedTableExtension(e);if(o.has()){var p=o.extendedRelationDao,d=e.extensionDao;p.getBaseTableRelations(n).forEach((function(t){var r=t.mapping_table_name,o=d.queryByExtensionAndTableName(a.RelatedTablesExtension.EXTENSION_NAME,r).concat(d.queryByExtensionAndTableName(a.RelatedTablesExtension.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR,r));if(o.length>0){var p=u.CoreSQLUtils.createName(e.connection,r,n,i),y=new l.UserCustomTableReader(r).readTable(e.connection);c.AlterTable.copyTable(e.connection,y,p);var m=o[0];m.setTableName(p),d.create(m);var g=h.TableMapping.fromTableInfo(s.TableInfo.info(e.connection,f.ExtendedRelationDao.TABLE_NAME));g.removeColumn(f.ExtendedRelationDao.ID);var _=g.getColumn(f.ExtendedRelationDao.BASE_TABLE_NAME);_.constantValue=i,_.whereValue=n;var b=g.getColumn(f.ExtendedRelationDao.MAPPING_TABLE_NAME);b.constantValue=p,b.whereValue=r,u.CoreSQLUtils.transferTableContentForTableMapping(e.connection,g)}}))}}catch(t){r.warn("Failed to create Related Tables for table: "+i+", copied from table: "+n,t)}},t.getRelatedTableExtension=function(t){return new a.RelatedTablesExtension(t)},t.deleteSchema=function(t,e){var n=t.dataColumnsDao;try{n.isTableExists()&&n.deleteByTableName(e)}catch(n){throw new Error("Failed to delete Schema extension. GeoPackage: "+t.name+", Table: "+e)}},t.deleteSchemaExtension=function(t){var e=new p.SchemaExtension(t);e.has()&&e.removeExtension()},t.copySchema=function(t,e,n){try{if(t.isTable(d.DataColumnsDao.TABLE_NAME)){var i=new l.UserCustomTableReader(d.DataColumnsDao.TABLE_NAME).readUserCustomTable(t),o=i.getColumnWithColumnName(d.DataColumnsDao.COLUMN_NAME);if(o.hasConstraints()){if(o.clearConstraints(),i.hasConstraints()){i.clearConstraints();var a=y.TableCreator.tableCreationScripts.data_columns[0],s=m.ConstraintParser.getConstraints(a);i.addConstraints(s.getTableConstraints())}c.AlterTable.alterColumnForTable(t.connection,i,o)}u.CoreSQLUtils.transferTableContent(t.connection,d.DataColumnsDao.TABLE_NAME,d.DataColumnsDao.COLUMN_TABLE_NAME,n,e)}}catch(t){r.warn("Failed to create Schema for table: "+n+", copied from table: "+e,t)}},t.deleteMetadata=function(t,e){var n=t.metadataReferenceDao;try{n.isTableExists()&&n.deleteByTableName(e)}catch(n){throw new Error("Failed to delete Metadata extension. GeoPackage: "+t.name+", Table: "+e)}},t.deleteMetadataExtension=function(t){var e=new g.MetadataExtension(t);e.has()&&e.removeExtension()},t.copyMetadata=function(t,e,n){try{t.isTable(_.MetadataReferenceDao.TABLE_NAME)&&u.CoreSQLUtils.transferTableContent(t.connection,_.MetadataReferenceDao.TABLE_NAME,_.MetadataReferenceDao.COLUMN_TABLE_NAME,n,e)}catch(t){r.warn("Failed to create Metadata for table: "+n+", copied from table: "+e,t)}},t.deleteCrsWktExtension=function(t){var e=new b.CrsWktExtension(t);e.has()&&e.removeExtension()},t}();e.GeoPackageExtensions=v},5626:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTableIndex=void 0;var s=n(5859),u=n(8140),l=n(624),c=n(7049),h=n(9095),f=n(735),p=n(1895),d=function(t){function e(n,r){var i=t.call(this,n)||this;return i.featureDao=r,i.extensionName=e.EXTENSION_NAME,i.extensionDefinition=e.EXTENSION_GEOMETRY_INDEX_DEFINITION,i.tableName=r.table_name,i.columnName=r.getGeometryColumnName(),i.tableIndexDao=n.tableIndexDao,i.geometryIndexDao=n.getGeometryIndexDao(r),i.rtreeIndexDao=new f.RTreeIndexDao(n,r),i.rtreeIndexDao.gpkgTableName="rtree_"+i.tableName+"_"+i.columnName,i.rtreeIndex=new s.RTreeIndex(n,r),i.rtreeIndexed=i.hasExtension("gpkg_rtree_index",i.tableName,i.columnName),i}return i(e,t),e.prototype.index=function(t){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this.indexWithForce(!1,t)]}))}))},e.prototype.indexWithForce=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){return e=e||function(){},this.progress=function(t){setTimeout(e,0,t)},(n=this.isIndexed())&&!t||((r=new s.RTreeIndex(this.geoPackage,this.featureDao)).create(),this.rtreeIndexed=r.hasExtension(r.extensionName,r.tableName,r.columnName),n=this.isIndexed()),n?[2,n]:(this.getOrCreateExtension(),i=this.getOrCreateTableIndex(),this.createOrClearGeometryIndicies(),[2,this.indexTable(i)])}))}))},e.prototype.ngaIndexWithForce=function(t,e){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return e=e||function(){},this.progress=function(t){setTimeout(e,0,t)},(n=this.isIndexed(!0))&&!t?[3,2]:[4,new s.RTreeIndex(this.geoPackage,this.featureDao).create()];case 1:i.sent(),i.label=2;case 2:return n&&!t?[3,5]:(this.getOrCreateExtension(),[4,this.getOrCreateTableIndex()]);case 3:return r=i.sent(),[4,this.createOrClearGeometryIndicies()];case 4:return i.sent(),[2,this.indexTable(r)];case 5:return[2,n]}}))}))},e.prototype.isIndexed=function(t){if(void 0===t&&(t=!1),!t){var e=new s.RTreeIndex(this.geoPackage,this.featureDao);if(this.rtreeIndexed=e.hasExtension(e.extensionName,e.tableName,e.columnName),this.rtreeIndexed)return!0}try{if(this.getFeatureTableIndexExtension()){var n=this.geoPackage.contentsDao.queryForId(this.tableName);if(!n)return!1;var r=new Date(n.last_change),i=this.tableIndexDao.queryForId(this.tableName);return!(!i||!i.last_indexed)&&new Date(i.last_indexed)>=r}return!1}catch(t){return!1}},e.prototype.getFeatureTableIndexExtension=function(){return this.getExtension(this.extensionName,this.tableName,this.columnName)[0]},e.prototype.getOrCreateExtension=function(){return this.getOrCreate(this.extensionName,this.tableName,this.columnName,this.extensionDefinition,l.Extension.READ_WRITE)},e.prototype.getOrCreateTableIndex=function(){return this.tableIndex||(this.tableIndexDao.createTable(),this.createTableIndex(),this.tableIndex)},e.prototype.createTableIndex=function(){var t=new c.TableIndex;return t.table_name=this.tableName,t.last_indexed=new Date,this.tableIndexDao.create(t)},Object.defineProperty(e.prototype,"tableIndex",{get:function(){return this.tableIndexDao.isTableExists()?this.tableIndexDao.queryForId(this.tableName):void 0},enumerable:!1,configurable:!0}),e.prototype.createOrClearGeometryIndicies=function(){return this.geometryIndexDao.createTable(),this.clearGeometryIndicies()},e.prototype.clearGeometryIndicies=function(){var t=this.geometryIndexDao.buildWhereWithFieldAndValue(h.GeometryIndexDao.COLUMN_TABLE_NAME,this.tableName),e=this.geometryIndexDao.buildWhereArgs(this.tableName);return this.geometryIndexDao.deleteWhere(t,e)},e.prototype.indexTable=function(t){return o(this,void 0,void 0,(function(){var e=this;return a(this,(function(n){return[2,new Promise((function(n,r){setTimeout((function(){e.indexChunk(0,t,n,r)}))})).then((function(){return 1===e.updateLastIndexed(t)}))]}))}))},e.prototype.indexChunk=function(t,e,n,r){var i=this,o=this.featureDao.queryForChunk(100,t);o.length?(this.progress("Indexing "+100*t+" to "+100*(t+1)),o.forEach((function(t){var n=i.featureDao.getRow(t);i.indexRow(e,n.id,n.geometry)})),setTimeout((function(){i.indexChunk(++t,e,n,r)}))):n()},e.prototype.indexRow=function(t,e,n){if(!n)return!1;var r=n.envelope;if(!r){var i=n.geometry;i&&(r=p.EnvelopeBuilder.buildEnvelopeWithGeometry(i))}if(r){var o=this.geometryIndexDao.populate(t,e,r);return 1===this.geometryIndexDao.createOrUpdate(o)}return!1},e.prototype.updateLastIndexed=function(t){return t||((t=new c.TableIndex).table_name=this.tableName),t.last_indexed=(new Date).toISOString(),this.tableIndexDao.createOrUpdate(t)},e.prototype.queryWithBoundingBox=function(t,e){var n=t.projectBoundingBox(e,this.featureDao.projection).buildEnvelope();return this.queryWithGeometryEnvelope(n)},e.prototype.queryWithGeometryEnvelope=function(t){return this.rtreeIndexed?this.rtreeIndexDao.queryWithGeometryEnvelope(t):this.geometryIndexDao.queryWithGeometryEnvelope(t)},e.prototype.countWithBoundingBox=function(t,e){var n=t.projectBoundingBox(e,this.featureDao.projection).buildEnvelope();return this.countWithGeometryEnvelope(n)},e.prototype.countWithGeometryEnvelope=function(t){return this.rtreeIndexed?this.rtreeIndexDao.countWithGeometryEnvelope(t):this.geometryIndexDao.countWithGeometryEnvelope(t)},e.EXTENSION_GEOMETRY_INDEX_AUTHOR="nga",e.EXTENSION_GEOMETRY_INDEX_NAME_NO_AUTHOR="geometry_index",e.EXTENSION_NAME=l.Extension.buildExtensionName(e.EXTENSION_GEOMETRY_INDEX_AUTHOR,e.EXTENSION_GEOMETRY_INDEX_NAME_NO_AUTHOR),e.EXTENSION_GEOMETRY_INDEX_DEFINITION="http://ngageoint.github.io/GeoPackage/docs/extensions/geometry-index.html",e}(u.BaseExtension);e.FeatureTableIndex=d},8021:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryIndex=void 0;var n=function(){function t(){}return Object.defineProperty(t.prototype,"tableIndex",{set:function(t){this.table_name=t.table_name},enumerable:!1,configurable:!0}),t}();e.GeometryIndex=n},9095:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryIndexDao=void 0;var o=n(4115),a=n(8021),s=n(1459),u=function(t){function e(n,r){var i=t.call(this,n)||this;return i.gpkgTableName=e.TABLE_NAME,i.idColumns=["table_name","geom_id"],i.featureDao=r,i}return i(e,t),e.prototype.createObject=function(t){var e=new a.GeometryIndex;return t&&(e.table_name=t.table_name,e.geom_id=t.geom_id,e.min_x=t.min_x,e.max_x=t.max_x,e.min_y=t.min_y,e.max_y=t.max_y,e.min_z=t.min_z,e.max_z=t.max_z,e.min_m=t.min_m,e.max_m=t.max_m),e},e.prototype.getTableIndex=function(t){return this.geoPackage.tableIndexDao.queryForId(t.table_name)},e.prototype.queryForTableName=function(t){return this.queryForEach(e.COLUMN_TABLE_NAME,t)},e.prototype.countByTableName=function(t){return this.count(e.COLUMN_TABLE_NAME,t)},e.prototype.populate=function(t,e,n){var r=new a.GeometryIndex;return r.tableIndex=t,r.geom_id=e,r.min_x=n.minX,r.min_y=n.minY,r.max_x=n.maxX,r.max_y=n.maxY,n.hasZ&&(r.min_z=n.minZ,r.max_z=n.maxZ),n.hasM&&(r.min_m=n.minM,r.max_m=n.maxM),r},e.prototype.createTable=function(){return!!this.isTableExists()||new s.TableCreator(this.geoPackage).createGeometryIndex()},e.prototype._generateGeometryEnvelopeQuery=function(t){var n=this.featureDao.gpkgTableName,r="";r+=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,n),r+=" and ";var i=t.minX<t.maxX;i?(r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_X,t.maxX,"<="),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_X,t.minX,">=")):(r+="(",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_X,t.maxX,"<="),r+=" or ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_X,t.minX,">="),r+=" or ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_X,t.minX,">="),r+=" or ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_X,t.maxX,"<="),r+=")"),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_Y,t.maxY,"<="),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_Y,t.minY,">=");var o=[n,t.maxX,t.minX];return i||o.push(t.minX,t.maxX),o.push(t.maxY,t.minY),t.hasZ&&(r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_Z,t.minZ,"<="),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_Z,t.maxZ,">="),o.push(t.maxZ,t.minZ)),t.hasM&&(r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_M,t.minM,"<="),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_M,t.maxM,">="),o.push(t.maxM,t.minM)),{join:'inner join "'+n+'" on "'+n+'".'+this.featureDao.idColumns[0]+" = "+e.COLUMN_GEOM_ID,where:r,whereArgs:o,tableNameArr:['"'+n+'".*']}},e.prototype.queryWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.queryJoinWhereWithArgs(e.join,e.where,e.whereArgs,e.tableNameArr)},e.prototype.countWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.countJoinWhereWithArgs(e.join,e.where,e.whereArgs)},e.TABLE_NAME="nga_geometry_index",e.COLUMN_TABLE_NAME=e.TABLE_NAME+".table_name",e.COLUMN_TABLE_NAME_FIELD="table_name",e.COLUMN_GEOM_ID=e.TABLE_NAME+".geom_id",e.COLUMN_MIN_X=e.TABLE_NAME+".min_x",e.COLUMN_MAX_X=e.TABLE_NAME+".max_x",e.COLUMN_MIN_Y=e.TABLE_NAME+".min_y",e.COLUMN_MAX_Y=e.TABLE_NAME+".max_y",e.COLUMN_MIN_Z=e.TABLE_NAME+".min_z",e.COLUMN_MAX_Z=e.TABLE_NAME+".max_z",e.COLUMN_MIN_M=e.TABLE_NAME+".min_m",e.COLUMN_MAX_M=e.TABLE_NAME+".max_m",e}(o.Dao);e.GeometryIndexDao=u},7049:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableIndex=void 0;e.TableIndex=function(){}},9581:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TableIndexDao=void 0;var o=n(4115),a=n(1459),s=n(7049),u=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_TABLE_NAME],n}return i(e,t),e.prototype.createObject=function(t){var e=new s.TableIndex;return t&&(e.table_name=t.table_name,e.last_indexed=t.last_indexed),e},e.prototype.createTable=function(){return new a.TableCreator(this.geoPackage).createTableIndex()},e.TABLE_NAME="nga_table_index",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_LAST_INDEXED="last_indexed",e}(o.Dao);e.TableIndexDao=u},3501:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataExtension=void 0;var o=n(8140),a=n(624),s=n(2056),u=n(663),l=function(t){function e(n){var r=t.call(this,n)||this;return r.extensionName=e.EXTENSION_NAME,r.extensionDefinition=e.EXTENSION_Metadata_DEFINITION,r}return i(e,t),e.prototype.getOrCreateExtension=function(){return this.getOrCreate(this.extensionName,null,null,this.extensionDefinition,a.Extension.READ_WRITE)},e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,null,null)},e.prototype.removeExtension=function(){this.geoPackage.isTable(s.MetadataReferenceDao.TABLE_NAME)&&this.geoPackage.dropTable(s.MetadataReferenceDao.TABLE_NAME),this.geoPackage.isTable(u.MetadataDao.TABLE_NAME)&&this.geoPackage.dropTable(u.MetadataDao.TABLE_NAME);try{this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)}catch(t){throw new Error("Failed to delete Schema extension. GeoPackage: "+this.geoPackage.name)}},e.EXTENSION_NAME="gpkg_metadata",e.EXTENSION_Metadata_AUTHOR="gpkg",e.EXTENSION_Metadata_NAME_NO_AUTHOR="metadata",e.EXTENSION_Metadata_DEFINITION="http://www.geopackage.org/spec/#extension_metadata",e}(o.BaseExtension);e.MetadataExtension=l},6131:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.NGAExtensions=void 0;var i=n(5626),o=n(9095),a=n(9581),s=n(5042),u=n(7960),l=n(7523),c=n(8479),h=n(1832),f=n(1314),p=n(362),d=n(8314),y=n(2431),m=n(233),g=n(8904),_=n(5045),b=n(7092),v=function(){function t(){}return t.deleteTableExtensions=function(e,n){t.deleteGeometryIndex(e,n),t.deleteTileScaling(e,n),t.deleteFeatureStyle(e,n),t.deleteContentsId(e,n)},t.deleteExtensions=function(e){t.deleteGeometryIndexExtension(e),t.deleteTileScalingExtension(e),t.deleteFeatureStyleExtension(e),t.deleteContentsIdExtension(e)},t.copyTableExtensions=function(e,n,i){try{t.copyContentsId(e,n,i),t.copyFeatureStyle(e,n,i),t.copyTileScaling(e,n,i),t.copyGeometryIndex(e,n,i)}catch(t){r.warn("Failed to copy extensions for table: "+i+", copied from table: "+n,t)}},t.deleteGeometryIndex=function(t,e){var n=t.getGeometryIndexDao(null),r=t.tableIndexDao,s=t.extensionDao;try{n.isTableExists()&&n.deleteWhere(n.buildWhereWithFieldAndValue(o.GeometryIndexDao.COLUMN_TABLE_NAME_FIELD,e),n.buildWhereArgs(e)),r.isTableExists()&&r.deleteWhere(r.buildWhereWithFieldAndValue(a.TableIndexDao.COLUMN_TABLE_NAME,e),r.buildWhereArgs(e)),s.isTableExists()&&s.deleteByExtensionAndTableName(i.FeatureTableIndex.EXTENSION_NAME,e)}catch(n){throw new Error("Failed to delete Table Index. GeoPackage: "+t.name+", Table: "+e)}},t.deleteGeometryIndexExtension=function(t){var e=t.getGeometryIndexDao(null),n=t.tableIndexDao,r=t.extensionDao;try{e.isTableExists()&&t.dropTable(o.GeometryIndexDao.TABLE_NAME),n.isTableExists()&&t.dropTable(a.TableIndexDao.TABLE_NAME),r.isTableExists()&&r.deleteByExtension(i.FeatureTableIndex.EXTENSION_NAME)}catch(e){throw new Error("Failed to delete Table Index extension and tables. GeoPackage: "+t.name)}},t.copyGeometryIndex=function(t,e,n){try{var a=t.extensionDao;if(a.isTableExists()){var u=a.queryByExtensionAndTableName(i.FeatureTableIndex.EXTENSION_NAME,e);if(u.length>0){var l=u[0];l.table_name=n,a.create(l);var c=t.tableIndexDao;if(c.isTableExists()){var h=c.queryForId(e);null!=h&&(h.table_name=n,c.create(h),t.isTable(o.GeometryIndexDao.TABLE_NAME)&&s.CoreSQLUtils.transferTableContent(t.connection,o.GeometryIndexDao.TABLE_NAME,o.GeometryIndexDao.COLUMN_TABLE_NAME_FIELD,n,e))}}}}catch(t){r.warn("Failed to create Geometry Index for table: "+n+", copied from table: "+e,t)}},t.deleteTileScaling=function(t,e){var n=t.tileScalingDao,r=t.extensionDao;try{n.isTableExists()&&n.deleteByTableName(e),r.isTableExists()&&r.deleteByExtensionAndTableName(l.TileScalingExtension.EXTENSION_NAME,e)}catch(n){throw new Error("Failed to delete Tile Scaling. GeoPackage: "+t.name+", Table: "+e)}},t.deleteTileScalingExtension=function(t){var e=t.tileScalingDao,n=t.extensionDao;try{e.isTableExists()&&t.dropTable(e.gpkgTableName),n.isTableExists()&&n.deleteByExtension(l.TileScalingExtension.EXTENSION_NAME)}catch(e){throw new Error("Failed to delete Tile Scaling extension and table. GeoPackage: "+t.name)}},t.copyTileScaling=function(t,e,n){try{var i=new l.TileScalingExtension(t,e);if(i.has()){var o=i.getOrCreateExtension();null!=o&&(o.setTableName(n),i.extensionsDao.create(o),t.isTable(u.TileScalingDao.TABLE_NAME)&&s.CoreSQLUtils.transferTableContent(t.connection,u.TileScalingDao.TABLE_NAME,u.TileScalingDao.COLUMN_TABLE_NAME,n,e))}}catch(t){r.warn("Failed to create Tile Scaling for table: "+n+", copied from table: "+e,t)}},t.deleteFeatureStyle=function(e,n){var r=t.getFeatureStyleExtension(e);r.has(n)&&r.deleteRelationships(n)},t.deleteFeatureStyleExtension=function(e){var n=t.getFeatureStyleExtension(e);n.has(null)&&n.removeExtension()},t.copyFeatureStyle=function(e,n,i){try{var o=t.getFeatureStyleExtension(e);if(o.hasRelationship(n)){var a=o.getOrCreateExtension(n);if(null!=a){a.setTableName(i),o.extensionsDao.create(a);var s=o.getContentsId(),u=s.getIdByTableName(n),l=s.getIdByTableName(i);null!=u&&null!=l&&(o.hasTableStyleRelationship(n)&&t.copyFeatureTableStyle(o,c.FeatureStyleExtension.TABLE_MAPPING_TABLE_STYLE,n,i,u,l),o.hasTableIconRelationship(n)&&t.copyFeatureTableStyle(o,c.FeatureStyleExtension.TABLE_MAPPING_TABLE_ICON,n,i,u,l))}}}catch(t){r.warn("Failed to create Feature Style for table: "+i+", copied from table: "+n,t)}},t.copyFeatureTableStyle=function(t,e,n,r,i,o){var a=t.geoPackage,u=t.getMappingTableName(e,n),l=a.extensionDao,c=l.queryByExtensionAndTableName(h.RelatedTablesExtension.EXTENSION_NAME,u).concat(l.queryByExtensionAndTableName(h.RelatedTablesExtension.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR,u));if(c.length>0){var f=t.getMappingTableName(e,r),v=new p.UserCustomTableReader(u).readTable(a.connection);d.AlterTable.copyTable(a.connection,v,f,!1);var T=new y.TableMapping(v.getTableName(),f,v.getUserColumns().getColumns()),E=T.getColumn(m.UserMappingTable.COLUMN_BASE_ID);E.constantValue=o,E.whereValue=i,s.CoreSQLUtils.transferTableContentForTableMapping(a.connection,T);var w=c[0];w.setTableName(f),l.create(w);var x=y.TableMapping.fromTableInfo(_.TableInfo.info(a.connection,g.ExtendedRelationDao.TABLE_NAME));x.removeColumn(g.ExtendedRelationDao.ID),x.getColumn(g.ExtendedRelationDao.BASE_TABLE_NAME).whereValue=b.ContentsIdDao.TABLE_NAME;var C=x.getColumn(g.ExtendedRelationDao.MAPPING_TABLE_NAME);C.constantValue=f,C.whereValue=u,s.CoreSQLUtils.transferTableContentForTableMapping(a.connection,x)}},t.getFeatureStyleExtension=function(t){return new c.FeatureStyleExtension(t)},t.deleteContentsId=function(t,e){var n=new f.ContentsIdExtension(t);n.has()&&n.deleteIdByTableName(e)},t.deleteContentsIdExtension=function(t){var e=new f.ContentsIdExtension(t);e.has()&&e.removeExtension()},t.copyContentsId=function(t,e,n){try{var i=new f.ContentsIdExtension(t);if(i.has())null!=i.getByTableName(e)&&i.createWithTableName(n)}catch(t){r.warn("Failed to create Contents Id for table: "+n+", copied from table: "+e,t)}},t}();e.NGAExtensions=v},3096:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DublinCoreMetadata=void 0;var r=n(2224),i=function(){function t(){}return t.hasColumn=function(t,e){var n,i=(n=t instanceof r.UserRow?t.table:t).hasColumn(e.name);if(!n.hasColumn(e.name)){var o=e.synonyms;if(o)for(var a=0;a<o.length&&!(i=n.hasColumn(o[a]));a++);}return i},t.getColumn=function(t,e){var n,i,o=(n=t instanceof r.UserRow?t.table:t).hasColumn(e.name);if(o)i=n.getColumnWithColumnName(e.name);else{var a=e.synonyms;if(a)for(var s=0;s<a.length;s++)if(o=n.hasColumn(a[s])){i=n.getColumnWithColumnName(a[s]);break}}return i},t.getValue=function(e,n){var r=t.getColumn(e,n).name;return e.getValueWithColumnName(r)},t.setValue=function(e,n,r){var i=t.getColumn(e,n);e.setValueWithColumnName(i.name,r)},t}();e.DublinCoreMetadata=i},1485:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DublinCoreType=void 0;var n=function(){function t(t,e){this.name=t,this.synonyms=e}return t.fromName=function(e){for(var n in t)if((r=t[n]).name===e)return r;for(var n in t){var r;if((r=t[n]).synonyms)for(var i=0;i<r.synonyms.length;i++)if(r.synonyms[i]===e)return r}},t.DATE=new t("date"),t.DESCRIPTION=new t("description"),t.FORMAT=new t("format",["content_type"]),t.IDENTIFIER=new t("identifier",["id"]),t.SOURCE=new t("source"),t.TITLE=new t("title"),t}();e.DublinCoreType=n},7817:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedRelation=void 0;e.ExtendedRelation=function(){}},8904:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedRelationDao=void 0;var a=n(4115),s=n(8572),u=n(7817),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=["id"],n}return i(e,t),e.prototype.createObject=function(t){var e=new u.ExtendedRelation;return t&&(e.base_table_name=t.base_table_name,e.base_primary_column=t.base_primary_column,e.related_table_name=t.base_primary_column,e.related_table_name=t.related_table_name,e.relation_name=t.relation_name,e.mapping_table_name=t.mapping_table_name,e.related_primary_column=t.related_primary_column,e.id=t.id),e},e.prototype.createTable=function(){return this.geoPackage.getTableCreator().createExtendedRelations()},e.prototype.getBaseTables=function(){for(var t=[],e=this.queryForColumns("base_table_name"),n=0;n<e.length;n++)t.push(e[n].base_table_name);return t},e.prototype.getRelatedTables=function(){for(var t=[],e=this.queryForColumns("related_table_name"),n=0;n<e.length;n++)t.push(e[n].related_table_name);return t},e.prototype.getBaseTableRelations=function(t){var n,r,i=[];try{for(var a=o(this.queryForAllEq(e.COLUMN_BASE_TABLE_NAME,t)),s=a.next();!s.done;s=a.next()){var u=s.value;i.push(this.createObject(u))}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.getRelatedTableRelations=function(t){var n,r,i=[];try{for(var a=o(this.queryForAllEq(e.COLUMN_RELATED_TABLE_NAME,t)),s=a.next();!s.done;s=a.next()){var u=s.value;i.push(this.createObject(u))}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.getBaseTableRelationsWithName=function(t,n){var r,i,a=new s.ColumnValues;a.addColumn(e.COLUMN_BASE_TABLE_NAME,t),a.addColumn(e.COLUMN_RELATION_NAME,n);var u=this.buildWhere(a,"and"),l=this.buildWhereArgs(a),c=[];try{for(var h=o(this.queryForAll(u,l)),f=h.next();!f.done;f=h.next()){var p=f.value;c.push(this.createObject(p))}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return c},e.prototype.getTableRelations=function(t){var n,r,i=new s.ColumnValues;i.addColumn(e.COLUMN_BASE_TABLE_NAME,t),i.addColumn(e.COLUMN_RELATED_TABLE_NAME,t);var a=this.buildWhere(i,"or"),u=this.buildWhereArgs(i),l=[];try{for(var c=o(this.queryForAll(a,u)),h=c.next();!h.done;h=c.next()){var f=h.value;l.push(this.createObject(f))}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return l},e.prototype.getRelations=function(t,n,r){var i,a,u=new s.ColumnValues;u.addColumn(e.COLUMN_BASE_TABLE_NAME,t),u.addColumn(e.COLUMN_RELATED_TABLE_NAME,n),u.addColumn(e.COLUMN_MAPPING_TABLE_NAME,r);var l=this.buildWhereLike(u,"and"),c=this.buildWhereArgs(u),h=[];try{for(var f=o(this.queryForAll(l,c)),p=f.next();!p.done;p=f.next()){var d=p.value;h.push(this.createObject(d))}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return h},e.prototype.queryByMappingTableName=function(t){var n,r,i=new s.ColumnValues;i.addColumn(e.COLUMN_MAPPING_TABLE_NAME,t);var a=this.buildWhere(i,"and"),u=this.buildWhereArgs(i),l=[];try{for(var c=o(this.queryForAll(a,u)),h=c.next();!h.done;h=c.next()){var f=h.value;l.push(this.createObject(f))}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return l},e.TABLE_NAME="gpkgext_relations",e.ID="id",e.COLUMN_ID=e.TABLE_NAME+"."+e.ID,e.BASE_TABLE_NAME="base_table_name",e.COLUMN_BASE_TABLE_NAME=e.TABLE_NAME+"."+e.BASE_TABLE_NAME,e.BASE_PRIMARY_COLUMN="base_primary_column",e.COLUMN_BASE_PRIMARY_COLUMN=e.TABLE_NAME+"."+e.BASE_PRIMARY_COLUMN,e.RELATED_TABLE_NAME="related_table_name",e.COLUMN_RELATED_TABLE_NAME=e.TABLE_NAME+"."+e.RELATED_TABLE_NAME,e.RELATED_PRIMARY_COLUMN="related_primary_column",e.COLUMN_RELATED_PRIMARY_COLUMN=e.TABLE_NAME+"."+e.RELATED_PRIMARY_COLUMN,e.RELATION_NAME="relation_name",e.COLUMN_RELATION_NAME=e.TABLE_NAME+"."+e.RELATION_NAME,e.MAPPING_TABLE_NAME="mapping_table_name",e.COLUMN_MAPPING_TABLE_NAME=e.TABLE_NAME+"."+e.MAPPING_TABLE_NAME,e}(a.Dao);e.ExtendedRelationDao=l},1832:function(t,e,n){"use strict";var r,i=n(5108),o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.RelatedTablesExtension=void 0;var s=n(8140),u=n(624),l=n(7502),c=n(6366),h=n(2702),f=n(4599),p=n(233),d=n(6302),y=n(1447),m=n(8904),g=n(8483),_=n(5897),b=n(8572),v=n(7817),T=n(7403),E=n(362),w=n(8008),x=n(2071),C=n(1394),M=function(t){function e(e){var n=t.call(this,e)||this;return n.extendedRelationDao=e.extendedRelationDao,n}return o(e,t),e.prototype.getOrCreateExtension=function(){var t=this.getOrCreate(e.EXTENSION_NAME,"gpkgext_relations",void 0,e.EXTENSION_RELATED_TABLES_DEFINITION,u.Extension.READ_WRITE);return this.extendedRelationDao.createTable(),t},e.prototype.getOrCreateMappingTable=function(t){return this.getOrCreateExtension(),this.getOrCreate(e.EXTENSION_NAME,t,void 0,e.EXTENSION_RELATED_TABLES_DEFINITION,u.Extension.READ_WRITE)},e.prototype.setContents=function(t){var e=this.geoPackage.contentsDao.queryForId(t.getTableName());return t.setContents(e)},e.prototype.getUserDao=function(t){return y.UserCustomDao.readTable(this.geoPackage,t)},e.prototype.getMappingDao=function(t){var e;return e=t instanceof v.ExtendedRelation?t.mapping_table_name:t,new d.UserMappingDao(this.getUserDao(e),this.geoPackage)},e.prototype.getRelationships=function(t){return this.extendedRelationDao.isTableExists()?t?this.geoPackage.extendedRelationDao.getBaseTableRelations(t):this.extendedRelationDao.queryForAll():[]},e.prototype.hasRelations=function(t,e,n){var r=[];return this.extendedRelationDao.isTableExists()&&(r=this.extendedRelationDao.getRelations(t,e,n)),!!r.length},e.prototype.getRelatedRows=function(t,e){for(var n=this.getRelationships(t),r=0;r<n.length;r++){var i=n[r],o=this.getMappingRowsForBase(i.mapping_table_name,e);i.mappingRows=o;var a=void 0;switch(i.relation_name){case g.RelationType.MEDIA.name:a=l.MediaDao.readTable(this.geoPackage,i.related_table_name);break;case g.RelationType.ATTRIBUTES.name:a=w.AttributesDao.readTable(this.geoPackage,i.related_table_name);break;case g.RelationType.FEATURES.name:a=x.FeatureDao.readTable(this.geoPackage,i.related_table_name);break;case g.RelationType.TILES.name:a=C.TileDao.readTable(this.geoPackage,i.related_table_name);break;case g.RelationType.SIMPLE_ATTRIBUTES.name:a=h.SimpleAttributesDao.readTable(this.geoPackage,i.related_table_name);break;default:throw new Error("Relationship Unknown")}for(var s=0;s<o.length;s++){var u=o[s];u.row=a.queryForId(u.relatedId)}}return n},e.prototype.getRelationshipBuilder=function(){return e.RelationshipBuilder()},e.prototype.addRelationship=function(t){var e,n=this.extendedRelationDao.createObject();if(t instanceof v.ExtendedRelation?(n=t,e=p.UserMappingTable.create(n.mapping_table_name)):(e=t.userMappingTable,t.relationType&&(t.relationName=t.relationType.name),t.relationAuthor&&(t.relationName=this.buildRelationName(t.relationAuthor,t.relationName)),t.mappingTableName&&(e=p.UserMappingTable.create(t.mappingTableName)),t.relatedTable&&(this.createRelatedTable(t.relatedTable),t.relatedTableName=t.relatedTable.getTableName(),t.relationName=t.relatedTable.relation_name),n.base_table_name=t.baseTableName,n.base_primary_column=this.getPrimaryKeyColumnName(t.baseTableName),n.related_table_name=t.relatedTableName,n.related_primary_column=this.getPrimaryKeyColumnName(t.relatedTableName),n.mapping_table_name=e.getTableName(),n.relation_name=t.relationName),this.validateRelationship(n.base_table_name,n.related_table_name,n.relation_name)){this.createUserMappingTable(e);var r=this.extendedRelationDao.queryByMappingTableName(n.mapping_table_name);return r.length?r[0]:(this.extendedRelationDao.create(n),n)}},e.prototype.getPrimaryKeyColumnName=function(t){return new E.UserCustomTableReader(t).readTable(this.geoPackage.database).getPkColumn().getName()},e.prototype.addFeaturesRelationship=function(t){return t instanceof v.ExtendedRelation?t.relation_name=t.relation_name||g.RelationType.FEATURES.name:t.relationType=g.RelationType.FEATURES,this.addRelationship(t)},e.prototype.addTilesRelationship=function(t){return t instanceof v.ExtendedRelation?t.relation_name=t.relation_name||g.RelationType.TILES.name:t.relationType=g.RelationType.TILES,this.addRelationship(t)},e.prototype.addAttributesRelationship=function(t){return t instanceof v.ExtendedRelation?t.relation_name=t.relation_name||g.RelationType.ATTRIBUTES.name:t.relationType=g.RelationType.ATTRIBUTES,this.addRelationship(t)},e.prototype.addSimpleAttributesRelationship=function(t){return t instanceof v.ExtendedRelation?t.relation_name=t.relation_name||g.RelationType.SIMPLE_ATTRIBUTES.name:t.relationType=g.RelationType.SIMPLE_ATTRIBUTES,this.addRelationship(t)},e.prototype.addMediaRelationship=function(t){return t instanceof v.ExtendedRelation?t.relation_name=t.relation_name||g.RelationType.MEDIA.name:t.relationType=g.RelationType.MEDIA,this.addRelationship(t)},e.prototype.removeRelationship=function(t){var n,r,i,o,s,u,l,c,h=this;if(t instanceof v.ExtendedRelation?(s=t.relation_name,u=t.related_table_name,l=t.base_table_name,c=t.mapping_table_name):(s=t.relationName,u=t.relatedTableName,l=t.baseTableName,c=t.userMappingTable,t.relationType&&(s=t.relationType.name),t.relationAuthor&&(s=this.buildRelationName(t.relationAuthor,s))),this.extendedRelationDao.isTableExists()){var f=new b.ColumnValues;f.addColumn(m.ExtendedRelationDao.COLUMN_BASE_TABLE_NAME,l),f.addColumn(m.ExtendedRelationDao.COLUMN_RELATED_TABLE_NAME,u),f.addColumn(m.ExtendedRelationDao.COLUMN_RELATION_NAME,s),f.addColumn(m.ExtendedRelationDao.COLUMN_MAPPING_TABLE_NAME,c);var p=this.extendedRelationDao.queryForFieldValues(f),d=[],y=[];try{for(var g=a(p),_=g.next();!_.done;_=g.next()){var T=_.value;d.push(T.mapping_table_name),y.push(T)}}catch(t){n={error:t}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}d.forEach((function(t){h.geoPackage.deleteTable(t)})),this.extensionsDao.deleteByExtensionAndTableName(e.EXTENSION_NAME,c);try{for(var E=a(y),w=E.next();!w.done;w=E.next())T=w.value,this.extendedRelationDao.delete(T)}catch(t){i={error:t}}finally{try{w&&!w.done&&(o=E.return)&&o.call(E)}finally{if(i)throw i.error}}return d.length}return 0},e.prototype.createUserMappingTable=function(t){var e;return e=t instanceof p.UserMappingTable?t:p.UserMappingTable.create(t),this.getOrCreateMappingTable(e.getTableName()),!!this.geoPackage.isTable(e.getTableName())||!!this.geoPackage.tableCreator.createUserTable(e)},e.prototype.createRelatedTable=function(t){if(!this.geoPackage.isTable(t.getTableName())){this.geoPackage.tableCreator.createUserTable(t);var e=new _.Contents;e.table_name=t.getTableName(),e.data_type=t.data_type,e.identifier=t.getTableName(),this.geoPackage.contentsDao.create(e);var n=this.geoPackage.contentsDao.refresh(e);t.setContents(n)}return!0},e.prototype.validateRelationship=function(t,e,n){if(!this.geoPackage.isTable(t))return i.log("Base relationship table does not exist: "+t+", Relation: "+n),!1;if(!this.geoPackage.isTable(e))return i.log("Related relationship table does not exist: "+e+", Relation: "+n),!1;var r=g.RelationType.fromName(n);return!r||!!this.geoPackage.isTableType(r.dataType,e)||(i.log("The related table must be a "+r.dataType+" table. Related Table: "+e+", Type: "+this.geoPackage.getTableType(e)),!1)},e.prototype.getMappingsForBase=function(t,e){for(var n=this.getMappingDao(t),r=n.queryByBaseId(e),i=[],o=0;o<r.length;o++){var a=n.getUserMappingRow(r[o]);i.push(a.relatedId)}return i},e.prototype.getMappingRowsForBase=function(t,e){var n=this.getMappingDao(t),r=[];return n.queryByBaseId(e).forEach((function(t){r.push(n.getUserMappingRow(t))})),r},e.prototype.getMappingsForRelated=function(t,e){for(var n=this.getMappingDao(t),r=n.queryByRelatedId(e),i=[],o=0;o<r.length;o++){var a=n.getUserMappingRow(r[o]);i.push(a.baseId)}return i},e.prototype.getMediaDao=function(t){var e;t instanceof c.MediaTable?e=t.getTableName():t instanceof v.ExtendedRelation?e=t.related_table_name:"string"==typeof t&&(e=t);var n=new E.UserCustomTableReader(e).readTable(this.geoPackage.database);return(e=new c.MediaTable(n.getTableName(),n.getUserColumns().getColumns(),c.MediaTable.requiredColumns())).setContents(this.geoPackage.contentsDao.queryForId(n.getTableName())),new l.MediaDao(this.geoPackage,e)},e.prototype.getSimpleAttributesDao=function(t){var e;if(t instanceof f.SimpleAttributesTable&&"simple_attributes"===t.TABLE_TYPE)e=t;else{t instanceof v.ExtendedRelation&&(e=t.related_table_name);var n=new E.UserCustomTableReader(e).readTable(this.geoPackage.database);(e=new f.SimpleAttributesTable(n.getTableName(),n.getUserColumns().getColumns(),f.SimpleAttributesTable.requiredColumns())).setContents(this.geoPackage.contentsDao.queryForId(e.getTableName()))}return new h.SimpleAttributesDao(this.geoPackage,e)},e.prototype.buildRelationName=function(t,e){return"x-"+t+"_"+e},e.prototype.removeExtension=function(){this.extendedRelationDao.isTableExists()&&(this.extendedRelationDao.queryForAll().forEach(function(t){return this.geoPackage.deleteTable(t.mapping_table_name)}.bind(this)),this.geoPackage.deleteTable(m.ExtendedRelationDao.TABLE_NAME)),this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)},e.prototype.has=function(t){return t?this.hasExtension(e.EXTENSION_NAME,m.ExtendedRelationDao.TABLE_NAME,null)&&this.hasExtension(e.EXTENSION_NAME,t,null)||this.hasExtension(e.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR,m.ExtendedRelationDao.TABLE_NAME,null)&&this.hasExtension(e.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR,t,null):this.hasExtension(e.EXTENSION_NAME,m.ExtendedRelationDao.TABLE_NAME,null)||this.hasExtension(e.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR,m.ExtendedRelationDao.TABLE_NAME,null)},e.RelationshipBuilder=function(){return T.OptionBuilder.build(["baseTableName","relatedTableName","userMappingTable","mappingTableName","relationName","relationAuthor","relationType","relatedTable"])},e.prototype.removeRelationships=function(t){var e=this;try{this.extendedRelationDao.isTableExists()&&this.extendedRelationDao.getTableRelations(t).forEach((function(t){e.removeRelationship(t)}))}catch(e){throw new Error("Failed to remove relationships for table: "+t)}},e.prototype.removeRelationshipsWithMappingTable=function(t){var e=this;try{this.extendedRelationDao.isTableExists()&&this.extendedRelationDao.queryByMappingTableName(t).forEach((function(t){e.removeRelationship(t)}))}catch(e){throw new Error("Failed to remove relationships for mapping table: "+t)}},e.EXTENSION_NAME="gpkg_related_tables",e.EXTENSION_RELATED_TABLES_AUTHOR="gpkg",e.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR="related_tables",e.EXTENSION_RELATED_TABLES_DEFINITION="TBD",e}(s.BaseExtension);e.RelatedTablesExtension=M},7502:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MediaDao=void 0;var o=n(4668),a=n(6119),s=n(362),u=function(t){function e(e,n){return t.call(this,e,n)||this}return i(e,t),e.prototype.newRow=function(t,e){return new a.MediaRow(this.table,t,e)},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.readTable=function(t,n){return new e(t,new s.UserCustomTableReader(n).readTable(t.database))},e}(o.UserDao);e.MediaDao=u},6119:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MediaRow=void 0;var o=n(2224),a=n(9325),s=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.mediaTable=e,i}return i(e,t),Object.defineProperty(e.prototype,"dataColumn",{get:function(){return this.mediaTable.dataColumn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.getValueWithColumnName(this.dataColumn.name)},set:function(t){this.setValueWithColumnName(this.dataColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataImage",{get:function(){return a.ImageUtils.getImage(this.data,this.contentType)},enumerable:!1,configurable:!0}),e.prototype.getScaledDataImage=function(t){return a.ImageUtils.getScaledImage(this.data,t)},Object.defineProperty(e.prototype,"contentTypeColumn",{get:function(){return this.mediaTable.contentTypeColumn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentType",{get:function(){return this.getValueWithColumnName(this.contentTypeColumn.name)},set:function(t){this.setValueWithColumnName(this.contentTypeColumn.name,t)},enumerable:!1,configurable:!0}),e}(o.UserRow);e.MediaRow=s},6366:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MediaTable=void 0;var o=n(8840),a=n(8483),s=n(5865),u=n(7319),l=function(t){function e(n,r,i){var o=t.call(this,n,e.RELATION_TYPE.name,e.RELATION_TYPE.dataType,r,i)||this;return o.TABLE_TYPE="media",o}return i(e,t),Object.defineProperty(e.prototype,"tableType",{get:function(){return this.TABLE_TYPE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataColumn",{get:function(){return this.getColumnWithColumnName(e.COLUMN_DATA)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentTypeColumn",{get:function(){return this.getColumnWithColumnName(e.COLUMN_CONTENT_TYPE)},enumerable:!1,configurable:!0}),e.create=function(t,n){var r=e.createRequiredColumns();return n&&(r=r.concat(n)),new e(t,r,e.requiredColumns())},e.requiredColumns=function(t){void 0===t&&(t=e.COLUMN_ID);var n=[];return n.push(t),n.push(e.COLUMN_DATA),n.push(e.COLUMN_CONTENT_TYPE),n},e.numRequiredColumns=function(){return e.requiredColumns().length},e.createRequiredColumns=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=e.COLUMN_ID),[e.createIdColumn(t++,n),e.createDataColumn(t++),e.createContentTypeColumn(t++)]},e.createIdColumn=function(t,e){return s.UserColumn.createPrimaryKeyColumn(t,e)},e.createDataColumn=function(t){return s.UserColumn.createColumn(t,e.COLUMN_DATA,u.GeoPackageDataType.BLOB,!0)},e.createContentTypeColumn=function(t){return s.UserColumn.createColumn(t,e.COLUMN_CONTENT_TYPE,u.GeoPackageDataType.TEXT,!0)},e.RELATION_TYPE=a.RelationType.MEDIA,e.COLUMN_ID="id",e.COLUMN_DATA="data",e.COLUMN_CONTENT_TYPE="content_type",e}(o.UserRelatedTable);e.MediaTable=l},8483:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RelationType=void 0;var r=n(9971),i=function(){function t(t,e){this.name=t,this.dataType=e}return t.fromName=function(e){return t[e.toUpperCase()]},t.FEATURES=new t("features",r.ContentsDataType.FEATURES),t.SIMPLE_ATTRIBUTES=new t("simple_attributes",r.ContentsDataType.ATTRIBUTES),t.MEDIA=new t("media",r.ContentsDataType.ATTRIBUTES),t.ATTRIBUTES=new t("attributes",r.ContentsDataType.ATTRIBUTES),t.TILES=new t("tiles",r.ContentsDataType.TILES),t}();e.RelationType=i},2702:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleAttributesDao=void 0;var o=n(4668),a=n(7374),s=function(t){function e(e,n){return t.call(this,e,n)||this}return i(e,t),e.prototype.newRow=function(t,e){return new a.SimpleAttributesRow(this.table,t,e)},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.getRows=function(t){for(var e=[],n=0;n<t.length;n++){var r=this.queryForId(t[n]);r&&e.push(r)}return e},e.readTable=function(t,e){return t.relatedTablesExtension.getSimpleAttributesDao(e)},e}(o.UserDao);e.SimpleAttributesDao=s},7374:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleAttributesRow=void 0;var o=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.simpleAttributesTable=e,i}return i(e,t),e}(n(2224).UserRow);e.SimpleAttributesRow=o},4599:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleAttributesTable=void 0;var o=n(8840),a=n(8483),s=n(5865),u=n(7319),l=function(t){function e(n,r,i){var o=t.call(this,n,e.RELATION_TYPE.name,e.RELATION_TYPE.dataType,r,i)||this;return o.TABLE_TYPE="simple_attributes",o.validateColumns(),o}return i(e,t),e.prototype.validateColumns=function(){var t=this.columns;if(t.getColumns().length<2)throw new Error("Simple Attributes Tables require at least one non id column");for(var n=0;n<t.getColumns().length;n++){var r=t.getColumns()[n];if(!e.isSimple(r))throw new Error("Simple Attributes Tables only support simple data types. Column: "+r.name+", Non Simple Data Type: "+r.dataType)}return!0},e.create=function(t,n){var r=e.createRequiredColumns(0);return n&&(r=r.concat(n)),new e(t,r,e.requiredColumns())},e.requiredColumns=function(t){void 0===t&&(t=e.COLUMN_ID);var n=[];return n.push(t),n},e.numRequiredColumns=function(){return e.requiredColumns().length},e.createRequiredColumns=function(t,n){return void 0===t&&(t=0),void 0===n&&(n="id"),[e.createIdColumn(t++,n||e.COLUMN_ID)]},e.createIdColumn=function(t,e){return s.UserColumn.createPrimaryKeyColumn(t,e)},e.isSimple=function(t){return t.notNull&&e.isSimpleDataType(t.dataType)},e.isSimpleDataType=function(t){return t!==u.GeoPackageDataType.BLOB},e.RELATION_TYPE=a.RelationType.SIMPLE_ATTRIBUTES,e.COLUMN_ID="id",e}(o.UserRelatedTable);e.SimpleAttributesTable=l},6302:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserMappingDao=void 0;var o=n(1447),a=n(233),s=n(8029),u=n(8572),l=function(t){function e(n,r,i){return t.call(this,r,i||e.createMappingTable(n))||this}return i(e,t),e.createMappingTable=function(t){return new a.UserMappingTable(t.table.getTableName(),t.table.getUserColumns().getColumns(),a.UserMappingTable.requiredColumns())},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.newRow=function(t,e){return new s.UserMappingRow(this.table,t,e)},e.prototype.getUserMappingRow=function(t){return this.getRow(t)},e.prototype.queryByBaseId=function(t){return this.queryForAllEq(a.UserMappingTable.COLUMN_BASE_ID,t instanceof s.UserMappingRow?t.baseId:t)},e.prototype.queryByRelatedId=function(t){return this.queryForAllEq(a.UserMappingTable.COLUMN_RELATED_ID,t instanceof s.UserMappingRow?t.relatedId:t)},e.prototype.queryByIds=function(t,e){var n=new u.ColumnValues;return n.addColumn(a.UserMappingTable.COLUMN_BASE_ID,t instanceof s.UserMappingRow?t.baseId:t),void 0!==e&&n.addColumn(a.UserMappingTable.COLUMN_RELATED_ID,e instanceof s.UserMappingRow?e.relatedId:e),this.queryForFieldValues(n)},e.prototype.uniqueRelatedIds=function(){var t="SELECT DISTINCT ";return t+=a.UserMappingTable.COLUMN_RELATED_ID,t+=" FROM ",t+="'"+this.gpkgTableName+"'",this.connection.all(t)},e.prototype.countByIds=function(t,e){var n=new u.ColumnValues;return n.addColumn(a.UserMappingTable.COLUMN_BASE_ID,t instanceof s.UserMappingRow?t.baseId:t),void 0!==e&&n.addColumn(a.UserMappingTable.COLUMN_RELATED_ID,e instanceof s.UserMappingRow?e.relatedId:e),this.count(n)},e.prototype.deleteByBaseId=function(t){var e="";e+=this.buildWhereWithFieldAndValue(a.UserMappingTable.COLUMN_BASE_ID,t instanceof s.UserMappingRow?t.baseId:t);var n=this.buildWhereArgs([t instanceof s.UserMappingRow?t.baseId:t]);return this.deleteWhere(e,n)},e.prototype.deleteByRelatedId=function(t){var e="";e+=this.buildWhereWithFieldAndValue(a.UserMappingTable.COLUMN_RELATED_ID,t instanceof s.UserMappingRow?t.relatedId:t);var n=this.buildWhereArgs([t instanceof s.UserMappingRow?t.relatedId:t]);return this.deleteWhere(e,n)},e.prototype.deleteByIds=function(t,e){var n="",r=[t instanceof s.UserMappingRow?t.baseId:t];n+=this.buildWhereWithFieldAndValue(a.UserMappingTable.COLUMN_BASE_ID,t instanceof s.UserMappingRow?t.baseId:t),void 0!==e&&(n+=" and ",n+=this.buildWhereWithFieldAndValue(a.UserMappingTable.COLUMN_RELATED_ID,e instanceof s.UserMappingRow?e.relatedId:e),r.push(e instanceof s.UserMappingRow?e.relatedId:e));var i=this.buildWhereArgs(r);return this.deleteWhere(n,i)},e}(o.UserCustomDao);e.UserMappingDao=l},8029:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserMappingRow=void 0;var o=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.table=e,i}return i(e,t),Object.defineProperty(e.prototype,"baseIdColumn",{get:function(){return this.table.baseIdColumn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseId",{get:function(){return this.getValueWithColumnName(this.baseIdColumn.name)},set:function(t){this.setValueWithColumnName(this.baseIdColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relatedIdColumn",{get:function(){return this.table.relatedIdColumn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relatedId",{get:function(){return this.getValueWithColumnName(this.relatedIdColumn.name)},set:function(t){this.setValueWithColumnName(this.relatedIdColumn.name,t)},enumerable:!1,configurable:!0}),e}(n(2224).UserRow);e.UserMappingRow=o},233:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserMappingTable=void 0;var o=n(5865),a=n(7319),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"tableType",{get:function(){return"userMappingTable"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseIdColumn",{get:function(){return this.getColumnWithColumnName(e.COLUMN_BASE_ID)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relatedIdColumn",{get:function(){return this.getColumnWithColumnName(e.COLUMN_RELATED_ID)},enumerable:!1,configurable:!0}),e.create=function(t,n){var r=e.createRequiredColumns(0);return n&&(r=r.concat(n)),new e(t,r,e.requiredColumns())},e.numRequiredColumns=function(){return e.createRequiredColumns(0).length},e.createRequiredColumns=function(t){return void 0===t&&(t=0),[e.createBaseIdColumn(t++),e.createRelatedIdColumn(t)]},e.createBaseIdColumn=function(t){return o.UserColumn.createColumn(t,e.COLUMN_BASE_ID,a.GeoPackageDataType.INTEGER,!0)},e.createRelatedIdColumn=function(t){return o.UserColumn.createColumn(t,e.COLUMN_RELATED_ID,a.GeoPackageDataType.INTEGER,!0)},e.requiredColumns=function(){return[e.COLUMN_BASE_ID,e.COLUMN_RELATED_ID]},e.COLUMN_BASE_ID="base_id",e.COLUMN_RELATED_ID="related_id",e}(n(2378).UserCustomTable);e.UserMappingTable=s},8840:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserRelatedTable=void 0;var o=function(t){function e(e,n,r,i,o){var a=t.call(this,e,i,o)||this;return a.relation_name=n,a.data_type=r,a}return i(e,t),Object.defineProperty(e.prototype,"tableType",{get:function(){return"userRelatedTable"},enumerable:!1,configurable:!0}),e.prototype.setContents=function(t){if(!t.data_type||t.data_type!==this.data_type)throw new Error("The contents of this related table must have a data type of "+this.data_type);return this.contents=t,!0},e}(n(2378).UserCustomTable);e.UserRelatedTable=o},5859:function(t,e,n){"use strict";var r,i=n(5108),o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RTreeIndex=void 0;var a=n(8140),s=n(624),u=n(735),l=n(1895),c=n(857),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.extensionName=s.Extension.buildExtensionName(u.RTreeIndexDao.EXTENSION_RTREE_INDEX_AUTHOR,u.RTreeIndexDao.EXTENSION_RTREE_INDEX_NAME_NO_AUTHOR),r.extensionDefinition=u.RTreeIndexDao.EXTENSION_RTREE_INDEX_DEFINITION,null!=n&&(r.tableName=n.table_name,r.primaryKeyColumn=n.idColumns[0],r.columnName=n.getGeometryColumnName()),r.rtreeIndexDao=new u.RTreeIndexDao(e,n),r.extensionExists=r.hasExtension(r.extensionName,r.tableName,r.columnName),r.createAllFunctions(),r}return o(e,t),e.prototype.getRTreeIndexExtension=function(){return this.getExtension(this.extensionName,this.tableName,this.columnName)},e.prototype.getOrCreateExtension=function(){return this.getOrCreate(this.extensionName,this.tableName,this.columnName,this.extensionDefinition,s.Extension.WRITE_ONLY)},e.prototype.createWithParameters=function(t,e,n){return this.hasExtension(this.extensionName,t,e)||(this.getOrCreate(this.extensionName,t,e,u.RTreeIndexDao.EXTENSION_RTREE_INDEX_DEFINITION,s.Extension.WRITE_ONLY),this.createRTreeIndex(t,e),this.loadRTreeIndex(t,e,n),this.createAllTriggers(t,e,n)),this.getRTreeIndexExtension()},e.prototype.create=function(t){var e=t||function(){};if(this.extensionExists)return this.getRTreeIndexExtension();this.getOrCreate(this.extensionName,this.tableName,this.columnName,u.RTreeIndexDao.EXTENSION_RTREE_INDEX_DEFINITION,s.Extension.WRITE_ONLY),this.createAllFunctions(),this.createRTreeIndex(this.tableName,this.columnName),e({description:"Creating Feature Index",count:0,totalCount:this.connection.count(this.tableName),layer:this.tableName});try{this.loadRTreeIndex(this.tableName,this.columnName,this.primaryKeyColumn)}catch(t){i.log("ERROR CREATING RTREE INDEX",t)}return this.createAllTriggers(this.tableName,this.columnName,this.primaryKeyColumn),this.getRTreeIndexExtension()},e.prototype.createAllTriggers=function(t,e,n){var r='CREATE TRIGGER "rtree_'+t+"_"+e+'_insert" AFTER INSERT ON "'+t+'" WHEN (new.'+e+" NOT NULL AND NOT ST_IsEmpty(NEW."+e+')) BEGIN INSERT OR REPLACE INTO "rtree_'+t+"_"+e+'" VALUES ( NEW.'+n+", ST_MinX(NEW."+e+"), ST_MaxX(NEW."+e+"), ST_MinY(NEW."+e+"), ST_MaxY(NEW."+e+") ); END;",i='CREATE TRIGGER "rtree_'+t+"_"+e+'_update1" AFTER UPDATE OF '+e+' ON "'+t+'" WHEN OLD.'+n+" = NEW."+n+" AND (NEW."+e+" NOTNULL AND NOT ST_IsEmpty(NEW."+e+')) BEGIN INSERT OR REPLACE INTO "rtree_'+t+"_"+e+'" VALUES ( NEW.'+n+", ST_MinX(NEW."+e+"), ST_MaxX(NEW."+e+"), ST_MinY(NEW."+e+"), ST_MaxY(NEW."+e+") ); END;",o='CREATE TRIGGER "rtree_'+t+"_"+e+'_update2" AFTER UPDATE OF '+e+' ON "'+t+'" WHEN OLD.'+n+" = NEW."+n+" AND (NEW."+e+" ISNULL OR ST_IsEmpty(NEW."+e+')) BEGIN DELETE FROM "rtree_'+t+"_"+e+'" WHERE id = OLD.'+n+"; END;",a='CREATE TRIGGER "rtree_'+t+"_"+e+'_update3" AFTER UPDATE OF '+e+' ON "'+t+'" WHEN OLD.'+n+" != NEW."+n+" AND (NEW."+e+" NOTNULL AND NOT ST_IsEmpty(NEW."+e+')) BEGIN DELETE FROM "rtree_'+t+"_"+e+'" WHERE id = OLD.'+n+'; INSERT OR REPLACE INTO "rtree_'+t+"_"+e+'" VALUES ( NEW.'+n+", ST_MinX(NEW."+e+"), ST_MaxX(NEW."+e+"), ST_MinY(NEW."+e+"), ST_MaxY(NEW."+e+") ); END;",s='CREATE TRIGGER "rtree_'+t+"_"+e+'_update4" AFTER UPDATE ON "'+t+'" WHEN OLD.'+n+" != NEW."+n+" AND (NEW."+e+" ISNULL OR ST_IsEmpty(NEW."+e+')) BEGIN DELETE FROM "rtree_'+t+"_"+e+'" WHERE id IN (OLD.'+n+", NEW."+n+"); END;",u='CREATE TRIGGER "rtree_'+t+"_"+e+'_delete" AFTER DELETE ON "'+t+'" WHEN old.'+e+' NOT NULL BEGIN DELETE FROM "rtree_'+t+"_"+e+'" WHERE id = OLD.'+n+"; END;",l=0;return l+=this.connection.run(r).changes,l+=this.connection.run(i).changes,l+=this.connection.run(o).changes,l+=this.connection.run(a).changes,6===(l+=this.connection.run(s).changes)+this.connection.run(u).changes},e.prototype.loadRTreeIndex=function(t,e,n){return 1===this.connection.run('INSERT OR REPLACE INTO "rtree_'+t+"_"+e+'" SELECT '+n+", st_minx("+e+"), st_maxx("+e+"), st_miny("+e+"), st_maxy("+e+') FROM "'+t+'"').changes},e.prototype.createRTreeIndex=function(t,e){return 1===this.connection.run('CREATE VIRTUAL TABLE "rtree_'+t+"_"+e+'" USING rtree(id, minx, maxx, miny, maxy)').changes},e.prototype.createAllFunctions=function(){this.createMinXFunction(),this.createMaxXFunction(),this.createMinYFunction(),this.createMaxYFunction(),this.createIsEmptyFunction()},e.prototype.createMinXFunction=function(){this.connection.registerFunction("ST_MinX",(function(t){var e=new c.GeometryData(t);if(!e.geometry)return null;var n=e.envelope;return n||(n=l.EnvelopeBuilder.buildEnvelopeWithGeometry(e.geometry)),n.minX===1/0?null:n.minX}))},e.prototype.createMinYFunction=function(){this.connection.registerFunction("ST_MinY",(function(t){var e=new c.GeometryData(t);if(!e.geometry)return null;var n=e.envelope;return n||(n=l.EnvelopeBuilder.buildEnvelopeWithGeometry(e.geometry)),n.minY===1/0?null:n.minY}))},e.prototype.createMaxXFunction=function(){this.connection.registerFunction("ST_MaxX",(function(t){var e=new c.GeometryData(t);if(!e.geometry)return null;var n=e.envelope;return n||(n=l.EnvelopeBuilder.buildEnvelopeWithGeometry(e.geometry)),n.maxX===-1/0?null:n.maxX}))},e.prototype.createMaxYFunction=function(){this.connection.registerFunction("ST_MaxY",(function(t){var e=new c.GeometryData(t);if(!e.geometry)return null;var n=e.envelope;return n||(n=l.EnvelopeBuilder.buildEnvelopeWithGeometry(e.geometry)),n.maxY===-1/0?null:n.maxY}))},e.prototype.createIsEmptyFunction=function(){this.connection.registerFunction("ST_IsEmpty",(function(t){var e=new c.GeometryData(t);return e&&!e.empty&&e.geometry?0:1}))},e.prototype.has=function(t,e){return this.hasExtension(this.extensionName,t,e)},e.prototype.deleteTable=function(t){var e=this;try{this.extensionsDao.isTableExists()&&this.extensionsDao.queryByExtensionAndTableName(this.extensionName,t).forEach((function(t){e.deleteTableAndColumn(t.getTableName(),t.column_name)}))}catch(e){throw new Error("Failed to delete RTree Index extensions for table. GeoPackage: "+this.geoPackage.name+", Table: "+t)}},e.prototype.deleteTableAndColumn=function(t,e){if(this.has(t,e)){this.dropTableAndColumn(t,e);try{this.extensionsDao.deleteByExtensionAndTableNameAndColumnName(this.extensionName,t,e)}catch(n){throw new Error("Failed to delete RTree Index extension. GeoPackage: "+this.geoPackage.name+", Table: "+t+", Geometry Column: "+e)}}},e.prototype.deleteAll=function(){var t=this;try{this.extensionsDao.isTableExists()&&this.extensionsDao.queryByExtensionAndTableName(this.extensionName,this.tableName).forEach((function(e){t.deleteTableAndColumn(e.getTableName(),e.column_name)}))}catch(t){throw new Error("Failed to delete RTree Index extensions for table. GeoPackage: "+this.geoPackage.name+", Table: "+this.tableName)}},e.prototype.dropByFeatureTable=function(t){this.dropTableAndColumn(t.getTableName(),t.getGeometryColumnName())},e.prototype.dropTableAndColumn=function(t,e){this.dropAllTriggers(t,e),this.dropRTreeIndex(t,e)},e.prototype.dropRTreeIndexByFeatureTable=function(t){this.dropRTreeIndex(t.getTableName(),t.getGeometryColumnName())},e.prototype.dropRTreeIndex=function(t,e){try{this.geoPackage.connection.run('DROP TABLE "rtree_'+t+"_"+e+'"')}catch(n){if(!(n.getMessage().indexOf("no such module: rtree")>-1))throw n;this.geoPackage.connection.run('DROP TABLE IF EXISTS "rtree_'+t+"_"+e+'_node"'),this.geoPackage.connection.run('DROP TABLE IF EXISTS "rtree_'+t+"_"+e+'_parent"'),this.geoPackage.connection.run('DROP TABLE IF EXISTS "rtree_'+t+"_"+e+'_rowid"'),this.geoPackage.connection.run("PRAGMA writable_schema = ON"),this.geoPackage.connection.run('DELETE FROM sqlite_master WHERE type = "table" AND name = "rtree_'+t+"_"+e+'"'),this.geoPackage.connection.run("PRAGMA writable_schema = OFF")}},e.prototype.dropTriggersByFeatureTable=function(t){this.dropTriggers(t.getTableName(),t.getGeometryColumnName())},e.prototype.dropTriggers=function(t,e){var n=this.has(t,e);return n&&this.dropAllTriggers(t,e),n},e.prototype.dropAllTriggersByFeatureTable=function(t){this.dropAllTriggers(t.getTableName(),t.getGeometryColumnName())},e.prototype.dropAllTriggers=function(t,e){this.dropInsertTrigger(t,e),this.dropUpdate1Trigger(t,e),this.dropUpdate2Trigger(t,e),this.dropUpdate3Trigger(t,e),this.dropUpdate4Trigger(t,e),this.dropDeleteTrigger(t,e)},e.prototype.dropInsertTrigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_INSERT_NAME)},e.prototype.dropUpdate1Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE1_NAME)},e.prototype.dropUpdate2Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE2_NAME)},e.prototype.dropUpdate3Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE3_NAME)},e.prototype.dropUpdate4Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE4_NAME)},e.prototype.dropDeleteTrigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_DELETE_NAME)},e.prototype.dropTrigger=function(t,e,n){this.geoPackage.connection.run('DROP TRIGGER IF EXISTS "rtree_'+t+"_"+e+"_"+n+'"')},e.TRIGGER_INSERT_NAME="insert",e.TRIGGER_UPDATE1_NAME="update1",e.TRIGGER_UPDATE2_NAME="update2",e.TRIGGER_UPDATE3_NAME="update3",e.TRIGGER_UPDATE4_NAME="update4",e.TRIGGER_DELETE_NAME="delete",e}(a.BaseExtension);e.RTreeIndex=h},735:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RTreeIndexDao=void 0;var o=n(4115),a=n(5859),s=n(8877),u=function(t){function e(n,r){var i=t.call(this,n)||this;return i.gpkgTableName=e.TABLE_NAME,i.featureDao=r,i}return i(e,t),e.prototype.createObject=function(t){return new a.RTreeIndex(this.geoPackage,this.featureDao)},e.prototype._generateGeometryEnvelopeQuery=function(t){var e=this.featureDao.gpkgTableName,n="",r=t.minX<t.maxX;r?(n+=this.buildWhereWithFieldAndValue("minx",t.maxX,"<="),n+=" and ",n+=this.buildWhereWithFieldAndValue("maxx",t.minX,">=")):(n+="(",n+=this.buildWhereWithFieldAndValue("minx",t.maxX,"<="),n+=" or ",n+=this.buildWhereWithFieldAndValue("maxx",t.minX,">="),n+=" or ",n+=this.buildWhereWithFieldAndValue("minx",t.minX,">="),n+=" or ",n+=this.buildWhereWithFieldAndValue("maxx",t.maxX,"<="),n+=")"),n+=" and ",n+=this.buildWhereWithFieldAndValue("miny",t.maxY,"<="),n+=" and ",n+=this.buildWhereWithFieldAndValue("maxy",t.minY,">=");var i=[];return i.push(t.maxX,t.minX),r||i.push(t.minX,t.maxX),i.push(t.maxY,t.minY),{join:'inner join "'+e+'" on "'+e+'".'+this.featureDao.idColumns[0]+' = "'+this.gpkgTableName+'".id',where:n,whereArgs:i,tableNameArr:['"'+e+'".*']}},e.prototype.queryWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.queryJoinWhereWithArgs(e.join,e.where,e.whereArgs,e.tableNameArr)},e.prototype.countWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.connection.get(s.SqliteQueryBuilder.buildCount("'"+this.gpkgTableName+"'",e.where),e.whereArgs).count},e.TABLE_NAME="rtree",e.PREFIX="rtree_",e.COLUMN_TABLE_NAME=e.TABLE_NAME+".table_name",e.COLUMN_GEOM_ID=e.TABLE_NAME+".geom_id",e.COLUMN_MIN_X=e.TABLE_NAME+".minx",e.COLUMN_MAX_X=e.TABLE_NAME+".maxx",e.COLUMN_MIN_Y=e.TABLE_NAME+".miny",e.COLUMN_MAX_Y=e.TABLE_NAME+".maxy",e.COLUMN_MIN_Z=e.TABLE_NAME+".minz",e.COLUMN_MAX_Z=e.TABLE_NAME+".maxz",e.COLUMN_MIN_M=e.TABLE_NAME+".minm",e.COLUMN_MAX_M=e.TABLE_NAME+".maxm",e.EXTENSION_NAME="gpkg_rtree_index",e.EXTENSION_RTREE_INDEX_AUTHOR="gpkg",e.EXTENSION_RTREE_INDEX_NAME_NO_AUTHOR="rtree_index",e.EXTENSION_RTREE_INDEX_DEFINITION="http://www.geopackage.org/spec/#extension_rtree",e}(o.Dao);e.RTreeIndexDao=u},7523:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileScalingExtension=void 0;var o=n(8140),a=n(624),s=n(7960),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tableName=n,r.tileScalingDao=e.tileScalingDao,r}return i(e,t),e.prototype.getOrCreateExtension=function(){var t=this.getOrCreate(e.EXTENSION_NAME,this.tableName,null,e.EXTENSION_DEFINITION,a.Extension.READ_WRITE);return this.tileScalingDao.createTable(),t},e.prototype.createOrUpdate=function(t){return t.table_name=this.tableName,this.tileScalingDao.createOrUpdate(t)},Object.defineProperty(e.prototype,"dao",{get:function(){return this.tileScalingDao},enumerable:!1,configurable:!0}),e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,this.tableName,null)&&this.tileScalingDao.isTableExists()},e.prototype.removeExtension=function(){this.tileScalingDao.isTableExists()&&this.geoPackage.deleteTable(s.TileScalingDao.TABLE_NAME),this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)},e.EXTENSION_NAME="nga_tile_scaling",e.EXTENSION_AUTHOR="nga",e.EXTENSION_NAME_NO_AUTHOR="tile_scaling",e.EXTENSION_DEFINITION="http://ngageoint.github.io/GeoPackage/docs/extensions/tile-scaling.html",e}(o.BaseExtension);e.TileScalingExtension=u},4301:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileScaling=void 0;var r=n(2777),i=function(){function t(){}return t.prototype.isZoomIn=function(){return(null==this.zoom_in||this.zoom_in>0)&&null!=this.scaling_type&&this.scaling_type!=r.TileScalingType.OUT},t.prototype.isZoomOut=function(){return(null==this.zoom_out||this.zoom_out>0)&&null!=this.scaling_type&&this.scaling_type!=r.TileScalingType.IN},t}();e.TileScaling=i},7960:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileScalingDao=void 0;var o=n(4115),a=n(4301),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_TABLE_NAME],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.TileScaling;return t&&(e.table_name=t.table_name,e.scaling_type=t.scaling_type,e.zoom_in=t.zoom_in,e.zoom_out=t.zoom_out),e},e.prototype.createTable=function(){return this.geoPackage.getTableCreator().createTileScaling()},e.prototype.queryForTableName=function(t){var n=this.queryForAll(this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t),this.buildWhereArgs(t));return n.length>0?this.createObject(n[0]):null},e.prototype.deleteByTableName=function(t){return this.deleteWhere(this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t),this.buildWhereArgs(t))},e.TABLE_NAME="nga_tile_scaling",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_SCALING_TYPE="scaling_type",e.COLUMN_ZOOM_IN="zoom_in",e.COLUMN_ZOOM_OUT="zoom_out",e}(o.Dao);e.TileScalingDao=s},2777:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TileScalingType=void 0,(n=e.TileScalingType||(e.TileScalingType={})).IN="in",n.OUT="out",n.IN_OUT="in_out",n.OUT_IN="out_in",n.CLOSEST_IN_OUT="closest_in_out",n.CLOSEST_OUT_IN="closest_out_in"},8116:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SchemaExtension=void 0;var o=n(8140),a=n(624),s=n(4941),u=n(7175),l=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getOrCreateExtension=function(){var t=[];return t.push(this.getOrCreate(e.EXTENSION_NAME,s.DataColumnsDao.TABLE_NAME,null,e.EXTENSION_SCHEMA_DEFINITION,a.Extension.READ_WRITE)),t.push(this.getOrCreate(e.EXTENSION_NAME,u.DataColumnConstraintsDao.TABLE_NAME,null,e.EXTENSION_SCHEMA_DEFINITION,a.Extension.READ_WRITE)),t},e.prototype.has=function(){return this.hasExtensions(e.EXTENSION_NAME)},e.prototype.removeExtension=function(){this.geoPackage.isTable(s.DataColumnsDao.TABLE_NAME)&&this.geoPackage.dropTable(s.DataColumnsDao.TABLE_NAME),this.geoPackage.isTable(u.DataColumnConstraintsDao.TABLE_NAME)&&this.geoPackage.dropTable(u.DataColumnConstraintsDao.TABLE_NAME),this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)},e.EXTENSION_SCHEMA_AUTHOR="gpkg",e.EXTENSION_SCHEMA_NAME_NO_AUTHOR="schema",e.EXTENSION_NAME=e.EXTENSION_SCHEMA_AUTHOR+"_"+e.EXTENSION_SCHEMA_NAME_NO_AUTHOR,e.EXTENSION_SCHEMA_DEFINITION="http://www.geopackage.org/spec/#extension_schema",e}(o.BaseExtension);e.SchemaExtension=l},612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureStyle=void 0;var n=function(){function t(t,e){this.styleRow=t,this.iconRow=e}return Object.defineProperty(t.prototype,"style",{get:function(){return this.styleRow},set:function(t){this.styleRow=t},enumerable:!1,configurable:!0}),t.prototype.hasStyle=function(){return!!this.styleRow},Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconRow},set:function(t){this.iconRow=t},enumerable:!1,configurable:!0}),t.prototype.hasIcon=function(){return!!this.iconRow},t.prototype.useIcon=function(){return this.hasIcon()&&(!this.iconRow.isTableIcon()||!this.hasStyle()||this.styleRow.isTableStyle())},t}();e.FeatureStyle=n},2752:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureStyles=void 0;e.FeatureStyles=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.styles=t,this.icons=e}},6536:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTableStyles=void 0;var r=n(2752),i=n(612),o=n(7924),a=n(4725),s=n(8412),u=n(9211),l=function(){function t(t,e){this.geoPackage=t,e instanceof s.FeatureTable?this.tableName=e.getTableName():this.tableName=e,this.featureStyleExtension=t.featureStyleExtension,this.cachedTableFeatureStyles=new r.FeatureStyles}return t.prototype.getFeatureStyleExtension=function(){return this.featureStyleExtension},t.prototype.getTableName=function(){return this.tableName},t.prototype.has=function(){return this.featureStyleExtension.has(this.tableName)},t.prototype.createRelationships=function(){return this.featureStyleExtension.createRelationships(this.tableName)},t.prototype.hasRelationship=function(){return this.featureStyleExtension.hasRelationship(this.tableName)},t.prototype.createStyleRelationship=function(){return this.featureStyleExtension.createStyleRelationship(this.tableName)},t.prototype.hasStyleRelationship=function(){return this.featureStyleExtension.hasStyleRelationship(this.tableName)},t.prototype.createTableStyleRelationship=function(){return this.featureStyleExtension.createTableStyleRelationship(this.tableName)},t.prototype.hasTableStyleRelationship=function(){return this.featureStyleExtension.hasTableStyleRelationship(this.tableName)},t.prototype.createIconRelationship=function(){return this.featureStyleExtension.createIconRelationship(this.tableName)},t.prototype.hasIconRelationship=function(){return this.featureStyleExtension.hasIconRelationship(this.tableName)},t.prototype.createTableIconRelationship=function(){return this.featureStyleExtension.createTableIconRelationship(this.tableName)},t.prototype.hasTableIconRelationship=function(){return this.featureStyleExtension.hasTableIconRelationship(this.tableName)},t.prototype.deleteRelationships=function(){return this.featureStyleExtension.deleteRelationships(this.tableName)},t.prototype.deleteStyleRelationship=function(){return this.featureStyleExtension.deleteStyleRelationship(this.tableName)},t.prototype.deleteTableStyleRelationship=function(){return this.featureStyleExtension.deleteTableStyleRelationship(this.tableName)},t.prototype.deleteIconRelationship=function(){return this.featureStyleExtension.deleteIconRelationship(this.tableName)},t.prototype.deleteTableIconRelationship=function(){return this.featureStyleExtension.deleteTableIconRelationship(this.tableName)},t.prototype.getStyleMappingDao=function(){return this.featureStyleExtension.getStyleMappingDao(this.tableName)},t.prototype.getTableStyleMappingDao=function(){return this.featureStyleExtension.getTableStyleMappingDao(this.tableName)},t.prototype.getIconMappingDao=function(){return this.featureStyleExtension.getIconMappingDao(this.tableName)},t.prototype.getTableIconMappingDao=function(){return this.featureStyleExtension.getTableIconMappingDao(this.tableName)},t.prototype.getStyleDao=function(){return this.featureStyleExtension.getStyleDao()},t.prototype.getIconDao=function(){return this.featureStyleExtension.getIconDao()},t.prototype.getTableFeatureStyles=function(){return this.featureStyleExtension.getTableFeatureStyles(this.tableName)},t.prototype.getTableStyles=function(){return this.featureStyleExtension.getTableStyles(this.tableName)},t.prototype.getCachedTableStyles=function(){var t=this.cachedTableFeatureStyles.styles;return null===t&&(null===(t=this.getTableStyles())&&(t=new o.Styles(!0)),this.cachedTableFeatureStyles.styles=t),t.isEmpty()&&(t=null),t},t.prototype.getTableStyle=function(t){return this.featureStyleExtension.getTableStyle(this.tableName,t)},t.prototype.getTableStyleDefault=function(){return this.featureStyleExtension.getTableStyleDefault(this.tableName)},t.prototype.getTableIcons=function(){return this.featureStyleExtension.getTableIcons(this.tableName)},t.prototype.getCachedTableIcons=function(){var t=this.cachedTableFeatureStyles.icons;return null===t&&(null===(t=this.getTableIcons())&&(t=new a.Icons(!0)),this.cachedTableFeatureStyles.icons=t),t.isEmpty()&&(t=null),t},t.prototype.getTableIcon=function(t){return this.featureStyleExtension.getTableIcon(this.tableName,t)},t.prototype.getTableIconDefault=function(){return this.featureStyleExtension.getTableIconDefault(this.tableName)},t.prototype.getFeatureStylesForFeatureRow=function(t){return this.featureStyleExtension.getFeatureStylesForFeatureRow(t)},t.prototype.getFeatureStyles=function(t){return this.featureStyleExtension.getFeatureStyles(this.tableName,t)},t.prototype.getFeatureStyleForFeatureRow=function(t){return this.getFeatureStyleForFeatureRowAndGeometryType(t,u.GeometryType.fromName(t.geometryType.toUpperCase()))},t.prototype.getFeatureStyleForFeatureRowAndGeometryType=function(t,e){return this.getFeatureStyle(t.id,e)},t.prototype.getFeatureStyleDefaultForFeatureRow=function(t){return this.getFeatureStyle(t.id,null)},t.prototype.getFeatureStyle=function(t,e){var n=null,r=this.getStyle(t,e),o=this.getIcon(t,e);return null==r&&null==o||(n=new i.FeatureStyle(r,o)),n},t.prototype.getFeatureStyleDefault=function(t){return this.getFeatureStyle(t,null)},t.prototype.getStylesForFeatureRow=function(t){return this.featureStyleExtension.getStylesForFeatureRow(t)},t.prototype.getStylesForFeatureId=function(t){return this.featureStyleExtension.getStylesForFeatureId(this.tableName,t)},t.prototype.getStyleForFeatureRow=function(t){return this.getStyleForFeatureRowAndGeometryType(t,u.GeometryType.fromName(t.geometryType.toUpperCase()))},t.prototype.getStyleForFeatureRowAndGeometryType=function(t,e){return this.getStyle(t.id,e)},t.prototype.getStyleDefaultForFeatureRow=function(t){return this.getStyle(t.id,null)},t.prototype.getStyle=function(t,e){var n=this.featureStyleExtension.getStyle(this.tableName,t,e,!1);if(null===n){var r=this.getCachedTableStyles();null!==r&&(n=r.getStyle(e))}return n},t.prototype.getStyleDefault=function(t){return this.getStyle(t,null)},t.prototype.getIconsForFeatureRow=function(t){return this.featureStyleExtension.getIconsForFeatureRow(t)},t.prototype.getIconsForFeatureId=function(t){return this.featureStyleExtension.getIconsForFeatureId(this.tableName,t)},t.prototype.getIconForFeatureRow=function(t){return this.getIconForFeatureRowAndGeometryType(t,u.GeometryType.fromName(t.geometryType.toUpperCase()))},t.prototype.getIconForFeatureRowAndGeometryType=function(t,e){return this.getIcon(t.id,e)},t.prototype.getIconDefaultForFeatureRow=function(t){return this.getIcon(t.id,null)},t.prototype.getIcon=function(t,e){var n=this.featureStyleExtension.getIcon(this.tableName,t,e,!1);if(null===n){var r=this.getCachedTableIcons();null!==r&&(n=r.getIcon(e))}return n},t.prototype.getIconDefault=function(t){return this.getIcon(t,null)},t.prototype.setTableFeatureStyles=function(t){var e=this.featureStyleExtension.setTableFeatureStyles(this.tableName,t);return this.clearCachedTableFeatureStyles(),e},t.prototype.setTableStyles=function(t){var e=this.featureStyleExtension.setTableStyles(this.tableName,t);return this.clearCachedTableStyles(),e},t.prototype.setTableStyleDefault=function(t){var e=this.featureStyleExtension.setTableStyleDefault(this.tableName,t);return this.clearCachedTableStyles(),e},t.prototype.setTableStyle=function(t,e){var n=this.featureStyleExtension.setTableStyle(this.tableName,t,e);return this.clearCachedTableStyles(),n},t.prototype.setTableIcons=function(t){var e=this.featureStyleExtension.setTableIcons(this.tableName,t);return this.clearCachedTableIcons(),e},t.prototype.setTableIconDefault=function(t){var e=this.featureStyleExtension.setTableIconDefault(this.tableName,t);return this.clearCachedTableIcons(),e},t.prototype.setTableIcon=function(t,e){var n=this.featureStyleExtension.setTableIcon(this.tableName,t,e);return this.clearCachedTableIcons(),n},t.prototype.setFeatureStylesForFeatureRow=function(t,e){return this.featureStyleExtension.setFeatureStylesForFeatureRow(t,e)},t.prototype.setFeatureStyles=function(t,e){return this.featureStyleExtension.setFeatureStyles(this.tableName,t,e)},t.prototype.setFeatureStyleForFeatureRow=function(t,e){return this.featureStyleExtension.setFeatureStyleForFeatureRow(t,e)},t.prototype.setFeatureStyleForFeatureRowAndGeometryType=function(t,e,n){return this.featureStyleExtension.setFeatureStyleForFeatureRowAndGeometryType(t,e,n)},t.prototype.setFeatureStyleDefaultForFeatureRow=function(t,e){return this.featureStyleExtension.setFeatureStyleDefaultForFeatureRow(t,e)},t.prototype.setFeatureStyle=function(t,e,n){return this.featureStyleExtension.setFeatureStyle(this.tableName,t,e,n)},t.prototype.setFeatureStyleDefault=function(t,e){return this.featureStyleExtension.setFeatureStyleDefault(this.tableName,t,e)},t.prototype.setStylesForFeatureRow=function(t,e){return this.featureStyleExtension.setStylesForFeatureRow(t,e)},t.prototype.setStyles=function(t,e){return this.featureStyleExtension.setStyles(this.tableName,t,e)},t.prototype.setStyleForFeatureRow=function(t,e){return this.featureStyleExtension.setStyleForFeatureRow(t,e)},t.prototype.setStyleForFeatureRowAndGeometryType=function(t,e,n){return this.featureStyleExtension.setStyleForFeatureRowAndGeometryType(t,e,n)},t.prototype.setStyleDefaultForFeatureRow=function(t,e){return this.featureStyleExtension.setStyleDefaultForFeatureRow(t,e)},t.prototype.setStyle=function(t,e,n){return this.featureStyleExtension.setStyle(this.tableName,t,e,n)},t.prototype.setStyleDefault=function(t,e){return this.featureStyleExtension.setStyleDefault(this.tableName,t,e)},t.prototype.setIconsForFeatureRow=function(t,e){return this.featureStyleExtension.setIconsForFeatureRow(t,e)},t.prototype.setIcons=function(t,e){return this.featureStyleExtension.setIcons(this.tableName,t,e)},t.prototype.setIconForFeatureRow=function(t,e){return this.featureStyleExtension.setIconForFeatureRow(t,e)},t.prototype.setIconForFeatureRowAndGeometryType=function(t,e,n){return this.featureStyleExtension.setIconForFeatureRowAndGeometryType(t,e,n)},t.prototype.setIconDefaultForFeatureRow=function(t,e){return this.featureStyleExtension.setIconDefaultForFeatureRow(t,e)},t.prototype.setIcon=function(t,e,n){return this.featureStyleExtension.setIcon(this.tableName,t,e,n)},t.prototype.setIconDefault=function(t,e){return this.featureStyleExtension.setIconDefault(this.tableName,t,e)},t.prototype.deleteAllFeatureStyles=function(){var t=this.featureStyleExtension.deleteAllFeatureStyles(this.tableName);return this.clearCachedTableFeatureStyles(),t},t.prototype.deleteAllStyles=function(){var t=this.featureStyleExtension.deleteAllStyles(this.tableName);return this.clearCachedTableStyles(),t},t.prototype.deleteAllIcons=function(){var t=this.featureStyleExtension.deleteAllIcons(this.tableName);return this.clearCachedTableIcons(),t},t.prototype.deleteTableFeatureStyles=function(){var t=this.featureStyleExtension.deleteTableFeatureStyles(this.tableName);return this.clearCachedTableFeatureStyles(),t},t.prototype.deleteTableStyles=function(){var t=this.featureStyleExtension.deleteTableStyles(this.tableName);return this.clearCachedTableStyles(),t},t.prototype.deleteTableStyleDefault=function(){var t=this.featureStyleExtension.deleteTableStyleDefault(this.tableName);return this.clearCachedTableStyles(),t},t.prototype.deleteTableStyle=function(t){var e=this.featureStyleExtension.deleteTableStyle(this.tableName,t);return this.clearCachedTableStyles(),e},t.prototype.deleteTableIcons=function(){var t=this.featureStyleExtension.deleteTableIcons(this.tableName);return this.clearCachedTableIcons(),t},t.prototype.deleteTableIconDefault=function(){var t=this.featureStyleExtension.deleteTableIconDefault(this.tableName);return this.clearCachedTableIcons(),t},t.prototype.deleteTableIcon=function(t){var e=this.featureStyleExtension.deleteTableIcon(this.tableName,t);return this.clearCachedTableIcons(),e},t.prototype.clearCachedTableFeatureStyles=function(){this.cachedTableFeatureStyles.styles=null,this.cachedTableFeatureStyles.icons=null},t.prototype.clearCachedTableStyles=function(){this.cachedTableFeatureStyles.styles=null},t.prototype.clearCachedTableIcons=function(){this.cachedTableFeatureStyles.icons=null},t.prototype.deleteFeatureStyles=function(){return this.featureStyleExtension.deleteFeatureStyles(this.tableName)},t.prototype.deleteStyles=function(){return this.featureStyleExtension.deleteStyles(this.tableName)},t.prototype.deleteStylesForFeatureRow=function(t){return this.featureStyleExtension.deleteStylesForFeatureRow(t)},t.prototype.deleteStylesForFeatureId=function(t){return this.featureStyleExtension.deleteStylesForFeatureId(this.tableName,t)},t.prototype.deleteStyleDefaultForFeatureRow=function(t){return this.featureStyleExtension.deleteStyleDefaultForFeatureRow(t)},t.prototype.deleteStyleDefault=function(t){return this.featureStyleExtension.deleteStyleDefault(this.tableName,t)},t.prototype.deleteStyleForFeatureRow=function(t){return this.featureStyleExtension.deleteStyleForFeatureRow(t)},t.prototype.deleteStyleForFeatureRowAndGeometryType=function(t,e){return this.featureStyleExtension.deleteStyleForFeatureRowAndGeometryType(t,e)},t.prototype.deleteStyle=function(t,e){return this.featureStyleExtension.deleteStyle(this.tableName,t,e)},t.prototype.deleteStyleAndMappingsByStyleRow=function(t){return this.featureStyleExtension.deleteStyleAndMappingsByStyleRow(this.tableName,t)},t.prototype.deleteStyleAndMappingsByStyleRowId=function(t){return this.featureStyleExtension.deleteStyleAndMappingsByStyleRowId(this.tableName,t)},t.prototype.deleteIcons=function(){return this.featureStyleExtension.deleteIcons(this.tableName)},t.prototype.deleteIconsForFeatureRow=function(t){return this.featureStyleExtension.deleteIconsForFeatureRow(t)},t.prototype.deleteIconsForFeatureId=function(t){return this.featureStyleExtension.deleteIconsForFeatureId(this.tableName,t)},t.prototype.deleteIconDefaultForFeatureRow=function(t){return this.featureStyleExtension.deleteIconDefaultForFeatureRow(t)},t.prototype.deleteIconDefault=function(t){return this.featureStyleExtension.deleteIconDefault(this.tableName,t)},t.prototype.deleteIconForFeatureRow=function(t){return this.featureStyleExtension.deleteIconForFeatureRow(t)},t.prototype.deleteIconForFeatureRowAndGeometryType=function(t,e){return this.featureStyleExtension.deleteIconForFeatureRowAndGeometryType(t,e)},t.prototype.deleteIcon=function(t,e){return this.featureStyleExtension.deleteIcon(this.tableName,t,e)},t.prototype.deleteIconAndMappingsByIconRow=function(t){return this.featureStyleExtension.deleteIconAndMappingsByIconRow(this.tableName,t)},t.prototype.deleteIconAndMappingsByIconRowId=function(t){return this.featureStyleExtension.deleteIconAndMappingsByIconRowId(this.tableName,t)},t.prototype.getAllTableStyleIds=function(){return this.featureStyleExtension.getAllTableStyleIds(this.tableName)},t.prototype.getAllTableIconIds=function(){return this.featureStyleExtension.getAllTableIconIds(this.tableName)},t.prototype.getAllStyleIds=function(){return this.featureStyleExtension.getAllStyleIds(this.tableName)},t.prototype.getAllIconIds=function(){return this.featureStyleExtension.getAllIconIds(this.tableName)},t}();e.FeatureTableStyles=l},8600:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.IconCache=void 0;var o=n(3437),a=n(9325),s=function(){function t(e){void 0===e&&(e=t.DEFAULT_CACHE_SIZE),this.cacheSize=e,this.iconCache={},this.accessHistory=[]}return t.prototype.getIconForIconRow=function(t){return this.get(t.id)},t.prototype.get=function(t){var e=this.iconCache[t];if(e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1),this.accessHistory.push(t)}return e},t.prototype.putIconForIconRow=function(t,e){return this.put(t.id,e)},t.prototype.put=function(t,e){var n=this.iconCache[t];if(this.iconCache[t]=e,n){var r=this.accessHistory.indexOf(t);r>-1&&this.accessHistory.splice(r,1)}if(this.accessHistory.push(t),Object.keys(this.iconCache).length>this.cacheSize){var i=this.accessHistory.shift();if(i){var a=this.iconCache[i];a&&o.Canvas.disposeImage(a),delete this.iconCache[i]}}return n},t.prototype.removeIconForIconRow=function(t){return this.remove(t.id)},t.prototype.remove=function(t){var e=this.iconCache[t];if(delete this.iconCache[t],e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1)}return e},t.prototype.clear=function(){var t=this;Object.keys(this.iconCache).forEach((function(e){var n=t.iconCache[e];o.Canvas.disposeImage(n)})),this.iconCache={},this.accessHistory=[]},t.prototype.resize=function(t){this.cacheSize=t;var e=Object.keys(this.iconCache);if(e.length>t)for(var n=e.length-t,r=0;r<n;r++){var i=this.accessHistory.shift(),a=this.iconCache[i];o.Canvas.disposeImage(a),delete this.iconCache[i]}},t.prototype.createIcon=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.createAndCacheIcon(t,this)]}))}))},t.prototype.createScaledIcon=function(t,e){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.createAndCacheScaledIcon(t,e,this)]}))}))},t.prototype.createIconNoCache=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.createScaledIconNoCache(t,1)]}))}))},t.prototype.createScaledIconNoCache=function(t,e){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.createAndCacheScaledIcon(t,e,null)]}))}))},t.prototype.createAndCacheIcon=function(t,e){return r(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.createAndCacheScaledIcon(t,1,e)]}))}))},t.prototype.createAndCacheScaledIcon=function(t,e,n){return r(this,void 0,void 0,(function(){var r,o,s,u,l,c,h,f,p;return i(this,(function(i){switch(i.label){case 0:if(r=null,null==t)return[3,7];if(o=t.id,null!=n&&(r=n.get(o)),null!=r)return[3,7];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,a.ImageUtils.getImage(t.data)];case 2:return r=i.sent(),[3,4];case 3:throw i.sent(),new Error("Failed to get the Icon Row image. Id: "+o+", Name: "+t.name);case 4:return s=r.width,u=r.height,l=t.width,c=t.height,(h=null!=l||null!=c)||1==e||(l=s,c=u,h=!0),h?(null==l?l=s*(c/u):null==c&&(c=u*(l/s)),f=Math.round(e*l),p=Math.round(e*c),f==s&&p==u?[3,6]:[4,a.ImageUtils.scaleImage(r,f,p)]):[3,6];case 5:r=i.sent(),i.label=6;case 6:null!=n&&n.putIconForIconRow(t,r),i.label=7;case 7:return[2,r]}}))}))},t.DEFAULT_CACHE_SIZE=100,t}();e.IconCache=s},9529:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.IconDao=void 0;var o=n(7502),a=n(9087),s=function(t){function e(e,n){return t.call(this,e,n)||this}return i(e,t),e.prototype.newRow=function(t,e){return new a.IconRow(this.table,t,e)},e}(o.MediaDao);e.IconDao=s},9087:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.IconRow=void 0;var o=n(6119),a=n(9325),s=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.tableIcon=!1,i.iconTable=e,i}return i(e,t),Object.defineProperty(e.prototype,"nameColumn",{get:function(){return this.iconTable.getNameColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.getValueWithColumnName(this.nameColumn.name)},set:function(t){this.setValueWithColumnName(this.nameColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"descriptionColumn",{get:function(){return this.iconTable.getDescriptionColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return this.getValueWithColumnName(this.descriptionColumn.name)},set:function(t){this.setValueWithColumnName(this.descriptionColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"widthColumn",{get:function(){return this.iconTable.getWidthColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.getValueWithColumnName(this.widthColumn.name)},set:function(t){this.setValueWithColumnName(this.widthColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"derivedWidth",{get:function(){var t=this.width;return null==t&&(t=this.derivedDimensions[0]),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heightColumn",{get:function(){return this.iconTable.getHeightColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.getValueWithColumnName(this.heightColumn.name)},set:function(t){this.setValueWithColumnName(this.heightColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"derivedHeight",{get:function(){var t=this.height;return null==t&&(t=this.derivedDimensions[1]),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"derivedDimensions",{get:function(){var t=this.width,e=this.height;if(null==t||null==e){var n=a.ImageUtils.getImageSize(this.data),r=n.width,i=n.height;null==t&&(t=r,null!=e&&(t*=e/i)),null==e&&(e=i,null!=t&&(e*=t/r))}return[t,e]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchorUColumn",{get:function(){return this.iconTable.getAnchorUColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchorU",{get:function(){return this.getValueWithColumnName(this.anchorUColumn.name)},set:function(t){this.validateAnchor(t),this.setValueWithColumnName(this.anchorUColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchorUOrDefault",{get:function(){var t=this.anchorU;return null==t&&(t=.5),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchorVColumn",{get:function(){return this.iconTable.getAnchorVColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchorV",{get:function(){return this.getValueWithColumnName(this.anchorVColumn.name)},set:function(t){this.validateAnchor(t),this.setValueWithColumnName(this.anchorVColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchorVOrDefault",{get:function(){var t=this.anchorV;return null==t&&(t=1),t},enumerable:!1,configurable:!0}),e.prototype.validateAnchor=function(t){if(null!=t&&(t<0||t>1))throw new Error("Anchor must be set inclusively between 0.0 and 1.0, invalid value: "+t);return!0},e.prototype.isTableIcon=function(){return this.tableIcon},e.prototype.setTableIcon=function(t){this.tableIcon=t},e}(o.MediaRow);e.IconRow=s},2015:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.IconTable=void 0;var o=n(6366),a=n(7319),s=n(5865),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.TABLE_TYPE="media",e}return i(e,t),e.prototype.getNameColumnIndex=function(){return this.getColumnIndex(e.COLUMN_NAME)},e.prototype.getNameColumn=function(){return this.getColumnWithColumnName(e.COLUMN_NAME)},e.prototype.getDescriptionColumnIndex=function(){return this.getColumnIndex(e.COLUMN_DESCRIPTION)},e.prototype.getDescriptionColumn=function(){return this.getColumnWithColumnName(e.COLUMN_DESCRIPTION)},e.prototype.getWidthColumnIndex=function(){return this.getColumnIndex(e.COLUMN_WIDTH)},e.prototype.getWidthColumn=function(){return this.getColumnWithColumnName(e.COLUMN_WIDTH)},e.prototype.getHeightColumnIndex=function(){return this.getColumnIndex(e.COLUMN_HEIGHT)},e.prototype.getHeightColumn=function(){return this.getColumnWithColumnName(e.COLUMN_HEIGHT)},e.prototype.getAnchorUColumnIndex=function(){return this.getColumnIndex(e.COLUMN_ANCHOR_U)},e.prototype.getAnchorUColumn=function(){return this.getColumnWithColumnName(e.COLUMN_ANCHOR_U)},e.prototype.getAnchorVColumnIndex=function(){return this.getColumnIndex(e.COLUMN_ANCHOR_V)},e.prototype.getAnchorVColumn=function(){return this.getColumnWithColumnName(e.COLUMN_ANCHOR_V)},e.create=function(){return new e(e.TABLE_NAME,e.createColumns(),e.requiredColumns())},e.createRequiredColumns=function(){return o.MediaTable.createRequiredColumns()},e.requiredColumns=function(){return o.MediaTable.requiredColumns()},e.createColumns=function(){var t=e.createRequiredColumns(),n=t.length;return t.push(s.UserColumn.createColumn(n++,e.COLUMN_NAME,a.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_DESCRIPTION,a.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_WIDTH,a.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_HEIGHT,a.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_ANCHOR_U,a.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n,e.COLUMN_ANCHOR_V,a.GeoPackageDataType.REAL,!1)),t},e.TABLE_NAME="nga_icon",e.COLUMN_NAME="name",e.COLUMN_DESCRIPTION="description",e.COLUMN_WIDTH="width",e.COLUMN_HEIGHT="height",e.COLUMN_ANCHOR_U="anchor_u",e.COLUMN_ANCHOR_V="anchor_v",e}(o.MediaTable);e.IconTable=u},4725:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Icons=void 0;var n=function(){function t(t){void 0===t&&(t=!1),this.defaultIcon=null,this.icons=new Map,this.tableIcons=t}return t.prototype.setDefault=function(t){null!=t&&t.setTableIcon(this.tableIcons),this.defaultIcon=t},t.prototype.getDefault=function(){return this.defaultIcon},t.prototype.setIcon=function(t,e){void 0===e&&(e=null),null!==e?null!=t?(t.setTableIcon(this.tableIcons),this.icons.set(e,t)):this.icons.delete(e):this.setDefault(t)},t.prototype.getIcon=function(t){void 0===t&&(t=null);var e=null;return null!==t&&this.icons.has(t)&&(e=this.icons.get(t)),null!=e&&null!==t||(e=this.getDefault()),e},t.prototype.isEmpty=function(){return 0===this.icons.size&&null===this.defaultIcon},t.prototype.getGeometryTypes=function(){return Array.from(this.icons.keys())},t}();e.Icons=n},8479:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureStyleExtension=void 0;var o=n(8140),a=n(624),s=n(7092),u=n(2015),l=n(9529),c=n(3934),h=n(3237),f=n(8138),p=n(3410),d=n(1553),y=n(8412),m=n(2752),g=n(612),_=n(7924),b=n(4725),v=n(362),T=n(9211),E=function(t){function e(e){var n=t.call(this,e)||this;return n.relatedTablesExtension=e.relatedTablesExtension,n.contentsIdExtension=e.contentsIdExtension,n}return i(e,t),e.prototype.getOrCreateExtension=function(t){return this.getOrCreate(e.EXTENSION_NAME,this.getFeatureTableName(t),null,e.EXTENSION_DEFINITION,a.Extension.READ_WRITE)},e.prototype.has=function(t){return this.hasExtension(e.EXTENSION_NAME,this.getFeatureTableName(t),null)},e.prototype.getTables=function(){var t=[];if(this.extensionsDao.isTableExists())for(var n=this.extensionsDao.queryAllByExtension(e.EXTENSION_NAME),r=0;r<n.length;r++)t.push(n[r].table_name);return t},e.prototype.getRelatedTables=function(){return this.relatedTablesExtension},e.prototype.getContentsId=function(){return this.contentsIdExtension},e.prototype.createRelationships=function(t){return{styleRelationship:this.createStyleRelationship(t),tableStyleRelationship:this.createTableStyleRelationship(t),iconRelationship:this.createIconRelationship(t),tableIconRelationship:this.createTableIconRelationship(t)}},e.prototype.hasRelationship=function(t){return this.hasStyleRelationship(t)||this.hasTableStyleRelationship(t)||this.hasIconRelationship(t)||this.hasTableIconRelationship(t)},e.prototype.createStyleRelationship=function(t){return this._createStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_STYLE,t),this.getFeatureTableName(t),this.getFeatureTableName(t),c.StyleTable.TABLE_NAME)},e.prototype.hasStyleRelationship=function(t){return this._hasStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_STYLE,t),this.getFeatureTableName(t),c.StyleTable.TABLE_NAME)},e.prototype.createTableStyleRelationship=function(t){return this._createStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_TABLE_STYLE,t),this.getFeatureTableName(t),s.ContentsIdDao.TABLE_NAME,c.StyleTable.TABLE_NAME)},e.prototype.hasTableStyleRelationship=function(t){return this._hasStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_TABLE_STYLE,t),s.ContentsIdDao.TABLE_NAME,c.StyleTable.TABLE_NAME)},e.prototype.createIconRelationship=function(t){return this._createStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_ICON,t),this.getFeatureTableName(t),this.getFeatureTableName(t),u.IconTable.TABLE_NAME)},e.prototype.hasIconRelationship=function(t){return this._hasStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_ICON,t),this.getFeatureTableName(t),u.IconTable.TABLE_NAME)},e.prototype.createTableIconRelationship=function(t){return this._createStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_TABLE_ICON,t),this.getFeatureTableName(t),s.ContentsIdDao.TABLE_NAME,u.IconTable.TABLE_NAME)},e.prototype.hasTableIconRelationship=function(t){return this._hasStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_TABLE_ICON,t),s.ContentsIdDao.TABLE_NAME,u.IconTable.TABLE_NAME)},e.prototype.getMappingTableName=function(t,e){return t+this.getFeatureTableName(e)},e.prototype._hasStyleRelationship=function(t,e,n){return this.relatedTablesExtension.hasRelations(e,n,t)},e.prototype._createStyleRelationship=function(t,e,n,r){return this._hasStyleRelationship(t,n,r)?this.geoPackage.extendedRelationDao.getRelations(n,r,t)[0]:(this.getOrCreateExtension(e),n!==s.ContentsIdDao.TABLE_NAME||this.contentsIdExtension.has()||this.contentsIdExtension.getOrCreateExtension(),this._handleCreateStyleRelationship(t,n,r))},e.prototype._handleCreateStyleRelationship=function(t,e,n){return n===c.StyleTable.TABLE_NAME?this.relatedTablesExtension.addAttributesRelationship(this.geoPackage.relatedTablesExtension.getRelationshipBuilder().setBaseTableName(e).setUserMappingTable(f.StyleMappingTable.create(t)).setRelatedTable(c.StyleTable.create())):this.relatedTablesExtension.addMediaRelationship(this.geoPackage.relatedTablesExtension.getRelationshipBuilder().setBaseTableName(e).setUserMappingTable(f.StyleMappingTable.create(t)).setRelatedTable(u.IconTable.create()))},e.prototype.deleteAllRelationships=function(){for(var t={styleRelationships:0,tableStyleRelationships:0,iconRelationship:0,tableIconRelationship:0},e=this.getTables(),n=0;n<e.length;n++){var r=this.deleteRelationships(e[n]),i=r.styleRelationships,o=r.tableStyleRelationships,a=r.iconRelationship,s=r.tableIconRelationship;t.styleRelationships+=i,t.tableStyleRelationships+=o,t.iconRelationship+=a,t.tableIconRelationship+=s}return t},e.prototype.deleteRelationships=function(t){return{styleRelationships:this.deleteStyleRelationship(t),tableStyleRelationships:this.deleteTableStyleRelationship(t),iconRelationship:this.deleteIconRelationship(t),tableIconRelationship:this.deleteTableIconRelationship(t)}},e.prototype.deleteStyleRelationship=function(t){return this._deleteStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_STYLE,t),t)},e.prototype.deleteTableStyleRelationship=function(t){return this._deleteStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_TABLE_STYLE,t),t)},e.prototype.deleteIconRelationship=function(t){return this._deleteStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_ICON,t),t)},e.prototype.deleteTableIconRelationship=function(t){return this._deleteStyleRelationship(this.getMappingTableName(e.TABLE_MAPPING_TABLE_ICON,t),t)},e.prototype._deleteStyleRelationship=function(t,n){return this.relatedTablesExtension.removeRelationshipsWithMappingTable(t),this.hasRelationship(n)||this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtensionAndTableName(e.EXTENSION_NAME,this.getFeatureTableName(n)),0},e.prototype.getStyleMappingDao=function(t){return this._getMappingDao(e.TABLE_MAPPING_STYLE,t)},e.prototype.getTableStyleMappingDao=function(t){return this._getMappingDao(e.TABLE_MAPPING_TABLE_STYLE,t)},e.prototype.getIconMappingDao=function(t){return this._getMappingDao(e.TABLE_MAPPING_ICON,t)},e.prototype.getTableIconMappingDao=function(t){return this._getMappingDao(e.TABLE_MAPPING_TABLE_ICON,t)},e.prototype._getMappingDao=function(t,e){var n=t+this.getFeatureTableName(e),r=null;return this.geoPackage.isTable(n)&&(r=new p.StyleMappingDao(this.relatedTablesExtension.getUserDao(n),this.geoPackage)),r},e.prototype.getStyleDao=function(){var t=null;if(this.geoPackage.isTable(c.StyleTable.TABLE_NAME)){var e=this.geoPackage.contentsDao.queryForId(c.StyleTable.TABLE_NAME);if(e){var n=new d.StyleTableReader(e.table_name).readTable(this.geoPackage.connection);n.setContents(e),t=new h.StyleDao(this.geoPackage,n)}}return t},e.prototype.getIconDao=function(){var t=null;if(this.geoPackage.isTable(u.IconTable.TABLE_NAME)){var e=new v.UserCustomTableReader(u.IconTable.TABLE_NAME).readTable(this.geoPackage.database),n=new u.IconTable(e.getTableName(),e.getUserColumns().getColumns(),u.IconTable.requiredColumns());n.setContents(this.geoPackage.contentsDao.queryForId(u.IconTable.TABLE_NAME)),t=new l.IconDao(this.geoPackage,n)}return t},e.prototype.getTableFeatureStyles=function(t){var e=null;if(null!==this.contentsIdExtension.getIdByTableName(this.getFeatureTableName(t))){var n=this.getTableStyles(t),r=this.getTableIcons(t);null===n&&null===r||(e=new m.FeatureStyles(n,r))}return e},e.prototype.getTableStyleDefault=function(t){return this.getTableStyle(t,null)},e.prototype.getTableStyle=function(t,e){var n=null,r=this.getTableStyles(t);return null!==r&&(n=null===e?r.getDefault():r.getStyle(e)),n},e.prototype.getTableStyles=function(t){var e=null,n=this.contentsIdExtension.getIdByTableName(this.getFeatureTableName(t));return null!==n&&(e=this.getStyles(n,this.getTableStyleMappingDao(t),!0)),e},e.prototype.getTableIconDefault=function(t){return this.getTableIcon(t,null)},e.prototype.getTableIcon=function(t,e){var n=null,r=this.getTableIcons(t);return null!==r&&(n=null===e?r.getDefault():r.getIcon(e)),n},e.prototype.getTableIcons=function(t){var e=null,n=this.contentsIdExtension.getIdByTableName(this.getFeatureTableName(t));return null!==n&&(e=this.getIcons(n,this.getTableIconMappingDao(t),!0)),e},e.prototype.getIcons=function(t,e,n){void 0===n&&(n=!1);var r=new b.Icons(n);if(null!==e)for(var i=this.getIconDao(),o=e.queryByBaseId(t),a=0;a<o.length;a++){var s=e.createObject(o[a]),u=i.queryForId(s.relatedId);null===s.getGeometryTypeName()?r.setDefault(u):r.setIcon(u,T.GeometryType.fromName(s.getGeometryTypeName().toUpperCase()))}return r.isEmpty()&&(r=null),r},e.prototype.getStyles=function(t,e,n){void 0===n&&(n=!1);var r=new _.Styles(n);if(null!==e)for(var i=this.getStyleDao(),o=e.queryByBaseId(t),a=0;a<o.length;a++){var s=e.createObject(o[a]),u=i.queryForId(s.relatedId);null===s.getGeometryTypeName()?r.setDefault(u):r.setStyle(u,T.GeometryType.fromName(s.getGeometryTypeName().toUpperCase()))}return r.isEmpty()&&(r=null),r},e.prototype.getFeatureStylesForFeatureRow=function(t){return this.getFeatureStyles(t.featureTable,t.id)},e.prototype.getFeatureStyles=function(t,e){var n=this.getStyles(e,this.getStyleMappingDao(t)),r=this.getIcons(e,this.getIconMappingDao(t)),i=null;return null===n&&null===r||(i=new m.FeatureStyles(n,r)),i},e.prototype.getStylesForFeatureRow=function(t){return this.getStyles(t.id,this.getStyleMappingDao(t.featureTable.getTableName()))},e.prototype.getStylesForFeatureId=function(t,e){return this.getStyles(e,this.getStyleMappingDao(t))},e.prototype.getIconsForFeatureRow=function(t){return this.getIcons(t.id,this.getIconMappingDao(t.featureTable.getTableName()))},e.prototype.getIconsForFeatureId=function(t,e){return this.getIcons(e,this.getIconMappingDao(t))},e.prototype.getFeatureStyleForFeatureRow=function(t){return new g.FeatureStyle(this.getStyle(t.featureTable.getTableName(),t.id,T.GeometryType.fromName(t.geometryType.toUpperCase()),!0),this.getIcon(t.featureTable.getTableName(),t.id,T.GeometryType.fromName(t.geometryType.toUpperCase()),!0))},e.prototype.getFeatureStyleDefault=function(t){return new g.FeatureStyle(this.getStyle(t.featureTable.getTableName(),t.id,null,!0),this.getIcon(t.featureTable.getTableName(),t.id,null,!0))},e.prototype.getIcon=function(t,e,n,r){var i=null,o=this.getIcons(e,this.getIconMappingDao(t));return null!==o&&(i=o.getIcon(n)),null===i&&r&&(i=this.getTableIcon(t,n)),i},e.prototype.getStyle=function(t,e,n,r){var i=null,o=this.getStyles(e,this.getStyleMappingDao(t));return null!==o&&(i=o.getStyle(n)),null===i&&r&&(i=this.getTableStyle(t,n)),i},e.prototype.setTableFeatureStyles=function(t,e){return null!==e?{tableStyles:this.setTableStyles(t,e.styles),tableIcons:this.setTableIcons(t,e.icons)}:{deleted:this.deleteTableFeatureStyles(t),tableStyles:void 0,tableIcons:void 0}},e.prototype.setTableStyles=function(t,e){var n=this.deleteTableStyles(t);if(null!==e){var r=[],i=void 0;null!==e.getDefault()&&(i=this.setTableStyleDefault(t,e.getDefault()));for(var o=e.getGeometryTypes(),a=0;a<o.length;a++){var s=o[a],u=e.getStyle(s);r.push(this.setTableStyle(t,s,u))}return{styleDefault:i,styles:r,deleted:n}}},e.prototype.setTableStyleDefault=function(t,e){return this.setTableStyle(t,null,e)},e.prototype.setTableStyle=function(t,e,n){if(this.deleteTableStyle(t,e),null!==n){this.createTableStyleRelationship(t);var r=this.contentsIdExtension.getOrCreateIdByTableName(this.getFeatureTableName(t)),i=this.getOrInsertStyle(n),o=this.getTableStyleMappingDao(t);return this.insertStyleMapping(o,r.id,i,e)}},e.prototype.setTableIcons=function(t,e){var n=this.deleteTableIcons(t);if(null!==e){var r=void 0,i=[];null!==e.getDefault()&&(r=this.setTableIconDefault(t,e.getDefault()));for(var o=e.getGeometryTypes(),a=0;a<o.length;a++){var s=o[a],u=e.getIcon(s);i.push(this.setTableIcon(t,s,u))}return{iconDefault:r,icons:i,deleted:n}}},e.prototype.setTableIconDefault=function(t,e){return this.setTableIcon(t,null,e)},e.prototype.setTableIcon=function(t,e,n){if(this.deleteTableIcon(t,e),null!==n){this.createTableIconRelationship(t);var r=this.contentsIdExtension.getOrCreateIdByTableName(this.getFeatureTableName(t)),i=this.getOrInsertIcon(n),o=this.getTableIconMappingDao(t);return this.insertStyleMapping(o,r.id,i,e)}},e.prototype.setFeatureStylesForFeatureRow=function(t,e){return this.setFeatureStyles(t.featureTable.getTableName(),t.id,e)},e.prototype.setFeatureStyles=function(t,e,n){return null!==n?{styles:this.setStyles(t,e,n.styles),icons:this.setIcons(t,e,n.icons)}:{styles:void 0,icons:void 0,deleted:{deletedStyles:this.deleteStyles(t),deletedIcons:this.deleteIcons(t)}}},e.prototype.setFeatureStyleForFeatureRow=function(t,e){return this.setFeatureStyleForFeatureRowAndGeometryType(t,T.GeometryType.fromName(t.geometryType.toUpperCase()),e)},e.prototype.setFeatureStyleForFeatureRowAndGeometryType=function(t,e,n){return this.setFeatureStyle(t.featureTable.getTableName(),t.id,e,n)},e.prototype.setFeatureStyleDefaultForFeatureRow=function(t,e){return this.setFeatureStyle(t.featureTable.getTableName(),t.id,null,e)},e.prototype.setFeatureStyle=function(t,e,n,r){return null!==r?{style:this.setStyle(t,e,n,r.style),icon:this.setIcon(t,e,n,r.icon)}:{style:void 0,icon:void 0,deleted:{style:this.deleteStyle(t,e,n),icon:this.deleteIcon(t,e,n)}}},e.prototype.setFeatureStyleDefault=function(t,e,n){return this.setFeatureStyle(t,e,null,n)},e.prototype.setStylesForFeatureRow=function(t,e){return this.setStyles(t.featureTable.getTableName(),t.id,e)},e.prototype.setStyles=function(t,e,n){var r=this.deleteStylesForFeatureId(t,e);if(null!==n){var i=[],o=void 0;null!==n.getDefault()&&(o=this.setStyleDefault(t,e,n.getDefault()));for(var a=n.getGeometryTypes(),s=0;s<a.length;s++)i.push(this.setStyle(t,e,a[s],n.getStyle(a[s])));return{styleDefault:o,styles:i,deleted:r}}return{styleDefault:void 0,styles:void 0,deleted:r}},e.prototype.setStyleForFeatureRow=function(t,e){return this.setStyleForFeatureRowAndGeometryType(t,T.GeometryType.fromName(t.geometryType.toUpperCase()),e)},e.prototype.setStyleForFeatureRowAndGeometryType=function(t,e,n){return this.setStyle(t.featureTable.getTableName(),t.id,e,n)},e.prototype.setStyleDefaultForFeatureRow=function(t,e){return this.setStyle(t.featureTable.getTableName(),t.id,null,e)},e.prototype.setStyle=function(t,e,n,r){if(this.deleteStyle(t,e,n),null!==r){this.createStyleRelationship(t);var i=this.getOrInsertStyle(r),o=this.getStyleMappingDao(t);return this.insertStyleMapping(o,e,i,n)}},e.prototype.setStyleDefault=function(t,e,n){return this.setStyle(t,e,null,n)},e.prototype.setIconsForFeatureRow=function(t,e){return this.setIcons(t.featureTable.getTableName(),t.id,e)},e.prototype.setIcons=function(t,e,n){var r=this.deleteIconsForFeatureId(t,e);if(null!==n){null!==n.getDefault()&&this.setIconDefault(t,e,n.getDefault());for(var i=n.getGeometryTypes(),o=0;o<i.length;o++)this.setIcon(t,e,i[o],n.getIcon(i[o]));return{iconDefault:void 0,icons:void 0,deleted:r}}return{iconDefault:void 0,icons:void 0,deleted:r}},e.prototype.setIconForFeatureRow=function(t,e){return this.setIconForFeatureRowAndGeometryType(t,T.GeometryType.fromName(t.geometryType.toUpperCase()),e)},e.prototype.setIconForFeatureRowAndGeometryType=function(t,e,n){return this.setIcon(t.featureTable.getTableName(),t.id,e,n)},e.prototype.setIconDefaultForFeatureRow=function(t,e){return this.setIcon(t.featureTable.getTableName(),t.id,null,e)},e.prototype.setIcon=function(t,e,n,r){if(this.deleteIcon(t,e,n),null!==r){this.createIconRelationship(t);var i=this.getOrInsertIcon(r),o=this.getIconMappingDao(t);return this.insertStyleMapping(o,e,i,n)}},e.prototype.setIconDefault=function(t,e,n){return this.setIcon(t,e,null,n)},e.prototype.getOrInsertStyle=function(t){var e;if(t.hasId())e=t.id;else{var n=this.getStyleDao();null!==n&&(e=n.create(t),t.id=e)}return e},e.prototype.getOrInsertIcon=function(t){var e;if(t.hasId())e=t.id;else{var n=this.getIconDao();null!=n&&(e=n.create(t),t.id=e)}return e},e.prototype.insertStyleMapping=function(t,e,n,r){void 0===r&&(r=null);var i=t.newRow();return i.baseId=e,i.relatedId=n,i.setGeometryTypeName(T.GeometryType.nameFromType(r)),t.create(i)},e.prototype.deleteAllFeatureStyles=function(t){return{tableStyles:this.deleteTableFeatureStyles(t),styles:this.deleteFeatureStyles(t)}},e.prototype.deleteAllStyles=function(t){return{tableStyles:this.deleteTableStyles(t),styles:this.deleteStyles(t)}},e.prototype.deleteAllIcons=function(t){return{tableIcons:this.deleteTableIcons(t),icons:this.deleteIcons(t)}},e.prototype.deleteTableFeatureStyles=function(t){return{styles:this.deleteTableStyles(t),icons:this.deleteTableIcons(t)}},e.prototype.deleteTableStyles=function(t){return this.deleteTableMappings(this.getTableStyleMappingDao(t),t)},e.prototype.deleteTableStyleDefault=function(t){return this.deleteTableStyle(t,null)},e.prototype.deleteTableStyle=function(t,e){return this.deleteTableMapping(this.getTableStyleMappingDao(t),t,e)},e.prototype.deleteTableIcons=function(t){return this.deleteTableMappings(this.getTableIconMappingDao(t),t)},e.prototype.deleteTableIconDefault=function(t){return this.deleteTableIcon(t,null)},e.prototype.deleteTableIcon=function(t,e){return this.deleteTableMapping(this.getTableIconMappingDao(t),t,e)},e.prototype.deleteTableMappings=function(t,e){if(null!==t){var n=this.contentsIdExtension.getIdByTableName(this.getFeatureTableName(e));if(null!==n)return t.deleteByBaseId(n)}return 0},e.prototype.deleteTableMapping=function(t,e,n){if(null!==t){var r=this.contentsIdExtension.getIdByTableName(this.getFeatureTableName(e));if(null!==r)return t.deleteByBaseIdAndGeometryType(r,n)}return 0},e.prototype.deleteFeatureStyles=function(t){return{styles:this.deleteStyles(t),icons:this.deleteIcons(t)}},e.prototype.deleteStyles=function(t){return this.deleteMappings(this.getStyleMappingDao(t))},e.prototype.deleteStylesForFeatureRow=function(t){return this.deleteStylesForFeatureId(t.featureTable.getTableName(),t.id)},e.prototype.deleteStylesForFeatureId=function(t,e){return this.deleteMappingsForFeatureId(this.getStyleMappingDao(t),e)},e.prototype.deleteStyleDefaultForFeatureRow=function(t){return this.deleteStyleForFeatureRowAndGeometryType(t,null)},e.prototype.deleteStyleDefault=function(t,e){return this.deleteStyle(t,e,null)},e.prototype.deleteStyleForFeatureRow=function(t){return this.deleteStyleForFeatureRowAndGeometryType(t,T.GeometryType.fromName(t.geometryType.toUpperCase()))},e.prototype.deleteStyleForFeatureRowAndGeometryType=function(t,e){return this.deleteStyle(t.featureTable,t.id,e)},e.prototype.deleteStyle=function(t,e,n){return this.deleteMapping(this.getStyleMappingDao(t),e,n)},e.prototype.deleteStyleAndMappingsByStyleRow=function(t,e){return this.deleteStyleAndMappingsByStyleRowId(t,e.id)},e.prototype.deleteStyleAndMappingsByStyleRowId=function(t,e){var n=0,r=this.getStyleDao();null!=r&&(n+=r.deleteById(e));var i=this.getStyleMappingDao(t);null!=i&&(n+=i.deleteByRelatedId(e));var o=this.getTableStyleMappingDao(t);return null!=o&&(n+=o.deleteByRelatedId(e)),n},e.prototype.deleteIcons=function(t){return this.deleteMappings(this.getIconMappingDao(t))},e.prototype.deleteIconsForFeatureRow=function(t){return this.deleteIconsForFeatureId(t.featureTable.getTableName(),t.id)},e.prototype.deleteIconsForFeatureId=function(t,e){return this.deleteMappingsForFeatureId(this.getIconMappingDao(t),e)},e.prototype.deleteIconDefaultForFeatureRow=function(t){return this.deleteIconDefault(t.featureTable.getTableName(),t.id)},e.prototype.deleteIconDefault=function(t,e){return this.deleteIcon(t,e,null)},e.prototype.deleteIconForFeatureRow=function(t){return this.deleteIconForFeatureRowAndGeometryType(t,T.GeometryType.fromName(t.geometryType.toUpperCase()))},e.prototype.deleteIconForFeatureRowAndGeometryType=function(t,e){return this.deleteIcon(t.featureTable,t.id,e)},e.prototype.deleteIcon=function(t,e,n){return this.deleteMapping(this.getIconMappingDao(t),e,n)},e.prototype.deleteIconAndMappingsByIconRow=function(t,e){return this.deleteIconAndMappingsByIconRowId(t,e.id)},e.prototype.deleteIconAndMappingsByIconRowId=function(t,e){var n=0,r=this.getIconDao();null!=r&&(n+=r.deleteById(e));var i=this.getIconMappingDao(t);null!=i&&(n+=i.deleteByRelatedId(e));var o=this.getTableIconMappingDao(t);return null!=o&&(n+=o.deleteByRelatedId(e)),n},e.prototype.deleteMappings=function(t){return null!==t?t.deleteAll():0},e.prototype.deleteMappingsForFeatureId=function(t,e){return null!==t&&e?t.deleteByBaseId(e):0},e.prototype.deleteMapping=function(t,e,n){return null!==t?t.deleteByBaseIdAndGeometryType(e,n):0},e.prototype.getAllTableStyleIds=function(t){var e=null,n=this.getTableStyleMappingDao(t);return null!==n&&(e=n.uniqueRelatedIds().map((function(t){return t.related_id}))),e},e.prototype.getAllTableIconIds=function(t){var e=null,n=this.getTableIconMappingDao(t);return null!==n&&(e=n.uniqueRelatedIds().map((function(t){return t.related_id}))),e},e.prototype.getAllStyleIds=function(t){var e=null,n=this.getStyleMappingDao(t);return null!==n&&(e=n.uniqueRelatedIds().map((function(t){return t.related_id}))),e},e.prototype.getAllIconIds=function(t){var e=null,n=this.getIconMappingDao(t);return null!==n&&(e=n.uniqueRelatedIds().map((function(t){return t.related_id}))),e},e.prototype.getFeatureTableName=function(t){return t instanceof y.FeatureTable?t.getTableName():t},e.prototype.removeExtension=function(){return this.deleteAllRelationships(),this.geoPackage.deleteTable(c.StyleTable.TABLE_NAME),this.geoPackage.deleteTable(u.IconTable.TABLE_NAME),this.extensionsDao.isTableExists()?this.extensionsDao.deleteByExtension(e.EXTENSION_NAME):0},e.EXTENSION_NAME="nga_feature_style",e.EXTENSION_AUTHOR="nga",e.EXTENSION_NAME_NO_AUTHOR="feature_style",e.EXTENSION_DEFINITION="http://ngageoint.github.io/GeoPackage/docs/extensions/feature-style.html",e.TABLE_MAPPING_STYLE=e.EXTENSION_AUTHOR+"_style_",e.TABLE_MAPPING_TABLE_STYLE=e.EXTENSION_AUTHOR+"_style_default_",e.TABLE_MAPPING_ICON=e.EXTENSION_AUTHOR+"_icon_",e.TABLE_MAPPING_TABLE_ICON=e.EXTENSION_AUTHOR+"_icon_default_",e}(o.BaseExtension);e.FeatureStyleExtension=E},3237:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleDao=void 0;var o=n(8008),a=n(7128),s=function(t){function e(e,n){return t.call(this,e,n)||this}return i(e,t),e.prototype.createObject=function(t){return void 0===t&&(t=void 0),t?this.getRow(t):this.newRow()},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.newRow=function(t,e){return new a.StyleRow(this.table,t,e)},e}(o.AttributesDao);e.StyleDao=s},3410:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleMappingDao=void 0;var o=n(6302),a=n(8138),s=n(233),u=n(9582),l=n(9211),c=function(t){function e(e,n,r){return t.call(this,e,n,r||new a.StyleMappingTable(e.table.getTableName(),e.table.getUserColumns().getColumns(),null))||this}return i(e,t),Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.createMappingTable=function(t){return new a.StyleMappingTable(t.table.getTableName(),t.table.getUserColumns().getColumns(),null)},e.prototype.newRow=function(t,e){return new u.StyleMappingRow(this.table,t,e)},e.prototype.deleteByBaseIdAndGeometryType=function(t,e){var n="";n+=this.buildWhereWithFieldAndValue(s.UserMappingTable.COLUMN_BASE_ID,t),n+=" AND ",n+=this.buildWhereWithFieldAndValue(a.StyleMappingTable.COLUMN_GEOMETRY_TYPE_NAME,l.GeometryType.nameFromType(e));var r=this.buildWhereArgs([t,l.GeometryType.nameFromType(e)]);return this.deleteWhere(n,r)},e}(o.UserMappingDao);e.StyleMappingDao=c},9582:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleMappingRow=void 0;var o=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.styleMappingTable=e,i}return i(e,t),e.prototype.getGeometryTypeNameColumn=function(){return this.styleMappingTable.getGeometryTypeNameColumn()},e.prototype.getGeometryTypeName=function(){return this.getValueWithColumnName(this.getGeometryTypeNameColumn().name)},e.prototype.setGeometryTypeName=function(t){this.setValueWithColumnName(this.getGeometryTypeNameColumn().name,t)},e}(n(8029).UserMappingRow);e.StyleMappingRow=o},8138:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleMappingTable=void 0;var o=n(233),a=n(7319),s=n(5865),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getGeometryTypeNameColumnIndex=function(){return this.getColumnIndex(e.COLUMN_GEOMETRY_TYPE_NAME)},e.prototype.getGeometryTypeNameColumn=function(){return this.getColumnWithColumnName(e.COLUMN_GEOMETRY_TYPE_NAME)},e.create=function(t){return new e(t,e.createColumns(),null)},e.createColumns=function(){var t=o.UserMappingTable.createRequiredColumns(),n=t.length;return t.push(s.UserColumn.createColumn(n,e.COLUMN_GEOMETRY_TYPE_NAME,a.GeoPackageDataType.TEXT,!1)),t},e.COLUMN_GEOMETRY_TYPE_NAME="geometry_type_name",e}(o.UserMappingTable);e.StyleMappingTable=u},7128:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleRow=void 0;var o=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.tableStyle=!1,i.styleTable=e,i}return i(e,t),e.prototype.getNameColumn=function(){return this.styleTable.getNameColumn()},e.prototype.getName=function(){return this.getValueWithColumnName(this.getNameColumn().name)},e.prototype.setName=function(t){this.setValueWithColumnName(this.getNameColumn().name,t)},e.prototype.getDescriptionColumn=function(){return this.styleTable.getDescriptionColumn()},e.prototype.getDescription=function(){return this.getValueWithColumnName(this.getDescriptionColumn().name)},e.prototype.setDescription=function(t){this.setValueWithColumnName(this.getDescriptionColumn().name,t)},e.prototype.getColorColumn=function(){return this.styleTable.getColorColumn()},e.prototype.getColor=function(){return this.createColor(this.getHexColor(),this.getOpacity())},e.prototype.hasColor=function(){return this._hasColor(this.getHexColor(),this.getOpacity())},e.prototype.getHexColor=function(){return this.getValueWithColumnName(this.getColorColumn().name)},e.prototype.setColor=function(t,e){this.setHexColor(t),this.setOpacity(e)},e.prototype.setHexColor=function(t){var e=this.validateColor(t);this.setValueWithColumnName(this.getColorColumn().name,e)},e.prototype.getOpacityColumn=function(){return this.styleTable.getOpacityColumn()},e.prototype.getOpacity=function(){return this.getValueWithColumnName(this.getOpacityColumn().name)},e.prototype.getOpacityOrDefault=function(){var t=this.getOpacity();return null===t&&(t=1),t},e.prototype.setOpacity=function(t){this.validateOpacity(t),this.setValueWithColumnName(this.getOpacityColumn().name,t)},e.prototype.getWidthColumn=function(){return this.styleTable.getWidthColumn()},e.prototype.getWidth=function(){return this.getValueWithColumnName(this.getWidthColumn().name)},e.prototype.setWidth=function(t){if(null!==t&&t<0)throw new Error("Width must be greater than or equal to 0.0, invalid value: "+t);this.setValueWithColumnName(this.getWidthColumn().name,t)},e.prototype.getWidthOrDefault=function(){var t=this.getWidth();return null===t&&(t=1),t},e.prototype.getFillColorColumn=function(){return this.styleTable.getFillColorColumn()},e.prototype.getFillColor=function(){return this.createColor(this.getFillHexColor(),this.getFillOpacity())},e.prototype.hasFillColor=function(){return this._hasColor(this.getFillHexColor(),this.getFillOpacity())},e.prototype.getFillHexColor=function(){return this.getValueWithColumnName(this.getFillColorColumn().name)},e.prototype.setFillColor=function(t,e){this.setFillHexColor(t),this.setFillOpacity(e)},e.prototype.setFillHexColor=function(t){var e=this.validateColor(t);this.setValueWithColumnName(this.getFillColorColumn().name,e)},e.prototype.getFillOpacityColumn=function(){return this.styleTable.getFillOpacityColumn()},e.prototype.getFillOpacity=function(){return this.getValueWithColumnName(this.getFillOpacityColumn().name)},e.prototype.setFillOpacity=function(t){this.validateOpacity(t),this.setValueWithColumnName(this.getFillOpacityColumn().name,t)},e.prototype.getFillOpacityOrDefault=function(){var t=this.getFillOpacity();return null==t&&(t=1),t},e.prototype.validateColor=function(t){var n=t;if(null!=t){if(t.startsWith("#")||(n="#"+t),!e.colorPattern.test(n))throw new Error("Color must be in hex format #RRGGBB or #RGB, invalid value: "+t);n=n.toUpperCase()}return n},e.prototype.validateOpacity=function(t){if(null!=t&&(t<0||t>1))throw new Error("Opacity must be set inclusively between 0.0 and 1.0, invalid value: "+t);return!0},e.prototype.createColor=function(t,e){var n="#000000";if(null!==t&&(n=t),null!==e){var r=Math.round(255*e).toString(16);1===r.length&&(r="0"+r),n+=r}return n.toUpperCase()},e.prototype._hasColor=function(t,e){return null!==t||null!==e},e.prototype.isTableStyle=function(){return this.tableStyle},e.prototype.setTableStyle=function(t){this.tableStyle=t},e.colorPattern=/^#([0-9a-fA-F]{3}){1,2}$/,e}(n(6861).AttributesRow);e.StyleRow=o},3934:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleTable=void 0;var o=n(3931),a=n(8483),s=n(5865),u=n(7319),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.TABLE_TYPE="media",e.data_type=a.RelationType.ATTRIBUTES.dataType,e.relation_name=a.RelationType.ATTRIBUTES.name,e}return i(e,t),e.prototype.getNameColumnIndex=function(){return this.getColumnIndex(e.COLUMN_NAME)},e.prototype.getNameColumn=function(){return this.getColumnWithColumnName(e.COLUMN_NAME)},e.prototype.getDescriptionColumnIndex=function(){return this.getColumnIndex(e.COLUMN_DESCRIPTION)},e.prototype.getDescriptionColumn=function(){return this.getColumnWithColumnName(e.COLUMN_DESCRIPTION)},e.prototype.getColorColumnIndex=function(){return this.getColumnIndex(e.COLUMN_COLOR)},e.prototype.getColorColumn=function(){return this.getColumnWithColumnName(e.COLUMN_COLOR)},e.prototype.getOpacityColumnIndex=function(){return this.getColumnIndex(e.COLUMN_OPACITY)},e.prototype.getOpacityColumn=function(){return this.getColumnWithColumnName(e.COLUMN_OPACITY)},e.prototype.getWidthColumnIndex=function(){return this.getColumnIndex(e.COLUMN_WIDTH)},e.prototype.getWidthColumn=function(){return this.getColumnWithColumnName(e.COLUMN_WIDTH)},e.prototype.getFillColorColumnIndex=function(){return this.getColumnIndex(e.COLUMN_FILL_COLOR)},e.prototype.getFillColorColumn=function(){return this.getColumnWithColumnName(e.COLUMN_FILL_COLOR)},e.prototype.getFillOpacityColumnIndex=function(){return this.getColumnIndex(e.COLUMN_FILL_OPACITY)},e.prototype.getFillOpacityColumn=function(){return this.getColumnWithColumnName(e.COLUMN_FILL_OPACITY)},e.create=function(){return new e(e.TABLE_NAME,e.createColumns())},e.createColumns=function(){var t=[],n=0;return t.push(s.UserColumn.createPrimaryKeyColumn(n++,e.COLUMN_ID)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_NAME,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_DESCRIPTION,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_COLOR,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_OPACITY,u.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_WIDTH,u.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_FILL_COLOR,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(7,e.COLUMN_FILL_OPACITY,u.GeoPackageDataType.REAL,!1)),t},e.TABLE_NAME="nga_style",e.COLUMN_ID="id",e.COLUMN_NAME="name",e.COLUMN_DESCRIPTION="description",e.COLUMN_COLOR="color",e.COLUMN_OPACITY="opacity",e.COLUMN_WIDTH="width",e.COLUMN_FILL_COLOR="fill_color",e.COLUMN_FILL_OPACITY="fill_opacity",e}(o.AttributesTable);e.StyleTable=l},1553:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleTableReader=void 0;var o=n(464),a=n(3934),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createTable=function(t,e){return new a.StyleTable(t,e)},e}(o.AttributesTableReader);e.StyleTableReader=s},7924:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Styles=void 0;var n=function(){function t(t){void 0===t&&(t=!1),this.defaultStyle=null,this.styles=new Map,this.tableStyles=t}return t.prototype.setDefault=function(t){null!=t&&t.setTableStyle(this.tableStyles),this.defaultStyle=t},t.prototype.getDefault=function(){return this.defaultStyle},t.prototype.setStyle=function(t,e){void 0===e&&(e=null),null!==e?null!=t?(t.setTableStyle(this.tableStyles),this.styles.set(e,t)):this.styles.delete(e):this.setDefault(t)},t.prototype.getStyle=function(t){void 0===t&&(t=null);var e=null;return null!==t&&(e=this.styles.get(t)),null!=e&&null!==t||(e=this.getDefault()),e},t.prototype.isEmpty=function(){return 0===this.styles.size&&null===this.defaultStyle},t.prototype.getGeometryTypes=function(){return Array.from(this.styles.keys())},t}();e.Styles=n},7719:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.WebPExtension=void 0;var o=n(8140),a=n(624),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tableName=n,r}return i(e,t),e.prototype.getOrCreateExtension=function(){return this.getOrCreate(e.EXTENSION_NAME,this.tableName,"tile_data",e.EXTENSION_WEBP_DEFINITION,a.Extension.READ_WRITE)},e.EXTENSION_NAME="gpkg_webp",e.EXTENSION_WEBP_AUTHOR="gpkg",e.EXTENSION_WEBP_NAME_NO_AUTHOR="webp",e.EXTENSION_WEBP_DEFINITION="http://www.geopackage.org/spec/#extension_webp",e}(o.BaseExtension);e.WebPExtension=s},812:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryColumns=void 0;var r=n(9971),i=function(){function t(){}return Object.defineProperty(t.prototype,"geometryType",{get:function(){return this.geometry_type_name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return"".concat(this.table_name," ").concat(this.column_name)},enumerable:!1,configurable:!0}),t.prototype.setContents=function(t){if(null!=t){var e=t.data_type;if(null==e||e!==r.ContentsDataType.FEATURES)throw new Error("The Contents of a GeometryColumns must have a data type of "+r.ContentsDataType.nameFromType(r.ContentsDataType.FEATURES));this.table_name=t.table_name}else this.table_name=null},t.TABLE_NAME="tableName",t.COLUMN_NAME="columnName",t.GEOMETRY_TYPE_NAME="geometryTypeName",t.SRS_ID="srsId",t.Z="z",t.M="m",t}();e.GeometryColumns=i},1968:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryColumnsDao=void 0;var a=n(4115),s=n(812),u=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName="gpkg_geometry_columns",n.idColumns=[e.COLUMN_ID_1,e.COLUMN_ID_2],n.columns=[e.COLUMN_TABLE_NAME,e.COLUMN_COLUMN_NAME,e.COLUMN_GEOMETRY_TYPE_NAME,e.COLUMN_SRS_ID,e.COLUMN_Z,e.COLUMN_M],n}return i(e,t),e.prototype.createObject=function(t){var e=new s.GeometryColumns;return t&&(e.table_name=t.table_name,e.column_name=t.column_name,e.geometry_type_name=t.geometry_type_name,e.srs_id=t.srs_id,e.z=t.z,e.m=t.m),e},e.prototype.queryForTableName=function(t){var n=this.queryForAllEq(e.COLUMN_TABLE_NAME,t);if(n&&n.length)return this.createObject(n[0])},e.prototype.getFeatureTables=function(){var t,n,r=[];try{for(var i=o(this.connection.each("select "+e.COLUMN_TABLE_NAME+" from "+this.gpkgTableName)),a=i.next();!a.done;a=i.next()){var s=a.value;r.push(s[e.COLUMN_TABLE_NAME])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.getSrs=function(t){return this.geoPackage.spatialReferenceSystemDao.queryForId(t.srs_id)},e.prototype.getContents=function(t){return this.geoPackage.contentsDao.queryForId(t.table_name)},e.prototype.getProjection=function(t){var e=this.getSrs(t);return this.geoPackage.spatialReferenceSystemDao.getProjection(e)},e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_ID_1=e.COLUMN_TABLE_NAME,e.COLUMN_ID_2=e.COLUMN_COLUMN_NAME,e.COLUMN_GEOMETRY_TYPE_NAME="geometry_type_name",e.COLUMN_SRS_ID="srs_id",e.COLUMN_Z="z",e.COLUMN_M="m",e}(a.Dao);e.GeometryColumnsDao=u},961:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureColumn=void 0;var o=n(5865),a=n(7319),s=n(9211),u=n(5071),l=function(t){function e(e,n,r,i,o,a,s,u,l){var c=t.call(this,e,n,r,i,o,a,s,l)||this;return c.geometryType=u,c.type=c.getTypeName(n,r,u),c}return i(e,t),e.createPrimaryKeyColumn=function(t,n,r){return void 0===r&&(r=u.UserTableDefaults.DEFAULT_AUTOINCREMENT),new e(t,n,a.GeoPackageDataType.INTEGER,void 0,!0,void 0,!0,void 0,r)},e.createGeometryColumn=function(t,n,r,i,o){if(null==r)throw new Error("Geometry Type is required to create column: "+n);return new e(t,n,a.GeoPackageDataType.BLOB,void 0,i,o,!1,r,!1)},e.createColumn=function(t,n,r,i,o,a,s){return void 0===i&&(i=!1),new e(t,n,r,a,i,o,!1,void 0,s)},e.prototype.getTypeName=function(e,n,r){return null!=r?s.GeometryType.nameFromType(r):t.prototype.getTypeName.call(this,e,n)},e.getGeometryTypeFromTableColumn=function(t){var e=null;return t.isDataType(a.GeoPackageDataType.BLOB)&&(e=s.GeometryType.fromName(t.type)),e},e.prototype.copy=function(){return new e(this.index,this.name,this.dataType,this.max,this.notNull,this.defaultValue,this.primaryKey,this.geometryType,this.autoincrement)},e.prototype.isGeometry=function(){return null!==this.geometryType},e.prototype.getGeometryType=function(){return this.geometryType},e}(o.UserColumn);e.FeatureColumn=l},5053:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureColumns=void 0;var o=n(2114),a=n(7319),s=function(t){function e(e,n,r,i){var o=t.call(this,e,r,i)||this;return o.geometryIndex=-1,o.geometryColumn=n,o.updateColumns(),o}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getGeometryColumnName(),this.getColumns(),this.isCustom())},e.prototype.updateColumns=function(){t.prototype.updateColumns.call(this);var e=null;if(null!==this.geometryColumn&&void 0!==this.geometryColumn)e=this.getColumnIndex(this.geometryColumn,!1);else for(var n=0;n<this.getColumns().length;n++){var r=this.getColumns()[n];if(r.isGeometry()){e=r.getIndex(),this.geometryColumn=r.getName();break}}this.isCustom()||this.missingCheck(e,a.GeoPackageDataType.nameFromType(a.GeoPackageDataType.BLOB)),null!=e&&(this.geometryIndex=e)},e.prototype.getGeometryColumnName=function(){return this.geometryColumn},e.prototype.setGeometryColumnName=function(t){this.geometryColumn=t},e.prototype.getGeometryIndex=function(){return this.geometryIndex},e.prototype.setGeometryIndex=function(t){this.geometryIndex=t},e.prototype.hasGeometryColumn=function(){return this.geometryIndex>=0},e.prototype.getGeometryColumn=function(){var t=null;return this.hasGeometryColumn()&&(t=this.getColumnForIndex(this.geometryIndex)),t},e}(o.UserColumns);e.FeatureColumns=s},2071:function(t,e,n){"use strict";var r,i=n(5108),o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureDao=void 0;var l=u(n(6102)),c=u(n(3663)),h=u(n(4170)),f=u(n(5184)),p=u(n(8147)),d=n(5626),y=n(4668),m=n(4941),g=n(234),_=n(7319),b=n(2527),v=n(1375),T=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;o.geometryColumns=r,o.metadataDao=i,o.dataColumnsDao=new m.DataColumnsDao(e),o.featureTableIndex=new d.FeatureTableIndex(e,o);var a=e.geometryColumnsDao;if(!a.getContents(r))throw new Error("Geometry Columns "+r.id+" has null Contents");if(!a.getSrs(r))throw new Error("Geometry Columns "+r.id+" has null Spatial Reference System");return o.projection=a.getProjection(r),o}return o(e,t),e.prototype.createObject=function(t){return t?this.getRow(t):this.newRow()},e.prototype.getRow=function(e){return t.prototype.getRow.call(this,e)},e.prototype.getContents=function(){return this.geoPackage.geometryColumnsDao.getContents(this.geometryColumns)},e.prototype.getFeatureTable=function(){return this.table},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.newRow=function(t,e){return new g.FeatureRow(this.getFeatureTable(),t,e)},e.prototype.getGeometryColumnName=function(){return this.geometryColumns.column_name},Object.defineProperty(e.prototype,"geometryType",{get:function(){return this.geometryColumns.geometryType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"srs",{get:function(){return this.geoPackage.geometryColumnsDao.getSrs(this.geometryColumns)},enumerable:!1,configurable:!0}),e.prototype.isIndexed=function(){return this.featureTableIndex.isIndexed()},e.prototype.index=function(t){return a(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.featureTableIndex.index(t)]}))}))},e.prototype.countWebMercatorBoundingBox=function(t){return this.countInBoundingBox(t,v.ProjectionConstants.EPSG_3857)},e.prototype.countInBoundingBox=function(t,e){return this.featureTableIndex.countWithBoundingBox(t,e)},e.prototype.fastQueryWebMercatorBoundingBox=function(t){var e,n=this,r=this.featureTableIndex.queryWithBoundingBox(t,v.ProjectionConstants.EPSG_3857);return(e={})[Symbol.iterator]=function(){return this},e.next=function(){var t=r.next();return t.done?{value:void 0,done:!0}:{value:n.getRow(t.value),done:!1}},e},e.prototype.queryIndexedFeaturesWithWebMercatorBoundingBox=function(t){var n,r=this.srs,o=this.projection,a=this.featureTableIndex.queryWithBoundingBox(t,v.ProjectionConstants.EPSG_3857),s=this.getRow.bind(this),u=t.projectBoundingBox(v.ProjectionConstants.EPSG_3857,v.ProjectionConstants.EPSG_4326);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=a.next();if(!t.done)for(var n=void 0,l=void 0;!t.done&&!l;){n=s(t.value);try{var c=e.reprojectFeature(n,r,o);l=e.verifyFeature(c,u)}catch(t){i.log("Error parsing Geometry",t)}if(l)return l.properties=n.values,{value:n,done:!1};t=a.next()}return{done:!0,value:void 0}},n},e.prototype.fastQueryBoundingBox=function(t,e){var n,r=this.featureTableIndex.queryWithBoundingBox(t,e),i=this.getRow.bind(this);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=r.next();return t.done?{done:!0,value:void 0}:{value:i(t.value),done:!1}},n},e.prototype.queryIndexedFeaturesWithBoundingBox=function(t){var n,r=this.srs,o=this.projection,a=this.featureTableIndex.queryWithBoundingBox(t,o),s=this.getRow.bind(this),u=t.projectBoundingBox(o,this.projection);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=a.next();if(!t.done)for(var n=void 0,l=void 0;!t.done&&!l;){n=s(t.value);try{var c=e.reprojectFeature(n,r,o);l=e.verifyFeature(c,u)}catch(t){i.log("Error parsing Geometry",t)}if(l)return l.properties=n.values,{value:n,done:!1};t=a.next()}return{done:!0,value:void 0}},n},e.prototype.queryForGeoJSONIndexedFeaturesWithBoundingBox=function(t,n){var r,o=this;void 0===n&&(n=!1);var a,s=[],u={},l=this.srs,c=this.projection;return this.table.getUserColumns().getColumns().forEach((function(t){var e=o.dataColumnsDao.getDataColumns(o.table.getTableName(),t.name);s.push({index:t.index,name:t.name,max:t.max,min:t.min,notNull:t.notNull,primaryKey:t.primaryKey,dataType:t.dataType?_.GeoPackageDataType.nameFromType(t.dataType):"",displayName:e&&e.name?e.name:t.name,dataColumn:e}),u[t.name]=s[s.length-1]})),a=t?this.featureTableIndex.queryWithBoundingBox(t,v.ProjectionConstants.EPSG_4326)[Symbol.iterator]():this.queryForEach(),(r={srs:l,featureDao:this})[Symbol.iterator]=function(){return this},r.next=function(){var r=a.next();if(!r.done)for(var s=void 0,h=void 0;!r.done&&!h;){s=o.getRow(r.value);try{h=e.reprojectFeature(s,l,c),!n&&t&&(h=e.verifyFeature(h,t))}catch(t){i.log("Error parsing Geometry",t)}if(h){var f={id:void 0,type:"Feature",properties:{},geometry:h};for(var p in s.values)Object.prototype.hasOwnProperty.call(s.values,p)&&p!==s.geometryColumn.name&&("_feature_id"===p.toLowerCase()?f.id=s.values[p]:"id"===p.toLowerCase()?f.properties[p]=s.values[p]:"_properties_id"===p.toLowerCase()?f.properties[p.substring(12)]=s.values[p]:f.properties[u[p].displayName]=s.values[p]);return f.id=f.id||s.id,{value:f,done:!1}}r=a.next()}return{done:!0,value:void 0}},r},e.prototype.getBoundingBox=function(){var t=this.getContents();return new b.BoundingBox(t.min_x,t.max_x,t.min_y,t.max_y)},e.reprojectFeature=function(t,e,n){var r=t.geometry.toGeoJSON();return e.organization===v.ProjectionConstants.EPSG&&e.organization_coordsys_id===v.ProjectionConstants.EPSG_CODE_4326||(r=l.default.reproject(r,n,v.ProjectionConstants.EPSG_4326)),r},e.verifyFeature=function(t,n){try{return"Point"===t.type?t:"LineString"===t.type?e.verifyLineString(t,n):"Polygon"===t.type?e.verifyPolygon(t,n):"MultiPoint"===t.type?e.verifyMultiPoint(t,n):"MultiLineString"===t.type?e.verifyLineString(t,n):"MultiPolygon"===t.type?e.verifyPolygon(t,n):"GeometryCollection"===t.type?e.verifyGeometryCollection(t,n):void 0}catch(t){return}},e.verifyMultiPoint=function(t,n){return e.multiPointIntersects(t,n.toGeoJSON().geometry)||(0,f.default)(t,n.toGeoJSON().geometry)?t:void 0},e.verifyLineString=function(t,e){return(0,c.default)(t,e.toGeoJSON().geometry).features.length||(0,f.default)(t,e.toGeoJSON().geometry)?t:void 0},e.verifyPolygon=function(t,e){return(0,h.default)(t,e.toGeoJSON().geometry)||(0,f.default)(t,e.toGeoJSON().geometry)?t:void 0},e.multiPointIntersects=function(t,e){for(var n=!1,r=0;r<t.coordinates.length&&!n;r++){var i=t.coordinates[r];n=(0,p.default)(i,e)}return n},e.geometryCollectionIntersects=function(t,n){for(var r=!1,i=0;i<t.geometries.length&&!r;i++){var o=t.geometries[i];switch(o.type){case"Point":r=(0,p.default)(o,n);break;case"LineString":case"MultiLineString":r=(0,c.default)(o,n).features.length>0;break;case"Polygon":case"MultiPolygon":r=null!==(0,h.default)(o,n);break;case"MultiPoint":r=e.multiPointIntersects(o,n);break;case"GeometryCollection":r=e.geometryCollectionIntersects(o,n)}}return r},e.verifyGeometryCollection=function(t,n){return e.geometryCollectionIntersects(t,n.toGeoJSON().geometry)||(0,f.default)(t,n.toGeoJSON().geometry)?t:void 0},e.readTable=function(t,e){return t.getFeatureDao(e)},e}(y.UserDao);e.FeatureDao=T},234:function(t,e,n){"use strict";var r,i=n(3085).Buffer,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureRow=void 0;var a=n(2224),s=n(961),u=n(857),l=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.featureTable=e,i}return o(e,t),Object.defineProperty(e.prototype,"geometryColumnIndex",{get:function(){return this.featureTable.getGeometryColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryColumn",{get:function(){return this.featureTable.getGeometryColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometry",{get:function(){return this.getValueWithIndex(this.featureTable.getGeometryColumnIndex())},set:function(t){this.setValueWithIndex(this.featureTable.getGeometryColumnIndex(),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryType",{get:function(){var t=null,e=this.getValueWithIndex(this.featureTable.getGeometryColumnIndex());return null!==e&&(t=e.toGeoJSON().type),t},enumerable:!1,configurable:!0}),e.prototype.toObjectValue=function(e,n){var r=this.getColumnWithIndex(e);return r instanceof s.FeatureColumn&&r.isGeometry()&&n&&n instanceof i||n instanceof Uint8Array?new u.GeometryData(n):t.prototype.toObjectValue.call(this,e,n)},e.prototype.getValueWithColumnName=function(e){var n=this.values[e],r=this.getColumnWithColumnName(e);return null!=n&&r instanceof s.FeatureColumn&&r.isGeometry()&&n.toData?n.toData():t.prototype.getValueWithColumnName.call(this,e)},e}(a.UserRow);e.FeatureRow=l},8412:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTable=void 0;var o=n(8018),a=n(5053),s=n(9971),u=function(t){function e(e,n,r){return t.call(this,new a.FeatureColumns(e,n,r,!1))||this}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getGeometryColumnName(),this.getUserColumns().getColumns())},e.prototype.getGeometryColumnIndex=function(){return this.getUserColumns().getGeometryIndex()},e.prototype.getUserColumns=function(){return t.prototype.getUserColumns.call(this)},e.prototype.getGeometryColumn=function(){return this.getUserColumns().getGeometryColumn()},e.prototype.getGeometryColumnName=function(){return this.getUserColumns().getGeometryColumnName()},e.prototype.getIdAndGeometryColumnNames=function(){return[this.getPkColumnName(),this.getGeometryColumnName()]},e.prototype.validateContents=function(t){var e=t.data_type;if(null==e||e!==s.ContentsDataType.FEATURES)throw new Error("The Contents of a FeatureTable must have a data type of "+s.ContentsDataType.FEATURES)},e}(o.UserTable);e.FeatureTable=u},4896:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTableReader=void 0;var o=n(1968),a=n(8412),s=n(4880),u=n(961),l=n(812),c=function(t){function e(e){var n=t.call(this,e instanceof l.GeometryColumns?e.table_name:e)||this;return e instanceof l.GeometryColumns&&(n.columnName=e.column_name),n}return i(e,t),e.prototype.readFeatureTable=function(t){if(null===this.columnName||void 0===this.columnName){var e=new o.GeometryColumnsDao(t);this.columnName=e.queryForTableName(this.table_name).column_name}return this.readTable(t.database)},e.prototype.createTable=function(t,e){return new a.FeatureTable(t,this.columnName,e)},e.prototype.createColumn=function(t){return new u.FeatureColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,u.FeatureColumn.getGeometryTypeFromTableColumn(t),t.autoincrement)},e}(s.UserTableReader);e.FeatureTableReader=c},9211:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryType=void 0,(n=e.GeometryType||(e.GeometryType={}))[n.GEOMETRY=0]="GEOMETRY",n[n.POINT=1]="POINT",n[n.LINESTRING=2]="LINESTRING",n[n.POLYGON=3]="POLYGON",n[n.MULTIPOINT=4]="MULTIPOINT",n[n.MULTILINESTRING=5]="MULTILINESTRING",n[n.MULTIPOLYGON=6]="MULTIPOLYGON",n[n.GEOMETRYCOLLECTION=7]="GEOMETRYCOLLECTION",n[n.CIRCULARSTRING=8]="CIRCULARSTRING",n[n.COMPOUNDCURVE=9]="COMPOUNDCURVE",n[n.CURVEPOLYGON=10]="CURVEPOLYGON",n[n.MULTICURVE=11]="MULTICURVE",n[n.MULTISURFACE=12]="MULTISURFACE",n[n.CURVE=13]="CURVE",n[n.SURFACE=14]="SURFACE",n[n.POLYHEDRALSURFACE=15]="POLYHEDRALSURFACE",n[n.TIN=16]="TIN",n[n.TRIANGLE=17]="TRIANGLE",function(t){t.nameFromType=function(e){var n=null;return null!=e&&(n=t[e]),n},t.fromName=function(e){return t[e]}}(e.GeometryType||(e.GeometryType={}))},4325:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},u=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackage=void 0;var c=l(n(1011)),h=l(n(6102)),f=l(n(3892)),p=l(n(7383)),d=l(n(8147)),y=l(n(1013)),m=o(n(4102)),g=l(n(4472)),_=n(857),b=n(5306),v=n(1832),T=n(8479),E=n(1314),w=n(7523),x=n(5965),C=n(1968),M=n(2071),S=n(4896),N=n(6638),O=n(5925),A=n(3506),I=n(4941),P=n(7175),R=n(663),L=n(2056),D=n(5698),k=n(9581),F=n(9095),U=n(8904),B=n(8008),j=n(1394),G=n(7092),W=n(7960),q=n(3931),H=n(9631),z=n(464),V=n(8412),X=n(8138),Y=n(8704),Z=n(5897),Q=n(7319),K=n(8116),J=n(812),$=n(1459),tt=n(1938),et=n(3684),nt=n(2527),rt=n(5899),it=n(5865),ot=n(8133),at=n(4275),st=n(961),ut=n(6366),lt=n(8483),ct=n(4599),ht=n(297),ft=n(731),pt=n(4301),dt=n(2777),yt=n(8375),mt=n(8314),gt=n(9406),_t=n(9971),bt=n(9211),vt=n(7686),Tt=n(5604),Et=n(1375),wt=n(8877),xt=function(){function t(t,e,n){this.name=t,this.path=e,this.connection=n,this.tableCreator=new $.TableCreator(this),this.loadSpatialReferenceSystemsIntoProj4()}return t.prototype.close=function(){this.connection.close()},Object.defineProperty(t.prototype,"database",{get:function(){return this.connection},enumerable:!1,configurable:!0}),t.prototype.export=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.connection.export()]}))}))},t.prototype.loadSpatialReferenceSystemsIntoProj4=function(){this.spatialReferenceSystemDao.getAllSpatialReferenceSystems().forEach((function(t){try{t.srs_id>0&&(t.organization!==Et.ProjectionConstants.EPSG||t.organization_coordsys_id!==Et.ProjectionConstants.EPSG_CODE_4326&&t.organization_coordsys_id!==Et.ProjectionConstants.EPSG_CODE_3857)&&Tt.Projection.loadProjection([t.organization,t.organization_coordsys_id].join(":"),t.definition)}catch(t){}}))},t.prototype.validate=function(){var t=[];return t.concat(at.GeoPackageValidate.validateMinimumTables(this))},Object.defineProperty(t.prototype,"spatialReferenceSystemDao",{get:function(){return this._spatialReferenceSystemDao||(this._spatialReferenceSystemDao=new x.SpatialReferenceSystemDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentsDao",{get:function(){return this._contentsDao||(this._contentsDao=new N.ContentsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tileMatrixSetDao",{get:function(){return this._tileMatrixSetDao||(this._tileMatrixSetDao=new O.TileMatrixSetDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tileMatrixDao",{get:function(){return this._tileMatrixDao||(this._tileMatrixDao=new A.TileMatrixDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataColumnsDao",{get:function(){return this._dataColumnsDao||(this._dataColumnsDao=new I.DataColumnsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensionDao",{get:function(){return this._extensionDao||(this._extensionDao=new D.ExtensionDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tableIndexDao",{get:function(){return this._tableIndexDao||(this._tableIndexDao=new k.TableIndexDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"geometryColumnsDao",{get:function(){return this._geometryColumnsDao||(this._geometryColumnsDao=new C.GeometryColumnsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataColumnConstraintsDao",{get:function(){return this._dataColumnConstraintsDao||(this._dataColumnConstraintsDao=new P.DataColumnConstraintsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadataReferenceDao",{get:function(){return this._metadataReferenceDao||(this._metadataReferenceDao=new L.MetadataReferenceDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadataDao",{get:function(){return this._metadataDao||(this._metadataDao=new R.MetadataDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extendedRelationDao",{get:function(){return this._extendedRelationDao||(this._extendedRelationDao=new U.ExtendedRelationDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentsIdDao",{get:function(){return this._contentsIdDao||(this._contentsIdDao=new G.ContentsIdDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tileScalingDao",{get:function(){return this._tileScalingDao||(this._tileScalingDao=new W.TileScalingDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentsIdExtension",{get:function(){return this._contentsIdExtension||(this._contentsIdExtension=new E.ContentsIdExtension(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"featureStyleExtension",{get:function(){return this._featureStyleExtension||(this._featureStyleExtension=new T.FeatureStyleExtension(this))},enumerable:!1,configurable:!0}),t.prototype.getTileScalingExtension=function(t){return new w.TileScalingExtension(this,t)},t.prototype.getGeometryIndexDao=function(t){return new F.GeometryIndexDao(this,t)},Object.defineProperty(t.prototype,"relatedTablesExtension",{get:function(){return this._relatedTablesExtension||(this._relatedTablesExtension=new v.RelatedTablesExtension(this))},enumerable:!1,configurable:!0}),t.prototype.getSrs=function(t){return this.spatialReferenceSystemDao.queryForId(t)},t.prototype.createRequiredTables=function(){return this.tableCreator.createRequired(),this},t.prototype.createSupportedExtensions=function(){return new b.CrsWktExtension(this).getOrCreateExtension(),new K.SchemaExtension(this).getOrCreateExtension(),this},t.prototype.getTileDao=function(t){if(t instanceof Z.Contents)t=this.contentsDao.getTileMatrixSet(t);else if(!(t instanceof rt.TileMatrixSet)){var e=this.tileMatrixSetDao,n=e.queryForAllEq(O.TileMatrixSetDao.COLUMN_TABLE_NAME,t);if(n.length>1)throw new Error("Unexpected state. More than one Tile Matrix Set matched for table name: "+t+", count: "+n.length);if(0===n.length)throw new Error("No Tile Matrix found for table name: "+t);t=e.createObject(n[0])}if(!t)throw new Error("Non null TileMatrixSet is required to create Tile DAO");var r=[],i=this.tileMatrixDao;i.queryForAllEq(A.TileMatrixDao.COLUMN_TABLE_NAME,t.table_name,null,null,A.TileMatrixDao.COLUMN_ZOOM_LEVEL+" ASC, "+A.TileMatrixDao.COLUMN_PIXEL_X_SIZE+" DESC, "+A.TileMatrixDao.COLUMN_PIXEL_Y_SIZE+" DESC").forEach((function(t){var e=i.createObject(t);i.hasTiles(e)&&r.push(e)}));var o=new H.TileTableReader(t).readTileTable(this);return new j.TileDao(this,o,t,r)},t.prototype.getTables=function(t){return void 0===t&&(t=!1),t?{features:this.contentsDao.getContentsForTableType(_t.ContentsDataType.FEATURES),tiles:this.contentsDao.getContentsForTableType(_t.ContentsDataType.TILES),attributes:this.contentsDao.getContentsForTableType(_t.ContentsDataType.ATTRIBUTES)}:{features:this.getFeatureTables(),tiles:this.getTileTables(),attributes:this.getAttributesTables()}},t.prototype.getAttributesTables=function(){return this.contentsDao.getTables(_t.ContentsDataType.ATTRIBUTES)},t.prototype.hasAttributeTable=function(t){var e=this.getAttributesTables();return e&&-1!=e.indexOf(t)},t.prototype.getTileTables=function(){var t=this.contentsDao;return t.isTableExists()?t.getTables(_t.ContentsDataType.TILES):[]},t.prototype.hasTileTable=function(t){var e=this.getTileTables();return e&&-1!==e.indexOf(t)},t.prototype.hasFeatureTable=function(t){var e=this.getFeatureTables();return e&&-1!=e.indexOf(t)},t.prototype.getFeatureTables=function(){var t=this.contentsDao;return t.isTableExists()?t.getTables(_t.ContentsDataType.FEATURES):[]},t.prototype.isTable=function(t){return!!this.connection.tableExists(t)},t.prototype.isTableType=function(t,e){return t===this.getTableType(e)},t.prototype.getTableType=function(t){var e=this.getTableContents(t);if(e)return e.data_type},t.prototype.getTableContents=function(t){return this.contentsDao.queryForId(t)},t.prototype.dropTable=function(t){return this.connection.dropTable(t)},t.prototype.deleteTable=function(t){gt.GeoPackageExtensions.deleteTableExtensions(this,t),this.contentsDao.deleteTable(t)},t.prototype.deleteTableQuietly=function(t){try{this.deleteTable(t)}catch(t){}},t.prototype.getTableCreator=function(){return this.tableCreator},t.prototype.index=function(){return a(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:t=this.getFeatureTables(),e=0,n.label=1;case 1:return e<t.length?[4,this.indexFeatureTable(t[e])]:[3,4];case 2:if(!n.sent())throw new Error("Unable to index table "+t[e]);n.label=3;case 3:return e++,[3,1];case 4:return[2,!0]}}))}))},t.prototype.indexFeatureTable=function(t,e){return a(this,void 0,void 0,(function(){var n,r;return s(this,(function(i){switch(i.label){case 0:return n=this.getFeatureDao(t),(r=n.featureTableIndex).isIndexed()?[2,!0]:[4,r.index(e)];case 1:return[2,i.sent()]}}))}))},t.prototype.getFeatureDao=function(t){if(t instanceof Z.Contents?t=this.contentsDao.getGeometryColumns(t):t instanceof J.GeometryColumns||(t=this.geometryColumnsDao.queryForTableName(t)),!t)throw new Error("Non null Geometry Columns is required to create Feature DAO");var e=new S.FeatureTableReader(t).readFeatureTable(this);return new M.FeatureDao(this,e,t,this.metadataDao)},t.prototype.queryForGeoJSONFeaturesInTable=function(t,e){var n,r,i=[],o=this.getFeatureDao(t).queryForGeoJSONIndexedFeaturesWithBoundingBox(e);try{for(var a=u(o),s=a.next();!s.done;s=a.next()){var l=s.value;i.push(l)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.prototype.createGeometryColumnsTable=function(){return!!this.geometryColumnsDao.isTableExists()||this.tableCreator.createGeometryColumns()},t.prototype.getAttributeDao=function(t){if(t instanceof Z.Contents||(t=this.contentsDao.queryForId(t)),!t)throw new Error("Non null Contents is required to create an Attributes DAO");var e=new z.AttributesTableReader(t.table_name).readTable(this.connection);return e.setContents(t),new B.AttributesDao(this,e)},t.prototype.createAttributesTableFromProperties=function(t,e){var n=[],r=0,i=[];n.push(it.UserColumn.createPrimaryKeyColumn(r++,"id"));for(var o=0;o<e.length;o++){var a=e[o];if(n.push(it.UserColumn.createColumn(r++,a.name,Q.GeoPackageDataType.fromName(a.dataType))),a.dataColumn){var s=new ot.DataColumns;s.table_name=a.dataColumn.table_name,s.column_name=a.dataColumn.column_name,s.name=a.dataColumn.name,s.title=a.dataColumn.title,s.description=a.dataColumn.description,s.mime_type=a.dataColumn.mime_type,s.constraint_name=a.dataColumn.constraint_name,i.push(s)}}return this.createAttributesTable(t,n,new vt.Constraints,i)},t.prototype.createAttributesTable=function(t,e,n,r){var i=[];-1===e.findIndex((function(t){return t.isPrimaryKey()}))&&i.push(yt.AttributesColumn.createPrimaryKeyColumn(yt.AttributesColumn.NO_INDEX,"id")),e.forEach((function(t){i.push(t.copy())}));var o=new q.AttributesTable(t,i);null!=n&&o.addConstraints(n),this.tableCreator.createUserTable(o);try{var a=new Z.Contents;if(a.table_name=t,a.data_type=_t.ContentsDataType.ATTRIBUTES,a.identifier=t,a.last_change=(new Date).toISOString(),this.contentsDao.create(a),o.setContents(a),r&&r.length){this.createDataColumns();var s=this.dataColumnsDao;r.forEach((function(t){s.create(t)}))}}catch(e){throw this.deleteTableQuietly(t),new Error("Failed to create table and metadata: "+t)}return!0},t.prototype.createMediaTable=function(t,e){var n=this.relatedTablesExtension,r=[],i=ut.MediaTable.numRequiredColumns();if(e)for(var o=0;o<e.length;o++){var a=e[o];r.push(it.UserColumn.createColumn(i++,a.name,Q.GeoPackageDataType.fromName(a.dataType),a.notNull,a.defaultValue,a.max))}var s=ut.MediaTable.create(t,r);return n.createRelatedTable(s),n.getMediaDao(s)},t.prototype.linkMedia=function(t,e,n,r){return this.linkRelatedRows(t,e,n,r,lt.RelationType.MEDIA)},t.prototype.linkRelatedRows=function(t,e,n,r,i,o,a){var s,u=this.relatedTablesExtension,l=u.getRelationshipBuilder().setBaseTableName(t).setRelatedTableName(n).setRelationType(i);o&&"string"!=typeof o?(l.setUserMappingTable(o),s=o.getTableName()):(o=o||t+"_"+n,l.setMappingTableName(o),s=o),u.addRelationship(l);var c=u.getMappingDao(s),h=c.newRow();for(var f in h.baseId=e,h.relatedId=r,a)h.setValueWithColumnName(f,a[f]);return c.create(h)},t.prototype.getLinkedMedia=function(t,e){for(var n=this.getRelatedRows(t,e),r=[],i=0;i<n.length;i++){var o=n[i];if(o.relation_name===lt.RelationType.MEDIA.name)for(var a=0;a<o.mappingRows.length;a++){var s=o.mappingRows[a].row;r.push(s)}}return r},t.prototype.addGeoJSONFeaturesToGeoPackage=function(t,e,n,r,i){return void 0===n&&(n=!1),void 0===r&&(r=1e3),a(this,void 0,void 0,(function(){var o,u,l,f,p,d,y,m,g,b,v=this;return s(this,(function(T){return o=0,u=this.getFeatureDao(e),l=u.srs,p=u.newRow(),d=c.default.Geometry.parse("POINT EMPTY"),y=!(l.organization===Et.ProjectionConstants.EPSG&&l.organization_coordsys_id===Et.ProjectionConstants.EPSG_CODE_4326),m=function(t){setTimeout(i||function(){},0,t)},g=wt.SqliteQueryBuilder.buildInsert("'"+u.gpkgTableName+"'",p),b=function(e,i,T){return a(v,void 0,void 0,(function(){return s(this,(function(a){return e<i?(u.connection.transaction((function(){var r,a,s=u.connection.adapter.prepareStatement(g);n&&(a=(r=u.featureTableIndex).tableIndex);for(var m=e;m<i;m++){var b=t[m];p=u.newRow(),(f=new _.GeometryData).setSrsId(l.srs_id),y&&(b=h.default.reproject(b,Et.ProjectionConstants.EPSG_4326,u.projection));var v="string"==typeof b.geometry?JSON.parse(b.geometry):b.geometry;for(var T in f.setGeometry(v?c.default.Geometry.parseGeoJSON(v):d),p.geometry=f,b.properties)Object.prototype.hasOwnProperty.call(b.properties,T)&&p.setValueWithColumnName(T,b.properties[T]);var E=u.connection.adapter.bindAndInsert(s,wt.SqliteQueryBuilder.buildUpdateOrInsertObject(p));o++,null!=a&&r.indexRow(a,E,f)}null!=a&&r.updateLastIndexed(a),u.connection.adapter.closeStatement(s)})),m(i),setTimeout((function(){b(i,Math.min(i+r,t.length),T)}))):T(o),[2]}))}))},[2,new Promise((function(e){setTimeout((function(){b(0,Math.min(r,t.length),e)}))}))]}))}))},t.prototype.addGeoJSONFeatureToGeoPackage=function(t,e,n){void 0===n&&(n=!1);var r=this.getFeatureDao(e);return this.addGeoJSONFeatureToGeoPackageWithFeatureDaoAndSrs(t,r,r.srs,n)},t.prototype.addGeoJSONFeatureToGeoPackageWithFeatureDaoAndSrs=function(t,e,n,r){void 0===r&&(r=!1);var i=e.newRow(),o=new _.GeometryData;o.setSrsId(n.srs_id),n.organization===Et.ProjectionConstants.EPSG&&n.organization_coordsys_id===Et.ProjectionConstants.EPSG_CODE_4326||(t=h.default.reproject(t,Et.ProjectionConstants.EPSG_4326,e.projection));var a="string"==typeof t.geometry?JSON.parse(t.geometry):t.geometry;if(null!==a){var s=c.default.Geometry.parseGeoJSON(a);o.setGeometry(s)}else{var u=c.default.Geometry.parse("POINT EMPTY");o.setGeometry(u)}for(var l in i.geometry=o,t.properties)Object.prototype.hasOwnProperty.call(t.properties,l)&&i.setValueWithColumnName(l,t.properties[l]);var f=e.create(i);if(r){var p=e.featureTableIndex,d=p.tableIndex;if(!d)return f;p.indexRow(d,f,o),p.updateLastIndexed(d)}return f},t.prototype.addAttributeRow=function(t,e){var n=this.getAttributeDao(t),r=n.getRow(e);return n.create(r)},t.prototype.createSimpleAttributesTable=function(t,e){var n=this.relatedTablesExtension,r=[],i=ct.SimpleAttributesTable.numRequiredColumns();if(e)for(var o=0;o<e.length;o++){var a=e[o];r.push(it.UserColumn.createColumn(i++,a.name,Q.GeoPackageDataType.fromName(a.dataType),!0))}var s=ct.SimpleAttributesTable.create(t,r);return n.createRelatedTable(s),n.getSimpleAttributesDao(s)},t.prototype.addMedia=function(t,e,n,r){var i=this.relatedTablesExtension.getMediaDao(t),o=i.newRow();for(var a in o.contentType=n,o.data=e,r)o.setValueWithColumnName(a,r[a]);return i.create(o)},t.prototype.getRelatedRows=function(t,e){return this.relatedTablesExtension.getRelatedRows(t,e)},t.prototype.createUserFeatureTable=function(t){return this.tableCreator.createUserTable(t)},t.prototype.createFeatureTableFromProperties=function(t,e){var n=new J.GeometryColumns;n.table_name=t,n.column_name="geometry",n.geometry_type_name="GEOMETRY",n.z=0,n.m=0;var r=[],i=0;r.push(st.FeatureColumn.createPrimaryKeyColumn(i++,"id")),r.push(st.FeatureColumn.createGeometryColumn(i++,n.column_name,bt.GeometryType.GEOMETRY,!1,null));for(var o=0;e&&o<e.length;o++){var a=e[o];r.push(st.FeatureColumn.createColumn(i++,a.name,Q.GeoPackageDataType.fromName(a.dataType)))}return this.createFeatureTable(t,n,r)},t.prototype.createFeatureTable=function(t,e,n,r,i,o){var a;if(void 0===r&&(r=new nt.BoundingBox(-180,180,-90,90)),void 0===i&&(i=Et.ProjectionConstants.EPSG_CODE_4326),!this.spatialReferenceSystemDao.getBySrsId(i))throw new Error("Spatial reference system ("+i+") is not defined.");this.createGeometryColumnsTable(),e?a=e:((a=new J.GeometryColumns).table_name=t,a.column_name="geometry",a.geometry_type_name="GEOMETRY",a.z=0,a.m=0);var s=[];if(n&&n.length>0&&n[0]instanceof it.UserColumn)s=n;else{var u=0;s.push(st.FeatureColumn.createPrimaryKeyColumn(u++,"id")),s.push(st.FeatureColumn.createGeometryColumn(u++,a.column_name,bt.GeometryType.GEOMETRY,!1,null));for(var l=0;n&&l<n.length;l++){var c=n[l];s.push(st.FeatureColumn.createColumn(u++,c.name,Q.GeoPackageDataType.fromName(c.dataType)))}}var h=new V.FeatureTable(a.table_name,a.column_name,s);this.createUserFeatureTable(h);var f=new Z.Contents;if(f.table_name=a.table_name,f.data_type=_t.ContentsDataType.FEATURES,f.identifier=a.table_name,f.last_change=(new Date).toISOString(),f.min_x=r.minLongitude,f.min_y=r.minLatitude,f.max_x=r.maxLongitude,f.max_y=r.maxLatitude,f.srs_id=i,this.contentsDao.create(f),a.srs_id=i,this.geometryColumnsDao.create(a),o){this.createDataColumns();var p=this.dataColumnsDao;o.forEach((function(t){p.create(t)}))}return!0},t.prototype.createTileMatrixSetTable=function(){return!!this.tileMatrixSetDao.isTableExists()||this.tableCreator.createTileMatrixSet()},t.prototype.createTileMatrixTable=function(){return!!this.tileMatrixDao.isTableExists()||this.tableCreator.createTileMatrix()},t.prototype.createTileTable=function(t){return this.tableCreator.createUserTable(t)},t.prototype.createSpatialReferenceSystem=function(t){Tt.Projection.loadProjection([t.organization.toUpperCase(),t.organization_coordsys_id].join(":"),t.definition),this.spatialReferenceSystemDao.create(t)},t.prototype.createTileTableWithTableName=function(t,e,n,r,i){var o=this.spatialReferenceSystemDao.getBySrsId(n);if(!o)throw new Error("Spatial reference system ("+n+") is not defined.");if(!(o=this.spatialReferenceSystemDao.getBySrsId(i)))throw new Error("Spatial reference system ("+i+") is not defined.");var a=Y.TileTable.createRequiredColumns(0),s=new Y.TileTable(t,a),u=new Z.Contents;u.table_name=t,u.data_type=_t.ContentsDataType.TILES,u.identifier=t,u.last_change=(new Date).toISOString(),u.min_x=e.minLongitude,u.min_y=e.minLatitude,u.max_x=e.maxLongitude,u.max_y=e.maxLatitude,u.srs_id=n;var l=new rt.TileMatrixSet;return l.contents=u,l.srs_id=i,l.min_x=r.minLongitude,l.min_y=r.minLatitude,l.max_x=r.maxLongitude,l.max_y=r.maxLatitude,this.createTileMatrixSetTable(),this.createTileMatrixTable(),this.createTileTable(s),this.contentsDao.create(u),this.tileMatrixSetDao.create(l),l},t.prototype.createStandardWGS84TileTable=function(t,e,n,r,i,o,a,s){void 0===s&&(s=256);var u=this.spatialReferenceSystemDao.getByOrganizationAndCoordSysId(Et.ProjectionConstants.EPSG,Et.ProjectionConstants.EPSG_CODE_4326);u||(this.spatialReferenceSystemDao.createWebMercator(),u=this.spatialReferenceSystemDao.getByOrganizationAndCoordSysId(Et.ProjectionConstants.EPSG,Et.ProjectionConstants.EPSG_CODE_4326));var l=u.srs_id,c=this.spatialReferenceSystemDao.getBySrsId(n);if(!c)throw new Error("Spatial reference system ("+n+") is not defined.");if(!(c=this.spatialReferenceSystemDao.getBySrsId(i)))throw new Error("Spatial reference system ("+i+") is not defined.");if(n!==l){var h=new x.SpatialReferenceSystemDao(this).getBySrsId(n).projection;e=e.projectBoundingBox(h,Et.ProjectionConstants.EPSG_4326)}i!==l&&(h=new x.SpatialReferenceSystemDao(this).getBySrsId(i).projection,r=r.projectBoundingBox(h,Et.ProjectionConstants.EPSG_4326));var f=this.createTileTableWithTableName(t,e,l,r,l);return this.createStandardWGS84TileMatrix(r,f,o,a,s),f},t.prototype.createStandardWGS84TileMatrix=function(t,e,n,r,i){void 0===i&&(i=256),i=i||256;for(var o=this.tileMatrixDao,a=n;a<=r;a++)this.createWGS84TileMatrixRow(t,e,o,a,i);return this},t.prototype.createStandardWebMercatorTileTable=function(t,e,n,r,i,o,a,s){void 0===s&&(s=256);var u=this.spatialReferenceSystemDao.getByOrganizationAndCoordSysId(Et.ProjectionConstants.EPSG,Et.ProjectionConstants.EPSG_CODE_3857);u||(this.spatialReferenceSystemDao.createWebMercator(),u=this.spatialReferenceSystemDao.getByOrganizationAndCoordSysId(Et.ProjectionConstants.EPSG,Et.ProjectionConstants.EPSG_CODE_3857));var l=u.srs_id,c=this.spatialReferenceSystemDao.getBySrsId(n);if(!c)throw new Error("Spatial reference system ("+n+") is not defined.");if(!(c=this.spatialReferenceSystemDao.getBySrsId(i)))throw new Error("Spatial reference system ("+i+") is not defined.");if(n!==l){var h=new x.SpatialReferenceSystemDao(this).getBySrsId(n).projection;e=e.projectBoundingBox(h,Et.ProjectionConstants.EPSG_3857)}i!==l&&(h=new x.SpatialReferenceSystemDao(this).getBySrsId(i).projection,r=r.projectBoundingBox(h,Et.ProjectionConstants.EPSG_3857));var f=this.createTileTableWithTableName(t,e,l,r,l);return this.createStandardWebMercatorTileMatrix(r,f,o,a,s),f},t.prototype.createStandardWebMercatorTileTableWithZoomLevels=function(t,e,n,r,i){return void 0===i&&(i=256),a(this,void 0,void 0,(function(){var o,a,u;return s(this,(function(s){switch(s.label){case 0:return(o=this.spatialReferenceSystemDao.getByOrganizationAndCoordSysId(Et.ProjectionConstants.EPSG,Et.ProjectionConstants.EPSG_CODE_3857))||(this.spatialReferenceSystemDao.createWebMercator(),o=this.spatialReferenceSystemDao.getByOrganizationAndCoordSysId(Et.ProjectionConstants.EPSG,Et.ProjectionConstants.EPSG_CODE_3857)),a=o.srs_id,[4,this.createTileTableWithTableName(t,e,a,n,a)];case 1:return u=s.sent(),this.createStandardWebMercatorTileMatrixWithZoomLevels(n,u,r,i),[2,u]}}))}))},t.prototype.createStandardWebMercatorTileMatrix=function(t,e,n,r,i){void 0===i&&(i=256),i=i||256;for(var o=this.tileMatrixDao,a=n;a<=r;a++)this.createTileMatrixRow(t,e,o,a,i);return this},t.prototype.createStandardWebMercatorTileMatrixWithZoomLevels=function(t,e,n,r){var i=this;void 0===r&&(r=256),r=r||256;var o=this.tileMatrixDao;return n.forEach((function(n){i.createTileMatrixRow(t,e,o,n,r)})),this},t.prototype.createWGS84TileMatrixRow=function(t,e,n,r,i){void 0===i&&(i=256);var o=et.TileBoundingBoxUtils.wgs84TileBox(t,r),a=o.maxLongitude-o.minLongitude+1,s=o.maxLatitude-o.minLatitude+1,u=(t.maxLongitude-t.minLongitude)/a/i,l=(t.maxLatitude-t.minLatitude)/s/i,c=new tt.TileMatrix;return c.table_name=e.table_name,c.zoom_level=r,c.matrix_width=a,c.matrix_height=s,c.tile_width=i,c.tile_height=i,c.pixel_x_size=u,c.pixel_y_size=l,n.create(c)},t.prototype.createTileMatrixRow=function(t,e,n,r,i){void 0===i&&(i=256);var o=et.TileBoundingBoxUtils.webMercatorTileBox(t,r),a=o.maxLongitude-o.minLongitude+1,s=o.maxLatitude-o.minLatitude+1,u=(t.maxLongitude-t.minLongitude)/a/i,l=(t.maxLatitude-t.minLatitude)/s/i,c=new tt.TileMatrix;return c.table_name=e.table_name,c.zoom_level=r,c.matrix_width=a,c.matrix_height=s,c.tile_width=i,c.tile_height=i,c.pixel_x_size=u,c.pixel_y_size=l,n.create(c)},t.prototype.addTile=function(t,e,n,r,i){var o=this.getTileDao(e),a=o.newRow();return a.zoomLevel=n,a.tileColumn=i,a.tileRow=r,a.tileData=t,o.create(a)},t.prototype.getTileFromTable=function(t,e,n,r){return this.getTileDao(t).queryForTile(r,n,e)},t.prototype.getTilesInBoundingBox=function(t,e,n,r,i,o){var a,s,l={columns:[],srs:void 0,tiles:[],west:void 0,east:void 0,south:void 0,north:void 0,zoom:void 0},c=this.getTileDao(t);if(!(e<c.minZoom||e>c.maxZoom)){for(var h=0;h<c.table.getUserColumns().getColumns().length;h++){var f=c.table.getUserColumns().getColumns()[h];l.columns.push({index:f.index,name:f.name,max:f.max,min:f.min,notNull:f.notNull,primaryKey:f.primaryKey})}var p=c.srs;l.srs=p,l.tiles=[];var d=c.tileMatrixSet,y=c.getTileMatrixWithZoomLevel(e);if(!y)return l;var m=new nt.BoundingBox(Math.max(-180,n),Math.min(r,180),i,o);l.west=Math.max(-180,n).toFixed(2),l.east=Math.min(r,180).toFixed(2),l.south=i.toFixed(2),l.north=o.toFixed(2),l.zoom=e,m=m.projectBoundingBox(Et.ProjectionConstants.EPSG_4326,c.srs.organization.toUpperCase()+":"+c.srs.organization_coordsys_id);var g=et.TileBoundingBoxUtils.getTileGridWithTotalBoundingBox(d.boundingBox,y.matrix_width,y.matrix_height,m),_=c.queryByTileGrid(g,e);try{for(var b=u(_),v=b.next();!v.done;v=b.next()){var T=v.value,E={};E.tableName=t,E.id=T.id;var w=et.TileBoundingBoxUtils.getTileBoundingBox(d.boundingBox,y,T.tileColumn,T.row);for(E.minLongitude=w.minLongitude,E.maxLongitude=w.maxLongitude,E.minLatitude=w.minLatitude,E.maxLatitude=w.maxLatitude,E.projection=c.srs.organization.toUpperCase()+":"+c.srs.organization_coordsys_id,E.values=[],h=0;h<l.columns.length;h++){var x=T.values[l.columns[h].name];"tile_data"===l.columns[h].name?E.values.push("data"):null===x||"null"===x?E.values.push(""):(E.values.push(x.toString()),E[l.columns[h].name]=x)}l.tiles.push(E)}}catch(t){a={error:t}}finally{try{v&&!v.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return l}},t.prototype.getTilesInBoundingBoxWebZoom=function(t,e,n,r,i,o){var a,s,l={columns:[],srs:void 0,tiles:[],west:void 0,east:void 0,south:void 0,north:void 0,zoom:void 0},c=this.getTileDao(t);if(!(e<c.minWebMapZoom||e>c.maxWebMapZoom)){l.columns=[];for(var h=0;h<c.table.getUserColumns().getColumns().length;h++){var f=c.table.getUserColumns().getColumns()[h];l.columns.push({index:f.index,name:f.name,max:f.max,min:f.min,notNull:f.notNull,primaryKey:f.primaryKey})}var p=c.srs;l.srs=p,l.tiles=[];var d=c.webZoomToGeoPackageZoom(e),y=c.tileMatrixSet,m=c.getTileMatrixWithZoomLevel(d);if(!m)return l;var g=new nt.BoundingBox(Math.max(-180,n),Math.min(r,180),i,o);l.west=Math.max(-180,n).toFixed(2),l.east=Math.min(r,180).toFixed(2),l.south=i.toFixed(2),l.north=o.toFixed(2),l.zoom=d,g=g.projectBoundingBox(Et.ProjectionConstants.EPSG_4326,c.srs.organization.toUpperCase()+":"+c.srs.organization_coordsys_id);var _=et.TileBoundingBoxUtils.getTileGridWithTotalBoundingBox(y.boundingBox,m.matrix_width,m.matrix_height,g),b=c.queryByTileGrid(_,d);try{for(var v=u(b),T=v.next();!T.done;T=v.next()){var E=T.value,w={tableName:void 0,id:void 0,minLongitude:void 0,maxLongitude:void 0,minLatitude:void 0,maxLatitude:void 0,projection:void 0,values:[]};w.tableName=t,w.id=E.id;var x=et.TileBoundingBoxUtils.getTileBoundingBox(y.boundingBox,m,E.tileColumn,E.row);for(w.minLongitude=x.minLongitude,w.maxLongitude=x.maxLongitude,w.minLatitude=x.minLatitude,w.maxLatitude=x.maxLatitude,w.projection=c.srs.organization.toUpperCase()+":"+c.srs.organization_coordsys_id,w.values=[],h=0;h<l.columns.length;h++){var C=E.values[l.columns[h].name];"tile_data"===l.columns[h].name?w.values.push("data"):null===C||"null"===C?w.values.push(""):(w.values.push(C.toString()),w[l.columns[h].name]=C)}l.tiles.push(w)}}catch(t){a={error:t}}finally{try{T&&!T.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}return l}},t.prototype.getFeatureTileFromXYZ=function(t,e,n,r,i,o){return a(this,void 0,void 0,(function(){var a;return s(this,(function(s){return e=Number(e),n=Number(n),r=Number(r),i=Number(i),o=Number(o),(a=this.getFeatureDao(t))?[2,new ht.FeatureTiles(a,i,o).drawTile(e,n,r)]:[2]}))}))},t.prototype.getClosestFeatureInXYZTile=function(e,n,r,i,o,a){var s,l;n=Number(n),r=Number(r),i=Number(i);var c=this.getFeatureDao(e);if(c){var h=new ht.FeatureTiles(c,256,256).getFeatureCountXYZ(n,r,i),f=et.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(n,r,i);if(f=f.projectBoundingBox(Et.ProjectionConstants.EPSG_3857,Et.ProjectionConstants.EPSG_4326),h>1e4){var p=f.toGeoJSON();return p.feature_count=h,p.coverage=!0,p.gp_table=e,p.gp_name=this.name,p}var d=[f.maxLongitude,f.maxLatitude],y=[f.minLongitude,f.minLatitude],g=(d[0]-y[0])/256*10;f.maxLongitude=a+g,f.minLongitude=a-g,f.maxLatitude=o+g,f.minLatitude=o-g;var _,b=c.queryForGeoJSONIndexedFeaturesWithBoundingBox(f),v=[],T=1e11,E=m.point([a,o]);try{for(var w=u(b),x=w.next();!x.done;x=w.next()){var C=x.value;C.type="Feature";var M=t.determineDistance(E.geometry,C);(M<T||M===T&&null!=_&&"Point"!==_.geometry.type)&&(_=C,T=M),v.push(C)}}catch(t){s={error:t}}finally{try{x&&!x.done&&(l=w.return)&&l.call(w)}finally{if(s)throw s.error}}return _&&(_.gp_table=e,_.gp_name=this.name,_.distance=T),_}},t.determineDistance=function(e,n){if("FeatureCollection"!==n.type){var r=n.geometry;if("Point"===r.type)return(0,y.default)(e,r);if("LineString"===r.type)return this.determineDistanceFromLine(e,r);if("MultiLineString"===r.type){var i=Number.MAX_SAFE_INTEGER;return r.coordinates.forEach((function(n){var r=m.lineString(n);i=Math.min(i,t.determineDistance(e,r))})),i}return"Polygon"===r.type||"MultiPolygon"===r.type?t.determineDistanceFromPolygon(e,r):Number.MAX_SAFE_INTEGER}n.features.forEach((function(n){t.determineDistance(e,n)}))},t.determineDistanceFromLine=function(t,e){return(0,f.default)(t,e)},t.determineDistanceFromPolygon=function(e,n){return(0,d.default)(e,n)?0:t.determineDistance(e,(0,p.default)(n))},t.prototype.createDataColumns=function(){return!!this.dataColumnsDao.isTableExists()||this.tableCreator.createDataColumns()},t.prototype.createDataColumnConstraintsTable=function(){return!!this.dataColumnConstraintsDao.isTableExists()||this.tableCreator.createDataColumnConstraints()},t.prototype.createMetadataTable=function(){return!!this.metadataDao.isTableExists()||this.tableCreator.createMetadata()},t.prototype.createMetadataReferenceTable=function(){return!!this.metadataReferenceDao.isTableExists()||this.tableCreator.createMetadataReference()},t.prototype.createExtensionTable=function(){return!!this.extensionDao.isTableExists()||this.tableCreator.createExtensions()},t.prototype.createTableIndexTable=function(){return!!this.tableIndexDao.isTableExists()||this.tableCreator.createTableIndex()},t.prototype.createGeometryIndexTable=function(){return!!this.getGeometryIndexDao(null).isTableExists()||this.tableCreator.createGeometryIndex()},t.prototype.createStyleMappingTable=function(t,e,n){var r=new X.StyleMappingTable(t,e,null);this.tableCreator.createUserTable(r);var i=new Z.Contents;if(i.table_name=t,i.data_type=_t.ContentsDataType.ATTRIBUTES,i.identifier=t,i.last_change=(new Date).toISOString(),this.contentsDao.create(i),n){this.createDataColumns();var o=this.dataColumnsDao;n.forEach((function(t){o.create(t)}))}return!0},t.prototype.getApplicationId=function(){return this.database.getApplicationId()},t.createDataColumnMap=function(t){var e={},n=new I.DataColumnsDao(t.geoPackage);return t.table.getUserColumns().getColumns().forEach(function(r){var i=n.getDataColumns(t.table.getTableName(),r.name);e[r.name]={index:r.index,name:r.name,max:r.max,min:r.min,notNull:r.notNull,primaryKey:r.primaryKey,dataType:r.dataType?Q.GeoPackageDataType.nameFromType(r.dataType):"",displayName:i&&i.name?i.name:r.name,dataColumn:i}}.bind(this)),e},t.prototype.iterateGeoJSONFeatures=function(t,e){return this.getFeatureDao(t).queryForGeoJSONIndexedFeaturesWithBoundingBox(e)},t.prototype.getFeature=function(e,n){var r=this.getFeatureDao(e),i=r.srs,o=r.queryForId(n);if(!o){var a=r.queryForAllEq("_feature_id",n);(a.length||(a=r.queryForAllEq("_properties_id",n)).length)&&(o=r.getRow(a[0]))}if(o)return t.parseFeatureRowIntoGeoJSON(o,i)},t.parseFeatureRowIntoGeoJSON=function(t,e,n){var r={type:"Feature",properties:{},id:void 0,geometry:void 0},i=t.geometry;if(i&&i.geometry){var o=i.geometry.toGeoJSON();e.definition&&"undefined"!==e.definition&&e.organization.toUpperCase()+":"+e.organization_coordsys_id!==Et.ProjectionConstants.EPSG_4326&&(o=h.default.reproject(o,e.projection,Et.ProjectionConstants.EPSG_4326)),r.geometry=o}for(var a in t.values)Object.prototype.hasOwnProperty.call(t.values,a)&&a!==t.geometryColumn.name&&"id"!==a?"_feature_id"===a.toLowerCase()?r.id=t.values[a]:"_properties_id"===a.toLowerCase()?r.properties[a.substring(12)]=t.values[a]:n&&n[a]?r.properties[n[a].displayName]=t.values[a]:r.properties[a]=t.values[a]:t.geometryColumn.name;return r.id=r.id||t.id,r},t.prototype.getGeoJSONFeaturesInTile=function(t,e,n,r,i){return void 0===i&&(i=!1),a(this,void 0,void 0,(function(){var o,a,l,c,h,f,p,d,y,m;return s(this,(function(s){switch(s.label){case 0:return o=et.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(e,n,r),a=o.projectBoundingBox(Et.ProjectionConstants.EPSG_3857,Et.ProjectionConstants.EPSG_4326),[4,this.indexFeatureTable(t)];case 1:if(s.sent(),!(l=this.getFeatureDao(t)))return[2];c=[],h=l.queryForGeoJSONIndexedFeaturesWithBoundingBox(a,i);try{for(f=u(h),p=f.next();!p.done;p=f.next())d=p.value,c.push(d)}catch(t){y={error:t}}finally{try{p&&!p.done&&(m=f.return)&&m.call(f)}finally{if(y)throw y.error}}return[2,c]}}))}))},t.prototype.getFeaturesInBoundingBox=function(t,e,n,r,i){return a(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return[4,this.indexFeatureTable(t)];case 1:if(s.sent(),!(o=this.getFeatureDao(t)))throw new Error("Unable to find table "+t);return a=new nt.BoundingBox(e,n,r,i),[2,o.queryIndexedFeaturesWithBoundingBox(a)]}}))}))},t.prototype.xyzTile=function(t,e,n,r,i,o,u){return void 0===i&&(i=256),void 0===o&&(o=256),a(this,void 0,void 0,(function(){var a,l,c;return s(this,(function(s){return i=Number(i),o=Number(o),a=this.getTileDao(t),l=new ft.GeoPackageTileRetriever(a,i,o),this.getTileScalingExtension(t).has()&&(c=this.getTileScalingExtension(t).dao.queryForTableName(t))&&l.setScaling(c),u?[2,l.drawTileIn(e,n,r,u)]:[2,l.getTile(e,n,r)]}))}))},t.prototype.xyzTileScaled=function(t,e,n,r,i,o,u,l,c){return void 0===i&&(i=256),void 0===o&&(o=256),a(this,void 0,void 0,(function(){var a,h,f,p;return s(this,(function(s){switch(s.label){case 0:return i=Number(i),o=Number(o),a=this.getTileDao(t),h=new ft.GeoPackageTileRetriever(a,i,o),[4,this.getTileScalingExtension(t).getOrCreateExtension()];case 1:return s.sent(),(f=this.getTileScalingExtension(t).dao.queryForTableName(t))?h.setScaling(f):((p=new pt.TileScaling).zoom_in=l,p.zoom_out=c,p.table_name=t,p.scaling_type=dt.TileScalingType.CLOSEST_IN_OUT,this.getTileScalingExtension(t).createOrUpdate(p),h.setScaling(p)),u?[2,h.drawTileIn(e,n,r,u)]:[2,h.getTile(e,n,r)]}}))}))},t.prototype.projectedTile=function(t,e,n,r,i,o,u,l,c,h){return void 0===u&&(u=Et.ProjectionConstants.EPSG_4326),void 0===l&&(l=256),void 0===c&&(c=256),a(this,void 0,void 0,(function(){var a,f,p;return s(this,(function(s){return a=this.getTileDao(t),f=new ft.GeoPackageTileRetriever(a,l,c),p=new nt.BoundingBox(n,i,e,r),[2,f.getTileWithWgs84BoundsInProjection(p,o,u,h)]}))}))},t.prototype.getInfoForTable=function(t){var e,n={tableName:t.table_name,tableType:t.table.tableType,count:t.getCount(),geometryColumns:void 0,minZoom:void 0,maxZoom:void 0,minWebMapZoom:void 0,maxWebMapZoom:void 0,zoomLevels:void 0,tileMatrixSet:void 0,contents:void 0,srs:void 0,columns:void 0,columnMap:void 0};t instanceof M.FeatureDao&&(n.geometryColumns={tableName:t.geometryColumns.table_name,geometryColumn:t.geometryColumns.column_name,geometryTypeName:t.geometryColumns.geometry_type_name,z:t.geometryColumns.z,m:t.geometryColumns.m}),t instanceof j.TileDao&&(n.minZoom=t.minZoom,n.maxZoom=t.maxZoom,n.minWebMapZoom=t.minWebMapZoom,n.maxWebMapZoom=t.maxWebMapZoom,n.zoomLevels=t.tileMatrices.length),t instanceof M.FeatureDao?e=this.geometryColumnsDao.getContents(t.geometryColumns):t instanceof j.TileDao&&(e=this.tileMatrixSetDao.getContents(t.tileMatrixSet),n.tileMatrixSet={srsId:t.tileMatrixSet.srs_id,minX:t.tileMatrixSet.min_x,maxX:t.tileMatrixSet.max_x,minY:t.tileMatrixSet.min_y,maxY:t.tileMatrixSet.max_y});var r=this.contentsDao.getSrs(e);n.contents={tableName:e.table_name,dataType:e.data_type,identifier:e.identifier,description:e.description,lastChange:e.last_change,minX:e.min_x,maxX:e.max_x,minY:e.min_y,maxY:e.max_y,srs:{name:r.srs_name,id:r.srs_id,organization:r.organization,organization_coordsys_id:r.organization_coordsys_id,definition:r.definition,description:r.description}},n.contents.srs={name:r.srs_name,id:r.srs_id,organization:r.organization,organization_coordsys_id:r.organization_coordsys_id,definition:r.definition,description:r.description};var i=t.srs;n.srs={name:i.srs_name,id:i.srs_id,organization:i.organization,organization_coordsys_id:i.organization_coordsys_id,definition:i.definition,description:i.description},n.columns=[],n.columnMap={};var o=this.dataColumnsDao;return t.table.getUserColumns().getColumns().forEach(function(e){var r=o.getDataColumns(t.table.getTableName(),e.name);n.columns.push({index:e.index,name:e.name,max:e.max,min:e.min,notNull:e.notNull,primaryKey:e.primaryKey,dataType:e.dataType,displayName:r&&r.name?r.name:e.name,dataColumn:r}),n.columnMap[e.name]=n.columns[n.columns.length-1]}.bind(this)),n},t.addProjection=function(t,e){if(!t||!e)throw new Error("Invalid projection name/definition");g.default.defs(t,e)},t.hasProjection=function(t){return g.default.defs(t)},t.prototype.renameTable=function(t,e){null!=this.getTableDataType(t)?(this.copyTableAndExtensions(t,e),this.deleteTable(t)):mt.AlterTable.renameTable(this.connection,t,e)},t.prototype.copyTableAndExtensions=function(t,e){this.copyTable(t,e,!0,!0)},t.prototype.copyTableNoExtensions=function(t,e){this.copyTable(t,e,!0,!1)},t.prototype.copyTableAsEmpty=function(t,e){this.copyTable(t,e,!1,!1)},t.prototype.getTableDataType=function(t){var e=null,n=this.contentsDao.queryForId(t);return null!=n&&(e=n.data_type),e},t.prototype.copyTable=function(t,e,n,r){var i=this.getTableDataType(t);if(null!=i)switch(i){case _t.ContentsDataType.ATTRIBUTES:this.copyAttributeTable(t,e,n);break;case _t.ContentsDataType.FEATURES:this.copyFeatureTable(t,e,n);break;case _t.ContentsDataType.TILES:this.copyTileTable(t,e,n);break;default:throw new Error("Unsupported data type: "+i)}else this.copyUserTable(t,e,n,!1);r&&gt.GeoPackageExtensions.copyTableExtensions(this,t,e)},t.prototype.copyAttributeTable=function(t,e,n){this.copyUserTable(t,e,n)},t.prototype.copyFeatureTable=function(t,e,n){var r=this.geometryColumnsDao,i=null;try{i=r.queryForTableName(t)}catch(e){throw new Error("Failed to retrieve table geometry columns: "+t)}if(null==i)throw new Error("No geometry columns for table: "+t);var o=this.copyUserTable(t,e,n);i.setContents(o);try{r.create(i)}catch(t){throw new Error("Failed to create geometry columns for feature table: "+e)}},t.prototype.copyTileTable=function(t,e,n){var r=this.tileMatrixSetDao,i=null;try{i=r.queryForId(t)}catch(e){throw new Error("Failed to retrieve table tile matrix set: "+t)}if(null==i)throw new Error("No tile matrix set for table: "+t);var o=this.tileMatrixDao,a=null;try{a=o.queryForAllEq(A.TileMatrixDao.COLUMN_TABLE_NAME,t).map((function(t){return o.createObject(t)}))}catch(e){throw new Error("Failed to retrieve table tile matrices: "+t)}var s=this.copyUserTable(t,e,n);i.contents=s;try{r.create(i)}catch(t){throw new Error("Failed to create tile matrix set for tile table: "+e)}a.forEach((function(t){t.contents=s;try{o.create(t)}catch(t){throw new Error("Failed to create tile matrix for tile table: "+e)}}))},t.prototype.copyUserTable=function(t,e,n,r){void 0===r&&(r=!0),mt.AlterTable.copyTableWithName(this.database,t,e,n);var i=this.copyContents(t,e);if(null==i&&r)throw new Error("No table contents found for table: "+t);return i},t.prototype.copyContents=function(t,e){var n=this.getTableContents(t);if(null!=n){n.table_name=e,n.identifier=e;try{this.contentsDao.create(n)}catch(n){throw new Error("Failed to create contents for table: "+e+", copied from table: "+t)}}return n},t}();e.GeoPackage=xt},1506:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageConstants=void 0;var n=function(){function t(){}return t.GEOPACKAGE_EXTENSION="gpkg",t.GEOPACKAGE_EXTENDED_EXTENSION="gpkx",t.APPLICATION_ID="GPKG",t.USER_VERSION="10200",t.GEOPACKAGE_EXTENSION_AUTHOR=t.GEOPACKAGE_EXTENSION,t.GEOMETRY_EXTENSION_PREFIX="geom",t.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER="GP",t.GEOPACKAGE_GEOMETRY_VERSION_1=0,t.SQLITE_HEADER_PREFIX="SQLite format 3",t}();e.GeoPackageConstants=n},5095:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Envelope=void 0;e.Envelope=function(){}},1895:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.EnvelopeBuilder=void 0;var i=r(n(9705)),o=function(){function t(){}return t.buildEnvelopeWithGeometry=function(t){var e=t.toGeoJSON(),n=(0,i.default)(e);return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}();e.EnvelopeBuilder=o},857:function(t,e,n){"use strict";var r=n(3085).Buffer,i=n(5108),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryData=void 0;var a=o(n(1011)),s=n(1506),u=n(5095),l=function(){function t(e){this.empty=!0,this.byteOrder=t.BIG_ENDIAN,e&&this.fromData(e)}return t.prototype.setSrsId=function(t){this.srsId=t},t.prototype.setGeometry=function(t){this.empty=!1,this.geometry=t},t.prototype.setEnvelope=function(t){this.envelope=t},t.prototype.toGeoJSON=function(){return this.geometry.toGeoJSON()},t.prototype.fromData=function(t){t instanceof Uint8Array?this.buffer=t=r.from(t):this.buffer=t;var e=this.buffer.toString("ascii",0,2);if(e!==s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER)throw new Error("Unexpected GeoPackage Geometry magic number: "+e+", Expected: "+s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER);var n=this.buffer.readUInt8(2);if(n!==s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_VERSION_1)throw new Error("Unexpected GeoPackage Geometry version "+n+", Expected: "+s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_VERSION_1);var o=this.buffer.readUInt8(3),u=this.readFlags(o);this.srsId=this.buffer[this.byteOrder?"readUInt32LE":"readUInt32BE"](4);var l=this.readEnvelope(u,this.buffer);this.envelope=l.envelope;var c=l.offset,h=this.buffer.slice(c);try{this.geometry=a.default.Geometry.parse(h),this.geometryError=void 0}catch(t){this.geometryError=t.message,i.log("Error parsing geometry")}},t.prototype.toData=function(){var t=r.alloc(8);t.write(s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER),t.writeUInt8(s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_VERSION_1,2);var e=this.buildFlagsByte();t.writeUInt8(e,3),t[this.byteOrder?"writeUInt32LE":"writeUInt32BE"](this.srsId,4);var n=[t,this.writeEnvelope()];try{n.push(this.geometry.toWkb()),this.geometryError=void 0}catch(t){this.geometryError=t.message}return this.buffer=r.concat(n),this.buffer},t.prototype.writeEnvelope=function(){if(!this.envelope)return r.alloc(0);var t=32;this.envelope.hasZ&&(t+=16),this.envelope.hasM&&(t+=16);var e,n=r.alloc(t);(e=this.byteOrder?n.writeDoubleLE.bind(n):n.writeDoubleBE.bind(n))(this.envelope.minX,0),e(this.envelope.maxX,8),e(this.envelope.minY,16),e(this.envelope.maxY,24);var i=32;return this.envelope.hasZ&&(e(this.envelope.minZ,i),e(this.envelope.maxZ,i+8),i=48),this.envelope.hasM&&(e(this.envelope.minM,i),e(this.envelope.maxM,i+8)),n},t.prototype.buildFlagsByte=function(){var e=0;return e+=(this.extended?1:0)<<5,e+=(this.empty?1:0)<<4,(e+=(this.envelope?this.getIndicatorWithEnvelope(this.envelope):0)<<1)+(this.byteOrder===t.BIG_ENDIAN?0:1)},t.prototype.getIndicatorWithEnvelope=function(t){var e=1;return t.hasZ&&e++,t.hasM&&(e+=2),e},t.prototype.readFlags=function(t){var e=t>>7&1,n=t>>6&1;if(0!==e||0!==n)throw new Error("Unexpected GeoPackage Geometry flags. Flag bit 7 and 6 should both be 0, 7="+e+", 6="+n);var r=t>>5&1;this.extended=1===r;var i=t>>4&1;this.empty=1===i;var o=t>>1&7;if(o>4)throw new Error("Unexpected GeoPackage Geometry flags. Envelope contents indicator must be between 0 and 4. Actual: "+o);var a=1&t;return this.byteOrder=a,o},t.prototype.readEnvelope=function(t,e){var n;n=this.byteOrder?e.readDoubleLE.bind(e):e.readDoubleBE.bind(e);var r=0,i={envelope:void 0,offset:8};if(t<=0)return i;var o=new u.Envelope;return o.minX=n(8+8*r++),o.maxX=n(8+8*r++),o.minY=n(8+8*r++),o.maxY=n(8+8*r++),o.hasZ=!1,o.hasM=!1,2!==t&&4!==t||(o.hasZ=!0,o.minZ=n(8+8*r++),o.maxZ=n(8+8*r++)),3!==t&&4!==t||(o.hasM=!0,o.minM=n(8+8*r++),o.maxM=n(8+8*r++)),i.envelope=o,i.offset=8+8*r,i},t.BIG_ENDIAN=0,t.LITTLE_ENDIAN=1,t}();e.GeometryData=l},3026:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=function(){function t(){}return t.prototype.getScopeInformation=function(e){switch(e){case t.UNDEFINED:return{name:t.UNDEFINED,code:"NA",definition:"Metadata information scope is undefined"};case t.FIELD_SESSION:return{name:t.FIELD_SESSION,code:"012",definition:"Information applies to the field session"};case t.COLLECTION_SESSION:return{name:t.COLLECTION_SESSION,code:"004",definition:"Information applies to the collection session"};case t.SERIES:return{name:t.SERIES,code:"006",definition:"Information applies to the (dataset) series"};case t.DATASET:return{name:t.DATASET,code:"005",definition:"Information applies to the (geographic feature) dataset"};case t.FEATURE_TYPE:return{name:t.FEATURE_TYPE,code:"010",definition:"Information applies to a feature type (class)"};case t.FEATURE:return{name:t.FEATURE,code:"009",definition:"Information applies to a feature (instance)"};case t.ATTRIBUTE_TYPE:return{name:t.ATTRIBUTE_TYPE,code:"002",definition:"Information applies to the attribute class"};case t.ATTRIBUTE:return{name:t.ATTRIBUTE,code:"001",definition:"Information applies to the characteristic of a feature (instance)"};case t.TILE:return{name:t.TILE,code:"016",definition:"Information applies to a tile, a spatial subset of geographic data"};case t.MODEL:return{name:t.MODEL,code:"015",definition:"Information applies to a copy or imitation of an existing or hypothetical object"};case t.CATALOG:return{name:t.CATALOG,code:"NA",definition:"Metadata applies to a feature catalog"};case t.SCHEMA:return{name:t.SCHEMA,code:"NA",definition:"Metadata applies to an application schema"};case t.TAXONOMY:return{name:t.TAXONOMY,code:"NA",definition:"Metadata applies to a taxonomy or knowledge system"};case t.SOFTWARE:return{name:t.SOFTWARE,code:"013",definition:"Information applies to a computer program or routine"};case t.SERVICE:return{name:t.SERVICE,code:"014",definition:"Information applies to a capability which a service provider entity makes available to a service user entity through a set of interfaces that define a behaviour, such as a use case"};case t.COLLECTION_HARDWARE:return{name:t.COLLECTION_HARDWARE,code:"003",definition:"Information applies to the collection hardware class"};case t.NON_GEOGRAPHIC_DATASET:return{name:t.NON_GEOGRAPHIC_DATASET,code:"007",definition:"Information applies to non-geographic data"};case t.DIMENSION_GROUP:return{name:t.DIMENSION_GROUP,code:"008",definition:"Information applies to a dimension group"}}},t.UNDEFINED="undefined",t.FIELD_SESSION="fieldSession",t.COLLECTION_SESSION="collectionSession",t.SERIES="series",t.DATASET="dataset",t.FEATURE_TYPE="featureType",t.FEATURE="feature",t.ATTRIBUTE_TYPE="attributeType",t.ATTRIBUTE="attribute",t.TILE="tile",t.MODEL="model",t.CATALOG="catalog",t.SCHEMA="schema",t.TAXONOMY="taxonomy",t.SOFTWARE="software",t.SERVICE="service",t.COLLECTION_HARDWARE="collectionHardware",t.NON_GEOGRAPHIC_DATASET="nonGeographicDataset",t.DIMENSION_GROUP="dimensionGroup",t}();e.Metadata=n},663:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataDao=void 0;var o=n(4115),a=n(3026),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_ID],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.Metadata;return t&&(e.id=t.id,e.md_scope=t.md_scope,e.md_standard_uri=t.md_standard_uri,e.mime_type=t.mime_type,e.metadata=t.metadata),e},e.TABLE_NAME="gpkg_metadata",e.COLUMN_ID="id",e.COLUMN_MD_SCOPE="md_scope",e.COLUMN_MD_STANDARD_URI="md_standard_uri",e.COLUMN_MIME_TYPE="mime_type",e.COLUMN_METADATA="metadata",e}(o.Dao);e.MetadataDao=s},9173:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReference=void 0;var n=function(){function t(){}return t.prototype.toDatabaseValue=function(t){return"timestamp"===t?this.timestamp.toISOString():this[t]},t.prototype.setMetadata=function(t){this.md_file_id=t?t.id:-1},t.prototype.setParentMetadata=function(t){this.md_parent_id=t?t.id:-1},t.prototype.setReferenceScopeType=function(e){switch(this.reference_scope=e,e){case t.GEOPACKAGE:this.table_name=void 0,this.column_name=void 0,this.row_id_value=void 0;break;case t.TABLE:this.column_name=void 0,this.row_id_value=void 0;break;case t.ROW:this.column_name=void 0;break;case t.COLUMN:this.row_id_value=void 0}},t.GEOPACKAGE="geopackage",t.TABLE="table",t.COLUMN="column",t.ROW="row",t.ROW_COL="row/col",t}();e.MetadataReference=n},2056:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReferenceDao=void 0;var o=n(4115),a=n(8572),s=n(9173),u=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_MD_FILE_ID,e.COLUMN_MD_PARENT_ID],n}return i(e,t),e.prototype.createObject=function(t){var e=new s.MetadataReference;return t&&(e.reference_scope=t.reference_scope,e.table_name=t.table_name,e.column_name=t.column_name,e.row_id_value=t.row_id_value,e.timestamp=new Date(t.timestamp),e.md_file_id=t.md_file_id,e.md_parent_id=t.md_parent_id),e},e.prototype.removeMetadataParent=function(t){var n={};n[e.COLUMN_MD_PARENT_ID]=null;var r=this.buildWhereWithFieldAndValue(e.COLUMN_MD_PARENT_ID,t),i=this.buildWhereArgs(t);return this.updateWithValues(n,r,i).changes},e.prototype.queryByMetadataAndParent=function(t,n){var r=new a.ColumnValues;return r.addColumn(e.COLUMN_MD_FILE_ID,t),r.addColumn(e.COLUMN_MD_PARENT_ID,n),this.queryForFieldValues(r)},e.prototype.queryByMetadata=function(t){var n=new a.ColumnValues;return n.addColumn(e.COLUMN_MD_FILE_ID,t),this.queryForFieldValues(n)},e.prototype.queryByMetadataParent=function(t){var n=new a.ColumnValues;return n.addColumn(e.COLUMN_MD_PARENT_ID,t),this.queryForFieldValues(n)},e.prototype.deleteByTableName=function(t){var n="";n+=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t);var r=this.buildWhereArgs(t);return this.deleteWhere(n,r)},e.TABLE_NAME="gpkg_metadata_reference",e.COLUMN_REFERENCE_SCOPE="reference_scope",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_ROW_ID="row_id_value",e.COLUMN_TIMESTAMP="timestamp",e.COLUMN_MD_FILE_ID="md_file_id",e.COLUMN_MD_PARENT_ID="md_parent_id",e}(o.Dao);e.MetadataReferenceDao=u},7403:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OptionBuilder=void 0;var n=function(){function t(){}return t.build=function(t){var e={};return t.forEach((function(t){e["set"+t.slice(0,1).toUpperCase()+t.slice(1)]=function(e){return this[t]=e,this},e["get"+t.slice(0,1).toUpperCase()+t.slice(1)]=function(){return this[t]}})),e},t}();e.OptionBuilder=n},5604:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Projection=void 0;var i=r(n(4472)),o=r(n(8446)),a=n(1375),s=function(){function t(){}return t.loadProjection=function(t,e){if(!t||!e)throw new Error("Invalid projection name/definition");null==i.default.defs(t)&&i.default.defs(t,e)},t.loadProjections=function(e){if(!e)throw new Error("Invalid array of projections");for(var n=0;n<e.length;n++){if(!e[n]||!e[n].name||!e[n].definition)throw new Error("Invalid projection in array. Valid projection {name: string, definition: string}.");t.loadProjection(e[n].name,e[n].definition)}},t.isConverter=function(t){return void 0!==t.forward},t.hasProjection=function(t){return i.default.defs(t)},t.getConverter=function(t,e){if(null!=t&&null==(0,i.default)(t))throw new Error("Projection "+t+" has not been defined.");if(null!=e&&null==(0,i.default)(e))throw new Error("Projection "+e+" has not been defined.");return(0,i.default)(t,e)},t.convertCoordinates=function(t,e,n){if(null!=t&&null==(0,i.default)(t))throw new Error("Projection "+t+" has not been defined.");if(null!=e&&null==(0,i.default)(e))throw new Error("Projection "+e+" has not been defined.");return(0,i.default)(t,e,n)},t.getEPSGConverter=function(t){return(0,i.default)(a.ProjectionConstants.EPSG_PREFIX+t)},t.getWebMercatorToWGS84Converter=function(){return(0,i.default)(a.ProjectionConstants.EPSG_3857)},t.isWebMercator=function(t){return"string"==typeof t?t.toUpperCase()===a.ProjectionConstants.EPSG_3857:this.convertersMatch(this.getEPSGConverter(a.ProjectionConstants.EPSG_CODE_3857),t)},t.isWGS84=function(t){return"string"==typeof t?t.toUpperCase()===a.ProjectionConstants.EPSG_4326:this.convertersMatch(this.getEPSGConverter(a.ProjectionConstants.EPSG_CODE_4326),t)},t.convertersMatch=function(t,e){return(0,o.default)(t.oProj,e.oProj)},t.getConverterFromConverters=function(t,e){return(0,i.default)(t,e)},t}();e.Projection=s},1375:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectionConstants=void 0;var n=function(){function t(){}return t.EPSG="EPSG",t.EPSG_PREFIX="EPSG:",t.EPSG_CODE_3857=3857,t.EPSG_CODE_4326=4326,t.EPSG_CODE_900913=900913,t.EPSG_CODE_102113=102113,t.EPSG_3857=t.EPSG_PREFIX+t.EPSG_CODE_3857,t.EPSG_4326=t.EPSG_PREFIX+t.EPSG_CODE_4326,t.EPSG_900913=t.EPSG_PREFIX+t.EPSG_CODE_900913,t.EPSG_102113=t.EPSG_PREFIX+t.EPSG_CODE_102113,t.WEB_MERCATOR_MAX_LAT_RANGE=85.0511287798066,t.WEB_MERCATOR_MIN_LAT_RANGE=-85.05112877980659,t.WEB_MERCATOR_MAX_LON_RANGE=180,t.WEB_MERCATOR_MIN_LON_RANGE=-180,t.WEB_MERCATOR_HALF_WORLD_WIDTH=20037508.342789244,t.WGS84_HALF_WORLD_LON_WIDTH=180,t.WGS84_HALF_WORLD_LAT_HEIGHT=90,t}();e.ProjectionConstants=n},7977:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TileCreator=void 0;var a=o(n(7769)),s=o(n(4472)),u=o(n(2331)),l=n(3684),c=n(3437),h=n(9325),f=n(824),p=n(5604),d=n(1375),y=function(){function t(t,e,n,r,i,o,a,s,u){this.dispose=!1,this.canvas=null,this.pixelsAdded=!1,this.width=t,this.height=e,this.tileMatrix=n,this.projectionFrom=o.organization.toUpperCase()+":"+o.organization_coordsys_id,this.projectionFromDefinition=o.definition,this.projectionTo=a.toUpperCase(),this.projectionToDefinition=s,this.tileBoundingBox=i,this.tileMatrixSet=r,this.chunks=[],this.tileHeightUnitsPerPixel=i.height/e,this.tileWidthUnitsPerPixel=i.width/t,this.sameProjection=this.projectionFrom===this.projectionTo||this.projectionTo===d.ProjectionConstants.EPSG_3857&&(this.projectionFrom===d.ProjectionConstants.EPSG_900913||this.projectionFrom===d.ProjectionConstants.EPSG_102113),this.canvas=u}return t.create=function(e,n,o,a,s,u,l,c,h){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,(r=new t(e,n,o,a,s,u,l,c,h)).initialize()];case 1:return i.sent(),[2,r]}}))}))},t.prototype.initialize=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,c.Canvas.initializeAdapter()];case 1:return t.sent(),null==this.canvas&&(this.canvas=c.Canvas.create(this.width,this.height),this.dispose=!0),this.ctx=this.canvas.getContext("2d"),this.tileCanvas=c.Canvas.create(this.tileMatrix.tile_width,this.tileMatrix.tile_height),this.tileContext=this.tileCanvas.getContext("2d"),this.imageData=c.Canvas.createImageData(this.width,this.height),[2,this]}}))}))},t.prototype.addPixel=function(t,e,n,r){var i=this.tileContext.getImageData(n,r,1,1);this.imageData.data.set(i.data,e*this.width*4+4*t),this.pixelsAdded=!0},t.prototype.addTile=function(t,e,n){return r(this,void 0,void 0,(function(){var r,o,s,u;return i(this,(function(i){switch(i.label){case 0:return r=(0,a.default)(t),[4,h.ImageUtils.getImage(t,r.mime)];case 1:return o=i.sent(),this.tileContext.clearRect(0,0,this.tileMatrix.tile_width,this.tileMatrix.tile_height),this.tileContext.drawImage(o.image,0,0),this.chunks=[],[4,this.projectTile(t,e,n)];case 2:if(i.sent(),this.pixelsAdded&&this.ctx.putImageData(this.imageData,0,0),this.chunks&&this.chunks.length)for(s=0;s<this.chunks.length;s++)u=this.chunks[s].position,this.ctx.drawImage(o.image,u.sx,u.sy,u.sWidth,u.sHeight,u.dx,u.dy,u.dWidth,u.dHeight);return c.Canvas.disposeImage(o),[2]}}))}))},t.prototype.projectTile=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=l.TileBoundingBoxUtils.getTileBoundingBox(this.tileMatrixSet.boundingBox,this.tileMatrix,e,n),this.sameProjection?[2,this.cutAndScale(t,r)]:[2,this.reproject(t,r)]}))}))},t.prototype.cutAndScale=function(t,e){var n=l.TileBoundingBoxUtils.determinePositionAndScale(e,this.tileMatrix.tile_height,this.tileMatrix.tile_width,this.tileBoundingBox,this.height,this.width);n.xPositionInFinalTileStart>=this.width||n.yPositionInFinalTileStart>=this.height||this.addChunk(t,n)},t.prototype.addChunk=function(t,e){this.chunks.push({chunk:t,position:e})},t.prototype.reproject=function(t,e){return r(this,void 0,void 0,(function(){var t,r,o,a,l,c,h,d,y,m,g,_,b,v=this;return i(this,(function(i){if("undefined"!=typeof window&&window.Worker)return f.TileUtilities.getPiecePosition(e,this.tileBoundingBox,this.height,this.width,this.projectionTo,this.projectionToDefinition,this.projectionFrom,this.projectionFromDefinition,this.tileHeightUnitsPerPixel,this.tileWidthUnitsPerPixel,this.tileMatrix.pixel_x_size,this.tileMatrix.pixel_y_size),t={sourceImageData:this.tileContext.getImageData(0,0,this.tileMatrix.tile_width,this.tileMatrix.tile_height).data.buffer,height:this.height,width:this.width,projectionTo:this.projectionTo,projectionToDefinition:this.projectionToDefinition,projectionFrom:this.projectionFrom,projectionFromDefinition:this.projectionFromDefinition,maxLatitude:this.tileBoundingBox.maxLatitude,minLongitude:this.tileBoundingBox.minLongitude,tileWidthUnitsPerPixel:this.tileWidthUnitsPerPixel,tileHeightUnitsPerPixel:this.tileHeightUnitsPerPixel,tilePieceBoundingBox:JSON.stringify(e),tileBoundingBox:JSON.stringify(this.tileBoundingBox),pixel_y_size:this.tileMatrix.pixel_y_size,pixel_x_size:this.tileMatrix.pixel_x_size,tile_width:this.tileMatrix.tile_width,tile_height:this.tileMatrix.tile_height},[2,new Promise((function(e){try{(r=n(8034)(n(7591))).onmessage=function(t){v.canvas.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(t.data),v.height,v.width),0,0),e()},r.postMessage(t,[v.tileContext.getImageData(0,0,v.tileMatrix.tile_width,v.tileMatrix.tile_height).data.buffer])}catch(n){var r,i=(r=u.default)(t);v.canvas.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(i),v.height,v.width),0,0),e()}}))];r=this.height,o=this.width,a=this.tileMatrix.tile_height,l=this.tileMatrix.tile_width,c=void 0;try{null==p.Projection.hasProjection(this.projectionTo)&&p.Projection.loadProjection(this.projectionTo,this.projectionToDefinition),null==p.Projection.hasProjection(this.projectionFrom)&&p.Projection.loadProjection(this.projectionFrom,this.projectionFromDefinition),c=(0,s.default)(this.projectionTo,this.projectionFrom)}catch(t){}for(h=void 0,d=0;d<r;d++)for(h=this.tileBoundingBox.maxLatitude-d*this.tileHeightUnitsPerPixel,y=0;y<o;y++)m=this.tileBoundingBox.minLongitude+y*this.tileWidthUnitsPerPixel,g=c.forward([m,h]),_=l-Math.round((e.maxLongitude-g[0])/this.tileMatrix.pixel_x_size),b=Math.round((e.maxLatitude-g[1])/this.tileMatrix.pixel_y_size),_>=0&&_<l&&b>=0&&b<a&&this.addPixel(y,d,_,b);return this.canvas.getContext("2d").putImageData(this.imageData,0,0),[2]}))}))},t.prototype.getCompleteTile=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,c.Canvas.toDataURL(this.canvas,t)]}))}))},t.prototype.cleanup=function(){this.dispose&&c.Canvas.disposeCanvas(this.canvas),c.Canvas.disposeCanvas(this.tileCanvas)},t}();e.TileCreator=y},2544:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomFeaturesTile=void 0;e.CustomFeaturesTile=function(){this.compressFormat="png",this.tileBorderStrokeWidth=2,this.tileBorderColor="rgba(0, 0, 0, 1.0)",this.tileFillColor="rgba(0, 0, 0, 0.0625)",this.drawUnindexedTiles=!0}},3060:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.NumberFeaturesTile=void 0;var s=n(3437),u=function(t){function e(){var e=t.call(this)||this;return e.textSize=18,e.textFont="Noto Mono",e.textColor="rgba(255, 255, 255, 1.0)",e.circleStrokeWidth=3,e.circleBorderColor="rgba(0, 0, 0, 0.25)",e.circleFillColor="rgba(0, 0, 0, 1.0)",e.circlePaddingPercentage=.25,e.defaultFontRegistered=!1,e}return i(e,t),e.prototype.getTextSize=function(){return this.textSize},e.prototype.setTextSize=function(t){this.textSize=t},e.prototype.getTextColor=function(){return this.textColor},e.prototype.setTextColor=function(t){this.textColor=t},e.prototype.getCircleStrokeWidth=function(){return this.circleStrokeWidth},e.prototype.setCircleStrokeWidth=function(t){this.circleStrokeWidth=t},e.prototype.getCircleColor=function(){return this.circleBorderColor},e.prototype.setCircleColor=function(t){this.circleBorderColor=t},e.prototype.getCircleFillColor=function(){return this.circleFillColor},e.prototype.setCircleFillColor=function(t){this.circleFillColor=t},e.prototype.getCirclePaddingPercentage=function(){return this.circlePaddingPercentage},e.prototype.setCirclePaddingPercentage=function(t){if(t<0||t>1)throw new Error("Circle padding percentage must be between 0.0 and 1.0: "+t);this.circlePaddingPercentage=t},e.prototype.getTileBorderStrokeWidth=function(){return this.tileBorderStrokeWidth},e.prototype.setTileBorderStrokeWidth=function(t){this.tileBorderStrokeWidth=t},e.prototype.getTileBorderColor=function(){return this.tileBorderColor},e.prototype.setTileBorderColor=function(t){this.tileBorderColor=t},e.prototype.getTileFillColor=function(){return this.tileFillColor},e.prototype.setTileFillColor=function(t){this.tileFillColor=t},e.prototype.isDrawUnindexedTiles=function(){return this.drawUnindexedTiles},e.prototype.setDrawUnindexedTiles=function(t){this.drawUnindexedTiles=t},e.prototype.getCompressFormat=function(){return this.compressFormat},e.prototype.setCompressFormat=function(t){this.compressFormat=t},e.prototype.drawUnindexedTile=function(t,e,n){return void 0===n&&(n=null),o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=null,this.drawUnindexedTiles&&(r=this.drawTile(t,e,"?",n)),[2,r]}))}))},e.prototype.drawTile=function(t,e,n,r){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,s.Canvas.initializeAdapter()];case 1:return o.sent(),[2,new Promise((function(o){var a,u=!1;null!=r?a=r:(a=s.Canvas.create(t,e),u=!0);var l=a.getContext("2d");l.clearRect(0,0,t,e),null!==i.tileFillColor&&(l.fillStyle=i.tileFillColor,l.fillRect(0,0,t,e)),null!==i.tileBorderColor&&(l.strokeStyle=i.tileBorderColor,l.lineWidth=i.tileBorderStrokeWidth,l.strokeRect(0,0,t,e));var c=s.Canvas.measureText(l,i.textFont,i.textSize,n),h=i.textSize,f=Math.round(t/2),p=Math.round(e/2);if(null!=i.circleBorderColor||null!=i.circleFillColor){var d=Math.max(c,h),y=Math.round(d/2);y=Math.round(y+d*i.circlePaddingPercentage),null!=i.circleFillColor&&(l.fillStyle=i.circleFillColor,l.beginPath(),l.arc(f,p,y,0,2*Math.PI,!0),l.closePath(),l.fill()),null!=i.circleBorderColor&&(l.strokeStyle=i.circleBorderColor,l.lineWidth=i.circleStrokeWidth,l.beginPath(),l.arc(f,p,y,0,2*Math.PI,!0),l.closePath(),l.stroke())}s.Canvas.drawText(l,n,[f,p],i.textFont,i.textSize,i.textColor),s.Canvas.toDataURL(a,"image/"+i.compressFormat).then((function(t){u&&s.Canvas.disposeCanvas(a),o(t)}))}))]}}))}))},e}(n(2544).CustomFeaturesTile);e.NumberFeaturesTile=u},6667:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.ShadedFeaturesTile=void 0;var s=n(3437),u=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.getTileBorderStrokeWidth=function(){return this.tileBorderStrokeWidth},e.prototype.setTileBorderStrokeWidth=function(t){this.tileBorderStrokeWidth=t},e.prototype.getTileBorderColor=function(){return this.tileBorderColor},e.prototype.setTileBorderColor=function(t){this.tileBorderColor=t},e.prototype.getTileFillColor=function(){return this.tileFillColor},e.prototype.setTileFillColor=function(t){this.tileFillColor=t},e.prototype.isDrawUnindexedTiles=function(){return this.drawUnindexedTiles},e.prototype.setDrawUnindexedTiles=function(t){this.drawUnindexedTiles=t},e.prototype.getCompressFormat=function(){return this.compressFormat},e.prototype.setCompressFormat=function(t){this.compressFormat=t},e.prototype.drawUnindexedTile=function(t,e,n){return void 0===n&&(n=null),o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=null,this.drawUnindexedTiles&&(r=this.drawTile(t,e,"?",n)),[2,r]}))}))},e.prototype.drawTile=function(t,e,n,r){return o(this,void 0,void 0,(function(){var n=this;return a(this,(function(i){switch(i.label){case 0:return[4,s.Canvas.initializeAdapter()];case 1:return i.sent(),[2,new Promise((function(i){var o,a=!1;null!=r?o=r:(o=s.Canvas.create(t,e),a=!0);var u=o.getContext("2d");u.clearRect(0,0,t,e),null!==n.tileFillColor&&(u.fillStyle=n.tileFillColor,u.fillRect(0,0,t,e)),null!==n.tileBorderColor&&(u.strokeStyle=n.tileBorderColor,u.lineWidth=n.tileBorderStrokeWidth,u.strokeRect(0,0,t,e)),s.Canvas.toDataURL(o,"image/"+n.compressFormat).then((function(t){a&&s.Canvas.disposeCanvas(o),i(t)}))}))]}}))}))},e}(n(2544).CustomFeaturesTile);e.ShadedFeaturesTile=u},4538:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureDrawType=void 0,(n=e.FeatureDrawType||(e.FeatureDrawType={})).CIRCLE="CIRCLE",n.STROKE="STROKE",n.FILL="FILL",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){switch(e){case"CIRCLE":return t.CIRCLE;case"STROKE":return t.STROKE;case"FILL":return t.FILL}}}(e.FeatureDrawType||(e.FeatureDrawType={}))},6063:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeaturePaint=void 0;var n=function(){function t(){this.featurePaints={}}return t.prototype.getPaint=function(t){return this.featurePaints[t]},t.prototype.setPaint=function(t,e){this.featurePaints[t]=e},t}();e.FeaturePaint=n},9957:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeaturePaintCache=void 0;var r=n(6063),i=function(){function t(e){void 0===e&&(e=t.DEFAULT_STYLE_PAINT_CACHE_SIZE),this.cacheSize=e,this.paintCache={},this.accessHistory=[]}return t.prototype.getFeaturePaintForStyleRow=function(t){return this.getFeaturePaint(t.id)},t.prototype.getFeaturePaint=function(t){var e=this.paintCache[t];if(e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1),this.accessHistory.push(t)}return e},t.prototype.getPaintForStyleRow=function(t,e){return this.getPaint(t.id,e)},t.prototype.getPaint=function(t,e){var n=null,r=this.getFeaturePaint(t);return null!=r&&(n=r.getPaint(e)),n},t.prototype.setPaintForStyleRow=function(t,e,n){this.setPaint(t.id,e,n)},t.prototype.setPaint=function(t,e,n){var i=this.paintCache[t];if(i){var o=this.accessHistory.indexOf(t);o>-1&&this.accessHistory.splice(o,1)}else i=new r.FeaturePaint;if(i.setPaint(e,n),this.paintCache[t]=i,this.accessHistory.push(t),Object.keys(this.paintCache).length>this.cacheSize){var a=this.accessHistory.shift();a&&delete this.paintCache[a]}},t.prototype.remove=function(t){var e=this.paintCache[t];if(delete this.paintCache[t],e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1)}return e},t.prototype.clear=function(){this.paintCache={},this.accessHistory=[]},t.prototype.resize=function(t){this.cacheSize=t;var e=Object.keys(this.paintCache);if(e.length>t)for(var n=e.length-t,r=0;r<n;r++){var i=this.accessHistory.shift();i&&delete this.paintCache[i]}},t.DEFAULT_STYLE_PAINT_CACHE_SIZE=100,t}();e.FeaturePaintCache=i},943:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryCache=void 0;var n=function(){function t(e){void 0===e&&(e=t.DEFAULT_GEOMETRY_CACHE_SIZE),this.cacheSize=e,this.geometryCache={},this.accessHistory=[]}return t.prototype.getGeometryForFeatureRow=function(t){return this.getGeometry(t.id)},t.prototype.getGeometry=function(t){var e=this.geometryCache[t];if(e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1),this.accessHistory.push(t)}return e},t.prototype.setGeometry=function(t,e){var n=this.accessHistory.indexOf(t);if(n>-1&&this.accessHistory.splice(n,1),this.geometryCache[t]=e,this.accessHistory.push(t),Object.keys(this.geometryCache).length>this.cacheSize){var r=this.accessHistory.shift();r&&delete this.geometryCache[r]}},t.prototype.remove=function(t){var e=this.geometryCache[t];if(delete this.geometryCache[t],e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1)}return e},t.prototype.clear=function(){this.geometryCache={},this.accessHistory=[]},t.prototype.resize=function(t){this.cacheSize=t;var e=Object.keys(this.geometryCache);if(e.length>t)for(var n=e.length-t,r=0;r<n;r++){var i=this.accessHistory.shift();i&&delete this.geometryCache[i]}},t.DEFAULT_GEOMETRY_CACHE_SIZE=100,t}();e.GeometryCache=n},297:function(t,e,n){"use strict";var r=n(5108),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTiles=void 0;var u=s(n(7383)),l=s(n(3809)),c=s(n(6479)),h=n(3684),f=n(2527),p=n(8600),d=n(943),y=n(4538),m=n(9957),g=n(5211),_=n(6536),b=n(3437),v=n(5604),T=n(1375),E=function(){function t(t,e,n){void 0===e&&(e=256),void 0===n&&(n=256),this.featureDao=t,this.tileWidth=e,this.tileHeight=n,this.projection=null,this.webMercatorProjection=null,this.simplifyGeometries=!0,this.simplifyToleranceInPixels=1,this.compressFormat="png",this.pointRadius=4,this.pointPaint=new g.Paint,this.pointIcon=null,this.linePaint=new g.Paint,this._lineStrokeWidth=2,this.polygonPaint=new g.Paint,this._polygonStrokeWidth=2,this.fillPolygon=!0,this.polygonFillPaint=new g.Paint,this.featurePaintCache=new m.FeaturePaintCache,this.geometryCache=new d.GeometryCache,this.cacheGeometries=!0,this.iconCache=new p.IconCache,this._scale=1,this.maxFeaturesPerTile=null,this.maxFeaturesTileDraw=null,this.projection=this.featureDao.projection,this.linePaint.strokeWidth=2,this.polygonPaint.strokeWidth=2,this.polygonFillPaint.color="#00000011",this.geoPackage=this.featureDao.geoPackage,null!=this.geoPackage&&(this.featureTableStyles=new _.FeatureTableStyles(this.geoPackage,t.table),this.featureTableStyles.has()||(this.featureTableStyles=null)),this.webMercatorProjection=v.Projection.getWebMercatorToWGS84Converter(),this.calculateDrawOverlap()}return t.prototype.cleanup=function(){this.clearIconCache(),this.pointIcon&&(b.Canvas.disposeImage(this.pointIcon.getIcon()),this.pointIcon=null)},Object.defineProperty(t.prototype,"drawOverlap",{set:function(t){this.widthDrawOverlap=t,this.heightDrawOverlap=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"simplifyTolerance",{get:function(){return this.simplifyToleranceInPixels},set:function(t){this.simplifyToleranceInPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"widthDrawOverlap",{get:function(){return this.widthOverlap},set:function(t){this.widthOverlap=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"heightDrawOverlap",{get:function(){return this.heightOverlap},set:function(t){this.heightOverlap=t},enumerable:!1,configurable:!0}),t.prototype.ignoreFeatureTableStyles=function(){this.featureTableStyles=null,this.calculateDrawOverlap()},t.prototype.clearCache=function(){this.clearStylePaintCache(),this.clearIconCache()},t.prototype.clearStylePaintCache=function(){this.featurePaintCache.clear()},Object.defineProperty(t.prototype,"stylePaintCacheSize",{set:function(t){this.featurePaintCache.resize(t)},enumerable:!1,configurable:!0}),t.prototype.clearIconCache=function(){this.iconCache.clear()},Object.defineProperty(t.prototype,"iconCacheSize",{set:function(t){this.iconCache.resize(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this._scale},set:function(t){this._scale=t,this.linePaint.strokeWidth=t*this.lineStrokeWidth,this.polygonPaint.strokeWidth=t*this.polygonStrokeWidth,this.featurePaintCache.clear()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"geometryCacheMaxSize",{set:function(t){this.geometryCache.resize(t)},enumerable:!1,configurable:!0}),t.prototype.calculateDrawOverlap=function(){this.pointIcon?(this.heightOverlap=this.scale*this.pointIcon.getHeight(),this.widthOverlap=this.scale*this.pointIcon.getWidth()):(this.heightOverlap=this.scale*this.pointRadius,this.widthOverlap=this.scale*this.pointRadius);var t=this.scale*this.lineStrokeWidth/2;this.heightOverlap=Math.max(this.heightOverlap,t),this.widthOverlap=Math.max(this.widthOverlap,t);var e=this.scale*this.polygonStrokeWidth/2;if(this.heightOverlap=Math.max(this.heightOverlap,e),this.widthOverlap=Math.max(this.widthOverlap,e),null!=this.featureTableStyles&&this.featureTableStyles.has()){var n=[],r=this.featureTableStyles.getAllTableStyleIds();null!=r&&(n=n.concat(r));var i=this.featureTableStyles.getAllStyleIds();null!=i&&(n=n.concat(i.filter((function(t){return-1===n.indexOf(t)}))));for(var o=this.featureTableStyles.getStyleDao(),a=0;a<n.length;a++){var s=n[a],u=o.queryForId(s),l=this.scale*(u.getWidthOrDefault()/2);this.widthOverlap=Math.max(this.widthOverlap,l),this.heightOverlap=Math.max(this.heightOverlap,l)}var c=[],h=this.featureTableStyles.getAllTableIconIds();null!=h&&(c=c.concat(h));var f=this.featureTableStyles.getAllIconIds();null!=f&&(c=c.concat(f.filter((function(t){return-1===c.indexOf(t)}))));var p=this.featureTableStyles.getIconDao();for(a=0;a<c.length;a++){var d=c[a],y=p.queryForId(d).derivedDimensions,m=this.scale*Math.ceil(y[0]),g=this.scale*Math.ceil(y[1]);this.widthOverlap=Math.max(this.widthOverlap,m),this.heightOverlap=Math.max(this.heightOverlap,g)}}},Object.defineProperty(t.prototype,"drawOverlapsWithPixels",{set:function(t){this.widthOverlap=t,this.heightOverlap=t},enumerable:!1,configurable:!0}),t.prototype.getFeatureStyle=function(t){var e=null;return null!=this.featureTableStyles&&(e=this.featureTableStyles.getFeatureStyleForFeatureRow(t)),e},t.prototype.getPointPaint=function(t){var e=this.getFeatureStylePaint(t,y.FeatureDrawType.CIRCLE);return null==e&&(e=this.pointPaint),e},t.prototype.getLinePaint=function(t){var e=this.getFeatureStylePaint(t,y.FeatureDrawType.STROKE);return null==e&&(e=this.linePaint),e},t.prototype.getPolygonPaint=function(t){var e=this.getFeatureStylePaint(t,y.FeatureDrawType.STROKE);return null==e&&(e=this.polygonPaint),e},t.prototype.getPolygonFillPaint=function(t){var e=null,n=!1;if(null!=t){var r=t.style;null!=r&&(r.hasFillColor()?e=this.getStylePaint(r,y.FeatureDrawType.FILL):n=r.hasColor())}return null===e&&!n&&this.fillPolygon&&(e=this.polygonFillPaint),e},t.prototype.getFeatureStylePaint=function(t,e){var n=null;if(null!=t){var r=t.style;null!=r&&r.hasColor()&&(n=this.getStylePaint(r,e))}return n},t.prototype.getStylePaint=function(t,e){var n=this.featurePaintCache.getPaintForStyleRow(t,e);if(null==n){var r=null,i=null;if(e===y.FeatureDrawType.CIRCLE)r=t.getColor();else if(e===y.FeatureDrawType.STROKE)r=t.getColor(),i=this.scale*t.getWidthOrDefault();else{if(e!==y.FeatureDrawType.FILL)throw new Error("Unsupported Draw Type: "+e);r=t.getFillColor(),i=this.scale*t.getWidthOrDefault()}var o=new g.Paint;o.color=r,null!=i&&(o.strokeWidth=i),null==(n=this.featurePaintCache.getPaintForStyleRow(t,e))&&(this.featurePaintCache.setPaintForStyleRow(t,e,o),n=o)}return n},Object.defineProperty(t.prototype,"pointColor",{get:function(){return this.pointPaint.color},set:function(t){this.pointPaint.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineStrokeWidth",{get:function(){return this._lineStrokeWidth},set:function(t){this._lineStrokeWidth=t,this.linePaint.strokeWidth=this.scale*this.lineStrokeWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineColor",{get:function(){return this.linePaint.color},set:function(t){this.linePaint.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonStrokeWidth",{get:function(){return this._polygonStrokeWidth},set:function(t){this._polygonStrokeWidth=t,this.polygonPaint.strokeWidth=this.scale*t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonColor",{get:function(){return this.polygonPaint.color},set:function(t){this.polygonPaint.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonFillColor",{get:function(){return this.polygonFillPaint.color},set:function(t){this.polygonFillPaint.color=t},enumerable:!1,configurable:!0}),t.prototype.getFeatureCountXYZ=function(t,e,n){var r=h.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n);return r=this.expandBoundingBox(r,T.ProjectionConstants.EPSG_3857),this.featureDao.countWebMercatorBoundingBox(r)},t.prototype.drawTile=function(t,e,n,r){return void 0===r&&(r=null),i(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.draw3857Tile(t,e,n,r)]}))}))},t.prototype.draw3857Tile=function(t,e,n,r){return void 0===r&&(r=null),i(this,void 0,void 0,(function(){return o(this,(function(i){return this.featureDao.isIndexed()?[2,this.drawTileQueryIndex(t,e,n,T.ProjectionConstants.EPSG_3857,r)]:[2,this.drawTileQueryAll(t,e,n,T.ProjectionConstants.EPSG_3857,r)]}))}))},t.prototype.draw4326Tile=function(t,e,n,r){return void 0===r&&(r=null),i(this,void 0,void 0,(function(){return o(this,(function(i){return this.featureDao.isIndexed()?[2,this.drawTileQueryIndex(t,e,n,T.ProjectionConstants.EPSG_4326,r)]:[2,this.drawTileQueryAll(t,e,n,T.ProjectionConstants.EPSG_4326,r)]}))}))},t.prototype.drawTileQueryAll=function(t,e,n,r,a){return i(this,void 0,void 0,(function(){var i,s;return o(this,(function(o){return i=r===T.ProjectionConstants.EPSG_3857?h.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n):h.TileBoundingBoxUtils.getWGS84BoundingBoxFromXYZ(t,e,n),s=this.featureDao.getCount(),null===this.maxFeaturesPerTile||s<=this.maxFeaturesPerTile?[2,this.drawTileWithBoundingBox(i,n,r,a)]:null!=this.maxFeaturesTileDraw?[2,this.maxFeaturesTileDraw.drawUnindexedTile(this.tileWidth,this.tileHeight,a)]:[2]}))}))},t.prototype.getTransformFunction=function(t){var e=this,n=v.Projection.getConverter(t);return v.Projection.convertersMatch(n,this.projection)?function(t){return t}:v.Projection.isWebMercator(n)&&v.Projection.isWGS84(this.projection)?function(n){return v.Projection.getConverterFromConverters(e.projection,t).forward([Math.max(T.ProjectionConstants.WEB_MERCATOR_MIN_LON_RANGE,Math.min(T.ProjectionConstants.WEB_MERCATOR_MAX_LON_RANGE,n[0])),Math.max(T.ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE,Math.min(T.ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE,n[1]))])}:v.Projection.getConverterFromConverters(this.projection,t).forward},t.prototype.drawTileQueryIndex=function(t,e,n,s,u){return i(this,void 0,void 0,(function(){var i,l,c,f,p,d,y,m,g,_,v,E,w,x,C,M,S,N,O;return o(this,(function(o){switch(o.label){case 0:return c=!1,p=s===T.ProjectionConstants.EPSG_3857?h.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n):h.TileBoundingBoxUtils.getWGS84BoundingBoxFromXYZ(t,e,n),d=this.expandBoundingBox(p,s),y=this.tileWidth,m=this.tileHeight,[4,b.Canvas.initializeAdapter()];case 1:if(o.sent(),null!=u?(l=(i=u).getContext("2d")).clearRect(0,0,y,m):(i=b.Canvas.create(y,m),l=i.getContext("2d"),c=!0),!((g=this.featureDao.countInBoundingBox(d,s))>0))return[3,16];if(!(null==this.maxFeaturesPerTile||g<=this.maxFeaturesPerTile))return[3,13];_=this.getTransformFunction(s),v=this.featureDao.fastQueryBoundingBox(d,s),o.label=2;case 2:o.trys.push([2,9,10,11]),E=a(v),w=E.next(),o.label=3;case 3:if(w.done)return[3,8];if(null==(x=w.value).geometry)return[3,7];C=null,this.cacheGeometries&&(C=this.geometryCache.getGeometry(x.id)),null==C&&(C=x.geometry.geometry.toGeoJSON(),this.geometryCache.setGeometry(x.id,C)),M=this.getFeatureStyle(x),o.label=4;case 4:return o.trys.push([4,6,,7]),[4,this.drawGeometry(C,l,p,M,_)];case 5:return o.sent(),[3,7];case 6:return o.sent(),r.error("Failed to draw feature in tile. Id: "+x.id+", Table: "+this.featureDao.table_name),[3,7];case 7:return w=E.next(),[3,3];case 8:return[3,11];case 9:return S=o.sent(),N={error:S},[3,11];case 10:try{w&&!w.done&&(O=E.return)&&O.call(E)}finally{if(N)throw N.error}return[7];case 11:return[4,b.Canvas.toDataURL(i,"image/"+this.compressFormat)];case 12:return f=o.sent(),[3,15];case 13:return null==this.maxFeaturesTileDraw?[3,15]:[4,this.maxFeaturesTileDraw.drawTile(y,m,g.toString(),i)];case 14:f=o.sent(),o.label=15;case 15:return[3,18];case 16:return[4,b.Canvas.toDataURL(i,"image/"+this.compressFormat)];case 17:f=o.sent(),o.label=18;case 18:return c&&b.Canvas.disposeCanvas(i),[2,f]}}))}))},t.prototype.drawTileWithBoundingBox=function(t,e,n,s){return i(this,void 0,void 0,(function(){var e,i,u,l,c,h,f,p,d,y,m,g,_,v,T,E,w,x;return o(this,(function(o){switch(o.label){case 0:return e=this.tileWidth,i=this.tileHeight,l=!1,[4,b.Canvas.initializeAdapter()];case 1:o.sent(),null!=s?u=s:(u=b.Canvas.create(e,i),l=!0),(c=u.getContext("2d")).clearRect(0,0,e,i),h=this.featureDao,f=h.queryForEach(void 0,void 0,void 0,void 0,void 0,[h.table.getIdColumn().getName(),h.table.getGeometryColumn().getName()]),p=this.getTransformFunction(n),o.label=2;case 2:o.trys.push([2,9,10,11]),d=a(f),y=d.next(),o.label=3;case 3:if(y.done)return[3,8];if(m=y.value,null==(g=h.getRow(m)).geometry)return[3,7];if(_=null,this.cacheGeometries&&(_=this.geometryCache.getGeometryForFeatureRow(g)),null==_&&(_=g.geometry.geometry.toGeoJSON(),this.geometryCache.setGeometry(g.id,_)),null==_)return[3,7];v=this.getFeatureStyle(g),o.label=4;case 4:return o.trys.push([4,6,,7]),[4,this.drawGeometry(_,c,t,v,p)];case 5:return o.sent(),[3,7];case 6:return o.sent(),r.error("Failed to draw feature in tile. Id: "+g.id+", Table: "+this.featureDao.table_name),[3,7];case 7:return y=d.next(),[3,3];case 8:return[3,11];case 9:return T=o.sent(),w={error:T},[3,11];case 10:try{y&&!y.done&&(x=d.return)&&x.call(d)}finally{if(w)throw w.error}return[7];case 11:return[4,b.Canvas.toDataURL(u,"image/"+this.compressFormat)];case 12:return E=o.sent(),l&&b.Canvas.disposeCanvas(u),[2,E]}}))}))},t.prototype.drawPoint=function(t,e,n,r,a){return i(this,void 0,void 0,(function(){var i,s,u,l,c,f,p,d,y,m,g,_,b,v;return o(this,(function(o){switch(o.label){case 0:return c=a(t.coordinates),f=h.TileBoundingBoxUtils.getXPixel(this.tileWidth,n,c[0]),p=h.TileBoundingBoxUtils.getYPixel(this.tileHeight,n,c[1]),null!=r&&r.useIcon()?(d=r.icon,[4,this.iconCache.createIcon(d)]):[3,2];case 1:return y=o.sent(),i=Math.round(this.scale*y.width),s=Math.round(this.scale*y.height),f>=0-i&&f<=this.tileWidth+i&&p>=0-s&&p<=this.tileHeight+s&&(u=Math.round(f-d.anchorUOrDefault*i),l=Math.round(p-d.anchorVOrDefault*s),e.drawImage(y.image,u,l,i,s)),[3,3];case 2:if(null!=this.pointIcon){if(i=Math.round(this.scale*this.pointIcon.getWidth()),s=Math.round(this.scale*this.pointIcon.getHeight()),f>=0-i&&f<=this.tileWidth+i&&p>=0-s&&p<=this.tileHeight+s){u=Math.round(f-this.scale*this.pointIcon.getXOffset()),l=Math.round(p-this.scale*this.pointIcon.getYOffset());try{e.drawImage(this.pointIcon.getIcon().image,u,l,i,s)}catch(t){}}}else e.save(),m=null,null!=r&&null!=(g=r.style)&&(m=this.scale*(g.getWidthOrDefault()/2)),null==m&&(m=this.scale*this.pointRadius),_=this.getPointPaint(r),f>=0-m&&f<=this.tileWidth+m&&p>=0-m&&p<=this.tileHeight+m&&(b=Math.round(f),v=Math.round(p),e.beginPath(),e.arc(b,v,m,0,2*Math.PI,!0),e.closePath(),e.fillStyle=_.colorRGBA,e.fill()),e.restore();o.label=3;case 3:return[2]}}))}))},t.prototype.simplifyPoints=function(t,e){return void 0===e&&(e=!1),(0,c.default)(t.map((function(t){return{x:t[0],y:t[1]}})),this.simplifyToleranceInPixels,!1).map((function(t){return[t.x,t.y]}))},t.prototype.getPath=function(t,e,n,r,i){var o=this;void 0===r&&(r=!1);var a=t.coordinates.map((function(t){var e=i(t.slice());return[h.TileBoundingBoxUtils.getXPixel(o.tileWidth,n,e[0]),h.TileBoundingBoxUtils.getYPixel(o.tileHeight,n,e[1])]})),s=this.simplifyGeometries?this.simplifyPoints(a,r):a;if(s.length>1){e.moveTo(s[0][0],s[0][1]);for(var u=1;u<s.length;u++)e.lineTo(s[u][0],s[u][1])}},t.prototype.drawLine=function(t,e,n,r,i){e.save(),e.beginPath();var o=this.getLinePaint(n);e.strokeStyle=o.colorRGBA,e.lineWidth=o.strokeWidth,this.getPath(t,e,r,!1,i),e.stroke(),e.closePath(),e.restore()},t.prototype.drawPolygon=function(t,e,n,r,i,o,a){void 0===a&&(a=!0),n.save(),n.beginPath(),(0,l.default)(t.coordinates)||(t.coordinates=t.coordinates.reverse()),this.getPath(t,n,i,!0,o),n.closePath();for(var s=0;s<e.length;s++)(0,l.default)(e[s].coordinates)&&(e[s].coordinates=e[s].coordinates.reverse()),this.getPath(e[s],n,i,!0,o),n.closePath();var u=this.getPolygonFillPaint(r);a&&void 0!==u&&null!=u&&(n.fillStyle=u.colorRGBA,n.fill());var c=this.getPolygonPaint(r);n.strokeStyle=c.colorRGBA,n.lineWidth=c.strokeWidth,n.stroke(),n.restore()},t.prototype.drawGeometry=function(t,e,n,r,a){return i(this,void 0,void 0,(function(){var i,s,l,c,h=this;return o(this,(function(o){switch(o.label){case 0:return"Point"!==t.type?[3,2]:[4,this.drawPoint(t,e,n,r,a)];case 1:return o.sent(),[3,19];case 2:return"LineString"!==t.type?[3,3]:(this.drawLine(t,e,r,n,a),[3,19]);case 3:return"Polygon"!==t.type?[3,4]:("Feature"===(s=(0,u.default)(t)).type?"LineString"===s.geometry.type?this.drawPolygon(s.geometry,[],e,r,n,a):"MultiLineString"===s.geometry.type&&(l={type:"LineString",coordinates:s.geometry.coordinates[0]},c=s.geometry.coordinates.slice(1).map((function(t){return{type:"LineString",coordinates:t}})),this.drawPolygon(l,c,e,r,n,a)):s.features.forEach((function(t){if("LineString"===t.geometry.type)h.drawPolygon(t.geometry,[],e,r,n,a);else if("MultiLineString"===t.geometry.type){var i={type:"LineString",coordinates:t.geometry.coordinates[0]},o=t.geometry.coordinates.slice(1).map((function(t){return{type:"LineString",coordinates:t}}));h.drawPolygon(i,o,e,r,n,a)}})),[3,19]);case 4:if("MultiPoint"!==t.type)return[3,9];i=0,o.label=5;case 5:return i<t.coordinates.length?[4,this.drawPoint({type:"Point",coordinates:t.coordinates[i]},e,n,r,a)]:[3,8];case 6:o.sent(),o.label=7;case 7:return i++,[3,5];case 8:return[3,19];case 9:if("MultiLineString"!==t.type)return[3,10];for(i=0;i<t.coordinates.length;i++)this.drawLine({type:"LineString",coordinates:t.coordinates[i]},e,r,n,a);return[3,19];case 10:if("MultiPolygon"!==t.type)return[3,15];i=0,o.label=11;case 11:return i<t.coordinates.length?[4,this.drawGeometry({type:"Polygon",coordinates:t.coordinates[i]},e,n,r,a)]:[3,14];case 12:o.sent(),o.label=13;case 13:return i++,[3,11];case 14:return[3,19];case 15:if("GeometryCollection"!==t.type)return[3,19];i=0,o.label=16;case 16:return i<t.geometries.length?[4,this.drawGeometry(t.geometries[i],e,n,r,a)]:[3,19];case 17:o.sent(),o.label=18;case 18:return i++,[3,16];case 19:return[2]}}))}))},t.prototype.expandBoundingBox=function(t,e){var n=h.TileBoundingBoxUtils.getLongitudeFromPixel(this.tileWidth,t,t,0-this.widthOverlap),r=h.TileBoundingBoxUtils.getLongitudeFromPixel(this.tileWidth,t,t,this.tileWidth+this.widthOverlap),i=h.TileBoundingBoxUtils.getLatitudeFromPixel(this.tileHeight,t,t,0-this.heightOverlap),o=h.TileBoundingBoxUtils.getLatitudeFromPixel(this.tileHeight,t,t,this.tileHeight+this.heightOverlap);return n=Math.min(n,t.minLongitude),r=Math.max(r,t.maxLongitude),o=Math.min(o,t.minLatitude),i=Math.max(i,t.maxLatitude),e===T.ProjectionConstants.EPSG_3857?(n=Math.max(n,-1*T.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH),r=Math.min(r,T.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH),o=Math.max(o,-1*T.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH),i=Math.min(i,T.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)):(n=Math.max(n,-1*T.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH),r=Math.min(r,T.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH),o=Math.max(o,-1*T.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT),i=Math.min(i,T.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT)),new f.BoundingBox(n,r,o,i)},t}();e.FeatureTiles=E},5211:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Paint=void 0;var n=function(){function t(){this._color="#000000FF",this._strokeWidth=1}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorRGBA",{get:function(){var t=parseInt(this.color.substr(1,2),16),e=parseInt(this.color.substr(3,2),16),n=parseInt(this.color.substr(5,2),16),r=1;return this.color.length>7&&(r=parseInt(this.color.substr(7,2),16)/255),"rgba("+t+","+e+","+n+","+r+")"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeWidth",{get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=t},enumerable:!1,configurable:!0}),t}();e.Paint=n},9325:function(t,e,n){"use strict";var r=n(5108),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageUtils=void 0;var s=a(n(7935)),u=n(3437),l=function(){function t(){}return t.getImageSize=function(t){return s.default.imageSize(t)},t.getImage=function(t,e){return void 0===e&&(e="image/png"),i(this,void 0,void 0,(function(){return o(this,(function(n){return[2,new Promise((function(n){u.Canvas.initializeAdapter().then((function(){u.Canvas.createImage(t,e).then((function(t){n(t)})).catch((function(t){r.error(t),n(null)}))})).catch((function(t){r.error(t),n(null)}))}))]}))}))},t.getScaledImage=function(e,n){return i(this,void 0,void 0,(function(){return o(this,(function(i){return[2,new Promise((function(i){t.getImage(e).then((function(t){1===n?i(t):u.Canvas.scaleImage(t,n).then((function(e){u.Canvas.disposeImage(t),i(e)})).catch((function(e){u.Canvas.disposeImage(t),r.error(e),i(null)}))})).catch((function(t){r.error(t),i(null)}))}))]}))}))},t.scaleImage=function(t,e,n){return i(this,void 0,void 0,(function(){return o(this,(function(i){return[2,new Promise((function(i){u.Canvas.scaleImageToDimensions(t,e,n).then((function(e){u.Canvas.disposeImage(t),i(e)})).catch((function(e){u.Canvas.disposeImage(t),r.error(e),i(null)}))}))]}))}))},t}();e.ImageUtils=l},1938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrix=void 0;var n=function(){function t(){}return Object.defineProperty(t.prototype,"contents",{set:function(t){t&&"tiles"===t.data_type&&(this.table_name=t.table_name)},enumerable:!1,configurable:!0}),t.TABLE_NAME="tableName",t.ZOOM_LEVEL="zoomLevel",t.MATRIX_WIDTH="matrixWidth",t.MATRIX_HEIGHT="matrixHeight",t.TILE_WIDTH="tileWidth",t.TILE_HEIGHT="tileHeight",t.PIXEL_X_SIZE="pixelXSize",t.PIXEL_Y_SIZE="pixelYSize",t}();e.TileMatrix=n},3506:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrixDao=void 0;var o=n(4115),a=n(1938),s=n(8877),u=n(8334),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName="gpkg_tile_matrix",n.idColumns=[e.COLUMN_PK1,e.COLUMN_PK2],n.columns=[e.COLUMN_TABLE_NAME,e.COLUMN_ZOOM_LEVEL,e.COLUMN_MATRIX_WIDTH,e.COLUMN_MATRIX_HEIGHT,e.COLUMN_TILE_WIDTH,e.COLUMN_TILE_HEIGHT,e.COLUMN_PIXEL_X_SIZE,e.COLUMN_PIXEL_Y_SIZE],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.TileMatrix;return t&&(e.table_name=t.table_name,e.zoom_level=t.zoom_level,e.matrix_width=t.matrix_width,e.matrix_height=t.matrix_height,e.tile_width=t.tile_width,e.tile_height=t.tile_height,e.pixel_x_size=t.pixel_x_size,e.pixel_y_size=t.pixel_y_size),e},e.prototype.getContents=function(t){return this.geoPackage.contentsDao.queryForId(t.table_name)},e.prototype.getTileMatrixSet=function(t){return this.geoPackage.tileMatrixSetDao.queryForId(t.table_name)},e.prototype.tileCount=function(t){var e=this.buildWhereWithFieldAndValue(u.TileColumn.COLUMN_ZOOM_LEVEL,t.zoom_level),n=this.buildWhereArgs([t.zoom_level]),r=s.SqliteQueryBuilder.buildCount("'"+t.table_name+"'",e),i=this.connection.get(r,n);return null==i?void 0:i.count},e.prototype.hasTiles=function(t){var e=this.buildWhereWithFieldAndValue(u.TileColumn.COLUMN_ZOOM_LEVEL,t.zoom_level),n=this.buildWhereArgs([t.zoom_level]),r=s.SqliteQueryBuilder.buildQuery(!1,"'"+t.table_name+"'",void 0,e);return null!=this.connection.get(r,n)},e.TABLE_NAME="gpkg_tile_matrix",e.COLUMN_PK1="table_name",e.COLUMN_PK2="zoom_level",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_ZOOM_LEVEL="zoom_level",e.COLUMN_MATRIX_WIDTH="matrix_width",e.COLUMN_MATRIX_HEIGHT="matrix_height",e.COLUMN_TILE_WIDTH="tile_width",e.COLUMN_TILE_HEIGHT="tile_height",e.COLUMN_PIXEL_X_SIZE="pixel_x_size",e.COLUMN_PIXEL_Y_SIZE="pixel_y_size",e}(o.Dao);e.TileMatrixDao=l},5899:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrixSet=void 0;var r=n(2527),i=function(){function t(){}return Object.defineProperty(t.prototype,"boundingBox",{get:function(){return new r.BoundingBox(this.min_x,this.max_x,this.min_y,this.max_y)},set:function(t){this.min_x=t.minLongitude,this.max_x=t.maxLongitude,this.min_y=t.minLatitude,this.max_y=t.maxLatitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contents",{set:function(t){t&&"tiles"===t.data_type&&(this.table_name=t.table_name)},enumerable:!1,configurable:!0}),t.TABLE_NAME="tableName",t.MIN_X="minX",t.MIN_Y="minY",t.MAX_X="maxX",t.MAX_Y="maxY",t.SRS_ID="srsId",t}();e.TileMatrixSet=i},5925:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrixSetDao=void 0;var a=n(4115),s=n(5899),u=function(t){function e(n){var r=t.call(this,n)||this;return r.gpkgTableName="gpkg_tile_matrix_set",r.idColumns=[e.COLUMN_PK],r.columns=[e.COLUMN_TABLE_NAME,e.COLUMN_SRS_ID,e.COLUMN_MIN_X,e.COLUMN_MIN_Y,e.COLUMN_MAX_X,e.COLUMN_MAX_Y],r.columnToPropertyMap={},r.columnToPropertyMap[e.COLUMN_TABLE_NAME]=s.TileMatrixSet.TABLE_NAME,r.columnToPropertyMap[e.COLUMN_SRS_ID]=s.TileMatrixSet.SRS_ID,r.columnToPropertyMap[e.COLUMN_MIN_X]=s.TileMatrixSet.MIN_X,r.columnToPropertyMap[e.COLUMN_MIN_Y]=s.TileMatrixSet.MIN_Y,r.columnToPropertyMap[e.COLUMN_MAX_X]=s.TileMatrixSet.MAX_X,r.columnToPropertyMap[e.COLUMN_MAX_Y]=s.TileMatrixSet.MAX_Y,r}return i(e,t),e.prototype.createObject=function(t){var e=new s.TileMatrixSet;return t&&(e.table_name=t.table_name,e.srs_id=t.srs_id,e.min_y=t.min_y,e.min_x=t.min_x,e.max_y=t.max_y,e.max_x=t.max_x),e},e.prototype.getTileTables=function(){var t,n,r=[];try{for(var i=o(this.connection.each("select "+e.COLUMN_TABLE_NAME+" from "+e.TABLE_NAME)),a=i.next();!a.done;a=i.next()){var s=a.value;r.push(s[e.COLUMN_TABLE_NAME])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.getProjection=function(t){var e=this.getSrs(t);if(e)return this.geoPackage.spatialReferenceSystemDao.getProjection(e)},e.prototype.getSrs=function(t){return this.geoPackage.spatialReferenceSystemDao.queryForId(t.srs_id)},e.prototype.getContents=function(t){return this.geoPackage.contentsDao.queryForId(t.table_name)},e.TABLE_NAME="gpkg_tile_matrix_set",e.COLUMN_PK="table_name",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_SRS_ID="srs_id",e.COLUMN_MIN_X="min_x",e.COLUMN_MIN_Y="min_y",e.COLUMN_MAX_X="max_x",e.COLUMN_MAX_Y="max_y",e}(a.Dao);e.TileMatrixSetDao=u},731:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageTileRetriever=void 0;var a=n(3684),s=n(7977),u=n(2777),l=n(5604),c=n(1375),h=function(){function t(t,e,n){this.tileDao=t,this.tileDao.adjustTileMatrixLengths(),this.width=e,this.height=n,this.scaling=null}return t.prototype.setScaling=function(t){this.scaling=t},t.prototype.getWebMercatorBoundingBox=function(){return null==this.setWebMercatorBoundingBox&&(this.setWebMercatorBoundingBox=this.tileDao.tileMatrixSet.boundingBox.projectBoundingBox(this.tileDao.projection,c.ProjectionConstants.EPSG_3857)),this.setWebMercatorBoundingBox},t.prototype.hasTile=function(t,e,n){var r=!1;if(t>=0&&e>=0&&n>=0){var i=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n);r=this.hasTileForBoundingBox(i,c.ProjectionConstants.EPSG_3857)}return r},t.prototype.hasTileForBoundingBox=function(t,e){for(var n=t.projectBoundingBox(e,this.tileDao.projection),r=this.getTileMatrices(n),i=!1,o=0;!i&&o<r.length;o++){var s=r[o],u=a.TileBoundingBoxUtils.getTileGridWithTotalBoundingBox(this.tileDao.tileMatrixSet.boundingBox,s.matrix_width,s.matrix_height,n);i=this.tileDao.countByTileGrid(u,s.zoom_level)>0}return i},t.prototype.getTile=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n),[2,this.getTileWithBounds(r,c.ProjectionConstants.EPSG_3857)]}))}))},t.prototype.getWebMercatorTile=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n),[2,this.getTileWithBounds(r,c.ProjectionConstants.EPSG_3857)]}))}))},t.prototype.drawTileIn=function(t,e,n,o){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n),[2,this.getTileWithBounds(r,c.ProjectionConstants.EPSG_3857,o)]}))}))},t.prototype.getTileWithWgs84Bounds=function(t,e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(r){return n=t.projectBoundingBox(c.ProjectionConstants.EPSG_4326,c.ProjectionConstants.EPSG_3857),[2,this.getTileWithBounds(n,c.ProjectionConstants.EPSG_3857,e)]}))}))},t.prototype.getTileWithWgs84BoundsInProjection=function(t,e,n,o){return r(this,void 0,void 0,(function(){var e;return i(this,(function(r){return e=t.projectBoundingBox(c.ProjectionConstants.EPSG_4326,n),[2,this.getTileWithBounds(e,n,o)]}))}))},t.prototype.getTileWithBounds=function(t,e,n){return r(this,void 0,void 0,(function(){var r,u,c,h,f,p,d,y,m,g,_,b,v,T,E,w,x,C,M,S,N;return i(this,(function(i){switch(i.label){case 0:if(null==(r=l.Projection.hasProjection(e)))throw new Error("Projection "+e+" is not loaded.");u=t.projectBoundingBox(e,this.tileDao.projection),c=this.getTileMatrices(u),h=!1,f=null,p=0,i.label=1;case 1:return!h&&p<c.length?(d=c[p],y=d.tile_width,m=d.tile_height,[4,s.TileCreator.create(this.width||y,this.height||m,d,this.tileDao.tileMatrixSet,t,this.tileDao.srs,e,r,n)]):[3,12];case 2:g=i.sent(),_=this.retrieveTileResults(u,d),i.label=3;case 3:i.trys.push([3,8,9,10]),S=void 0,b=o(_),v=b.next(),i.label=4;case 4:return v.done?[3,7]:(T=v.value,E=a.TileBoundingBoxUtils.getTileBoundingBox(this.tileDao.tileMatrixSet.boundingBox,d,T.tileColumn,T.row),null==(w=a.TileBoundingBoxUtils.intersection(u,E))?[3,6]:(x=a.TileBoundingBoxUtils.getFloatRoundedRectangle(d.tile_width,d.tile_height,E,w),C=a.TileBoundingBoxUtils.getFloatRoundedRectangle(this.width,this.height,u,w),x.isValid&&C.isValid?[4,g.addTile(T.tileData,T.tileColumn,T.row)]:[3,6]));case 5:i.sent(),h=!0,i.label=6;case 6:return v=b.next(),[3,4];case 7:return[3,10];case 8:return M=i.sent(),S={error:M},[3,10];case 9:try{v&&!v.done&&(N=b.return)&&N.call(b)}finally{if(S)throw S.error}return[7];case 10:!n&&h&&(f=g.getCompleteTile()),g.cleanup(),i.label=11;case 11:return p++,[3,1];case 12:return[2,f]}}))}))},t.prototype.retrieveTileResults=function(t,e){if(e){var n=a.TileBoundingBoxUtils.getTileGridWithTotalBoundingBox(this.tileDao.tileMatrixSet.boundingBox,e.matrix_width,e.matrix_height,t);return this.tileDao.queryByTileGrid(n,e.zoom_level)}},t.prototype.getTileMatrices=function(t){var e=this,n=[];if(0!==this.tileDao.tileMatrices.length&&a.TileBoundingBoxUtils.intersects(t,this.tileDao.tileMatrixSet.boundingBox)){var r,i=t.maxLongitude-t.minLongitude,o=t.maxLatitude-t.minLatitude;if(null!=(r=null!=this.scaling?this.tileDao.getApproximateZoomLevelForWidthAndHeight(i,o):this.tileDao.getZoomLevelForWidthAndHeight(i,o))){var s=[];if(null!=this.scaling&&null!=this.scaling.scaling_type){var l=[];if(this.scaling.isZoomIn())for(var c=null!=this.scaling.zoom_in?r+this.scaling.zoom_in:this.tileDao.maxZoom,h=r+1;h<=c;h++)l.push(h);var f=[];if(this.scaling.isZoomOut()){var p=null!=this.scaling.zoom_out?r-this.scaling.zoom_out:this.tileDao.minZoom;for(h=r-1;h>=p;h--)f.push(h)}if(0==l.length)s=f;else if(0==f.length)s=l;else{var d=this.scaling.scaling_type;switch(d){case u.TileScalingType.IN:case u.TileScalingType.IN_OUT:s=l.concat(f);break;case u.TileScalingType.OUT:case u.TileScalingType.OUT_IN:s=f.concat(l);break;case u.TileScalingType.CLOSEST_IN_OUT:case u.TileScalingType.CLOSEST_OUT_IN:var y=void 0,m=void 0;d==u.TileScalingType.CLOSEST_IN_OUT?(y=l,m=f):(y=f,m=l),s=[];for(var g=Math.max(y.length,m.length),_=0;_<g;_++)_<y.length&&s.push(y[_]),_<m.length&&s.push(m[_]);break;default:throw new Error("Unsupported TileScalingType: "+d)}}}else s=[];s.unshift(r),s.forEach((function(t){var r=e.tileDao.getTileMatrixWithZoomLevel(t);null!=r&&n.push(r)}))}}return n},t}();e.GeoPackageTileRetriever=h},3684:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileBoundingBoxUtils=void 0;var r=n(1375),i=n(7218),o=n(2527),a=function(){function t(){}return t.webMercatorTileBox=function(e,n){var i=t.tilesPerSideWithZoom(n),a=t.tileSizeWithTilesPerSide(i),s=Math.max(-r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.minLongitude),u=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.maxLongitude),l=Math.max(-r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.minLatitude),c=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.maxLatitude),h=Math.floor((s+r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)/a),f=Math.max(0,Math.ceil((u+r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)/a)-1),p=Math.floor((r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-c)/a),d=Math.max(0,Math.ceil((r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-l)/a)-1);return new o.BoundingBox(h,f,p,d)},t.wgs84TileBox=function(e,n){var i=t.tilesPerWGS84LatSide(n),a=t.tilesPerWGS84LonSide(n),s=t.tileSizeLatPerWGS84Side(i),u=t.tileSizeLonPerWGS84Side(a),l=Math.max(-r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,e.minLongitude),c=Math.min(r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,e.maxLongitude),h=Math.max(-r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT,e.minLatitude),f=Math.min(r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT,e.maxLatitude),p=Math.floor((l+r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)/u),d=Math.max(0,Math.ceil((c+r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)/u)-1),y=Math.floor((r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-f)/s),m=Math.max(0,Math.ceil((r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-h)/s)-1);return new o.BoundingBox(p,d,y,m)},t.determinePositionAndScale=function(t,e,n,r,i,o){var a={},s=r.maxLongitude-r.minLongitude,u=(t.minLongitude-r.minLongitude)/s,l=r.maxLatitude-r.minLatitude,c=(r.maxLatitude-t.maxLatitude)/l,h=o/s,f=(t.maxLongitude-t.minLongitude)*h,p=i/l,d=(t.maxLatitude-t.minLatitude)*p;return a.yPositionInFinalTileStart=c*i,a.xPositionInFinalTileStart=u*o,a.dx=a.xPositionInFinalTileStart,a.dy=a.yPositionInFinalTileStart,a.sx=0,a.sy=0,a.dWidth=f,a.dHeight=d,a.sWidth=n,a.sHeight=e,a},t.getWebMercatorBoundingBoxFromXYZ=function(e,n,i,a){for(var s=t.tilesPerSideWithZoom(i),u=t.tileSizeWithTilesPerSide(s);e<0;)e+=s;for(;e>=s;)e-=s;var l=0;if(a&&a.buffer&&a.tileSize){var c=a.buffer;l=u/a.tileSize*c}var h=-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH+e*u-l,f=-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH+(e+1)*u+l,p=r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-(n+1)*u-l,d=r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-n*u+l;return h=Math.max(-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,h),f=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,f),p=Math.max(-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,p),d=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,d),new o.BoundingBox(h,f,p,d)},t.getWGS84BoundingBoxFromXYZ=function(e,n,i){var a=t.tilesPerWGS84LatSide(i),s=t.tilesPerWGS84LonSide(i),u=t.tileSizeLatPerWGS84Side(a),l=t.tileSizeLonPerWGS84Side(s),c=-1*r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH+e*l,h=-1*r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH+(e+1)*l,f=r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-(n+1)*u,p=r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-n*u;return new o.BoundingBox(c,h,f,p)},t.tileSizeWithTilesPerSide=function(t){return 2*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH/t},t.intersects=function(e,n){return null!=t.intersection(e,n)},t.intersection=function(t,e){var n=Math.max(t.minLongitude,e.minLongitude),r=Math.max(t.minLatitude,e.minLatitude),i=Math.min(t.maxLongitude,e.maxLongitude),a=Math.min(t.maxLatitude,e.maxLatitude);return n>i||r>a?null:new o.BoundingBox(n,i,r,a)},t.tilesPerSideWithZoom=function(t){return 1<<t},t.tilesPerWGS84LatSide=function(e){return t.tilesPerSide(e)},t.tilesPerWGS84LonSide=function(e){return 2*t.tilesPerSide(e)},t.tileSizeLatPerWGS84Side=function(t){return 2*r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT/t},t.tileSizeLonPerWGS84Side=function(t){return 2*r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH/t},t.getTileGridWithTotalBoundingBox=function(e,n,r,o){var a=t.getTileColumnWithTotalBoundingBox(e,n,o.minLongitude),s=t.getTileColumnWithTotalBoundingBox(e,n,o.maxLongitude);a<n&&s>=0&&(a<0&&(a=0),s>=n&&(s=n-1));var u=t.getRowWithTotalBoundingBox(e,r,o.minLatitude),l=t.getRowWithTotalBoundingBox(e,r,o.maxLatitude);return l<r&&u>=0&&(l<0&&(l=0),u>=r&&(u=r-1)),new i.TileGrid(a,s,l,u)},t.getTileColumnWithTotalBoundingBox=function(t,e,n){var r=t.minLongitude,i=t.maxLongitude;return n<r?-1:n>=i?e:~~((n-r)/((i-r)/e))},t.getRowWithTotalBoundingBox=function(t,e,n){var r=t.minLatitude,i=t.maxLatitude;return n<r?e:n>=i?-1:~~((i-n)/((i-r)/e))},t.getTileBoundingBox=function(t,e,n,r){var a=e.matrix_width,s=e.matrix_height,u=new i.TileGrid(n,n,r,r),l=t.minLongitude,c=(t.maxLongitude-l)/a,h=l+c*u.min_x,f=h+c*(u.max_x+1-u.min_x),p=t.minLatitude,d=t.maxLatitude,y=(d-p)/s,m=d-y*u.min_y,g=m-y*(u.max_y+1-u.min_y);return new o.BoundingBox(h,f,g,m)},t.getTileGridBoundingBox=function(t,e,n,r){var i=t.minLongitude,a=t.width/e,s=i+a*r.min_x,u=s+a*(r.max_x+1-r.min_x),l=t.maxLatitude,c=t.height/n,h=l-c*r.min_y,f=h-c*(r.max_y+1-r.min_y);return new o.BoundingBox(s,u,f,h)},t.getXPixel=function(t,e,n){return(n-e.minLongitude)/e.width*t},t.getLongitudeFromPixel=function(t,e,n,r){return r/t*n.width+e.minLongitude},t.getYPixel=function(t,e,n){return(e.maxLatitude-n)/e.height*t},t.getLatitudeFromPixel=function(t,e,n,r){return e.maxLatitude-r/t*n.height},t.tileSize=function(t){return 2*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH/t},t.zoomLevelOfTileSize=function(t){var e=2*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH/t;return Math.log(e)/Math.log(2)},t.tileWidthDegrees=function(t){return 360/t},t.prototype.statictileHeightDegrees=function(t){return 180/t},t.tilesPerSide=function(t){return Math.pow(2,t)},t.tileSizeWithZoom=function(t){var e=this.tilesPerSide(t);return this.tileSize(e)},t.toleranceDistance=function(t,e){return this.tileSizeWithZoom(t)/e},t.toleranceDistanceWidthAndHeight=function(t,e,n){return this.toleranceDistance(t,Math.max(e,n))},t.getFloatRoundedRectangle=function(e,n,r,i){var o=Math.round(t.getXPixel(e,r,i.minLongitude)),a=Math.round(t.getXPixel(e,r,i.maxLongitude)),s=Math.round(t.getYPixel(n,r,i.maxLatitude)),u=Math.round(t.getYPixel(n,r,i.minLatitude));return{left:o,right:a,bottom:u,top:s,isValid:o<a&&s<u}},t}();e.TileBoundingBoxUtils=a},7218:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileGrid=void 0;var n=function(){function t(t,e,n,r){this.min_x=t,this.max_x=e,this.min_y=n,this.max_y=r}return t.prototype.count=function(){return(this.max_x+1-this.min_x)*(this.max_y+1-this.min_y)},t.prototype.equals=function(t){return!!t&&this.min_x===t.min_x&&this.max_x===t.max_x&&this.min_y===t.min_y&&this.max_y===t.max_y},t}();e.TileGrid=n},8334:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileColumn=void 0;var o=n(5865),a=n(7319),s=n(5071),u=function(t){function e(e,n,r,i,o,a,s,u){return t.call(this,e,n,r,i,o,a,s,u)||this}return i(e,t),e.createIdColumn=function(t,n){return void 0===n&&(n=s.UserTableDefaults.DEFAULT_AUTOINCREMENT),new e(t,e.COLUMN_ID,a.GeoPackageDataType.INTEGER,null,!1,null,!0,n)},e.createZoomLevelColumn=function(t){return new e(t,e.COLUMN_ZOOM_LEVEL,a.GeoPackageDataType.INTEGER,null,!0,null,!1,!1)},e.createTileColumnColumn=function(t){return new e(t,e.COLUMN_TILE_COLUMN,a.GeoPackageDataType.INTEGER,null,!0,null,!1,!1)},e.createTileRowColumn=function(t){return new e(t,e.COLUMN_TILE_ROW,a.GeoPackageDataType.INTEGER,null,!0,null,!1,!1)},e.createTileDataColumn=function(t){return new e(t,e.COLUMN_TILE_DATA,a.GeoPackageDataType.BLOB,null,!0,null,!1,!1)},e.createColumn=function(t,n,r,i,o,a,s){return void 0===i&&(i=!1),new e(t,n,r,a,i,o,!1,s)},e.COLUMN_ID="id",e.COLUMN_ZOOM_LEVEL="zoom_level",e.COLUMN_TILE_COLUMN="tile_column",e.COLUMN_TILE_ROW="tile_row",e.COLUMN_TILE_DATA="tile_data",e}(o.UserColumn);e.TileColumn=u},6295:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileColumns=void 0;var o=n(7319),a=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.zoomLevelIndex=-1,i.tileColumnIndex=-1,i.tileRowIndex=-1,i.tileDataIndex=-1,i.updateColumns(),i}return i(e,t),e.prototype.copy=function(){var t=new e(this._tableName,this._columns,this._custom);return t.zoomLevelIndex=this.zoomLevelIndex,t.tileColumnIndex=this.tileColumnIndex,t.tileRowIndex=this.tileRowIndex,t.tileDataIndex=this.tileDataIndex,t},e.prototype.updateColumns=function(){t.prototype.updateColumns.call(this);var n=this.getColumnIndex(e.ZOOM_LEVEL,!1);this.isCustom()||this.missingCheck(n,e.ZOOM_LEVEL),null!==n&&(this.typeCheck(o.GeoPackageDataType.INTEGER,this.getColumnForIndex(n)),this.zoomLevelIndex=n);var r=this.getColumnIndex(e.TILE_COLUMN,!1);this.isCustom()||this.missingCheck(r,e.TILE_COLUMN),null!=r&&(this.typeCheck(o.GeoPackageDataType.INTEGER,this.getColumnForIndex(r)),this.tileColumnIndex=r);var i=this.getColumnIndex(e.TILE_ROW,!1);this.isCustom()||this.missingCheck(i,e.TILE_ROW),null!=i&&(this.typeCheck(o.GeoPackageDataType.INTEGER,this.getColumnForIndex(i)),this.tileRowIndex=i);var a=this.getColumnIndex(e.TILE_DATA,!1);this.isCustom()||this.missingCheck(a,e.TILE_DATA),null!=a&&(this.typeCheck(o.GeoPackageDataType.BLOB,this.getColumnForIndex(a)),this.tileDataIndex=a)},e.prototype.getZoomLevelIndex=function(){return this.zoomLevelIndex},e.prototype.setZoomLevelIndex=function(t){this.zoomLevelIndex=t},e.prototype.hasZoomLevelColumn=function(){return this.zoomLevelIndex>=0},e.prototype.getZoomLevelColumn=function(){var t=null;return this.hasZoomLevelColumn()&&(t=this.getColumnForIndex(this.zoomLevelIndex)),t},e.prototype.getTileColumnIndex=function(){return this.tileColumnIndex},e.prototype.setTileColumnIndex=function(t){this.tileColumnIndex=t},e.prototype.hasTileColumnColumn=function(){return this.tileColumnIndex>=0},e.prototype.getTileColumnColumn=function(){var t=null;return this.hasTileColumnColumn()&&(t=this.getColumnForIndex(this.tileColumnIndex)),t},e.prototype.getTileRowIndex=function(){return this.tileRowIndex},e.prototype.setTileRowIndex=function(t){this.tileRowIndex=t},e.prototype.hasTileRowColumn=function(){return this.tileRowIndex>=0},e.prototype.getTileRowColumn=function(){var t=null;return this.hasTileRowColumn()&&(t=this.getColumnForIndex(this.tileRowIndex)),t},e.prototype.getTileDataIndex=function(){return this.tileDataIndex},e.prototype.setTileDataIndex=function(t){this.tileDataIndex=t},e.prototype.hasTileDataColumn=function(){return this.tileDataIndex>=0},e.prototype.getTileDataColumn=function(){var t=null;return this.hasTileDataColumn()&&(t=this.getColumnForIndex(this.tileDataIndex)),t},e.ID="id",e.ZOOM_LEVEL="zoom_level",e.TILE_COLUMN="tile_column",e.TILE_ROW="tile_row",e.TILE_DATA="tile_data",e}(n(2114).UserColumns);e.TileColumns=a},1394:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.TileDao=void 0;var a=n(4668),s=n(3506),u=n(5925),l=n(1332),c=n(8334),h=n(7218),f=n(8572),p=n(3684),d=n(2527),y=n(1584),m=n(5604),g=n(1375),_=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;o.tileMatrixSet=r,o.tileMatrices=i,o.zoomLevelToTileMatrix=[],o.widths=[],o.heights=[],0===i.length?(o.minZoom=0,o.maxZoom=0):(o.minZoom=o.tileMatrices[0].zoom_level,o.maxZoom=o.tileMatrices[o.tileMatrices.length-1].zoom_level);for(var a=o.tileMatrices.length-1;a>=0;a--){var s=o.tileMatrices[a];o.zoomLevelToTileMatrix[s.zoom_level]=s}return o.initialize(),o}return i(e,t),e.prototype.initialize=function(){var t=this.geoPackage.tileMatrixSetDao;this.srs=t.getSrs(this.tileMatrixSet),this.projection=[this.srs.organization.toUpperCase(),this.srs.organization_coordsys_id].join(":"),m.Projection.loadProjection(this.projection,this.srs.definition);for(var e=this.tileMatrices.length-1;e>=0;e--){var n=this.tileMatrices[e],r=n.pixel_x_size*n.tile_width,i=n.pixel_y_size*n.tile_height,o=m.Projection.getConverter(this.projection);o.to_meter&&(r=o.to_meter*n.pixel_x_size*n.tile_width,i=o.to_meter*n.pixel_y_size*n.tile_height),this.widths.push(r),this.heights.push(i)}this.setWebMapZoomLevels()},e.prototype.webZoomToGeoPackageZoom=function(t){var e=p.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(0,0,t);return this.determineGeoPackageZoomLevel(e,t)},e.prototype.setWebMapZoomLevels=function(){this.minWebMapZoom=20,this.maxWebMapZoom=0,this.webZoomToGeoPackageZooms={};for(var t=this.tileMatrixSet.max_x-this.tileMatrixSet.min_x,e=this.tileMatrixSet.max_y-this.tileMatrixSet.min_y,n=0;n<this.tileMatrices.length;n++){var r=this.tileMatrices[n],i=t/r.matrix_width,o=e/r.matrix_height,a=new d.BoundingBox(this.tileMatrixSet.min_x,this.tileMatrixSet.min_x+i,this.tileMatrixSet.min_y,this.tileMatrixSet.min_y+o),s=m.Projection.getConverter(this.projection,g.ProjectionConstants.EPSG_4326),u=s.forward([a.maxLongitude,a.maxLatitude]),l=s.forward([a.minLongitude,a.minLatitude]),c=u[0]-l[0],h=Math.ceil(Math.log2(360/c));this.minWebMapZoom>h&&(this.minWebMapZoom=h),this.maxWebMapZoom<h&&(this.maxWebMapZoom=h),this.webZoomToGeoPackageZooms[h]=r.zoom_level}},e.prototype.determineGeoPackageZoomLevel=function(t,e){return this.webZoomToGeoPackageZooms[e]},e.prototype.getBoundingBoxWithZoomLevel=function(t){var e,n=this.getTileMatrixWithZoomLevel(t);if(n){var r=this.queryForTileGridWithZoomLevel(t);if(r){var i=this.boundingBox;e=p.TileBoundingBoxUtils.getTileGridBoundingBox(i,n.matrix_width,n.matrix_height,r)}}return e},Object.defineProperty(e.prototype,"boundingBox",{get:function(){return this.tileMatrixSet.boundingBox},enumerable:!1,configurable:!0}),e.prototype.queryForTileGridWithZoomLevel=function(t){var e,n=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_ZOOM_LEVEL,t),r=this.buildWhereArgs(t),i=this.minOfColumn(c.TileColumn.COLUMN_TILE_COLUMN,n,r),o=this.maxOfColumn(c.TileColumn.COLUMN_TILE_COLUMN,n,r),a=this.minOfColumn(c.TileColumn.COLUMN_TILE_ROW,n,r),s=this.maxOfColumn(c.TileColumn.COLUMN_TILE_ROW,n,r);return null!=i&&null!=a&&null!=o&&null!=s&&(e=new h.TileGrid(i,o,a,s)),e},e.prototype.getTileGridWithZoomLevel=function(t){var e,n=this.getTileMatrixWithZoomLevel(t);return n&&(e=new h.TileGrid(0,~~n.matrix_width-1,0,~~n.matrix_height-1)),e},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.newRow=function(t,e){return new l.TileRow(this.table,t,e)},e.prototype.adjustTileMatrixLengths=function(){for(var t=this.tileMatrixSet.max_x-this.tileMatrixSet.min_x,e=this.tileMatrixSet.max_y-this.tileMatrixSet.min_y,n=0;n<this.tileMatrices.length;n++){var r=this.tileMatrices[n],i=~~(t/(r.pixel_x_size*~~r.tile_width)),o=~~(e/(r.pixel_y_size*~~r.tile_height));i>~~r.matrix_width&&(r.matrix_width=~~i),o>~~r.matrix_height&&(r.matrix_height=~~o)}},e.prototype.getTileMatrixWithZoomLevel=function(t){return this.zoomLevelToTileMatrix[t]},e.prototype.getZoomLevelForLength=function(t){return y.TileDaoUtils.getZoomLevelForLength(this.widths,this.heights,this.tileMatrices,t)},e.prototype.getZoomLevelForWidthAndHeight=function(t,e){return y.TileDaoUtils.getZoomLevelForWidthAndHeight(this.widths,this.heights,this.tileMatrices,t,e)},e.prototype.getClosestZoomLevelForLength=function(t){return y.TileDaoUtils.getClosestZoomLevelForLength(this.widths,this.heights,this.tileMatrices,t)},e.prototype.getClosestZoomLevelForWidthAndHeight=function(t,e){return y.TileDaoUtils.getClosestZoomLevelForWidthAndHeight(this.widths,this.heights,this.tileMatrices,t,e)},e.prototype.getApproximateZoomLevelForLength=function(t){return y.TileDaoUtils.getApproximateZoomLevelForLength(this.widths,this.heights,this.tileMatrices,t)},e.prototype.getApproximateZoomLevelForWidthAndHeight=function(t,e){return y.TileDaoUtils.getApproximateZoomLevelForWidthAndHeight(this.widths,this.heights,this.tileMatrices,t,e)},e.prototype.getMaxLength=function(){return y.TileDaoUtils.getMaxLengthForTileWidthsAndHeights(this.widths,this.heights)},e.prototype.getMinLength=function(){return y.TileDaoUtils.getMinLengthForTileWidthsAndHeights(this.widths,this.heights)},e.prototype.queryForTile=function(t,e,n){var r,i,a,s=new f.ColumnValues;s.addColumn(c.TileColumn.COLUMN_TILE_COLUMN,t),s.addColumn(c.TileColumn.COLUMN_TILE_ROW,e),s.addColumn(c.TileColumn.COLUMN_ZOOM_LEVEL,n);try{for(var u=o(this.queryForFieldValues(s)),l=u.next();!l.done;l=u.next()){var h=l.value;a=this.getRow(h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return a},e.prototype.queryForTilesWithZoomLevel=function(t){var e,n=this,r=this.queryForEach(c.TileColumn.COLUMN_ZOOM_LEVEL,t);return(e={})[Symbol.iterator]=function(){return this},e.next=function(){var t=r.next();return t.done?{value:void 0,done:!0}:{value:n.getRow(t.value),done:!1}},e},e.prototype.queryForTilesDescending=function(t){var e,n=this,r=this.queryForEach(c.TileColumn.COLUMN_ZOOM_LEVEL,t,void 0,void 0,c.TileColumn.COLUMN_TILE_COLUMN+" DESC, "+c.TileColumn.COLUMN_TILE_ROW+" DESC");return(e={})[Symbol.iterator]=function(){return this},e.next=function(){var t=r.next();return t.done?{value:void 0,done:!0}:{value:n.getRow(t.value),done:!1}},e},e.prototype.queryForTilesInColumn=function(t,e){var n,r=this,i=new f.ColumnValues;i.addColumn(c.TileColumn.COLUMN_TILE_COLUMN,t),i.addColumn(c.TileColumn.COLUMN_ZOOM_LEVEL,e);var o=this.queryForFieldValues(i);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=o.next();return t.done?{value:void 0,done:!0}:{value:r.getRow(t.value),done:!1}},n},e.prototype.queryForTilesInRow=function(t,e){var n,r=this,i=new f.ColumnValues;i.addColumn(c.TileColumn.COLUMN_TILE_ROW,t),i.addColumn(c.TileColumn.COLUMN_ZOOM_LEVEL,e);var o=this.queryForFieldValues(i);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=o.next();return t.done?{value:void 0,done:!0}:{value:r.getRow(t.value),done:!1}},n},e.prototype.queryByTileGrid=function(t,e){var n,r=this;if(t){var i="";i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_ZOOM_LEVEL,e),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.min_x,">="),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.max_x,"<="),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.min_y,">="),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.max_y,"<=");var o=this.buildWhereArgs([e,t.min_x,t.max_x,t.min_y,t.max_y]),a=this.queryWhereWithArgsDistinct(i,o);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=a.next();return t.done?{value:void 0,done:!0}:{value:r.getRow(t.value),done:!1}},n}},e.prototype.countByTileGrid=function(t,e){if(t){var n="";n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_ZOOM_LEVEL,e),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.min_x,">="),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.max_x,"<="),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.min_y,">="),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.max_y,"<=");var r=this.buildWhereArgs([e,t.min_x,t.max_x,t.min_y,t.max_y]);return this.countWhere(n,r)}},e.prototype.deleteTile=function(t,e,n){var r="";r+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_ZOOM_LEVEL,n),r+=" and ",r+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t),r+=" and ",r+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,e);var i=this.buildWhereArgs([n,t,e]);return this.deleteWhere(r,i)},e.prototype.dropTable=function(){var t=this.geoPackage.tileMatrixDao,e=a.UserDao.prototype.dropTable.call(this);this.geoPackage.tileMatrixSetDao.delete(this.tileMatrixSet);for(var n=this.tileMatrices.length-1;n>=0;n--){var r=this.tileMatrices[n];t.delete(r)}return this.geoPackage.contentsDao.deleteById(this.gpkgTableName),e},e.prototype.rename=function(e){t.prototype.rename.call(this,e);var n=this.tileMatrixSet.table_name,r={};r[u.TileMatrixSetDao.COLUMN_TABLE_NAME]=e;var i=this.buildWhereWithFieldAndValue(u.TileMatrixSetDao.COLUMN_TABLE_NAME,n),o=this.buildWhereArgs([n]),a=this.geoPackage.contentsDao,l=a.queryForId(n);l.table_name=e,l.identifier=e,a.create(l),this.geoPackage.tileMatrixSetDao.updateWithValues(r,i,o);var c=this.geoPackage.tileMatrixDao,h={};h[s.TileMatrixDao.COLUMN_TABLE_NAME]=e;var f=this.buildWhereWithFieldAndValue(s.TileMatrixDao.COLUMN_TABLE_NAME,n);c.updateWithValues(h,f,o),a.deleteById(n)},e.readTable=function(t,e){return t.getTileDao(e)},e}(a.UserDao);e.TileDao=_},1584:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TileDaoUtils=void 0;var i=r(n(5871)),o=r(n(1159)),a=function(){function t(){}return t.adjustTileMatrixLengths=function(t,e){var n=t.max_x-t.min_x,r=t.max_y-t.min_y;e.forEach((function(t){var e=Math.floor(n/(t.pixel_x_size*t.tile_width)),i=Math.floor(r/(t.pixel_y_size*t.tile_height));e>t.matrix_width&&(t.matrix_width=e),i>t.matrix_height&&(t.matrix_height=i)}))},t.getZoomLevelForLength=function(e,n,r,i){return t._getZoomLevelForLength(e,n,r,i,!0)},t.getZoomLevelForWidthAndHeight=function(e,n,r,i,o){return t._getZoomLevelForWidthAndHeight(e,n,r,i,o,!0)},t.getClosestZoomLevelForLength=function(e,n,r,i){return t._getZoomLevelForLength(e,n,r,i,!1)},t.getClosestZoomLevelForWidthAndHeight=function(e,n,r,i,o){return t._getZoomLevelForWidthAndHeight(e,n,r,i,o,!1)},t._getZoomLevelForLength=function(e,n,r,i,o){return t._getZoomLevelForWidthAndHeight(e,n,r,i,i,o)},t._getZoomLevelForWidthAndHeight=function(e,n,r,a,s,u){var l=null,c=(0,i.default)(e,a);-1===c&&(c=(0,o.default)(e,a)),c<0&&(c=-1*(c+1));var h=(0,i.default)(n,s);if(-1===h&&(h=(0,o.default)(n,s)),h<0&&(h=-1*(h+1)),0==c?u&&a<t.getMinLength(e)&&(c=-1):c==e.length?u&&a>=t.getMaxLength(e)?c=-1:--c:t.closerToZoomIn(e,a,c)&&--c,0==h?u&&s<t.getMinLength(n)&&(h=-1):h==n.length?u&&s>=t.getMaxLength(n)?h=-1:--h:t.closerToZoomIn(n,s,h)&&--h,c>=0||h>=0){var f;f=c<0?h:h<0?c:Math.min(c,h),l=t.getTileMatrixAtLengthIndex(r,f).zoom_level}return l},t.closerToZoomIn=function(t,e,n){return Math.log(e/t[n-1])/Math.log(2)<Math.log(e/t[n])/Math.log(.5)},t.getTileMatrixAtLengthIndex=function(t,e){return t[t.length-e-1]},t.getApproximateZoomLevelForLength=function(e,n,r,i){return t.getApproximateZoomLevelForWidthAndHeight(e,n,r,i,i)},t.getApproximateZoomLevelForWidthAndHeight=function(e,n,r,i,o){var a=t.getApproximateZoomLevel(e,r,i),s=t.getApproximateZoomLevel(n,r,o);return null==a?s:null==s?a:Math.max(a,s)},t.getApproximateZoomLevel=function(e,n,r){var o,a=e[0],s=e[e.length-1];if(r<a){var u=Math.log(r/a)/Math.log(.5),l=Math.floor(u),c=Math.ceil(u),h=a*Math.pow(.5,l),f=a*Math.pow(.5,c);o=n[n.length-1].zoom_level,o+=h-r<=r-f?l:c}else if(r>s){var p=Math.log(r/s)/Math.log(2);l=Math.ceil(p),c=Math.floor(p),h=s*Math.pow(2,l),f=s*Math.pow(2,c),o=n[0].zoom_level,o-=r-f<=h-r?c:l}else{var d=(0,i.default)(e,r);d<0&&(d=-1*(d+1));var y=Math.log(r/e[d])/Math.log(.5),m=t.getTileMatrixAtLengthIndex(n,d).zoom_level;o=m+=Math.round(y)}return o},t.getMaxLengthForTileWidthsAndHeights=function(e,n){var r=t.getMaxLength(e),i=t.getMaxLength(n);return Math.min(r,i)},t.getMinLengthForTileWidthsAndHeights=function(e,n){var r=t.getMinLength(e),i=t.getMinLength(n);return Math.max(r,i)},t.getMaxLength=function(t){return t[t.length-1]/.51},t.getMinLength=function(t){return.51*t[0]},t}();e.TileDaoUtils=a},1332:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileRow=void 0;var o=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.tileTable=e,i}return i(e,t),Object.defineProperty(e.prototype,"zoomLevelColumnIndex",{get:function(){return this.tileTable.getZoomLevelColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevelColumn",{get:function(){return this.tileTable.getZoomLevelColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this.getValueWithColumnName(this.zoomLevelColumn.name)},set:function(t){this.setValueWithIndex(this.zoomLevelColumnIndex,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileColumnColumnIndex",{get:function(){return this.tileTable.getTileColumnColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileColumnColumn",{get:function(){return this.tileTable.getTileColumnColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileColumn",{get:function(){return this.getValueWithColumnName(this.tileColumnColumn.name)},set:function(t){this.setValueWithColumnName(this.tileColumnColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rowColumnIndex",{get:function(){return this.tileTable.getTileRowColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rowColumn",{get:function(){return this.tileTable.getTileRowColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"row",{get:function(){return this.getValueWithColumnName(this.rowColumn.name)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileRow",{set:function(t){this.setValueWithColumnName(this.rowColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileDataColumnIndex",{get:function(){return this.tileTable.getTileDataColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileDataColumn",{get:function(){return this.tileTable.getTileDataColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileData",{get:function(){return this.getValueWithColumnName(this.tileDataColumn.name)},set:function(t){this.setValueWithColumnName(this.tileDataColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileDataImage",{get:function(){return null},enumerable:!1,configurable:!0}),e}(n(2224).UserRow);e.TileRow=o},8704:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileTable=void 0;var o=n(8018),a=n(8334),s=n(6295),u=n(1648),l=n(9971),c=function(t){function e(e,n){var r=t.call(this,new s.TileColumns(e,n,!1))||this,i=new u.UniqueConstraint;return i.add(r.getUserColumns().getZoomLevelColumn()),i.add(r.getUserColumns().getTileColumnColumn()),i.add(r.getUserColumns().getTileRowColumn()),r.addConstraint(i),r}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.columns._columns)},e.prototype.getDataType=function(){return l.ContentsDataType.TILES},e.prototype.getUserColumns=function(){return t.prototype.getUserColumns.call(this)},e.prototype.createUserColumns=function(t){return new s.TileColumns(this.getTableName(),t,!0)},e.prototype.getZoomLevelColumnIndex=function(){return this.getUserColumns().getZoomLevelIndex()},e.prototype.getZoomLevelColumn=function(){return this.getUserColumns().getZoomLevelColumn()},e.prototype.getTileColumnColumnIndex=function(){return this.getUserColumns().getTileColumnIndex()},e.prototype.getTileColumnColumn=function(){return this.getUserColumns().getTileColumnColumn()},e.prototype.getTileRowColumnIndex=function(){return this.getUserColumns().getTileRowIndex()},e.prototype.getTileRowColumn=function(){return this.getUserColumns().getTileRowColumn()},e.prototype.getTileDataColumnIndex=function(){return this.getUserColumns().getTileDataIndex()},e.prototype.getTileDataColumn=function(){return this.getUserColumns().getTileDataColumn()},e.createRequiredColumns=function(t){void 0===t&&(t=0);var e=[];return e.push(a.TileColumn.createIdColumn(t++)),e.push(a.TileColumn.createZoomLevelColumn(t++)),e.push(a.TileColumn.createTileColumnColumn(t++)),e.push(a.TileColumn.createTileRowColumn(t++)),e.push(a.TileColumn.createTileDataColumn(t)),e},e.prototype.validateContents=function(t){var e=t.data_type;if(null==e||e!==l.ContentsDataType.TILES)throw new Error("The Contents of a TileTable must have a data type of tiles")},e.COLUMN_ID=s.TileColumns.ID,e.COLUMN_ZOOM_LEVEL=s.TileColumns.ZOOM_LEVEL,e.COLUMN_TILE_COLUMN=s.TileColumns.TILE_COLUMN,e.COLUMN_TILE_ROW=s.TileColumns.TILE_ROW,e.COLUMN_TILE_DATA=s.TileColumns.TILE_DATA,e}(o.UserTable);e.TileTable=c},9631:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileTableReader=void 0;var o=n(4880),a=n(8704),s=n(8334),u=function(t){function e(e){var n=t.call(this,e.table_name)||this;return n.tileMatrixSet=e,n}return i(e,t),e.prototype.readTileTable=function(t){return this.readTable(t.database)},e.prototype.createTable=function(t,e){return new a.TileTable(t,e)},e.prototype.createColumn=function(t){return new s.TileColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,t.autoincrement)},e}(o.UserTableReader);e.TileTableReader=u},5762:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomColumn=void 0;var o=n(5865),a=n(7319),s=n(5071),u=function(t){function e(e,n,r,i,o,a,s,u){var l=t.call(this,e,n,r,i,o,a,s,u)||this;if(null==r)throw new Error("Data type is required to create column: "+n);return l}return i(e,t),e.createColumn=function(t,n,r,i,o,a,s){return void 0===i&&(i=!1),new e(t,n,r,a,i,o,!1,s)},e.createPrimaryKeyColumn=function(t,n,r){return void 0===r&&(r=s.UserTableDefaults.DEFAULT_AUTOINCREMENT),new e(t,n,a.GeoPackageDataType.INTEGER,void 0,void 0,void 0,!0,r)},e}(o.UserColumn);e.UserCustomColumn=u},496:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomColumns=void 0;var o=function(t){function e(e,n,r,i){var o=t.call(this,e,n,i)||this;return o.requiredColumns=null==r?[]:r.slice(),o.updateColumns(),o}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getColumns(),this.getRequiredColumns(),this.isCustom())},e.prototype.getRequiredColumns=function(){return this.requiredColumns},e.prototype.setRequiredColumns=function(t){void 0===t&&(t=[]),this.requiredColumns=t.slice()},e.prototype.updateColumns=function(){var e=this;if(t.prototype.updateColumns.call(this),!this.isCustom()&&null!==this.requiredColumns&&0!==this.requiredColumns.length){var n=new Set(this.requiredColumns),r={};this.getColumns().forEach((function(t){var i=t.getName(),o=t.getIndex();if(n.has(i)){var a=r[i];e.duplicateCheck(o,a,i),r[i]=o}})),n.forEach((function(t){e.missingCheck(r[t],t)}))}},e}(n(2114).UserColumns);e.UserCustomColumns=o},1447:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomDao=void 0;var o=n(4668),a=n(362),s=function(t){function e(e,n){return t.call(this,e,n)||this}return i(e,t),e.prototype.createObject=function(t){return this.getRow(t)},e.readTable=function(t,n){return new e(t,new a.UserCustomTableReader(n).readTable(t.database))},e}(o.UserDao);e.UserCustomDao=s},2378:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomTable=void 0;var o=n(8018),a=n(496),s=function(t){function e(e,n,r){return void 0===r&&(r=[]),t.call(this,new a.UserCustomColumns(e,n,r,!0))||this}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getUserColumns().getColumns(),this.getUserColumns().getRequiredColumns())},e.prototype.getDataType=function(){return null},e.prototype.getUserColumns=function(){return t.prototype.getUserColumns.call(this)},e.prototype.getRequiredColumns=function(){return this.getUserColumns().getRequiredColumns()},e}(o.UserTable);e.UserCustomTable=s},362:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomTableReader=void 0;var o=n(2378),a=n(4880),s=n(5762),u=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.readUserCustomTable=function(t){return this.readTable(t.database)},e.prototype.createTable=function(t,e){return new o.UserCustomTable(t,e,null)},e.prototype.createColumn=function(t){return new s.UserCustomColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,t.autoincrement)},e}(a.UserTableReader);e.UserCustomTableReader=u},5865:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.UserColumn=void 0;var i=r(n(8446)),o=n(7319),a=n(2841),s=n(1133),u=n(91),l=n(5071),c=n(7686),h=function(){function t(t,e,n,r,i,o,a,s,u){this.index=t,this.name=e,this.dataType=n,this.max=r,this.notNull=i,this.defaultValue=o,this.primaryKey=a,this.autoincrement=s,this.unique=u,this.constraints=new c.Constraints,this.validateMax(),this.type=this.getTypeName(e,n),this.addDefaultConstraints()}return t.validateDataType=function(t,e){if(null==e)throw new Error("Data Type is required to create column: "+t)},t.prototype.copy=function(){var e=new t(this.index,this.name,this.dataType,this.max,this.notNull,this.defaultValue,this.primaryKey,this.unique);return e.min=this.min,e.constraints=this.constraints.copy(),e},t.prototype.clearConstraints=function(){return this.constraints.clear()},t.prototype.getConstraints=function(){return this.constraints},t.prototype.setIndex=function(t){if(this.hasIndex()){if(!(0,i.default)(t,this.index))throw new Error("User Column with a valid index may not be changed. Column Name: "+this.name+", Index: "+this.index+", Attempted Index: "+this.index)}else this.index=t},t.prototype.hasIndex=function(){return this.index>t.NO_INDEX},t.prototype.resetIndex=function(){this.index=t.NO_INDEX},t.prototype.getIndex=function(){return this.index},t.prototype.setName=function(t){this.name=t},t.prototype.getName=function(){return this.name},t.prototype.isNamed=function(t){return this.name===t},t.prototype.hasMax=function(){return null!=this.max},t.prototype.setMax=function(t){this.max=t},t.prototype.getMax=function(){return this.max},t.prototype.setNotNull=function(t){this.notNull!==t&&(t?this.addNotNullConstraint():this.removeConstraintByType(u.ConstraintType.NOT_NULL)),this.notNull=t},t.prototype.isNotNull=function(){return this.notNull},t.prototype.hasDefaultValue=function(){return null!==this.defaultValue&&void 0!==this.defaultValue},t.prototype.setDefaultValue=function(t){this.removeConstraintByType(u.ConstraintType.DEFAULT),null!=t&&this.addDefaultValueConstraint(t),this.defaultValue=t},t.prototype.getDefaultValue=function(){return this.defaultValue},t.prototype.setPrimaryKey=function(t){this.primaryKey!==t&&(t?this.addPrimaryKeyConstraint():(this.autoincrement=!1,this.removeConstraintByType(u.ConstraintType.AUTOINCREMENT),this.removeConstraintByType(u.ConstraintType.PRIMARY_KEY))),this.primaryKey=t},t.prototype.isPrimaryKey=function(){return this.primaryKey},t.prototype.setAutoincrement=function(t){this.autoincrement!==t&&(t?this.addAutoincrementConstraint():this.removeConstraintByType(u.ConstraintType.AUTOINCREMENT)),this.autoincrement=t},t.prototype.isAutoincrement=function(){return this.autoincrement},t.prototype.setUnique=function(t){this.unique!==t&&(t?this.addUniqueConstraint():this.removeConstraintByType(u.ConstraintType.UNIQUE)),this.unique=t},t.prototype.isUnique=function(){return this.unique},t.prototype.setDataType=function(t){this.dataType=t},t.prototype.getDataType=function(){return this.dataType},t.prototype.getTypeName=function(e,n){return t.validateDataType(e,n),o.GeoPackageDataType.nameFromType(n)},t.prototype.validateMax=function(){if(this.max&&this.dataType!==o.GeoPackageDataType.TEXT&&this.dataType!==o.GeoPackageDataType.BLOB)throw new Error("Column max is only supported for TEXT and BLOB columns. column: "+this.name+", max: "+this.max+", type: "+this.dataType);return!0},t.createPrimaryKeyColumn=function(e,n,r){return void 0===r&&(r=l.UserTableDefaults.DEFAULT_AUTOINCREMENT),new t(e,n,o.GeoPackageDataType.INTEGER,void 0,!0,void 0,!0,r)},t.createColumn=function(e,n,r,i,o,a){return void 0===i&&(i=!1),new t(e,n,r,a,i,o,!1)},t.prototype.addDefaultConstraints=function(){this.isNotNull()&&this.addNotNullConstraint(),this.hasDefaultValue()&&this.addDefaultValueConstraint(this.getDefaultValue()),this.isPrimaryKey()&&(this.addPrimaryKeyConstraint(),this.isAutoincrement()&&this.addAutoincrementConstraint()),this.isUnique()&&this.addUniqueConstraint()},t.prototype.addConstraint=function(t){null!==t.order&&void 0!==t.order||this.setConstraintOrder(t),this.constraints.add(t)},t.prototype.setConstraintOrder=function(e){var n=null;switch(e.getType()){case u.ConstraintType.PRIMARY_KEY:n=t.PRIMARY_KEY_CONSTRAINT_ORDER;break;case u.ConstraintType.UNIQUE:n=t.UNIQUE_CONSTRAINT_ORDER;break;case u.ConstraintType.NOT_NULL:n=t.NOT_NULL_CONSTRAINT_ORDER;break;case u.ConstraintType.DEFAULT:n=t.DEFAULT_VALUE_CONSTRAINT_ORDER;break;case u.ConstraintType.AUTOINCREMENT:n=t.AUTOINCREMENT_CONSTRAINT_ORDER}e.order=n},t.prototype.addConstraintSql=function(t){var e=s.ConstraintParser.getType(t),n=s.ConstraintParser.getName(t);this.constraints.add(new a.RawConstraint(e,n,t))},t.prototype.addConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.addColumnConstraints=function(t){this.addConstraints(t.getConstraints())},t.prototype.addNotNullConstraint=function(){this.addConstraint(new a.RawConstraint(u.ConstraintType.NOT_NULL,null,"NOT NULL",t.NOT_NULL_CONSTRAINT_ORDER))},t.prototype.addDefaultValueConstraint=function(e){this.addConstraint(new a.RawConstraint(u.ConstraintType.DEFAULT,null,"DEFAULT "+o.GeoPackageDataType.columnDefaultValue(e,this.getDataType()),t.DEFAULT_VALUE_CONSTRAINT_ORDER))},t.prototype.addPrimaryKeyConstraint=function(){this.addConstraint(new a.RawConstraint(u.ConstraintType.PRIMARY_KEY,null,"PRIMARY KEY",t.PRIMARY_KEY_CONSTRAINT_ORDER))},t.prototype.addAutoincrementConstraint=function(){if(!this.isPrimaryKey())throw new Error("Autoincrement may only be set on a primary key column");this.addConstraint(new a.RawConstraint(u.ConstraintType.AUTOINCREMENT,null,"AUTOINCREMENT",t.AUTOINCREMENT_CONSTRAINT_ORDER))},t.prototype.addUniqueConstraint=function(){this.addConstraint(new a.RawConstraint(u.ConstraintType.UNIQUE,null,"UNIQUE",t.UNIQUE_CONSTRAINT_ORDER))},t.prototype.removeConstraintByType=function(t){this.constraints.clearConstraintsByType(t)},t.prototype.getType=function(){return this.type},t.prototype.hasConstraints=function(){return this.constraints.has()},t.prototype.buildConstraintSql=function(t){var e=null;return!l.UserTableDefaults.DEFAULT_PK_NOT_NULL&&this.isPrimaryKey()&&t.getType()===u.ConstraintType.NOT_NULL||(e=t.buildSql()),e},t.NO_INDEX=-1,t.NOT_NULL_CONSTRAINT_ORDER=1,t.DEFAULT_VALUE_CONSTRAINT_ORDER=2,t.PRIMARY_KEY_CONSTRAINT_ORDER=3,t.AUTOINCREMENT_CONSTRAINT_ORDER=4,t.UNIQUE_CONSTRAINT_ORDER=5,t}();e.UserColumn=h},2114:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserColumns=void 0;var r=n(7319),i=function(){function t(t,e,n){void 0===n&&(n=!1),this._pkIndex=-1,this._tableName=t,this._columns=e,this._custom=n,this._nameToIndex=new Map,this._columnNames=[]}return t.prototype.copy=function(){var e=[];this._columns.forEach((function(t){e.push(t.copy())}));var n=new t(this._tableName,e,this._custom);return n._columnNames=Array.from(this._columnNames),n._nameToIndex=new Map(this._nameToIndex),n._pkIndex=this._pkIndex,n},t.prototype.updateColumns=function(){var t=this;if(this._nameToIndex.clear(),!this._custom){var e=new Set,n=[];this._columns.forEach((function(r){if(r.hasIndex()){var i=r.getIndex();if(e.has(i))throw new Error("Duplicate index: "+i+", Table Name: "+t._tableName);e.add(i)}else n.push(r)}));var r=-1;n.forEach((function(t){for(;e.has(++r););t.setIndex(r)})),this._columns.sort((function(t,e){return t.index-e.index}))}this._pkIndex=-1,this._columnNames=[];for(var i=0;i<this._columns.length;i++){var o=this._columns[i],a=o.getName(),s=a.toLowerCase();if(!this._custom){if(o.getIndex()!=i)throw new Error("No column found at index: "+i+", Table Name: "+this._tableName);if(this._nameToIndex.has(s))throw new Error("Duplicate column found at index: "+i+", Table Name: "+this._tableName+", Name: "+a)}if(o.isPrimaryKey()){if(-1!=this._pkIndex){var u="More than one primary key column was found for ";throw u=(u=this._custom?u.concat("custom specified table columns"):u.concat("table")).concat(". table: "+this._tableName+", index1: "+this._pkIndex+", index2: "+i),this._custom&&(u=u.concat(", columns: "+this._columnNames)),new Error(u)}this._pkIndex=i}this._columnNames[i]=a,this._nameToIndex.set(s,i)}},t.prototype.duplicateCheck=function(t,e,n){if(null!=e)throw new Error("More than one "+n+" column was found for table '"+this._tableName+"'. Index "+e+" and "+t)},t.prototype.typeCheck=function(t,e){var n=e.getDataType();if(null==n||n!==t)throw new Error("Unexpected "+e.getName()+" column data type was found for table '"+this._tableName+"', expected: "+r.GeoPackageDataType.nameFromType(t)+", actual: "+(null!=n?r.GeoPackageDataType.nameFromType(n):"null"))},t.prototype.missingCheck=function(t,e){if(null==t)throw new Error("No "+e+" column was found for table '"+this._tableName+"'")},t.prototype.getColumnIndexForColumnName=function(t){return this.getColumnIndex(t,!0)},t.prototype.getColumnIndex=function(t,e){var n=this._nameToIndex.get(t.toLowerCase());if(e&&null==n){var r="Column does not exist in ";throw r=(r=this._custom?r.concat("custom specified table columns"):r.concat("table")).concat(". table: "+this._tableName+", column: "+t),this._custom&&(r=r.concat(", columns: "+this._columnNames)),new Error(r)}return n},t.prototype.getColumnNames=function(){return this._columnNames},t.prototype.getColumnName=function(t){return this._columnNames[t]},t.prototype.getColumns=function(){return this._columns},t.prototype.getColumnForIndex=function(t){return this._columns[t]},t.prototype.getColumn=function(t){return this.getColumnForIndex(this.getColumnIndexForColumnName(t))},t.prototype.hasColumn=function(t){return this._nameToIndex.has(t.toLowerCase())},t.prototype.columnCount=function(){return this._columns.length},t.prototype.getTableName=function(){return this._tableName},t.prototype.setTableName=function(t){this._tableName=t},t.prototype.isCustom=function(){return this._custom},t.prototype.setCustom=function(t){this._custom=t},t.prototype.hasPkColumn=function(){return this._pkIndex>=0},t.prototype.getPkColumnIndex=function(){return this._pkIndex},t.prototype.getPkColumn=function(){var t=null;return this.hasPkColumn()&&(t=this._columns[this._pkIndex]),t},t.prototype.getPkColumnName=function(){return this.getPkColumn().getName()},t.prototype.columnsOfType=function(t){return this._columns.filter((function(e){return e.getDataType()===t}))},t.prototype.addColumn=function(t){this._columns.push(t),this.updateColumns()},t.prototype.renameColumn=function(t,e){this.renameColumnWithName(t.getName(),e),t.setName(e)},t.prototype.renameColumnWithName=function(t,e){this.renameColumnWithIndex(this.getColumnIndexForColumnName(t),e)},t.prototype.renameColumnWithIndex=function(t,e){this._columns[t].setName(e),this.updateColumns()},t.prototype.dropColumn=function(t){this.dropColumnWithIndex(t.getIndex())},t.prototype.dropColumnWithName=function(t){this.dropColumnWithIndex(this.getColumnIndexForColumnName(t))},t.prototype.dropColumnWithIndex=function(t){this._columns.splice(t,1),this._columns.forEach((function(t){return t.resetIndex()})),this.updateColumns()},t.prototype.alterColumn=function(t){var e=this.getColumn(t.getName()).getIndex();t.setIndex(e),this._columns[e]=t},t}();e.UserColumns=i},4668:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserDao=void 0;var o=n(4115),a=n(6366),s=n(4599),u=n(2224),l=n(8483),c=n(8314),h=n(5042),f=function(t){function e(e,n){var r=t.call(this,e)||this;return r._table=n,r.table_name=n.getTableName(),r.gpkgTableName=n.getTableName(),n.getPkColumn()?r.idColumns=[n.getPkColumn().getName()]:r.idColumns=[],r.columns=n.getUserColumns().getColumnNames(),r}return i(e,t),e.prototype.createObject=function(t){return t?this.getRow(t):this.newRow()},e.prototype.setValueInObject=function(t,e,n){t.setValueNoValidationWithIndex(e,n)},e.prototype.getRow=function(t){if(t instanceof u.UserRow)return t;if(this.table){for(var e=this.table.getColumnCount(),n={},r=0;r<e;r++){var i=this.table.getColumnWithIndex(r);n[i.name]=i.dataType}return this.newRow(n,t)}},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.newRow=function(t,e){return new u.UserRow(this.table,t,e)},e.prototype.linkRelatedRow=function(t,e,n,r,i){var o,a=this.geoPackage.relatedTablesExtension,s=t.table.getTableName(),u=e.table.getTableName(),l=a.getRelationshipBuilder().setBaseTableName(s).setRelatedTableName(u).setRelationType(n);r&&"string"!=typeof r?(l.setUserMappingTable(r),o=r.getTableName()):(r=r||s+"_"+u,l.setMappingTableName(r),o=r),a.addRelationship(l);var c=a.getMappingDao(o),h=c.newRow();for(var f in h.baseId=t.id,h.relatedId=e.id,i)h.setValueWithColumnName(f,i[f]);return c.create(h)},e.prototype.linkFeatureRow=function(t,e,n,r){return this.linkRelatedRow(t,e,l.RelationType.FEATURES,n,r)},e.prototype.linkMediaRow=function(t,e,n,r){return this.linkRelatedRow(t,e,l.RelationType.MEDIA,n,r)},e.prototype.linkSimpleAttributesRow=function(t,e,n,r){return this.linkRelatedRow(t,e,l.RelationType.SIMPLE_ATTRIBUTES,n,r)},e.prototype.getLinkedMedia=function(t){for(var e=this.mediaRelations,n=this.geoPackage.relatedTablesExtension,r=[],i=0;i<e.length;i++)for(var o=e[i],a=n.getMediaDao(o),s=n.getMappingDao(o.mapping_table_name).queryByBaseId(t.id),u=0;u<s.length;u++){var l=s[u].related_id;r.push(a.queryForId(l))}return r},e.prototype.getLinkedSimpleAttributes=function(t){for(var e=this.simpleAttributesRelations,n=this.geoPackage.relatedTablesExtension,r=[],i=0;i<e.length;i++)for(var o=e[i],a=n.getSimpleAttributesDao(o),s=n.getMappingDao(o.mapping_table_name).queryByBaseId(t.id),u=0;u<s.length;u++){var l=s[u].related_id;r.push(a.queryForId(l))}return r},e.prototype.getLinkedFeatures=function(t){for(var e=this.featureRelations,n=this.geoPackage.relatedTablesExtension,r=[],i=0;i<e.length;i++)for(var o=e[i],a=this.geoPackage.getFeatureDao(o.base_table_name),s=n.getMappingDao(o.mapping_table_name).queryByBaseId(t.id),u=0;u<s.length;u++){var l=s[u].related_id;r.push(a.queryForId(l))}return r},Object.defineProperty(e.prototype,"simpleAttributesRelations",{get:function(){return this.getRelationsWithName(s.SimpleAttributesTable.RELATION_TYPE.name)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"featureRelations",{get:function(){return this.getRelationsWithName(l.RelationType.FEATURES.name)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaRelations",{get:function(){return this.getRelationsWithName(a.MediaTable.RELATION_TYPE.name)},enumerable:!1,configurable:!0}),e.prototype.getRelationsWithName=function(t){return this.geoPackage.extendedRelationDao.getBaseTableRelationsWithName(this.table_name,t)},Object.defineProperty(e.prototype,"relations",{get:function(){return this.geoPackage.extendedRelationDao.getBaseTableRelations(this.table_name)},enumerable:!1,configurable:!0}),e.prototype.getRows=function(t){for(var e=[],n=0;n<t.length;n++){var r=this.queryForId(t[n]);r&&e.push(r)}return e},e.prototype.getCount=function(){return this.connection.count(this.table_name)},e.prototype.getTableName=function(){return this.table_name},e.prototype.renameColumn=function(t,e){c.AlterTable.renameColumn(this.connection,this.table_name,t,e),this._table.renameColumnWithName(t,e)},e.prototype.addColumn=function(t){c.AlterTable.addColumn(this.connection,this.table_name,t.getName(),h.CoreSQLUtils.columnDefinition(t)),this._table.addColumn(t)},e.prototype.dropColumnWithIndex=function(t){this.dropColumn(this._table.getColumnNameWithIndex(t))},e.prototype.dropColumn=function(t){c.AlterTable.dropColumnForUserTable(this.connection,this.table,t)},e.prototype.dropColumns=function(t){var e=[];t.forEach((function(t){e.push(t.getName())})),this.dropColumnNames(e)},e.prototype.dropColumnIndexes=function(t){var e=this,n=[];t.forEach((function(t){n.push(e._table.getColumnNameWithIndex(t))})),this.dropColumnNames(n)},e.prototype.dropColumnNames=function(t){c.AlterTable.dropColumnsForUserTable(this.connection,this.table,t)},e.prototype.alterColumn=function(t){c.AlterTable.alterColumnForTable(this.connection,this.table,t)},e.prototype.alterColumns=function(t){c.AlterTable.alterColumnsForTable(this.connection,this.table,t)},e}(o.Dao);e.UserDao=f},2224:(t,e,n)=>{"use strict";var r=n(3085).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.UserRow=void 0;var i=n(7319),o=function(){function t(t,e,n){if(this.table=t,this.columnTypes=e,this.values=n,!this.columnTypes){var r=this.table.getColumnCount();this.columnTypes={},this.values={};for(var i=0;i<r;i++)this.columnTypes[this.table.columns.getColumnName(i)]=this.table.columns.getColumnForIndex(i).dataType,this.values[this.table.columns.getColumnName(i)]=this.table.columns.getColumnForIndex(i).defaultValue}}return Object.defineProperty(t.prototype,"idColumn",{get:function(){return this.table.getIdColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnCount",{get:function(){return this.table.getColumnCount()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnNames",{get:function(){return this.table.columns._columnNames},enumerable:!1,configurable:!0}),t.prototype.getColumnNameWithIndex=function(t){return this.table.getColumnNameWithIndex(t)},t.prototype.getColumnIndexWithColumnName=function(t){return this.table.getColumnIndex(t)},t.prototype.getValueWithIndex=function(t){var e=this.values[this.getColumnNameWithIndex(t)];return void 0!==e&&(e=this.toObjectValue(t,e)),e},t.prototype.getValueWithColumnName=function(t){var e=this.values[t],n=this.getRowColumnTypeWithColumnName(t);return null==e?e:n===i.GeoPackageDataType.BOOLEAN?1===e:n===i.GeoPackageDataType.BLOB?r.from(e):e},t.prototype.toObjectValue=function(t,e){var n=e;return this.getColumnWithIndex(t).dataType===i.GeoPackageDataType.BOOLEAN&&e?1===e:n},t.prototype.toDatabaseValue=function(t){var e=this.getColumnWithColumnName(t),n=this.getValueWithColumnName(t);return e.dataType===i.GeoPackageDataType.BOOLEAN?!0===n?1:0:n},t.prototype.getRowColumnTypeWithIndex=function(t){return this.columnTypes[this.getColumnNameWithIndex(t)]},t.prototype.getRowColumnTypeWithColumnName=function(t){return this.columnTypes[t]},t.prototype.getColumnWithIndex=function(t){return this.table.getColumnWithIndex(t)},t.prototype.getColumnWithColumnName=function(t){return this.table.getColumnWithColumnName(t)},Object.defineProperty(t.prototype,"id",{get:function(){var t=null;return this.pkColumn&&(t=this.getValueWithIndex(this.pkColumnIndex)),t},set:function(t){this.values[this.table.getPkColumnName()]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pkColumnIndex",{get:function(){return this.table.getUserColumns().getPkColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pkColumn",{get:function(){return this.table.getPkColumn()},enumerable:!1,configurable:!0}),t.prototype.setValueWithIndex=function(t,e){if(t===this.table.getUserColumns().getPkColumnIndex())throw new Error("Cannot update the primary key of the row. Table Name: "+this.table.getTableName()+", Index: "+t+", Name: "+this.table.getPkColumnName());this.setValueWithColumnName(this.getColumnNameWithIndex(t),e)},t.prototype.setValueNoValidationWithIndex=function(t,e){this.values[this.getColumnNameWithIndex(t)]=e},t.prototype.setValueWithColumnName=function(t,e){var n=this.getRowColumnTypeWithColumnName(t);n===i.GeoPackageDataType.BOOLEAN?this.values[t]=!0===e?1:0:n===i.GeoPackageDataType.DATE?this.values[t]=e.toISOString().slice(0,10):n===i.GeoPackageDataType.DATETIME?this.values[t]=e.toISOString():this.values[t]=e},t.prototype.hasIdColumn=function(){return void 0!==this.table.getUserColumns().getPkColumnIndex()},t.prototype.hasId=function(){var t=!1;if(this.hasIdColumn()){var e=this.getValueWithIndex(this.table.getUserColumns().getPkColumnIndex());t=null!=e&&"number"==typeof e}return t},t.prototype.resetId=function(){this.values[this.table.getPkColumnName()]=void 0},t}();e.UserRow=o},8018:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserTable=void 0;var r=n(7686),i=function(){function t(t){this.constraints=new r.Constraints,this.columns=t,this.constraints=new r.Constraints}return t.prototype.copy=function(){var e=new t(this.columns.copy());return e.constraints.addConstraints(this.constraints),null!==this.contents&&void 0!==this.contents&&(e.contents=this.contents.copy()),e},t.prototype.getTableName=function(){return this.columns.getTableName()},Object.defineProperty(t.prototype,"tableType",{get:function(){return"userTable"},enumerable:!1,configurable:!0}),t.prototype.getUserColumns=function(){return this.columns},t.prototype.getColumnIndex=function(t){return this.columns.getColumnIndexForColumnName(t)},t.prototype.hasColumn=function(t){try{return this.getColumnIndex(t),!0}catch(t){return!1}},t.prototype.getColumnNameWithIndex=function(t){return this.columns.getColumnName(t)},t.prototype.getColumnWithIndex=function(t){return this.columns.getColumnForIndex(t)},t.prototype.getColumnWithColumnName=function(t){return this.getColumnWithIndex(this.getColumnIndex(t))},t.prototype.getColumnCount=function(){return this.columns.columnCount()},t.prototype.getPkColumn=function(){return this.columns.getPkColumn()},t.prototype.getPkColumnName=function(){return this.columns.getPkColumnName()},t.prototype.getIdColumnIndex=function(){return this.columns.getPkColumnIndex()},t.prototype.getIdColumn=function(){return this.getPkColumn()},t.prototype.addConstraint=function(t){this.constraints.add(t)},t.prototype.addConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.hasConstraints=function(){return this.constraints.has()},t.prototype.getConstraints=function(){return this.constraints},t.prototype.getConstraintsByType=function(t){return this.constraints.getConstraintsForType(t)},t.prototype.clearConstraints=function(){return this.constraints.clear()},t.prototype.columnsOfType=function(t){return this.columns.columnsOfType(t)},t.prototype.getContents=function(){return this.contents},t.prototype.setContents=function(t){this.contents=t,null!=t&&this.validateContents(t)},t.prototype.validateContents=function(t){},t.prototype.addColumn=function(t){this.columns.addColumn(t)},t.prototype.renameColumn=function(t,e){this.columns.renameColumn(t,e)},t.prototype.renameColumnWithName=function(t,e){this.columns.renameColumnWithName(t,e)},t.prototype.renameColumnAtIndex=function(t,e){this.columns.renameColumnWithIndex(t,e)},t.prototype.dropColumn=function(t){this.columns.dropColumn(t)},t.prototype.dropColumnWithName=function(t){this.columns.dropColumnWithName(t)},t.prototype.dropColumnWithIndex=function(t){this.columns.dropColumnWithIndex(t)},t.prototype.alterColumn=function(t){this.columns.alterColumn(t)},t}();e.UserTable=i},5071:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserTableDefaults=void 0;var n=function(){function t(){}return t.DEFAULT_AUTOINCREMENT=!0,t.DEFAULT_PK_NOT_NULL=!0,t}();e.UserTableDefaults=n},4880:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserTableReader=void 0;var r=n(5865),i=n(5045),o=n(7043),a=function(){function t(t){this.table_name=t}return t.prototype.readTable=function(t){var e=this,n=[],r=i.TableInfo.info(t,this.table_name);if(null==r)throw new Error("Table does not exist: "+this.table_name);var a=o.SQLiteMaster.queryForConstraints(t,this.table_name);r.getColumns().forEach((function(t){if(null===t.getDataType()||void 0===t.getDataType())throw new Error("Unsupported column data type "+t.getType());var r=e.createColumn(t),i=a.getColumnConstraints(r.getName());null!=i&&i.hasConstraints()&&(r.clearConstraints(),r.addConstraints(i.constraints)),n.push(r)}));var s=this.createTable(this.table_name,n);return s.addConstraints(a.getTableConstraints()),s},t.prototype.createColumn=function(t){return new r.UserColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,t.autoincrement)},t}();e.UserTableReader=a},4275:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageValidate=e.GeoPackageValidationError=void 0;var i=r(n(3935)),o=n(1506),a=function(t,e){this.error=t,this.fatal=e};e.GeoPackageValidationError=a;var s=function(){function t(){}return t.hasGeoPackageExtension=function(t){var e=i.default.extname(t);return e&&""!==e&&(e.toLowerCase()==="."+o.GeoPackageConstants.GEOPACKAGE_EXTENSION.toLowerCase()||e.toLowerCase()==="."+o.GeoPackageConstants.GEOPACKAGE_EXTENDED_EXTENSION.toLowerCase())},t.validateGeoPackageExtension=function(e){if(!t.hasGeoPackageExtension(e))return new a("GeoPackage database file '"+e+"' does not have a valid extension of '"+o.GeoPackageConstants.GEOPACKAGE_EXTENSION+"' or '"+o.GeoPackageConstants.GEOPACKAGE_EXTENDED_EXTENSION+"'",!0)},t.validateMinimumTables=function(t){var e=[],n=t.spatialReferenceSystemDao.isTableExists(),r=t.contentsDao.isTableExists();return n||e.push(new a("gpkg_spatial_ref_sys table does not exist",!0)),r||e.push(new a("gpkg_contents table does not exist",!0)),e},t.hasMinimumTables=function(t){return 0==this.validateMinimumTables(t).length},t}();e.GeoPackageValidate=s},2038:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.WKB=void 0;var r=function(){function t(){}return t.fromName=function(e){return"GEOMETRY"===(e=e.toUpperCase())?t.typeMap.wkb.GeometryCollection:t.wktToEnum[e]},t.typeMap={wkt:{Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION"},wkb:{Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6,GeometryCollection:7}},t.wktToEnum=((n={})[t.typeMap.wkt.Point]=t.typeMap.wkb.Point,n[t.typeMap.wkt.LineString]=t.typeMap.wkb.LineString,n[t.typeMap.wkt.Polygon]=t.typeMap.wkb.Polygon,n[t.typeMap.wkt.MultiPoint]=t.typeMap.wkb.MultiPoint,n[t.typeMap.wkt.MultiLineString]=t.typeMap.wkb.MultiLineString,n[t.typeMap.wkt.MultiPolygon]=t.typeMap.wkb.MultiPolygon,n[t.typeMap.wkt.GeometryCollection]=t.typeMap.wkb.GeometryCollection,n),t}();e.WKB=r},2511:function(t,e,n){var r;t=n.nmd(t),function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof n.g&&n.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,u=36,l=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function y(t){throw RangeError(f[t])}function m(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function g(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+m((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function b(t){return m(t,(function(t){var e="";return t>65535&&(e+=d((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+d(t)})).join("")}function v(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,n){var r=0;for(t=n?p(t/700):t>>1,t+=p(t/e);t>455;r+=u)t=p(t/35);return p(r+36*t/(t+38))}function E(t){var e,n,r,i,o,a,l,c,h,f,d,m=[],g=t.length,_=0,v=128,E=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&y("not-basic"),m.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<g;){for(o=_,a=1,l=u;i>=g&&y("invalid-input"),((c=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||c>p((s-_)/a))&&y("overflow"),_+=c*a,!(c<(h=l<=E?1:l>=E+26?26:l-E));l+=u)a>p(s/(f=u-h))&&y("overflow"),a*=f;E=T(_-o,e=m.length+1,0==o),p(_/e)>s-v&&y("overflow"),v+=p(_/e),_%=e,m.splice(_++,0,v)}return b(m)}function w(t){var e,n,r,i,o,a,l,c,h,f,m,g,b,E,w,x=[];for(g=(t=_(t)).length,e=128,n=0,o=72,a=0;a<g;++a)(m=t[a])<128&&x.push(d(m));for(r=i=x.length,i&&x.push("-");r<g;){for(l=s,a=0;a<g;++a)(m=t[a])>=e&&m<l&&(l=m);for(l-e>p((s-n)/(b=r+1))&&y("overflow"),n+=(l-e)*b,e=l,a=0;a<g;++a)if((m=t[a])<e&&++n>s&&y("overflow"),m==e){for(c=n,h=u;!(c<(f=h<=o?1:h>=o+26?26:h-o));h+=u)w=c-f,E=u-f,x.push(d(v(f+w%E,0))),c=p(w/E);x.push(d(v(c,0))),o=T(n,b,r==i),n=0,++r}++n,++e}return x.join("")}a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:E,encode:w,toASCII:function(t){return g(t,(function(t){return c.test(t)?"xn--"+w(t):t}))},toUnicode:function(t){return g(t,(function(t){return l.test(t)?E(t.slice(4).toLowerCase()):t}))}},void 0===(r=function(){return a}.call(e,n,e,t))||(t.exports=r)}()},8575:(t,e,n)=>{"use strict";var r=n(2511),i=n(2502);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){return i.isString(t)&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=n(7673);function b(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",l=t.split(s);l[0]=l[0].replace(/\\/g,"/");var b=t=l.join(s);if(b=b.trim(),!n&&1===t.split("#").length){var v=u.exec(b);if(v)return this.path=b,this.href=b,this.pathname=v[1],v[2]?(this.search=v[2],this.query=e?_.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var T=a.exec(b);if(T){var E=(T=T[0]).toLowerCase();this.protocol=E,b=b.substr(T.length)}if(n||T||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var w="//"===b.substr(0,2);!w||T&&m[T]||(b=b.substr(2),this.slashes=!0)}if(!m[T]&&(w||T&&!g[T])){for(var x,C,M=-1,S=0;S<f.length;S++)-1!==(N=b.indexOf(f[S]))&&(-1===M||N<M)&&(M=N);for(-1!==(C=-1===M?b.lastIndexOf("@"):b.lastIndexOf("@",M))&&(x=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(x)),M=-1,S=0;S<h.length;S++){var N;-1!==(N=b.indexOf(h[S]))&&(-1===M||N<M)&&(M=N)}-1===M&&(M=b.length),this.host=b.slice(0,M),b=b.slice(M),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var A=this.hostname.split(/\./),I=(S=0,A.length);S<I;S++){var P=A[S];if(P&&!P.match(p)){for(var R="",L=0,D=P.length;L<D;L++)P.charCodeAt(L)>127?R+="x":R+=P[L];if(!R.match(p)){var k=A.slice(0,S),F=A.slice(S+1),U=P.match(d);U&&(k.push(U[1]),F.unshift(U[2])),F.length&&(b="/"+F.join(".")+b),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+B,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[E])for(S=0,I=c.length;S<I;S++){var G=c[S];if(-1!==b.indexOf(G)){var W=encodeURIComponent(G);W===G&&(W=escape(G)),b=b.split(G).join(W)}}var q=b.indexOf("#");-1!==q&&(this.hash=b.substr(q),b=b.slice(0,q));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),e&&(this.query=_.parse(this.query)),b=b.slice(0,H)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var z=this.search||"";this.path=B+z}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=_.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(n=n.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+r},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var n=new o,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),l=0;l<u.length;l++){var c=u[l];"protocol"!==c&&(n[c]=t[c])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!g[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var p=h[f];n[p]=t[p]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||m[t.protocol])n.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var y=n.pathname||"",_=n.search||"";n.path=y+_}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),T=v||b||n.host&&t.pathname,E=T,w=n.pathname&&n.pathname.split("/")||[],x=(d=t.pathname&&t.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(x&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),T=T&&(""===d[0]||""===w[0])),v)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,w=d;else if(d.length)w||(w=[]),w.pop(),w=w.concat(d),n.search=t.search,n.query=t.query;else if(!i.isNullOrUndefined(t.search))return x&&(n.hostname=n.host=w.shift(),(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift())),n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=w.slice(-1)[0],M=(n.host||t.host||w.length>1)&&("."===C||".."===C)||""===C,S=0,N=w.length;N>=0;N--)"."===(C=w[N])?w.splice(N,1):".."===C?(w.splice(N,1),S++):S&&(w.splice(N,1),S--);if(!T&&!E)for(;S--;S)w.unshift("..");!T||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),M&&"/"!==w.join("/").substr(-1)&&w.push("");var O,A=""===w[0]||w[0]&&"/"===w[0].charAt(0);return x&&(n.hostname=n.host=A?"":w.length?w.shift():"",(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift())),(T=T||n.host&&w.length)&&!A&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},2502:t=>{"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},4927:(t,e,n)=>{var r=n(5108);function i(t){try{if(!n.g.localStorage)return!1}catch(t){return!1}var e=n.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?r.trace(e):r.warn(e),n=!0}return t.apply(this,arguments)}}},1496:t=>{"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},9539:(t,e,n)=>{var r=n(4155),i=n(5108),o=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(u(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),s=r[n];n<i;s=r[++n])m(s)||!T(s)?a+=" "+s:a+=" "+u(s);return a},e.deprecate=function(t,o){if(b(n.g.process))return function(){return e.deprecate(t,o).apply(this,arguments)};if(!0===r.noDeprecation)return t;var a=!1;return function(){if(!a){if(r.throwDeprecation)throw new Error(o);r.traceDeprecation?i.trace(o):i.error(o),a=!0}return t.apply(this,arguments)}};var a,s={};function u(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&e._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),h(r,t,r.depth)}function l(t,e){var n=u.styles[e];return n?"["+u.colors[n][0]+"m"+t+"["+u.colors[n][1]+"m":t}function c(t,e){return t}function h(t,n,r){if(t.customInspect&&n&&x(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return _(i)||(i=h(t,i,r)),i}var o=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return g(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,n);if(o)return o;var a=Object.keys(n),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),w(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(x(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(v(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return t.stylize(Date.prototype.toString.call(n),"date");if(w(n))return f(n)}var l,c="",T=!1,C=["{","}"];return d(n)&&(T=!0,C=["[","]"]),x(n)&&(c=" [Function"+(n.name?": "+n.name:"")+"]"),v(n)&&(c=" "+RegExp.prototype.toString.call(n)),E(n)&&(c=" "+Date.prototype.toUTCString.call(n)),w(n)&&(c=" "+f(n)),0!==a.length||T&&0!=n.length?r<0?v(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),l=T?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)O(e,String(a))?o.push(p(t,e,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(t,e,n,r,i,!0))})),o}(t,n,r,s,a):a.map((function(e){return p(t,n,r,s,e,T)})),t.seen.pop(),function(t,e,n){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(l,c,C)):C[0]+c+C[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),O(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(n)?h(t,u.value,null):h(t,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return void 0===t}function v(t){return T(t)&&"[object RegExp]"===C(t)}function T(t){return"object"==typeof t&&null!==t}function E(t){return T(t)&&"[object Date]"===C(t)}function w(t){return T(t)&&("[object Error]"===C(t)||t instanceof Error)}function x(t){return"function"==typeof t}function C(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(b(a)&&(a=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!s[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=r.pid;s[t]=function(){var r=e.format.apply(e,arguments);i.error("%s %d: %s",t,n,r)}}else s[t]=function(){};return s[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=_,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=v,e.isObject=T,e.isDate=E,e.isError=w,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(384);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){i.log("%s - %s",N(),e.format.apply(e,arguments))},e.inherits=n(1496),e._extend=function(t,e){if(!e||!T(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}},8034:t=>{var e=arguments[3],n=arguments[4],r=arguments[5],i=JSON.stringify;t.exports=function(t,o){for(var a,s=Object.keys(r),u=0,l=s.length;u<l;u++){var c=s[u],h=r[c].exports;if(h===t||h&&h.default===t){a=c;break}}if(!a){a=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var f={};for(u=0,l=s.length;u<l;u++)f[c=s[u]]=c;n[a]=["function(require,module,exports){"+t+"(self); }",f]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),d={};d[a]=a,n[p]=["function(require,module,exports){var f = require("+i(a)+");(f.default ? f.default : f)(self);}",d];var y={};!function t(e){for(var r in y[e]=!0,n[e][1]){var i=n[e][1][r];y[i]||t(i)}}(p);var m="("+e+")({"+Object.keys(y).map((function(t){return i(t)+":["+n[t][0]+","+i(n[t][1])+"]"})).join(",")+"},{},["+i(p)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,_=new Blob([m],{type:"text/javascript"});if(o&&o.bare)return _;var b=g.createObjectURL(_),v=new Worker(b);return v.objectURL=b,v}},6382:(t,e,n)=>{var r=n(3085).Buffer;function i(t,e){this.buffer=t,this.position=0,this.isBigEndian=e||!1}function o(t,e,n){return function(){var r;return r=this.isBigEndian?e.call(this.buffer,this.position):t.call(this.buffer,this.position),this.position+=n,r}}t.exports=i,i.prototype.readUInt8=o(r.prototype.readUInt8,r.prototype.readUInt8,1),i.prototype.readUInt16=o(r.prototype.readUInt16LE,r.prototype.readUInt16BE,2),i.prototype.readUInt32=o(r.prototype.readUInt32LE,r.prototype.readUInt32BE,4),i.prototype.readInt8=o(r.prototype.readInt8,r.prototype.readInt8,1),i.prototype.readInt16=o(r.prototype.readInt16LE,r.prototype.readInt16BE,2),i.prototype.readInt32=o(r.prototype.readInt32LE,r.prototype.readInt32BE,4),i.prototype.readFloat=o(r.prototype.readFloatLE,r.prototype.readFloatBE,4),i.prototype.readDouble=o(r.prototype.readDoubleLE,r.prototype.readDoubleBE,8),i.prototype.readVarInt=function(){var t,e=0,n=0;do{e+=(127&(t=this.buffer[this.position+n]))<<7*n,n++}while(t>=128);return this.position+=n,e}},2659:(t,e,n)=>{var r=n(3085).Buffer;function i(t,e){this.buffer=new r(t),this.position=0,this.allowResize=e}function o(t,e){return function(n,r){this.ensureSize(e),t.call(this.buffer,n,this.position,r),this.position+=e}}t.exports=i,i.prototype.writeUInt8=o(r.prototype.writeUInt8,1),i.prototype.writeUInt16LE=o(r.prototype.writeUInt16LE,2),i.prototype.writeUInt16BE=o(r.prototype.writeUInt16BE,2),i.prototype.writeUInt32LE=o(r.prototype.writeUInt32LE,4),i.prototype.writeUInt32BE=o(r.prototype.writeUInt32BE,4),i.prototype.writeInt8=o(r.prototype.writeInt8,1),i.prototype.writeInt16LE=o(r.prototype.writeInt16LE,2),i.prototype.writeInt16BE=o(r.prototype.writeInt16BE,2),i.prototype.writeInt32LE=o(r.prototype.writeInt32LE,4),i.prototype.writeInt32BE=o(r.prototype.writeInt32BE,4),i.prototype.writeFloatLE=o(r.prototype.writeFloatLE,4),i.prototype.writeFloatBE=o(r.prototype.writeFloatBE,4),i.prototype.writeDoubleLE=o(r.prototype.writeDoubleLE,8),i.prototype.writeDoubleBE=o(r.prototype.writeDoubleBE,8),i.prototype.writeBuffer=function(t){this.ensureSize(t.length),t.copy(this.buffer,this.position,0,t.length),this.position+=t.length},i.prototype.writeVarInt=function(t){for(var e=1;0!=(4294967168&t);)this.writeUInt8(127&t|128),t>>>=7,e++;return this.writeUInt8(127&t),e},i.prototype.ensureSize=function(t){if(this.buffer.length<this.position+t){if(!this.allowResize)throw new RangeError("index out of range");var e=new r(this.position+t);this.buffer.copy(e,0,0,this.buffer.length),this.buffer=e}}},7056:(t,e,n)=>{var r=n(3085).Buffer;t.exports=m;var i=n(4905),o=n(9213),a=n(9645),s=n(978),u=n(1665),l=n(9606),c=n(9763),h=n(2292),f=n(6382),p=n(2659),d=n(2620),y=n(3172);function m(){this.srid=void 0,this.hasZ=!1,this.hasM=!1}m.parse=function(t,e){if("string"==typeof t||t instanceof d)return m._parseWkt(t);if(r.isBuffer(t)||t instanceof f)return m._parseWkb(t,e);throw new Error("first argument must be a string or Buffer")},m._parseWkt=function(t){var e,n,r=(e=t instanceof d?t:new d(t)).matchRegex([/^SRID=(\d+);/]);r&&(n=parseInt(r[1],10));var f=e.matchType(),p=e.matchDimension(),y={srid:n,hasZ:p.hasZ,hasM:p.hasM};switch(f){case i.wkt.Point:return o._parseWkt(e,y);case i.wkt.LineString:return a._parseWkt(e,y);case i.wkt.Polygon:return s._parseWkt(e,y);case i.wkt.MultiPoint:return u._parseWkt(e,y);case i.wkt.MultiLineString:return l._parseWkt(e,y);case i.wkt.MultiPolygon:return c._parseWkt(e,y);case i.wkt.GeometryCollection:return h._parseWkt(e,y)}},m._parseWkb=function(t,e){var n,r,p,d={};switch((n=t instanceof f?t:new f(t)).isBigEndian=!n.readInt8(),r=n.readUInt32(),d.hasSrid=536870912==(536870912&r),d.isEwkb=536870912&r||1073741824&r||2147483648&r,d.hasSrid&&(d.srid=n.readUInt32()),d.hasZ=!1,d.hasM=!1,d.isEwkb||e&&e.isEwkb?(2147483648&r&&(d.hasZ=!0),1073741824&r&&(d.hasM=!0),p=15&r):r>=1e3&&r<2e3?(d.hasZ=!0,p=r-1e3):r>=2e3&&r<3e3?(d.hasM=!0,p=r-2e3):r>=3e3&&r<4e3?(d.hasZ=!0,d.hasM=!0,p=r-3e3):p=r,p){case i.wkb.Point:return o._parseWkb(n,d);case i.wkb.LineString:return a._parseWkb(n,d);case i.wkb.Polygon:return s._parseWkb(n,d);case i.wkb.MultiPoint:return u._parseWkb(n,d);case i.wkb.MultiLineString:return l._parseWkb(n,d);case i.wkb.MultiPolygon:return c._parseWkb(n,d);case i.wkb.GeometryCollection:return h._parseWkb(n,d);default:throw new Error("GeometryType "+p+" not supported")}},m.parseTwkb=function(t){var e,n={},r=(e=t instanceof f?t:new f(t)).readUInt8(),p=e.readUInt8(),d=15&r;if(n.precision=y.decode(r>>4),n.precisionFactor=Math.pow(10,n.precision),n.hasBoundingBox=p>>0&1,n.hasSizeAttribute=p>>1&1,n.hasIdList=p>>2&1,n.hasExtendedPrecision=p>>3&1,n.isEmpty=p>>4&1,n.hasExtendedPrecision){var m=e.readUInt8();n.hasZ=1==(1&m),n.hasM=2==(2&m),n.zPrecision=y.decode((28&m)>>2),n.zPrecisionFactor=Math.pow(10,n.zPrecision),n.mPrecision=y.decode((224&m)>>5),n.mPrecisionFactor=Math.pow(10,n.mPrecision)}else n.hasZ=!1,n.hasM=!1;if(n.hasSizeAttribute&&e.readVarInt(),n.hasBoundingBox){var g=2;n.hasZ&&g++,n.hasM&&g++;for(var _=0;_<g;_++)e.readVarInt(),e.readVarInt()}switch(d){case i.wkb.Point:return o._parseTwkb(e,n);case i.wkb.LineString:return a._parseTwkb(e,n);case i.wkb.Polygon:return s._parseTwkb(e,n);case i.wkb.MultiPoint:return u._parseTwkb(e,n);case i.wkb.MultiLineString:return l._parseTwkb(e,n);case i.wkb.MultiPolygon:return c._parseTwkb(e,n);case i.wkb.GeometryCollection:return h._parseTwkb(e,n);default:throw new Error("GeometryType "+d+" not supported")}},m.parseGeoJSON=function(t){return m._parseGeoJSON(t)},m._parseGeoJSON=function(t,e){var n;switch(t.type){case i.geoJSON.Point:n=o._parseGeoJSON(t);break;case i.geoJSON.LineString:n=a._parseGeoJSON(t);break;case i.geoJSON.Polygon:n=s._parseGeoJSON(t);break;case i.geoJSON.MultiPoint:n=u._parseGeoJSON(t);break;case i.geoJSON.MultiLineString:n=l._parseGeoJSON(t);break;case i.geoJSON.MultiPolygon:n=c._parseGeoJSON(t);break;case i.geoJSON.GeometryCollection:n=h._parseGeoJSON(t);break;default:throw new Error("GeometryType "+t.type+" not supported")}if(t.crs&&t.crs.type&&"name"===t.crs.type&&t.crs.properties&&t.crs.properties.name){var r=t.crs.properties.name;if(0===r.indexOf("EPSG:"))n.srid=parseInt(r.substring(5));else{if(0!==r.indexOf("urn:ogc:def:crs:EPSG::"))throw new Error("Unsupported crs: "+r);n.srid=parseInt(r.substring(22))}}else e||(n.srid=4326);return n},m.prototype.toEwkt=function(){return"SRID="+this.srid+";"+this.toWkt()},m.prototype.toEwkb=function(){var t=new p(this._getWkbSize()+4),e=this.toWkb();return t.writeInt8(1),t.writeUInt32LE((536870912|e.slice(1,5).readUInt32LE(0))>>>0,!0),t.writeUInt32LE(this.srid),t.writeBuffer(e.slice(5)),t.buffer},m.prototype._getWktType=function(t,e){var n=t;return this.hasZ&&this.hasM?n+=" ZM ":this.hasZ?n+=" Z ":this.hasM&&(n+=" M "),!e||this.hasZ||this.hasM||(n+=" "),e&&(n+="EMPTY"),n},m.prototype._getWktCoordinate=function(t){var e=t.x+" "+t.y;return this.hasZ&&(e+=" "+t.z),this.hasM&&(e+=" "+t.m),e},m.prototype._writeWkbType=function(t,e,n){var r=0;void 0!==this.srid||n&&void 0!==n.srid?(this.hasZ&&(r|=2147483648),this.hasM&&(r|=1073741824)):this.hasZ&&this.hasM?r+=3e3:this.hasZ?r+=1e3:this.hasM&&(r+=2e3),t.writeUInt32LE(r+e>>>0,!0)},m.getTwkbPrecision=function(t,e,n){return{xy:t,z:e,m:n,xyFactor:Math.pow(10,t),zFactor:Math.pow(10,e),mFactor:Math.pow(10,n)}},m.prototype._writeTwkbHeader=function(t,e,n,r){var i=(y.encode(n.xy)<<4)+e,o=(this.hasZ||this.hasM)<<3;if(o+=r<<4,t.writeUInt8(i),t.writeUInt8(o),this.hasZ||this.hasM){var a=0;this.hasZ&&(a|=1),this.hasM&&(a|=2),t.writeUInt8(a)}},m.prototype.toGeoJSON=function(t){var e={};return this.srid&&t&&(t.shortCrs?e.crs={type:"name",properties:{name:"EPSG:"+this.srid}}:t.longCrs&&(e.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+this.srid}})),e}},2292:(t,e,n)=>{t.exports=s;var r=n(9539),i=n(4905),o=n(7056),a=n(2659);function s(t,e){o.call(this),this.geometries=t||[],this.srid=e,this.geometries.length>0&&(this.hasZ=this.geometries[0].hasZ,this.hasM=this.geometries[0].hasM)}r.inherits(s,o),s.Z=function(t,e){var n=new s(t,e);return n.hasZ=!0,n},s.M=function(t,e){var n=new s(t,e);return n.hasM=!0,n},s.ZM=function(t,e){var n=new s(t,e);return n.hasZ=!0,n.hasM=!0,n},s._parseWkt=function(t,e){var n=new s;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();do{n.geometries.push(o.parse(t))}while(t.isMatch([","]));return t.expectGroupEnd(),n},s._parseWkb=function(t,e){var n=new s;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i<r;i++)n.geometries.push(o.parse(t,e));return n},s._parseTwkb=function(t,e){var n=new s;if(n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty)return n;for(var r=t.readVarInt(),i=0;i<r;i++)n.geometries.push(o.parseTwkb(t));return n},s._parseGeoJSON=function(t){for(var e=new s,n=0;n<t.geometries.length;n++)e.geometries.push(o._parseGeoJSON(t.geometries[n],!0));return e.geometries.length>0&&(e.hasZ=e.geometries[0].hasZ),e},s.prototype.toWkt=function(){if(0===this.geometries.length)return this._getWktType(i.wkt.GeometryCollection,!0);for(var t=this._getWktType(i.wkt.GeometryCollection,!1)+"(",e=0;e<this.geometries.length;e++)t+=this.geometries[e].toWkt()+",";return(t=t.slice(0,-1))+")"},s.prototype.toWkb=function(){var t=new a(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,i.wkb.GeometryCollection),t.writeUInt32LE(this.geometries.length);for(var e=0;e<this.geometries.length;e++)t.writeBuffer(this.geometries[e].toWkb({srid:this.srid}));return t.buffer},s.prototype.toTwkb=function(){var t=new a(0,!0),e=o.getTwkbPrecision(5,0,0),n=0===this.geometries.length;if(this._writeTwkbHeader(t,i.wkb.GeometryCollection,e,n),this.geometries.length>0){t.writeVarInt(this.geometries.length);for(var r=0;r<this.geometries.length;r++)t.writeBuffer(this.geometries[r].toTwkb())}return t.buffer},s.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.geometries.length;e++)t+=this.geometries[e]._getWkbSize();return t},s.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);e.type=i.geoJSON.GeometryCollection,e.geometries=[];for(var n=0;n<this.geometries.length;n++)e.geometries.push(this.geometries[n].toGeoJSON());return e}},9645:(t,e,n)=>{t.exports=u;var r=n(9539),i=n(7056),o=n(4905),a=n(9213),s=n(2659);function u(t,e){i.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}r.inherits(u,i),u.Z=function(t,e){var n=new u(t,e);return n.hasZ=!0,n},u.M=function(t,e){var n=new u(t,e);return n.hasM=!0,n},u.ZM=function(t,e){var n=new u(t,e);return n.hasZ=!0,n.hasM=!0,n},u._parseWkt=function(t,e){var n=new u;return n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),n.points.push.apply(n.points,t.matchCoordinates(e)),t.expectGroupEnd()),n},u._parseWkb=function(t,e){var n=new u;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i<r;i++)n.points.push(a._readWkbPoint(t,e));return n},u._parseTwkb=function(t,e){var n=new u;if(n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty)return n;for(var r=new a(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),i=t.readVarInt(),o=0;o<i;o++)n.points.push(a._readTwkbPoint(t,e,r));return n},u._parseGeoJSON=function(t){var e=new u;t.coordinates.length>0&&(e.hasZ=t.coordinates[0].length>2);for(var n=0;n<t.coordinates.length;n++)e.points.push(a._readGeoJSONPoint(t.coordinates[n]));return e},u.prototype.toWkt=function(){return 0===this.points.length?this._getWktType(o.wkt.LineString,!0):this._getWktType(o.wkt.LineString,!1)+this._toInnerWkt()},u.prototype._toInnerWkt=function(){for(var t="(",e=0;e<this.points.length;e++)t+=this._getWktCoordinate(this.points[e])+",";return(t=t.slice(0,-1))+")"},u.prototype.toWkb=function(t){var e=new s(this._getWkbSize());e.writeInt8(1),this._writeWkbType(e,o.wkb.LineString,t),e.writeUInt32LE(this.points.length);for(var n=0;n<this.points.length;n++)this.points[n]._writeWkbPoint(e);return e.buffer},u.prototype.toTwkb=function(){var t=new s(0,!0),e=i.getTwkbPrecision(5,0,0),n=0===this.points.length;if(this._writeTwkbHeader(t,o.wkb.LineString,e,n),this.points.length>0){t.writeVarInt(this.points.length);for(var r=new a(0,0,0,0),u=0;u<this.points.length;u++)this.points[u]._writeTwkbPoint(t,e,r)}return t.buffer},u.prototype._getWkbSize=function(){var t=16;return this.hasZ&&(t+=8),this.hasM&&(t+=8),9+this.points.length*t},u.prototype.toGeoJSON=function(t){var e=i.prototype.toGeoJSON.call(this,t);e.type=o.geoJSON.LineString,e.coordinates=[];for(var n=0;n<this.points.length;n++)this.hasZ?e.coordinates.push([this.points[n].x,this.points[n].y,this.points[n].z]):e.coordinates.push([this.points[n].x,this.points[n].y]);return e}},9606:(t,e,n)=>{t.exports=l;var r=n(9539),i=n(4905),o=n(7056),a=n(9213),s=n(9645),u=n(2659);function l(t,e){o.call(this),this.lineStrings=t||[],this.srid=e,this.lineStrings.length>0&&(this.hasZ=this.lineStrings[0].hasZ,this.hasM=this.lineStrings[0].hasM)}r.inherits(l,o),l.Z=function(t,e){var n=new l(t,e);return n.hasZ=!0,n},l.M=function(t,e){var n=new l(t,e);return n.hasM=!0,n},l.ZM=function(t,e){var n=new l(t,e);return n.hasZ=!0,n.hasM=!0,n},l._parseWkt=function(t,e){var n=new l;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();do{t.expectGroupStart(),n.lineStrings.push(new s(t.matchCoordinates(e))),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),n},l._parseWkb=function(t,e){var n=new l;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i<r;i++)n.lineStrings.push(o.parse(t,e));return n},l._parseTwkb=function(t,e){var n=new l;if(n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty)return n;for(var r=new a(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),i=t.readVarInt(),o=0;o<i;o++){var u=new s;u.hasZ=e.hasZ,u.hasM=e.hasM;for(var c=t.readVarInt(),h=0;h<c;h++)u.points.push(a._readTwkbPoint(t,e,r));n.lineStrings.push(u)}return n},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var n=0;n<t.coordinates.length;n++)e.lineStrings.push(s._parseGeoJSON({coordinates:t.coordinates[n]}));return e},l.prototype.toWkt=function(){if(0===this.lineStrings.length)return this._getWktType(i.wkt.MultiLineString,!0);for(var t=this._getWktType(i.wkt.MultiLineString,!1)+"(",e=0;e<this.lineStrings.length;e++)t+=this.lineStrings[e]._toInnerWkt()+",";return(t=t.slice(0,-1))+")"},l.prototype.toWkb=function(){var t=new u(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,i.wkb.MultiLineString),t.writeUInt32LE(this.lineStrings.length);for(var e=0;e<this.lineStrings.length;e++)t.writeBuffer(this.lineStrings[e].toWkb({srid:this.srid}));return t.buffer},l.prototype.toTwkb=function(){var t=new u(0,!0),e=o.getTwkbPrecision(5,0,0),n=0===this.lineStrings.length;if(this._writeTwkbHeader(t,i.wkb.MultiLineString,e,n),this.lineStrings.length>0){t.writeVarInt(this.lineStrings.length);for(var r=new a(0,0,0,0),s=0;s<this.lineStrings.length;s++){t.writeVarInt(this.lineStrings[s].points.length);for(var l=0;l<this.lineStrings[s].points.length;l++)this.lineStrings[s].points[l]._writeTwkbPoint(t,e,r)}}return t.buffer},l.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.lineStrings.length;e++)t+=this.lineStrings[e]._getWkbSize();return t},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);e.type=i.geoJSON.MultiLineString,e.coordinates=[];for(var n=0;n<this.lineStrings.length;n++)e.coordinates.push(this.lineStrings[n].toGeoJSON().coordinates);return e}},1665:(t,e,n)=>{t.exports=u;var r=n(9539),i=n(4905),o=n(7056),a=n(9213),s=n(2659);function u(t,e){o.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}r.inherits(u,o),u.Z=function(t,e){var n=new u(t,e);return n.hasZ=!0,n},u.M=function(t,e){var n=new u(t,e);return n.hasM=!0,n},u.ZM=function(t,e){var n=new u(t,e);return n.hasZ=!0,n.hasM=!0,n},u._parseWkt=function(t,e){var n=new u;return n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),n.points.push.apply(n.points,t.matchCoordinates(e)),t.expectGroupEnd()),n},u._parseWkb=function(t,e){var n=new u;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i<r;i++)n.points.push(o.parse(t,e));return n},u._parseTwkb=function(t,e){var n=new u;if(n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty)return n;for(var r=new a(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),i=t.readVarInt(),o=0;o<i;o++)n.points.push(a._readTwkbPoint(t,e,r));return n},u._parseGeoJSON=function(t){var e=new u;t.coordinates.length>0&&(e.hasZ=t.coordinates[0].length>2);for(var n=0;n<t.coordinates.length;n++)e.points.push(a._parseGeoJSON({coordinates:t.coordinates[n]}));return e},u.prototype.toWkt=function(){if(0===this.points.length)return this._getWktType(i.wkt.MultiPoint,!0);for(var t=this._getWktType(i.wkt.MultiPoint,!1)+"(",e=0;e<this.points.length;e++)t+=this._getWktCoordinate(this.points[e])+",";return(t=t.slice(0,-1))+")"},u.prototype.toWkb=function(){var t=new s(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,i.wkb.MultiPoint),t.writeUInt32LE(this.points.length);for(var e=0;e<this.points.length;e++)t.writeBuffer(this.points[e].toWkb({srid:this.srid}));return t.buffer},u.prototype.toTwkb=function(){var t=new s(0,!0),e=o.getTwkbPrecision(5,0,0),n=0===this.points.length;if(this._writeTwkbHeader(t,i.wkb.MultiPoint,e,n),this.points.length>0){t.writeVarInt(this.points.length);for(var r=new a(0,0,0,0),u=0;u<this.points.length;u++)this.points[u]._writeTwkbPoint(t,e,r)}return t.buffer},u.prototype._getWkbSize=function(){var t=16;return this.hasZ&&(t+=8),this.hasM&&(t+=8),t+=5,9+this.points.length*t},u.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);e.type=i.geoJSON.MultiPoint,e.coordinates=[];for(var n=0;n<this.points.length;n++)e.coordinates.push(this.points[n].toGeoJSON().coordinates);return e}},9763:(t,e,n)=>{t.exports=l;var r=n(9539),i=n(4905),o=n(7056),a=n(9213),s=n(978),u=n(2659);function l(t,e){o.call(this),this.polygons=t||[],this.srid=e,this.polygons.length>0&&(this.hasZ=this.polygons[0].hasZ,this.hasM=this.polygons[0].hasM)}r.inherits(l,o),l.Z=function(t,e){var n=new l(t,e);return n.hasZ=!0,n},l.M=function(t,e){var n=new l(t,e);return n.hasM=!0,n},l.ZM=function(t,e){var n=new l(t,e);return n.hasZ=!0,n.hasM=!0,n},l._parseWkt=function(t,e){var n=new l;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();do{t.expectGroupStart();var r=[],i=[];for(t.expectGroupStart(),r.push.apply(r,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),i.push(t.matchCoordinates(e)),t.expectGroupEnd();n.polygons.push(new s(r,i)),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),n},l._parseWkb=function(t,e){var n=new l;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i<r;i++)n.polygons.push(o.parse(t,e));return n},l._parseTwkb=function(t,e){var n=new l;if(n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty)return n;for(var r=new a(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),i=t.readVarInt(),o=0;o<i;o++){var u=new s;u.hasZ=e.hasZ,u.hasM=e.hasM;for(var c=t.readVarInt(),h=t.readVarInt(),f=0;f<h;f++)u.exteriorRing.push(a._readTwkbPoint(t,e,r));for(f=1;f<c;f++){for(var p=[],d=t.readVarInt(),y=0;y<d;y++)p.push(a._readTwkbPoint(t,e,r));u.interiorRings.push(p)}n.polygons.push(u)}return n},l._parseGeoJSON=function(t){var e=new l;t.coordinates.length>0&&t.coordinates[0].length>0&&t.coordinates[0][0].length>0&&(e.hasZ=t.coordinates[0][0][0].length>2);for(var n=0;n<t.coordinates.length;n++)e.polygons.push(s._parseGeoJSON({coordinates:t.coordinates[n]}));return e},l.prototype.toWkt=function(){if(0===this.polygons.length)return this._getWktType(i.wkt.MultiPolygon,!0);for(var t=this._getWktType(i.wkt.MultiPolygon,!1)+"(",e=0;e<this.polygons.length;e++)t+=this.polygons[e]._toInnerWkt()+",";return(t=t.slice(0,-1))+")"},l.prototype.toWkb=function(){var t=new u(this._getWkbSize());t.writeInt8(1),this._writeWkbType(t,i.wkb.MultiPolygon),t.writeUInt32LE(this.polygons.length);for(var e=0;e<this.polygons.length;e++)t.writeBuffer(this.polygons[e].toWkb({srid:this.srid}));return t.buffer},l.prototype.toTwkb=function(){var t=new u(0,!0),e=o.getTwkbPrecision(5,0,0),n=0===this.polygons.length;if(this._writeTwkbHeader(t,i.wkb.MultiPolygon,e,n),this.polygons.length>0){t.writeVarInt(this.polygons.length);for(var r=new a(0,0,0,0),s=0;s<this.polygons.length;s++){t.writeVarInt(1+this.polygons[s].interiorRings.length),t.writeVarInt(this.polygons[s].exteriorRing.length);for(var l=0;l<this.polygons[s].exteriorRing.length;l++)this.polygons[s].exteriorRing[l]._writeTwkbPoint(t,e,r);for(l=0;l<this.polygons[s].interiorRings.length;l++){t.writeVarInt(this.polygons[s].interiorRings[l].length);for(var c=0;c<this.polygons[s].interiorRings[l].length;c++)this.polygons[s].interiorRings[l][c]._writeTwkbPoint(t,e,r)}}}return t.buffer},l.prototype._getWkbSize=function(){for(var t=9,e=0;e<this.polygons.length;e++)t+=this.polygons[e]._getWkbSize();return t},l.prototype.toGeoJSON=function(t){var e=o.prototype.toGeoJSON.call(this,t);e.type=i.geoJSON.MultiPolygon,e.coordinates=[];for(var n=0;n<this.polygons.length;n++)e.coordinates.push(this.polygons[n].toGeoJSON().coordinates);return e}},9213:(t,e,n)=>{t.exports=u;var r=n(9539),i=n(7056),o=n(4905),a=n(2659),s=n(3172);function u(t,e,n,r,o){i.call(this),this.x=t,this.y=e,this.z=n,this.m=r,this.srid=o,this.hasZ=void 0!==this.z,this.hasM=void 0!==this.m}r.inherits(u,i),u.Z=function(t,e,n,r){var i=new u(t,e,n,void 0,r);return i.hasZ=!0,i},u.M=function(t,e,n,r){var i=new u(t,e,void 0,n,r);return i.hasM=!0,i},u.ZM=function(t,e,n,r,i){var o=new u(t,e,n,r,i);return o.hasZ=!0,o.hasM=!0,o},u._parseWkt=function(t,e){var n=new u;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();var r=t.matchCoordinate(e);return n.x=r.x,n.y=r.y,n.z=r.z,n.m=r.m,t.expectGroupEnd(),n},u._parseWkb=function(t,e){var n=u._readWkbPoint(t,e);return n.srid=e.srid,n},u._readWkbPoint=function(t,e){return new u(t.readDouble(),t.readDouble(),e.hasZ?t.readDouble():void 0,e.hasM?t.readDouble():void 0)},u._parseTwkb=function(t,e){var n=new u;return n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty||(n.x=s.decode(t.readVarInt())/e.precisionFactor,n.y=s.decode(t.readVarInt())/e.precisionFactor,n.z=e.hasZ?s.decode(t.readVarInt())/e.zPrecisionFactor:void 0,n.m=e.hasM?s.decode(t.readVarInt())/e.mPrecisionFactor:void 0),n},u._readTwkbPoint=function(t,e,n){return n.x+=s.decode(t.readVarInt())/e.precisionFactor,n.y+=s.decode(t.readVarInt())/e.precisionFactor,e.hasZ&&(n.z+=s.decode(t.readVarInt())/e.zPrecisionFactor),e.hasM&&(n.m+=s.decode(t.readVarInt())/e.mPrecisionFactor),new u(n.x,n.y,n.z,n.m)},u._parseGeoJSON=function(t){return u._readGeoJSONPoint(t.coordinates)},u._readGeoJSONPoint=function(t){return 0===t.length?new u:t.length>2?new u(t[0],t[1],t[2]):new u(t[0],t[1])},u.prototype.toWkt=function(){return void 0===this.x&&void 0===this.y&&void 0===this.z&&void 0===this.m?this._getWktType(o.wkt.Point,!0):this._getWktType(o.wkt.Point,!1)+"("+this._getWktCoordinate(this)+")"},u.prototype.toWkb=function(t){var e=new a(this._getWkbSize());return e.writeInt8(1),this._writeWkbType(e,o.wkb.Point,t),void 0===this.x&&void 0===this.y?(e.writeDoubleLE(NaN),e.writeDoubleLE(NaN),this.hasZ&&e.writeDoubleLE(NaN),this.hasM&&e.writeDoubleLE(NaN)):this._writeWkbPoint(e),e.buffer},u.prototype._writeWkbPoint=function(t){t.writeDoubleLE(this.x),t.writeDoubleLE(this.y),this.hasZ&&t.writeDoubleLE(this.z),this.hasM&&t.writeDoubleLE(this.m)},u.prototype.toTwkb=function(){var t=new a(0,!0),e=i.getTwkbPrecision(5,0,0),n=void 0===this.x&&void 0===this.y;return this._writeTwkbHeader(t,o.wkb.Point,e,n),n||this._writeTwkbPoint(t,e,new u(0,0,0,0)),t.buffer},u.prototype._writeTwkbPoint=function(t,e,n){var r=this.x*e.xyFactor,i=this.y*e.xyFactor,o=this.z*e.zFactor,a=this.m*e.mFactor;t.writeVarInt(s.encode(r-n.x)),t.writeVarInt(s.encode(i-n.y)),this.hasZ&&t.writeVarInt(s.encode(o-n.z)),this.hasM&&t.writeVarInt(s.encode(a-n.m)),n.x=r,n.y=i,n.z=o,n.m=a},u.prototype._getWkbSize=function(){var t=21;return this.hasZ&&(t+=8),this.hasM&&(t+=8),t},u.prototype.toGeoJSON=function(t){var e=i.prototype.toGeoJSON.call(this,t);return e.type=o.geoJSON.Point,void 0===this.x&&void 0===this.y?e.coordinates=[]:void 0!==this.z?e.coordinates=[this.x,this.y,this.z]:e.coordinates=[this.x,this.y],e}},978:(t,e,n)=>{t.exports=u;var r=n(9539),i=n(7056),o=n(4905),a=n(9213),s=n(2659);function u(t,e,n){i.call(this),this.exteriorRing=t||[],this.interiorRings=e||[],this.srid=n,this.exteriorRing.length>0&&(this.hasZ=this.exteriorRing[0].hasZ,this.hasM=this.exteriorRing[0].hasM)}r.inherits(u,i),u.Z=function(t,e,n){var r=new u(t,e,n);return r.hasZ=!0,r},u.M=function(t,e,n){var r=new u(t,e,n);return r.hasM=!0,r},u.ZM=function(t,e,n){var r=new u(t,e,n);return r.hasZ=!0,r.hasM=!0,r},u._parseWkt=function(t,e){var n=new u;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;for(t.expectGroupStart(),t.expectGroupStart(),n.exteriorRing.push.apply(n.exteriorRing,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),n.interiorRings.push(t.matchCoordinates(e)),t.expectGroupEnd();return t.expectGroupEnd(),n},u._parseWkb=function(t,e){var n=new u;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;var r=t.readUInt32();if(r>0){for(var i=t.readUInt32(),o=0;o<i;o++)n.exteriorRing.push(a._readWkbPoint(t,e));for(o=1;o<r;o++){for(var s=[],l=t.readUInt32(),c=0;c<l;c++)s.push(a._readWkbPoint(t,e));n.interiorRings.push(s)}}return n},u._parseTwkb=function(t,e){var n=new u;if(n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty)return n;for(var r=new a(0,0,e.hasZ?0:void 0,e.hasM?0:void 0),i=t.readVarInt(),o=t.readVarInt(),s=0;s<o;s++)n.exteriorRing.push(a._readTwkbPoint(t,e,r));for(s=1;s<i;s++){for(var l=[],c=t.readVarInt(),h=0;h<c;h++)l.push(a._readTwkbPoint(t,e,r));n.interiorRings.push(l)}return n},u._parseGeoJSON=function(t){var e=new u;t.coordinates.length>0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var n=0;n<t.coordinates.length;n++){n>0&&e.interiorRings.push([]);for(var r=0;r<t.coordinates[n].length;r++)0===n?e.exteriorRing.push(a._readGeoJSONPoint(t.coordinates[n][r])):e.interiorRings[n-1].push(a._readGeoJSONPoint(t.coordinates[n][r]))}return e},u.prototype.toWkt=function(){return 0===this.exteriorRing.length?this._getWktType(o.wkt.Polygon,!0):this._getWktType(o.wkt.Polygon,!1)+this._toInnerWkt()},u.prototype._toInnerWkt=function(){for(var t="((",e=0;e<this.exteriorRing.length;e++)t+=this._getWktCoordinate(this.exteriorRing[e])+",";for(t=t.slice(0,-1),t+=")",e=0;e<this.interiorRings.length;e++){t+=",(";for(var n=0;n<this.interiorRings[e].length;n++)t+=this._getWktCoordinate(this.interiorRings[e][n])+",";t=t.slice(0,-1),t+=")"}return t+")"},u.prototype.toWkb=function(t){var e=new s(this._getWkbSize());e.writeInt8(1),this._writeWkbType(e,o.wkb.Polygon,t),this.exteriorRing.length>0?(e.writeUInt32LE(1+this.interiorRings.length),e.writeUInt32LE(this.exteriorRing.length)):e.writeUInt32LE(0);for(var n=0;n<this.exteriorRing.length;n++)this.exteriorRing[n]._writeWkbPoint(e);for(n=0;n<this.interiorRings.length;n++){e.writeUInt32LE(this.interiorRings[n].length);for(var r=0;r<this.interiorRings[n].length;r++)this.interiorRings[n][r]._writeWkbPoint(e)}return e.buffer},u.prototype.toTwkb=function(){var t=new s(0,!0),e=i.getTwkbPrecision(5,0,0),n=0===this.exteriorRing.length;if(this._writeTwkbHeader(t,o.wkb.Polygon,e,n),this.exteriorRing.length>0){t.writeVarInt(1+this.interiorRings.length),t.writeVarInt(this.exteriorRing.length);for(var r=new a(0,0,0,0),u=0;u<this.exteriorRing.length;u++)this.exteriorRing[u]._writeTwkbPoint(t,e,r);for(u=0;u<this.interiorRings.length;u++){t.writeVarInt(this.interiorRings[u].length);for(var l=0;l<this.interiorRings[u].length;l++)this.interiorRings[u][l]._writeTwkbPoint(t,e,r)}}return t.buffer},u.prototype._getWkbSize=function(){var t=16;this.hasZ&&(t+=8),this.hasM&&(t+=8);var e=9;this.exteriorRing.length>0&&(e+=4+this.exteriorRing.length*t);for(var n=0;n<this.interiorRings.length;n++)e+=4+this.interiorRings[n].length*t;return e},u.prototype.toGeoJSON=function(t){var e=i.prototype.toGeoJSON.call(this,t);if(e.type=o.geoJSON.Polygon,e.coordinates=[],this.exteriorRing.length>0){for(var n=[],r=0;r<this.exteriorRing.length;r++)this.hasZ?n.push([this.exteriorRing[r].x,this.exteriorRing[r].y,this.exteriorRing[r].z]):n.push([this.exteriorRing[r].x,this.exteriorRing[r].y]);e.coordinates.push(n)}for(var a=0;a<this.interiorRings.length;a++){for(var s=[],u=0;u<this.interiorRings[a].length;u++)this.hasZ?s.push([this.interiorRings[a][u].x,this.interiorRings[a][u].y,this.interiorRings[a][u].z]):s.push([this.interiorRings[a][u].x,this.interiorRings[a][u].y]);e.coordinates.push(s)}return e}},4905:t=>{t.exports={wkt:{Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION"},wkb:{Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6,GeometryCollection:7},geoJSON:{Point:"Point",LineString:"LineString",Polygon:"Polygon",MultiPoint:"MultiPoint",MultiLineString:"MultiLineString",MultiPolygon:"MultiPolygon",GeometryCollection:"GeometryCollection"}}},2620:(t,e,n)=>{t.exports=o;var r=n(4905),i=n(9213);function o(t){this.value=t,this.position=0}o.prototype.match=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++)if(0===this.value.substring(this.position).indexOf(t[e]))return this.position+=t[e].length,t[e];return null},o.prototype.matchRegex=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++){var n=this.value.substring(this.position).match(t[e]);if(n)return this.position+=n[0].length,n}return null},o.prototype.isMatch=function(t){this.skipWhitespaces();for(var e=0;e<t.length;e++)if(0===this.value.substring(this.position).indexOf(t[e]))return this.position+=t[e].length,!0;return!1},o.prototype.matchType=function(){var t=this.match([r.wkt.Point,r.wkt.LineString,r.wkt.Polygon,r.wkt.MultiPoint,r.wkt.MultiLineString,r.wkt.MultiPolygon,r.wkt.GeometryCollection]);if(!t)throw new Error("Expected geometry type");return t},o.prototype.matchDimension=function(){switch(this.match(["ZM","Z","M"])){case"ZM":return{hasZ:!0,hasM:!0};case"Z":return{hasZ:!0,hasM:!1};case"M":return{hasZ:!1,hasM:!0};default:return{hasZ:!1,hasM:!1}}},o.prototype.expectGroupStart=function(){if(!this.isMatch(["("]))throw new Error("Expected group start")},o.prototype.expectGroupEnd=function(){if(!this.isMatch([")"]))throw new Error("Expected group end")},o.prototype.matchCoordinate=function(t){var e;if(!(e=t.hasZ&&t.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+(\S*)\s+([^\s,)]*)/]):t.hasZ||t.hasM?this.matchRegex([/^(\S*)\s+(\S*)\s+([^\s,)]*)/]):this.matchRegex([/^(\S*)\s+([^\s,)]*)/])))throw new Error("Expected coordinates");return t.hasZ&&t.hasM?new i(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])):t.hasZ?new i(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])):t.hasM?new i(parseFloat(e[1]),parseFloat(e[2]),void 0,parseFloat(e[3])):new i(parseFloat(e[1]),parseFloat(e[2]))},o.prototype.matchCoordinates=function(t){var e=[];do{var n=this.isMatch(["("]);e.push(this.matchCoordinate(t)),n&&this.expectGroupEnd()}while(this.isMatch([","]));return e},o.prototype.skipWhitespaces=function(){for(;this.position<this.value.length&&" "===this.value[this.position];)this.position++}},1011:(t,e,n)=>{e.Types=n(4905),e.Geometry=n(7056),e.Point=n(9213),e.LineString=n(9645),e.Polygon=n(978),e.MultiPoint=n(1665),e.MultiLineString=n(9606),e.MultiPolygon=n(9763),e.GeometryCollection=n(2292)},3172:t=>{t.exports={encode:function(t){return t<<1^t>>31},decode:function(t){return t>>1^-(1&t)}}},7529:t=>{t.exports=function(){for(var t={},n=0;n<arguments.length;n++){var r=arguments[n];for(var i in r)e.call(r,i)&&(t[i]=r[i])}return t};var e=Object.prototype.hasOwnProperty},3730:t=>{"use strict";if(void 0===__WEBPACK_EXTERNAL_MODULE__3730__){var e=new Error("Cannot find module 'better-sqlite3'");throw e.code="MODULE_NOT_FOUND",e}t.exports=__WEBPACK_EXTERNAL_MODULE__3730__},5699:()=>{},4919:()=>{},1929:()=>{},2203:()=>{},7990:()=>{},8497:()=>{},1408:()=>{},3646:()=>{}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__={};return(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),t.OffscreenCanvasAdapter=t.NumberFeaturesTile=t.MetadataReference=t.MetadataExtension=t.MetadataDao=t.Metadata=t.MediaTable=t.ImageUtils=t.IconTable=t.Icons=t.IconCache=t.HtmlCanvasAdapter=t.GeoPackageValidate=t.GeoPackageTileRetriever=t.GeoPackageDataType=t.GeoPackageConnection=t.GeoPackageAPI=t.GeoPackage=t.GeometryData=t.GeometryColumnsDao=t.GeometryColumns=t.GeometryType=t.FeatureTiles=t.FeatureTableStyles=t.FeatureTableReader=t.FeatureTableIndex=t.FeatureTable=t.FeatureStyles=t.FeatureStyleExtension=t.FeatureStyle=t.FeaturePaint=t.FeatureDrawType=t.FeatureColumn=t.Extension=t.DublinCoreType=t.DublinCoreMetadata=t.DataColumnsDao=t.DataColumns=t.DataColumnConstraintsDao=t.DataColumnConstraints=t.CrsWktExtension=t.Context=t.ConstraintType=t.Constraints=t.Constraint=t.ContentsIdDao=t.ContentsDao=t.CanvasKitCanvasAdapter=t.Canvas=t.BoundingBox=void 0,t.WKB=t.WebPExtension=t.UserTableReader=t.UserTable=t.UserRow=t.UserMappingTable=t.UserDao=t.UserColumn=t.TileUtilities=t.TileTable=t.TileScalingType=t.TileScaling=t.TileMatrixSet=t.TileMatrix=t.TileColumn=t.TileBoundingBoxUtils=t.TileCreator=t.TableCreator=t.StyleTable=t.Styles=t.SqljsAdapter=t.StyleMappingTable=t.SqliteQueryBuilder=t.SqliteAdapter=t.SpatialReferenceSystem=t.SimpleAttributesTable=t.ShadedFeaturesTile=t.SchemaExtension=t.setSqljsWasmLocateFile=t.setCanvasKitWasmLocateFile=t.RTreeIndexDao=t.RTreeIndex=t.RelatedTablesExtension=t.ProjectionConstants=t.Projection=t.Paint=t.OptionBuilder=void 0;var e=__webpack_require__(2527);Object.defineProperty(t,"BoundingBox",{enumerable:!0,get:function(){return e.BoundingBox}});var n=__webpack_require__(4325);Object.defineProperty(t,"GeoPackage",{enumerable:!0,get:function(){return n.GeoPackage}});var r=__webpack_require__(6638);Object.defineProperty(t,"ContentsDao",{enumerable:!0,get:function(){return r.ContentsDao}});var i=__webpack_require__(7092);Object.defineProperty(t,"ContentsIdDao",{enumerable:!0,get:function(){return i.ContentsIdDao}});var o=__webpack_require__(8007);Object.defineProperty(t,"Constraint",{enumerable:!0,get:function(){return o.Constraint}});var a=__webpack_require__(7686);Object.defineProperty(t,"Constraints",{enumerable:!0,get:function(){return a.Constraints}});var s=__webpack_require__(91);Object.defineProperty(t,"ConstraintType",{enumerable:!0,get:function(){return s.ConstraintType}});var u=__webpack_require__(5306);Object.defineProperty(t,"CrsWktExtension",{enumerable:!0,get:function(){return u.CrsWktExtension}});var l=__webpack_require__(8590);Object.defineProperty(t,"DataColumnConstraints",{enumerable:!0,get:function(){return l.DataColumnConstraints}});var c=__webpack_require__(7175);Object.defineProperty(t,"DataColumnConstraintsDao",{enumerable:!0,get:function(){return c.DataColumnConstraintsDao}});var h=__webpack_require__(8133);Object.defineProperty(t,"DataColumns",{enumerable:!0,get:function(){return h.DataColumns}});var f=__webpack_require__(7319);Object.defineProperty(t,"GeoPackageDataType",{enumerable:!0,get:function(){return f.GeoPackageDataType}});var p=__webpack_require__(4941);Object.defineProperty(t,"DataColumnsDao",{enumerable:!0,get:function(){return p.DataColumnsDao}});var d=__webpack_require__(3096);Object.defineProperty(t,"DublinCoreMetadata",{enumerable:!0,get:function(){return d.DublinCoreMetadata}});var y=__webpack_require__(1485);Object.defineProperty(t,"DublinCoreType",{enumerable:!0,get:function(){return y.DublinCoreType}});var m=__webpack_require__(624);Object.defineProperty(t,"Extension",{enumerable:!0,get:function(){return m.Extension}});var g=__webpack_require__(961);Object.defineProperty(t,"FeatureColumn",{enumerable:!0,get:function(){return g.FeatureColumn}});var _=__webpack_require__(4538);Object.defineProperty(t,"FeatureDrawType",{enumerable:!0,get:function(){return _.FeatureDrawType}});var b=__webpack_require__(6063);Object.defineProperty(t,"FeaturePaint",{enumerable:!0,get:function(){return b.FeaturePaint}});var v=__webpack_require__(612);Object.defineProperty(t,"FeatureStyle",{enumerable:!0,get:function(){return v.FeatureStyle}});var T=__webpack_require__(8479);Object.defineProperty(t,"FeatureStyleExtension",{enumerable:!0,get:function(){return T.FeatureStyleExtension}});var E=__webpack_require__(2752);Object.defineProperty(t,"FeatureStyles",{enumerable:!0,get:function(){return E.FeatureStyles}});var w=__webpack_require__(8412);Object.defineProperty(t,"FeatureTable",{enumerable:!0,get:function(){return w.FeatureTable}});var x=__webpack_require__(5626);Object.defineProperty(t,"FeatureTableIndex",{enumerable:!0,get:function(){return x.FeatureTableIndex}});var C=__webpack_require__(4896);Object.defineProperty(t,"FeatureTableReader",{enumerable:!0,get:function(){return C.FeatureTableReader}});var M=__webpack_require__(6536);Object.defineProperty(t,"FeatureTableStyles",{enumerable:!0,get:function(){return M.FeatureTableStyles}});var S=__webpack_require__(297);Object.defineProperty(t,"FeatureTiles",{enumerable:!0,get:function(){return S.FeatureTiles}});var N=__webpack_require__(812);Object.defineProperty(t,"GeometryColumns",{enumerable:!0,get:function(){return N.GeometryColumns}});var O=__webpack_require__(1968);Object.defineProperty(t,"GeometryColumnsDao",{enumerable:!0,get:function(){return O.GeometryColumnsDao}});var A=__webpack_require__(857);Object.defineProperty(t,"GeometryData",{enumerable:!0,get:function(){return A.GeometryData}});var I=__webpack_require__(9211);Object.defineProperty(t,"GeometryType",{enumerable:!0,get:function(){return I.GeometryType}});var P=__webpack_require__(1191);Object.defineProperty(t,"GeoPackageAPI",{enumerable:!0,get:function(){return P.GeoPackageAPI}});var R=__webpack_require__(5116);Object.defineProperty(t,"GeoPackageConnection",{enumerable:!0,get:function(){return R.GeoPackageConnection}});var L=__webpack_require__(731);Object.defineProperty(t,"GeoPackageTileRetriever",{enumerable:!0,get:function(){return L.GeoPackageTileRetriever}});var D=__webpack_require__(4275);Object.defineProperty(t,"GeoPackageValidate",{enumerable:!0,get:function(){return D.GeoPackageValidate}});var k=__webpack_require__(8600);Object.defineProperty(t,"IconCache",{enumerable:!0,get:function(){return k.IconCache}});var F=__webpack_require__(4725);Object.defineProperty(t,"Icons",{enumerable:!0,get:function(){return F.Icons}});var U=__webpack_require__(2015);Object.defineProperty(t,"IconTable",{enumerable:!0,get:function(){return U.IconTable}});var B=__webpack_require__(9325);Object.defineProperty(t,"ImageUtils",{enumerable:!0,get:function(){return B.ImageUtils}});var j=__webpack_require__(6366);Object.defineProperty(t,"MediaTable",{enumerable:!0,get:function(){return j.MediaTable}});var G=__webpack_require__(3026);Object.defineProperty(t,"Metadata",{enumerable:!0,get:function(){return G.Metadata}});var W=__webpack_require__(663);Object.defineProperty(t,"MetadataDao",{enumerable:!0,get:function(){return W.MetadataDao}});var q=__webpack_require__(3501);Object.defineProperty(t,"MetadataExtension",{enumerable:!0,get:function(){return q.MetadataExtension}});var H=__webpack_require__(9173);Object.defineProperty(t,"MetadataReference",{enumerable:!0,get:function(){return H.MetadataReference}});var z=__webpack_require__(3060);Object.defineProperty(t,"NumberFeaturesTile",{enumerable:!0,get:function(){return z.NumberFeaturesTile}});var V=__webpack_require__(7403);Object.defineProperty(t,"OptionBuilder",{enumerable:!0,get:function(){return V.OptionBuilder}});var X=__webpack_require__(5211);Object.defineProperty(t,"Paint",{enumerable:!0,get:function(){return X.Paint}});var Y=__webpack_require__(5604);Object.defineProperty(t,"Projection",{enumerable:!0,get:function(){return Y.Projection}});var Z=__webpack_require__(1375);Object.defineProperty(t,"ProjectionConstants",{enumerable:!0,get:function(){return Z.ProjectionConstants}});var Q=__webpack_require__(1832);Object.defineProperty(t,"RelatedTablesExtension",{enumerable:!0,get:function(){return Q.RelatedTablesExtension}});var K=__webpack_require__(5859);Object.defineProperty(t,"RTreeIndex",{enumerable:!0,get:function(){return K.RTreeIndex}});var J=__webpack_require__(735);Object.defineProperty(t,"RTreeIndexDao",{enumerable:!0,get:function(){return J.RTreeIndexDao}});var $=__webpack_require__(8116);Object.defineProperty(t,"SchemaExtension",{enumerable:!0,get:function(){return $.SchemaExtension}});var tt=__webpack_require__(6667);Object.defineProperty(t,"ShadedFeaturesTile",{enumerable:!0,get:function(){return tt.ShadedFeaturesTile}});var et=__webpack_require__(4599);Object.defineProperty(t,"SimpleAttributesTable",{enumerable:!0,get:function(){return et.SimpleAttributesTable}});var nt=__webpack_require__(341);Object.defineProperty(t,"SpatialReferenceSystem",{enumerable:!0,get:function(){return nt.SpatialReferenceSystem}});var rt=__webpack_require__(8877);Object.defineProperty(t,"SqliteQueryBuilder",{enumerable:!0,get:function(){return rt.SqliteQueryBuilder}});var it=__webpack_require__(8138);Object.defineProperty(t,"StyleMappingTable",{enumerable:!0,get:function(){return it.StyleMappingTable}});var ot=__webpack_require__(7924);Object.defineProperty(t,"Styles",{enumerable:!0,get:function(){return ot.Styles}});var at=__webpack_require__(3934);Object.defineProperty(t,"StyleTable",{enumerable:!0,get:function(){return at.StyleTable}});var st=__webpack_require__(1459);Object.defineProperty(t,"TableCreator",{enumerable:!0,get:function(){return st.TableCreator}});var ut=__webpack_require__(3684);Object.defineProperty(t,"TileBoundingBoxUtils",{enumerable:!0,get:function(){return ut.TileBoundingBoxUtils}});var lt=__webpack_require__(8334);Object.defineProperty(t,"TileColumn",{enumerable:!0,get:function(){return lt.TileColumn}});var ct=__webpack_require__(1938);Object.defineProperty(t,"TileMatrix",{enumerable:!0,get:function(){return ct.TileMatrix}});var ht=__webpack_require__(5899);Object.defineProperty(t,"TileMatrixSet",{enumerable:!0,get:function(){return ht.TileMatrixSet}});var ft=__webpack_require__(4301);Object.defineProperty(t,"TileScaling",{enumerable:!0,get:function(){return ft.TileScaling}});var pt=__webpack_require__(2777);Object.defineProperty(t,"TileScalingType",{enumerable:!0,get:function(){return pt.TileScalingType}});var dt=__webpack_require__(8704);Object.defineProperty(t,"TileTable",{enumerable:!0,get:function(){return dt.TileTable}});var yt=__webpack_require__(824);Object.defineProperty(t,"TileUtilities",{enumerable:!0,get:function(){return yt.TileUtilities}});var mt=__webpack_require__(5865);Object.defineProperty(t,"UserColumn",{enumerable:!0,get:function(){return mt.UserColumn}});var gt=__webpack_require__(4668);Object.defineProperty(t,"UserDao",{enumerable:!0,get:function(){return gt.UserDao}});var _t=__webpack_require__(233);Object.defineProperty(t,"UserMappingTable",{enumerable:!0,get:function(){return _t.UserMappingTable}});var bt=__webpack_require__(2224);Object.defineProperty(t,"UserRow",{enumerable:!0,get:function(){return bt.UserRow}});var vt=__webpack_require__(8018);Object.defineProperty(t,"UserTable",{enumerable:!0,get:function(){return vt.UserTable}});var Tt=__webpack_require__(4880);Object.defineProperty(t,"UserTableReader",{enumerable:!0,get:function(){return Tt.UserTableReader}});var Et=__webpack_require__(7719);Object.defineProperty(t,"WebPExtension",{enumerable:!0,get:function(){return Et.WebPExtension}});var wt=__webpack_require__(2038);Object.defineProperty(t,"WKB",{enumerable:!0,get:function(){return wt.WKB}});var xt=__webpack_require__(922);Object.defineProperty(t,"SqliteAdapter",{enumerable:!0,get:function(){return xt.SqliteAdapter}});var Ct=__webpack_require__(5849);Object.defineProperty(t,"SqljsAdapter",{enumerable:!0,get:function(){return Ct.SqljsAdapter}});var Mt=__webpack_require__(7977);Object.defineProperty(t,"TileCreator",{enumerable:!0,get:function(){return Mt.TileCreator}});var St=__webpack_require__(3437);Object.defineProperty(t,"Canvas",{enumerable:!0,get:function(){return St.Canvas}});var Nt=__webpack_require__(8038);Object.defineProperty(t,"CanvasKitCanvasAdapter",{enumerable:!0,get:function(){return Nt.CanvasKitCanvasAdapter}});var Ot=__webpack_require__(342);Object.defineProperty(t,"OffscreenCanvasAdapter",{enumerable:!0,get:function(){return Ot.OffscreenCanvasAdapter}});var At=__webpack_require__(2807);Object.defineProperty(t,"HtmlCanvasAdapter",{enumerable:!0,get:function(){return At.HtmlCanvasAdapter}});var It=__webpack_require__(1150);Object.defineProperty(t,"Context",{enumerable:!0,get:function(){return It.Context}}),It.Context.setupDefaultContext();var Pt=Ct.SqljsAdapter.setSqljsWasmLocateFile;t.setSqljsWasmLocateFile=Pt;var Rt=Nt.CanvasKitCanvasAdapter.setCanvasKitWasmLocateFile;t.setCanvasKitWasmLocateFile=Rt})(),__webpack_exports__})()}));
//# sourceMappingURL=geopackage.min.js.map