text: (function(){(this||window).webpackJsonp.registerAbsMids({"esri/views/2d/RenderingCore2D":1457,"esri/views/3d/webgl-engine/lib/Util":1470,"esri/views/webgl/FramebufferObject":1473,"esri/views/webgl/capabilities/isWebGL2Context":1491,"esri/views/3d/support/imageUtils":1513,"esri/views/2d/engine/webgl/definitions":1517,"esri/views/vectorTiles/GeometryUtils":1523,"esri/views/webgl/Renderbuffer":1524,"esri/views/2d/engine/DisplayObject":1528,"esri/views/2d/engine/Container":1539,"esri/views/2d/engine/Evented":1553,"esri/views/webgl/RenderingContext":1560,"esri/views/webgl/enums":1561,"esri/views/webgl/InstanceCounter":1562,"esri/views/webgl/capabilities/load":1563,"esri/views/webgl/capabilities/DisjointTimerQuery":1564,"esri/views/webgl/capabilities/Instancing":1565,"esri/views/webgl/capabilities/VertexArrayObjects":1566,"esri/views/2d/engine/webgl/Rect":1640,"esri/views/2d/engine/webgl/Geometry":1643,"esri/views/2d/layers/graphics/graphicsUtils":1645,"esri/views/2d/engine/webgl/GeometryUtils":1647,"esri/views/2d/engine/webgl/WGLDisplayList":1648,"esri/views/2d/layers/features/support/Tile":1663,"esri/views/2d/engine/webgl/TileClipper":1666,"esri/views/2d/support/Evented":1668,"esri/views/2d/engine/webgl/shaders/sources/resolver":1729,"esri/views/2d/engine/webgl/WGLRendererInfo":1731,"esri/views/2d/engine/webgl/TileData":1732,"esri/views/2d/engine/webgl/MemoryRequirements":1733,"esri/views/2d/engine/webgl/TileBufferData":1734,"esri/views/2d/engine/webgl/TileDisplayData":1735,"esri/views/2d/engine/webgl/util/Reader":1736,"esri/views/2d/engine/webgl/WGLTile":1738,"esri/views/2d/engine/webgl/DirtyMap":1739,"esri/views/2d/engine/webgl/DisplayRecordStore":1740,"esri/views/2d/engine/webgl/FreeList":1741,"esri/views/2d/engine/webgl/Fader":1742,"esri/views/2d/engine/webgl/WGLBuffers":1743,"esri/views/2d/engine/webgl/util/vvFlagUtils":1744,"esri/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate":1745,"esri/views/2d/layers/features/support/TileStore":1746,"esri/views/2d/engine/webgl/util/iterator":1762,"esri/views/2d/engine/webgl/util/BidiText":1763,"esri/views/2d/layers/support/GraphicsView2D":1776,"esri/views/2d/engine/webgl/GraphicContainer":1777,"esri/views/2d/engine/webgl/TextShaping":1780,"esri/views/2d/engine/webgl/LineTess":1781,"esri/views/2d/layers/graphics/GraphicProcessingQueue":1783,"esri/views/2d/layers/graphics/GraphicStore":1784,"esri/views/2d/layers/graphics/GraphicStoreItem":1785,"esri/views/layers/GraphicsView":1786,"esri/views/2d/engine/webgl/shaders/MaterialPrograms":1807,"esri/views/2d/engine/webgl/fontUtils":1808,"esri/core/MapPool":1809,"esri/views/2d/engine/webgl/mesh/factories/matcherUtils":1810,"esri/views/2d/engine/webgl/mesh/factories/WGLMeshFactory":1811,"esri/views/2d/engine/webgl/mesh/templates/WGLTemplateStore":1812,"esri/views/2d/engine/webgl/brushes/WGLGeometryBrush":1827,"esri/views/2d/engine/webgl/mesh/templates/ComputedGlyph":1830,"esri/views/2d/engine/webgl/mesh/templates/util":1831,"esri/views/2d/engine/webgl/mesh/templates/WGLTextTemplate":1832,"esri/views/2d/engine/webgl/TextShapingNew":1833,"esri/views/2d/engine/webgl/mesh/templates/WGLLineTemplate":1835,"esri/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate":1836,"esri/views/2d/engine/webgl/BitBlitRenderer":1878,"esri/views/2d/engine/webgl/collisions/LayerCollisionInfo":1880,"esri/views/2d/engine/webgl/shaders/BitBlitPrograms":1908,"esri/views/2d/engine/webgl/shaders/sources/shaderRepository":1909,"esri/views/2d/engine/webgl/SDFHelper":1911,"esri/views/2d/engine/webgl/brushes/WGLBrush":1913,"esri/views/2d/engine/webgl/util/Matcher":1915,"esri/views/2d/engine/webgl/mesh/MeshData":1916,"esri/views/2d/engine/webgl/mesh/VertexVector":1917,"esri/views/2d/engine/webgl/mesh/factories/VVFactory":1918,"esri/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate":1919,"esri/views/2d/engine/webgl/mesh/templates/GlyphGroup":1920,"esri/geometry/support/boundsUtils":1921,"esri/views/2d/engine/webgl/mesh/templates/WGLFillTemplate":1922,"esri/views/2d/engine/webgl/mesh/Tesselator":1923,"esri/core/libs/libtess/libtess":1924,"esri/views/2d/engine/webgl/util/Lock":1925,"esri/views/navigation/Momentum":1926,"esri/views/2d/engine/webgl/RectangleBinPack":1995,"esri/views/2d/engine/webgl/shaders/BackgroundPrograms":1996,"esri/views/navigation/FilteredFiniteDifference":1997,"esri/views/navigation/MomentumEstimator":1998,"esri/views/2d/engine/Stage":2272,"esri/views/2d/engine/webgl/Painter":2280,"esri/views/2d/engine/webgl/MaterialManager":2281,"esri/views/2d/engine/webgl/TextureManager":2283,"esri/views/2d/engine/webgl/CIMSymbolHelper":2284,"esri/views/2d/engine/webgl/CIMSymbolDrawHelper":2285,"esri/views/2d/engine/webgl/GlyphMosaic":2286,"esri/views/2d/engine/webgl/GlyphSource":2287,"esri/views/2d/engine/webgl/SDFConverter":2288,"esri/views/2d/engine/webgl/SpriteMosaic":2289,"esri/views/2d/engine/webgl/VertexStream":2290,"esri/views/2d/engine/webgl/brushes/WGLBrushInfo":2291,"esri/views/2d/engine/webgl/shaders/TileInfoPrograms":2292,"esri/views/2d/engine/webgl/brushes/WGLBrushStencil":2293,"esri/views/2d/engine/webgl/brushes/WGLGeometryBrushFill":2294,"esri/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel":2295,"esri/views/2d/engine/webgl/brushes/WGLGeometryBrushLine":2296,"esri/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker":2297,"esri/views/2d/engine/webgl/brushes/WGLGeometryBrushText":2298,"esri/views/2d/engine/webgl/painter/WGLHighlightPainter":2299,"esri/views/2d/engine/webgl/painter/highlight/HighlightRenderer":2300,"esri/views/2d/engine/webgl/shaders/HighlightPrograms":2301,"esri/views/2d/engine/webgl/painter/highlight/HighlightSurfaces":2302,"esri/views/2d/engine/webgl/shaders/RasterPrograms":2303,"esri/views/2d/engine/webgl/shaders/StencilPrograms":2304,"esri/views/2d/LabelManager":2305,"esri/views/2d/engine/webgl/collisions/CollisionEngine":2306,"esri/views/2d/engine/webgl/collisions/CollisionBucket":2307,"esri/views/2d/engine/webgl/collisions/CollisionBucketEntry":2308,"esri/views/2d/engine/webgl/collisions/LayerViewSorter":2309,"esri/views/2d/navigation/MapViewNavigation":2314,"esri/views/2d/navigation/ZoomBox":2315,"esri/views/2d/navigation/actions/Pan":2316,"esri/views/navigation/PanPlanarMomentumEstimator":2317,"esri/views/2d/navigation/actions/Pinch":2318,"esri/views/navigation/RotationMomentumEstimator":2319,"esri/views/navigation/ZoomMomentumEstimator":2320,"esri/views/2d/navigation/actions/Rotate":2321})})(),(window.webpackJsonp=window.webpackJsonp||[]).push([[47,9],{1457:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(2272),i(2305),i(1776),i(2314)],void 0===(n=function(e,t,i,r,n,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=i.Stage,t.LabelManager=r.default,t.GraphicsView2D=n.default,t.MapViewNavigation=o.default}.apply(null,r))||(e.exports=n)},1470:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(36),i(90)],void 0===(n=function(e,t,i,r){function n(e,t){if(!e){var i=new Error("dummy");throw i.stack&&console.log(i.stack),new v(t)}}function o(e){for(var t in e)return t}function s(e,t){e[12]=t[0],e[13]=t[1],e[14]=t[2]}function a(e,t){void 0===t&&(t=0);for(var i=0,r=0;r<4;r++)i+=e[t+r]*g[r];return i}function l(e){return e-Math.floor(e)}Object.defineProperty(t,"__esModule",{value:!0});var u=i.vec4f64.create(),h=i.vec2f64.create(),c=i.vec2f64.create(),d=i.vec2f64.create(),f=i.vec2f64.create(),p=i.vec2f64.create(),_=i.vec2f64.create(),v=function(){function e(e){this.message=e}return e.prototype.toString=function(){return"AssertException: "+this.message},e}();t.AssertException=v,t.VertexAttrConstants={POSITION:"position",NORMAL:"normal",NORMALCOMPRESSED:"normalCompressed",UV0:"uv0",AUXPOS1:"auxpos1",AUXPOS2:"auxpos2",COLOR:"color",SYMBOLCOLOR:"symbolColor",SIZE:"size",REGION:"region",COMPONENTINDEX:"componentIndex"},t.assert=n,t.verify=function(e,t){e||(console.log("Verify failed: "+t),console.log(new Error("dummy").stack))},t.encodeInt16=function(e){return r.clamp(Math.round(32767*e),-32767,32767)},t.encodeNormal=function(e,t){var i=Math.abs(e[0]),r=Math.abs(e[1]),n=1/(i+r+Math.abs(e[2])),o=i*n,s=r*n,a=Math.min(e[2]*n,0);t[0]=(e[0]<0?-1:1)*(o-a),t[1]=(e[1]<0?-1:1)*(s-a)},t.fallbackIfUndefined=function(e,t){return void 0===e?t:e},t.hex2rgb=function(e){return[((e=Math.floor(e))>>16&255)/255,(e>>8&255)/255,(255&e)/255]},t.rgb2hex=function(e){return"0x"+((r.clamp(Math.round(255*e[0]),0,255)<<16)+(r.clamp(Math.round(255*e[1]),0,255)<<8)+r.clamp(Math.round(255*e[2]),0,255)).toString(16)},t.dec2hex=function(e){var t=e.toString(16);return"00000000".substr(0,8-t.length)+t},t.rayTriangle3D=function(e,t,r,n,o,s,a,l,u){void 0===u&&(u=i.vec3f64.create());var h=n[a]-r[s],c=n[a+1]-r[s+1],d=n[a+2]-r[s+2],f=o[l]-r[s],p=o[l+1]-r[s+1],_=o[l+2]-r[s+2],v=t[1]*_-p*t[2],m=t[2]*f-_*t[0],g=t[0]*p-f*t[1],y=h*v+c*m+d*g;if(y>-1e-5&&y<1e-5)return!1;var x=1/y,b=e[0]-r[s],S=e[1]-r[s+1],T=e[2]-r[s+2];if(u[1]=x*(b*v+S*m+T*g),u[1]<0||u[1]>1)return!1;var w=S*d-c*T,E=T*h-d*b,V=b*c-h*S;return u[2]=x*(t[0]*w+t[1]*E+t[2]*V),!(u[2]<0||u[1]+u[2]>1||(u[0]=x*(f*w+p*E+_*V),0))},t.rayBoxTest=function(e,t,i,r){var n,o=(i[0]-e[0])/t[0],s=(r[0]-e[0])/t[0];o>s&&(n=o,o=s,s=n);var a=(i[1]-e[1])/t[1],l=(r[1]-e[1])/t[1];if(a>l&&(n=a,a=l,l=n),o>l||a>s)return!1;a>o&&(o=a),l<s&&(s=l);var u=(i[2]-e[2])/t[2],h=(r[2]-e[2])/t[2];return u>h&&(n=u,u=h,h=n),!(o>h||u>s||(h<s&&(s=h),s<0))},t.rayRay2D=function(e,t,r,n,o,s){void 0===s&&(s=i.vec2f64.create());var a=(n[o]-r[o])*(t[0]-e[0])-(n[0]-r[0])*(t[o]-e[o]),l=(n[0]-r[0])*(e[o]-r[o])-(n[o]-r[o])*(e[0]-r[0]);if(0===a)return!1;var u=l/a;return s[0]=e[0]+u*(t[0]-e[0]),s[1]=e[o]+u*(t[o]-e[o]),!0},t.project=function(e,t,r,o,s){s||(s=e),u[0]=e[0],u[1]=e[1],u[2]=e[2],u[3]=1,i.vec4.transformMat4(u,u,t),s.length>2&&(s[2]=-u[2]),i.vec4.transformMat4(u,u,r),n(0!==u[3]),s[0]=u[0]/u[3],s[1]=u[1]/u[3],s[2]=u[2]/u[3],s[0]=(.5*s[0]+.5)*o[2]+o[0],s[1]=(.5*s[1]+.5)*o[3]+o[1]},t.getFirstObjectKey=o,t.getFirstObjectValue=function(e){return e[o(e)]},t.objectEmpty=function(e){for(var t in e)return!1;return!0},t.logWithBase=function(e,t){return Math.log(e)/Math.log(t)},t.setMatrixTranslation=s,t.setMatrixTranslation3=function(e,t,i,r){e[12]=t,e[13]=i,e[14]=r},t.getMatrixTranslation=function(e,t){return void 0===t&&(t=i.vec3f64.create()),t[0]=e[12],t[1]=e[13],t[2]=e[14],t},t.createTranslationMatrix=function(e,t){return s(e=i.mat4.identity(e),t),e},t.isTranslationMatrix=function(e){return 1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&1===e[15]},t.fovx2fovy=function(e,t,i){return 2*Math.atan(i*Math.tan(.5*e)/t)},t.fovy2fovx=function(e,t,i){return 2*Math.atan(t*Math.tan(.5*e)/i)},t.fovx2fovd=function(e,t,i){return 2*Math.atan(Math.sqrt(t*t+i*i)*Math.tan(.5*e)/t)},t.fovy2fovd=function(e,t,i){return 2*Math.atan(Math.sqrt(t*t+i*i)*Math.tan(.5*e)/i)},t.fovd2fovx=function(e,t,i){return 2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+i*i))},t.fovd2fovy=function(e,t,i){return 2*Math.atan(i*Math.tan(.5*e)/Math.sqrt(t*t+i*i))},t.pointLineSegmentDistanceSquared2D=function(e,t,n){var o=f,s=p,a=_,l=d,u=h,v=c;o[0]=t[0]-e[0],o[1]=t[1]-e[1],s[0]=n[0]-e[0],s[1]=n[1]-e[1],a[0]=n[0],a[1]=n[1];var m=i.vec2.dot(s,o),g=i.vec2.dot(o,o),y=r.clamp(m/g,0,1);l[0]=o[0]*y,l[1]=o[1]*y,u[0]=e[0]+l[0],u[1]=e[1]+l[1],i.vec2.subtract(v,a,u);var x=i.vec2.dot(v,v),b=i.vec2.dot(s,s),S=i.vec2.dot(o,o),T=i.vec2.dot(l,l);return(T>b||T>S)&&(x=Number.MAX_VALUE),x},t.packFloatRGBA=function(e,t,i){void 0===i&&(i=0);for(var n=r.clamp(e,0,y),o=0;o<4;o++)t[i+o]=Math.floor(256*l(n*m[o]))},t.unpackFloatRGBA=a;var m=[1,256,65536,16777216],g=[1/256,1/65536,1/16777216,1/4294967296],y=a(new Uint8ClampedArray([255,255,255,255]));t.inverseProjectionInfo=function(e,t,r,n,o){var s=e;0===e[11]?(n[0]=2/(t*s[0]),n[1]=2/(r*s[5]),n[2]=(1+s[12])/s[0],n[3]=(1+s[13])/s[5],i.vec2.set(o,0,1)):(n[0]=-2/(t*s[0]),n[1]=-2/(r*s[5]),n[2]=(1-s[8])/s[0],n[3]=(1-s[9])/s[5],i.vec2.set(o,1,0))}}.apply(null,r))||(e.exports=n)},1473:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(18),i(1524),i(1471)],void 0===(n=function(e,t,i,r,n){return function(){function e(t,o,s,a){if(this._context=null,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachment=null,this._initialized=!1,this._context=t,this._desc={colorTarget:o.colorTarget,depthStencilTarget:o.depthStencilTarget,width:o.width,height:o.height,multisampled:o.multisampled},this._id=e._nextId++,i("esri-webgl-debug")&&t.instanceCounter.incrementCount(4),s){var l=void 0;s instanceof n?(this._colorAttachment=s,l=s.descriptor):(l=s,this._colorAttachment=new n(this._context,l)),0!==this._desc.colorTarget&&console.error("Framebuffer is initialized with a texture however the descriptor indicates using a renderbuffer color attachment!"),e._validateTextureDimensions(l,this._desc)}if(a instanceof r)2===o.depthStencilTarget?this._stencilAttachment=a:1===o.depthStencilTarget||3===o.depthStencilTarget?this._depthAttachment=a:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),e._validateBufferDimensions(a.descriptor,this._desc);else if(a){this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");var u=void 0;a instanceof n?(this._depthStencilTexture=a,u=this._depthStencilTexture.descriptor):(u=a,this._depthStencilTexture=new n(this._context,u)),e._validateTextureDimensions(u,this._desc)}}return e.create=function(t,i){return new e(t,i)},e.createWithAttachments=function(t,i,r,n){return new e(t,r,i,n)},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this._colorAttachment instanceof n?this._colorAttachment:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"depthStencilTexture",{get:function(){return this._depthStencilTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._desc.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._desc.height},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._context&&(this._disposeColorAttachment(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),i("esri-webgl-debug")&&this._context.instanceCounter.decrementCount(4),this._context=null)},e.prototype.attachColorTexture=function(t){if(t){var i=t.descriptor;if(e._validateTextureDimensions(i,this._desc),this._disposeColorAttachment(),this._initialized){this._context.bindFramebuffer(this);var r=this._context.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t.glName,0)}this._colorAttachment=t}},e.prototype.detachColorTexture=function(){var e=void 0;if(this._colorAttachment instanceof n){if(e=this._colorAttachment,this._initialized){this._context.bindFramebuffer(this);var t=this._context.gl;this._context.gl.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,null,0)}this._colorAttachment=null}return e},e.prototype.attachDepthStencilTexture=function(t){if(t){var i=t.descriptor;if(34041!==i.pixelFormat&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),34042!==i.dataType&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8_WEBGL!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),e._validateTextureDimensions(i,this._desc),4!==this._desc.depthStencilTarget&&(this._desc.depthStencilTarget=4),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);var r=this._context.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,t.glName,0)}this._depthStencilTexture=t}},e.prototype.detachDepthStencilTexture=function(){var e=this._depthStencilTexture;if(e&&this._initialized){this._context.bindFramebuffer(this);var t=this._context.gl;this._context.gl.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,null,0)}return this._depthStencilTexture=null,e},e.prototype.attachDepthStencilBuffer=function(t){if(t){var i=t.descriptor;if(34041!==i.internalFormat&&33189!==i.internalFormat&&console.error("Depth/Stencil buffer must have correct internalFormat"),e._validateBufferDimensions(i,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=34041===i.internalFormat?3:1,this._initialized){this._context.bindFramebuffer(this);var r=this._context.gl,n=1===this._desc.depthStencilTarget?r.DEPTH_ATTACHMENT:r.DEPTH_STENCIL_ATTACHMENT;r.framebufferRenderbuffer(r.FRAMEBUFFER,n,r.RENDERBUFFER,t.glName)}this._depthAttachment=t}},e.prototype.detachDepthStencilBuffer=function(){var e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);var i=1===this._desc.depthStencilTarget?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,null)}return this._depthAttachment=null,t},e.prototype.copyToTexture=function(e,t,i,r,n,o,s){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");var a=this._desc,l=s.descriptor;3553!==s.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(e+i>a.width||t+r>a.height||n+i>l.width||o+r>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");var u=this._context;u.bindTexture(s),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(3553,0,n,o,e,t,i,r)},e.prototype.readPixels=function(e,t,i,r,n,o,s){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),s||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,i,r,n,o,s)},e.prototype.resize=function(t,i){var r=this._desc;if(r.width!==t||r.height!==i){if(!this._initialized){if(r.width=t,r.height=i,this._colorAttachment instanceof n)(o=this._colorAttachment).resize(t,i);return void(this._depthStencilTexture&&this._depthStencilTexture.resize(t,i))}var o,s;if(r.width=t,r.height=i,this._colorAttachment instanceof n)(s=(o=this._colorAttachment).descriptor).width=t,s.height=i,this._colorAttachment.dispose(),this._colorAttachment=new n(this._context,s),e._validateTextureDimensions(o.descriptor,this._desc);else this._colorAttachment&&this._disposeColorAttachment();if(null!=this._depthStencilTexture)(s=this._depthStencilTexture.descriptor).width=t,s.height=i,this._depthStencilTexture.dispose(),this._depthStencilTexture=new n(this._context,s);else(this._depthAttachment||this._stencilAttachment)&&this._disposeDepthStencilAttachments();this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}},e.prototype.initialize=function(){if(this._initialized)return!1;var e=this._context.gl;this._glName&&e.deleteFramebuffer(this._glName);var t=e.createFramebuffer(),i=this._desc;if(e.bindFramebuffer(e.FRAMEBUFFER,t),!this._colorAttachment)if(0===i.colorTarget){var o={target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:i.width,height:i.height};this._colorAttachment=new n(this._context,o)}else{var s=new r(this._context,{internalFormat:32854,width:i.width,height:i.height});e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,s.glName),this._colorAttachment=s}if(this._colorAttachment instanceof n){var a=this._colorAttachment;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.glName,0)}switch(i.depthStencilTarget){case 1:case 3:this._depthAttachment||(this._depthAttachment=new r(this._context,{internalFormat:1===i.depthStencilTarget?33189:34041,width:i.width,height:i.height}));var l=1===i.depthStencilTarget?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,this._depthAttachment.glName);break;case 2:this._stencilAttachment||(this._stencilAttachment=new r(this._context,{internalFormat:36168,width:i.width,height:i.height})),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,this._stencilAttachment.glName);break;case 4:if(!this._depthStencilTexture){this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");var u={target:3553,pixelFormat:34041,dataType:34042,samplingMode:9728,wrapMode:33071,width:i.width,height:i.height};this._depthStencilTexture=new n(this._context,u)}e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,this._depthStencilTexture.glName,0)}return e.checkFramebufferStatus(e.FRAMEBUFFER)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=t,this._initialized=!0,!0},e.prototype._disposeColorAttachment=function(){if(this._colorAttachment instanceof n){var e=this._colorAttachment;if(this._initialized)this._context.bindFramebuffer(this),(i=this._context.gl).framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,null,0);e.dispose()}else if(this._colorAttachment instanceof WebGLRenderbuffer){var t=this._colorAttachment,i=this._context.gl;this._initialized&&(this._context.bindFramebuffer(this),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(t)}this._colorAttachment=null},e.prototype._disposeDepthStencilAttachments=function(){var e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);var t=1===this._desc.depthStencilTarget?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,null,0)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)},e._validateBufferDimensions=function(e,t){console.assert(e.width>=0&&e.height>=0),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)},e._validateTextureDimensions=function(e,t){console.assert(e.width>=0&&e.height>=0),3553!==e.target&&console.error("Texture type must be TEXTURE_2D!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)},e._nextId=0,e}()}.apply(null,r))||(e.exports=n)},1491:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}}.apply(null,r))||(e.exports=n)},1513:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(29)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),n=new Uint8Array(r),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return new Blob([r],{type:i})},t.requestImage=function(e){return i(e,{responseType:"image"}).then(function(e){return e.data})}}.apply(null,r))||(e.exports=n)},1517:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EXTRUDE_SCALE=64,t.PICTURE_FILL_COLOR=4294967295,t.TILE_SIZE=512,t.ANGLE_FACTOR_256=256/360,t.DEBUG_LABELS=!1,t.COLLISION_BUCKET_SIZE=128,t.COLLISION_MAX_ZOOM_DELTA=3,t.COLLISION_EARLY_REJECT_BUCKET_SIZE=32,t.COLLISION_BOX_PADDING=8,t.COLLISION_TILE_BOX_SIZE=t.TILE_SIZE/t.COLLISION_BUCKET_SIZE,t.COLLISION_PLACEMENT_PADDING=8,t.HEURISTIC_GLYPHS_PER_LINE=50,t.HEURISTIC_GLYPHS_PER_FEATURE=10,t.GLYPH_SIZE=24,t.TEXT_LINE_HEIGHT=1.2*t.GLYPH_SIZE,t.TEXT_MAX_WIDTH=10*t.GLYPH_SIZE,t.TEXT_SPACING=0}.apply(null,r))||(e.exports=n)},1523:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){function i(e,t){return(e%=t)>=0?e:e+t}Object.defineProperty(t,"__esModule",{value:!0}),t.C_INFINITY=Number.POSITIVE_INFINITY,t.C_PI=Math.PI,t.C_2PI=2*t.C_PI,t.C_PI_BY_2=t.C_PI/2,t.C_RAD_TO_256=128/t.C_PI,t.C_256_TO_RAD=t.C_PI/128,t.C_DEG_TO_256=256/360,t.C_DEG_TO_RAD=t.C_PI/180,t.C_SQRT2=1.414213562,t.C_SQRT2_INV=1/t.C_SQRT2;var r=1/Math.LN2;t.positiveMod=i,t.radToByte=function(e){return i(e*t.C_RAD_TO_256,256)},t.degToByte=function(e){return i(e*t.C_DEG_TO_256,256)},t.log2=function(e){return Math.log(e)*r},t.sqr=function(e){return e*e},t.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},t.interpolate=function(e,t,i){return e*(1-i)+t*i},t.between=function(e,t,i){return e>=t&&e<=i||e>=i&&e<=t}}.apply(null,r))||(e.exports=n)},1524:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(18)],void 0===(n=function(e,t,i){return function(){function e(t,r){this._context=t,this._desc=r,this._glName=null,this._id=-1;var n=this._context.gl;i("esri-webgl-debug")&&this._context.instanceCounter.incrementCount(5),this._id=++e._nextId,this._glName=n.createRenderbuffer(),this._context.bindRenderbuffer(this),n.renderbufferStorage(n.RENDERBUFFER,r.internalFormat,r.width,r.height)}return Object.defineProperty(e.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0}),e.prototype.resize=function(e,t){var i=this._context.gl,r=this._desc;r.width===e&&r.height===t||(r.width=e,r.height=t,this._context.bindRenderbuffer(this),i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height))},e.prototype.dispose=function(){this._glName&&(this._context.gl.deleteRenderbuffer(this._glName),this._glName=null),i("esri-webgl-debug")&&this._context.instanceCounter.decrementCount(5),this._context=null},e._nextId=0,e}()}.apply(null,r))||(e.exports=n)},1528:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(1553)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._renderRequestedCalled=!1,t._attached=!1,t._isReady=!1,t._opacity=1,t.renderRequested=!1,t._visible=!0,t}return i(t,e),Object.defineProperty(t.prototype,"attached",{get:function(){return this._attached},set:function(e){this._attached!==e&&(this._attached=e,e?this.hasEventListener("attach")&&this.emit("attach"):this.hasEventListener("detach")&&this.emit("detach"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isReady",{get:function(){return this._attached&&this._isReady},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"opacity",{get:function(){return this._opacity},set:function(e){this._opacity!==e&&(this._opacity=e,this.requestRender())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible!==e&&(this._visible=e,this.requestRender())},enumerable:!0,configurable:!0}),t.prototype.attach=function(){return this.ready(),!0},t.prototype.detach=function(){},t.prototype.processRender=function(e){this.visible&&this.attached&&(this._renderRequestedCalled=!1,this.doRender(e),this._renderRequestedCalled||(this.renderRequested=!1),this.hasEventListener("post-render")&&this.emit("post-render"))},t.prototype.requestRender=function(){var e=this.renderRequested;this._renderRequestedCalled=!0,this.renderRequested=!0,this.parent&&this.parent.requestChildRender(this),e!==this.renderRequested&&this.hasEventListener("will-render")&&this.emit("will-render")},t.prototype.dispose=function(){},t.prototype.ready=function(){this._isReady=!0,this.hasEventListener("isReady")&&this.emit("isReady")},t}(r.Evented);t.DisplayObject=n}.apply(null,r))||(e.exports=n)},1539:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(1528)],void 0===(n=function(e,t,i,r){var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.ATTACHING=0]="ATTACHING",e[e.DETACHING=1]="DETACHING",e[e.RENDERING=2]="RENDERING",e[e.DONE=3]="DONE"}(n||(n={}));var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._childrenSet=new Set,t._childrenToAttach=[],t._childrenToDetach=[],t._renderPhase=n.DONE,t.children=[],t}return i(t,e),Object.defineProperty(t.prototype,"numChildren",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),t.prototype.detach=function(){for(var e=0,t=this.children.concat(this._childrenToDetach);e<t.length;e++){var i=t[e];i.attached&&(this.detachChild(i),i.attached=!1,i.parent=null)}},t.prototype.doRender=function(e){var t=e.globalOpacity;e.globalOpacity*=this.opacity,this._renderPhase=n.ATTACHING,this.attachChildren(),this._renderPhase=n.DETACHING;for(var i=this._childrenToDetach;i.length>0;){var r=i.shift();this.detachChild(r),r.attached=!1,r.parent=null,r.stage=null}this._renderPhase=n.RENDERING,this.renderChildren(e),this._renderPhase=n.DONE,e.globalOpacity=t},t.prototype.addChild=function(e){return this.addChildAt(e,this.children.length)},t.prototype.addChildAt=function(e,t){if(void 0===t&&(t=this.numChildren),!e)return e;if(this.contains(e))return e;var i=e.parent;i&&i!==this&&i.removeChild(e),t>=this.numChildren?this.children.push(e):this.children.splice(t,0,e),this._childrenSet.add(e);var r=this._childrenToDetach.indexOf(e);return r>-1&&this._childrenToDetach.splice(r,1),this._childrenToAttach.push(e),this._renderPhase>=n.RENDERING&&this.requestRender(),e},t.prototype.contains=function(e){return this._childrenSet.has(e)},t.prototype.getChildIndex=function(e){return this.children.indexOf(e)},t.prototype.getChildAt=function(e){return e<0||e>this.children.length?null:this.children[e]},t.prototype.removeAllChildren=function(){for(var e=this.numChildren;e--;)this.removeChildAt(0)},t.prototype.removeChild=function(e){return this.contains(e)?this.removeChildAt(this.getChildIndex(e)):e},t.prototype.removeChildAt=function(e){var t;if(e<0||e>=this.children.length)return null;if(t=this.children.splice(e,1)[0],function(e,t){e.delete(t)}(this._childrenSet,t),t.attached)this._childrenToDetach.push(t),this._renderPhase>=n.RENDERING&&this.requestRender();else{var i=this._childrenToAttach.indexOf(t);i>-1&&this._childrenToAttach.splice(i,1)}return t},t.prototype.requestChildRender=function(e){e&&e.parent===this&&this._renderPhase>=n.RENDERING&&this.requestRender()},t.prototype.setChildIndex=function(e,t){var i=this.getChildIndex(e);i>-1&&(this.children.splice(i,1),this.children.splice(t,0,e),this._renderPhase>=n.RENDERING&&this.requestRender())},t.prototype.sortChildren=function(e){return this._renderPhase>n.RENDERING&&this.requestRender(),this.children.sort(e)},t.prototype.attachChildren=function(){var e=this._childrenToAttach;if(0!==e.length)for(var t=0,i=!1;!i;){var r=e[t];r.parent=this,r.stage=this.stage,this.attachChild(r)?(r.attached=!0,e.splice(t,1)):++t,i=e.length===t}},t.prototype.renderChildren=function(e){for(var t=this.children,i=t.length,r=0;r<i;r++)t[r].processRender(e)},t.prototype.attachChild=function(e){return e.attach()},t.prototype.detachChild=function(e){e.detach()},t}(r.DisplayObject);t.Container=o}.apply(null,r))||(e.exports=n)},1553:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(85),i(53)],void 0===(n=function(e,t,i,r,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.prototype.on=function(e,t){return r.after(this,"on"+e,t,!0)},e.prototype.once=function(e,t){return n.once(this,e,t)},e.prototype.emit=function(e){n.emit(this,e,this)},e.prototype.hasEventListener=function(e){var t="on"+e;return!(!this[t]||!this[t].after)},e}();t.Evented=o,t.EventedMixin=function(e){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.on=function(e,t){return r.after(this,"on"+e,t,!0)},t.prototype.once=function(e,t){return n.once(this,e,t)},t.prototype.emit=function(e,t){n.emit(this,e,t)},t.prototype.hasEventListener=function(e){var t="on"+e;return!(!this[t]||!this[t].after)},t}(e)}}.apply(null,r))||(e.exports=n)},1560:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(18),i(1561),i(1562),i(1491),i(1563)],void 0===(n=function(e,t,i,r,n,o,s){function a(e,t){switch(e){case 0:return 2*t;case 4:return t/3;case 5:case 6:return t-2}return 0}return function(){function e(e,t){this.gl=null,this._blendEnabled=!1,this._blendColorState={r:0,g:0,b:0,a:0},this._blendFunctionState={srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0},this._blendEquationState={mode:32774,modeAlpha:32774},this._colorMaskState={r:!0,g:!0,b:!0,a:!0},this._polygonCullingEnabled=!1,this._cullFace=1029,this._frontFace=2305,this._scissorTestEnabled=!1,this._scissorRect={x:0,y:0,width:0,height:0},this._depthTestEnabled=!1,this._depthFunction=513,this._clearDepth=1,this._depthWriteEnabled=!0,this._depthRange={zNear:0,zFar:1},this._viewport=null,this._stencilTestEnabled=!1,this._polygonOffsetFillEnabled=!1,this._polygonOffset=[0,0],this._stencilFunction={face:1032,func:519,ref:0,mask:1},this._clearStencil=0,this._stencilWriteMask=1,this._stencilOperation={face:1032,fail:7680,zFail:7680,zPass:7680},this._lineWidth=1,this._clearColor={r:0,g:0,b:0,a:0},this._activeShaderProgram=null,this._activeVertexBuffer=null,this._activeIndexBuffer=null,this._activeFramebuffer=null,this._activeRenderbuffer=null,this._activeTextureUnit=0,this._textureUnitMap={},this._numOfDrawCalls=0,this._numOfTriangles=0,this.contextVersion=o.default(e)?"webgl2":"webgl",this.gl=e,e instanceof WebGLRenderingContext&&this.gl.getExtension("OES_element_index_uint"),this._capabilities=s.loadCapabilities(e,t);var r=this.gl.getParameter(this.gl.VIEWPORT);this._viewport={x:r[0],y:r[1],width:r[2],height:r[3]};var a=this.capabilities.textureFilterAnisotropic;this._parameters={versionString:this.gl.getParameter(this.gl.VERSION),maxVertexTextureImageUnits:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:a?this.gl.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY):void 0,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS)},i("esri-webgl-debug")&&(this.instanceCounter=new n),this.enforceState()}return Object.defineProperty(e.prototype,"contextAttributes",{get:function(){return this.gl.getContextAttributes()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parameters",{get:function(){return this._parameters},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this._textureUnitMap={},i("esri-webgl-debug")&&this.instanceCounter.printResourceCount(),this.gl=null},e.prototype.setBlendingEnabled=function(e){this._blendEnabled!==e&&(!0===e?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._blendEnabled=e)},e.prototype.setBlendColor=function(e,t,i,r){e===this._blendColorState.r&&t===this._blendColorState.g&&i===this._blendColorState.b&&r===this._blendColorState.a||(this.gl.blendColor(e,t,i,r),this._blendColorState.r=e,this._blendColorState.g=t,this._blendColorState.b=i,this._blendColorState.a=r)},e.prototype.setBlendFunction=function(e,t){e===this._blendFunctionState.srcRGB&&t===this._blendFunctionState.dstRGB||(this.gl.blendFunc(e,t),this._blendFunctionState.srcRGB=e,this._blendFunctionState.srcAlpha=e,this._blendFunctionState.dstRGB=t,this._blendFunctionState.dstAlpha=t)},e.prototype.setBlendFunctionSeparate=function(e,t,i,r){this._blendFunctionState.srcRGB===e&&this._blendFunctionState.srcAlpha===i&&this._blendFunctionState.dstRGB===t&&this._blendFunctionState.dstAlpha===r||(this.gl.blendFuncSeparate(e,t,i,r),this._blendFunctionState.srcRGB=e,this._blendFunctionState.srcAlpha=i,this._blendFunctionState.dstRGB=t,this._blendFunctionState.dstAlpha=r)},e.prototype.setBlendEquation=function(e){this._blendEquationState.mode!==e&&(this.gl.blendEquation(e),this._blendEquationState.mode=e,this._blendEquationState.modeAlpha=e)},e.prototype.setBlendEquationSeparate=function(e,t){this._blendEquationState.mode===e&&this._blendEquationState.modeAlpha===t||(this.gl.blendEquationSeparate(e,t),this._blendEquationState.mode=e,this._blendEquationState.modeAlpha=t)},e.prototype.setColorMask=function(e,t,i,r){this._colorMaskState.r===e&&this._colorMaskState.g===t&&this._colorMaskState.b===i&&this._colorMaskState.a===r||(this.gl.colorMask(e,t,i,r),this._colorMaskState.r=e,this._colorMaskState.g=t,this._colorMaskState.b=i,this._colorMaskState.a=r)},e.prototype.setClearColor=function(e,t,i,r){this._clearColor.r===e&&this._clearColor.g===t&&this._clearColor.b===i&&this._clearColor.a===r||(this.gl.clearColor(e,t,i,r),this._clearColor.r=e,this._clearColor.g=t,this._clearColor.b=i,this._clearColor.a=r)},e.prototype.setFaceCullingEnabled=function(e){this._polygonCullingEnabled!==e&&(!0===e?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._polygonCullingEnabled=e)},e.prototype.setPolygonOffsetFillEnabled=function(e){this._polygonOffsetFillEnabled!==e&&(!0===e?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._polygonOffsetFillEnabled=e)},e.prototype.setPolygonOffset=function(e,t){this._polygonOffset[0]===e&&this._polygonOffset[1]===t||(this._polygonOffset[0]=e,this._polygonOffset[1]=t,this.gl.polygonOffset(e,t))},e.prototype.setCullFace=function(e){this._cullFace!==e&&(this.gl.cullFace(e),this._cullFace=e)},e.prototype.setFrontFace=function(e){this._frontFace!==e&&(this.gl.frontFace(e),this._frontFace=e)},e.prototype.setScissorTestEnabled=function(e){this._scissorTestEnabled!==e&&(!0===e?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._scissorTestEnabled=e)},e.prototype.setScissorRect=function(e,t,i,r){this._scissorRect.x===e&&this._scissorRect.y===t&&this._scissorRect.width===i&&this._scissorRect.height===r||(this.gl.scissor(e,t,i,r),this._scissorRect.x=e,this._scissorRect.y=t,this._scissorRect.width=i,this._scissorRect.height=r)},e.prototype.setDepthTestEnabled=function(e){this._depthTestEnabled!==e&&(!0===e?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTestEnabled=e)},e.prototype.setClearDepth=function(e){this._clearDepth!==e&&(this.gl.clearDepth(e),this._clearDepth=e)},e.prototype.setDepthFunction=function(e){this._depthFunction!==e&&(this.gl.depthFunc(e),this._depthFunction=e)},e.prototype.setDepthWriteEnabled=function(e){this._depthWriteEnabled!==e&&(this.gl.depthMask(e),this._depthWriteEnabled=e)},e.prototype.setDepthRange=function(e,t){this._depthRange.zNear===e&&this._depthRange.zFar===t||(this.gl.depthRange(e,t),this._depthRange.zNear=e,this._depthRange.zFar=t)},e.prototype.setStencilTestEnabled=function(e){this._stencilTestEnabled!==e&&(!0===e?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTestEnabled=e)},e.prototype.setClearStencil=function(e){e!==this._clearStencil&&(this.gl.clearStencil(e),this._clearStencil=e)},e.prototype.setStencilFunction=function(e,t,i){this._stencilFunction.func===e&&this._stencilFunction.ref===t&&this._stencilFunction.mask===i||(this.gl.stencilFunc(e,t,i),this._stencilFunction.face=1032,this._stencilFunction.func=e,this._stencilFunction.ref=t,this._stencilFunction.mask=i)},e.prototype.setStencilFunctionSeparate=function(e,t,i,r){this._stencilFunction.face===e&&this._stencilFunction.func===t&&this._stencilFunction.ref===i&&this._stencilFunction.mask===r||(this.gl.stencilFuncSeparate(e,t,i,r),this._stencilFunction.face=e,this._stencilFunction.func=t,this._stencilFunction.ref=i,this._stencilFunction.mask=r)},e.prototype.setStencilWriteMask=function(e){this._stencilWriteMask!==e&&(this.gl.stencilMask(e),this._stencilWriteMask=e)},e.prototype.setStencilOp=function(e,t,i){this._stencilOperation.fail===e&&this._stencilOperation.zFail===t&&this._stencilOperation.zPass===i||(this.gl.stencilOp(e,t,i),this._stencilOperation.face=1032,this._stencilOperation.fail=e,this._stencilOperation.zFail=t,this._stencilOperation.zPass=i)},e.prototype.setStencilOpSeparate=function(e,t,i,r){this._stencilOperation.face===e&&this._stencilOperation.fail===t&&this._stencilOperation.zFail===i&&this._stencilOperation.zPass===r||(this.gl.stencilOpSeparate(e,t,i,r),this._stencilOperation.face=e,this._stencilOperation.face=e,this._stencilOperation.fail=t,this._stencilOperation.zFail=i,this._stencilOperation.zPass=r)},e.prototype.setLineWidth=function(e){var t=this._lineWidth;return this._lineWidth!==e&&(this.gl.lineWidth(e),this._lineWidth=e),t},e.prototype.setActiveTexture=function(e){var t=this._activeTextureUnit;return e>=0&&e!==this._activeTextureUnit&&(this.gl.activeTexture(r.BASE_TEXTURE_UNIT+e),this._activeTextureUnit=e),t},e.prototype.clear=function(e){e&&this.gl.clear(e)},e.prototype.drawArrays=function(e,t,r){i("esri-webgl-debug")&&(this._numOfDrawCalls++,this._numOfTriangles+=a(e,r)),this.gl.drawArrays(e,t,r)},e.prototype.drawElements=function(e,t,r,n){i("esri-webgl-debug")&&(this._numOfDrawCalls++,this._numOfTriangles+=a(e,t)),5123!==r?5125===r&&this.gl.drawElements(e,t,r,n):this.gl.drawElements(e,t,r,n)},e.prototype.logIno=function(){i("esri-webgl-debug")&&console.log("DrawCalls: "+this._numOfDrawCalls+", Triangles: "+this._numOfTriangles)},Object.defineProperty(e.prototype,"capabilities",{get:function(){return this._capabilities},enumerable:!0,configurable:!0}),e.prototype.setViewport=function(e,t,i,r){var n=this._viewport;n.x===e&&n.y===t&&n.width===i&&n.height===r||(n.x=e,n.y=t,n.width=i,n.height=r,this.gl.viewport(e,t,i,r))},e.prototype.getViewport=function(){return{x:this._viewport.x,y:this._viewport.y,width:this._viewport.width,height:this._viewport.height}},e.prototype.bindProgram=function(e){if(!e)return this.gl.useProgram(null),void(this._activeShaderProgram=null);this._activeShaderProgram!==e&&(e.initialize(),this.gl.useProgram(e.glName),this._activeShaderProgram=e)},e.prototype.bindTexture=function(t,i){void 0===i&&(i=0),-1===e._MAX_TEXTURE_IMAGE_UNITS&&(e._MAX_TEXTURE_IMAGE_UNITS=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS)),(i>=e._MAX_TEXTURE_IMAGE_UNITS||i<0)&&console.error("Input texture unit is out of range of available units!");var r=this._textureUnitMap[i];return this.setActiveTexture(i),null==t||null==t.glName?(null!=r&&(this.gl.bindTexture(r.descriptor.target,null),r.setBoundToUnit(i,!1)),void(this._textureUnitMap[i]=null)):r&&r.id===t.id?void t.applyChanges():(this.gl.bindTexture(t.descriptor.target,t.glName),t.setBoundToUnit(i,!0),t.applyChanges(),void(this._textureUnitMap[i]=t))},e.prototype.bindFramebuffer=function(e){if(!e)return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),void(this._activeFramebuffer=null);this._activeFramebuffer!==e&&(e.initialize()||this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e.glName),this._activeFramebuffer=e)},e.prototype.bindBuffer=function(t){t&&(34962===t.bufferType?this._activeVertexBuffer=e._bindBuffer(this.gl,t,t.bufferType,this._activeVertexBuffer):this._activeIndexBuffer=e._bindBuffer(this.gl,t,t.bufferType,this._activeIndexBuffer))},e.prototype.bindRenderbuffer=function(e){var t=this.gl;e||(t.bindRenderbuffer(t.RENDERBUFFER,null),this._activeRenderbuffer=null),this._activeRenderbuffer!==e&&(t.bindRenderbuffer(t.RENDERBUFFER,e.glName),this._activeRenderbuffer=e)},e.prototype.unbindBuffer=function(t){34962===t?this._activeVertexBuffer=e._bindBuffer(this.gl,null,t,this._activeVertexBuffer):this._activeIndexBuffer=e._bindBuffer(this.gl,null,t,this._activeIndexBuffer)},e.prototype.bindVAO=function(e){e?this._activeVertexArrayObject&&this._activeVertexArrayObject.id===e.id||(e.bind(),this._activeVertexArrayObject=e):this._activeVertexArrayObject&&(this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null)},e.prototype.getBoundTexture=function(e){return this._textureUnitMap[e]},e.prototype.getBoundFramebufferObject=function(){return this._activeFramebuffer},e.prototype.getBoundVAO=function(){return this._activeVertexArrayObject},e.prototype.resetState=function(){this.bindProgram(null),this.bindVAO(null),this.bindFramebuffer(null),this.unbindBuffer(34962),this.unbindBuffer(34963);for(var e=0;e<this.parameters.maxTextureImageUnits;e++)this.bindTexture(null,e);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)},e.prototype.enforceState=function(){var e=this.gl,t=this._capabilities.vao;t&&t.bindVertexArray(null);for(var n=0;n<this.parameters.maxVertexAttributes;n++)e.disableVertexAttribArray(n);if(this._activeVertexBuffer?e.bindBuffer(this._activeVertexBuffer.bufferType,this._activeVertexBuffer.glName):e.bindBuffer(34962,null),this._activeIndexBuffer?e.bindBuffer(this._activeIndexBuffer.bufferType,this._activeIndexBuffer.glName):e.bindBuffer(34963,null),t&&this._activeVertexArrayObject){var o=this._activeVertexArrayObject;this._activeVertexArrayObject&&(this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null),this.bindVAO(o)}e.bindFramebuffer(e.FRAMEBUFFER,this._activeFramebuffer?this._activeFramebuffer.glName:null),e.useProgram(this._activeShaderProgram?this._activeShaderProgram.glName:null),e.blendColor(this._blendColorState.r,this._blendColorState.g,this._blendColorState.b,this._blendColorState.a),e.bindRenderbuffer(e.RENDERBUFFER,this._activeRenderbuffer?this._activeRenderbuffer.glName:null),!0===this._blendEnabled?e.enable(this.gl.BLEND):e.disable(this.gl.BLEND),e.blendEquationSeparate(this._blendEquationState.mode,this._blendEquationState.modeAlpha),e.blendFuncSeparate(this._blendFunctionState.srcRGB,this._blendFunctionState.dstRGB,this._blendFunctionState.srcAlpha,this._blendFunctionState.dstAlpha),e.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearColor.a),e.clearDepth(this._clearDepth),e.clearStencil(this._clearStencil),e.colorMask(this._colorMaskState.r,this._colorMaskState.g,this._colorMaskState.b,this._colorMaskState.a),e.cullFace(this._cullFace),e.depthFunc(this._depthFunction),e.depthRange(this._depthRange.zNear,this._depthRange.zFar),!0===this._depthTestEnabled?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthMask(this._depthWriteEnabled),e.frontFace(this._frontFace),e.lineWidth(this._lineWidth),!0===this._polygonCullingEnabled?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),e.polygonOffset(this._polygonOffset[0],this._polygonOffset[1]),!0===this._polygonOffsetFillEnabled?e.enable(e.POLYGON_OFFSET_FILL):e.disable(e.POLYGON_OFFSET_FILL),e.scissor(this._scissorRect.x,this._scissorRect.y,this._scissorRect.width,this._scissorRect.height),!0===this._scissorTestEnabled?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST),e.stencilFunc(this._stencilFunction.func,this._stencilFunction.ref,this._stencilFunction.mask),e.stencilOpSeparate(this._stencilOperation.face,this._stencilOperation.fail,this._stencilOperation.zFail,this._stencilOperation.zPass),!0===this._stencilTestEnabled?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),e.stencilMask(this._stencilWriteMask);for(var s=0;s<this.parameters.maxTextureImageUnits;s++){e.activeTexture(r.BASE_TEXTURE_UNIT+s),e.bindTexture(3553,null);var a=this._textureUnitMap[s];a&&e.bindTexture(a.descriptor.target,a.glName)}e.activeTexture(r.BASE_TEXTURE_UNIT+this._activeTextureUnit),e.viewport(this._viewport.x,this._viewport.y,this._viewport.width,this._viewport.height),i("esri-webgl-debug")&&(this._numOfDrawCalls=0,this._numOfTriangles=0)},e._bindBuffer=function(e,t,i,r){return t?r===t?r:(e.bindBuffer(i,t.glName),t):(e.bindBuffer(i,null),null)},e._MAX_TEXTURE_IMAGE_UNITS=-1,e}()}.apply(null,r))||(e.exports=n)},1561:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BASE_TEXTURE_UNIT=33984}.apply(null,r))||(e.exports=n)},1562:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){return function(){function e(){this._instanceCount={textureCount:0,bufferCount:0,vaoCount:0,programCount:0,framebufferCount:0,renderBufferCount:0}}return e.prototype.incrementCount=function(e){switch(e){case 0:this._instanceCount.textureCount++;break;case 1:this._instanceCount.bufferCount++;break;case 2:this._instanceCount.vaoCount++;break;case 3:this._instanceCount.programCount++;break;case 4:this._instanceCount.framebufferCount++;break;case 5:this._instanceCount.renderBufferCount++}},e.prototype.decrementCount=function(e){switch(e){case 0:this._instanceCount.textureCount--;break;case 1:this._instanceCount.bufferCount--;break;case 2:this._instanceCount.vaoCount--;break;case 3:this._instanceCount.programCount--;break;case 4:this._instanceCount.framebufferCount--;break;case 5:this._instanceCount.renderBufferCount--}},e.prototype.printResourceCount=function(){console.log("Live objects:"),console.log("Textures: "+this._instanceCount.textureCount),console.log("Buffers: "+this._instanceCount.bufferCount),console.log("VAOs: "+this._instanceCount.vaoCount),console.log("Programs: "+this._instanceCount.programCount),console.log("Framebuffers: "+this._instanceCount.framebufferCount),console.log("Renderbuffers: "+this._instanceCount.renderBufferCount)},e}()}.apply(null,r))||(e.exports=n)},1563:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1564),i(1565),i(1491),i(1566)],void 0===(n=function(e,t,i,r,n,o){function s(e,t){if(t.compressedTextureS3TC)return null;var i=e.getExtension("WEBGL_compressed_texture_s3tc");return i?{COMPRESSED_RGB_S3TC_DXT1:i.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:i.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:i.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:i.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function a(e,t){if(n.default(e))return{MIN:e.MIN,MAX:e.MAX};if(t.blendMinMax)return null;var i=e.getExtension("EXT_blend_minmax");return i?{MIN:i.MIN_EXT,MAX:i.MAX_EXT}:null}function l(e,t){if(t.textureFilterAnisotropic)return null;var i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return i?{MAX_TEXTURE_MAX_ANISOTROPY:i.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:i.TEXTURE_MAX_ANISOTROPY_EXT}:null}function u(e,t){if(n.default(e))return!t.colorBufferFloat&&e.getExtension("EXT_color_buffer_float")?{R16F:e.R16F,RG16F:e.RG16F,RGBA16F:e.RGBA16F,R32F:e.R32F,RG32F:e.RG32F,RGBA32F:e.RGBA32F,R11F_G11F_B10F:e.R11F_G11F_B10F}:null;if(e instanceof WebGLRenderingContext){var i=!t.colorBufferFloat&&e.getExtension("EXT_color_buffer_half_float"),r=!t.colorBufferFloat&&e.getExtension("WEBGL_color_buffer_float");return i||r?{RGBA16F:i?i.RGBA16F_EXT:void 0,RGBA32F:r?r.RGBA32F_EXT:void 0}:null}}function h(e,t,i,r,o){if(r&&n.default(e))return!0;if(t[i])return!1;for(var s=0,a=o;s<a.length;s++){var l=a[s];if(e.getExtension(l))return!0}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.loadCapabilities=function(e,t){var n=t&&t.disabledExtensions||{};return h(e,n,"standardDerivatives",!0,["OES_standard_derivatives"]),{instancing:r.load(e),vao:o.load(e,n),compressedTextureS3TC:s(e,n),textureFilterAnisotropic:l(e,n),disjointTimerQuery:i.load(e,n),colorBufferFloat:u(e,n),blendMinMax:a(e,n),depthTexture:h(e,n,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),standardDerivatives:!0,shaderTextureLOD:h(e,n,"shaderTextureLOD",!0,["EXT_shader_texture_lod"]),textureFloatLinear:h(e,n,"textureFloatLinear",!1,["OES_texture_float_linear"]),fragDepth:h(e,n,"fragDepth",!0,["EXT_frag_depth"])}}}.apply(null,r))||(e.exports=n)},1564:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1491)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.load=function(e,t){if(t.disjointTimerQuery)return null;var r=e.getExtension("EXT_disjoint_timer_query")||e.getExtension("EXT_disjoint_timer_query_webgl2");return r?i.default(e)?{createQuery:function(){return e.createQuery()},resultAvailable:function(t){return e.getQueryParameter(t,e.QUERY_RESULT_AVAILABLE)},getResult:function(t){return e.getQueryParameter(t,e.QUERY_RESULT)},disjoint:function(){return e.getParameter(r.GPU_DISJOINT_EXT)},beginTimeElapsed:function(t){return e.beginQuery(r.TIME_ELAPSED_EXT,t)},endTimeElapsed:function(){return e.endQuery(r.TIME_ELAPSED_EXT)},createTimestamp:function(e){return r.queryCounterEXT(e,r.TIMESTAMP_EXT)},timestampBits:function(){return e.getQuery(r.TIMESTAMP_EXT,r.QUERY_COUNTER_BITS_EXT)}}:{createQuery:function(){return r.createQueryEXT()},resultAvailable:function(e){return r.getQueryObjectEXT(e,r.QUERY_RESULT_AVAILABLE_EXT)},getResult:function(e){return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)},disjoint:function(){return e.getParameter(r.GPU_DISJOINT_EXT)},beginTimeElapsed:function(e){return r.beginQueryEXT(r.TIME_ELAPSED_EXT,e)},endTimeElapsed:function(){return r.endQueryEXT(r.TIME_ELAPSED_EXT)},createTimestamp:function(e){return r.queryCounterEXT(e,r.TIMESTAMP_EXT)},timestampBits:function(){return r.getQueryEXT(r.TIMESTAMP_EXT,r.QUERY_COUNTER_BITS_EXT)}}:null}}.apply(null,r))||(e.exports=n)},1565:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1491)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.load=function(e){if(i.default(e))return{drawArraysInstanced:e.drawArraysInstanced.bind(e),drawElementsInstanced:e.drawElementsInstanced.bind(e),vertexAttribDivisor:e.vertexAttribDivisor.bind(e)};var t=e.getExtension("ANGLE_instanced_arrays");return t?{drawArraysInstanced:t.drawArraysInstancedANGLE.bind(t),drawElementsInstanced:t.drawElementsInstancedANGLE.bind(t),vertexAttribDivisor:t.vertexAttribDivisorANGLE.bind(t)}:null}}.apply(null,r))||(e.exports=n)},1566:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1491)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.load=function(e,t){if(i.default(e))return{createVertexArray:e.createVertexArray.bind(e),deleteVertexArray:e.deleteVertexArray.bind(e),bindVertexArray:e.bindVertexArray.bind(e)};if(t.vao)return null;var r=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object");return r?{createVertexArray:r.createVertexArrayOES.bind(r),deleteVertexArray:r.deleteVertexArrayOES.bind(r),bindVertexArray:r.bindVertexArrayOES.bind(r)}:null}}.apply(null,r))||(e.exports=n)},1640:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){return function(){function e(e,t,i,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=e,this.y=t,this.width=i,this.height=r}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.width<=0||this.height<=0},enumerable:!0,configurable:!0}),e}()}.apply(null,r))||(e.exports=n)},1643:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.equals=function(e,t){return e===this.x&&t===this.y},e.prototype.isEqual=function(e){return e.x===this.x&&e.y===this.y},e.prototype.setCoords=function(e,t){this.x=e,this.y=t},e.prototype.normalize=function(){var e=this.x,t=this.y,i=Math.sqrt(e*e+t*t);this.x/=i,this.y/=i},e.prototype.rightPerpendicular=function(){var e=this.x;this.x=this.y,this.y=-e},e.prototype.move=function(e,t){this.x+=e,this.y+=t},e.prototype.assign=function(e){this.x=e.x,this.y=e.y},e.prototype.assignAdd=function(e,t){this.x=e.x+t.x,this.y=e.y+t.y},e.prototype.assignSub=function(e,t){this.x=e.x-t.x,this.y=e.y-t.y},e.prototype.rotate=function(e,t){var i=this.x,r=this.y;this.x=i*e-r*t,this.y=i*t+r*e},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.length=function(){var e=this.x,t=this.y;return Math.sqrt(e*e+t*t)},e.distance=function(e,t){var i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)},e.add=function(t,i){return new e(t.x+i.x,t.y+i.y)},e.sub=function(t,i){return new e(t.x-i.x,t.y-i.y)},e}();t.Point=i}.apply(null,r))||(e.exports=n)},1645:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(6),i(30),i(36),i(54),i(45),i(24),i(1921),i(52),i(204),i(63),i(63),i(1517),i(1808),i(1647),i(1833),i(1666),i(1763)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m,g){function y(e){switch(e){case"left":return 1;case"right":return-1;case"center":case"justify":return 0}}function x(e){switch(e){case"top":return-1;case"middle":return 0;case"baseline":case"bottom":return 1}}function b(e){switch(e){case"left":return 0;case"right":return 1;case"center":case"justify":return.5}}function S(e,t,i){if(!i)return e;var n=g.bidiText(t.text),o=n[0],s=n[1],a=b(t.horizontalAlignment||"center"),l=y(t.horizontalAlignment||"center"),u=i.glyphMosaicItems,h=new v([u],f.TEXT_MAX_WIDTH,f.TEXT_LINE_HEIGHT,f.TEXT_SPACING,[0,.5*-f.TEXT_LINE_HEIGHT],.5*(1-l),0,a).getShaping(o,s),c=p.getFontDecorationTop(t.font);isNaN(c)||v.addDecoration(h,c);var d=v.getBox(h),_=r.pt2px(t.font.size)/P;return e[0]=_*d.x,e[1]=_*d.y,e[2]=_*d.width,e[3]=_*d.height,e}function T(e,t,i,n,o,s){var a,l,u=r.pt2px(n.xoffset),c=r.pt2px(n.yoffset),f=_.C_DEG_TO_RAD*n.angle;switch(n.type){case"simple-marker":var p=n;a=l=r.pt2px(p.size);break;case"picture-marker":var v=n;a=r.pt2px(v.width),l=r.pt2px(v.height)}var m=.5*a,g=.5*l;if(0!==f){var y=Math.cos(f),x=Math.sin(f),b=m*x+g*y;m=m*y+g*x,g=b}var S=o*(u+m),T=o*(c+g),w=Math.sqrt(S*S+T*T),E=h.normalizeMapX(t-w,s),V=h.normalizeMapX(t+w,s);if(E>V){var I=d.getInfo(s);if(I){var C=I.valid;E=C[0],V=C[1]}}return e[0]=E,e[1]=i-w,e[2]=V,e[3]=i+w,e}function w(e,t,i,n,o,s,a){var l=y(n.horizontalAlignment||"center"),u=x(n.verticalAlignment||"middle"),c=s*r.pt2px(n.xoffset),f=s*r.pt2px(n.yoffset),p=_.C_DEG_TO_RAD*n.angle,v=s*o[2],m=s*o[3];if(0!==p){var g=Math.cos(p),b=Math.sin(p),S=v*b+m*g;v=v*g+m*b,m=S}var T=c+l*v+v,w=f+u*m+m,E=Math.sqrt(T*T+w*w),V=h.normalizeMapX(t-E,a),I=h.normalizeMapX(t+E,a);if(V>I){var C=d.getInfo(a);if(C){var M=C.valid;V=M[0],I=M[1]}}return e[0]=V,e[1]=i-E,e[2]=I,e[3]=i+E,e}function E(e,t){return Math.ceil((e-t)/(2*t))}function V(e,t,i){var r;if(Array.isArray(e)){if((r=e[0])>t){var n=E(r,t);e[0]=r+n*(-2*t)}else if(r<i){n=E(r,i);e[0]=r+n*(-2*i)}}else if((r=e.x)>t){n=E(r,t);e=e.clone().offset(n*(-2*t),0)}else if(r<i){n=E(r,i);e=e.clone().offset(n*(-2*i),0)}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.ensureClosedRings=function(e){if(u.isPolygon(e))for(var t=0,i=e.rings;t<i.length;t++){var r=i[t];r.length<3||r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]||r.push(r[0])}},t.getBounds=function(e,t,i,r,n,o,s,a,h){if(!r)return e[0]=e[1]=e[2]=e[3]=0,t[0]=t[1]=t[2]=t[3]=0,e;var c=i.symbol;if(!c&&o&&(c=o.getSymbol(i,{scale:a})),!c)return e;var d=r;if(!u.isPoint(d)){l.getBoundsXY(e,d);var f=t[0];0===f&&(f=function(e,t){var i=0;switch(e.type){case"simple-fill":case"picture-fill":var r=e.outline;if(!r)return 0;i=r.width;break;case"simple-line":i=e.width;break;case"simple-marker":i=e.size;break;case"picture-marker":i=Math.max(e.width,e.height);break;case"text":var n=[0,0,0,0];S(n,e,t),i=Math.max(n[0],n[1])}return i}(c,n),t[0]=f);var p=s*f/2;return e[0]-=p,e[1]-=p,e[2]+=p,e[3]+=p,e}var _=d.x,v=d.y;switch(c.type){case"simple-marker":case"picture-marker":T(e,_,v,c,s,h);break;case"text":0===t[2]&&0===t[3]&&S(t,c,n),w(e,_,v,c,t,s,h)}return e},t.isMarkerSymbol=function(e){return"simple-marker"===e||"picture-marker"===e||"text"===e},t.graphicGeometryToNumber=function(e){switch(e.geometry.type){case"point":case"multipoint":return 0;case"polyline":return 1;case"polygon":case"extent":return 2}return 0},t.getXAnchorDirection=y,t.getYAnchorDirection=x,t.getJustification=b;var I=n.vec2f32.create(),C=n.vec2f32.create(),M=n.vec2f32.create(),O=n.vec2f32.create(),L=n.vec2f32.create(),A=n.vec2f32.create(),R=n.vec2f32.create();t.isPointOnPolyline=function(e,t,i,r){n.vec2.set(M,t,i);for(var o,s,a,l,u,h,c,d,f,p=e.paths,_=1/0,v=0;v<p.length;v++){var m=p[v];if(!(m.length<2))for(var g=1;g<m.length;g++)o=m[g-1][0],a=m[g-1][1],s=m[g][0],l=m[g][1],u=Math.min(o,s)-r,h=Math.min(a,l)-r,c=Math.max(o,s)+r,d=Math.max(a,l)+r,t<u||t>c||i<h||i>d||(n.vec2.set(I,o,a),n.vec2.set(C,s,l),n.vec2.subtract(O,C,I),n.vec2.subtract(L,I,M),n.vec2.scale(A,O,n.vec2.dot(O,L)/n.vec2.dot(O,O)),n.vec2.subtract(R,L,A),_>(f=n.vec2.dot(R,R))&&(_=f))}return Math.sqrt(_)<=r},t.getMarkerSymbolBounds=function(e,t,i,n,o,s){var a,l,u=o*r.pt2px(n.xoffset),h=o*r.pt2px(n.yoffset),c=_.C_DEG_TO_RAD*n.angle;switch(n.type){case"simple-marker":var d=n;a=l=.5*o*r.pt2px(d.size);break;case"picture-marker":var f=n;a=.5*o*r.pt2px(f.width),l=.5*o*r.pt2px(f.height)}var p=_.C_DEG_TO_RAD*s,v=Math.cos(p),m=Math.sin(p);if(t+=u*v-h*m,i+=u*m+h*v,0!==c){var g=Math.cos(c),y=Math.sin(c),x=a*y+l*g;a=a*g+l*y,l=x}return e[0]=t-a,e[1]=i-l,e[2]=t+a,e[3]=i+l,e},t.getTextSymbolBounds=function(e,t,i,n,o,s,a){var l=x(n.verticalAlignment||"baseline"),u="baseline"===(n.verticalAlignment||"baseline"),h=s*r.pt2px(n.xoffset),c=s*r.pt2px(n.yoffset),d=r.pt2px(n.font.size)/24,f=4*d,p=u?25*d:o[1]+(1-l)*o[3]*.5,v=_.C_DEG_TO_RAD*a,m=Math.cos(v),g=Math.sin(v),y=h*g+c*m,b=t+(h*m-c*g)+s*o[0],S=i+y+s*(p+f);return e[0]=b,e[1]=S-s*o[3],e[2]=b+s*o[2],e[3]=S,e},t.normalizeCentralMeridian=function(e){var t,r,n,s,a,l,u,h,d,f=null;if(!e)return i.resolve(null);if(t=e.spatialReference,r=c.getInfo(t),n=t.isWebMercator,s=F[l=n?102100:4326].maxX,a=F[l].minX,u=F[l].plus180Line,h=F[l].minus180Line,!r)return i.resolve(e);if("mesh"===e.type)d=e;else if("point"===e.type)d=V(e.clone(),s,a);else if("multipoint"===e.type){var p=e.clone();p.points=p.points.map(function(e){return V(e,s,a)}),d=p}else if("extent"===e.type){var _=(v=e.clone())._normalize(!1,!1,r);d=_.rings?new o(_):_}else if(e.extent){var v,g=E((v=e.extent).xmin,a)*(2*s),y=0===g?e.clone():function(e,t){for(var i=function(e){return u.isPolygon(e)?e.rings:e.paths}(e),r=0,n=i;r<n.length;r++)for(var o=n[r],s=0,a=o;s<a.length;s++){var l=a[s];l[0]+=t}return e}(e.clone(),g);v.offset(g,0),v.intersects(u)&&v.xmax!==s?f=y:v.intersects(h)&&v.xmin!==a?f=y:d=y}else d=e.clone();if(null!==f){var x=(new m.CutVertical).cut(f,s);return i.resolve(x)}return i.resolve(d)};var P=24,F={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:a.WebMercator}),minus180Line:new s({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:a.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s({paths:[[[180,-180],[180,180]]],spatialReference:a.WebMercator}),minus180Line:new s({paths:[[[-180,-180],[-180,180]]],spatialReference:a.WebMercator})}}}.apply(null,r))||(e.exports=n)},1647:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.C_INFINITY=Number.POSITIVE_INFINITY,t.C_PI=Math.PI,t.C_2PI=2*t.C_PI,t.C_PI_BY_2=t.C_PI/2,t.C_RAD_TO_256=128/t.C_PI,t.C_256_TO_RAD=t.C_PI/128,t.C_DEG_TO_256=256/360,t.C_DEG_TO_RAD=t.C_PI/180,t.C_SQRT2=1.414213562,t.C_SQRT2_INV=1/t.C_SQRT2;var i=1/Math.LN2;function r(e,t){return 0<=(e%=t)?e:e+t}t.positiveMod=r,t.radToByte=function(e){return r(e*t.C_RAD_TO_256,256)},t.degToByte=function(e){return r(e*t.C_DEG_TO_256,256)},t.log2=function(e){return Math.log(e)*i},t.sqr=function(e){return e*e},t.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},t.interpolate=function(e,t,i){return e*(1-i)+t*i},t.between=function(e,t,i){return t<=e&&e<=i||i<=e&&e<=t}}.apply(null,r))||(e.exports=n)},1648:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(92),i(7),i(1493),i(1775),i(1490)],void 0===(n=function(e,t,i,r,n,o,s){var a=r.getLogger("esri.views.2d.engine.webgl.WGLDisplayList");function l(e,t,i){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];t<e.length?e.splice.apply(e,[t,i].concat(r)):e.push.apply(e,r)}var u=new Map;u.set(n.WGLDrawPhase.MAP,[n.WGLGeometryType.FILL,n.WGLGeometryType.LINE,n.WGLGeometryType.MARKER,n.WGLGeometryType.TEXT]),u.set(n.WGLDrawPhase.LABEL,[n.WGLGeometryType.LABEL]),u.set(n.WGLDrawPhase.LABEL_ALPHA,[n.WGLGeometryType.LABEL]);var h=function(){function e(e){void 0===e&&(e=!1),this.symbolLevels=[],this.unified=e}return e.prototype.replay=function(e,t){if(this.unified)for(var i=0,r=this.symbolLevels;i<r.length;i++)for(var n=0,o=r[i].zLevels;n<o.length;n++){var s=o[n].geometryDPInfo;for(var a in s)if(s[a])for(var l=0,h=s[a];l<h.length;l++){var c=h[l];e.painter.getGeometryBrush(c.geometryType).drawGeometry(e,t,c,null)}}else for(var d=function(i){var r=e.painter.getGeometryBrush(i);f.byType(i,function(i){r.drawGeometry(e,t,i,null)})},f=this,p=0,_=u.get(e.drawPhase);p<_.length;p++)d(_[p])},Object.defineProperty(e.prototype,"empty",{get:function(){return!this.symbolLevels||0===this.symbolLevels.length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this.symbolLevels.length=0},e.prototype.addToList=function(e,t){if(Array.isArray(e))for(var i=0,r=e;i<r.length;i++){var n=r[i];this._addToList(n,t)}else this._addToList(e,t)},e.prototype.removeFromList=function(e){Array.isArray(e)||(e=[e]);for(var t=null,i=0,r=e;i<r.length;i++){var n=r[i];t=this._removeFromList(n)}return t},e.prototype.byType=function(e,t){for(var i=0,r=this.symbolLevels;i<r.length;i++)for(var n=0,o=r[i].zLevels;n<o.length;n++){var s=o[n].geometryDPInfo,a=this.getDPInfoType(e);if(s[a])for(var l=0,u=s[a];l<u.length;l++)t(u[l])}},e.prototype.clone=function(){for(var t=new e(this.unified),i=0,r=this.symbolLevels;i<r.length;i++){var n=r[i];t.symbolLevels.push(n.clone())}return t},e.prototype.splitAfter=function(e){for(var t=this._getDisplayList(e.symbolLevel,e.zOrder,e.geometryType),i=t.length,r=e.indexFrom+e.indexCount,n=0;n<i;++n){var o=t[n];if(o.geometryType===e.geometryType&&r>o.indexFrom&&r<=o.indexFrom+o.indexCount){if(r<o.indexFrom+o.indexCount){var s=new c;s.geometryType=o.geometryType,s.materialInfo=o.materialInfo,s.indexFrom=r,s.indexCount=o.indexFrom+o.indexCount-r,t.splice(n+1,0,s),o.indexCount=r-o.indexFrom}return n}}},e.prototype._addToList=function(e,t){var i=e.symbolLevel,r=e.zOrder,n=this._getDisplayList(i,r,e.geometryType),o=null!=t?t:n.length-1,a=0<=o&&o<n.length?n[o]:null;if(null===a||!s.isSameMaterialInfo(a.materialInfo,e.materialInfo)||a.indexFrom+a.indexCount!==e.indexFrom||this.unified&&a.geometryType!==e.geometryType){var u=new c;u.indexFrom=e.indexFrom,u.indexCount=e.indexCount,u.materialInfo=e.materialInfo,u.geometryType=e.geometryType,l(n,o+1,0,u)}else a.indexCount+=e.indexCount},e.prototype._removeFromList=function(e){for(var t=e.symbolLevel,i=e.zOrder,r=this._getDisplayList(t,i,e.geometryType),n=r.length,s=void 0,a=0;a<n;++a){var u=r[a];if(e.indexFrom+e.indexCount>u.indexFrom&&e.indexFrom<u.indexFrom+u.indexCount&&(!this.unified||u.geometryType===e.geometryType)){s=a;break}}if(void 0===s)return null;if(u=r[s],e.indexFrom===u.indexFrom)return u.indexCount-=e.indexCount,u.indexFrom+=e.indexCount,0===u.indexCount&&l(r,s,1),s-1;if(e.indexFrom+e.indexCount===u.indexFrom+u.indexCount)return u.indexCount-=e.indexCount,0===u.indexCount?(l(r,s,1),s-1):s;var h=u.indexFrom,d=e.indexFrom-u.indexFrom,f=e.indexCount,p=u.indexFrom+u.indexCount-(e.indexFrom+e.indexCount);u.indexCount=d;var _=new c;return _.geometryType=u.geometryType,_.materialInfo=new o.default,_.materialInfo.copy(u.materialInfo),_.indexFrom=h+d+f,_.indexCount=p,l(r,s+1,0,_),s},e.prototype._getDisplayList=function(e,t,i){for(var r,o,s=this.symbolLevels.length,a=0;a<s;a++)if(this.symbolLevels[a].symbolLevel===e){r=this.symbolLevels[a];break}r||((r=new p).symbolLevel=e,this.symbolLevels.push(r));for(var l,u=r.zLevels.length,h=0;h<u;h++)if(r.zLevels[h].zLevel===t){o=r.zLevels[h];break}if(o||((o=new f).geometryDPInfo=new d,o.zLevel=t,r.zLevels.push(o)),this.unified)o.geometryDPInfo.unified||(o.geometryDPInfo.unified=[]),l=o.geometryDPInfo.unified;else switch(i){case n.WGLGeometryType.FILL:o.geometryDPInfo.fill||(o.geometryDPInfo.fill=[]),l=o.geometryDPInfo.fill;break;case n.WGLGeometryType.LINE:o.geometryDPInfo.line||(o.geometryDPInfo.line=[]),l=o.geometryDPInfo.line;break;case n.WGLGeometryType.MARKER:o.geometryDPInfo.marker||(o.geometryDPInfo.marker=[]),l=o.geometryDPInfo.marker;break;case n.WGLGeometryType.TEXT:o.geometryDPInfo.text||(o.geometryDPInfo.text=[]),l=o.geometryDPInfo.text;break;case n.WGLGeometryType.LABEL:o.geometryDPInfo.label||(o.geometryDPInfo.label=[]),l=o.geometryDPInfo.label;break;default:console.error("Trying to add a record with geometry type '"+i+"'.")}return l},e.prototype.getDPInfoType=function(e){if(this.unified)return"unified";switch(e){case n.WGLGeometryType.FILL:return"fill";case n.WGLGeometryType.LINE:return"line";case n.WGLGeometryType.MARKER:return"marker";case n.WGLGeometryType.TEXT:return"text";case n.WGLGeometryType.LABEL:return"label";default:a.error("DisplayList: Tried to convert unknown geometryType: "+e)}},e}(),c=function(){function e(){this.materialInfo=null,this.indexFrom=0,this.indexCount=0}return e.prototype.clone=function(){var t=new e;return t.geometryType=this.geometryType,t.materialInfo=new o.default,t.materialInfo.copy(this.materialInfo),t.indexFrom=this.indexFrom,t.indexCount=this.indexCount,t},e}(),d=function(){function e(){this.fill=null,this.line=null,this.marker=null,this.text=null,this.label=null,this.unified=null}return e.prototype.clone=function(){var t=new e;return t.fill=this.fill&&this.fill.map(function(e){return e.clone()}),t.line=this.line&&this.line.map(function(e){return e.clone()}),t.marker=this.marker&&this.marker.map(function(e){return e.clone()}),t.text=this.text&&this.text.map(function(e){return e.clone()}),t.label=this.label&&this.label.map(function(e){return e.clone()}),t.unified=this.unified&&this.unified.map(function(e){return e.clone()}),t},e}(),f=function(){function e(){this.geometryDPInfo=new d}return e.prototype.clone=function(){var t=new e;return t.zLevel=this.zLevel,t.geometryDPInfo=this.geometryDPInfo.clone(),t},e}(),p=function(){function e(){this.zLevels=[]}return e.prototype.clone=function(){var t=new e;t.symbolLevel=this.symbolLevel;for(var i=0,r=this.zLevels;i<r.length;i++){var n=r[i];t.zLevels.push(n.clone())}return t},e}();return h}.apply(null,r))||(e.exports=n)},1663:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(437),i(120),i(82),i(450),i(143)],void 0===(n=function(e,t,i,r,n,o,s){function a(e,t){var i=e.bounds,r=t.bounds;return e.key.id!==t.key.id&&e.key.world===t.key.world&&i[0]<=r[0]&&i[1]<=r[1]&&i[2]>=r[2]&&i[3]>=r[3]}Object.defineProperty(t,"__esModule",{value:!0}),t.isParentOf=a,t.isChildOf=function(e,t){return a(t,e)};var l=function(){function e(e,t){this.bounds=n.create(),this.key=new s(0,0,0,0),this.objectIds=new i.default,this.key.set(t);var r=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=r.resolution,this.scale=r.scale,this.level=r.level,this.needsClear=!0}return Object.defineProperty(e.prototype,"id",{get:function(){return this.key.id},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this.tileInfoView,this.id)},e.prototype.createChildTiles=function(){for(var t=this.key.getChildKeys(),i=r.acquire(),n=0;n<t.length;n++)i[n]=new e(this.tileInfoView,t[n]);return i},e.prototype.getQuantizationParameters=function(){return o.default.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})},e}();t.Tile=l,t.default=l}.apply(null,r))||(e.exports=n)},1666:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1517),i(1643),i(1647)],void 0===(n=function(e,t,i,r,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t,i){this.ratio=e,this.x=t,this.y=i},s=function(){function e(e,t,r,n,o){void 0===n&&(n=8),void 0===o&&(o=8),this.lines=[],this.starts=[],this.pixelRatio=n,this.pixelMargin=o,this.tileSize=i.TILE_SIZE*n,this.dz=e,this.yPos=t,this.xPos=r}return e.prototype.setExtent=function(e){this.finalRatio=this.tileSize/e*(1<<this.dz);var t=this.pixelRatio*this.pixelMargin;t/=this.finalRatio;var i=e>>this.dz;i<t&&(t=i),this.margin=t,this.xmin=i*this.xPos-t,this.ymin=i*this.yPos-t,this.xmax=this.xmin+i+2*t,this.ymax=this.ymin+i+2*t},e.prototype.reset=function(e){this.type=e,this.lines=[],this.starts=[],this.line=null,this.start=0},e.prototype.moveTo=function(e,t){this._pushLine(),this._prevIsIn=this._isIn(e,t),this._moveTo(e,t,this._prevIsIn),this._prevPt=new r.Point(e,t),this._firstPt=new r.Point(e,t),this._dist=0},e.prototype.lineTo=function(e,t){var i,n,s,a,l,u,h,c,d=this._isIn(e,t),f=new r.Point(e,t),p=r.Point.distance(this._prevPt,f);if(d)this._prevIsIn?this._lineTo(e,t,!0):(i=this._prevPt,n=f,s=this._intersect(n,i),this.start=this._dist+p*(1-this._r),this._lineTo(s.x,s.y,!0),this._lineTo(n.x,n.y,!0));else if(this._prevIsIn)n=this._prevPt,i=f,s=this._intersect(n,i),this._lineTo(s.x,s.y,!0),this._lineTo(i.x,i.y,!1);else{var _=this._prevPt,v=f;if(_.x<=this.xmin&&v.x<=this.xmin||_.x>=this.xmax&&v.x>=this.xmax||_.y<=this.ymin&&v.y<=this.ymin||_.y>=this.ymax&&v.y>=this.ymax)this._lineTo(v.x,v.y,!1);else{var m=[];if((_.x<this.xmin&&v.x>this.xmin||_.x>this.xmin&&v.x<this.xmin)&&(a=(this.xmin-_.x)/(v.x-_.x),(c=_.y+a*(v.y-_.y))<=this.ymin?u=!1:c>=this.ymax?u=!0:m.push(new o(a,this.xmin,c))),(_.x<this.xmax&&v.x>this.xmax||_.x>this.xmax&&v.x<this.xmax)&&(a=(this.xmax-_.x)/(v.x-_.x),(c=_.y+a*(v.y-_.y))<=this.ymin?u=!1:c>=this.ymax?u=!0:m.push(new o(a,this.xmax,c))),(_.y<this.ymin&&v.y>this.ymin||_.y>this.ymin&&v.y<this.ymin)&&(a=(this.ymin-_.y)/(v.y-_.y),(h=_.x+a*(v.x-_.x))<=this.xmin?l=!1:h>=this.xmax?l=!0:m.push(new o(a,h,this.ymin))),(_.y<this.ymax&&v.y>this.ymax||_.y>this.ymax&&v.y<this.ymax)&&(a=(this.ymax-_.y)/(v.y-_.y),(h=_.x+a*(v.x-_.x))<=this.xmin?l=!1:h>=this.xmax?l=!0:m.push(new o(a,h,this.ymax))),0===m.length)l?u?this._lineTo(this.xmax,this.ymax,!0):this._lineTo(this.xmax,this.ymin,!0):u?this._lineTo(this.xmin,this.ymax,!0):this._lineTo(this.xmin,this.ymin,!0);else if(1<m.length&&m[0].ratio>m[1].ratio)this.start=this._dist+p*m[1].ratio,this._lineTo(m[1].x,m[1].y,!0),this._lineTo(m[0].x,m[0].y,!0);else{this.start=this._dist+p*m[0].ratio;for(var g=0;g<m.length;g++)this._lineTo(m[g].x,m[g].y,!0)}this._lineTo(v.x,v.y,!1)}}this._dist+=p,this._prevIsIn=d,this._prevPt=f},e.prototype.close=function(){if(2<this.line.length){var e=this._firstPt,t=this._prevPt;e.x===t.x&&e.y===t.y||this.lineTo(e.x,e.y);for(var i=this.line,r=i.length;4<=r&&(i[0].x===i[1].x&&i[0].x===i[r-2].x||i[0].y===i[1].y&&i[0].y===i[r-2].y);)i.pop(),i[0].x=i[r-2].x,i[0].y=i[r-2].y,--r}},e.prototype.result=function(e){return void 0===e&&(e=!0),this._pushLine(),0===this.lines.length?null:(3===this.type&&e&&l.simplify(this.tileSize,this.margin*this.finalRatio,this.lines),this.lines)},e.prototype.resultWithStarts=function(){if(2!==this.type)throw new Error("Only valid for lines");this._pushLine();var e=this.lines,t=e.length;if(0===t)return null;for(var i=[],r=0;r<t;r++)i.push({line:e[r],start:this.starts[r]||0});return i},e.prototype._isIn=function(e,t){return e>=this.xmin&&e<=this.xmax&&t>=this.ymin&&t<=this.ymax},e.prototype._intersect=function(e,t){var i,n,o;if(t.x>=this.xmin&&t.x<=this.xmax)o=((n=t.y<=this.ymin?this.ymin:this.ymax)-e.y)/(t.y-e.y),i=e.x+o*(t.x-e.x);else if(t.y>=this.ymin&&t.y<=this.ymax)o=((i=t.x<=this.xmin?this.xmin:this.xmax)-e.x)/(t.x-e.x),n=e.y+o*(t.y-e.y);else{n=t.y<=this.ymin?this.ymin:this.ymax;var s=((i=t.x<=this.xmin?this.xmin:this.xmax)-e.x)/(t.x-e.x),a=(n-e.y)/(t.y-e.y);s<a?(o=s,n=e.y+s*(t.y-e.y)):(o=a,i=e.x+a*(t.x-e.x))}return this._r=o,new r.Point(i,n)},e.prototype._pushLine=function(){this.line&&(1===this.type?0<this.line.length&&(this.lines.push(this.line),this.starts.push(this.start)):2===this.type?1<this.line.length&&(this.lines.push(this.line),this.starts.push(this.start)):3===this.type&&3<this.line.length&&(this.lines.push(this.line),this.starts.push(this.start))),this.line=[],this.start=0},e.prototype._moveTo=function(e,t,i){3!==this.type?i&&(e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),this.line.push(new r.Point(e,t))):(i||(e<this.xmin&&(e=this.xmin),e>this.xmax&&(e=this.xmax),t<this.ymin&&(t=this.ymin),t>this.ymax&&(t=this.ymax)),e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),this.line.push(new r.Point(e,t)),this._is_h=!1,this._is_v=!1)},e.prototype._lineTo=function(e,t,i){var n,o;if(3!==this.type)if(i){if(e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),0<this.line.length&&(n=this.line[this.line.length-1]).equals(e,t))return;this.line.push(new r.Point(e,t))}else this.line&&0<this.line.length&&this._pushLine();else if(i||(e<this.xmin&&(e=this.xmin),e>this.xmax&&(e=this.xmax),t<this.ymin&&(t=this.ymin),t>this.ymax&&(t=this.ymax)),e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),this.line&&0<this.line.length){var s=(n=this.line[this.line.length-1]).x===e,a=n.y===t;if(s&&a)return;this._is_h&&s?(n.x=e,n.y=t,(o=this.line[this.line.length-2]).x===e&&o.y===t?(this.line.pop(),this.line.length<=1?(this._is_h=!1,this._is_v=!1):(o=this.line[this.line.length-2],this._is_h=o.x===e,this._is_v=o.y===t)):(this._is_h=o.x===e,this._is_v=o.y===t)):this._is_v&&a?(n.x=e,n.y=t,(o=this.line[this.line.length-2]).x===e&&o.y===t?(this.line.pop(),this.line.length<=1?(this._is_h=!1,this._is_v=!1):(o=this.line[this.line.length-2],this._is_h=o.x===e,this._is_v=o.y===t)):(this._is_h=o.x===e,this._is_v=o.y===t)):(this.line.push(new r.Point(e,t)),this._is_h=s,this._is_v=a)}else this.line.push(new r.Point(e,t))},e}();t.TileClipper=s;var a=function(){function e(){}return e.prototype.setExtent=function(e){this._ratio=4096===e?1:4096/e},e.prototype.reset=function(e){this.type=e,this.lines=[],this.line=null},e.prototype.moveTo=function(e,t){this.line&&this.lines.push(this.line),this.line=[];var i=this._ratio;this.line.push(new r.Point(Math.round(e*i),Math.round(t*i)))},e.prototype.lineTo=function(e,t){var i=this._ratio;this.line.push(new r.Point(Math.round(e*i),Math.round(t*i)))},e.prototype.close=function(){var e=this.line;e&&!e[0].isEqual(e[e.length-1])&&e.push(e[0])},e.prototype.result=function(){return this.line&&this.lines.push(this.line),0===this.lines.length?null:(3===this.type&&1!==this._ratio&&l.simplify(4096,64,this.lines),this.lines)},e}();t.SimpleBuilder=a;var l=function(){function e(){}return e.simplify=function(t,i,r){if(r){for(var n=-i,o=t+i,s=-i,a=t+i,l=[],u=[],h=r.length,c=0;c<h;++c){var d=r[c];if(d&&!(d.length<2))for(var f=d[0],p=void 0,_=d.length,v=1;v<_;++v)p=d[v],f.x===p.x&&(f.x<=n&&(f.y>p.y?(l.push(c),l.push(v),l.push(0),l.push(-1)):(u.push(c),u.push(v),u.push(0),u.push(-1))),f.x>=o&&(f.y<p.y?(l.push(c),l.push(v),l.push(1),l.push(-1)):(u.push(c),u.push(v),u.push(1),u.push(-1)))),f.y===p.y&&(f.y<=s&&(f.x<p.x?(l.push(c),l.push(v),l.push(2),l.push(-1)):(u.push(c),u.push(v),u.push(2),u.push(-1))),f.y>=a&&(f.x>p.x?(l.push(c),l.push(v),l.push(3),l.push(-1)):(u.push(c),u.push(v),u.push(3),u.push(-1)))),f=p}if(0!==l.length&&0!==u.length){e.fillParent(r,u,l),e.fillParent(r,l,u);var m=[];e.calcDeltas(m,u,l),e.calcDeltas(m,l,u),e.addDeltas(m,r)}}},e.fillParent=function(e,t,i){for(var r=i.length,o=t.length,s=0;s<o;s+=4){for(var a=t[s],l=t[s+1],u=t[s+2],h=e[a][l-1],c=e[a][l],d=8092,f=-1,p=0;p<r;p+=4)if(i[p+2]===u){var _=i[p],v=i[p+1],m=e[_][v-1],g=e[_][v];switch(u){case 0:case 1:n.between(h.y,m.y,g.y)&&n.between(c.y,m.y,g.y)&&(y=Math.abs(g.y-m.y))<d&&(d=y,f=p);break;case 2:case 3:var y;n.between(h.x,m.x,g.x)&&n.between(c.x,m.x,g.x)&&(y=Math.abs(g.x-m.x))<d&&(d=y,f=p)}}t[s+3]=f}},e.calcDeltas=function(t,i,r){for(var n=i.length,o=0;o<n;o+=4){var s=e.calcDelta(o,i,r,[]);t.push(i[o]),t.push(i[o+1]),t.push(i[o+2]),t.push(s)}},e.calcDelta=function(t,i,r,n){var o=i[t+3];if(-1===o)return 0;var s=n.length;return 1<s&&n[s-2]===o?0:(n.push(o),e.calcDelta(o,r,i,n)+1)},e.addDeltas=function(e,t){for(var i=e.length,r=0,n=0;n<i;n+=4)r<(a=e[n+3])&&(r=a);for(n=0;n<i;n+=4){var o=t[e[n]],s=e[n+1],a=r-e[n+3];switch(e[n+2]){case 0:o[s-1].x-=a,o[s].x-=a,1===s&&(o[o.length-1].x-=a),s===o.length-1&&(o[0].x-=a);break;case 1:o[s-1].x+=a,o[s].x+=a,1===s&&(o[o.length-1].x+=a),s===o.length-1&&(o[0].x+=a);break;case 2:o[s-1].y-=a,o[s].y-=a,1===s&&(o[o.length-1].y-=a),s===o.length-1&&(o[0].y-=a);break;case 3:o[s-1].y+=a,o[s].y+=a,1===s&&(o[o.length-1].y+=a),s===o.length-1&&(o[0].y+=a)}}},e}(),u=function(){function e(){this.linesIn=[],this.linesOut=[]}return e.prototype.cut=function(e,t){var i;if(this.xCut=t,e.rings)this.closed=!0,i=e.rings,this.minPts=4;else{if(!e.paths)return null;this.closed=!1,i=e.paths,this.minPts=2}for(var r=0,n=i;r<n.length;r++)if((p=n[r])&&!(p.length<this.minPts)){for(var o=!0,s=0,a=p;s<a.length;s++){var l=a[s];o?(this.moveTo(l),o=!1):this.lineTo(l)}this.closed&&this.close()}this._pushLineIn(),this._pushLineOut(),i=[];for(var u=0,h=this.linesIn;u<h.length;u++)(p=h[u])&&p.length>=this.minPts&&i.push(p);for(var c=-2*this.xCut,d=0,f=this.linesOut;d<f.length;d++){var p;if((p=f[d])&&p.length>=this.minPts){for(var _=0,v=p;_<v.length;_++)(l=v[_])[0]+=c;i.push(p)}}return this.closed?e.rings=i:e.paths=i,e},e.prototype.moveTo=function(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e},e.prototype.lineTo=function(e){var t=this._side(e[0]);if(t*this._prevSide==-1){var i=this._intersect(this._prevPt,e);this._lineTo(this.xCut,i,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e},e.prototype.close=function(){var e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this.lineIn),this._checkClosingPt(this.lineOut)},e.prototype._moveTo=function(e,t,i){this.closed?(this.lineIn.push([i<=0?e:this.xCut,t]),this.lineOut.push([0<=i?e:this.xCut,t])):(i<=0&&this.lineIn.push([e,t]),0<=i&&this.lineOut.push([e,t]))},e.prototype._lineTo=function(e,t,i){this.closed?(this._addPolyVertex(this.lineIn,i<=0?e:this.xCut,t),this._addPolyVertex(this.lineOut,0<=i?e:this.xCut,t)):i<0?(0===this._prevSide&&this._pushLineOut(),this.lineIn.push([e,t])):0<i?(0===this._prevSide&&this._pushLineIn(),this.lineOut.push([e,t])):this._prevSide<0?(this.lineIn.push([e,t]),this.lineOut.push([e,t])):0<this._prevSide&&(this.lineOut.push([e,t]),this.lineIn.push([e,t]))},e.prototype._addPolyVertex=function(e,t,i){var r=e.length;1<r&&e[r-1][0]===t&&e[r-2][0]===t?e[r-1][1]=i:e.push([t,i])},e.prototype._checkClosingPt=function(e){var t=e.length;3<t&&e[0][0]===this.xCut&&e[t-2][0]===this.xCut&&e[1][0]===this.xCut&&(e[0][1]=e[t-2][1],e.pop())},e.prototype._side=function(e){return e<this.xCut?-1:e>this.xCut?1:0},e.prototype._intersect=function(e,t){var i=(this.xCut-e[0])/(t[0]-e[0]);return e[1]+i*(t[1]-e[1])},e.prototype._pushLineIn=function(){this.lineIn&&this.lineIn.length>=this.minPts&&this.linesIn.push(this.lineIn),this.lineIn=[]},e.prototype._pushLineOut=function(){this.lineOut&&this.lineOut.length>=this.minPts&&this.linesOut.push(this.lineOut),this.lineOut=[]},e}();t.CutVertical=u}.apply(null,r))||(e.exports=n)},1668:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this._listeners={}}return e.prototype.on=function(e,t){var i=this;null==this._listeners[e]&&(this._listeners[e]=new Map);var r={};return this._listeners[e].set(r,t),{remove:function(){return i._listeners[e].delete(r)}}},e.prototype.once=function(e,t){var i=this.on(e,function(e){i.remove(),t(e)});return i},e.prototype.emit=function(e,t){this.hasEventListener(e)&&this._listeners[e].forEach(function(e){return e(t)})},e.prototype.hasEventListener=function(e){return null!=this._listeners[e]&&this._listeners[e].size>0},e}();t.default=i}.apply(null,r))||(e.exports=n)},1729:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1909),i(1879)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=new r(function(e){var t=i;return e.split("/").forEach(function(e){t&&(t=t[e])}),t});t.resolveIncludes=function(e){return n.resolveIncludes(e)}}.apply(null,r))||(e.exports=n)},1731:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(30),i(70),i(289),i(1490)],void 0===(n=function(e,t,i,r,n,o){function s(e,t){var i=t.length;if(e<t[0].value||1===i)return t[0].size;for(var r=1;r<i;r++)if(e<t[r].value){var n=(e-t[r-1].value)/(t[r].value-t[r-1].value);return t[r-1].size+n*(t[r].size-t[r-1].size)}return t[i-1].size}return function(){function e(){this.symbolLevels=[],this.vvColorValues=new Float32Array(8),this.vvColors=new Float32Array(32),this.vvOpacityValues=new Float32Array(8),this.vvOpacities=new Float32Array(8),this.vvSizeMinMaxValue=new Float32Array(4),this.vvSizeFieldStopsValues=new Float32Array(6),this.vvSizeFieldStopsSizes=new Float32Array(6),this._vvMaterialParameters={vvSizeEnabled:!1,vvColorEnabled:!1,vvRotationEnabled:!1,vvRotationType:"geographic",vvOpacityEnabled:!1},this.symbolLevels.push(0)}return Object.defineProperty(e.prototype,"vvMaterialParameters",{get:function(){return this._vvMaterialParameters},enumerable:!0,configurable:!0}),e.prototype.updateVisualVariables=function(e,t){var a=this._vvMaterialParameters;if(a.vvOpacityEnabled=!1,a.vvSizeEnabled=!1,a.vvColorEnabled=!1,a.vvRotationEnabled=!1,e){var l=e.size;if(l){if(a.vvSizeEnabled=!0,l.minMaxValue){var u=l.minMaxValue,h=void 0,c=void 0;if(o.isDefined(u.minSize)&&o.isDefined(u.maxSize))if(o.isNumber(u.minSize)&&o.isNumber(u.maxSize))h=i.pt2px(u.minSize),c=i.pt2px(u.maxSize);else{var d=t.scale;h=i.pt2px(s(d,u.minSize.stops)),c=i.pt2px(s(d,u.maxSize.stops))}this.vvSizeMinMaxValue.set([u.minDataValue,u.maxDataValue,h,c])}if(l.scaleStops&&(this.vvSizeScaleStopsValue=i.pt2px(s(t.scale,l.scaleStops.stops))),l.unitValue){var f=r.getMetersPerUnitForSR(t.spatialReference)/n.meterIn[l.unitValue.unit];this.vvSizeUnitValueToPixelsRatio=f/t.resolution}l.fieldStops&&(this.vvSizeFieldStopsValues.set(l.fieldStops.values),this.vvSizeFieldStopsSizes.set(l.fieldStops.sizes))}var p=e.color;p&&(a.vvColorEnabled=!0,this.vvColorValues.set(p.values),this.vvColors.set(p.colors));var _=e.opacity;_&&(a.vvOpacityEnabled=!0,this.vvOpacityValues.set(_.values),this.vvOpacities.set(_.opacities));var v=e.rotation;v&&(a.vvRotationEnabled=!0,a.vvRotationType=v.type)}},e}()}.apply(null,r))||(e.exports=n)},1732:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1733),i(1734),i(1735),i(1490),i(1490),i(1662),i(1649),i(1778),i(1644),i(1736),i(1639),i(1737)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f){var p=new i.default,_=new i.default;function v(e,t){var i={};for(var r in e){var n={data:s.allocateTypedArrayBuffer(t,e[r]),stride:e[r]};i[r]=n}return i}return function(){function e(){this.tileDisplayData=null,this.tileBufferData=null}return e.prototype.reshuffle=function(){p.reset();var t=n.groupRecordsByGeometryType(this.tileDisplayData.displayObjects);for(var i in t)for(var a=0,l=b=t[i];a<l.length;a++){var u=l[a];p.needMore(u.geometryType,u.meshData?u.meshData.vertexCount:u.vertexCount,u.meshData?u.meshData.indexData.length:u.indexCount)}var h=t.length,c=new r;for(i=0;i<h;++i){c.geometries[i].indexBuffer=new Uint32Array(Math.round(1.15*p.indicesFor(i)));var d=[];for(var f in this.tileBufferData.geometries[i].vertexBuffer)d.push(this.tileBufferData.geometries[i].vertexBuffer[f].stride);var v=e._computeVertexAlignment(d),m=Math.round(1.15*p.verticesFor(i)),g=e._align(m,v);for(var y in this.tileBufferData.geometries[i].vertexBuffer){var x=this.tileBufferData.geometries[i].vertexBuffer[y].stride;c.geometries[i].vertexBuffer[y]={stride:x,data:s.allocateTypedArrayBuffer(g,x)}}}for(_.reset(),this.tileDisplayData.displayList.clear(),i=0;i<h;++i){for(var b,S=0,T=b=t[i];S<T.length;S++){if((u=T[S]).meshData)u.writeMeshDataToBuffers(_.verticesFor(i),c.geometries[i].vertexBuffer,_.indicesFor(i),c.geometries[i].indexBuffer),u.meshData=null;else{var w=this.tileBufferData.geometries[i].vertexBuffer,E=this.tileBufferData.geometries[i].indexBuffer,V=c.geometries[i].vertexBuffer,I=c.geometries[i].indexBuffer,C=_.verticesFor(i),M=_.indicesFor(i);o.copyMeshData(C,M,V,I,u,w,E),u.vertexFrom=C,u.indexFrom=M}_.needMore(i,u.vertexCount,u.indexCount)}this.tileDisplayData.displayList.unified||this.tileDisplayData.displayList.addToList(b)}if(this.tileDisplayData.displayList.unified)for(var O=0,L=this.tileDisplayData.displayObjects;O<L.length;O++){var A=L[O];this.tileDisplayData.displayList.addToList(A.displayRecords)}this.tileBufferData=c},e.prototype.getStrides=function(){for(var e=[],t=0;t<this.tileBufferData.geometries.length;++t){var i=this.tileBufferData.geometries[t];for(var r in e[t]={},i.vertexBuffer)e[t][r]=i.vertexBuffer[r].stride}return e},e.prototype._guessSize=function(){for(var e=this.tileDisplayData.displayObjects,t=Math.min(e.length,4),i=0,r=0;r<t;r++)i=Math.max(i,e[r].displayRecords.length);return 2*(12*e.length+e.length*i*40)},e.prototype.serialize=function(){var e=this.tileBufferData.serialize(),t=this.tileBufferData.getBuffers(),i=this.tileDisplayData.serialize(new f.default(Int32Array,this._guessSize())).buffer();return t.push(i),{result:{displayData:i,bufferData:e},transferList:t}},e.decode=function(t){var i=h.default.deserialize(new c.default(t.materialStore)),r=d.deserializeList(new c.default(t.displayObjects),a,{store:i}),n={};for(var o in t.vertexBuffersMap)n[o]=u.VertexBuffers.decode(t.vertexBuffersMap[o]);return e.fromMeshData({materials:i,displayObjects:r,vertexBuffersMap:n},!1)},e.fromMeshData=function(t,i){void 0===i&&(i=!0);var o=new e,s=new n.default,a=new r;for(var l in s.displayObjects=t.displayObjects,i&&t.materials.hydrateObjects(s.displayObjects),t.vertexBuffersMap){var u=t.vertexBuffersMap[l];a.geometries[l].indexBuffer=u.indexBuffer,a.geometries[l].vertexBuffer=u.namedBuffers}return o.tileDisplayData=s,o.tileBufferData=a,o},e.bind=function(t,i){var r=new e;return r.tileDisplayData=t,r.tileBufferData=i,r},e.create=function(t,i){var o=new e;o.tileDisplayData=new n.default;for(var s=[0,0,0,0,0],a=[0,0,0,0,0],u=[[],[],[],[],[]],h=0,c=o.tileDisplayData.displayObjects=t;h<c.length;h++)for(var d=0,f=c[h].displayRecords;d<f.length;d++){var p=f[d];u[p.geometryType].push(p),s[p.geometryType]+=p.meshData.vertexCount,a[p.geometryType]+=p.meshData.indexData.length}for(var _,m=new r,g=[(_=i).fill||{},_.line||{},_.icon||{},_.text||{},_.label||{}],y=0;y<5;y++){var x=new Uint32Array(a[y]),b=v(g[y],s[y]);l.writeAllMeshDataToBuffers(u[y],b,x),m.geometries[y]={indexBuffer:x,vertexBuffer:b}}return o.tileBufferData=m,o},e._align=function(e,t){var i=e%t;return 0===i?e:e+(t-i)},e._computeVertexAlignment=function(e){for(var t=!1,i=!1,r=0,n=e;r<n.length;r++){var o=n[r];o%4==2?t=!0:o%4!=0&&(i=!0)}return i?4:t?2:1},e}()}.apply(null,r))||(e.exports=n)},1733:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this._byGeometryType=null}return Object.defineProperty(e.prototype,"satisfied",{get:function(){return!this._byGeometryType},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this._byGeometryType=null},e.prototype.verticesFor=function(e){return this._byGeometryType?this._byGeometryType[e].vertices:0},e.prototype.indicesFor=function(e){return this._byGeometryType?this._byGeometryType[e].indices:0},e.prototype.needMore=function(e,t,i){if(t||i){this._byGeometryType||(this._byGeometryType=[{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0}]);var r=this._byGeometryType[e];r.vertices+=t,r.indices+=i}},e}();t.default=i}.apply(null,r))||(e.exports=n)},1734:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1490)],void 0===(n=function(e,t,i){return function(){function e(){this.geometries=[{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}}]}return e.deserialize=function(t){for(var r=new e,n=0;n<5;++n)for(var o in r.geometries[n].indexBuffer=new Uint32Array(t.geometries[n].indexBuffer),r.geometries[n].vertexBuffer={},t.geometries[n].vertexBuffer)r.geometries[n].vertexBuffer[o]={data:i.allocateTypedArrayBufferwithData(t.geometries[n].vertexBuffer[o].data,t.geometries[n].vertexBuffer[o].stride),stride:t.geometries[n].vertexBuffer[o].stride};return r},e.prototype.serialize=function(){for(var e={geometries:[{indexBuffer:this.geometries[0].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[1].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[2].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[3].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[4].indexBuffer.buffer,vertexBuffer:{}}]},t=0;t<5;++t)for(var i in this.geometries[t].vertexBuffer)e.geometries[t].vertexBuffer[i]={data:this.geometries[t].vertexBuffer[i].data.buffer,stride:this.geometries[t].vertexBuffer[i].stride};return e},e.prototype.getBuffers=function(){for(var e=[],t=0;t<5;++t)for(var i in e.push(this.geometries[t].indexBuffer.buffer),this.geometries[t].vertexBuffer)e.push(this.geometries[t].vertexBuffer[i].data.buffer);return e},e}()}.apply(null,r))||(e.exports=n)},1735:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1648),i(1662),i(1644),i(1639)],void 0===(n=function(e,t,i,r,n,o){function s(e){for(var t=[[],[],[],[],[]],i=0,r=e;i<r.length;i++)for(var n=0,o=r[i].displayRecords;n<o.length;n++){var s=o[n];t[s.geometryType].push(s)}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.groupRecordsByGeometryType=s;var a=function(){function e(){}return Object.defineProperty(e.prototype,"displayObjectRegistry",{get:function(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(var e=0,t=this.displayObjects;e<t.length;e++){var i=t[e];this._displayObjectRegistry.set(i.id,i)}}return this._displayObjectRegistry},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayList",{get:function(){return this._displayList},enumerable:!0,configurable:!0}),e.prototype.computeDisplayList=function(e){if(this._displayList=new i(e),e)for(var t=0,r=this.displayObjects;t<r.length;t++)for(var n=0,o=r[t].displayRecords;n<o.length;n++){var a=o[n];this._displayList.addToList(a)}else for(var l=s(this.displayObjects),u=l.length,h=0;h<u;++h){var c=l[h];this._displayList.addToList(c)}},e.prototype.serialize=function(e){return this.materialStore.serialize(e),o.serializeList(e,this.displayObjects),e},e.prototype._deserializeObjects=function(e){for(var t=e.readInt32(),i=new Array(t),n=new Map,o={store:this.materialStore},s=0;s<i.length;++s){var a=r.deserialize(e,o);i[s]=a,n.set(a.id,a)}this.displayObjects=i,this._displayList=null,this._displayObjectRegistry=n},e.deserialize=function(t){var i=new e;return i.materialStore=n.default.deserialize(t),i._deserializeObjects(t),i},e}();t.default=a}.apply(null,r))||(e.exports=n)},1736:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this._pos=0,this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer)}return e.prototype.readInt32=function(){return this._i32View[this._pos++]},e.prototype.readF32=function(){return this._f32View[this._pos++]},e}();t.default=i}.apply(null,r))||(e.exports=n)},1738:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1528),i(1517),i(1739),i(1740),i(1493),i(1742),i(1554),i(1490),i(1743),i(1648),i(143)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p){function _(e,t){return e.sortKey-t.sortKey}var v=new Set;return function(e){function t(t,i,n){void 0===n&&(n=!1);var o=e.call(this)||this;return o._data=null,o.hlDisplayList=null,o._displayList=null,o._wglBuffers=null,o._dirtyMap=new s.default,o.coords=[0,0],o.bounds=[0,0,0,0],o.tileTransform={transform:r.mat4f32.create(),screenTransform:r.mat2df32.create(),displayCoord:r.vec2f32.create(),screenCoord:r.vec2f32.create()},o.dvsMat3=r.mat3f32.create(),o.tileMat3=r.mat3f32.create(),o.labelMat2d=r.mat2df32.create(),o._labelIndex=null,o._dirty=!0,o.fader=new u.default,o.key=p.pool.acquire(t),o.coords[0]=i[0],o.coords[1]=i[3],o.bounds=i,o._ensureCorrectZOrder=n,o}return i(t,e),Object.defineProperty(t.prototype,"iconGeometry",{get:function(){return this.getGeometry(l.WGLGeometryType.MARKER)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textGeometry",{get:function(){return this.getGeometry(l.WGLGeometryType.TEXT)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fillGeometry",{get:function(){return this.getGeometry(l.WGLGeometryType.FILL)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineGeometry",{get:function(){return this.getGeometry(l.WGLGeometryType.LINE)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelGeometry",{get:function(){return this.getGeometry(l.WGLGeometryType.LABEL)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"displayObjects",{get:function(){return this._data.tileDisplayData.displayObjects},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canDisplay",{get:function(){return!!this.attached},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDirty",{get:function(){return this._dirty},set:function(e){(this._dirty=e)||this.isReady||this.ready(),this.requestRender()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasData",{get:function(){return!!this._data},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelIndex",{get:function(){return this._labelIndex},enumerable:!0,configurable:!0}),t.prototype.getGeometry=function(e){return this._wglBuffers&&this._wglBuffers.has(e)?this._wglBuffers.get(e):null},t.prototype.getDisplayList=function(e){switch(e){case l.WGLDrawPhase.HIGHLIGHT:return this.hlDisplayList;default:return this._data&&this._displayList}},Object.defineProperty(t.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),t.prototype.setData=function(e,t,i){var r=e.addOrUpdate,n=e.remove;if(this.fader.reset(),(e.clear||!this.hasData)&&!e.addOrUpdate)return this.clear(),void this.ready();!e.clear&&this.hasData||!e.addOrUpdate?this.hasData&&this._doPatchData({addOrUpdate:r,remove:n},t,i):(r.tileDisplayData.computeDisplayList(this._ensureCorrectZOrder),this._dirtyMap=new s.default,this._dispRecStore=a.default.fromTileData(r,this._dirtyMap),this._data=r,this._readyTileIfNoLabels(t,i),this._dirtyMap.markAllDirty(),this._displayList||(this._displayList=r.tileDisplayData.displayList.clone()))},t.prototype.commitChanges=function(e){this.isDirty&&this._wglBuffers||(this._wglBuffers||(this._wglBuffers=new d.default(this.stage.context)),this._displayList=this._data.tileDisplayData.displayList.clone(),this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._dirtyMap.markAllClean())},t.prototype.resetVisibility=function(e){var t=this,i=new Array(0),r=new Array(1);e.forEach(function(e){r[0]=e,t.setVisibility(i,r)})},t.prototype.setVisibility=function(e,t){for(var i=this._data.tileBufferData.geometries.map(c.geometryToMappedGeometry),r=0,n=e;r<n.length;r++){var o=n[r];if(p=this._data.tileDisplayData.displayObjectRegistry.get(o))for(var s=0,a=p.displayRecords;s<a.length;s++)if(y=(S=i[(g=a[s]).geometryType]).geometry.vertexBuffer[c.C_VBO_VISIBILITY]){S.vertexFrom=null==S.vertexFrom?g.vertexFrom:Math.min(S.vertexFrom,g.vertexFrom),S.vertexTo=null==S.vertexTo?g.vertexFrom+g.vertexCount:Math.max(S.vertexTo,g.vertexFrom+g.vertexCount);for(var l=g.vertexFrom,u=g.vertexCount,h=0;h<u;++h)y.data[l+h]=255}}for(var d=0,f=t;d<f.length;d++){var p,_=f[d];if(p=this._data.tileDisplayData.displayObjectRegistry.get(_))for(var v=0,m=p.displayRecords;v<m.length;v++){var g,y;if(y=(S=i[(g=m[v]).geometryType]).geometry.vertexBuffer[c.C_VBO_VISIBILITY])for(S.vertexFrom=null==S.vertexFrom?g.vertexFrom:Math.min(S.vertexFrom,g.vertexFrom),S.vertexTo=null==S.vertexTo?g.vertexFrom+g.vertexCount:Math.max(S.vertexTo,g.vertexFrom+g.vertexCount),l=g.vertexFrom,u=g.vertexCount,h=0;h<u;++h)y.data[l+h]=0}}for(var x=!1,b=0;b<i.length;++b){var S;if(null!=(S=i[b]).vertexFrom&&null!=S.vertexTo){var T=S.vertexTo?S.vertexTo-S.vertexFrom:0;this._dirtyMap.markDirtyVertices(b,c.C_VBO_VISIBILITY,S.vertexFrom,T),x=!0}}x&&this.requestRender()},t.prototype.setVisibilityRange=function(e,t,i,r){for(var n=this._data.tileDisplayData.displayObjectRegistry.get(e),o=this._data.tileBufferData.geometries[l.WGLGeometryType.LABEL].vertexBuffer[c.C_VBO_VISIBILITY_RANGE],s=1/0,a=0,u=t;u<t+i;++u){for(var d=n.displayRecords[u],f=Math.max(d.minZoom,r),p=d.maxZoom,_=h.i8888to32(f,p,f,p),v=d.vertexFrom*o.stride/4,m=d.vertexCount*o.stride/4,g=v;g<v+m;++g)o.data[g]=_;s=Math.min(s,d.vertexFrom),a=Math.max(a,d.vertexFrom+d.vertexCount)}var y=a-s;this._dirtyMap.markDirtyVertices(l.WGLGeometryType.LABEL,c.C_VBO_VISIBILITY_RANGE,s,y)},t.prototype.setTransform=function(e,t){var i=this.tileMat3,n=e.toScreenNoRotation([0,0],this.coords),o=n[0],s=n[1],a=t;r.mat3.set(this.tileMat3,a,0,0,0,a,0,o,s,1),r.mat3.multiply(this.dvsMat3,e.displayViewMat3,i)},t.prototype.setLabelTransform=function(e,t){var i=this.labelMat2d,n=e.getScreenTransform(i,t),o=r.vec2f32.create();r.vec2.transformMat2d(o,this.coords,n),r.mat2d.identity(i),r.mat2d.translate(i,i,o),r.mat2d.multiply(i,e.viewMat2d,i)},t.prototype.clear=function(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null),this.hlDisplayList&&(this.hlDisplayList=null)},t.prototype.attach=function(){return!0},t.prototype.dispose=function(){this.clear()},t.prototype.doRender=function(e){if(this.isReady&&this.hasData){if(this.commitChanges(e),this.stage.context.setStencilFunction(514,this.stencilRef,255),e.drawPhase===l.WGLDrawPhase.MAP||e.drawPhase===l.WGLDrawPhase.LABEL||e.drawPhase===l.WGLDrawPhase.LABEL_ALPHA)this._displayList.replay(e,this);else for(var t=0,i=this.stage.painter.getBrushes(e.drawPhase);t<i.length;t++)i[t].draw(e,this);this.fader.step()||this.requestRender()}},t.prototype.buildHLList=function(e){var t=this;this.hlDisplayList=new f,e.forEach(function(e){t._addToHLDisplayList(t.hlDisplayList,e)})},t.prototype._addToHLDisplayList=function(e,t){if(this._data){var i=this._data.tileDisplayData.displayObjectRegistry.get(t);if(i){for(var r=[],n=0,o=i.displayRecords;n<o.length;n++){var s=o[n].copy();s.meshData=null,s.symbolLevel=0,s.zOrder=0,r.push(s)}r.sort(_),e.addToList(r)}}},t.prototype._readyTileIfNoLabels=function(e,t){this.isDirty=!!e&&(t||(this.isDirty=!1),this._rebuildLabelIndex(),!0)},t.prototype._doPatchData=function(e,t,i){this._patchData(e)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=a.default.fromTileData(this._data,this._dirtyMap)),this._readyTileIfNoLabels(t,i),this.requestRender()},t.prototype._rebuildLabelIndex=function(){this._labelIndex=this._initLabelIndex();for(var e=0,t=this.displayObjects;e<t.length;e++)for(var i=0,r=t[e].metrics;i<r.length;i++){var n=r[i];this._insertIntoLabelIndex(n)}},t.prototype._insertIntoLabelIndex=function(e){-1!==e.xBucket&&this.labelIndex[e.yBucket][e.xBucket].push(e)},t.prototype._initLabelIndex=function(){for(var e=[],t=0;t<o.TILE_SIZE/o.COLLISION_BUCKET_SIZE;t++){e.push([]);for(var i=0;i<o.TILE_SIZE/o.COLLISION_BUCKET_SIZE;i++)e[t].push([])}return e},t.prototype._patchData=function(e){for(var t=!0,i=e.addOrUpdate&&e.addOrUpdate.tileDisplayData&&e.addOrUpdate.tileDisplayData.displayObjects||[],r=(e.remove||[]).slice(),n=0,o=i;n<o.length;n++)null!=(m=o[n]).insertAfter&&r.push(m.id);for(var s=0,a=r;s<a.length;s++){var l=a[s];if(_=this._data.tileDisplayData.displayObjectRegistry.get(l)){this._data.tileDisplayData.displayList.removeFromList(_.displayRecords);for(var u=0,h=_.displayRecords;u<h.length;u++){var c=h[u];this._dispRecStore.delete(c)}this._data.tileDisplayData.displayObjectRegistry.delete(l);var d=this._data.tileDisplayData.displayObjects.indexOf(_);this._data.tileDisplayData.displayObjects.splice(d,1)}}for(var f=0,p=i;f<p.length;f++){var _,m=p[f],g=void 0;if(_=this._data.tileDisplayData.displayObjectRegistry.get(m.id)){var y=_.displayRecords;_.set(m),_.displayRecords=y;for(var x=_.displayRecords.length,b=0;b<x;++b){var S=_.displayRecords[b],T=m.displayRecords[b];(b>=m.displayRecords.length||S.geometryType!==T.geometryType||S.symbolLevel!==T.symbolLevel||S.zOrder!==T.zOrder||S.materialInfo.materialKey!==T.materialInfo.materialKey)&&(this._dispRecStore.delete(_.displayRecords[b]),b<m.displayRecords.length&&(_.displayRecords[b]=void 0))}_.displayRecords.length=m.displayRecords.length,_.metrics=m.metrics}else{(_=m.copy()).displayRecords=[],this._data.tileDisplayData.displayObjectRegistry.set(m.id,_);var w=void 0,E=this._data.tileDisplayData.displayObjects;if(null!=_.insertAfter)if(g={},0<=_.insertAfter){var V=this._data.tileDisplayData.displayObjectRegistry.get(_.insertAfter);V&&(w=E.indexOf(V)+1)<E.length?E.splice(w,0,_):(E.push(_),w=E.length)}else E.unshift(_),w=0;else E.push(_),w=E.length;if(g){var I=void 0;if(this._data.tileDisplayData.displayList.unified)I=0<m.displayRecords.length?1:0;else{v.clear();for(var C=0,M=m.displayRecords;C<M.length;C++){var O=M[C],L=this._data.tileDisplayData.displayList.getDPInfoType(O.geometryType);v.add(L)}I=v.size}var A=0;for(b=w-1;0<=b&&A<I;--b)for(var R=E[b].displayRecords.length-1;0<=R&&A<I;--R){var P=E[b].displayRecords[R];g[L=this._data.tileDisplayData.displayList.getDPInfoType(P.geometryType)]||(g[L]=P,++A)}}}var F=m.displayRecords.length;for(b=0;b<F;++b){T=m.displayRecords[b],(S=_.displayRecords[b])?(S.meshData=T.meshData,S.materialInfo=T.materialInfo):((S=T.copy()).vertexFrom=void 0,S.indexFrom=void 0,_.displayRecords[b]=S);var D=T.geometryType,z=(L=this._data.tileDisplayData.displayList.getDPInfoType(D),e.addOrUpdate.tileBufferData.geometries[D]),G=z.vertexBuffer,N=z.indexBuffer,B=void 0;g&&(B=g[L]?this._data.tileDisplayData.displayList.splitAfter(g[L]):-1),t=this._dispRecStore.setMeshData(S,T,G,N,B)&&t,g&&null!=S.indexFrom&&null!=S.indexFrom&&(g[L]=S)}}return t},t}(n.DisplayObject)}.apply(null,r))||(e.exports=n)},1739:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1490)],void 0===(n=function(e,t,i){function r(e,t,i){if(!e.allDirty)if(null!=e.from&&null!=e.count){var r=Math.min(e.from,t),n=Math.max(e.from+e.count,t+i)-r;e.from=r,e.count=n}else e.from=t,e.count=i}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._dirties=i.createGeometryData(function(e){return{indices:{from:null,count:null,allDirty:!1}}},function(e,t){return{vertices:{from:null,count:null,allDirty:!1}}})}return e.prototype.markAllClean=function(){for(var e=0,t=this._dirties;e<t.length;e++){var i=t[e];for(var r in i.data.indices.from=null,i.data.indices.count=null,i.data.indices.allDirty=!1,i.buffers)i.buffers[r].data.vertices.from=null,i.buffers[r].data.vertices.count=null,i.buffers[r].data.vertices.allDirty=!1}},e.prototype.markAllDirty=function(){for(var e=0,t=this._dirties;e<t.length;e++){var i=t[e];for(var r in i.data.indices.allDirty=!0,i.buffers)i.buffers[r].data.vertices.allDirty=!0}},e.prototype.forEach=function(e){for(var t=0;t<this._dirties.length;++t){var i=this._dirties[t],r={};for(var n in i.buffers){var o=i.buffers[n].data.vertices;(o.allDirty||null!=o.from&&null!=o.count&&0<o.count)&&(r[n]=o)}var s,a=i.data.indices;((s=a.allDirty||null!=a.from&&null!=a.count&&0<a.count?{indices:a,vertices:r}:{indices:null,vertices:r}).indices||0<Object.keys(s).length)&&e(s,t)}},e.prototype.markDirtyIndices=function(e,t,i){r(this._dirties[e].data.indices,t,i)},e.prototype.markDirtyVertices=function(e,t,i,n){r(this._dirties[e].buffers[t].data.vertices,i,n)},e}();t.default=n}.apply(null,r))||(e.exports=n)},1740:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(18),i(1741),i(1490)],void 0===(n=function(e,t,i,r,n){Object.defineProperty(t,"__esModule",{value:!0});var o=["FILL","LINE","MARKER","TEXT","LABEL"],s=function(){function e(e,t,i,o){for(var s in this._strides=e,this._displayList=t,this._freeListsAndStorage={},this._dirtyMap=null,this._dirtyMap=i,e)for(var a in this._freeListsAndStorage[s]={vtxFreeList:o?new r.FreeList(o):null,idxFreeList:o?new r.FreeList(o):null,vertexBuffers:{},indexBuffer:o?new Uint32Array(o):null},e[s])this._freeListsAndStorage[s].vertexBuffers[a]={data:o?n.allocateTypedArrayBuffer(o,e[s][a]):null,stride:e[s][a]}}return e.fromTileData=function(t,i){var s=function(e){var t=e.getStrides(),i={};for(var r in t)i[o[r]]=t[r];return i}(t),a=[0,0,0,0,0],l=[0,0,0,0,0],u=[];t.tileDisplayData.displayObjectRegistry.forEach(function(e){u.push(e)});for(var h=0,c=u;h<c.length;h++)for(var d=0,f=c[h].displayRecords;d<f.length;d++){var p=f[d];a[p.geometryType]=Math.max(a[p.geometryType],p.vertexFrom+p.vertexCount),l[p.geometryType]=Math.max(l[p.geometryType],p.indexFrom+p.indexCount)}for(var _=new e(s,t.tileDisplayData.displayList,i,null),v=0;v<t.tileBufferData.geometries.length;++v){var m=a[v],g=l[v],y=t.tileBufferData.geometries[v],x=o[v],b=_._storageFor(x),S=t.tileBufferData.geometries[v].indexBuffer;b.indexBuffer=S,b.idxFreeList=new r.FreeList(S.length),b.idxFreeList.allocate(g);var T=void 0;for(var w in y.vertexBuffer){var E=t.tileBufferData.geometries[v].vertexBuffer[w];b.vertexBuffers[w].data=E.data,b.vertexBuffers[w].stride=E.stride;var V=n.strideToPackingFactor(E.stride),I=E.data.length*V/E.stride;T||(T=I)}b.vtxFreeList=new r.FreeList(T),b.vtxFreeList.allocate(m)}return _},e.prototype.delete=function(e){var t=o[e.geometryType];this._freeVertices(t,e.vertexFrom,e.vertexCount),this._freeIndices(t,e.indexFrom,e.indexCount),this._displayList.removeFromList(e),e.vertexFrom=void 0,e.indexFrom=void 0},e.prototype.setMeshData=function(e,t,i,r,s){var a=o[e.geometryType];e.meshData=null;var l=void 0,u=void 0;void 0===e.vertexFrom?(u=t.vertexCount,l=this._allocateVertices(a,u)):t.vertexCount>e.vertexCount?(this._freeVertices(a,e.vertexFrom,e.vertexCount),u=t.vertexCount,l=this._allocateVertices(a,u)):u=t.vertexCount===e.vertexCount?(l=e.vertexFrom,e.vertexCount):(this._freeVertices(a,e.vertexFrom+t.vertexCount,e.vertexCount-t.vertexCount),l=e.vertexFrom,t.vertexCount);var h=!0,c=void 0,d=void 0,f=void 0;if(void 0===e.indexFrom?(c=s,f=t.indexCount,d=this._allocateIndices(a,f)):t.indexCount>e.indexCount?(c=this._displayList.removeFromList(e),this._freeIndices(a,e.indexFrom,e.indexCount),f=t.indexCount,d=this._allocateIndices(a,f)):f=t.indexCount===e.indexCount?(h=!1,d=e.indexFrom,e.indexCount):(c=this._displayList.removeFromList(e),this._freeIndices(a,e.indexFrom+t.indexCount,e.indexCount-t.indexCount),d=e.indexFrom,t.indexCount),-1===l||-1===d)return-1!==l&&this._freeVertices(a,l,u),-1!==d&&this._freeIndices(a,d,f),e.setMeshDataFromBuffers(t,i,r),e.vertexFrom=void 0,e.vertexCount=0,e.indexFrom=void 0,e.indexCount=0,!1;var p=this._storageFor(a);if(n.copyMeshData(l,d,p.vertexBuffers,p.indexBuffer,t,i,r),e.vertexFrom=l,e.indexFrom=d,e.vertexCount=t.vertexCount,e.indexCount=t.indexCount,this._dirtyMap)for(var _ in this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount),i)this._dirtyMap.markDirtyVertices(e.geometryType,_,e.vertexFrom,e.vertexCount);return h&&this._displayList.addToList(e,c),!0},e.prototype._allocateVertices=function(e,t){var i=this._storageFor(e),r=i.vtxFreeList.allocate(t);return-1===r?-1:.5<i.vtxFreeList.fragmentation?-1:r},e.prototype._freeVertices=function(e,t,r){var o=this._storageFor(e);if(o.vtxFreeList.free(t,r),i("esri-feature-tiles-debug"))for(var s in o.vertexBuffers)for(var a=o.vertexBuffers[s].data,l=this._stridesFor(e,s),u=n.strideToPackingFactor(l),h=t*l/u,c=r*l/u,d=h;d<h+c;++d)a[d]=0},e.prototype._freeIndices=function(e,t,r){var n=this._storageFor(e);if(n.idxFreeList.free(t,r),i("esri-feature-tiles-debug"))for(var o=n.indexBuffer,s=t;s<t+r;++s)o[s]=0},e.prototype._allocateIndices=function(e,t){var i=this._storageFor(e),r=i.idxFreeList.allocate(t);return-1===r?-1:.5<i.idxFreeList.fragmentation?-1:r},e.prototype._storageFor=function(e){return this._freeListsAndStorage[e]},e.prototype._stridesFor=function(e,t){return this._strides[e][t]},e}();t.default=s}.apply(null,r))||(e.exports=n)},1741:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this._largestRange=null,this._parent=e,this._updateLargestRange()}return Object.defineProperty(e.prototype,"largestRange",{get:function(){return this._largestRange},enumerable:!0,configurable:!0}),e.prototype.rangeCreated=function(e){(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)},e.prototype.rangeResized=function(e,t,i){e===this._largestRange?e.count<i&&this._updateLargestRange():(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)},e.prototype.findBestRange=function(e){for(var t=this._parent._freeHead,i=null;null!==t;)t.count>=e&&(!i||t.count-e<i.count-e)&&(i=t),t=t.next;return i},e.prototype.findAdjacentRanges=function(e,t){for(var i=!0,r=!1,n=null,o=this._parent._freeHead;i&&!r;){var s=null!==n?n.from+n.count:0,a=null!==o?o.from:this._parent._size;s<=e&&e+t<=a?r=!(i=!1):null!==o?o=(n=o).next:i=!1}return[n,o]},e.prototype._updateLargestRange=function(){for(var e=null,t=this._parent._freeHead;null!==t;)(!e||t.count>e.count)&&(e=t),t=t.next;this._largestRange=e},e}(),r=function(){function e(e,t){this._allocated=0,this._size=e,this._freeHead=0<e?{from:0,count:e,prev:null,next:null}:null,this._bookKeeper=t||new i(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}return e.prototype.allocate=function(t){var i=this._bookKeeper.findBestRange(t);if(null===i)return-1;var r=i.from,n=i.count;if(i.from+=t,i.count-=t,this._bookKeeper.rangeResized(i,r,n),this._allocated+=t,0===i.count){var o=null!==i.prev?this._freeHead:i.next;e._removeRange(i),this._freeHead=o}return r},e.prototype.free=function(t,i){var r=this._bookKeeper.findAdjacentRanges(t,i),n=r[0],o=r[1],s={from:t,count:i,prev:n,next:o};if(null!==n&&(n.next=s),null!==o&&(o.prev=s),this._bookKeeper.rangeCreated(s),this._allocated-=i,null!==o&&s.from+s.count===o.from){var a=s.from,l=s.count;e._fuse(s,o),e._removeRange(o),this._bookKeeper.rangeResized(s,a,l),this._bookKeeper.rangeResized(o,void 0,0)}null!==n&&n.from+n.count===s.from&&(a=n.from,l=n.count,e._fuse(n,s),e._removeRange(s),this._bookKeeper.rangeResized(n,a,l),this._bookKeeper.rangeResized(s,void 0,0)),this._freeHead=null!==s.prev?this._freeHead:s},Object.defineProperty(e.prototype,"fragmentation",{get:function(){var e=this._size-this._allocated;return 0===e?0:1-this._bookKeeper.largestRange.count/e},enumerable:!0,configurable:!0}),e._removeRange=function(e){null!==e.prev?null!==e.next?(e.prev.next=e.next,e.next.prev=e.prev):e.prev.next=null:null!==e.next&&(e.next.prev=null)},e._fuse=function(e,t){e.count+=t.count,e.next=t.next,t.from+=t.count,t.count=0,null!==t.next&&(t.next.prev=e)},e}();t.FreeList=r}.apply(null,r))||(e.exports=n)},1742:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){void 0===e&&(e=400),this.duration=e,this._lastTime=0,this._elapsed=0,this._value=0,this._finished=!1}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this._lastTime=0,this._elapsed=0,this._value=0},e.prototype.step=function(){var e=performance.now();if(0===this._lastTime)return this._lastTime=e,!(this._value=0);if(this._elapsed>=this.duration)return!0;var t=e-this._lastTime;return this._elapsed+=t,this._lastTime=e,this._value=Math.min(this._elapsed/this.duration,1),!1},e}();t.default=i}.apply(null,r))||(e.exports=n)},1743:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1490),i(1475)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.geometryMap=i.createGeometryData(function(t){return{indexBuffer:r.createIndex(e,35044),vao:null}},function(t,n){return{vertexBuffer:r.createVertex(e,i.C_VBO_INFO[n])}})}return e.prototype.dispose=function(){for(var e in this.geometryMap){var t=this.geometryMap[e];for(var i in t.data.vao&&t.data.vao.dispose(!1),t.data.indexBuffer&&t.data.indexBuffer.dispose(),t.buffers)t.buffers[i]&&t.buffers[i].data.vertexBuffer.dispose()}},e.prototype.get=function(e){var t=this.geometryMap[e],i={};for(var r in t.buffers)i[r]=t.buffers[r].data.vertexBuffer;return{indexBuffer:t.data.indexBuffer,get vao(){return t.data.vao},set vao(e){t.data.vao=e},vertexBufferMap:i}},e.prototype.has=function(e){return null!=this.geometryMap[e]},e.prototype.upload=function(e,t){var i=this;t.forEach(function(t,r){i._upload(t,r,e)})},e.prototype._upload=function(e,t,i){if(e.indices&&(e.indices.allDirty?this._uploadIndices(i,t):null!=e.indices.from&&null!=e.indices.count&&this._uploadIndices(i,t,e.indices.from,e.indices.count)),e.vertices){var r=e.vertices;for(var n in r){var o=r[n];o.allDirty?this._uploadVertices(i,t,n):null!=o.from&&null!=o.count&&this._uploadVertices(i,t,n,o.from,o.count)}}},e.prototype._uploadVertices=function(e,t,i,r,n){var o=this.geometryMap[t];if(o){var s=e.geometries[t].vertexBuffer[i];if(s){var a=s.stride,l=s.data.buffer;o.buffers[i]&&0<l.byteLength&&(null!=r&&null!=n?o.buffers[i].data.vertexBuffer.setSubData(l,r*a,r*a,(r+n)*a):o.buffers[i].data.vertexBuffer.setData(l))}}},e.prototype._uploadIndices=function(e,t,i,r){var n=this.geometryMap[t];if(n){var o=e.geometries[t].indexBuffer.buffer;n.data.indexBuffer&&0<o.byteLength&&(null!=i&&null!=r?n.data.indexBuffer.setSubData(o,4*i,4*i,4*(i+r)):n.data.indexBuffer.setData(o))}},e}();t.default=n}.apply(null,r))||(e.exports=n)},1744:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1493),i(1779)],void 0===(n=function(e,t,i,r){function n(e,t){void 0===t&&(t=!1);var r=i.WGLVVFlag.SIZE_FIELD_STOPS|i.WGLVVFlag.SIZE_MINMAX_VALUE|i.WGLVVFlag.SIZE_SCALE_STOPS|i.WGLVVFlag.SIZE_UNIT_VALUE,n=(e&(i.WGLVVTarget.FIELD_TARGETS_OUTLINE|i.WGLVVTarget.MINMAX_TARGETS_OUTLINE|i.WGLVVTarget.SCALE_TARGETS_OUTLINE|i.WGLVVTarget.UNIT_TARGETS_OUTLINE))>>>4;return t?r&n:r&~n}function o(e){var t=n(e,!1);return e&(i.WGLVVFlag.COLOR|i.WGLVVFlag.OPACITY|i.WGLVVFlag.ROTATION|t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getVVFlags=function(e){if(!e)return i.WGLVVFlag.NONE;for(var t=0,n=0,o=e;n<o.length;n++){var s=o[n];if("size"===s.type){var a=r.getTypeOfSizeVisualVariable(s);t|=a,"outline"===s.target&&(t|=a<<4)}else"color"===s.type?t|=i.WGLVVFlag.COLOR:"opacity"===s.type?t|=i.WGLVVFlag.OPACITY:"rotation"===s.type&&(t|=i.WGLVVFlag.ROTATION)}return t},t.getSizeFlagsMask=n,t.getMarkerVVFlags=o,t.getFillVVFlags=function(e){return e&(i.WGLVVFlag.COLOR|i.WGLVVFlag.OPACITY)},t.getLineVVFlags=function(e,t){if(t)return e&n(e,!0);var r=n(e,!1);return e&(i.WGLVVFlag.COLOR|i.WGLVVFlag.OPACITY|r)},t.getTextVVFlags=function(e){return o(e)},t.getLabelVVFlags=function(e){return e&n(e,!1)}}.apply(null,r))||(e.exports=n)},1745:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}}.apply(null,r))||(e.exports=n)},1746:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(0),i(437),i(18),i(1667),i(1663),i(1668),i(143)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u){Object.defineProperty(t,"__esModule",{value:!0});var h={added:[],removed:[]},c=new n.default,d=new u(0,0,0,0),f=function(e){function t(t){var i=e.call(this)||this;return i._tiles=new Map,i._index=s(9,o("csp-restrictions")?function(e){return{minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}}:[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),i.tiles=[],i.tileScheme=t,i}return i(t,e),t.prototype.destroy=function(){this._tiles.clear()},t.prototype.has=function(e){return this._tiles.has(e)},t.prototype.get=function(e){return this._tiles.get(e)},t.prototype.findByKey=function(e){return this._tiles.get(e.id)},t.prototype.intersections=function(e,t){var i="string"==typeof e?this.get(e):e;if(!i)return[];for(var r=t*i.resolution,n=i.bounds[0]-r,o=i.bounds[1]-r,s=i.bounds[2]+r,a=i.bounds[3]+r,l=[],u=0,h=this._index.search({minX:n,minY:o,maxX:s,maxY:a});u<h.length;u++){var c=h[u],d=c.bounds.slice();d[0]=Math.max(d[0],n),d[1]=Math.max(d[1],o),d[2]=Math.min(d[2],s),d[3]=Math.min(d[3],a),d[2]-d[0]>0&&d[3]-d[1]>0&&l.push({bounds:d,tile:c})}return l},t.prototype.boundsIntersections=function(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})},t.prototype.setViewState=function(e){var t=this.tileScheme.getTileCoverage(e,0);if(t){var i=t.spans,r=t.lodInfo,n=r.level;if(i.length>0)for(var o=0,s=i;o<s.length;o++)for(var l=s[o],u=l.row,f=l.colFrom,p=l.colTo,_=f;_<=p;_++){var v=d.set(n,u,r.normalizeCol(_),r.getWorldForColumn(_)).id;if(c.add(v),!this.has(v)){var m=new a.default(this.tileScheme,v);this._tiles.set(v,m),this._index.insert(m),this.tiles.push(m),h.added.push(m)}}for(var g=this.tiles.length-1;g>=0;g--){m=this.tiles[g];c.has(m.id)||(this._tiles.delete(m.id),this.tiles.splice(g,1),this._index.remove(m),h.removed.push(m))}(h.added.length||h.removed.length)&&this.emit("update",h),c.clear(),h.added.length=0,h.removed.length=0}},t}(l.default);t.default=f}.apply(null,r))||(e.exports=n)},1762:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.forEachIter=function(e,t){for(;;){var i=e.next(),r=i.value;if(i.done)return;t(r)}}}.apply(null,r))||(e.exports=n)},1763:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1834)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=new i;t.bidiText=function(e){return r.hasBidiChar(e)?(t="rtl"===r.checkContextual(e)?"IDNNN":"ICNNN",[r.bidiTransform(e,t,"VLYSN"),!0]):[e,!1];var t}}.apply(null,r))||(e.exports=n)},1776:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(41),i(16),i(1512),i(95),i(1809),i(6),i(2),i(25),i(54),i(82),i(52),i(63),i(1665),i(1777),i(1732),i(1738),i(1810),i(1644),i(1811),i(1812),i(1746),i(1783),i(1784),i(1645),i(1786)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m,g,y,x,b,S,T,w,E,V,I,C){Object.defineProperty(t,"__esModule",{value:!0});var M=new c,O=new Set,L=[],A=function(e){function t(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=e.apply(this,t)||this;return r._hiddenGraphics=[],r._tiles=new Map,r._graphicStoreUpdate=!1,r._highlightIDs=new Set,r._graphicsSet=new Set,r._matcher=null,r._tileUpdateSet=new Set,r.lastUpdateId=-1,r.updateRequested=!1,r.graphicUpdateHandler=r.graphicUpdateHandler.bind(r),r._addOrUpdateGraphic=r._addOrUpdateGraphic.bind(r),r._processAnalyzedGraphics=r._processAnalyzedGraphics.bind(r),r._graphicsChangeHandler=r._graphicsChangeHandler.bind(r),r}return i(t,e),t.prototype.initialize=function(){var e=this;this._tileStore=new w.default(this.view.featuresTilingScheme),this.container=new m.default({tileInfoView:this.view.featuresTilingScheme,highlightOptions:this.view.highlightOptions,highlightIDs:this._highlightIDs}),this._graphicStore=new V.default(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.renderer,this.graphics),this._graphicProcessingQueue=new E.default({process:this._addOrUpdateGraphic});var t=new b.default,i=new T.default(this.container.getMaterialItems,devicePixelRatio);this.renderer&&(this._matcher=x.createMatcher(this.renderer,t,i,null)),this._meshFactory=new S.default(null,this.uid,null,null,this.view.state.pixelRatio,this.view.spatialReference,t,i,null,this._tileStore.tileScheme.tileInfo),this.watch("renderer",function(r){e._graphicStore.renderer=r,r&&(e._matcher=x.createMatcher(e.renderer,t,i,null))}),this._tileStore.on("update",this._onTileUpdate.bind(this)),this.view.watch("highlightOptions.color,highlightOptions.fillOpacity,highlightOptions.haloOpacity",function(){e.container.requestRender()}),this.container.on("attach",function(){var t=e.graphics.toArray();t.sort(function(t,i){return e.graphics.indexOf(i)-e.graphics.indexOf(t)});for(var i=0,r=t;i<r.length;i++){var n=r[i];e._add(n)}e.handles.add(e.graphics.on("change",e._graphicsChangeHandler),"graphics")})},t.prototype.destroy=function(){this._graphicStore.clear(),this._tileStore.destroy()},Object.defineProperty(t.prototype,"updating",{get:function(){return this._graphicProcessingQueue.updating||this._tileUpdateSet.size>0},enumerable:!0,configurable:!0}),t.prototype.install=function(e){e.addChild(this.container)},t.prototype.uninstall=function(e){e.removeChild(this.container)},t.prototype.addHighlight=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];this._highlightIDs.add(r)}this._buildHLList()},t.prototype.highlight=function(e){var t=this;return t.addHighlight(e),{remove:function(){t.removeHighlight(e)}}},t.prototype.hitTest=function(e,t){return this.view&&this.view.position?(this.view.toMap(e,t,M),this.searchFeatures(M).then(function(e){return e&&e.length?e[0]:null})):u.resolve()},t.prototype.searchFeatures=function(e,t){var i=this;return void 0===t&&(t=2),u.create(function(r){r(i._graphicStore.hitTest(e.x,e.y,t,i.view.state.resolution,i.view.state.rotation))})},t.prototype.removeHighlight=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];this._highlightIDs.delete(r)}this._buildHLList()},t.prototype.setHighlight=function(e){this._highlightIDs.clear(),this.addHighlight(e)},t.prototype.update=function(e){var t=e.state,i=this.view.featuresTilingScheme.getClosestInfoForScale(t.scale).level;this._graphicStore.updateLevel(i),this._tileStore.setViewState(t),this._graphicStoreUpdate=!0,this.updateRequested=!1},t.prototype.viewChange=function(){this.requestUpdate()},t.prototype.requestUpdate=function(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate(this))},t.prototype.processUpdate=function(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))},t.prototype.graphicUpdateHandler=function(e){var t=e.graphic,i=e.property,r=e.newValue;switch(i){case"attributes":break;case"geometry":case"symbol":this._graphicProcessingQueue.push(t,"update");break;case"visible":this._setVisible(t.uid,r)}},t.prototype._graphicsChangeHandler=function(e){if(!this._graphicStoreUpdate){var t=this.view.state,i=this.view.featuresTilingScheme.getClosestInfoForScale(t.scale).level;this._graphicStore.updateLevel(i),this._tileStore.setViewState(t)}for(var r=e.added,n=e.removed,o=e.moved,s=0,a=n;s<a.length;s++){var l=a[s];this._remove(l)}for(var u=0,h=r;u<h.length;u++){var c=h[u];this._add(c)}for(var d=0,f=o;d<f.length;d++){var p=f[d];this._reorder(p)}},t.prototype._buildHLList=function(){for(var e=0,t=this.container.children;e<t.length;e++)t[e].buildHLList(this._highlightIDs);this.container.requestRender()},t.prototype._getSymbolResources=function(e){var t=e.symbol;if(!t&&this.renderer&&(t=this.renderer.getSymbol(e,{scale:this.view.scale})),!t||t&&"text"!==t.type)return u.resolve(null);O.clear();for(var i=t,r=i.text,n=0;n<r.length;n++)O.add(r.charCodeAt(n));L.length=0,O.forEach(function(e){return L.push(e)});var o=[];return o.push({symbol:i.toJSON(),id:0,glyphIds:L}),this.container.getMaterialItems(o).then(function(e){return e.length>0?e[0].mosaicItem:null})},t.prototype._projectAndNormalizeGeometry=function(e){var t=this;if(!e.geometry)return u.resolve(null);var i=e.geometry;if(p.isPolygon(i)){var r=i.rings;i.rings=r}else if(p.isPolyline(i)){var n=i.paths;i.paths=n}else p.isExtent(i)&&(i=d.fromExtent(i));return v.checkProjectionSupport(i.spatialReference,this.view.spatialReference).then(function(){return I.normalizeCentralMeridian(i)}).then(function(e){return v.project(e.toJSON(),e.spatialReference,t.view.spatialReference)}).then(function(e){return I.ensureClosedRings(e),e})},t.prototype._onTileUpdate=function(e){var t=this,i=_.getInfo(this.view.spatialReference);if(e.added&&e.added.length>0)for(var r=this,n=0,o=e.added;n<o.length;n++){!function(e){var n=r._graphicStore.queryTileData(e);if(i)for(var o=Math.round((i.valid[1]-i.valid[0])/e.resolution),s=0,a=n;s<a.length;s++){var l=a[s];l.geometry&&p.isPoint(l.geometry)&&r._wrapPoints(l,o)}r._tileUpdateSet.add(e.key),r.notifyChange("updating"),r._processGraphics(e.key,n).then(function(i){t._addTile(e.key,i),t._tileUpdateSet.delete(e.key),t.notifyChange("updating")}).catch(function(){t._tileUpdateSet.delete(e.key),t.notifyChange("updating")})}(o[n])}if(e.removed&&e.removed.length>0)for(var s=0,a=e.removed;s<a.length;s++){var l=a[s];this._removeTile(l.key)}},t.prototype._add=function(e){this.container.attached&&(this._graphicsSet.add(e),this._graphicProcessingQueue.has(e)&&this._graphicProcessingQueue.cancel(e),this._graphicProcessingQueue.push(e,"add"))},t.prototype._addOrUpdateGraphic=function(e,t){var i=this;return this._projectAndNormalizeGeometry(e).then(function(r){return i._getSymbolResources(e).then(function(n){return"add"===t?i._addProjectedGraphic(e,n,r):i._updateGraphic(e,n,r)})})},t.prototype._addProjectedGraphic=function(e,t,i){var r=this;if(!this._graphicsSet.has(e))return u.resolve();var n=this._graphicStore.add(e,t,i);if(!n||0===f.width(n)&&0===f.height(n))return u.resolve();e.visible||this._hiddenGraphics.push(e.uid);for(var o=[],s=this._tileStore.boundsIntersections(n),a=this,l=0,h=s;l<h.length;l++){!function(t){var i=a._getGraphicData(t,e),n=a._processGraphics(t.key,i).then(function(e){r._patchTile(t.key,{addOrUpdate:e,remove:null})});o.push(n)}(h[l])}return u.all(o)},t.prototype._remove=function(e){this._graphicsSet.has(e)&&this._graphicsSet.delete(e),this._graphicProcessingQueue.has(e)&&this._graphicProcessingQueue.cancel(e);var t=this._graphicStore.getBounds(e);if(t){this._graphicStore.remove(e);for(var i=0,r=this._tileStore.boundsIntersections(t);i<r.length;i++){var n=r[i];this._patchTile(n.key,{addOrUpdate:null,remove:[e.uid]})}}},t.prototype._reorder=function(e){var t=this;this._graphicStore.reorder(e);var i=this._graphicStore.getBounds(e);if(0===f.width(i)&&0===f.height(i))return u.resolve();for(var r=this._tileStore.boundsIntersections(i),n=[],o=this,s=0,a=r;s<a.length;s++){!function(i){var r=o._getGraphicData(i,e),s=o._processGraphics(i.key,r).then(function(e){t._patchTile(i.key,{addOrUpdate:e,remove:[]})});n.push(s)}(a[s])}return u.all(n)},t.prototype._updateGraphic=function(e,t,i){var r=this;if(!this._graphicStore.has(e))return u.resolve();for(var n=this._graphicStore.update(e,t,i),o=n.oldBounds,s=n.newBounds,a=0===f.width(o)&&0===f.height(o),h=0===f.width(s)&&0===f.height(s),c=a?[]:this._tileStore.boundsIntersections(o),d=h?[]:this._tileStore.boundsIntersections(s),p=l.acquire(),_=0,v=c;_<v.length;_++){var m=v[_];p.set(m.key,{addOrUpdate:null,remove:[e.uid]})}for(var g=0,y=d;g<y.length;g++){m=y[g];var x=this._getGraphicData(m,e);if(p.has(m.key)){var b=p.get(m.key);b.remove.length=0,b.addOrUpdate=x}else p.set(m.key,{addOrUpdate:x,remove:null})}var S=[];return p.forEach(function(e,t){var i=r._processGraphics(t,e.addOrUpdate).then(function(i){r._patchTile(t,{addOrUpdate:i,remove:e.remove})});S.push(i)}),l.release(p),u.all(S)},t.prototype._addTile=function(e,t){var i=f.create();this.view.featuresTilingScheme.getTileBounds(i,e);var r=new y(e,i,!0),n={clear:!0,addOrUpdate:t,remove:[]};r.setData(n,!1,!1),r.buildHLList(this._highlightIDs),this._hiddenGraphics.length>0&&r.setVisibility([],this._hiddenGraphics),this._tiles.set(e,r),this.container.addChild(r)},t.prototype._removeTile=function(e){if(this._tiles.has(e)){var t=this._tiles.get(e);this.container.removeChild(t)}},t.prototype._patchTile=function(e,t){if(this._tiles.has(e)){var i=this._tiles.get(e);i.setData(t,!1,!1),i.buildHLList(this._highlightIDs),this._hiddenGraphics.length>0&&i.setVisibility([],this._hiddenGraphics),this.container.requestRender()}},t.prototype._setVisible=function(e,t){var i=[],r=[],n=this._hiddenGraphics.indexOf(e);if(t){if(-1===n)return;this._hiddenGraphics.splice(n,1),i.push(e)}else{if(-1!==n)return;this._hiddenGraphics.push(e),r.push(e)}for(var o=0,s=this.container.children;o<s.length;o++){var a=s[o];a.data&&a.setVisibility(i,r)}},t.prototype._getGraphicData=function(e,t){var i=this._graphicStore.getGraphicData(e,t),r=[i],n=_.getInfo(this.view.spatialReference);if(n){var o=Math.round((n.valid[1]-n.valid[0])/e.resolution);i.geometry&&p.isPoint(i.geometry)&&this._wrapPoints(i,o)}return r},t.prototype._wrapPoints=function(e,t){var i=e.geometry;512===t?i.x<20?e.geometry={points:[[i.x,i.y],[t,0]]}:i.x>492&&(e.geometry={points:[[i.x,i.y],[-t,0]]}):i.x<-20?e.geometry={points:[[i.x,i.y],[t,0]]}:i.x>532&&(e.geometry={points:[[i.x,i.y],[-t,0]]})},t.prototype._processGraphics=function(e,t){var i=this;return t&&t.length&&this._meshFactory?this._meshFactory.analyze(t,this._matcher).then(function(t){return i._processAnalyzedGraphics(e,t)}):u.resolve(null)},t.prototype._processAnalyzedGraphics=function(e,t){for(var i=this._meshFactory,r=i.createMeshData(t.length),n=0,o=t;n<o.length;n++){var s=o[n];i.write(r,s,null,null,e.level)}return g.fromMeshData(r)},r([h.property()],t.prototype,"_graphicProcessingQueue",void 0),r([h.property(),h.cast(o.ofType(n))],t.prototype,"graphics",void 0),r([h.property({dependsOn:["_graphicProcessingQueue.updating"]})],t.prototype,"updating",null),r([h.property()],t.prototype,"view",void 0),r([h.property()],t.prototype,"updateRequested",void 0),r([h.subclass("esri.views.2d.layers.support.GraphicsView2D")],t)}(h.declared(C,s,a.Identifiable));t.default=A}.apply(null,r))||(e.exports=n)},1777:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(10),i(28),i(6),i(1539),i(1493),i(1731)],void 0===(n=function(e,t,i,r,n,o,s,a){Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t){var i=e.call(this)||this;return i._displayHeight=0,i._displayWidth=0,i._rendererInfo=new a,i._highlightOptionsUpToDate=!1,i.tileInfoView=t.tileInfoView,i.highlightOptions=t.highlightOptions,i.highlightIDs=t.highlightIDs,i.getMaterialItems=i.getMaterialItems.bind(i),i}return r(t,e),t.prototype.dispose=function(){this.removeAllChildren();for(var e=0,t=this.children;e<t.length;e++)t[e].dispose()},t.prototype.disposeWebGLResources=function(){for(var e=0,t=this.children;e<t.length;e++)t[e].clear()},t.prototype.displayWidth=function(){return this._displayWidth},Object.defineProperty(t.prototype,"displayHeight",{get:function(){return this._displayHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"highlightOptions",{get:function(){return this._highlightOptions},set:function(e){this._highlightOptions=e,this._highlightOptionsUpToDate=!1},enumerable:!0,configurable:!0}),t.prototype.setVisibility=function(e,t){},t.prototype.getMaterialItems=function(e){var t=e;if(t&&0!==t.length){for(var i=[],r=this.stage.painter.textureManager,o=0,s=t;o<s.length;o++){var a=s[o];i.push(r.rasterizeItem(a.symbol,a.glyphIds))}return n.all(i).then(function(e){return e.map(function(e,i){return{id:t[i].id,mosaicItem:e}})})}},t.prototype.renderChildren=function(e){var t=this.stage.painter;if(this._updateTilesTransform(e.state,this.tileInfoView.getClosestInfoForScale(e.state.scale).level),this._updateHighlightOptions(),e.drawPhase===s.WGLDrawPhase.MAP){var r=this.tileInfoView.getClosestInfoForScale(e.state.scale).level,n=this.tileInfoView.tileInfo.scaleToZoom(e.state.scale),o=this._rendererInfo,a=i({},e,{rendererInfo:o,requiredLevel:r,displayLevel:n,context:this.stage.context,painter:t});this.sortChildren(function(e,t){return e.key.level-t.key.level!=0?e.key.level-t.key.level:e.key.row-t.key.row!=0?e.key.row-t.key.row:e.key.col-t.key.col});var l=a.drawPhase;t.draw(a,this.children,l,null),0<this.highlightIDs.size&&t.highlight(a,this.children)}},t.prototype._updateTilesTransform=function(e,t){for(var i=0,r=this.children;i<r.length;i++){var n=r[i],o=this.tileInfoView.tileInfo.lods[n.key.level].resolution/(e.resolution*e.pixelRatio);n.setTransform(e,o)}},t.prototype._updateHighlightOptions=function(){if(!this._highlightOptionsUpToDate&&this.parent&&this._highlightOptions){var e=this.stage.painter,t=this._highlightOptions;if(e){var i=t.color.toRgba();i[0]/=255,i[1]/=255,i[2]/=255;var r=i.slice();i[3]*=t.fillOpacity,r[3]*=t.haloOpacity,e.setHighlightOptions({fillColor:i,outlineColor:r,outlineWidth:2,outerHaloWidth:.3,innerHaloWidth:.3,outlinePosition:0}),this._highlightOptionsUpToDate=!0}}},t}(o.Container);t.default=l}.apply(null,r))||(e.exports=n)},1780:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1640)],void 0===(n=function(e,t,i){return function(){function e(e,t,i,r,n,o,s,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=i,this._letterSpacing=r,this._offset=n,this._hAnchor=o,this._vAnchor=s,this._justify=a}return e.prototype.getShaping=function(e,t){for(var i=this._letterSpacing,r=this._lineHeight,n=this._justify,o=this._maxWidth,s=[],a=0,l=0,u=0,h=0,c=-1,d=0,f=-1,p=e.length,_=0;_<p;_++){var v=e.charCodeAt(_);if(10!==v){for(var m=void 0,g=0,y=this._glyphItems;g<y.length&&!(m=y[g][v]);g++);if(m){if(s.push({codePoint:v,x:a,y:l,glyphMosaicItem:m}),a+=m.metrics.advance+i,0<o&&o<a&&0<=f){var x=f+1;S=s[x].x,d=Math.max(S,d);for(var b=x;b<s.length;b++)t?s[b].y-=r:s[b].y+=r,s[b].x-=S;n&&this._applyJustification(s,h,f),t?l-=r:l+=r,a-=S,++u,h=x,f=-1}++c,32===v&&(f=s.length-1)}}else{if(_===p-1)continue;if(h<=c){var S=(T=s[c]).x+T.glyphMosaicItem.metrics.advance;d=Math.max(S,d),n&&this._applyJustification(s,h,c),h=s.length}t?l-=r:l+=r,a=0,++u}}if(h<=c){var T,w=(T=s[c]).x+T.glyphMosaicItem.metrics.advance;d=Math.max(d,w),n&&this._applyJustification(s,h,c)}if(0<s.length){var E=(n-this._hAnchor)*d,V=(-this._vAnchor*(u+1)+.5)*r;t&&u&&(V+=u*r),E+=this._offset[0],V+=this._offset[1];for(var I=0,C=s;I<C.length;I++){var M=C[I];M.x+=E,M.y+=V}}return s},e.getBox=function(e){if(!e.length)return null;for(var t=1/0,i=1/0,r=0,n=0,o=0,s=e;o<s.length;o++){var a=s[o],l=a.glyphMosaicItem.metrics,u=l.height,h=l.left,c=l.top,d=l.width,f=a.x,p=a.y-(u-Math.abs(c)),_=f+d+h,v=p+u;t=Math.min(t,f),r=Math.max(r,_),i=Math.min(i,p),n=Math.max(n,v)}return{x:t,y:i,width:r-t,height:n-i}},e.addDecoration=function(e,t){var r=e.length;if(0!==r){for(var n=e[0].x+e[0].glyphMosaicItem.metrics.left,o=e[0].y,s=1;s<r;s++){var a=e[s];if(a.y!==o){var l=e[s-1].x+e[s-1].glyphMosaicItem.metrics.left+e[s-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:o+t-3,glyphMosaicItem:{rect:new i(4,0,4,8),metrics:{width:l-n,height:8,left:0,top:0,advance:0},page:0}}),o=a.y,n=a.x+a.glyphMosaicItem.metrics.left}}var u=e[r-1].x+e[r-1].glyphMosaicItem.metrics.left+e[r-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:o+t-3,glyphMosaicItem:{rect:new i(4,0,4,8),metrics:{width:u-n,height:8,left:0,top:0,advance:0},page:0}})}},e.prototype._applyJustification=function(e,t,i){for(var r=e[i],n=r.glyphMosaicItem.metrics.advance,o=(r.x+n)*this._justify,s=t;s<=i;s++)e[s].x-=o},e}()}.apply(null,r))||(e.exports=n)},1781:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){var i,r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),(r=i=t.VectorRole||(t.VectorRole={}))[r.ENTRY=1]="ENTRY",r[r.EXIT=2]="EXIT",r[r.CAP=3]="CAP",(o=n=t.CapPosition||(t.CapPosition={}))[o.START=1]="START",o[o.END=2]="END",t.SYSTEM_MAG_LIMIT=3.8,t.MITER_SAFE_RADS=2*Math.acos(1/t.SYSTEM_MAG_LIMIT);var s=t.SYSTEM_MAG_LIMIT*t.SYSTEM_MAG_LIMIT,a=-1,l=8/(2*Math.PI);function u(e){var t,i={items:new Array,count:0};for(t=0;t<e;++t)i.items.push(void 0);return i}t.allocTriangles=function(e){var t,i={items:new Array,count:0};for(t=0;t<e;++t)i.items.push({v1:{vector:[void 0,void 0],texCoords:[void 0,void 0],direction:[void 0,void 0]},v2:{vector:[void 0,void 0],texCoords:[void 0,void 0],direction:[void 0,void 0]},v3:{vector:[void 0,void 0],texCoords:[void 0,void 0],direction:[void 0,void 0]}});return i},t.allocExtrudeVectors=function(){var e=function(e){var t,i={items:new Array,count:0};for(t=0;t<30;++t)i.items.push({vector:[void 0,void 0],texCoords:[void 0,void 0],direction:[void 0,void 0]});return i}(),t={};return t[i.ENTRY]=u(20),t[i.EXIT]=u(20),t[i.CAP]=u(20),{vectors:e,lists:t}},t.copyExtrudeVectors=function(e,t){var r;for(r=0;r<t.vectors.count;++r)e.vectors.items[r].vector[0]=t.vectors.items[r].vector[0],e.vectors.items[r].vector[1]=t.vectors.items[r].vector[1],e.vectors.items[r].texCoords[0]=t.vectors.items[r].texCoords[0],e.vectors.items[r].texCoords[1]=t.vectors.items[r].texCoords[1],e.vectors.items[r].direction[0]=t.vectors.items[r].direction[0],e.vectors.items[r].direction[1]=t.vectors.items[r].direction[1],e.vectors.items[r].base=t.vectors.items[r].base;e.vectors.count=t.vectors.count;var n=t.lists[i.ENTRY],o=e.lists[i.ENTRY],s=t.lists[i.EXIT],a=e.lists[i.EXIT],l=t.lists[i.CAP],u=e.lists[i.CAP];for(r=0;r<n.count;++r)o.items[r]=n.items[r];for(o.count=n.count,r=0;r<s.count;++r)a.items[r]=s.items[r];for(a.count=s.count,r=0;r<l.count;++r)u.items[r]=l.items[r];u.count=l.count,e.capCenter=t.capCenter};var h={vector:[void 0,void 0],texCoords:[void 0,void 0],direction:[void 0,void 0],base:void 0};function c(e,t){h.vector[0]=e.vector[0],h.vector[1]=e.vector[1],h.texCoords[0]=e.texCoords[0],h.texCoords[1]=e.texCoords[1],h.direction[0]=e.direction[0],h.direction[1]=e.direction[1],h.base=e.base,e.vector[0]=t.vector[0],e.vector[1]=t.vector[1],e.texCoords[0]=t.texCoords[0],e.texCoords[1]=t.texCoords[1],e.direction[0]=t.direction[0],e.direction[1]=t.direction[1],e.base=t.base,t.vector[0]=h.vector[0],t.vector[1]=h.vector[1],t.texCoords[0]=h.texCoords[0],t.texCoords[1]=h.texCoords[1],t.direction[0]=h.direction[0],t.direction[1]=h.direction[1],t.base=h.base}t.swapExtrudeVectors=c;var d,f=[];for(d=0;d<32;++d)f.push([void 0,void 0]);var p=function(e){var t,i={items:new Array,count:0};for(t=0;t<8;++t)i.items.push([void 0,void 0]);return i}();function _(e,t){return e[0]*t[0]+e[1]*t[1]}function v(e){return Math.sqrt(_(e,e))}function m(e,t){var i=v(t);return e[0]=t[0]/i,e[1]=t[1]/i,e}function g(e,t){return e[0]=-t[1],e[1]=t[0],e}function y(e,t){return e[0]*t[1]-e[1]*t[0]}function x(e,t){return e[0]=-t[0],e[1]=-t[1],e}function b(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function S(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function T(e,t,i){return r=e,o=i,((n=t)[0]-r[0])*(o[1]-r[1])-(o[0]-r[0])*(n[1]-r[1])<0;var r,n,o}function w(e,t){var i=_(e,t);return.999<i?0:i<-.999?Math.PI:Math.acos(i)}function E(e,t,i,r,n){if(0!==r){var o,s=v(t),a=(n?-1:1)*w(b(f[0],t,1/s),b(f[1],i,1/s))/r,l=Math.cos(a),u=Math.sin(a),h=t[0],c=t[1];for(o=0;o<r-1;++o){var d=h;h=l*d-u*c,c=u*d+l*c,e.items[o][0]=h,e.items[o][1]=c}e.count=r-1}else e.count=0}function V(e){var t,i=e.count,r=Math.floor(i/2);for(t=0;t<r;++t){var n=e.items[t];e.items[t]=e.items[i-t-1],e.items[i-t-1]=n}}t.length=v,t.normalize=m,t.getNumberOfSlices=function(e){return Math.max(Math.round(e*l),1)},t.getRads=w,t.reverse=V;var I=[void 0,void 0],C=[void 0,void 0],M=[0,0],O=[0,0],L=[0,0],A=[0,0],R=Math.cos(Math.PI/4),P=Math.sin(Math.PI/4),F=Math.sqrt(2),D=function(){function e(e){this._distanceAlongCorrection=e.distanceAlongCorrection}return e.prototype.bridge=function(e,t,r){var n,o,s,a,l=t.vectors,u=t.lists[i.EXIT],h=r.vectors,d=r.lists[i.ENTRY];if(u.count===d.count+1)n=u.items,o=l.items,s=d.items,a=h.items;else if(d.count===u.count+1)n=d.items,o=h.items,s=u.items,a=l.items;else{if(u.count!==d.count)return console.error("Cannot bridge "+u.count+" to "+d.count+"."),void(e.count=0);n=d.items,o=h.items,s=u.items,a=l.items}var f,p=u.count+d.count-2;for(e.count=p,I[0]=n,I[1]=s,C[0]=o,C[1]=a,f=0;f<p;++f){var _=e.items[f],v=(f+0)%2,m=Math.floor((f+0)/2),g=C[v][I[v][m]];_.v1.vector[0]=g.vector[0],_.v1.vector[1]=g.vector[1],_.v1.texCoords[0]=g.texCoords[0],_.v1.texCoords[1]=g.texCoords[1],_.v1.direction[0]=g.direction[0],_.v1.direction[1]=g.direction[1],_.v1.base=g.base;var y=(f+1)%2,x=Math.floor((f+1)/2),b=C[y][I[y][x]];_.v2.vector[0]=b.vector[0],_.v2.vector[1]=b.vector[1],_.v2.texCoords[0]=b.texCoords[0],_.v2.texCoords[1]=b.texCoords[1],_.v2.direction[0]=b.direction[0],_.v2.direction[1]=b.direction[1],_.v2.base=b.base;var S=(f+2)%2,w=Math.floor((f+2)/2),E=C[S][I[S][w]];_.v3.vector[0]=E.vector[0],_.v3.vector[1]=E.vector[1],_.v3.texCoords[0]=E.texCoords[0],_.v3.texCoords[1]=E.texCoords[1],_.v3.direction[0]=E.direction[0],_.v3.direction[1]=E.direction[1],_.v3.base=E.base;var V=_.v1.base&&_.v1.base.point||M,R=_.v2.base&&_.v2.base.point||M,P=_.v3.base&&_.v3.base.point||M;O[0]=V[0]+_.v1.vector[0],O[1]=V[1]+_.v1.vector[1],L[0]=R[0]+_.v2.vector[0],L[1]=R[1]+_.v2.vector[1],A[0]=P[0]+_.v3.vector[0],A[1]=P[1]+_.v3.vector[1],T(O,L,A)||c(_.v2,_.v3)}},e.prototype.pie=function(e,t){if(0!==t.lists[i.CAP].count){if(1===t.lists[i.CAP].count)return console.error("A single vector is not enough to define a pie."),void(e.count=0);var r;for(e.count=t.lists[i.CAP].count-1,r=0;r<e.count;++r){var n=e.items[r],o=t.lists[i.CAP].items[r],s=t.vectors.items[o];n.v1.vector[0]=s.vector[0],n.v1.vector[1]=s.vector[1],n.v1.texCoords[0]=s.texCoords[0],n.v1.texCoords[1]=s.texCoords[1],n.v1.direction[0]=s.direction[0],n.v1.direction[1]=s.direction[1],n.v1.base=s.base;var a=t.lists[i.CAP].items[r+1],l=t.vectors.items[a];n.v2.vector[0]=l.vector[0],n.v2.vector[1]=l.vector[1],n.v2.texCoords[0]=l.texCoords[0],n.v2.texCoords[1]=l.texCoords[1],n.v2.direction[0]=l.direction[0],n.v2.direction[1]=l.direction[1],n.v2.base=l.base;var u=t.capCenter,h=t.vectors.items[u];n.v3.vector[0]=h.vector[0],n.v3.vector[1]=h.vector[1],n.v3.texCoords[0]=h.texCoords[0],n.v3.texCoords[1]=h.texCoords[1],n.v3.direction[0]=h.direction[0],n.v3.direction[1]=h.direction[1],n.v3.base=h.base;var d=n.v1.base&&n.v1.base.point||M,f=n.v2.base&&n.v2.base.point||M,p=n.v3.base&&n.v3.base.point||M;O[0]=d[0]+n.v1.vector[0],O[1]=d[1]+n.v1.vector[1],L[0]=f[0]+n.v2.vector[0],L[1]=f[1]+n.v2.vector[1],A[0]=p[0]+n.v3.vector[0],A[1]=p[1]+n.v3.vector[1],T(O,L,A)||c(n.v2,n.v3)}}else e.count=0},e.prototype.buttCap=function(e,t,i){this.fastMiterJoin(e,t,i)},e.prototype.roundCap=function(e,t,r,o,s,a){void 0===a&&(a=0),this.fastMiterJoin(e,t,r);var l=o===n.START?0:1,u=o===n.START?1:0;e.capCenter=e.vectors.count;var h=e.vectors.items[e.capCenter];h.vector[0]=0,h.vector[1]=0,h.texCoords[0]=0,h.texCoords[1]=0,h.direction[0]=0,h.direction[1]=0,++e.vectors.count,E(p,e.vectors.items[l].vector,e.vectors.items[u].vector,s,!1);var c=e.vectors.count,d=e.lists[i.CAP];d.items[0]=l;var f,_=e.vectors.items[l].texCoords[1],v=e.vectors.items[u].texCoords[1];for(f=0;f<p.count;++f){var m=a*(1-Math.abs(p.count/2-f)/(p.count/2)),g=_+f/(p.count-1)*(v-_),y=p.items[f],x=e.vectors.items[c+f];x.vector[0]=y[0],x.vector[1]=y[1],x.texCoords[0]=m,x.texCoords[1]=g,x.direction[0]=0,x.direction[1]=0,d.items[f+1]=c+f}d.items[p.count+1]=u,d.count=p.count+2,e.vectors.count=c+p.count},e.prototype.squareCap=function(e,t,i,r){this.fastMiterJoin(e,t,i);var o=r===n.START?0:1,s=r===n.START?1:0,a=f[0],l=f[1],u=f[2],h=f[3],c=f[4],d=e.vectors.items[o].vector;a[0]=R*d[0]-P*d[1],a[1]=P*d[0]+R*d[1],b(h,a,F),l[0]=R*a[0]-P*a[1],l[1]=P*a[0]+R*a[1],u[0]=R*l[0]-P*l[1],u[1]=P*l[0]+R*l[1],b(c,u,F);var p=e.vectors.items[o];p.vector[0]=h[0],p.vector[1]=h[1];var _=e.vectors.items[s];_.vector[0]=c[0],_.vector[1]=c[1]},e.prototype.squareCapForDashedLines=function(e,t,r,o){if(o===n.START){var s=g(f[0],r),a=x(f[4],s),l=f[1],u=f[2],h=f[3];l[0]=R*s[0]-P*s[1],l[1]=P*s[0]+R*s[1],u[0]=R*l[0]-P*l[1],u[1]=P*l[0]+R*l[1],h[0]=R*u[0]-P*u[1],h[1]=P*u[0]+R*u[1],(c=f[5])[0]=0,c[1]=0,e.capCenter=0,(d=e.vectors.items)[0].vector[0]=c[0],d[0].vector[1]=c[1],d[0].direction[0]=0,d[0].direction[1]=0,d[0].texCoords[0]=0,d[0].texCoords[1]=0,d[1].vector[0]=s[0],d[1].vector[1]=s[1],d[1].direction[0]=0,d[1].direction[1]=0,d[1].texCoords[0]=0,d[1].texCoords[1]=-1,d[2].vector[0]=l[0]*F,d[2].vector[1]=l[1]*F,d[2].direction[0]=0,d[2].direction[1]=0,d[2].texCoords[0]=-1,d[2].texCoords[1]=-1,d[3].vector[0]=h[0]*F,d[3].vector[1]=h[1]*F,d[3].direction[0]=0,d[3].direction[1]=0,d[3].texCoords[0]=-1,d[3].texCoords[1]=1,d[4].vector[0]=a[0],d[4].vector[1]=a[1],d[4].direction[0]=0,d[4].direction[1]=0,d[4].texCoords[0]=0,d[4].texCoords[1]=1,e.vectors.count=5,e.lists[i.CAP].count=4,e.lists[i.CAP].items[0]=1,e.lists[i.CAP].items[1]=2,e.lists[i.CAP].items[2]=3,e.lists[i.CAP].items[3]=4,e.lists[i.ENTRY].count=0,e.lists[i.EXIT].count=3,e.lists[i.EXIT].items[0]=1,e.lists[i.EXIT].items[1]=0,e.lists[i.EXIT].items[2]=4}else{var c,d;s=g(f[0],r),a=x(f[4],s),l=f[1],u=f[2],h=f[3],l[0]=R*a[0]-P*a[1],l[1]=P*a[0]+R*a[1],u[0]=R*l[0]-P*l[1],u[1]=P*l[0]+R*l[1],h[0]=R*u[0]-P*u[1],h[1]=P*u[0]+R*u[1],(c=f[5])[0]=0,c[1]=0,e.capCenter=0,(d=e.vectors.items)[0].vector[0]=c[0],d[0].vector[1]=c[1],d[0].direction[0]=0,d[0].direction[1]=0,d[0].texCoords[0]=0,d[0].texCoords[1]=0,d[1].vector[0]=a[0],d[1].vector[1]=a[1],d[1].direction[0]=0,d[1].direction[1]=0,d[1].texCoords[0]=0,d[1].texCoords[1]=1,d[2].vector[0]=l[0]*F,d[2].vector[1]=l[1]*F,d[2].direction[0]=0,d[2].direction[1]=0,d[2].texCoords[0]=1,d[2].texCoords[1]=1,d[3].vector[0]=h[0]*F,d[3].vector[1]=h[1]*F,d[3].direction[0]=0,d[3].direction[1]=0,d[3].texCoords[0]=1,d[3].texCoords[1]=-1,d[4].vector[0]=s[0],d[4].vector[1]=s[1],d[4].direction[0]=0,d[4].direction[1]=0,d[4].texCoords[0]=0,d[4].texCoords[1]=-1,e.vectors.count=5,e.lists[i.CAP].count=4,e.lists[i.CAP].items[0]=1,e.lists[i.CAP].items[1]=2,e.lists[i.CAP].items[2]=3,e.lists[i.CAP].items[3]=4,e.lists[i.ENTRY].count=3,e.lists[i.ENTRY].items[0]=4,e.lists[i.ENTRY].items[1]=0,e.lists[i.ENTRY].items[2]=1,e.lists[i.EXIT].count=0}},e.prototype.fastMiterJoin=function(e,t,r){var n=g(f[0],r),o=n,s=x(f[1],n),l=e.vectors.items[0];l.vector[0]=o[0],l.vector[1]=o[1],l.texCoords[0]=0,l.texCoords[1]=a,l.direction[0]=0,l.direction[1]=0;var u=e.vectors.items[1];u.vector[0]=s[0],u.vector[1]=s[1],u.texCoords[0]=0,u.texCoords[1]=1,u.direction[0]=0,u.direction[1]=0,e.vectors.count=2;var h=e.lists[i.ENTRY];h.items[0]=0,h.items[1]=1,h.count=2;var c=e.lists[i.EXIT];c.items[0]=0,c.items[1]=1,c.count=2,e.lists[i.CAP].count=0,e.capCenter=void 0},e.prototype.miterJoin=function(e,t,r){var n=g(f[0],t),o=g(f[1],r),s=f[2];s[0]=n[0]+o[0],s[1]=n[1]+o[1];var l=m(f[3],s),u=_(l,n);l=b(f[4],l,1/u);var h=x(f[5],l);if(this._distanceAlongCorrection){(p=e.vectors.items[0]).vector[0]=l[0],p.vector[1]=l[1],p.texCoords[0]=0,p.texCoords[1]=a,p.direction[0]=t[0],p.direction[1]=t[1],(v=e.vectors.items[1]).vector[0]=h[0],v.vector[1]=h[1],v.texCoords[0]=0,v.texCoords[1]=1,v.direction[0]=t[0],v.direction[1]=t[1];var c=e.vectors.items[2];c.vector[0]=l[0],c.vector[1]=l[1],c.texCoords[0]=0,c.texCoords[1]=a,c.direction[0]=r[0],c.direction[1]=r[1];var d=e.vectors.items[3];d.vector[0]=h[0],d.vector[1]=h[1],d.texCoords[0]=0,d.texCoords[1]=1,d.direction[0]=r[0],d.direction[1]=r[1],e.vectors.count=4,(y=e.lists[i.ENTRY]).items[0]=0,y.items[1]=1,y.count=2,(S=e.lists[i.EXIT]).items[0]=2,S.items[1]=3,S.count=2}else{var p,v,y,S;(p=e.vectors.items[0]).vector[0]=l[0],p.vector[1]=l[1],p.texCoords[0]=0,p.texCoords[1]=a,p.direction[0]=0,p.direction[1]=0,(v=e.vectors.items[1]).vector[0]=h[0],v.vector[1]=h[1],v.texCoords[0]=0,v.texCoords[1]=1,v.direction[0]=0,v.direction[1]=0,e.vectors.count=2,(y=e.lists[i.ENTRY]).items[0]=0,y.items[1]=1,y.count=2,(S=e.lists[i.EXIT]).items[0]=0,S.items[1]=1,S.count=2}e.lists[i.CAP].count=0,e.capCenter=void 0},e.prototype.bevelJoin=function(e,t,r,n){var o=n*n,l=y(t,r),u=0<l?[a,1]:[1,a],h=u[0],c=u[1],d=0<l?x(f[0],g(f[1],t)):g(f[2],t),p=0<l?x(f[3],g(f[4],r)):g(f[5],r),v=f[6];v[0]=d[0]+p[0],v[1]=d[1]+p[1];var T=m(f[7],v),w=x(f[8],T),E=_(T,d),I=y(T,d),C=Math.abs(I/E),M=1+C*C,O=M<s?[C,this._distanceAlongCorrection]:[Math.sqrt(s-1),!0],L=O[0],A=O[1],R=M<o?[C,this._distanceAlongCorrection]:[Math.sqrt(o-1),!0],P=R[0],F=R[1];if(F&&A){S((B=e.vectors.items[0]).vector,x(f[9],d),b(f[10],x(f[11],t),L)),B.texCoords[0]=0,B.texCoords[1]=h,B.direction[0]=this._distanceAlongCorrection?t[0]:0,B.direction[1]=this._distanceAlongCorrection?t[1]:0,S((U=e.vectors.items[1]).vector,x(f[12],p),b(f[13],r,L)),U.texCoords[0]=0,U.texCoords[1]=h,U.direction[0]=this._distanceAlongCorrection?r[0]:0,U.direction[1]=this._distanceAlongCorrection?r[1]:0,(z=e.vectors.items[2]).vector[0]=0,z.vector[1]=0,z.texCoords[0]=0,z.texCoords[1]=0,z.direction[0]=0,z.direction[1]=0,S((G=e.vectors.items[3]).vector,d,b(f[14],t,P)),G.texCoords[0]=0,G.texCoords[1]=c,G.direction[0]=this._distanceAlongCorrection?t[0]:0,G.direction[1]=this._distanceAlongCorrection?t[1]:0;var D=e.vectors.items[4];S(D.vector,p,b(f[15],x(f[16],r),P)),D.texCoords[0]=0,D.texCoords[1]=c,D.direction[0]=this._distanceAlongCorrection?r[0]:0,D.direction[1]=this._distanceAlongCorrection?r[1]:0,e.vectors.count=5,(k=e.lists[i.ENTRY]).items[0]=0,k.items[1]=2,k.items[2]=3,k.count=3,(j=e.lists[i.EXIT]).items[0]=1,j.items[1]=2,j.items[2]=4,j.count=3,M<o?((N=e.lists[i.CAP]).count=0,e.capCenter=void 0):((N=e.lists[i.CAP]).items[0]=3,N.items[1]=4,N.count=2,e.capCenter=2)}else if(!F&&A)S((B=e.vectors.items[0]).vector,x(f[9],d),b(f[10],x(f[11],t),L)),B.texCoords[0]=0,B.texCoords[1]=h,B.direction[0]=this._distanceAlongCorrection?t[0]:0,B.direction[1]=this._distanceAlongCorrection?t[1]:0,S((U=e.vectors.items[1]).vector,x(f[12],p),b(f[13],r,L)),U.texCoords[0]=0,U.texCoords[1]=h,U.direction[0]=this._distanceAlongCorrection?r[0]:0,U.direction[1]=this._distanceAlongCorrection?r[1]:0,(z=e.vectors.items[2]).vector[0]=0,z.vector[1]=0,z.texCoords[0]=0,z.texCoords[1]=0,z.direction[0]=0,z.direction[1]=0,b((G=e.vectors.items[3]).vector,T,1/E),G.texCoords[0]=0,G.texCoords[1]=c,G.direction[0]=0,G.direction[1]=0,e.vectors.count=4,(k=e.lists[i.ENTRY]).items[0]=0,k.items[1]=2,k.items[2]=3,k.count=3,(j=e.lists[i.EXIT]).items[0]=1,j.items[1]=2,j.items[2]=3,j.count=3,e.lists[i.CAP].count=0,e.capCenter=void 0;else if(F&&!A){var z,G,N;b((B=e.vectors.items[0]).vector,w,1/E),B.texCoords[0]=0,B.texCoords[1]=h,B.direction[0]=0,B.direction[1]=0,(U=e.vectors.items[1]).vector[0]=0,U.vector[1]=0,U.texCoords[0]=0,U.texCoords[1]=0,U.direction[0]=0,U.direction[1]=0,S((z=e.vectors.items[2]).vector,d,b(f[9],t,P)),z.texCoords[0]=0,z.texCoords[1]=c,z.direction[0]=this._distanceAlongCorrection?t[0]:0,z.direction[1]=this._distanceAlongCorrection?t[1]:0,S((G=e.vectors.items[3]).vector,p,b(f[10],x(f[11],r),P)),G.texCoords[0]=0,G.texCoords[1]=c,G.direction[0]=this._distanceAlongCorrection?r[0]:0,G.direction[1]=this._distanceAlongCorrection?r[1]:0,e.vectors.count=4,(k=e.lists[i.ENTRY]).items[0]=0,k.items[1]=1,k.items[2]=2,k.count=3,(j=e.lists[i.EXIT]).items[0]=0,j.items[1]=1,j.items[2]=3,j.count=3,M<o?((N=e.lists[i.CAP]).count=0,e.capCenter=void 0):((N=e.lists[i.CAP]).items[0]=2,N.items[1]=3,N.count=2,e.capCenter=1)}else if(!F&&!A){var B,U,k,j;b((B=e.vectors.items[0]).vector,w,1/E),B.texCoords[0]=0,B.texCoords[1]=h,B.direction[0]=0,B.direction[1]=0,b((U=e.vectors.items[1]).vector,T,1/E),U.texCoords[0]=0,U.texCoords[1]=c,U.direction[0]=0,U.direction[1]=0,e.vectors.count=2,(k=e.lists[i.ENTRY]).items[0]=0,k.items[1]=1,k.count=2,(j=e.lists[i.EXIT]).items[0]=0,j.items[1]=1,j.count=2,e.lists[i.CAP].count=0,e.capCenter=void 0}l<0&&(V(e.lists[i.ENTRY]),V(e.lists[i.EXIT]))},e.prototype.roundJoin=function(e,t,r,n){var o=y(t,r),l=0<o?[a,1]:[1,a],u=l[0],h=l[1],c=0<o?x(f[0],g(f[1],t)):g(f[2],t),d=0<o?x(f[3],g(f[4],r)):g(f[5],r),v=f[6];v[0]=c[0]+d[0],v[1]=c[1]+d[1];var T=m(f[7],v),w=x(f[8],T),I=_(T,c),C=y(T,c),M=Math.abs(C/I),O=1+M*M<s?[M,this._distanceAlongCorrection]:[Math.sqrt(s-1),!0],L=O[0];if(O[1]){(R=e.vectors.items[0]).vector[0]=c[0],R.vector[1]=c[1],R.texCoords[0]=0,R.texCoords[1]=h,R.direction[0]=0,R.direction[1]=0,(P=e.vectors.items[1]).vector[0]=d[0],P.vector[1]=d[1],P.texCoords[0]=0,P.texCoords[1]=h,P.direction[0]=0,P.direction[1]=0,S((F=e.vectors.items[2]).vector,x(f[9],c),b(f[10],x(f[11],t),L)),F.texCoords[0]=0,F.texCoords[1]=u,F.direction[0]=this._distanceAlongCorrection?t[0]:0,F.direction[1]=this._distanceAlongCorrection?t[1]:0,S((D=e.vectors.items[3]).vector,x(f[12],d),b(f[13],r,L)),D.texCoords[0]=0,D.texCoords[1]=u,D.direction[0]=this._distanceAlongCorrection?r[0]:0,D.direction[1]=this._distanceAlongCorrection?r[1]:0;var A=e.vectors.items[4];A.vector[0]=0,A.vector[1]=0,A.texCoords[0]=0,A.texCoords[1]=0,A.direction[0]=0,A.direction[1]=0,e.vectors.count=5,(z=e.lists[i.ENTRY]).items[0]=2,z.items[1]=4,z.items[2]=0,z.count=3,(G=e.lists[i.EXIT]).items[0]=3,G.items[1]=4,G.items[2]=1,G.count=3,e.capCenter=4}else{var R,P,F,D,z,G;(R=e.vectors.items[0]).vector[0]=c[0],R.vector[1]=c[1],R.texCoords[0]=0,R.texCoords[1]=h,R.direction[0]=0,R.direction[1]=0,(P=e.vectors.items[1]).vector[0]=d[0],P.vector[1]=d[1],P.texCoords[0]=0,P.texCoords[1]=h,P.direction[0]=0,P.direction[1]=0,b((F=e.vectors.items[2]).vector,w,1/I),F.texCoords[0]=0,F.texCoords[1]=u,F.direction[0]=0,F.direction[1]=0,(D=e.vectors.items[3]).vector[0]=0,D.vector[1]=0,D.texCoords[0]=0,D.texCoords[1]=0,D.direction[0]=0,D.direction[1]=0,e.vectors.count=4,(z=e.lists[i.ENTRY]).items[0]=2,z.items[1]=3,z.items[2]=0,z.count=3,(G=e.lists[i.EXIT]).items[0]=2,G.items[1]=3,G.items[2]=1,G.count=3,e.capCenter=3}E(p,c,d,n,o<0);var N,B=e.vectors.count,U=e.lists[i.CAP];for(N=U.items[0]=0;N<p.count;++N){var k=p.items[N],j=e.vectors.items[B+N];j.vector[0]=k[0],j.vector[1]=k[1],j.texCoords[0]=0,j.texCoords[1]=h,j.direction[0]=0,j.direction[1]=0,U.items[N+1]=B+N}U.items[p.count+1]=1,U.count=p.count+2,e.vectors.count=B+p.count,o<0&&(V(e.lists[i.ENTRY]),V(e.lists[i.EXIT]))},e.prototype.unitRoundJoin=function(e,t,r,n){var o=y(t,r),s=0<o?[a,1]:[1,a],l=s[0],u=s[1],h=0<o?x(f[0],g(f[1],t)):g(f[2],t),c=0<o?x(f[3],g(f[4],r)):g(f[5],r),d=e.vectors.items[0];d.vector[0]=h[0],d.vector[1]=h[1],d.texCoords[0]=0,d.texCoords[1]=u,d.direction[0]=0,d.direction[1]=0;var _=e.vectors.items[1];_.vector[0]=c[0],_.vector[1]=c[1],_.texCoords[0]=0,_.texCoords[1]=u,_.direction[0]=0,_.direction[1]=0;var v=e.vectors.items[2];x(v.vector,h),v.texCoords[0]=0,v.texCoords[1]=l,v.direction[0]=0,v.direction[1]=0;var m=e.vectors.items[3];x(m.vector,c),m.texCoords[0]=0,m.texCoords[1]=l,m.direction[0]=0,m.direction[1]=0;var b=e.vectors.items[4];b.vector[0]=0,b.vector[1]=0,b.texCoords[0]=0,b.texCoords[1]=0,b.direction[0]=0,b.direction[1]=0,e.vectors.count=5;var S=e.lists[i.ENTRY];S.items[0]=2,S.items[1]=0,S.count=2;var T=e.lists[i.EXIT];T.items[0]=3,T.items[1]=1,T.count=2,e.capCenter=4,E(p,h,c,n,o<0);var w,I=e.vectors.count,C=e.lists[i.CAP];for(w=C.items[0]=0;w<p.count;++w){var M=p.items[w],O=e.vectors.items[I+w];O.vector[0]=M[0],O.vector[1]=M[1],O.texCoords[0]=0,O.texCoords[1]=u,O.direction[0]=0,O.direction[1]=0,C.items[w+1]=I+w}C.items[p.count+1]=1,C.count=p.count+2,e.vectors.count=I+p.count,o<0&&(V(e.lists[i.ENTRY]),V(e.lists[i.EXIT]))},e.prototype.rectJoin=function(e,t,r){var n=g(f[0],t),o=g(f[1],r),s=e.vectors.items[0];s.vector[0]=n[0],s.vector[1]=n[1],s.texCoords[0]=0,s.texCoords[1]=a,s.direction[0]=0,s.direction[1]=0;var l=e.vectors.items[1];l.vector[0]=o[0],l.vector[1]=o[1],l.texCoords[0]=0,l.texCoords[1]=a,l.direction[0]=0,l.direction[1]=0;var u=e.vectors.items[2];x(u.vector,n),u.texCoords[0]=0,u.texCoords[1]=1,u.direction[0]=0,u.direction[1]=0;var h=e.vectors.items[3];x(h.vector,o),h.texCoords[0]=0,h.texCoords[1]=1,h.direction[0]=0,h.direction[1]=0,e.vectors.count=4;var c=e.lists[i.ENTRY];c.items[0]=0,c.items[1]=2,c.count=2;var d=e.lists[i.EXIT];d.items[0]=1,d.items[1]=3,d.count=2,e.capCenter=void 0},e}();t.Tessellator=D}.apply(null,r))||(e.exports=n)},1783:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(5),i(44),i(2)],void 0===(n=function(e,t,i,r,n,o,s){Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var i=e.call(this,t)||this;return i._queue=new Map,i._onGoingGraphic=null,i._onGoingPromise=null,i._scheduledNextHandle=null,i._timestamp=Date.now(),i._next=i._next.bind(i),i._finalize=i._finalize.bind(i),i}return i(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this._queue.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updating",{get:function(){return this._queue.size>0||null!==this._onGoingPromise},enumerable:!0,configurable:!0}),t.prototype.cancel=function(e){this._onGoingGraphic&&this._onGoingGraphic.graphic===e&&(this._onGoingPromise.cancel(),this._onGoingGraphic=this._onGoingPromise=null),this._queue.delete(e),this._scheduleNext(),this.notifyChange("updating")},t.prototype.clear=function(){this._queue.clear(),this._onGoingPromise&&(this._onGoingPromise.cancel(),this._onGoingGraphic=this._onGoingPromise=null),this._cancelNext(),this.notifyChange("updating")},t.prototype.has=function(e){return this._queue.has(e)},t.prototype.isOngoing=function(e){return this._onGoingGraphic&&this._onGoingGraphic.graphic===e},t.prototype.push=function(e,t,i){this._queue.has(e)||(this._queue.set(e,{graphic:e,addOrUpdate:t,timestamp:i||this._timestamp}),this._scheduleNext(),this.notifyChange("updating"))},t.prototype.refresh=function(){this._timestamp=Date.now(),this.reset()},t.prototype.reset=function(){var e=this._onGoingGraphic;if(e){var t=e.graphic,i=e.addOrUpdate;this.push(t,i,this._timestamp)}},t.prototype._finalize=function(){this._onGoingGraphic=null,this._onGoingPromise=null,this.notifyChange("updating"),this._scheduleNext()},t.prototype._cancelNext=function(){this._scheduledNextHandle&&(this._scheduledNextHandle.remove(),this._scheduledNextHandle=null)},t.prototype._scheduleNext=function(){this._scheduledNextHandle||0===this._queue.size||null!=this._onGoingGraphic||(this._scheduledNextHandle=o.schedule(this._next))},t.prototype._next=function(){if(null==this._scheduledNextHandle||0===this._queue.size||this._onGoingGraphic)this._scheduledNextHandle=null;else{this._scheduledNextHandle=null;var e=this._peek(),t=e.graphic,i=e.addOrUpdate;this._queue.delete(t),this._onGoingGraphic=e,this._onGoingPromise=this.process(t,i,this._timestamp),this._onGoingPromise.then(this._finalize,this._finalize),this.notifyChange("updating")}},t.prototype._peek=function(){var e=this,t=Number.NEGATIVE_INFINITY,i=null;return this._queue.forEach(function(r,n){var o=e._timestamp-r.timestamp;isNaN(o)?i=r:o===t?i=r:o>t&&(t=o,i=r)}),i},r([s.property({readOnly:!0})],t.prototype,"length",null),r([s.property({readOnly:!0})],t.prototype,"updating",null),r([s.property({constructOnly:!0})],t.prototype,"process",void 0),r([s.subclass()],t)}(s.declared(n));t.default=a}.apply(null,r))||(e.exports=n)},1784:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(10),i(1540),i(18),i(30),i(1667),i(82),i(101),i(52),i(204),i(1762),i(1785),i(1645),i(1523)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p){function _(e,t,i,r,n){return v.minX=t,v.minY=i,v.maxX=r,v.maxY=n,e.search(v)}Object.defineProperty(t,"__esModule",{value:!0});var v={minX:0,minY:0,maxX:0,maxY:0},m=a.create(),g=a.create(),y=function(){function e(e,t,i,o,a){this.renderer=o,this._graphics=a,this._index=s(9,n("csp-restrictions")?function(e){return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}}:[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this._itemByGraphic=new r.default,this._currentLevel=-1/0,this._tileInfoView=e,this._uidFieldName=i;var l=e.getClosestInfoForScale(t);l&&(this._currentLevel=l.level,this._resolution=this._tileInfoView.getTileResolution(l.level)),this._updateGraphicZorder=this._updateGraphicZorder.bind(this)}return e.prototype.hitTest=function(e,t,i,r,n){e=h.normalizeMapX(e,this._tileInfoView.spatialReference);var s=.5*r*i;g[0]=e-s,g[1]=t-s,g[2]=e+s,g[3]=t+s;var c=.5*r*(i+50),d=_(this._index,e-c,t-c,e+c,t+c);if(!d||0===d.length)return[];for(var v,y=a.create(),x=n?function(i,r,o){var l=p.C_DEG_TO_RAD*n,u=Math.cos(l),h=Math.sin(l),c=((1+r)*i[0]+(1-r)*i[2])/2,d=((1+o)*i[1]+(1-o)*i[3])/2,f=e-c,_=t-d,v=c+u*f+h*_,m=d-h*f+u*_;return y[0]=v-s,y[1]=m-s,y[2]=v+s,y[3]=m+s,a.intersects(i,y)}:function(e){return a.intersects(e,g)},b=[],S=0,T=d;S<T.length;S++){var w=T[S];switch(u.getJsonType(w.geometry)){case"esriGeometryPoint":var E=this._getSymbol(w.graphic);if(!E)continue;var V=w.geometry,I=void 0,C=void 0;if("text"===E.type){var M=E;I=f.getXAnchorDirection(M.horizontalAlignment||"center"),C=f.getYAnchorDirection(M.verticalAlignment||"middle"),f.getTextSymbolBounds(m,V.x,V.y,M,w.size,this._resolution,n)}else I=0,C=0,f.getMarkerSymbolBounds(m,V.x,V.y,E,this._resolution,n);x(m,I,C)&&b.push(w);break;case"esriGeometryPolyline":var O=this._getSymbol(w.graphic);if(!O)continue;v=1.5*r*window.devicePixelRatio*o.pt2px(O.width),f.isPointOnPolyline(w.geometry,e,t,v)&&b.push(w);break;case"esriGeometryEnvelope":var L=w.geometry,A=a.fromValues(L.xmin,L.ymin,L.xmax,L.ymax);a.intersects(A,g)&&b.push(w);break;case"esriGeometryPolygon":l.polygonContainsPoint(w.geometry,{x:e,y:t})&&b.push(w);break;case"esriGeometryMultipoint":var R=this._getSymbol(w.graphic);if(!R)continue;for(var P=w.geometry.points,F=void 0,D=void 0,z=0;z<P.length;z++){if("text"===R.type){M=R;F=f.getXAnchorDirection(M.horizontalAlignment||"center"),D=f.getYAnchorDirection(M.verticalAlignment||"middle"),f.getTextSymbolBounds(m,P[z][0],P[z][1],M,w.size,this._resolution,n)}else F=0,D=0,f.getMarkerSymbolBounds(m,P[z][0],P[z][1],R,this._resolution,n);if(x(m,F,D)){b.push(w);break}}}}return b.sort(function(e,t){var i=f.graphicGeometryToNumber(e.graphic),r=f.graphicGeometryToNumber(t.graphic);return i===r?t.zorder-e.zorder:i-r}),b.map(function(e){return e.graphic})},e.prototype.getGraphicData=function(e,t){var r=this._itemByGraphic.get(t);if(!r)return null;var n=_(this._index,e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3]);n.sort(function(e,t){return e.zorder-t.zorder});var o=n.indexOf(r),s=0===o||-1===o?-1:n[o-1].graphic.uid,a={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},l=r.getGeometryQuantized(a),u=i({},r.graphic.attributes);return u[this._uidFieldName]=t.uid,{centroid:d.default.getCentroidQuantized(r,a,this.renderer,this._scale),geometry:l,attributes:u,symbol:t.symbol,insertAfter:s}},e.prototype.queryTileData=function(e){var t=50*e.resolution,i=a.pad(e.bounds,t,a.create()),r=_(this._index,i[0],i[1],i[2],i[3]),n=[];return this._createTileGraphics(n,r,{originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]}),n},e.prototype.has=function(e){return this._itemByGraphic.has(e)},e.prototype.getBounds=function(e){return this._itemByGraphic.has(e)?this._itemByGraphic.get(e).bounds:null},e.prototype.add=function(e,t,i){if(e){var r=d.default.acquire(e,i,t,this.renderer,this._resolution,this._scale,this._tileInfoView.spatialReference);return this._itemByGraphic.set(e,r),this._itemByGraphic.forEach(this._updateGraphicZorder),i&&this._index.insert(r),r.bounds}},e.prototype.remove=function(e){if(this._itemByGraphic.has(e)){var t=this._itemByGraphic.get(e);this._index.remove(t),this._itemByGraphic.delete(e),this._itemByGraphic.forEach(this._updateGraphicZorder)}},e.prototype.reorder=function(e){this._itemByGraphic.has(e)&&this._itemByGraphic.forEach(this._updateGraphicZorder)},e.prototype.update=function(e,t,i){var r=this._itemByGraphic.get(e),n=a.clone(r.bounds);return r.size[0]=r.size[1]=0,this._index.remove(r),r.set(e,i,t,this.renderer,this._resolution,this._scale,this._tileInfoView.spatialReference),i&&this._index.insert(r),{oldBounds:n,newBounds:r.bounds}},e.prototype.updateLevel=function(e){var t=this;if(this._currentLevel!==e){this._currentLevel=e;var i=this._tileInfoView.getTileResolution(e);this._resolution=i,this._scale=this._tileInfoView.getTileScale({level:e,row:0,col:0,world:0});var r=this._itemByGraphic.values();c.forEachIter(r,function(e){t._index.remove(e),e.updateBounds(t.renderer,t._resolution,t._scale,t._tileInfoView.spatialReference),e.geometry&&t._index.insert(e)})}},e.prototype.clear=function(){this._itemByGraphic.clear(),this._index.clear()},e.prototype._createTileGraphics=function(e,t,r){var n=this._uidFieldName;t.sort(function(e,t){return e.zorder-t.zorder});for(var o,s,a,l,u=0;u<t.length;u++){o=(a=t[u]).graphic,s=a.getGeometryQuantized(r),l=0===u?-1:t[u-1].graphic.uid;var h=i({},a.graphic.attributes);h[n]=o.uid,e.push({centroid:d.default.getCentroidQuantized(a,r,this.renderer,this._scale),geometry:s,attributes:h,symbol:o.symbol,insertAfter:l})}},e.prototype._getSymbol=function(e){return e.symbol?e.symbol:this.renderer?this.renderer.getSymbol(e,{scale:this._scale}):null},e.prototype._updateGraphicZorder=function(e,t){e.zorder=this._graphics.indexOf(t)},e}();t.default=y}.apply(null,r))||(e.exports=n)},1785:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(82),i(445),i(52),i(1533),i(1645)],void 0===(n=function(e,t,i,r,n,o,s){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this.bounds=i.create(),this.graphic=null,this.size=[0,0,0,0]}return e.acquire=function(t,i,r,n,o,s,a){var l;return void 0===t&&(t=null),0===e._pool.length?l=new e:(l=e._pool.pop(),this._set.delete(l)),l.acquire(t,i,r,n,o,s,a),l},e.release=function(e){e&&!this._set.has(e)&&(e.release(),this._pool.push(e),this._set.add(e))},e.getCentroidQuantized=function(e,t,i,a){if(n.isPolygon(e.geometry)){var l=e.graphic.symbol;if(!l&&i&&(l=i.getSymbol(e.graphic,{scale:a})),!l)return null;if(s.isMarkerSymbol(l.type)){var u=r.polygonCentroid(e.geometry);return o.quantizePoint(t,{},{x:u[0],y:u[1]},!1,!1)}}return null},e.prototype.acquire=function(e,t,i,r,n,o,s){void 0===e&&(e=null),e&&this.set(e,t,i,r,n,o,s)},e.prototype.release=function(){this.graphic=null,this.geometry=null},e.prototype.set=function(e,t,i,r,n,o,a){this.graphic=e,this.geometry=t,s.getBounds(this.bounds,this.size,e,t,i,r,n,o,a)},e.prototype.updateBounds=function(e,t,i,r){s.getBounds(this.bounds,this.size,this.graphic,this.geometry,null,e,t,i,r)},e.prototype.getGeometryQuantized=function(e){return o.quantizeGeometry(e,this.geometry)},e._pool=[],e._set=new Set,e}();t.default=a}.apply(null,r))||(e.exports=n)},1786:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(5),i(2)],void 0===(n=function(e,t,i,r,n,o){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.graphics=null,t.renderer=null,t.view=null,t}return i(t,e),r([o.property()],t.prototype,"graphics",void 0),r([o.property()],t.prototype,"renderer",void 0),r([o.property()],t.prototype,"view",void 0),r([o.subclass("esri.views.layers.GraphicsView")],t)}(o.declared(n))}.apply(null,r))||(e.exports=n)},1807:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1729),i(1484)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return r.glslifyDefineMap({ID:e.id,HIGHLIGHT:e.highlight,SDF:e.isSDF,VV_SIZE_MIN_MAX_VALUE:e.vvSizeMinMaxValue,VV_SIZE_SCALE_STOPS:e.vvSizeScaleStops,VV_SIZE_FIELD_STOPS:e.vvSizeFieldStops,VV_SIZE_UNIT_VALUE:e.vvSizeUnitValue,VV_COLOR:e.vvColor,VV_ROTATION:e.vvRotation,VV_OPACITY:e.vvOpacity,VERTEX_VISIBILITY:e.visibility,PATTERN:e.pattern})};t.fill={name:"fill",shaders:function(e){return{vertexShader:n(e)+i.resolveIncludes("materials/fill/fill.vert"),fragmentShader:n(e)+i.resolveIncludes("materials/fill/fill.frag")}},attributes:{a_pos:0,a_id:1,a_color:2,a_tlbr:3,a_aux1:4,a_aux2:5,a_vv:6,a_visible:7}},t.icon={name:"icon",shaders:function(e){return{vertexShader:n(e)+i.resolveIncludes("materials/icon/icon.vert"),fragmentShader:n(e)+i.resolveIncludes("materials/icon/icon.frag")}},attributes:{a_pos:0,a_vertexOffsetAndTex:1,a_id:2,a_color:3,a_outlineColor:4,a_sizeAndOutlineWidth:5,a_vv:6,a_visible:8}},t.label={name:"label",shaders:function(e){return{vertexShader:n(e)+i.resolveIncludes("materials/label/label.vert"),fragmentShader:n(e)+i.resolveIncludes("materials/label/label.frag")}},attributes:{a_pos:0,a_color:1,a_vertexOffset:2,a_texAndSize:3,a_refSymbolAndPlacementOffset:4,a_vvSize:5,a_visible:6,a_visibilityRange:7}},t.line={name:"line",shaders:function(e){return{vertexShader:n(e)+i.resolveIncludes("materials/line/line.vert"),fragmentShader:n(e)+i.resolveIncludes("materials/line/line.frag")}},attributes:{a_pos:0,a_id:1,a_color:2,a_offsetAndNormal:3,a_accumulatedDistanceAndHalfWidth:4,a_tlbr:5,a_segmentDirection:6,a_vv:7,a_visible:8}},t.text={name:"text",shaders:function(e){return{vertexShader:n(e)+i.resolveIncludes("materials/text/text.vert"),fragmentShader:n(e)+i.resolveIncludes("materials/text/text.frag")}},attributes:{a_pos:0,a_id:1,a_color:2,a_vertexOffset:3,a_texFontSize:4,a_visible:5,a_vv:6}}}.apply(null,r))||(e.exports=n)},1808:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getFullyQualifiedFontName=function(e){var t=function(e){if(!e.weight)return"";switch(e.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}(e)+function(e){if(!e.style)return"";switch(e.style.toLowerCase()){case"italic":case"oblic":return"-italic"}return""}(e);return function(e){var t=e.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}(e.family)+(0<t.length?t:"-regular")},t.getFontDecorationTop=function(e){switch(e.decoration.toLowerCase()){case"underline":return-26;case"line-through":return-18}return NaN}}.apply(null,r))||(e.exports=n)},1809:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(83)],void 0===(n=function(e,t,i){var r=function(){function e(e,t){void 0===e&&(e=50),void 0===t&&(t=50),this._pool=new i(Map,!1,function(e){return e.clear()},t,e)}return e.prototype.acquire=function(){return this._pool.acquire()},e.prototype.release=function(e){this._pool.release(e)},e.acquire=function(){return n.acquire()},e.release=function(e){return n.release(e)},e}(),n=new r(100);return r}.apply(null,r))||(e.exports=n)},1810:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(9),i(7),i(1915)],void 0===(n=function(e,t,i,r,n){Object.defineProperty(t,"__esModule",{value:!0});var o=r.getLogger("esri/views/2d/engine/webgl/mesh/factories/matcherUtils");t.createMatcher=function(e,t,r,s){switch(e.type){case"simple":return n.default.fromSimpleRenderer(e,t,r);case"unique-value":case"uniqueValue":return n.MapMatcher.fromUVRenderer(e,t,r,s);case"class-breaks":case"classBreaks":return n.IntervalMatcher.fromCBRenderer(e,t,r,s);default:return o.error(new i("mapview-mesh:invalid-renderer","Unable to handle unknown renderer type")),null}}}.apply(null,r))||(e.exports=n)},1811:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(9),i(7),i(52),i(107),i(1517),i(1493),i(1662),i(1880),i(1916),i(1917),i(1918),i(1919),i(1835),i(1836),i(1744)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m){Object.defineProperty(t,"__esModule",{value:!0});var g=n.getLogger("esri.views.2d.engine.webgl.WGLMeshFactory"),y={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null,esriGeometryEnvelope:null},x=function(){function e(e,t,i,n,o,s,l,u,c,d){var _=this;if(this._labelsDebugTemplate=null,this._labelsDebugVVEval=null,this._materials=l,this._geometryType=e,this._idField=t,this._pixelRatio=o,this._vvFlags=m.getVVFlags(i),this._vvFactory=new f.default(i,n),this._vvBuf=new ArrayBuffer(16),this._vvBufU32=new Uint32Array(this._vvBuf),this._vvBufF32=new Float32Array(this._vvBuf),this._templateStore=u,c)if(a.DEBUG_LABELS&&(this._labelsDebugVVEval=i&&h.createLabelVVEvaluator(i)),this._validateLabelingInfo(c)){var v=m.getLabelVVFlags(this._vvFlags);this._labelTemplates=c.map(function(e){return p.default.fromLabelClass(_._materials,v,e,o,d)})}else g.error(new r("mapview-labeling:unsupported-geometry","LabelingInfo failed validation - unable to create labels for layer."))}return Object.defineProperty(e.prototype,"materials",{get:function(){return this._materials},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"templates",{get:function(){return this._templateStore},enumerable:!0,configurable:!0}),e.prototype.createMeshData=function(e){var t=new Array(5),i=new Array,r=!!m.getMarkerVVFlags(this._vvFlags),n=!!m.getFillVVFlags(this._vvFlags),o=!!m.getLineVVFlags(this._vvFlags,"esriGeometryPolyline"!==this._geometryType),s=!!m.getTextVVFlags(this._vvFlags),u="esriGeometryPolyline"===this._geometryType?a.HEURISTIC_GLYPHS_PER_LINE:a.HEURISTIC_GLYPHS_PER_FEATURE;return t[l.WGLGeometryType.MARKER]=new d.VertexVectors(l.WGLGeometryType.MARKER,r,e),t[l.WGLGeometryType.FILL]=new d.VertexVectors(l.WGLGeometryType.FILL,n,e),t[l.WGLGeometryType.LINE]=new d.VertexVectors(l.WGLGeometryType.LINE,o,e),t[l.WGLGeometryType.TEXT]=new d.VertexVectors(l.WGLGeometryType.TEXT,s,e),t[l.WGLGeometryType.LABEL]=new d.VertexVectors(l.WGLGeometryType.LABEL,!1,this._labelTemplates&&0<this._labelTemplates.length?u:0),new c.default(i,t,this._materials)},e.prototype.analyze=function(e,t,i,r){for(var n=e,o=0,s=n;o<s.length;o++){var a=s[o],l=-1;null!=a.symbol?l=this._templateStore.createTemplateGroup(a.symbol,null,this._materials,0):t&&(l=t.match(a,i,r)),a.groupId=l}return this._templateStore.finalize().then(function(){return n})},e.prototype.write=function(e,t,i,r,n,s,a){var l=this._templateStore.getTemplateGroup(t.groupId),h=e,c=t.attributes[this._idField],d=new u(c),f=!!s&&!!this._labelTemplates&&s.has(c);if(l&&(t.geometry||t.centroid)){this._vvFactory.computeVV(this._vvBufF32,t,i,r);var p=d.displayRecords,_=t.insertAfter;void 0!==_&&(d.insertAfter=_);var v=this._geometryType;v||(v=null!=t.centroid?"esriGeometryPolygon":o.getJsonType(t.geometry));for(var m=0,g=l;m<g.length;m++){var y=g[m],x=h.get(y.geometryType);y.writeMesh(p,x,v,c,t,this._pixelRatio,this._vvBufU32)}if(f){var b=this._getLabelReference(l),S=s.get(c);this._writeLabelMesh(d,h,c,t,a,S,b,n,v)}h.pushDisplayObject(d)}},e.prototype._hasBadLabelClass=function(e,t){var i=e.labelPlacement,n=y[t];if(!n)return g.error(new r("mapview-labeling:unsupported-geometry-type","Unable to create labels for WebGL Feature Layer, "+t+" is not supported")),!0;if(!n.some(function(e){return e===i})){var o=n[0];i&&g.warn("Found invalid label placement type "+i+" for "+t+". Defaulting to "+o),e.labelPlacement=o}return!1},e.prototype._validateLabelingInfo=function(e){var t=this;return!e.some(function(e){return t._hasBadLabelClass(e,t._geometryType)})},e.prototype._getLabelReference=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];if(r instanceof v.default)return r}return null},e.prototype._writeLabelMesh=function(e,t,i,r,n,o,s,l,u){for(var h=e.displayRecords,c=[],d=this._pixelRatio,f=this._vvBufU32,p=0;p<o.length;p++){var _=o[p],v=_.id,m=_.text,g=_.rtl,y=this._labelTemplates[v],x=t.get(y.geometryType),b=n.get(y.symbolId).glyphMosaicItems;y.bindReferenceTemplate(s),y.bindTextInfo(b,m,g),y.writeMesh(h,x,u,i,r,d,f,l,c)}e.metrics=c,a.DEBUG_LABELS&&this._debugLabels(e,t)},e.prototype._debugLabels=function(e,t){for(var i=e.displayRecords,r=e.id,n=0,o=e.metrics;n<o.length;n++){var s=o[n],a=s.boxes?s.boxes.concat([s.bounds]):[s.bounds];this._labelsDebugVVEval&&s.computeOffset(this._labelsDebugVVEval);for(var l=0,u=a;l<u.length;l++){var h=u[l],c=s.anchor[0]+s.offsetX+h.center[0],d=s.anchor[1]+s.offsetY+h.center[1],f={geometry:{paths:[[[c-h.width/2,d+h.height/2],[0,-h.height],[h.width,0],[0,h.height],[-h.width,0]]]},attributes:{}},p=this._getLabelDebugTemplate(),_=t.get(p.geometryType);p.writeMesh(i,_,"esriGeometryPolyline",r,f,this._pixelRatio,null)}}},e.prototype._getLabelDebugTemplate=function(){return this._labelsDebugTemplate||(this._labelsDebugTemplate=this._createLabelsDebugTemplate()),this._labelsDebugTemplate},e.prototype._createLabelsDebugTemplate=function(){var e=new s({style:"solid",width:1,color:[255,0,0,1]});return _.default.fromSimpleLine(this._materials,0,e,null,this._pixelRatio)},e}();t.default=x}.apply(null,r))||(e.exports=n)},1812:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(141),i(92),i(103),i(9),i(7),i(6),i(1493),i(1922),i(1835),i(1836),i(1832),i(1763),i(1925),i(1910),i(1744)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v){Object.defineProperty(t,"__esModule",{value:!0});var m=s.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),g=new Array,y=new n.SimpleFillSymbol({color:"black",outline:null}),x=new n.SimpleMarkerSymbol({size:"14px",color:"black",outline:null}),b=new n.SimpleLineSymbol({color:"black",width:"2px"});function S(e,t){var i=e.length;return e.push(null),t.then(function(t){return e[i]=t}),e}var T=function(){function e(e,t){this._idCounter=0,this._templateIdCounter=0,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._pixelRatio=1,this._lock=new p.default,this._fetchResource=e,this._pixelRatio=t}return Object.defineProperty(e.prototype,"_markerError",{get:function(){return this._errorTemplates.marker[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_fillError",{get:function(){return this._errorTemplates.fill[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_lineError",{get:function(){return this._errorTemplates.line[0]},enumerable:!0,configurable:!0}),e.prototype.createTemplateGroup=function(e,t,i,r){this._initErrorTemplates(i);var n=this._hashSymbol(e);if(!this._symbolToTemplate.has(n)){var o=new Array;t&&this._createMeshTemplates(o,i,t,r,this._pixelRatio,!0),this._createMeshTemplates(o,i,e,r,this._pixelRatio,!1);var s=this._createGroupId();this._idToTemplateGroup.set(s,o),this._symbolToTemplate.set(n,s)}return this._symbolToTemplate.get(n)},e.prototype.getTemplateGroup=function(e){return this._idToTemplateGroup.has(e)?this._idToTemplateGroup.get(e):g},e.prototype.finalize=function(){return this._fetchQueue.length||this._lock.isHeld()?p.withLock(this._lock,this._fetchAllQueuedResources.bind(this)):a.resolve()},e.prototype._initErrorTemplates=function(e){if(!this._errorTemplates){var t=this._pixelRatio,i=this._createMeshTemplates([],e,y,0,t,!1),r=this._createMeshTemplates([],e,x,0,t,!1),n=this._createMeshTemplates([],e,b,0,t,!1);this._errorTemplates={fill:i,marker:r,line:n}}},e.prototype._fetchAllQueuedResources=function(){var e=this;if(!this._fetchQueue.length)return a.resolve();var t=this._fetchQueue;return this._fetchQueue=[],this._fetchResource(t).then(function(t){for(var i=0,r=t;i<r.length;i++){var n=r[i],o=n.id,s=n.mosaicItem;e._idToResolver.get(o)(s),e._idToResolver.delete(o)}}).catch(function(i){"cancel"===i.dojoType?e._fetchQueue=e._fetchQueue.concat(t):m.error(new o("mapview-template-store","Unable to fetch requested texture resources",i))})},e.prototype._createGroupId=function(){return this._idCounter++},e.prototype._createTemplateId=function(){return this._templateIdCounter++},e.prototype._getCodepoints=function(e){for(var t=f.bidiText(e.text)[0],i=[],r=0;r<t.length;r++)i.push(t.charCodeAt(r));return i},e.prototype._getMosaicItem=function(e){var t=this,i=this._createTemplateId(),r="text"===e.type&&this._getCodepoints(e),n=a.create(function(e){return t._idToResolver.set(i,e)});return this._fetchQueue.push({symbol:e.toJSON(),id:i,glyphIds:r}),n},e.prototype._hashSymbol=function(e){return e.id?e.id:JSON.stringify(e)},e.prototype._createSMS=function(e,t,n,o){return i(this,void 0,void 0,function(){var i,s;return r(this,function(r){switch(r.label){case 0:return[4,this._getMosaicItem(t)];case 1:return i=r.sent().spriteMosaicItem,s=v.getMarkerVVFlags(n),_.ok(i,m)?[2,c.default.fromSimpleMarker(e,s,t,i,o)]:[2,this._markerError]}})})},e.prototype._createPMS=function(e,t,n,o){return i(this,void 0,void 0,function(){var i,s;return r(this,function(r){switch(r.label){case 0:return[4,this._getMosaicItem(t)];case 1:return i=r.sent().spriteMosaicItem,s=v.getMarkerVVFlags(n),_.ok(i,m)?[2,c.default.fromPictureMarker(e,s,t,i,o)]:[2,this._markerError]}})})},e.prototype._createSFS=function(e,t,n,o,s){return i(this,void 0,void 0,function(){var i,a;return r(this,function(r){switch(r.label){case 0:return[4,this._getMosaicItem(t)];case 1:return i=r.sent().spriteMosaicItem,a=v.getFillVVFlags(n),_.ok(i,m)?[2,u.default.fromSimpleFill(e,a,t,i,o,s)]:[2,this._fillError]}})})},e.prototype._createPFS=function(e,t,n,o,s){return i(this,void 0,void 0,function(){var i,a;return r(this,function(r){switch(r.label){case 0:return[4,this._getMosaicItem(t)];case 1:return i=r.sent().spriteMosaicItem,a=v.getFillVVFlags(n),_.ok(i,m)?[2,u.default.fromPictureFill(e,a,t,i,o,s)]:[2,this._fillError]}})})},e.prototype._createSLS=function(e,t,n,o,s){return i(this,void 0,void 0,function(){var i,a;return r(this,function(r){switch(r.label){case 0:return[4,this._getMosaicItem(t)];case 1:return i=r.sent().spriteMosaicItem,a=v.getLineVVFlags(n,s),_.ok(i,m)?[2,h.default.fromSimpleLine(e,a,t,i,o)]:[2,this._lineError]}})})},e.prototype._createTS=function(e,t,n,o){return i(this,void 0,void 0,function(){var i,s;return r(this,function(r){switch(r.label){case 0:return[4,this._getMosaicItem(t)];case 1:return i=r.sent().glyphMosaicItems,s=v.getTextVVFlags(n),[2,d.default.fromText(e,s,t,o,i)]}})})},e.prototype._createMeshTemplates=function(e,t,i,r,n,o){if(-1!==i.type.indexOf("3d"))return m.error("3D symbols are not supported with MapView"),e;switch(i.type){case l.EsriSymbolTypeKebab.SIMPLE_MARKER:return S(e,this._createSMS(t,i,r,n));case l.EsriSymbolTypeKebab.PICTURE_MARKER:return S(e,this._createPMS(t,i,r,n));case l.EsriSymbolTypeKebab.SIMPLE_FILL:var s=i;return S(e,this._createSFS(t,s,r,n,o)),s.outline&&S(e,this._createSLS(t,s.outline,r,n,!0)),e;case l.EsriSymbolTypeKebab.PICTURE_FILL:var a=i;return S(e,this._createPFS(t,a,r,n,o)),a.outline&&S(e,this._createSLS(t,a.outline,r,n,!0)),e;case l.EsriSymbolTypeKebab.SIMPLE_LINE:return S(e,this._createSLS(t,i,r,n,!1));case l.EsriSymbolTypeKebab.TEXT:return S(e,this._createTS(t,i,r,n));default:return m.error("Unable to create mesh template for unknown symbol type: "+i.type),e}},e}();t.default=T}.apply(null,r))||(e.exports=n)},1827:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(1913)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.draw=function(e,t){var i=this;if(t.canDisplay){var r=this.getGeometryType(),n=t.getDisplayList(e.drawPhase),o=t.getGeometry(r);o&&n.byType(r,function(r){i.drawGeometry(e,t,r,o)})}},t}(r.default);t.default=n}.apply(null,r))||(e.exports=n)},1830:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(36),i(1517),i(1554),i(1829)],void 0===(n=function(e,t,i,r,n,o){Object.defineProperty(t,"__esModule",{value:!0});var s=i.vec2f32.create(),a=function(){function e(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p){this.anchorX=e,this.anchorY=t,this.angle=i,this.bounds=r,this.minZoom=n,this.maxZoom=o,this.materialId=s,this.vertexOffsetUpperLeft=a,this.vertexOffsetUpperRight=l,this.vertexOffsetLowerLeft=u,this.vertexOffsetLowerRight=h,this.texFontSizeUpperLeft=c,this.texFontSizeUpperRight=d,this.texFontSizeLowerLeft=f,this.texFontSizeLowerRight=p}return e.from=function(t,a,l,u,h,c,d,f,p,_,v,m,g,y,x){void 0===y&&(y=!1),void 0===x&&(x=!1);var b=f.rect,S=f.metrics,T=-1===h?255:Math.floor(180*h/Math.PI/360*254),w=Math.round(b.x/4),E=Math.round(b.y/4),V=w+Math.round(b.width/4),I=E+Math.round(b.height/4),C=-24-S.top,M=S.left,O=-S.top,L=b.width,A=b.height;!p&&(x||(C=0),M=4,L=S.width);var R=t+M,P=x?a+O:a+C,F=R+L,D=P,z=R,G=P+A,N=F,B=G,U=z+S.width,k=G-S.height,j=S.width*m/24,W=S.height*m/24;if(v){var H=s,X=v;i.vec2.transformMat2d(H,i.vec2.set(H,R,P),X),R=H[0],P=H[1],i.vec2.transformMat2d(H,i.vec2.set(H,F,D),X),F=H[0],D=H[1],i.vec2.transformMat2d(H,i.vec2.set(H,z,G),X),z=H[0],G=H[1],i.vec2.transformMat2d(H,i.vec2.set(H,N,B),X),N=H[0],B=H[1],i.vec2.transformMat2d(H,i.vec2.set(H,U,k),X),U=H[0],k=H[1]}return new e(0|l,0|u,T,y?new o.default(U,k,j+r.COLLISION_BOX_PADDING,W+r.COLLISION_BOX_PADDING):null,c,d,_,n.i1616to32(8*R,8*P),n.i1616to32(8*F,8*D),n.i1616to32(8*z,8*G),n.i1616to32(8*N,8*B),n.i8888to32(w,E,m,g),n.i8888to32(V,E,m,g),n.i8888to32(w,I,m,g),n.i8888to32(V,I,m,g))},e}();t.default=a}.apply(null,r))||(e.exports=n)},1831:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){function i(e,t){return Math.sqrt(e*e+t*t)}Object.defineProperty(t,"__esModule",{value:!0}),t.sub=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},t.len=i,t.normalize=function(e){var t=i(e[0],e[1]);e[0]/=t,e[1]/=t},t.dist=function(e,t){return i(e[0]-t[0],e[1]-t[1])}}.apply(null,r))||(e.exports=n)},1832:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(9),i(7),i(30),i(36),i(1661),i(1517),i(1493),i(1808),i(1554),i(1833),i(1649),i(1829),i(1830),i(1745),i(1763),i(1645),i(1523)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m,g,y){Object.defineProperty(t,"__esModule",{value:!0});var x=n.getLogger("esri.views.2d.engine.webgl.WGLTextTemplate"),b=255,S=s.mat2df32.create(),T=s.vec2f32.create(),w=function(e){function t(t,i,r){var n=e.call(this)||this;return n.geometryType=u.WGLGeometryType.TEXT,n.vvFlags=0,n._xOffset=o.pt2px(r.xoffset),n._yOffset=o.pt2px(r.yoffset),n._decorationTop=h.getFontDecorationTop(r.font),n._color=0|(r.color&&a.premultiplyAlphaRGBA(r.color)),n._haloColor=0|(r.haloColor&&a.premultiplyAlphaRGBA(r.haloColor)),n._haloSize=Math.min(Math.floor(5*o.pt2px(o.toPt(r.haloSize||0))),127),n._size=Math.min(Math.round(o.pt2px(r.font.size)),127),n._scale=n._size/24,n._angle=r.angle||0,n._justify=g.getJustification(r.horizontalAlignment||"center"),n._xAlignD=g.getXAnchorDirection(r.horizontalAlignment||"center"),n._yAlignD=-g.getYAnchorDirection(r.verticalAlignment||"baseline"),n._baseline="baseline"===(r.verticalAlignment||"baseline"),n._materialStore=t,n.vvFlags=i,n.symbolId=r.id,n}return i(t,e),t.fromText=function(e,i,r,n,o){var s=new t(e,i,r),a=m.bidiText(r.text),l=a[0],u=a[1];return s.bindTextInfo(o,l,u),s._computeGlyphs(s._shapedGlyphs,s._shapedBox),s},t.prototype.bindTextInfo=function(e,t,i){var r=this._computeShaping(e,this._justify).getShaping(t,i);isNaN(this._decorationTop)||d.addDecoration(r,this._decorationTop),this._shapedGlyphs=r,this._shapedBox=d.getBox(r)},t.prototype.writeMesh=function(e,t,i,n,o,s,a){var l,u,h=this._computedGlyphs;switch(i){case"esriGeometryPoint":for(var c=o.geometry,d=c.x,f=c.y,p=0,_=h;p<_.length;p++)(E=_[p]).anchorX=d,E.anchorY=f;return void this._writeVertices(e,t,n,a,h,0,0);case"esriGeometryPolygon":if(o.centroid){for(var v=o.centroid,m=(d=v.x,f=v.y,0),g=h;m<g.length;m++)(E=g[m]).anchorX=d,E.anchorY=f;return void this._writeVertices(e,t,n,a,h,0,0)}case"esriGeometryMultipoint":d=0,f=0;for(var y=0,b=o.geometry.points;y<b.length;y++){var S=b[y];d+=S[0],f+=S[1];for(var T=0,w=h;T<w.length;T++){var E;(E=w[T]).anchorX=d,E.anchorY=f}this._writeVertices(e,t,n,a,h,0,0)}return;default:l="Unable to handle geometryType: "+i,void 0===u&&(u="mapview-processing"),x.error(new r(u,l))}},t.prototype._computeGlyphs=function(e,t){for(var i=new Array(e.length),r=this._computeGlyphTransform(t),n=0;n<e.length;n++){var o=e[n],s=o.x,a=o.y,l=o.codePoint,u=o.glyphMosaicItem,h=this._materialStore.createGlyphMaterial(u,this.geometryType,this.vvFlags);i[n]=_.default.from(s,a,0,0,-1,0,25,u,l,h,r,this._size,this._haloSize,!1,!0)}this._computedGlyphs=i},t.prototype._createBounds=function(e,t){var i,r,n=e.width/2,o=e.height/2,a=t[4],u=t[5];if(this._angle){var h=s.vec2f32.fromValues(-n,-o),c=s.vec2f32.fromValues(n,-o),d=s.vec2f32.fromValues(-n,o),f=s.vec2f32.fromValues(n,o);s.vec2.transformMat2d(h,h,t),s.vec2.transformMat2d(c,c,t),s.vec2.transformMat2d(d,d,t),s.vec2.transformMat2d(f,f,t);for(var _=1/0,v=1/0,m=0,g=0,y=0,x=[h,c,d,f];y<x.length;y++){var b=x[y];_=Math.min(b[0],_),m=Math.max(b[0],m),v=Math.min(b[1],v),g=Math.max(b[1],g)}i=m-_,r=g-v}else i=e.width*this._scale,r=e.height*this._scale;var S=i+l.COLLISION_BOX_PADDING,T=r+l.COLLISION_BOX_PADDING;return new p.default(a,u,S,T)},t.prototype._computeShaping=function(e,t){return new d([e],l.TEXT_MAX_WIDTH,l.TEXT_LINE_HEIGHT,l.TEXT_SPACING,[0,.5*-l.TEXT_LINE_HEIGHT],.5*(1-this._xAlignD),0,t)},t.prototype._computeGlyphTransform=function(e){var t=this._scale,i=this._angle*y.C_DEG_TO_RAD,r=s.mat2d.identity(S);s.mat2d.rotate(r,r,i),s.mat2d.translate(r,r,s.vec2.set(T,this._xOffset,-this._yOffset)),s.mat2d.scale(r,r,s.vec2.set(T,t,t));var n=this._baseline?25:e.y+(1-this._yAlignD)*e.height*.5;return s.mat2d.translate(r,r,s.vec2.set(T,-4,-4-n)),r},t.prototype._getOffset=function(e){var t=this.vvFlags?9:5;return e.length/t},t.prototype._writeVertices=function(e,t,i,r,n,o,s){this._writeHalos(e,t,i,r,n,o,s),this._writeText(e,t,i,r,n,o,s)},t.prototype._writeHalos=function(e,t,i,r,n,o,s){var a=t.indexVector,l=t.get("geometry"),u=this._getOffset(l),h=0;if(this._haloSize)for(var d=0;d<n.length;d++,h+=4){var p=n[d],_=c.i1616to32(2*p.anchorX+1,2*p.anchorY),v=n[d].materialId,m=this._materialStore.get(v),g=null==o?Math.floor(10*p.minZoom):o,y=null==s?Math.floor(10*p.maxZoom):s,x=new f(i,this.geometryType,v,g,y);x.vertexFrom=u+h,x.indexFrom=a.length,this._writeVertex(x,t,i,_,this._haloColor,p,m,r),this._writeIndices(x,a,u+h),e.push(x)}},t.prototype._writeText=function(e,t,i,r,n,o,s){for(var a=t.indexVector,l=t.get("geometry"),u=this._getOffset(l),h=0,d=0;d<n.length;d++,h+=4){var p=n[d],_=c.i1616to32(2*p.anchorX,2*p.anchorY),v=n[d].materialId,m=this._materialStore.get(v),g=null==o?Math.floor(10*p.minZoom):o,y=null==s?Math.floor(10*p.maxZoom):s,x=new f(i,this.geometryType,v,g,y);x.vertexFrom=u+h,x.indexFrom=a.length,this._writeVertex(x,t,i,_,this._color,p,m,r),this._writeIndices(x,a,u+h),e.push(x)}},t.prototype._writeVertex=function(e,t,i,r,n,o,s,a){var l=t.get("geometry"),u=t.get("visibility");l.push(r),l.push(i),l.push(n),l.push(o.vertexOffsetUpperLeft),l.push(o.texFontSizeUpperLeft),this._writeVV(l,a,s),u.push(b),l.push(r),l.push(i),l.push(n),l.push(o.vertexOffsetUpperRight),l.push(o.texFontSizeUpperRight),this._writeVV(l,a,s),u.push(b),l.push(r),l.push(i),l.push(n),l.push(o.vertexOffsetLowerLeft),l.push(o.texFontSizeLowerLeft),this._writeVV(l,a,s),u.push(b),l.push(r),l.push(i),l.push(n),l.push(o.vertexOffsetLowerRight),l.push(o.texFontSizeLowerRight),this._writeVV(l,a,s),u.push(b),e.vertexCount+=4},t.prototype._writeVV=function(e,t,i){i.materialKeyInfo.hasVV()&&(e.push(t[u.VVType.SIZE]),e.push(t[u.VVType.COLOR]),e.push(t[u.VVType.OPACITY]),e.push(t[u.VVType.ROTATION]))},t.prototype._writeIndices=function(e,t,i){t.push(i+0),t.push(i+1),t.push(i+2),t.push(i+1),t.push(i+3),t.push(i+2),e.indexCount+=6},t}(v.default);t.default=w}.apply(null,r))||(e.exports=n)},1833:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1640)],void 0===(n=function(e,t,i){return function(){function e(e,t,i,r,n,o,s,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=i,this._letterSpacing=r,this._offset=n,this._hAnchor=o,this._vAnchor=s,this._justify=a}return e.prototype.getShaping=function(e,t){for(var i=this._letterSpacing,r=this._lineHeight,n=this._justify,o=this._maxWidth,s=[],a=0,l=0,u=0,h=0,c=-1,d=0,f=-1,p=e.length,_=0;_<p;_++){var v=e.charCodeAt(_);if(10!==v){for(var m=void 0,g=0,y=this._glyphItems;g<y.length&&!(m=y[g][v]);g++);if(m){if(s.push({codePoint:v,x:a,y:l,glyphMosaicItem:m}),a+=m.metrics.advance+i,0<o&&o<a&&0<=f){var x=f+1;S=s[x].x,d=Math.max(S,d);for(var b=x;b<s.length;b++)t?s[b].y-=r:s[b].y+=r,s[b].x-=S;n&&this._applyJustification(s,h,f),t?l-=r:l+=r,a-=S,++u,h=x,f=-1}++c,32===v&&(f=s.length-1)}}else{if(_===p-1)continue;if(h<=c){var S=(T=s[c]).x+T.glyphMosaicItem.metrics.advance;d=Math.max(S,d),n&&this._applyJustification(s,h,c),h=s.length}t?l-=r:l+=r,a=0,++u}}if(h<=c){var T,w=(T=s[c]).x+T.glyphMosaicItem.metrics.advance;d=Math.max(d,w),n&&this._applyJustification(s,h,c)}if(0<s.length){var E=(n-this._hAnchor)*d,V=(-this._vAnchor*(u+1)+.5)*r;t&&u&&(V+=u*r),E+=this._offset[0],V+=this._offset[1];for(var I=0,C=s;I<C.length;I++){var M=C[I];M.x+=E,M.y+=V}}return s},e.getBox=function(e){if(!e.length)return null;for(var t=1/0,i=1/0,r=-1/0,n=-1/0,o=0,s=e;o<s.length;o++){var a=s[o],l=a.glyphMosaicItem.metrics,u=l.height,h=l.left,c=l.top,d=l.width,f=a.x+h,p=a.y-c,_=f+d,v=p+u;t=Math.min(t,f),r=Math.max(r,_),i=Math.min(i,p),n=Math.max(n,v)}return{x:t,y:i,width:r-t,height:n-i}},e.addDecoration=function(e,t){var r=e.length;if(0!==r){for(var n=e[0].x+e[0].glyphMosaicItem.metrics.left,o=e[0].y,s=1;s<r;s++){var a=e[s];if(a.y!==o){var l=e[s-1].x+e[s-1].glyphMosaicItem.metrics.left+e[s-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:o,glyphMosaicItem:{rect:new i(4,0,4,8),metrics:{width:l-n,height:2,left:0,top:t,advance:0},page:0}}),o=a.y,n=a.x+a.glyphMosaicItem.metrics.left}}var u=e[r-1].x+e[r-1].glyphMosaicItem.metrics.left+e[r-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:o,glyphMosaicItem:{rect:new i(4,0,4,8),metrics:{width:u-n,height:2,left:0,top:t,advance:0},page:0}})}},e.prototype._applyJustification=function(e,t,i){for(var r=e[i],n=r.glyphMosaicItem.metrics.advance,o=(r.x+n)*this._justify,s=t;s<=i;s++)e[s].x-=o},e}()}.apply(null,r))||(e.exports=n)},1835:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(7),i(30),i(1661),i(1517),i(1493),i(1493),i(1781),i(1554),i(1666),i(1490),i(1649),i(1745)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p){Object.defineProperty(t,"__esModule",{value:!0});var _=r.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate"),v=65535,m=u.allocTriangles(20),g=u.allocTriangles(20),y=[u.allocExtrudeVectors(),u.allocExtrudeVectors()],x=u.allocExtrudeVectors(),b=s.TILE_SIZE+8,S=31,T=new u.Tessellator({distanceAlongCorrection:!0}),w=new c.TileClipper(0,0,0,1,8);w.setExtent(s.TILE_SIZE);var E=function(e){function t(t,i,r,n,o,s,l,u,h,c,d,f){var p=e.call(this)||this;p.capType=s,p.joinType=l,p.fillColor=u,p.tl=h,p.br=c,p.hasPattern=d,p.isDashed=f,p.geometryType=a.WGLGeometryType.LINE;var _=1/o;return p.halfWidth=0<n?.5*(n+_):0,p._materialStore=t,p.vvFlags=i,p.materialId=p._materialStore.createSpriteMaterial(r,p.geometryType,i),p}return i(t,e),t.fromSimpleLine=function(e,i,r,s,a){var l=r.color,u="solid"!==r.style&&"none"!==r.style,c=d.getCapType(r.cap||"round",u),f=d.getJoinType(r.join||"round"),p=l&&"none"!==r.style&&o.premultiplyAlphaRGBA(l)||0;if("none"===r.style&&(p=0),!s)return new t(e,i,s,n.pt2px(r.width),a,c,f,p,0,0,!1,u);var _=s.rect,v=s.width,m=s.height,g=_.x+1,y=_.y+1,x=_.x+1+v,b=_.y+1+m,S=h.i1616to32(g,y),T=h.i1616to32(x,b);return new t(e,i,s,n.pt2px(r.width),a,c,f,p,S,T,!0,u)},t.fromPictureLineSymbol=function(e,t,i,r){return _.error("PictureLineSymbol support does not exist!"),null},t.prototype.writeMesh=function(e,t,i,r,n,o,s){if(this.vvFlags&l.WGLVVFlag.COLOR||0!==this.fillColor){var a=this._materialStore.get(this.materialId),u=t.indexVector,h=t.get("geometry"),c=t.get("visibility"),d=this.halfWidth,p=new f(r,this.geometryType,this.materialId),v=this._getOffset(h,a);switch(p.vertexFrom=v,p.indexFrom=u.length,i){case"esriGeometryPolyline":var m=n.geometry.paths;if(0===(g=this._clipLines(m)).length)return;return this._write(p,u,h,c,v,r,d,g,a,s),void e.push(p);case"esriGeometryPolygon":var g,y=n.geometry.rings;if(0===(g=this._clipLines(y)).length)return;return this._write(p,u,h,c,v,r,d,g,a,s),void e.push(p);default:_.error("Unable to handle geometryType: "+i)}}},t.prototype._clipLines=function(e){for(var t=[],i=!1,r=0;r<e.length;){var n=[],o=e[r];w.reset(2);var s=o[0],a=s[0],l=s[1];if(i)w.moveTo(a,l);else{if(a<-8||b<a||l<-8||b<l){i=!0;continue}n.push({x:a,y:l})}for(var u=!1,h=o.length,c=1;c<h;++c)if(a+=o[c][0],l+=o[c][1],i)w.lineTo(a,l);else{if(a<-8||b<a||l<-8||b<l){u=!0;break}n.push({x:a,y:l})}if(u)i=!0;else{if(i){var d=w.resultWithStarts();if(d)for(var f=0,p=d;f<p.length;f++){var _=p[f];t.push(_)}}else t.push({line:n,start:0});r++,i=!1}}return t},t.prototype._getOffset=function(e,t){var i=t.materialKeyInfo.hasVV()?11:8;return e.length/i},t.prototype._write=function(e,t,i,r,n,o,s,a,l,h){for(var c=0,d=0,f=a;d<f.length;d++){var p=f[d],_=p.line,g=p.start;if(!(_.length<2))for(var b=_[0],S=_[_.length-1],w=S.x-b.x,E=S.y-b.y,V=w*w+E*E<1e-6,I=g%v,C=y[1],M=0;M<_.length;M++){var O=_[M],L=C===y[M%2]?y[(M+1)%2]:y[M%2],A=0===M,R=M===_.length-1;if(R&&V&&!this.hasPattern?u.copyExtrudeVectors(L,x):(this._computeExtrudeVectors(L,M,_,V),c+=this._writeVertices(i,r,o,s,O.x,O.y,L,I,c,l,h),null==L.capCenter||V&&R||this._writePieIndices(e,t,n,L),V&&A&&!this.hasPattern&&u.copyExtrudeVectors(x,L)),A||this._writeBridgeIndices(e,t,n,C,L),!R){var P=_[M+1],F=[P.x-O.x,P.y-O.y],D=u.length(F),z=[F[0]/D,F[1]/D],G=I+D;if(v<G){var N=(v-I)/(G-I),B=O.x+(P.x-O.x)*N,U=O.y+(P.y-O.y)*N,k=C;T.buttCap(k,z,z),c+=this._writeVertices(i,r,o,s,B,U,k,v,c,l,h),T.bridge(m,L,k),this._writeBridgeIndices(e,t,n,L,k),T.buttCap(k,z,z),I=G-v}else I=G,C=L}}}e.vertexCount=c},t.prototype._writeVertices=function(e,t,i,r,n,o,s,a,l,u,c){for(var d=0,f=h.i1616to32(n,o),p=s.vectors,_=p.items,v=p.count;d<v;++d){var m=_[d].vector,g=m[0],y=m[1],x=_[d].texCoords,b=x[0],T=x[1],w=_[d].direction,E=w[0],V=w[1],I=h.i1616to32(a,S*r),C=h.i8888to32(Math.round(S*g),Math.round(S*y),Math.round(S*b),Math.round(S*T)),M=h.i8888to32(Math.round(S*E),Math.round(S*V),0,0);e.push(f),e.push(i),e.push(this.fillColor),e.push(C),e.push(I),e.push(this.tl),e.push(this.br),e.push(M),this._writeVV(e,c,u),t.push(255),_[d].base={index:l+d,point:[n,o]}}return d},t.prototype._writeVV=function(e,t,i){i.materialKeyInfo.hasVV()&&(e.push(t[a.VVType.SIZE]),e.push(t[a.VVType.COLOR]),e.push(t[a.VVType.OPACITY]))},t.prototype._writeBridgeIndices=function(e,t,i,r,n){T.bridge(m,r,n);for(var o=0;o<m.count;++o){var s=m.items[o];t.push(i+s.v1.base.index),t.push(i+s.v2.base.index),t.push(i+s.v3.base.index),e.indexCount+=3}},t.prototype._writePieIndices=function(e,t,i,r){T.pie(g,r);for(var n=0;n<g.count;++n){var o=g.items[n];t.push(i+o.v1.base.index),t.push(i+o.v2.base.index),t.push(i+o.v3.base.index),e.indexCount+=3}},t.prototype._computeExtrudeVectors=function(e,t,i,r){var n=i[t],o=[void 0,void 0],s=[void 0,void 0];if(0<t&&t<i.length-1){var a=i[(t+i.length-1)%i.length],l=i[(t+1)%i.length];u.normalize(o,[n.x-a.x,n.y-a.y]),u.normalize(s,[l.x-n.x,l.y-n.y])}else if(0===t)if(l=i[(t+1)%i.length],u.normalize(s,[l.x-n.x,l.y-n.y]),r){var h=i[i.length-2];u.normalize(o,[n.x-h.x,n.y-h.y])}else o=s;else{if(t!==i.length-1)return void console.error("Vertex index 'i' out of range.");if(a=i[(t+i.length-1)%i.length],u.normalize(o,[n.x-a.x,n.y-a.y]),r){var c=i[1];u.normalize(s,[c.x-n.x,c.y-n.y])}else s=o}r||0!==t?r||t!==i.length-1?this._computeJoinExtrudeVectors(e,o,s):this._computeCapExtrudeVectors(e,o,s,u.CapPosition.END):this._computeCapExtrudeVectors(e,o,s,u.CapPosition.START)},t.prototype._computeCapExtrudeVectors=function(e,t,i,r){switch(this.capType){case a.CapType.BUTT:return void T.buttCap(e,t,i);case a.CapType.ROUND:var n=u.getNumberOfSlices(Math.PI),o=r===u.CapPosition.START?-1:1;return void T.roundCap(e,t,i,r,n,o);case a.CapType.SQUARE:return void(this.isDashed?T.squareCapForDashedLines(e,t,i,r):T.squareCap(e,t,i,r));default:return _.error("Encountered unknown cap type: "+this.capType+", defaulting to BUTT"),void T.buttCap(e,t,i)}},t.prototype._computeJoinExtrudeVectors=function(e,t,i){var r=u.getRads(t,i);if(r>Math.PI-.05)T.rectJoin(e,t,i);else if(this.joinType===a.JoinType.MITER||r<.1)r<.05?T.fastMiterJoin(e,t,i):r<u.MITER_SAFE_RADS?T.miterJoin(e,t,i):T.bevelJoin(e,t,i,u.SYSTEM_MAG_LIMIT);else if(this.joinType===a.JoinType.BEVEL)T.bevelJoin(e,t,i,1);else if(this.joinType===a.JoinType.ROUND){var n=u.getNumberOfSlices(r);r<2.3?n<2||r<.5?T.bevelJoin(e,t,i,1):T.roundJoin(e,t,i,n):T.unitRoundJoin(e,t,i,n)}},t}(p.default);t.default=E}.apply(null,r))||(e.exports=n)},1836:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(7),i(30),i(36),i(1661),i(1517),i(1493),i(1554),i(1649),i(1745)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c){Object.defineProperty(t,"__esModule",{value:!0});var d=r.getLogger("esri.views.2d.engine.webgl.WGLMeshTemplate"),f=255,p=function(e){function t(t,i,r,n,s,a,h,c,d,f,p){var _=e.call(this)||this;_.geometryType=l.WGLGeometryType.MARKER;var v=o.vec2f32.create(),m=o.mat2df32.create();h=0===h?0:Math.max(h,2),c=0===c?0:Math.max(c,2);var g=p.sdf?.5:1;o.mat2d.translate(m,m,o.vec2f32.fromValues(g*r,g*-n)),s&&o.mat2d.rotate(m,m,3.14159265359/180*s),_._materialStore=t,_.vvFlags=i,_._materialId=t.createSpriteMaterial(p,_.geometryType,i),_._fillColor=a,_._outlineColor=d,_._sizeOutlineWidth=u.i8888to32(h,c,f,0);var y=Math.round(p.rect.x/4)-128,x=Math.round(p.rect.y/4)-128,b=y+Math.round(p.rect.width/4),S=x+Math.round(p.rect.height/4);return o.vec2.set(v,-.5*h,-.5*c),o.vec2.transformMat2d(v,v,m),_._offsetAndTexUpperLeft=u.i8888to32(v[0],v[1],y,x),o.vec2.set(v,.5*h,-.5*c),o.vec2.transformMat2d(v,v,m),_._offsetAndTexUpperRight=u.i8888to32(v[0],v[1],b,x),o.vec2.set(v,-.5*h,.5*c),o.vec2.transformMat2d(v,v,m),_._offsetAndTexBottomLeft=u.i8888to32(v[0],v[1],y,S),o.vec2.set(v,.5*h,.5*c),o.vec2.transformMat2d(v,v,m),_._offsetAndTexBottomRight=u.i8888to32(v[0],v[1],b,S),_.height=c,_.width=h,_.xOffset=r,_.yOffset=n,_}return i(t,e),t.fromPictureMarker=function(e,i,r,o,s){var l=Math.round(n.pt2px(r.width)),u=Math.round(n.pt2px(r.height)),h=a.PICTURE_FILL_COLOR;return new t(e,i,Math.round(n.pt2px(r.xoffset||0)),Math.round(n.pt2px(r.yoffset||0)),r.angle,h,l,u,0,0,o)},t.fromSimpleMarker=function(e,i,r,o,a){var l=s.premultiplyAlphaRGBA(r.color),u=Math.round(n.pt2px(r.size)),h=u,c=Math.round(n.pt2px(r.xoffset||0)),d=Math.round(n.pt2px(r.yoffset||0)),f=r.outline,p=0|(f&&f.color&&s.premultiplyAlphaRGBA(f.color)),_=0|(f&&f.width&&Math.round(n.pt2px(f.width)));return new t(e,i,c,d,r.angle,l,u,h,p,_,o)},t.prototype.writeMesh=function(e,t,i,r,n,o,s){var a=this._materialStore.get(this._materialId),l=t.indexVector,u=t.get("geometry"),c=t.get("visibility"),f=new h(r,this.geometryType,this._materialId),p=this._getOffset(u,a);switch(e.push(f),f.vertexFrom=p,f.indexFrom=l.length,i){case"esriGeometryPoint":var _=n.geometry,v=_.x,m=_.y;return this._writeVertices(f,u,c,r,this._getPos(v,m),a,s),void this._writeIndices(f,l,p);case"esriGeometryPolyline":var g=n.geometry.paths;return void this._writeMany(f,l,u,c,p,r,g[0],a,s);case"esriGeometryPolygon":var y=n.centroid;return void(y?(v=y.x,m=y.y,this._writeVertices(f,u,c,r,this._getPos(v,m),a,s),this._writeIndices(f,l,p)):d.error("Tried to render polygon geometries as markers, but found no centroid!"));case"esriGeometryMultipoint":var x=n.geometry.points;return void this._writeMany(f,l,u,c,p,r,x,a,s);case"esriGeometryEnvelope":default:d.error("Unable to handle geometryType: "+i)}},t.prototype._getPos=function(e,t){return u.i1616to32(e,t)},t.prototype._writeMany=function(e,t,i,r,n,o,s,a,l){for(var u=0,h=0,c=0,d=0,f=s;d<f.length;d++){var p=f[d],_=p[0],v=p[1];this._writeVertices(e,i,r,o,this._getPos(_+u,v+h),a,l),this._writeIndices(e,t,n+c),u+=_,h+=v,c+=4}},t.prototype._getOffset=function(e,t){var i=t.materialKeyInfo.hasVV()?10:6;return e.length/i},t.prototype._writeVertices=function(e,t,i,r,n,o,s){t.push(n),t.push(this._offsetAndTexUpperLeft),t.push(r),t.push(this._fillColor),t.push(this._outlineColor),t.push(this._sizeOutlineWidth),this._writeVV(t,s,o),i.push(f),t.push(n),t.push(this._offsetAndTexUpperRight),t.push(r),t.push(this._fillColor),t.push(this._outlineColor),t.push(this._sizeOutlineWidth),this._writeVV(t,s,o),i.push(f),t.push(n),t.push(this._offsetAndTexBottomLeft),t.push(r),t.push(this._fillColor),t.push(this._outlineColor),t.push(this._sizeOutlineWidth),this._writeVV(t,s,o),i.push(f),t.push(n),t.push(this._offsetAndTexBottomRight),t.push(r),t.push(this._fillColor),t.push(this._outlineColor),t.push(this._sizeOutlineWidth),this._writeVV(t,s,o),i.push(f),e.vertexCount+=4},t.prototype._writeVV=function(e,t,i){i.materialKeyInfo.hasVV()&&(e.push(t[l.VVType.SIZE]),e.push(t[l.VVType.COLOR]),e.push(t[l.VVType.OPACITY]),e.push(t[l.VVType.ROTATION]))},t.prototype._writeIndices=function(e,t,i){var r=i;t.push(r+0),t.push(r+1),t.push(r+2),t.push(r+1),t.push(r+3),t.push(r+2),e.indexCount+=6},t}(c.default);t.default=p}.apply(null,r))||(e.exports=n)},1878:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1908),i(1475),i(1484),i(1478)],void 0===(n=function(e,t,i,r,n,o){return function(){function e(){this._initialized=!1}return e.prototype.dispose=function(){this._program&&(this._program.dispose(),this._program=null),this._vertexArrayObject&&(this._vertexArrayObject.dispose(),this._vertexArrayObject=null)},e.prototype.render=function(e,t,i,r){e&&(this._initialized||this._initialize(e),e.setBlendFunctionSeparate(1,771,1,771),e.bindVAO(this._vertexArrayObject),e.bindProgram(this._program),t.setSamplingMode(i),e.bindTexture(t,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",r),e.drawArrays(5,0,4),e.bindVAO())},e.prototype._initialize=function(e){if(this._initialized)return!0;var t=i.bitBlit.attributes,s=n.createProgram(e,i.bitBlit);if(!s)return!1;var a=new Int8Array(16);a[0]=-1,a[1]=-1,a[2]=0,a[3]=0,a[4]=1,a[5]=-1,a[6]=1,a[7]=0,a[8]=-1,a[9]=1,a[10]=0,a[11]=1,a[12]=1,a[13]=1,a[14]=1,a[15]=1;var l=new o(e,t,{geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:4,normalized:!1,divisor:0},{name:"a_tex",count:2,type:5120,offset:2,stride:4,normalized:!1,divisor:0}]},{geometry:r.createVertex(e,35044,a)});return this._program=s,this._vertexArrayObject=l,this._initialized=!0},e}()}.apply(null,r))||(e.exports=n)},1880:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(7),i(30),i(90)],void 0===(n=function(e,t,i,r,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){return e.order-t.order},s=function(e,t){return e.index-t.index},a=i.getLogger("esri/views/2d/engine/webgl/collisions/CollisionEngine");function l(e){return function(t){return r.pt2px(e.getSize(t))}}function u(e){if(!e)return null;for(var t=0,i=e;t<i.length;t++){var r=i[t];if("size"===r.type)return l(r)}return null}t.createLabelVVEvaluator=u;var h=function(){function e(e,t,i,r){var o=this;this._vvHandle=null;var s=e.geometryType,a=e.labelingInfo,l=e.renderer;this.vvEval=u("visualVariables"in l&&l.visualVariables),this._vvHandle=e.watch("visualVariables",function(e){o.vvEval=u(e)});var h=a.map(function(e){return i=r,o=!!(t=e).minScale,s=!!t.maxScale,a=o&&i.scaleToZoom(t.minScale)||0,l=s&&i.scaleToZoom(t.maxScale)||255,{minZoom:n.clamp(Math.floor(10*a),0,255),maxZoom:n.clamp(Math.floor(10*l),0,255)};var t,i,o,s,a,l});this.geometryType=s,this.index=t,this.order=i,this.zoomRanges=h}return e.prototype.hasVV=function(){return!!this.vvEval},e.prototype.allOrNothing=function(){return!("polyline"===this.geometryType)},e.prototype.destroy=function(){this._vvHandle.remove()},e.create=function(t,i,r,n){for(var s=r.sort(o),a=!1,l=-1,u=0,h=s;u<h.length;u++){var c=h[u];!a&&c.order>i&&(l=c.index,a=!0),a&&c.index++}return a||(l=s.length),new e(t,l,i,n)},e.delete=function(e,t){for(var i=t.sort(s),r=e+1;r<i.length;r++)t[r].index--;t[e].destroy(),t.splice(e,1)},e.find=function(e,t){for(var i=0,r=t;i<r.length;i++){var n=r[i];if(n.index===e)return n}return a.error("Tried to get a LayerCollisionInfo for an index that doesn't exist!"),null},e}();t.default=h}.apply(null,r))||(e.exports=n)},1908:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1729)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.bitBlit={name:"bitBlit",shaders:{vertexShader:i.resolveIncludes("bitBlit/bitBlit.vert"),fragmentShader:i.resolveIncludes("bitBlit/bitBlit.frag")},attributes:{a_pos:0,a_tex:1}}}.apply(null,r))||(e.exports=n)},1909:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){return{background:{"background.frag":"uniform lowp vec4 u_color;\nvoid main() {\n  gl_FragColor = u_color;\n}\n","background.vert":"attribute vec2 a_pos;\n\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_coord_range;\nuniform mediump float u_depth;\n\nvoid main() {\n  vec3 v_pos = u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0);\n  gl_Position = vec4(v_pos.xy, 0.0, 1.0);\n}\n"},bitBlit:{"bitBlit.frag":"uniform lowp sampler2D u_tex;\nuniform lowp float u_opacity;\n\nvarying mediump vec2 v_uv;\n\nvoid main() {\n  lowp vec4 color = texture2D(u_tex, v_uv);\n\n  // Note: output in pre-multiplied alpha for correct alpha compositing\n  gl_FragColor = color *  u_opacity;\n}\n","bitBlit.vert":"attribute vec2 a_pos;\nattribute vec2 a_tex;\n\nvarying mediump vec2 v_uv;\n\nvoid main(void) {\n  gl_Position = vec4(a_pos, 0.0, 1.0);\n  v_uv = a_tex;\n}\n"},highlight:{"blur.frag":"// A gaussian blur shader. It blurs the alpha channel of its input\n// according to 4 different sigma and stores the results into the\n// four channel of the target framebuffer.\n\n// It is intended to be called twice; the first time to perform an\n// horizontal blur, and a second time to perform a vertical blur.\n\n// This shader is used to turn the highlight mask into a highlight\n// map. The highlight map is an approximation of the signed distance\n// field of the mask.\n\n\n// Interpolated texture coordinates.\nvarying mediump vec2 v_texcoord;\n\n// Blur direction information. There are two possible\n// configurations that the host code can use.\n//  - [1, 0, 1/WIDTH, 0] Used when blurring horizontally. In this\n//    case u_direction[0] = 1 is expressed in pixel and is fed to\n//    the gauss function to produce the value of the gaussian weight\n//    for that pixel, while u_direction[2] = 1/WIDTH is in texel units\n//    and is used to sample the right texel from the texture map.\n//  - [0, 1, 0, 1/HEIGHT] Used when blurring vertically. In this\n//    case u_direction[1] = 1 is expressed in pixel and is fed to\n//    the gauss function to produce the value of the gaussian weight\n//    for that pixel, while u_direction[3] = 1/HEIGHT is in texel units\n//    and is used to sample the right texel from the texture map.\nuniform mediump vec4 u_direction;\n\n// Source to destination channel selection matrix.\nuniform mediump mat4 u_channelSelector;\n\n// The highlight map is obtained by blurring the alpha channel of the highlight\n// mask accroding to these 4 values of the gaussian's sigma parameter.\nuniform mediump vec4 u_sigmas;\n\n// This is the highlight mask if we have not blurred horizontally yet, otherwise\n// it is the horizontally blurred highlight map and blurring it one more time\n// vertically will complete the process.\nuniform sampler2D u_texture;\n\n// The gaussian kernel. Note that it lacks the normalization constant, because\n// we want to store it unnormalized in the highlight map (i.e. having a peak\n// value of 1). Note also that we are using the SIMD (single instruction, multiple\n// data) capabilities of the GPU to compute four different gaussian kernels, one\n// for each sigma.\nmediump vec4 gauss(mediump vec2 dir) {\n  return exp(-dot(dir, dir) / (2.0 * u_sigmas * u_sigmas));\n}\n\nmediump vec4 selectChannel(mediump vec4 sample) {\n  return u_channelSelector * sample;\n}\n\n// Sample the input texture and accumulated its gaussian weighted value and the\n// total weight.\nvoid accumGauss(mediump float i, inout mediump vec4 tot, inout mediump vec4 weight) {\n  // Computes the gaussian weights, one for each sigma.\n  // Note that u_direction.xy is [1, 0] when blurring horizontally and [0, 1] when blurring vertically.\n  mediump vec4 w = gauss(i * u_direction.xy);\n\n  // Accumumates the values.\n  // Note that u_direction.xy is [1/WIDTH, 0] when blurring horizontally and [0, 1/HEIGHT] when blurring vertically.\n  tot += selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw)) * w;\n\n  // Accumulates the weights.\n  weight += w;\n}\n\nvoid main(void) {\n  // Initialize accumulated values and weights to zero.\n  mediump vec4 tot = vec4(0.0, 0.0, 0.0, 0.0);\n  mediump vec4 weight = vec4(0.0, 0.0, 0.0, 0.0);\n\n  // Accumulates enough samples. These will be taken\n  // horizontally or vertically depending on the value\n  // of u_direction.\n  accumGauss(-5.0, tot, weight);\n  accumGauss(-4.0, tot, weight);\n  accumGauss(-3.0, tot, weight);\n  accumGauss(-2.0, tot, weight);\n  accumGauss(-1.0, tot, weight);\n  accumGauss(0.0, tot, weight);\n  accumGauss(1.0, tot, weight);\n  accumGauss(2.0, tot, weight);\n  accumGauss(3.0, tot, weight);\n  accumGauss(4.0, tot, weight);\n  accumGauss(5.0, tot, weight);\n\n  // Compute blurred values.\n  mediump vec4 rgba = tot / weight;\n\n  // Return the values. Note that each channel will contain\n  // the result of a different blur operation, one for each\n  // of the four chosen sigma.\n  gl_FragColor = vec4(rgba);\n}\n","highlight.frag":"// Takes as input the highlight map, estimated the signed distance field,\n// and shades the fragments according to their estimated distance from the\n// edge of the highlighted feature.\n\n// A shade texture is used to turn distance values into colors; the shade\n// texture is basically a color gradient and is recomputed on the host\n// every time that the user alters the highlight options.\n\n// Interpolated texture coordinates.\nvarying mediump vec2 v_texcoord;\n\n// The highlight map. Each channel is a blurred\n// version of the alpha channel of the highlight mask.\n//  - Channel 0 (red) corresponds to a gaussian blur with sigma = u_sigmas[0];\n//  - Channel 1 (green) corresponds to a gaussian blur with sigma = u_sigmas[1];\n//  - Channel 2 (blue) corresponds to a gaussian blur with sigma = u_sigmas[2];\n//  - Channel 3 (alpha) corresponds to a gaussian blur with sigma = u_sigmas[3];\n// As of today, only channel 3 is used for distance estimation.\n// But the availability of different amounts of blur leaves the\n// door open to multi-scale approaches.\nuniform sampler2D u_texture;\n\n// The highlight map was obtained by blurring the alpha channel of the highlight\n// mask accroding to these 4 values of the gaussian's sigma parameter.\nuniform mediump vec4 u_sigmas;\n\n// A 1-D texture used to shade the highlight.\nuniform sampler2D u_shade;\n\n// The 1-D shade texture is spreaded between u_minMaxDistance[0] and u_minMaxDistance[1].\nuniform mediump vec2 u_minMaxDistance;\n\n// Signed distance estimation.\nmediump float estimateDistance() {\n  // Use the largest sigma and the corresponding distance value stored in the\n  // last channel of the highlight map.\n  mediump float sigma = u_sigmas[3];\n  mediump float y = texture2D(u_texture, v_texcoord)[3];\n\n  // Estimates the distance by linearization and local inversion around\n  // the inflection point. The inflection point is in x = 0.\n  const mediump float y0 = 0.5;                           // Value of the convolution at the inflection point.\n  mediump float m0 = 1.0 / (sqrt(2.0 * 3.1415) * sigma);  // Slope of the convolution at the inflection point.\n  mediump float d = (y - y0) / m0;                        // Inversion of a local linearization.\n\n  // Return the estimated distance.\n  return d;\n}\n\n// Shading based on estimated distance.\nmediump vec4 shade(mediump float d) {\n  // Maps the sampled distance from the [A, D] range (see HighlightRenderer::setHighlightOptions) to [0, 1].\n  mediump float mappedDistance = (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x);\n\n  // Force to [0, 1]; it should not be necessary because the shade texture uses the CLAMP address mode, so\n  // this should happen anyway internally to the sampler, but in practice it is needed to avoid weird\n  // banding artifacts.\n  // We don't really know if we need this or not.\n  mappedDistance = clamp(mappedDistance, 0.0, 1.0);\n\n  // Sample the 1-D shade texture on its center line (i.e. on t=0.5).\n  return texture2D(u_shade, vec2(mappedDistance, 0.5));\n}\n\nvoid main(void) {\n  // Estimate the distance.\n  mediump float d = estimateDistance();\n\n  // Shade the distance.\n  gl_FragColor = shade(d);\n}\n","textured.vert":"// Identity vertex shader that outputs an untransformed 2-D vertex\n// and passes its texture coordinates unchanged to the interpolator.\n\n// Vertex position.\nattribute mediump vec2 a_position;\n\n// Texture coordinates.\nattribute mediump vec2 a_texcoord;\n\n// Texture coordinates to be interpolated.\nvarying mediump vec2 v_texcoord;\n\nvoid main(void) {\n  // Pass the position unchanged.\n  gl_Position = vec4(a_position, 0.0, 1.0);\n\n  // Pass the texture coordinates unchanged.\n  v_texcoord = a_texcoord;\n}\n"},materials:{fill:{"fill.frag":"precision lowp float;\n\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\n\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_tileTextureCoord;\n#endif // PATTERN\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\nvarying lowp vec4 v_color;\nvarying lowp float v_opacity;\n\nvoid main()\n{\n#ifdef PATTERN\n  // normalize the calculated texture coordinate such that it fits in the range of 0 to 1.\n  mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0);\n  // interpolate the image coordinate between the top-left and the bottom right to get the actual position to sample.\n  // after normalizing the position, we get a value ranging between 0 and 1 which refers to the entire texture, however\n  // we need to only sample from area that has our sprite in the mosaic.\n  mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\n  // sample the sprite mosaic\n  lowp vec4 color = texture2D(u_texture, samplePos);\n  gl_FragColor = v_opacity * v_color * color;\n#else\n  gl_FragColor = v_opacity * v_color;\n#endif // PATTERN\n\n#ifdef HIGHLIGHT\n  gl_FragColor.a = step(1.0 / 255.0, gl_FragColor.a);\n#endif // HIGHLIGHT\n\n#ifdef ID\n  //if (gl_FragColor.a < 1.0 / 255.0) {\n  //  discard;\n  //}\n  gl_FragColor = v_id;\n#endif // ID\n}\n","fill.vert":"precision mediump float;\n\nattribute vec2 a_pos;\nattribute vec4 a_id; // since we need to render the Id as a color we need to break it into RGBA components. so just like a color, the Id is normalized.\nattribute vec4 a_color;\nattribute vec4 a_tlbr;\nattribute vec4 a_aux1;\nattribute vec2 a_aux2;\n\nattribute float  a_visible; // a one byte controlling the visibility of the vertex (a separate visibility buffer), values are 0 or 1 (visible)\n\n// T: TileCoords -> DisplayCoords\n// Premultiplies DisplayMat3 * ViewMat3 * ScreenMat3\nuniform highp mat3 u_dvsMat3;\n\nvarying lowp vec4 v_color;\nvarying lowp float v_opacity;\n\n// import the VV inputs and functions (they are #ifdefed, so if the proper #define is not set it will end-up being a no-op)\n#include <materials/fill/vvUniforms.glsl>\n#include <materials/fill/vvFunctions.glsl>\n\n#ifdef PATTERN\nuniform mediump float u_zoomFactor;\nuniform mediump vec2 u_mosaicSize;\n\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_tileTextureCoord;\n#endif // PATTERN\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\nconst float SIGNED_BYTE_TO_UNSIGNED = 128.0;\n\nvoid main()\n{\n#ifdef VV_OPACITY\n  v_opacity = getVVOpacity(a_vv.y);\n#else\n  v_opacity = 1.0;\n#endif\n\n#ifdef VV_COLOR\n  v_color = getVVColor(a_vv.x, a_color);\n#else\n  v_color = a_color;\n#endif // VV_COLOR\n\n#ifdef ID\n  v_id = a_id;\n#endif // ID\n\n#ifdef PATTERN\n  vec2 aux2 = (1.0 / SIGNED_BYTE_TO_UNSIGNED) * a_aux2;\n\n  // calculate the pattern matrix\n  mat3 patternMatrix = mat3(1.0, 0.0, 0.0,\n                            0.0, 1.0, 0.0,\n                            0.0, 0.0, 1.0);\n\n  patternMatrix[0][0] = 1.0 / (u_zoomFactor * a_aux1.x * aux2.x);\n  patternMatrix[1][1] = 1.0 / (u_zoomFactor * a_aux1.y * aux2.y);\n\n  vec2 symbolOffset = u_zoomFactor * (a_aux1.zw - vec2(SIGNED_BYTE_TO_UNSIGNED));\n\n  // calculate the texture coordinates of the current vertex. It will of course get interpolated.\n  // The pattern matrix is a 3x3 scale matrix which 'tiles' the texture inside the tile, translating from\n  // tile coordinates to texture coordinates.\n  v_tileTextureCoord = (patternMatrix * vec3(a_pos + symbolOffset, 1.0)).xy;\n  v_tlbr = vec4(a_tlbr.x / u_mosaicSize.x, a_tlbr.y / u_mosaicSize.y, a_tlbr.z / u_mosaicSize.x, a_tlbr.w / u_mosaicSize.y);\n#endif // PATTERN\n\n  float z = 2.0 * (1.0 - a_visible); // clip the vertex if the geometry isn't visible\n  vec3 v_pos = u_dvsMat3 * vec3(a_pos, 1.);\n\n  gl_Position = vec4(v_pos.xy, z, 1.0);\n}\n","vvFunctions.glsl":"const highp float nanValue = 1e-30;\n\nbool isNan(float val) {\n  return (val == nanValue);\n  //return !(val < 0.0 || -1.0 < (val - 1.0) || val == 0.0);\n}\n\n#ifdef VV_OPACITY\nconst int VV_OPACITY_N = 8;\n\nfloat getVVOpacity(float opacityValue) {\n  if (isNan(opacityValue)) {\n    return 1.0;\n  }\n\n  if (opacityValue <= u_vvOpacityValues[0]) {\n    return u_vvOpacities[0];\n  }\n\n  for (int i = 1; i < VV_OPACITY_N; ++i) {\n    if (u_vvOpacityValues[i] >= opacityValue) {\n      float f = (opacityValue - u_vvOpacityValues[i-1]) / (u_vvOpacityValues[i] - u_vvOpacityValues[i-1]);\n      return mix(u_vvOpacities[i-1], u_vvOpacities[i], f);\n    }\n  }\n\n  return u_vvOpacities[VV_OPACITY_N - 1];\n}\n#endif // VV_OPACITY\n\n#ifdef VV_COLOR\nconst int VV_COLOR_N = 8;\n\nvec4 getVVColor(float colorValue, vec4 fallback) {\n  if (isNan(colorValue)) {\n    return fallback;\n  }\n\n  if (colorValue <= u_vvColorValues[0]) {\n    return u_vvColors[0];\n  }\n\n  for (int i = 1; i < VV_COLOR_N; ++i) {\n    if (u_vvColorValues[i] >= colorValue) {\n      float f = (colorValue - u_vvColorValues[i-1]) / (u_vvColorValues[i] - u_vvColorValues[i-1]);\n      return mix(u_vvColors[i-1], u_vvColors[i], f);\n    }\n  }\n\n  return u_vvColors[VV_COLOR_N - 1];\n}\n#endif // VV_COLOR\n","vvUniforms.glsl":"#if defined(VV_COLOR)|| defined(VV_OPACITY)\nattribute highp vec4 a_vv;\n#endif // VV_COLOR || VV_OPACITY\n\n#ifdef VV_COLOR\nuniform highp float u_vvColorValues[8];\nuniform vec4 u_vvColors[8];\n#endif // VV_COLOR\n\n#ifdef VV_OPACITY\nuniform highp float u_vvOpacityValues[8];\nuniform float u_vvOpacities[8];\n#endif // VV_OPACITY\n"},icon:{"icon.frag":"precision mediump float;\n\nuniform lowp sampler2D u_texture;\n\nvarying lowp vec2 v_tex;\nvarying lowp float v_transparency;\nvarying mediump vec2 v_size;\nvarying lowp vec4 v_color;\n\n#ifdef SDF\nvarying lowp vec4 v_outlineColor;\nvarying mediump float v_outlineWidth;\n\n// we need the conversion function from RGBA to float\n#include <util/encoding.glsl>\n#endif // SDF\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\nconst float softEdgeRatio = 1.0; // use blur here if needed\n\nvoid main()\n{\n#ifdef SDF\n  lowp vec4 fillPixelColor = v_color;\n\n  // calculate the distance from the edge [-0.5, 0.5]\n  float d = 0.5 - rgba2float(texture2D(u_texture, v_tex));\n\n  // the soft edge ratio is about 1.5 pixels allocated for the soft edge.\n  float size = max(v_size.x, v_size.y);\n  float dist = d * size * softEdgeRatio;\n\n  // set the fragment's transparency according to the distance from the edge\n  fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0);\n\n  // count for the outline\n  // therefore tint the entire icon area.\n  if (v_outlineWidth > 0.25) {\n    lowp vec4 outlinePixelColor = v_outlineColor;\n\n    // outlines can't be larger than the size of the symbol\n    float clampedOutlineSize = min(v_outlineWidth, size);\n\n    outlinePixelColor *= clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0);\n\n    // finally combine the outline and the fill colors (outline draws on top of fill)\n    gl_FragColor = v_transparency * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor);\n  }\n  else {\n    gl_FragColor = v_transparency * fillPixelColor;\n  }\n#else // not an SDF\n   lowp vec4 texColor = texture2D(u_texture, v_tex);\n   gl_FragColor = v_transparency * texColor;\n#endif // SDF\n\n#ifdef HIGHLIGHT\n  gl_FragColor.a = step(1.0 / 255.0, gl_FragColor.a);\n#endif // HIGHLIGHT\n\n#ifdef ID\n  if (gl_FragColor.a < 1.0 / 255.0) {\n    discard;\n  }\n  gl_FragColor = v_id;\n#endif // ID\n}\n","icon.vert":"precision mediump float;\n\n//const float C_256_TO_RAD = 3.14159265359 / 128.0;\nconst float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst vec2 SIGNED_BYTE_TO_UNSIGNED = vec2(128.0);\n\n// per quad (instance) attributes (20 bytes ==> equivalent of 5 bytes per vertex)\nattribute vec2 a_pos;\nattribute vec4 a_vertexOffsetAndTex;\nattribute vec4 a_id; // since we need to render the Id as a color we need to break it into RGBA components. so just like a color, the Id is normalized.\nattribute vec4 a_color;\nattribute vec4 a_outlineColor;\nattribute vec4 a_sizeAndOutlineWidth;\n\nattribute float a_visible; // a one byte controlling the visibility of the vertex (a separate visibility buffer), values are 0 or 1 (visible)\n\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\n\n// the size of the mosaic given in pixels\nuniform vec2 u_mosaicSize;\n\n// the interpolated texture coordinate value to be used by the fragment shader in order to sample the sprite texture\nvarying mediump vec2 v_tex;\n// the calculated transparency to be applied by the fragment shader. It is incorporating both the fade as well as the\n// opacity of the layer given by the painter\nvarying lowp float v_transparency;\n// the of the icon given in pixels\nvarying mediump vec2 v_size;\n\n// icon color. If is a picture-marker it is used to tint the texture color\nvarying lowp vec4 v_color;\n\n#ifdef SDF\nvarying lowp vec4 v_outlineColor;\nvarying mediump float v_outlineWidth;\n#endif // SDF\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\n// import the VV inputs and functions (they are #ifdefed, so if the proper #define is not set it will end-up being a no-op)\n#include <materials/icon/vvUniforms.glsl>\n#include <materials/icon/vvFunctions.glsl>\n\nvoid main()\n{\n  vec2 a_offset = a_vertexOffsetAndTex.xy;\n  vec2 a_tex = a_vertexOffsetAndTex.zw + SIGNED_BYTE_TO_UNSIGNED; // offset to change from signed to unsigned byte\n  vec2 a_size = a_sizeAndOutlineWidth.xy;\n\n  // default values (we need them for the variations to come)\n  float a_angle = 0.0;\n  float delta_z = 2.0 * (1.0 - a_visible);\n  float depth = 0.0;\n  v_transparency = 1.0;\n\n#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\n  // vv size override the original symbol's size\n  float h = getVVMinMaxSize(a_vv.x, a_size.y);\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_SCALE_STOPS\n  float h = u_vvSizeScaleStopsValue;\n#endif // VV_SIZE_SCALE_STOPS\n\n#ifdef VV_SIZE_FIELD_STOPS\n  float h = getVVStopsSize(a_vv.x, a_size.y);\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\n  float h = getVVUnitValue(a_vv.x, a_size.y);\n#endif // VV_SIZE_UNIT_VALUE\n\n  // make sure to preserve the aspect ratio of the symbol\n  vec2 size = vec2(h * a_size.x / a_size.y, h);\n  vec3 offset = vec3(a_offset * size / a_size, 0.0);\n  v_size = size;\n#else\n  vec3 offset = vec3(a_offset, 0.0);\n  v_size = a_size;\n#endif // defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n#ifdef SDF\n  offset *= 2.0;\n#endif // SDF\n\n\n#ifdef VV_ROTATION\n  // If we have a rotation VV, we need to rotate our offset\n  offset = u_displayMat3 * getVVRotationMat3(a_vv.w) * offset;\n#else\n  offset = u_displayMat3 * offset;\n#endif // VV_ROTATION\n  vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + offset;\n\n  gl_Position = vec4(pos.xy, delta_z, 1.0);\n\n#ifdef VV_OPACITY\n  v_transparency = getVVOpacity(a_vv.z);\n#else\n  v_transparency = 1.0;\n#endif // VV_OPACITY\n\n#ifdef VV_COLOR\n  v_color = getVVColor(a_vv.y, a_color);\n#else\n  v_color = a_color;\n#endif // VV_COLOR\n\n  // output the texture coordinates and the transparency\n  v_tex = a_tex / u_mosaicSize;\n\n#ifdef SDF\n  v_outlineColor = a_outlineColor;\n  // YF: in practice v_size.x and v_size.y are identical since we're mostly dealing with sms\n  v_outlineWidth = min(a_sizeAndOutlineWidth.z, max(v_size.x - 0.99, 0.0));\n#endif // SDF\n\n#ifdef ID\n  v_id = a_id;\n#endif // ID\n}\n","vvFunctions.glsl":"const highp float nanValue = 1e-30;\n\nbool isNan(float val) {\n  return (val == nanValue);\n  //return !( val < 0.0 || 0.0 < val || val == 0.0 );\n}\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\nfloat getVVMinMaxSize(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  // we need to multiply by 8 in order to translate to tile coordinates\n  float interpolationRatio = (sizeValue  - u_vvSizeMinMaxValue.x) / (u_vvSizeMinMaxValue.y - u_vvSizeMinMaxValue.x);\n  interpolationRatio = clamp(interpolationRatio, 0.0, 1.0);\n  return u_vvSizeMinMaxValue.z + interpolationRatio * (u_vvSizeMinMaxValue.w - u_vvSizeMinMaxValue.z);\n}\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_FIELD_STOPS\nconst int VV_SIZE_N = 6;\nfloat getVVStopsSize(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  if (sizeValue <= u_vvSizeFieldStopsValues[0]) {\n    return u_vvSizeFieldStopsSizes[0];\n  }\n\n  for (int i = 1; i < VV_SIZE_N; ++i) {\n    if (u_vvSizeFieldStopsValues[i] >= sizeValue) {\n      float f = (sizeValue - u_vvSizeFieldStopsValues[i-1]) / (u_vvSizeFieldStopsValues[i] - u_vvSizeFieldStopsValues[i-1]);\n      return mix(u_vvSizeFieldStopsSizes[i-1], u_vvSizeFieldStopsSizes[i], f);\n    }\n  }\n\n  return u_vvSizeFieldStopsSizes[VV_SIZE_N - 1];\n}\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\nfloat getVVUnitValue(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  return u_vvSizeUnitValueWorldToPixelsRatio * sizeValue;\n}\n#endif // VV_SIZE_UNIT_VALUE\n\n#ifdef VV_OPACITY\nconst int VV_OPACITY_N = 8;\nfloat getVVOpacity(float opacityValue) {\n  if (isNan(opacityValue)) {\n    return 1.0;\n  }\n\n  if (opacityValue <= u_vvOpacityValues[0]) {\n    return u_vvOpacities[0];\n  }\n\n  for (int i = 1; i < VV_OPACITY_N; ++i) {\n    if (u_vvOpacityValues[i] >= opacityValue) {\n      float f = (opacityValue - u_vvOpacityValues[i-1]) / (u_vvOpacityValues[i] - u_vvOpacityValues[i-1]);\n      return mix(u_vvOpacities[i-1], u_vvOpacities[i], f);\n    }\n  }\n\n  return u_vvOpacities[VV_OPACITY_N - 1];\n}\n#endif // VV_OPACITY\n\n#ifdef VV_ROTATION\nmat4 getVVRotation(float rotationValue) {\n  // YF TODO: if the symbol has rotation we need to combine the symbo's rotation with the VV one\n  if (isNan(rotationValue)) {\n    return mat4(1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1);\n  }\n\n  float rotation = rotationValue;\n  if (u_vvRotationType == 1.0) {\n    rotation = 90.0 - rotation;\n  }\n\n  float angle = C_DEG_TO_RAD * rotation;\n\n  float sinA = sin(angle);\n  float cosA = cos(angle);\n\n  return mat4(cosA, sinA, 0, 0,\n              -sinA,  cosA, 0, 0,\n              0,     0, 1, 0,\n              0,     0, 0, 1);\n}\n\nmat3 getVVRotationMat3(float rotationValue) {\n  // YF TODO: if the symbol has rotation we need to combine the symbo's rotation with the VV one\n  if (isNan(rotationValue)) {\n    return mat3(1, 0, 0,\n                0, 1, 0,\n                0, 0, 1);\n  }\n\n  float rotation = rotationValue;\n  if (u_vvRotationType == 1.0) {\n    rotation = 90.0 - rotation;\n  }\n\n  float angle = C_DEG_TO_RAD * -rotation;\n\n  float sinA = sin(angle);\n  float cosA = cos(angle);\n\n  return mat3(cosA, -sinA, 0,\n             sinA, cosA, 0,\n              0,    0,    1);\n}\n#endif // VV_ROTATION\n\n#ifdef VV_COLOR\nconst int VV_COLOR_N = 8;\n\nvec4 getVVColor(float colorValue, vec4 fallback) {\n  if (isNan(colorValue)) {\n    return fallback;\n  }\n\n  if (colorValue <= u_vvColorValues[0]) {\n    return u_vvColors[0];\n  }\n\n  for (int i = 1; i < VV_COLOR_N; ++i) {\n    if (u_vvColorValues[i] >= colorValue) {\n      float f = (colorValue - u_vvColorValues[i-1]) / (u_vvColorValues[i] - u_vvColorValues[i-1]);\n      return mix(u_vvColors[i-1], u_vvColors[i], f);\n    }\n  }\n\n  return u_vvColors[VV_COLOR_N - 1];\n}\n#endif // VV_COLOR\n","vvUniforms.glsl":"#if defined(VV_COLOR) || defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE) || defined(VV_OPACITY) || defined(VV_ROTATION)\nattribute highp vec4 a_vv;\n#endif // VV_COLOR || VV_SIZE_MIN_MAX_VALUE || VV_SIZE_SCALE_STOPS || VV_SIZE_FIELD_STOPS || VV_SIZE_UNIT_VALUE || VV_OPACITY || VV_ROTATION\n\n#ifdef VV_COLOR\nuniform highp float u_vvColorValues[8];\nuniform vec4 u_vvColors[8];\n#endif // VV_COLOR\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\nuniform highp vec4 u_vvSizeMinMaxValue;\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_SCALE_STOPS\nuniform highp float u_vvSizeScaleStopsValue;\n#endif // VV_SIZE_SCALE_STOPS\n\n#ifdef VV_SIZE_FIELD_STOPS\nuniform highp float u_vvSizeFieldStopsValues[6];\nuniform float u_vvSizeFieldStopsSizes[6];\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\nuniform highp float u_vvSizeUnitValueWorldToPixelsRatio;\n#endif // VV_SIZE_UNIT_VALUE\n\n#ifdef VV_OPACITY\nuniform highp float u_vvOpacityValues[8];\nuniform float u_vvOpacities[8];\n#endif // VV_OPACITY\n\n#ifdef VV_ROTATION\nuniform lowp float u_vvRotationType;\n#endif // VV_ROTATION\n"},label:{"label.frag":"precision lowp float;\n\nuniform mediump sampler2D u_referenceTex;\nuniform mediump vec2 u_screenSize;\nuniform mediump float u_pixelRatio;\n\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying mediump vec2 v_tex;\n\n#ifdef ID\nvarying mediump float v_fadeStep;\n#else\nuniform lowp sampler2D u_texture;\nvarying mediump vec4 v_color;\n#endif // ID\n\nconst vec3 epsilon = vec3(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n\nvoid main()\n{\n  mediump vec2 refTextPos = gl_FragCoord.xy / (u_pixelRatio * u_screenSize.xy);\n  mediump vec4 referenceFragment = texture2D(u_referenceTex, refTextPos);\n#ifdef ID\n  mediump float alpha = clamp(referenceFragment.a + v_fadeStep, 0.0, 1.0);\n  // fill the whole quad\n  gl_FragColor = vec4(alpha);\n#else\n  // read the fade alpha\n  lowp float fadeAlpha = referenceFragment.a;\n\n  // read the distance from the SDF texture\n  lowp float dist = texture2D(u_texture, v_tex).a;\n\n  // the edge distance if a factor of the outline width\n  // We cap this to 0.25 to prevent this from becomming negative / running into the glyph boundaries\n  float glyphEdgeDistance = max(0.75 - v_edgeDistanceOffset, 0.25);\n\n  // use a smooth-step in order to calculate the geometry of the shape given by the distance field\n  lowp float sdfAlpha = smoothstep(glyphEdgeDistance - v_antialiasingWidth, glyphEdgeDistance + v_antialiasingWidth, dist);\n\n  gl_FragColor = fadeAlpha * sdfAlpha * v_color;\n#endif\n}\n","label.vert":"precision mediump float;\n\nattribute vec2 a_pos;                  // 2 * 2 (2 x signed 16)\nattribute vec4 a_color;                // 4 (4 x unsigned byte)\nattribute vec2 a_vertexOffset;         // 2 * 2 // (2 x signed 16) offset from the anchor point of the string\nattribute vec4 a_texAndSize;          // 4 (4 x unsigned byte) texture coordinatesm and font size. w is for the halo size\nattribute vec4 a_refSymbolAndPlacementOffset; // 4 (4 x unsigned byte) the offset of the reference symbol of the feature (x,y) and the placement offset (z, w) all given in pixels\nattribute float a_vvSize;\n\nattribute lowp float  a_visible; // a one byte controlling the visibility of the vertex (a separate visibility buffer), values are 0 or 1 (visible)\n\nattribute mediump vec2 a_visibilityRange; // 2 x unsigned byte;\n\n// T: TileCoords -> DisplayCoords\n// Premultiplies DisplayMat3 * ViewMat3 * ScreenMat3\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\n\n\nuniform float u_mapRotation;\nuniform float u_mapAligned;\n\nuniform vec2 u_mosaicSize;\nuniform float u_pixelRatio;\n\n// the curent zoom\nuniform mediump float u_zoomLevel; // the current zoom level X 10\n\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\n\n// the interpolated texture coordinate value to be used by the fragment shader in order to sample the sprite texture\nvarying mediump vec2 v_tex;\n\n#ifdef ID\nuniform mediump float u_fadeStep;\nvarying mediump float v_fadeStep;\n#else\nvarying mediump vec4 v_color;\n#endif // ID\n\n// the vertex offsets are given in integers, therefore in order to maintain a reasonable precission we multiply the values\n// by 16 and then at the shader devide by the same number\nconst float offsetPrecision = 1.0 / 8.0;\nconst float outlineScale = 1.0 / 5.0;\nconst float sdfFontSize = 24.0;\n\n// maximum SDF distance of 8 pixels represent the distance values that range from -2 inside the geometry to 6 on the outside.\n// 6 is actually the maximum distance outside the glyph, therefore it is the limitation of the halo which is 1/4 of the geometry size.\nconst float maxSdfDistance = 8.0;\n\nconst float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst float PLACEMENT_PADDING = 8.0;\n\n#include <materials/icon/vvUniforms.glsl>\n#include <materials/icon/vvFunctions.glsl>\n\nvoid main()\n{\n  float refSymbolSize = a_refSymbolAndPlacementOffset.y;\n    \n#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n  #ifdef VV_SIZE_MIN_MAX_VALUE\n    // vv size override the original symbol's size\n    float h = getVVMinMaxSize(a_vvSize, refSymbolSize);\n  #endif // VV_SIZE_MIN_MAX_VALUE\n\n  #ifdef VV_SIZE_SCALE_STOPS\n    float h = u_vvSizeScaleStopsValue;\n  #endif // VV_SIZE_SCALE_STOPS\n\n  #ifdef VV_SIZE_FIELD_STOPS\n    float h = getVVStopsSize(a_vvSize, refSymbolSize);\n  #endif // VV_SIZE_FIELD_STOPS\n\n  #ifdef VV_SIZE_UNIT_VALUE\n    float h = getVVUnitValue(a_vvSize, refSymbolSize);\n  #endif // VV_SIZE_UNIT_VALUE\n    // make sure to preserve the aspect ratio of the symbol\n    float halfSize = h / 2.0;\n#else\n    float halfSize = refSymbolSize / 2.0;\n#endif // defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n  // make sure to clip the vertices in case that given record is marked as invisible\n  float z = 2.0 * (1.0 - a_visible);\n  float glyphAngle = a_refSymbolAndPlacementOffset.x * 360.0 / 254.0;\n  float mapAngle = u_mapRotation * 360.0 / 254.0;\n  float diffAngle = min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle));\n  \n  // make sure range is inclusive\n  z += 2.0 * (1.0 - step(a_visibilityRange.x, u_zoomLevel));\n  z += 2.0 * (1.0 - step(u_zoomLevel, a_visibilityRange.y));\n  z += 2.0 * u_mapAligned * step(90.0, diffAngle); \n\n  // encoded as dir + 1.0\n  vec2 placementDir = a_refSymbolAndPlacementOffset.zw - 1.0; \n  \n  // we use the list significant bit of the position in order to store the indication\n  // whether the vertex is of a halow of a glyph\n  mediump float halo = mod(a_pos, 2.0).x;\n  vec3 pos = vec3(floor(a_pos * 0.5), 1.0);\n\n  float fontSize = a_texAndSize.z;\n  float fontScale = fontSize / sdfFontSize;\n\n  vec2 vertexOffset = offsetPrecision * a_vertexOffset;\n  vec2 placementOffset = placementDir * (halfSize + PLACEMENT_PADDING);\n  vec3 glyphOffset = u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0);\n  vec3 v_pos = u_dvsMat3 * pos + glyphOffset;\n\n  gl_Position = vec4(v_pos.xy, z, 1.0);\n\n  v_tex = a_texAndSize.xy / u_mosaicSize;\n  v_antialiasingWidth = 0.106 * sdfFontSize / fontSize / u_pixelRatio;\n  // if halo.x is zero (not a halo) v_edgeDistanceOffset will end up being zero as well.\n  v_edgeDistanceOffset = halo * outlineScale * a_texAndSize.w / fontScale / maxSdfDistance;\n\n#ifdef ID\n  v_fadeStep = u_fadeStep;\n#else\n  v_color = a_color;\n  // Enable this code to visualize hidden glyphs\n  // float a = 1.0;\n  // if (z != 0.0)  {\n  //   a = 0.645;\n  // }\n  // v_color = vec4(a_color.rgb, a);\n#endif // ID\n}\n"},line:{"constants.glsl":"const float thinLineHalfWidth = 1.0; // meaning that a 2 pixels line width is considered a thin line\nconst float thinLineWidthFactor = 1.1;\n","line.frag":"precision lowp float;\n\nuniform lowp float u_blur;\nuniform mediump float u_antialiasing;\n\nvarying mediump vec2 v_normal;\nvarying mediump float v_lineHalfWidth;\nvarying lowp vec4 v_color;\nvarying lowp float v_transparency;\n\n#if defined(PATTERN) || defined(SDF)\nuniform sampler2D u_texture;\nuniform mediump float u_zoomFactor;\n\nvarying mediump vec4 v_tlbr; // normalized pattern coordinates [0, 1]\nvarying mediump vec2 v_patternSize;\nvarying highp float v_accumulatedDistance;\n#endif // PATTERN SDF\n\n#ifdef SDF\nconst float sdfPatternHalfWidth = 15.5; // YF: assumed that the width will be set to 31\nconst float widthFactor = 2.0;\n\n// we need the conversion function from RGBA to float\n#include <util/encoding.glsl>\n#endif // SDF\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\n// include the thin line parameters (thinLineHalfWidth and thinLineWidthFactor)\n#include <materials/line/constants.glsl>\n\nvoid main()\n{\n  // for now assume that a thin line is a line which is under 2 pixels (1 pixels on either sides of the centerline)\n  mediump float thinLineFactor = max(thinLineWidthFactor * step(v_lineHalfWidth, thinLineHalfWidth), 1.0);\n\n  // dist represent the distance of the fragment from the line. 1.0 or -1.0 will be the values on the edge of the line,\n  // and any value in between will be inside the line (the sign represent the direction - right or left).\n  // since u_linewidth.s (half line width) is represented in pixels, dist is also given in pixels\n  mediump float fragDist = length(v_normal) * v_lineHalfWidth;\n\n  // calculate the alpha given the difference between the line-width and the distance of the fragment from the center-line.\n  // when it is a thin line then use a slightly shallower slope in order to add more feathering\n  lowp float alpha = clamp(thinLineFactor * (v_lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0);\n\n#if defined(SDF)\n  mediump float lineHalfWidth = widthFactor * v_lineHalfWidth;\n  mediump float lineWidthRatio = lineHalfWidth / sdfPatternHalfWidth;\n  mediump float relativeTexX = mod((u_zoomFactor * v_accumulatedDistance + v_normal.x * lineHalfWidth) / (lineWidthRatio * v_patternSize.x), 1.0);\n  mediump float relativeTexY = 0.5 + 0.5 * v_normal.y;\n\n  // claculate the actual texture coordinates by interpolating between the TL/BR pattern coordinates\n  mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\n\n  // calculate the distance from the edge [-0.5, 0.5]\n  mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5;\n\n  // the distance is a proportional to the line width\n  float dist = d * lineHalfWidth;\n\n  lowp vec4 fillPixelColor = v_transparency * alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color;\n  gl_FragColor = fillPixelColor;\n#elif defined(PATTERN)\n  // we need to calculate the relative portion of the line texture along the line given the accumulated distance along the line\n  // The computed value should is anumber btween 0 and 1 which will later be used to interpolate btween the BR and TL values\n  mediump float relativeTexX = mod((u_zoomFactor * v_accumulatedDistance + v_normal.x * v_lineHalfWidth) / v_patternSize.x, 1.0);\n\n  // in order to calculate the texture coordinates prependicular to the line (Y axis), we use the interpolated normal values\n  // which range from -1.0 to 1.0. On the line's centerline, the value of the interpolated normal is 0.0, however the relative\n  // texture value shpould be 0.5 (given that at the bottom of the line, the texture coordinate must be equal to 0.0)\n  // (TL) ---------------------------      --\x3e left edge of line. Interpolatedf normal is 1.0\n  //              | -> line-width / 2\n  //      - - - - - - - - - - - - - -\n  //              | -> line-width / 2\n  //      ---------------------------- (BR)--\x3e right edge of line. Interpolatedf normal is -1.0\n\n  mediump float relativeTexY = 0.5 + (v_normal.y * v_lineHalfWidth / v_patternSize.y);\n\n  // claculate the actual texture coordinates by interpolating between the TL/BR pattern coordinates\n  mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\n\n  // get the color from the texture\n  lowp vec4 color = texture2D(u_texture, texCoord);\n\n  gl_FragColor = v_transparency * alpha * v_color * color;\n#else // solid line (no texture, no pattern)\n  // output the fragment color\n  gl_FragColor = v_transparency * alpha * v_color;\n#endif // SDF\n\n#ifdef HIGHLIGHT\n  gl_FragColor.a = step(1.0 / 255.0, gl_FragColor.a);\n#endif // HIGHLIGHT\n\n#ifdef ID\n  if (gl_FragColor.a < 1.0 / 255.0) {\n    discard;\n  }\n  gl_FragColor = v_id;\n#endif // ID\n}\n","line.vert":"precision mediump float;\n\nattribute vec2 a_pos;\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute vec4 a_offsetAndNormal;\nattribute vec2 a_accumulatedDistanceAndHalfWidth;\nattribute vec4 a_tlbr;\nattribute vec4 a_segmentDirection;\n\nattribute float  a_visible; // a one byte controlling the visibility of the vertex (a separate visibility buffer), values are 0 or 1 (visible)\n\n// T: TileCoords -> DisplayCoords\n// Premultiplies DisplayMat3 * ViewMat3 * ScreenMat3\nuniform highp mat3 u_dvsMat3;\n// T: ScreenCoords -> DisplayCoords\n// Premultiplies DisplayMat3 * ViewMat3\nuniform highp mat3 u_dvMat3;\n\nuniform mediump float u_zoomFactor;\nuniform mediump float u_antialiasing;\n\n// the interpolated normal to the line. the information is packed into the two LSBs of the vertex coordinate\nvarying mediump vec2 v_normal;\nvarying mediump float v_lineHalfWidth;\nvarying lowp vec4 v_color;\nvarying lowp float v_transparency;\n\nconst float scale = 1.0 / 31.0;\n#ifdef SDF\nconst float widthFactor = 2.0;\n#else\nconst float widthFactor = 1.0;\n#endif\n\n\n#ifdef PATTERN\nuniform mediump vec2 u_mosaicSize;\n\nvarying mediump vec4 v_tlbr; // normalized pattern coordinates [0, 1]\nvarying mediump vec2 v_patternSize;\n#endif // PATTERN\n\n// we need to accumulated distance only if it is a pattern or an SDF line\n#if defined(PATTERN) || defined(SDF)\nvarying highp float v_accumulatedDistance;\n#endif // PATTERN SDF\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\n// import the VV inputs and functions (they are #ifdefed, so if the proper #define is not set it will end-up being a no-op)\n#include <materials/line/vvUniforms.glsl>\n#include <materials/line/vvFunctions.glsl>\n\n// include the thin line parameters (thinLineHalfWidth and thinLineWidthFactor)\n#include <materials/line/constants.glsl>\n\nvoid main()\n{\n// size VV block\n#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\n  mediump float lineHalfWidth = 0.5 * getVVMinMaxSize(a_vv.x, 2.0 * a_accumulatedDistanceAndHalfWidth.y * scale);\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_SCALE_STOPS\n  mediump float lineHalfWidth = 0.5 * u_vvSizeScaleStopsValue;\n#endif // VV_SIZE_SCALE_STOPS\n\n#ifdef VV_SIZE_FIELD_STOPS\n  mediump float lineHalfWidth = 0.5 * getVVStopsSize(a_vv.x, 2.0 * a_accumulatedDistanceAndHalfWidth.y * scale);\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\n  mediump float lineHalfWidth = 0.5 * getVVUnitValue(a_vv.x, 2.0 * a_accumulatedDistanceAndHalfWidth.y * scale);\n#endif // VV_SIZE_UNIT_VALUE\n\n#else // no VV\n  mediump float lineHalfWidth = a_accumulatedDistanceAndHalfWidth.y * scale;\n#endif // defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n#ifdef VV_OPACITY\nv_transparency = getVVOpacity(a_vv.z);\n#else\nv_transparency = 1.0;\n#endif // VV_OPACITY\n\n#ifdef VV_COLOR\nv_color = getVVColor(a_vv.y, a_color);\n#else\nv_color = a_color;\n#endif // VV_COLOR\n\n  // make sure to clip the vertices in case that the width of the line is 0 (or negative),\n  // or in case that the line is not visible\n  float z = 2.0 * (step(lineHalfWidth, 0.0) + (1.0 - a_visible));\n\n  // add an antialiasing distance. We use 0.2 rather than 0.5 in order to match the SVG renderer\n  // also limit the total line width to 1.3 pixels. Below this value lines don't look good compared\n  // to the SVG renderer\n  lineHalfWidth = max(lineHalfWidth, 0.45) + 0.2 * u_antialiasing;\n\n  // for now assume that a thin line is a line which is under 2 pixels (1 pixels on either sides\n  // of the centerline) in practice, a thin line is a line who's half width vary from 0.45px to\n  // the value of thinLineHalfWidth, as the value is claped in line 221 above\n  mediump float thinLineFactor = max(thinLineWidthFactor * step(lineHalfWidth, thinLineHalfWidth), 1.0);\n\n  v_lineHalfWidth = lineHalfWidth;\n\n  // calculate the relative distance from the centerline to the edge of the line. Since offset is\n  // given in integers (for the sake of using less attribute memory, we need to scale it back to\n  // the original range of ~ [0, 1]) in a case of a thin line we move each vertex twice as far\n  mediump vec2 dist = thinLineFactor * widthFactor * lineHalfWidth * a_offsetAndNormal.xy * scale;\n\n  vec3 offset = u_dvMat3 * vec3(dist, 0.0);\n  vec3 v_pos = u_dvsMat3 * vec3(a_pos.xy, 1.0) + offset;\n\n  gl_Position = vec4(v_pos.xy, z, 1.0);\n\n  v_normal = a_offsetAndNormal.zw * scale;\n\n#if defined(PATTERN) || defined(SDF)\n  v_accumulatedDistance = a_accumulatedDistanceAndHalfWidth.x + dot(scale * a_segmentDirection.xy, dist / u_zoomFactor);\n#endif // PATTERN || SDF\n\n#ifdef PATTERN\nv_tlbr = vec4(a_tlbr.x / u_mosaicSize.x, a_tlbr.y / u_mosaicSize.y, a_tlbr.z / u_mosaicSize.x, a_tlbr.w / u_mosaicSize.y);\nv_patternSize = vec2(a_tlbr.z - a_tlbr.x, a_tlbr.w - a_tlbr.y);\n#endif // PATTERN\n\n#ifdef ID\nv_id = a_id;\n#endif // ID\n}\n","vvFunctions.glsl":"const highp float nanValue = 1e-30;\n\nbool isNan(float val) {\n  return (val == nanValue);\n  //return !( val < 0.0 || 0.0 < val || val == 0.0 );\n}\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\nfloat getVVMinMaxSize(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  float f = (sizeValue - u_vvSizeMinMaxValue.x) / (u_vvSizeMinMaxValue.y - u_vvSizeMinMaxValue.x);\n  return clamp(mix(u_vvSizeMinMaxValue.z, u_vvSizeMinMaxValue.w, f), u_vvSizeMinMaxValue.z, u_vvSizeMinMaxValue.w);\n}\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_FIELD_STOPS\nconst int VV_SIZE_N = 6;\nfloat getVVStopsSize(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  if (sizeValue <= u_vvSizeFieldStopsValues[0]) {\n    return u_vvSizeFieldStopsSizes[0];\n  }\n\n  for (int i = 1; i < VV_SIZE_N; ++i) {\n    if (u_vvSizeFieldStopsValues[i] >= sizeValue) {\n      float f = (sizeValue - u_vvSizeFieldStopsValues[i-1]) / (u_vvSizeFieldStopsValues[i] - u_vvSizeFieldStopsValues[i-1]);\n      return mix(u_vvSizeFieldStopsSizes[i-1], u_vvSizeFieldStopsSizes[i], f);\n    }\n  }\n\n  return u_vvSizeFieldStopsSizes[VV_SIZE_N - 1];\n}\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\nfloat getVVUnitValue(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  return u_vvSizeUnitValueWorldToPixelsRatio * sizeValue;\n}\n#endif // VV_SIZE_UNIT_VALUE\n\n#ifdef VV_OPACITY\nconst int VV_OPACITY_N = 8;\nfloat getVVOpacity(float opacityValue) {\n  if (isNan(opacityValue)) {\n    return 1.0;\n  }\n\n  if (opacityValue <= u_vvOpacityValues[0]) {\n    return u_vvOpacities[0];\n  }\n\n  for (int i = 1; i < VV_OPACITY_N; ++i) {\n    if (u_vvOpacityValues[i] >= opacityValue) {\n      float f = (opacityValue - u_vvOpacityValues[i-1]) / (u_vvOpacityValues[i] - u_vvOpacityValues[i-1]);\n      return mix(u_vvOpacities[i-1], u_vvOpacities[i], f);\n    }\n  }\n\n  return u_vvOpacities[VV_OPACITY_N - 1];\n}\n#endif // VV_OPACITY\n\n#ifdef VV_COLOR\nconst int VV_COLOR_N = 8;\n\nvec4 getVVColor(float colorValue, vec4 fallback) {\n  if (isNan(colorValue)) {\n    return fallback;\n  }\n\n  if (colorValue <= u_vvColorValues[0]) {\n    return u_vvColors[0];\n  }\n\n  for (int i = 1; i < VV_COLOR_N; ++i) {\n    if (u_vvColorValues[i] >= colorValue) {\n      float f = (colorValue - u_vvColorValues[i-1]) / (u_vvColorValues[i] - u_vvColorValues[i-1]);\n      return mix(u_vvColors[i-1], u_vvColors[i], f);\n    }\n  }\n\n  return u_vvColors[VV_COLOR_N - 1];\n}\n#endif // VV_COLOR\n","vvUniforms.glsl":"#if defined(VV_COLOR) || defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE) || defined(VV_OPACITY)\nattribute highp vec3 a_vv;\n#endif // VV_COLOR || VV_SIZE_MIN_MAX_VALUE || VV_SIZE_SCALE_STOPS || VV_SIZE_FIELD_STOPS || VV_SIZE_UNIT_VALUE || VV_OPACITY\n\n#ifdef VV_COLOR\nuniform highp float u_vvColorValues[8];\nuniform vec4 u_vvColors[8];\n#endif // VV_COLOR\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\nuniform highp vec4 u_vvSizeMinMaxValue;\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_SCALE_STOPS\nuniform highp float u_vvSizeScaleStopsValue;\n#endif\n\n#ifdef VV_SIZE_FIELD_STOPS\nuniform highp float u_vvSizeFieldStopsValues[6];\nuniform float u_vvSizeFieldStopsSizes[6];\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\nuniform float u_vvSizeUnitValueWorldToPixelsRatio;\n#endif // VV_SIZE_UNIT_VALUE\n\n#ifdef VV_OPACITY\nuniform highp float u_vvOpacityValues[8];\nuniform float u_vvOpacities[8];\n#endif // VV_OPACITY\n"},text:{"text.frag":"precision lowp float;\n\nuniform lowp sampler2D u_texture;\n\nvarying mediump vec4 v_color;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying mediump vec2 v_tex;\nvarying lowp float v_transparency;\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\nvoid main()\n{\n  // read the distance from the SDF texture\n  lowp float dist = texture2D(u_texture, v_tex).a;\n\n  // the edge distance if a factor of the outline width\n  // We cap this to 0.25 to prevent this from becomming negative / running into the glyph boundaries\n  float glyphEdgeDistance = max(0.75 - v_edgeDistanceOffset, 0.25);\n  \n  // use a smooth-step in order to calculate the geometry of the shape given by the distance field\n  lowp float alpha = smoothstep(glyphEdgeDistance - v_antialiasingWidth, glyphEdgeDistance + v_antialiasingWidth, dist) * v_transparency;\n\n  gl_FragColor = alpha * v_color;\n\n#ifdef ID\n  if (gl_FragColor.a < 1.0 / 255.0) {\n    discard;\n  }\n  gl_FragColor = v_id;\n#endif // ID\n}\n","text.vert":"precision mediump float;\n\nconst float C_DEG_TO_RAD = 3.14159265359 / 180.0;\n\nattribute vec2 a_pos;           // 2 * 2 (2 x signed 16)\nattribute vec4 a_id;            // 4 (4 x unsigned byte)\nattribute vec4 a_color;         // 4 (4 x unsigned byte)\nattribute vec2 a_vertexOffset; // 2 * 2 // (2 x signed 16) offset from the anchor point of the string\nattribute vec4 a_texFontSize; // 4 (4 x unsigned byte) texture coordinatesm and font size\n\nattribute lowp float  a_visible; // a one byte controlling the visibility of the vertex (a separate visibility buffer), values are 0 or 1 (visible)\n\nuniform vec2 u_mosaicSize;\nuniform float u_pixelRatio;\n\n// T: TileCoords -> DisplayCoords\n// Premultiplies DisplayMat3 * ViewMat3 * ScreenMat3\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\n\nvarying mediump vec4 v_color;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\n\n// the interpolated texture coordinate value to be used by the fragment shader in order to sample the sprite texture\nvarying mediump vec2 v_tex;\n// the calculated transparency to be applied by the fragment shader. It is incorporating both the fade as well as the\n// opacity of the layer given by the painter\nvarying lowp float v_transparency;\n\n// the vertex offsets are given in integers, therefore in order to maintain a reasonable precission we multiply the values\n// by 16 and then at the shader devide by the same number\nconst float offsetPrecision = 1.0 / 8.0;\nconst float outlineScale = 1.0 / 5.0;\nconst float sdfFontSize = 24.0;\n\n// maximum SDF distance of 8 pixels represent the distance values that range from -2 inside the geometry to 6 on the outside.\n// 6 is actually the maximum distance outside the glyph, therefore it is the limitation of the halo which is 1/4 of the geometry size.\nconst float maxSdfDistance = 8.0;\n\n#ifdef ID\nvarying highp vec4 v_id;\n#endif // ID\n\n// import the VV inputs and functions (they are #ifdefed, so if the proper #define is not set it will end-up being a no-op)\n#include <materials/text/vvUniforms.glsl>\n#include <materials/text/vvFunctions.glsl>\n\nvoid main()\n{\n  // make sure to clip the vertices in case that given record is marked as invisible\n  float z = 2.0 * (1.0 - a_visible);\n\n  // we use the list significant bit of the position in order to store the indication whethe the vertex is of a halow of a glyph\n  mediump float halo = mod(a_pos, 2.0).x;\n\n  float fontSize = a_texFontSize.z;\n  float scale = 1.0;\n\n#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n  #ifdef VV_SIZE_MIN_MAX_VALUE\n    // vv size override the original symbol's size\n    vec2 size = vec2(getVVMinMaxSize(a_vv.x, a_texFontSize.z));\n  #endif // VV_SIZE_MIN_MAX_VALUE\n\n  #ifdef VV_SIZE_SCALE_STOPS\n    vec2 size = vec2(u_vvSizeScaleStopsValue);\n  #endif // VV_SIZE_SCALE_STOPS\n\n  #ifdef VV_SIZE_FIELD_STOPS\n    vec2 size = vec2(getVVStopsSize(a_vv.x, a_texFontSize.z));\n  #endif // VV_SIZE_FIELD_STOPS\n\n  #ifdef VV_SIZE_UNIT_VALUE\n    vec2 size = vec2(getVVUnitValue(a_vv.x, a_texFontSize.z));\n  #endif // VV_SIZE_UNIT_VALUE\n\n    scale = size.x / fontSize;\n    fontSize = size.x;\n\n#endif // defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n\n  float fontScale = fontSize / sdfFontSize;\n  vec3 pos = vec3(floor(a_pos * 0.5), 1.0);\n  vec3 offset = vec3(offsetPrecision * a_vertexOffset * scale, 0.0);\n\n#ifdef VV_ROTATION\n  vec3 glyphOffset = u_displayMat3 * getVVRotationMat3(a_vv.w) * offset;\n#else\n  vec3 glyphOffset = u_displayMat3 * offset;\n#endif // VV_ROTATION\n\n  vec3 v_pos = u_dvsMat3 * pos + glyphOffset;\n  gl_Position = vec4(v_pos.xy, z, 1.0);\n\n\n  v_tex = a_texFontSize.xy / u_mosaicSize;\n  v_antialiasingWidth = 0.105 * sdfFontSize / fontSize / u_pixelRatio;\n  // if halo.x is zero (not a halo) v_edgeDistanceOffset will end up being zero as well.\n  v_edgeDistanceOffset = halo * outlineScale * a_texFontSize.w / fontScale / maxSdfDistance;\n\n#ifdef VV_OPACITY\n  v_transparency = getVVOpacity(a_vv.z);\n#else\n  v_transparency = 1.0;\n#endif // VV_OPACITY\n\n#ifdef VV_COLOR\n  // we don't want to override the halo color\n  v_color = halo * a_color + (1.0 - halo) * getVVColor(a_vv.y, a_color);\n#else\n  v_color = a_color;\n#endif // VV_COLOR\n\n#ifdef ID\n  v_id = a_id;\n#endif // ID\n}\n","vvFunctions.glsl":"const highp float nanValue = 1e-30;\n\nbool isNan(float val) {\n  return (val == nanValue);\n  //return !( val < 0.0 || 0.0 < val || val == 0.0 );\n}\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\nfloat getVVMinMaxSize(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  // we need to multiply by 8 in order to translate to tile coordinates\n  float interpolationRatio = (sizeValue  - u_vvSizeMinMaxValue.x) / (u_vvSizeMinMaxValue.y - u_vvSizeMinMaxValue.x);\n  return clamp(u_vvSizeMinMaxValue.z + interpolationRatio * (u_vvSizeMinMaxValue.w - u_vvSizeMinMaxValue.z), u_vvSizeMinMaxValue.z, u_vvSizeMinMaxValue.w);\n}\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_FIELD_STOPS\nconst int VV_SIZE_N = 6;\nfloat getVVStopsSize(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  if (sizeValue <= u_vvSizeFieldStopsValues[0]) {\n    return u_vvSizeFieldStopsSizes[0];\n  }\n\n  for (int i = 1; i < VV_SIZE_N; ++i) {\n    if (u_vvSizeFieldStopsValues[i] >= sizeValue) {\n      float f = (sizeValue - u_vvSizeFieldStopsValues[i-1]) / (u_vvSizeFieldStopsValues[i] - u_vvSizeFieldStopsValues[i-1]);\n      return mix(u_vvSizeFieldStopsSizes[i-1], u_vvSizeFieldStopsSizes[i], f);\n    }\n  }\n\n  return u_vvSizeFieldStopsSizes[VV_SIZE_N - 1];\n}\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\nfloat getVVUnitValue(float sizeValue, float fallback) {\n  if (isNan(sizeValue)) {\n    return fallback;\n  }\n\n  return u_vvSizeUnitValueWorldToPixelsRatio * sizeValue;\n}\n#endif // VV_SIZE_UNIT_VALUE\n\n#ifdef VV_OPACITY\nconst int VV_OPACITY_N = 8;\nfloat getVVOpacity(float opacityValue) {\n  if (isNan(opacityValue)) {\n    return 1.0;\n  }\n\n  if (opacityValue <= u_vvOpacityValues[0]) {\n    return u_vvOpacities[0];\n  }\n\n  for (int i = 1; i < VV_OPACITY_N; ++i) {\n    if (u_vvOpacityValues[i] >= opacityValue) {\n      float f = (opacityValue - u_vvOpacityValues[i-1]) / (u_vvOpacityValues[i] - u_vvOpacityValues[i-1]);\n      return mix(u_vvOpacities[i-1], u_vvOpacities[i], f);\n    }\n  }\n\n  return u_vvOpacities[VV_OPACITY_N - 1];\n}\n#endif // VV_OPACITY\n\n#ifdef VV_ROTATION\nmat4 getVVRotation(float rotationValue) {\n  // YF TODO: if the symbol has rotation we need to combine the symbo's rotation with the VV one\n  if (isNan(rotationValue)) {\n    return mat4(1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1);\n  }\n\n  float rotation = rotationValue;\n  if (u_vvRotationType == 1.0) {\n    rotation = 90.0 - rotation;\n  }\n\n  float angle = C_DEG_TO_RAD * rotation;\n\n  float sinA = sin(angle);\n  float cosA = cos(angle);\n\n  return mat4(cosA, sinA, 0, 0,\n              -sinA,  cosA, 0, 0,\n              0,     0, 1, 0,\n              0,     0, 0, 1);\n}\n\nmat3 getVVRotationMat3(float rotationValue) {\n  // YF TODO: if the symbol has rotation we need to combine the symbo's rotation with the VV one\n  if (isNan(rotationValue)) {\n    return mat3(1, 0, 0,\n                0, 1, 0,\n                0, 0, 1);\n  }\n\n  float rotation = rotationValue;\n  if (u_vvRotationType == 1.0) {\n    rotation = 90.0 - rotation;\n  }\n\n  float angle = C_DEG_TO_RAD * -rotation;\n\n  float sinA = sin(angle);\n  float cosA = cos(angle);\n\n  return mat3(cosA, -sinA, 0,\n             sinA, cosA, 0,\n              0,    0,    1);\n}\n\n#endif // VV_ROTATION\n\n#ifdef VV_COLOR\nconst int VV_COLOR_N = 8;\n\nvec4 getVVColor(float colorValue, vec4 fallback) {\n  if (isNan(colorValue)) {\n    return fallback;\n  }\n\n  if (colorValue <= u_vvColorValues[0]) {\n    return u_vvColors[0];\n  }\n\n  for (int i = 1; i < VV_COLOR_N; ++i) {\n    if (u_vvColorValues[i] >= colorValue) {\n      float f = (colorValue - u_vvColorValues[i-1]) / (u_vvColorValues[i] - u_vvColorValues[i-1]);\n      return mix(u_vvColors[i-1], u_vvColors[i], f);\n    }\n  }\n\n  return u_vvColors[VV_COLOR_N - 1];\n}\n#endif // VV_COLOR\n","vvUniforms.glsl":"#if defined(VV_COLOR) || defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE) || defined(VV_OPACITY) || defined(VV_ROTATION)\nattribute highp vec4 a_vv;\n#endif // VV_COLOR || VV_SIZE_MIN_MAX_VALUE || VV_SIZE_SCALE_STOPS || VV_SIZE_FIELD_STOPS || VV_SIZE_UNIT_VALUE || VV_OPACITY || VV_ROTATION\n\n#ifdef VV_COLOR\nuniform highp float u_vvColorValues[8];\nuniform vec4 u_vvColors[8];\n#endif // VV_COLOR\n\n#ifdef VV_SIZE_MIN_MAX_VALUE\nuniform highp vec4 u_vvSizeMinMaxValue;\n#endif // VV_SIZE_MIN_MAX_VALUE\n\n#ifdef VV_SIZE_SCALE_STOPS\nuniform highp float u_vvSizeScaleStopsValue;\n#endif // VV_SIZE_SCALE_STOPS\n\n#ifdef VV_SIZE_FIELD_STOPS\nuniform highp float u_vvSizeFieldStopsValues[6];\nuniform float u_vvSizeFieldStopsSizes[6];\n#endif // VV_SIZE_FIELD_STOPS\n\n#ifdef VV_SIZE_UNIT_VALUE\nuniform float u_vvSizeUnitValueWorldToPixelsRatio;\n#endif // VV_SIZE_UNIT_VALUE\n\n#ifdef VV_OPACITY\nuniform highp float u_vvOpacityValues[8];\nuniform float u_vvOpacities[8];\n#endif // VV_OPACITY\n\n#ifdef VV_ROTATION\nuniform lowp float u_vvRotationType;\n#endif // VV_ROTATION\n"}},raster:{"solid.frag":"precision mediump float;\n\nvoid main(void) {\n  gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n","texture.frag":"precision mediump float;\n\n// Texture coordinates.\nvarying vec2 v_texcoord;\n\n// Texture sampler.\nuniform sampler2D u_texture;\n\n// Opacity.\nuniform float u_opacity;\n\nvoid main(void) {\n  vec4 color = texture2D(u_texture, v_texcoord);\n  color.a *= u_opacity;\n  gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n","transform.vert":'precision mediump float;\n\n// Vertex position. Assumed normalized in the [-1, 1] range.\nattribute vec2 a_position;\n\n// Texture coordinates. Assumed normalized in the [-1, 1] range.\nattribute vec2 a_texcoord;\n\n// Transform matrix.\nuniform mat4 u_transform;\n\n// Scales applied to position and texture coordinates to get the\n// "unnormalized" value.\nuniform float u_positionScale;\nuniform float u_texcoordScale;\n\n// Output texture coordinates, for interpolation.\nvarying vec2 v_texcoord;\n\nvoid main(void) {\n  gl_Position = u_transform * vec4(a_position * u_positionScale, 0.0, 1.0);\n  v_texcoord = a_texcoord * u_texcoordScale;\n}\n'},stencil:{"stencil.frag":"void main() {\n  gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n}\n","stencil.vert":"attribute vec2 a_pos;\n\nvoid main() {\n  gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n"},tileInfo:{"tileInfo.frag":"uniform mediump sampler2D u_texture;\nvarying mediump vec2 v_tex;\n\nvoid main(void) {\n  lowp vec4 color = texture2D(u_texture, v_tex);\n  gl_FragColor = 0.75 * color;\n}\n","tileInfo.vert":"attribute vec2 a_pos;\n\nuniform highp mat3 u_dvsMat3;\n\nuniform mediump float u_depth;\nuniform mediump float u_coord_ratio;\nuniform mediump vec2 u_delta; // in tile coordinates\nuniform mediump vec2 u_dimensions; // in tile coordinates\n\nvarying mediump vec2 v_tex;\n\nvoid main() {\n  mediump vec2 offset = u_coord_ratio * vec2(u_delta + a_pos * u_dimensions);\n  vec3 v_pos = u_dvsMat3 * vec3(offset, 1.0);\n  \n  gl_Position = vec4(v_pos.xy, 0.0, 1.0);\n\n  v_tex = a_pos;\n}\n"},util:{"encoding.glsl":"// Factors to convert rgba back to float\nconst vec4 rgba2float_factors = vec4(\n    255.0 / (256.0),\n    255.0 / (256.0 * 256.0),\n    255.0 / (256.0 * 256.0 * 256.0),\n    255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n  );\n\nfloat rgba2float(vec4 rgba) {\n  // Convert components from 0->1 back to 0->255 and then\n  // add the components together with their corresponding\n  // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n  return dot(rgba, rgba2float_factors);\n}\n"}}}.apply(null,r))||(e.exports=n)},1911:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1643),i(1640),i(1470)],void 0===(n=function(e,t,i,r,n){function o(e,t,i){n.packFloatRGBA(e,t,i)}Object.defineProperty(t,"__esModule",{value:!0}),t.packFloat=o;var s=function(){function e(){}return e.checkSDF=function(e){return!0},e.prototype._extractGeometry=function(e){if(!e)return null;var t=e.symbolLayers;if(!t||1!==t.length)return null;var r=t[0];if(!r)return null;var n=r.markerGraphics;if(!n||1!==n.length)return null;var o=n[0];if(!o)return null;var s=o.geometry;if(!s||!s.rings)return null;for(var a=[],l=0,u=s.rings;l<u.length;l++){for(var h=[],c=0,d=u[l];c<d.length;c++){var f=d[c];h.push(new i.Point(f[0],f[1]))}a.push(h)}return a},e.prototype._getEnvelope=function(e){for(var t=1/0,i=-1/0,n=1/0,o=-1/0,s=0,a=e;s<a.length;s++)for(var l=0,u=a[s];l<u.length;l++){var h=u[l];h.x<t&&(t=h.x),h.x>i&&(i=h.x),h.y<n&&(n=h.y),h.y>o&&(o=h.y)}return new r(t,n,i-t,o-n)},e.prototype.buildSDF=function(e){var t=this._extractGeometry(e);if(!t)return null;var i=this._getEnvelope(t);if(i.width<=0||i.height<=0)return null;for(var r=Math.floor(31.5),n=(128-2*(r+0+1))/Math.max(i.width,i.height),o=Math.round(i.width*n),s=Math.round(i.height*n),a=o+2*r,l=s+2*r,u=0,h=t;u<h.length;u++)for(var c=0,d=h[u];c<d.length;c++){var f=d[c];f.x-=i.x,f.y-=i.y,f.x*=n,f.y*=n,f.x+=r-.5,f.y+=r-.5}var p=this._dist_map(t,a,l,r);return this._sign_dist_map(t,a,l,r,p),[this._encodeDistMap(p,r),a,l,o,s,n]},e.prototype._dist_map=function(e,t,i,r){for(var n=t*i,o=new Float32Array(n),s=r*r+1,a=0;a<n;++a)o[a]=s;for(var l=0,u=e;l<u.length;l++){var h=u[l],c=h.length;for(a=1;a<c;++a){var d,f=h[a-1],p=h[a],_=void 0;d=f.x<p.x?(_=f.x,p.x):(_=p.x,f.x);var v,m=void 0;v=f.y<p.y?(m=f.y,p.y):(m=p.y,f.y);var g=Math.floor(_)-r,y=Math.floor(d)+r,x=Math.floor(m)-r,b=Math.floor(v)+r;g<0&&(g=0),t<y&&(y=t),x<0&&(x=0),i<b&&(b=i);for(var S=p.x-f.x,T=p.y-f.y,w=S*S+T*T,E=g;E<y;E++)for(var V=x;V<b;V++){var I,C=(E-f.x)*S+(V-f.y)*T,M=void 0;I=C<0?(M=f.x,f.y):w<C?(M=p.x,p.y):(C/=w,M=f.x+C*S,f.y+C*T);var O=(E-M)*(E-M)+(V-I)*(V-I),L=(i-V-1)*t+E;O<o[L]&&(o[L]=O)}}}for(a=0;a<n;++a)o[a]=Math.sqrt(o[a]);return o},e.prototype._sign_dist_map=function(e,t,i,r,n){for(var o=0,s=e;o<s.length;o++)for(var a=s[o],l=a.length,u=1;u<l;++u){var h,c=a[u-1],d=a[u],f=void 0;h=c.x<d.x?(f=c.x,d.x):(f=d.x,c.x);var p,_=void 0;p=c.y<d.y?(_=c.y,d.y):(_=d.y,c.y);var v=Math.floor(f),m=Math.floor(h)+1,g=Math.floor(_),y=Math.floor(p)+1;v<r&&(v=r),t-r<m&&(m=t-r),g<r&&(g=r),i-r<y&&(y=i-r);for(var x=g;x<y;++x)if(c.y>x!=d.y>x){for(var b=(i-x-1)*t,S=v;S<m;++S)S<(d.x-c.x)*(x-c.y)/(d.y-c.y)+c.x&&(n[b+S]=-n[b+S]);for(S=r;S<v;++S)n[b+S]=-n[b+S]}}},e.prototype._encodeDistMap=function(e,t){for(var i=2*t,r=e.length,n=new Uint8Array(4*r),s=0;s<r;++s)o(.5-e[s]/i,n,4*s);return n},e}();t.SDFHelper=s}.apply(null,r))||(e.exports=n)},1913:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){}}.apply(null,r))||(e.exports=n)},1915:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(7),i(1490),i(1744)],void 0===(n=function(e,t,i,r,n,o){Object.defineProperty(t,"__esModule",{value:!0});var s=r.getLogger("esri/views/2d/engine/webgl/util/Matcher"),a=function(){function e(){this._defaultResult=null}return e.fromSimpleRenderer=function(t,i,r){var n=t.getSymbols(),s=t.visualVariables,a=o.getVVFlags(s),l=new e;if(n.length){var u=r.createTemplateGroup(n[0],null,i,a);l.setDefault(u)}return l},e.prototype.size=function(){return 1},e.prototype.getDefault=function(){return this._defaultResult},e.prototype.setDefault=function(e){this._defaultResult=e},e.prototype.match=function(e,t,i){return this.getDefault()},e}(),l=function(e){function t(t,i,r,o,s){var a=e.call(this)||this;return a._intervals=[],a._isMaxInclusive=i,o?a._getValue=n.createArcadeFunction(o,s):t&&t.length?a._getValue="function"==typeof t?(a._field=null,t):(a._field=t,a._normalizationInfo=r,a._getValueFromField.bind(a)):a._field=null,a}return i(t,e),t.fromCBRenderer=function(e,i,r,n){for(var s=e.isMaxInclusive,a=e.visualVariables,l=e.valueExpression,u=e.normalizationField,h=e.normalizationTotal,c=e.normalizationType,d=o.getVVFlags(a),f=new t(e.field,s,{normalizationField:u,normalizationTotal:h,normalizationType:c},l,n),p=e.backgroundFillSymbol,_=0,v=e.classBreakInfos;_<v.length;_++){var m=v[_],g=m.symbol,y=r.createTemplateGroup(g,p,i,d),x={min:m.minValue,max:m.maxValue};f.add(x,y)}var b=e.defaultSymbol;if(b){var S=r.createTemplateGroup(b,p,i,d);f.setDefault(S)}return f},t.prototype.add=function(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort(function(e,t){return e.interval.min-t.interval.min})},t.prototype.size=function(){return e.prototype.size.call(this)+this._intervals.length},t.prototype.match=function(e,t,i){if(!this._getValue)return this.getDefault();var r=this._getValue(e,t,i);if(!r&&(null==r||isNaN(r)))return this.getDefault();for(var n=0;n<this._intervals.length;n++){var o=this._intervals[n],s=o.interval,a=o.result,l=r>=s.min,u=this._isMaxInclusive?r<=s.max:r<s.max;if(l&&u)return a}return this.getDefault()},t.prototype._needsNormalization=function(){var e=this._normalizationInfo;return e&&(e.normalizationField||e.normalizationTotal||e.normalizationType)},t.prototype._getValueFromField=function(e){var t=e.attributes[this._field];if(!this._needsNormalization())return t;var i=this._normalizationInfo,r=i.normalizationField,n=i.normalizationTotal,o=i.normalizationType,a=!!r&&e.attributes[r];if(o)switch(o){case"field":return a?t/a:void 0;case"log":return Math.log(t)*Math.LOG10E;case"percent-of-total":return t/n*100;default:return void s.error("Found unknown normalization type: "+o)}else s.error("Normalization is required, but no type was set!")},t}(t.default=a);t.IntervalMatcher=l;var u=function(e){function t(t,i,r,o){var s=e.call(this)||this;return s._resultsMap=new Map,r?s._getValue=n.createArcadeFunction(r,o):t&&t.length?"function"==typeof t[0]?(s._fields=null,s._getValue=t[0]):(s._fields=t,s._seperator=i||"",s._getValue=s._getValueFromFields.bind(s)):s._fields=null,s}return i(t,e),t.fromUVRenderer=function(e,i,r,n){var s=e.uniqueValueInfos,a=e.visualVariables,l=o.getVVFlags(a),u=e.fieldDelimiter,h=e.valueExpression,c=[e.field];e.field2&&c.push(e.field2),e.field3&&c.push(e.field3);for(var d=e.backgroundFillSymbol,f=new t(c,u,h,n),p=0,_=s;p<_.length;p++){var v=_[p],m=r.createTemplateGroup(v.symbol,d,i,l);f.add(v.value,m)}if(e.defaultSymbol){var g=r.createTemplateGroup(e.defaultSymbol,d,i,l);f.setDefault(g)}return f},t.prototype.add=function(e,t){this._resultsMap.set(e.toString(),t)},t.prototype.size=function(){return e.prototype.size.call(this)+this._resultsMap.size},t.prototype.match=function(e,t,i){if(!this._getValue)return this.getDefault();var r=this._getValue(e,t,i);if(!r&&null==r)return this.getDefault();var n=r.toString();return this._resultsMap.has(n)?this._resultsMap.get(n):this.getDefault()},t.prototype._getValueFromFields=function(e){for(var t=[],i=0,r=this._fields;i<r.length;i++){var n=r[i],o=e.attributes[n];t.push(o)}return t.join(this._seperator)},t}(a);t.MapMatcher=u}.apply(null,r))||(e.exports=n)},1916:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1639),i(1737)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,i){this.displayObjects=e,this.vertexVectorsMap=t,this._materials=i}return Object.defineProperty(e.prototype,"materials",{get:function(){return this._materials},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertexBuffersMap",{get:function(){if(!this._vertexBuffersMap){this._vertexBuffersMap={};for(var e=0;e<this.vertexVectorsMap.length;e++)this._vertexBuffersMap[e]=this.vertexVectorsMap[e].intoBuffers();this.vertexVectorsMap=null}return this._vertexBuffersMap},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return this.vertexVectorsMap[e]},e.prototype.pushDisplayObject=function(e){this.displayObjects.push(e)},e.prototype.encode=function(e,t){var n=i.serializeList(new r.default(Uint32Array,this._guessSize()),this.displayObjects).buffer(),o=this._materials.serialize(new r.default(Uint32Array)).buffer(),s={};t.push(n),t.push(o);for(var a=0;a<this.vertexVectorsMap.length;a++){var l=this.vertexVectorsMap[a];s[a]={},l.transfer(s[a],t)}e.displayObjects=n,e.materialStore=o,e.vertexBuffersMap=s,this.destroy()},e.prototype.destroy=function(){this.vertexVectorsMap=null,this.displayObjects=null},e.prototype._guessSize=function(){for(var e=this.displayObjects,t=Math.min(e.length,4),i=0,r=0;r<t;r++)i=Math.max(i,e[r].displayRecords.length);return 2*(12*e.length+e.length*i*40)},e}();t.default=n}.apply(null,r))||(e.exports=n)},1917:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1490),i(1778),i(1737)],void 0===(n=function(e,t,i,r,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this.data=e,this.stride=t,this.vertexCount=0}return e.prototype.transfer=function(e,t){var i=this.data.buffer();e.vertexCount=this.vertexCount,e.data=i,e.stride=this.stride,t.push(i)},e}();t.default=o;var s=function(){function e(e,t,r){this.geometryType=e,this.indexVector=new n.default(Uint32Array,r),this.namedVectors={};var s=i.getStrides(e,t);for(var a in s){var l=s[a],u=void 0;switch(l%4){case 0:case 2:u=new n.default(Uint32Array,l/4*r);break;case 1:case 3:u=new n.default(Uint8Array,l*r)}this.namedVectors[a]=new o(u,l)}}return e.prototype.get=function(e){return this.namedVectors[e].data},e.prototype.transfer=function(e,t){var i=this.indexVector.buffer(),r={};for(var n in t.push(i),this.namedVectors){var o=this.namedVectors[n];r[n]={},o.transfer(r[n],t)}e.geometryType=this.geometryType,e.indexBuffer=i,e.namedBuffers=r,this.destroy()},e.prototype.intoBuffers=function(){var e=r.VertexBuffers.fromVertexVectors(this);return this.destroy(),e},e.prototype.destroy=function(){this.indexVector=null,this.namedVectors=null},e}();t.VertexVectors=s}.apply(null,r))||(e.exports=n)},1918:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(9),i(7),i(1493),i(1490),i(1779)],void 0===(n=function(e,t,i,r,n,o,s){Object.defineProperty(t,"__esModule",{value:!0});var a,l,u=r.getLogger("esri.views.2d.engine.webgl.mesh.VVFactory");(l=a=t.VVError||(t.VVError={}))[l.NONE=0]="NONE",l[l.MISSING_DATA=1]="MISSING_DATA";var h=function(){function e(){this._vvMap=new Map}return e.prototype.set=function(e,t){this._vvMap.set(e,t)},e.prototype.getValue=function(e,t,i,r){return this._vvMap.has(e)?this._vvMap.get(e)(t,i,r):0},e}(),c=function(){function e(e,t){this._createVVFunctionMap(e,t)}return e.prototype.computeVV=function(e,t,i,r){if(!this._vvMap)return a.NONE;var o=this._vvMap.getValue(n.VVType.SIZE,t,i,r),s=this._vvMap.getValue(n.VVType.COLOR,t,i,r),l=this._vvMap.getValue(n.VVType.OPACITY,t,i,r),u=this._vvMap.getValue(n.VVType.ROTATION,t,i,r),h=1e-30;return e[n.VVType.SIZE]=this._isErrorVV(o)?h:o,e[n.VVType.COLOR]=this._isErrorVV(s)?h:s,e[n.VVType.OPACITY]=this._isErrorVV(l)?h:l,e[n.VVType.ROTATION]=this._isErrorVV(u)?h:u,a.NONE},e.prototype._isErrorVV=function(e){return null===e||isNaN(e)||e===1/0},e.prototype._createVVFunctionMap=function(e,t){if(e&&e.length)for(var i=0,r=e;i<r.length;i++){var n=r[i],s=o.getVVType(n.type),a=this._createGetValueFunction(n,t);a&&(this._vvMap||(this._vvMap=new h),this._vvMap.set(s,a))}},e.prototype._createGetValueFunction=function(e,t){if(o.getVVType(e.type)!==n.VVType.SIZE)return this._createNormalizedFunction(e,t);var i=e,r=s.getTypeOfSizeVisualVariable(i);if(r===n.WGLVVFlag.SIZE_SCALE_STOPS)return null;var a=r===n.WGLVVFlag.SIZE_UNIT_VALUE&&function(e){return s.getVisualVariableSizeValueRepresentationRatio(e,i.valueRepresentation)};return this._createNormalizedFunction(e,t,a)},e.prototype._createNormalizedFunction=function(e,t,r){var n=e.field;if(n){if("string"!=typeof n)return"function"==typeof n?(u.error(new i("mapview-rendering:unsupported-feature","Function field types are not currently supported. Please use a valueExpression instead")),function(e){}):(u.error(new i("mapview-rendering:invalid-type","The field for a vv must be a string or a number, but got "+typeof n)),function(e){});var s=e.normalizationField;return s?function(e){if(e.attributes[n]&&e.attributes[s]){var t=e.attributes[n]/e.attributes[s];return r?r(t):t}}:r?function(e){return r(e.attributes[n])}:function(e){return e.attributes[n]}}return e.valueExpression?o.createArcadeFunction(e.valueExpression,t,r):(u.error("Unable to create a normalized function for visual variable: "+e),function(e){})},e}();t.default=c}.apply(null,r))||(e.exports=n)},1919:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(9),i(7),i(36),i(1517),i(1493),i(1554),i(1780),i(1490),i(1914),i(1920),i(1831),i(1832),i(1744),i(90),i(1523)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m){Object.defineProperty(t,"__esModule",{value:!0});var g=n.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),y=255,x=l.i8888to32(255,255,255,255),b=o.vec2f32.create(),S=o.mat2df32.create(),T={xOffset:0,yOffset:0,width:0,height:0},w=function(e,t){return void 0===t&&(t="mapview-labeling"),g.error(new r(t,e))},E=function(e){function t(t,i,r,n,o,s){var l=e.call(this,t,i,r)||this;l.geometryType=a.WGLGeometryType.LABEL,l._refTemplate=T;var u=function(e){switch(n){case"above-along":case"below-along":case"center-along":return 1;default:return 0}}(),h=function(e){switch(e){case"above-left":return[-1,-1];case"above-center":case"above-along":return[0,-1];case"above-right":return[1,-1];case"center-left":return[-1,0];case"center-center":case"center-along":return[0,0];case"center-right":return[1,0];case"below-left":return[-1,1];case"below-center":case"below-along":return[0,1];case"below-right":return[1,1];case"always-horizontal":return[0,0];default:w("Found invalid placement type "+e)}}(n),c=h[0],d=h[1];l._justify=(-1*c+1)/2,l._xAlignD=c,l._yAlignD=d,l._xPlacementD=c,l._yPlacementD=d,l._minZoom=o,l._maxZoom=s,l.vvFlags|=u*a.WGLVVFlag.ROTATION;var f=r.font.decoration.toLowerCase();return"underline"===f?l._decorationTop=6:"line-through"===f&&(l._decorationTop=-5),l}return i(t,e),t.fromLabelClass=function(e,i,r,n,o){var s,a,l,u,h,c,d=r.symbol,f=(a=o,l=!!(s=r).minScale&&a.scaleToZoom(s.minScale)||0,v.clamp(l,0,25.5)),p=(h=o,c=!!(u=r).maxScale&&h.scaleToZoom(u.maxScale)||255,v.clamp(c,0,25.5));return new t(e,i,d,r.labelPlacement,f,p)},t.prototype.bindTextInfo=function(e,t,i){var r=this._computeShaping(e,this._justify).getShaping(t,i);isNaN(this._decorationTop)||u.addDecoration(r,this._decorationTop),this._shapedGlyphs=r,this._shapedBox=u.getBox(r)},t.prototype._computeShaping=function(e,t){return new u([e],s.TEXT_MAX_WIDTH,s.TEXT_LINE_HEIGHT,s.TEXT_SPACING,[0,0],.5,.5,t)},Object.defineProperty(t.prototype,"bounds",{get:function(){return this._bounds},enumerable:!0,configurable:!0}),t.prototype.bindReferenceTemplate=function(e){this._refTemplate=e||T},t.prototype._placeGlyphs=function(e,t,i,r){var n=this._size,o=this._haloSize,s=this._shapedBox,a=this._shapedGlyphs,l=this._computeGlyphTransform(s);if("esriGeometryPolyline"===e)for(var u=0;u<i.length;u++){T=i[u];for(var h=this._shapedBox.width*this._scale,c=function(e){return!(e%2)},d=T.order,f=d-(d-1)/2-1,p=f-(f-1)/2-1,_=p-(p-1)/2-1,m=-1===d?0:c(d)?r-.1:c(f)?r-1.1:c(p)?r-2.1:c(_)?r-3.1:0,g=Math.max(r+v.log2((h+48)/T.pathLen),Math.max(m,this._minZoom)),y=0,x=a;y<x.length;y++)V=x[y],I=this._materialStore.createGlyphMaterial(V.glyphMosaicItem,this.geometryType,this.vvFlags),T.place(V,e,t,l,I,n,o,s,r,g,this._maxZoom)}else for(var b=0,S=i;b<S.length;b++)for(var T=S[b],w=0,E=a;w<E.length;w++){var V=E[w],I=this._materialStore.createGlyphMaterial(V.glyphMosaicItem,this.geometryType,this.vvFlags);T.place(V,e,t,l,I,n,o,s,r,this._minZoom,this._maxZoom)}},t.prototype.writeMesh=function(e,t,i,r,n,o,u,h,d){var f=this,p=this._computeAnchors(i,n);if(p.length&&this._shapedGlyphs.length){if(this._placeGlyphs(i,n,p,h),"esriGeometryPolyline"!==i){var v=p[0],m=this._shapedBox,g=this._computeGlyphTransform(m),y=this._createBounds(this._shapedBox,g),x=v.glyphs.get(0),b=x[0],S=b.anchorX,T=b.anchorY,w=Math.floor(10*b.minZoom),E=Math.floor(10*b.maxZoom),V=e.length;x.forEach(function(e){e.minZoom=25.5,e.maxZoom=25.5}),this._writeVertices(e,t,r,u,x,w,E);var I={from:V,count:e.length-V},C=new c.default(r,I,S,T,w),M=Math.max(this._refTemplate.height,this._refTemplate.width),O=_.getSizeFlagsMask(this.vvFlags,!1);return this.vvFlags&O?C.setVV(l.toFloat32(u[a.VVType.SIZE]),M,this._xPlacementD,this._yPlacementD):(C.offsetX=(M/2+s.COLLISION_PLACEMENT_PADDING)*this._xPlacementD,C.offsetY=(M/2+s.COLLISION_PLACEMENT_PADDING)*this._yPlacementD),C.bounds=y,d.push(C),void v.clear()}for(var L=function(i){var n=p[i],o=n.x,s=n.y,a=e.length,l=new c.default(r,{from:a,count:-1},o,s,25.5);n.glyphs.forEach(function(i){for(var a=0,h=i;a<h.length;a++){var c=h[a];if(c.minZoom=Math.max(n.minZoom,c.minZoom),c.bounds){var d=c.anchorX-o,p=c.anchorY-s;c.bounds.center[0]+=d,c.bounds.center[1]+=p,l.add(c.bounds)}}l.bounds&&f._writeHalos(e,t,r,u,i)}),n.glyphs.forEach(function(i){l.bounds&&f._writeText(e,t,r,u,i)}),l.range.count=e.length-a,l.bounds&&d.push(l),n.clear()},A=0;A<p.length;A++)L(A);this._computedGlyphs=[]}},t.prototype._outsideTile=function(e,t){return e<0||512<=e||t<0||512<=t},t.prototype._smoothVertices=function(e,t){if(!(t<=0)){var i=e.length;if(!(i<3)){var r=[],n=0;r.push(0);for(var o=1;o<i;o++)n+=f.dist(e[o],e[o-1]),r.push(n);t=Math.min(t,.2*n);var s=[];s.push(e[0][0]),s.push(e[0][1]);var a=e[i-1][0],l=e[i-1][1],u=f.sub([0,0],e[0],e[1]);for(f.normalize(u),e[0][0]+=t*u[0],e[0][1]+=t*u[1],f.sub(u,e[i-1],e[i-2]),f.normalize(u),e[i-1][0]+=t*u[0],e[i-1][1]+=t*u[1],o=1;o<i;o++)r[o]+=t;r[i-1]+=t;var h=.5*t;for(o=1;o<i-1;o++){for(var c=0,d=0,p=0,_=o-1;0<=_&&!(r[_+1]<r[o]-h);_--){var v=h+r[_+1]-r[o],m=r[_+1]-r[_],g=r[o]-r[_]<h?1:v/m;if(Math.abs(g)<1e-6)break;var y=g*v-.5*(w=g*g)*m,x=g*m/t,b=e[_+1],S=e[_][0]-b[0],T=e[_][1]-b[1];c+=x/y*(b[0]*g*v+.5*w*(v*S-m*b[0])-w*g*m*S/3),d+=x/y*(b[1]*g*v+.5*w*(v*T-m*b[1])-w*g*m*T/3),p+=x}for(_=o+1;_<i&&!(r[_-1]>r[o]+h)&&(v=h-r[_-1]+r[o],m=r[_]-r[_-1],g=r[_]-r[o]<h?1:v/m,!(Math.abs(g)<1e-6));_++){var w;y=g*v-.5*(w=g*g)*m,x=g*m/t,b=e[_-1],S=e[_][0]-b[0],T=e[_][1]-b[1],c+=x/y*(b[0]*g*v+.5*w*(v*S-m*b[0])-w*g*m*S/3),d+=x/y*(b[1]*g*v+.5*w*(v*T-m*b[1])-w*g*m*T/3),p+=x}s.push(c/p),s.push(d/p)}for(s.push(a),s.push(l),o=0,_=0;o<i;o++)e[o][0]=s[_++],e[o][1]=s[_++]}}},t.prototype._computeLineAnchors=function(e,t,i){for(var r=t.paths,n=this._scale*this._shapedBox.width,o=n/2+i,s=n/2+16,a=this._shapedBox.width*this._scale,l=0;l<r.length;l++){var u=r[l],h=[];h.push(u[0]);for(var c=1;c<u.length;c++){var f=h[c-1],p=f[0],_=f[1];p+=u[c][0],_+=u[c][1],h.push([p,_])}this._smoothVertices(h,a);var v=[];v.push(h[0]);for(var m=1;m<h.length;m++){var g=h[m-1],y=g[0],x=g[1],b=h[m],S=b[0],T=b[1],w=Math.round(S-y),E=Math.round(T-x);v.push([w,E])}u=r[l]=v;var V=this._getPathLength(u);if(!(V<2*s))for(var I=V/2,C=0,M=u[0][0],O=u[0][1],L=1;L<u.length;L++){w=u[L][0],E=u[L][1];var A=Math.sqrt(w*w+E*E);if(0<=(C+=A)-I){var R=C-I,P=A-R,F=P/A,D=M+w*F,z=O+E*F;if(!this._outsideTile(D,z)){var G=new d.default(D,z,F,l,L,M,O,A,V,-1);e.push(G)}var N=-1,B=0;for(B=P-o;0<=B;B-=o){var U=B/A,k=M+w*U,j=O+E*U;N++,this._outsideTile(k,j)||(G=new d.default(k,j,U,l,L,M,O,A,V,N),e.push(G))}C=B+o;for(var W=A-R,H=M,X=O,q=L-1;0!==q;q--){var Z=u[q][0],Y=u[q][1],Q=Math.sqrt(Z*Z+Y*Y);if(o<=C+Q){for(var K=o-C;K<Q;K+=o){var J=K/Q,$=H-Z*J,ee=X-Y*J;N++,K+W+s<I&&!this._outsideTile($,ee)&&(G=new d.default($,ee,1-J,l,q,H-Z,X-Y,Q,V,N),e.push(G))}C=Q-(K-o)}else C+=Q;W+=Q,H-=Z,X-=Y}var te=-1;for(B=P+o;B<=A;B+=o){var ie=B/A,re=M+w*ie,ne=O+E*ie;te++,this._outsideTile(re,ne)||(G=new d.default(re,ne,ie,l,L,M,O,A,V,te),e.push(G))}for(H=M+w,X=O+E,C=A-(B-o),W=R,q=L+1;q<u.length;q++){var oe=u[q][0],se=u[q][1],ae=Math.sqrt(oe*oe+se*se);if(o<=C+ae){for(var le=o-C;le<ae;le+=o){var ue=le/ae,he=H+oe*ue,ce=X+se*ue;te++,le+W+s<I&&!this._outsideTile(he,ce)&&(G=new d.default(he,ce,ue,l,q,H,X,ae,V,te),e.push(G))}C=ae-(le-o)}else C+=ae;W+=ae,H+=oe,X+=se}break}M+=w,O+=E}}return e},t.prototype._computeAnchors=function(e,t){var i=[];switch(e){case"esriGeometryPoint":var r=t.geometry,n=r.x,o=r.y,s=new d.default(n,o);return i.push(s),i;case"esriGeometryPolygon":if(t.centroid){var a=t.centroid;return n=a.x,o=a.y,s=new d.default(n,o),i.push(s),i}w("Non-centroid polygon anchor placement not supported");break;case"esriGeometryPolyline":return this._computeLineAnchors(i,t.geometry,376);case"esriGeometryMultipoint":default:return w("Unable to handle geometryType: "+e),i}},t.prototype._getPathLength=function(e){for(var t=0,i=1;i<e.length;i++){var r=e[i][0],n=e[i][1];t+=Math.sqrt(r*r+n*n)}return t},t.prototype._computeGlyphTransform=function(e){var t=this._scale,i=this._angle*m.C_DEG_TO_RAD,r=e.x,n=e.y,s=e.width/2,a=e.height/2,l=r+s,u=n+a,h=this._xAlignD*(s*t),c=this._yAlignD*(a*t),d=h+(this._xOffset+this._refTemplate.xOffset)+l,f=c-(this._yOffset+this._refTemplate.yOffset)-u,p=o.mat2d.identity(S);return o.mat2d.translate(p,p,o.vec2.set(b,d,f)),o.mat2d.scale(p,p,o.vec2.set(b,t,t)),o.mat2d.rotate(p,p,i),p},t.prototype._getOffset=function(e){var t=h.C_LABEL_VERTEX_DEF[0].strideInBytes/4;return e.length/t},t.prototype._writeVertex=function(e,t,i,r,n,o,s,u){var h=t.get("geometry"),c=t.get("visibility"),d=t.get("visibilityRange"),f=u&&u[a.VVType.SIZE]||1,p=Math.min(Math.floor(Math.max(this._refTemplate.width,this._refTemplate.height)),255),_=this._xPlacementD+1,v=this._yPlacementD+1;this._refSymbolAndPlacementOffset=l.i8888to32(o.angle,p,_,v),h.push(r),h.push(n),h.push(o.vertexOffsetUpperLeft),h.push(o.texFontSizeUpperLeft),h.push(this._refSymbolAndPlacementOffset),h.push(f),c.push(y),h.push(r),h.push(n),h.push(o.vertexOffsetUpperRight),h.push(o.texFontSizeUpperRight),h.push(this._refSymbolAndPlacementOffset),h.push(f),c.push(y),h.push(r),h.push(n),h.push(o.vertexOffsetLowerLeft),h.push(o.texFontSizeLowerLeft),h.push(this._refSymbolAndPlacementOffset),h.push(f),c.push(y),h.push(r),h.push(n),h.push(o.vertexOffsetLowerRight),h.push(o.texFontSizeLowerRight),h.push(this._refSymbolAndPlacementOffset),h.push(f),c.push(y),d.push(x),d.push(x),e.vertexCount+=4},t}(p.default);t.default=E}.apply(null,r))||(e.exports=n)},1920:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(9),i(7),i(36),i(1517),i(1830),i(1831),i(90)],void 0===(n=function(e,t,i,r,n,o,s,a,l){Object.defineProperty(t,"__esModule",{value:!0});var u=r.getLogger("esri.views.2d.engine.webgl.GlyphGroup"),h=function(){function e(e,t,i,r,n,o,s,a,l,u){void 0===i&&(i=0),void 0===r&&(r=-1),void 0===n&&(n=-1),void 0===o&&(o=-1),void 0===s&&(s=-1),void 0===a&&(a=-1),void 0===l&&(l=0),void 0===u&&(u=-1),this.x=e,this.y=t,this.t=i,this.i=r,this.j=n,this.segmentPosX=o,this.segmentPosY=s,this.segmentLen=a,this.pathLen=l,this.order=u,this._glyphs=new Map,this.minZoom=0}return Object.defineProperty(e.prototype,"glyphs",{get:function(){return this._glyphs},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t){var i=this._glyphs.get(t);i?i.push(e):this._glyphs.set(t,[e])},e.prototype.clear=function(){this._glyphs.clear()},e.prototype.place=function(e,t,r,n,o,a,l,h,c,d,f){var p,_,v=e.x,m=e.y,g=e.codePoint,y=e.glyphMosaicItem;switch(t){case"esriGeometryPoint":case"esriGeometryPolygon":var x=s.default.from(v,m,this.x,this.y,-1,d,f,y,g,o,n,a,l);return void this.add(x,0);case"esriGeometryPolyline":var b=r.geometry;return this._placeGlyphAlongLine(e,o,b,n,h,a,l,c,d,f,-1),void this._placeGlyphAlongLine(e,o,b,n,h,a,l,c,d,f,1);case"esriGeometryMultipoint":case"esriGeometryEnvelope":return p="Cannot place for unsupported geometryType: "+t,void 0===_&&(_="mapview-labeling"),void u.error(new i(_,p))}},e.prototype._findLabelTheta=function(e,t,i,r){var n=r*t,o=(0*n+r*-e*-1)/(1*i),s=Math.acos(o);return 0<n&&(s=2*Math.PI-s),s},e.prototype._placeGlyphAlongLine=function(e,t,i,r,u,h,c,d,f,p,_){var v=i.paths[this.i],m=v[this.j],g=m[0],y=m[1],x=e.x,b=e.y,S=e.glyphMosaicItem,T=e.codePoint,w=e.glyphMosaicItem.metrics,E=(e.x+w.left+w.width/2)*h/24,V=_*l.sign(E)||1,I=Math.abs(E),C=a.len(g,y),M=this._findLabelTheta(g,y,C,_),O=(V+1)/2,L=-V*(-1*O+this.t)*C,A=n.mat2d.rotate(n.mat2df32.create(),r,-M),R=p,P=48<u.height,F=0===L?R:Math.max(Math.max(d+l.log2(Math.abs(I/L)),0),f);P&&(F=f);var D=P||F<=d&&d<=R&&1===_,z=s.default.from(x,b,this.x,this.y,M,F,R,S,T,t,A,h,c,D);if(this.add(z,this.j),!P)for(var G=this.segmentPosX+O*g,N=this.segmentPosY+O*y,B=F,U=this.j+V;0<U&&U<v.length;U+=V){var k=G,j=N,W=v[U],H=W[0],X=W[1],q=a.len(H,X),Z=this._findLabelTheta(H,X,q,_),Y=n.mat2d.rotate(n.mat2df32.create(),r,-Z),Q=k+-V*H/q*L,K=j+-V*X/q*L,J=B-.1,$=0===(L+=q)?J:Math.max(Math.max(d+l.log2(Math.abs(I/L)),0),f),ee=$<=d&&d<=J&&1===_,te=s.default.from(x,b,Q,K,M,$,J,S,T,t,Y,h,c,ee);if(this.add(te,U),$<d-o.COLLISION_MAX_ZOOM_DELTA){this.minZoom=Math.max($,this.minZoom);break}G+=V*H,N+=V*X,B=$}},e}();t.default=h}.apply(null,r))||(e.exports=n)},1921:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(52)],void 0===(n=function(e,t,i){function r(e){return function(t,i){return null==t?i:null==i?t:e(t,i)}}function n(e,t,i,r){var n=i?3:2;if(!t.length||!t[0].length)return null;for(var o=t[0][0],s=o[0],u=o[1],h=t[0][0],c=h[0],d=h[1],f=void 0,p=void 0,_=void 0,v=void 0,m=0;m<t.length;m++)for(var g=t[m],y=0;y<g.length;y++){var x=g[y],b=x[0],S=x[1];if(s=a(s,b),u=a(u,S),c=l(c,b),d=l(d,S),i&&x.length>2){var T=x[2];f=a(f,T),p=l(p,T)}if(r&&x.length>n){var w=x[n];_=a(f,w),v=l(p,w)}}return i?r?(e[0]=s,e[1]=u,e[2]=f,e[3]=_,e[4]=c,e[5]=d,e[6]=p,e[7]=v,e):(e[0]=s,e[1]=u,e[2]=f,e[3]=c,e[4]=d,e[5]=p,e):r?(e[0]=s,e[1]=u,e[2]=_,e[3]=c,e[4]=d,e[5]=v,e):(e[0]=s,e[1]=u,e[2]=c,e[3]=d,e)}function o(e,t,i,r,n,o){var s=t.xmin,a=t.xmax,l=t.ymin,u=t.ymax,h=t.zmin,c=t.zmax,d=t.mmin,f=t.mmax;return n?(h=h||0,c=c||0,o?(d=d||0,f=f||0,e[0]=s,e[1]=l,e[2]=h,e[3]=d,e[4]=a,e[5]=u,e[6]=c,e[7]=f,e):(e[0]=s,e[1]=l,e[2]=h,e[3]=a,e[4]=u,e[5]=c,e)):o?(d=d||0,f=f||0,e[0]=s,e[1]=l,e[2]=d,e[3]=a,e[4]=u,e[5]=f,e):(e[0]=s,e[1]=l,e[2]=a,e[3]=u,e)}function s(e,t,i,r,n,o){var s=i?3:2,u=r&&o,h=i&&n;if(!t.length||!t[0].length)return null;for(var c=t[0],d=c[0],f=c[1],p=t[0],_=p[0],v=p[1],m=void 0,g=void 0,y=void 0,x=void 0,b=0;b<t.length;b++){var S=t[b],T=S[0],w=S[1];if(d=a(d,T),f=a(f,w),_=l(_,T),v=l(v,w),h&&S.length>2){var E=S[2];m=a(m,E),g=l(g,E)}if(u&&S.length>s){var V=S[s];y=a(m,V),x=l(g,V)}}return n?(m=m||0,g=g||0,o?(y=y||0,x=x||0,e[0]=d,e[1]=f,e[2]=m,e[3]=y,e[4]=_,e[5]=v,e[6]=g,e[7]=x,e):(e[0]=d,e[1]=f,e[2]=m,e[3]=_,e[4]=v,e[5]=g,e)):o?(y=y||0,x=x||0,e[0]=d,e[1]=f,e[2]=y,e[3]=_,e[4]=v,e[5]=x,e):(e[0]=d,e[1]=f,e[2]=_,e[3]=v,e)}Object.defineProperty(t,"__esModule",{value:!0});var a=r(Math.min),l=r(Math.max);t.getBoundsXY=function(e,t){return i.isPolyline(t)?n(e,t.paths,!1,!1):i.isPolygon(t)?n(e,t.rings,!1,!1):i.isMultipoint(t)?s(e,t.points,!1,!1,!1,!1):i.isExtent(t)?o(e,t):(i.isPoint(t)&&(e[0]=t.x,e[1]=t.y,e[2]=t.x,e[3]=t.y),e)},t.getRingsOrPathsBounds=n,t.getExtentBounds=o,t.getPointsBounds=s}.apply(null,r))||(e.exports=n)},1922:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(7),i(30),i(441),i(1661),i(1517),i(1493),i(1493),i(1554),i(1666),i(1649),i(1923),i(1745)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p){Object.defineProperty(t,"__esModule",{value:!0});var _=r.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLFillTemplate"),v=[],m=[],g=128,y=function(e){function t(t,i,r,n,o,s,u,h,d){var p=e.call(this)||this;return p.fillColor=n,p.tl=o,p.br=s,p.aux1=u,p.aux2=h,p.isBFS=d,p.geometryType=l.WGLGeometryType.FILL,p.useLibtess=!0,p._tesselator=new f.default,p.vvFlags=i,p._materialStore=t,p.materialId=p._materialStore.createSpriteMaterial(r,p.geometryType,i),p._tileClipper=new c.TileClipper(0,0,0,1,8),p._tileClipper.setExtent(a.TILE_SIZE),p}return i(t,e),t.fromSimpleFill=function(e,i,r,n,o,a){void 0===a&&(a=!1);var l=r.color,u=l&&"none"!==r.style&&s.premultiplyAlphaRGBA(l)||0;if(!n)return new t(e,i,null,u,0,0,0,0,a);var c=n.rect,d=n.width,f=n.height,p=c.x+1,_=c.y+1,v=c.x+1+d,m=c.y+1+f;return new t(e,i,n,u,h.i1616to32(p,_),h.i1616to32(v,m),h.i8888to32(h.nextHighestPowerOfTwo(v-p),h.nextHighestPowerOfTwo(m-_),0,0),h.i1616to32(g,g),a)},t.fromPictureFill=function(e,i,r,o,s,l){void 0===l&&(l=!1);var u=a.PICTURE_FILL_COLOR,c=o.rect,d=o.width,f=o.height,p=c.x+1,_=c.y+1,v=p+d,m=_+f,y=h.i1616to32(p,_),x=h.i1616to32(v,m),b=h.nextHighestPowerOfTwo(n.pt2px(r.width));255<b&&(b=255);var S=h.nextHighestPowerOfTwo(n.pt2px(r.height));255<S&&(S=255);var T=n.pt2px(r.xoffset)+g;255<T&&(T=255);var w=n.pt2px(-r.yoffset)+g;return 255<w&&(w=255),new t(e,i,o,u,y,x,h.i8888to32(b,S,T,w),h.i1616to32(g*r.xscale,g*r.yscale),l)},t.prototype.writeMesh=function(e,t,i,r,n,o,s){if(v.length=0,this.vvFlags&u.WGLVVFlag.COLOR||0!==this.fillColor){if("esriGeometryPolygon"===i){var a=n.geometry,l=this._isClippingRequired(a),h=l?this._clip(a,!this.useLibtess):a.rings;return this.useLibtess?this._writeMeshLibtess(e,t,i,r,h,l,o,s):this._writeMeshEarcut(e,t,i,r,h,l,o,s)}_.error("Unable to handle geometryType: "+i)}},t.prototype._isClippingRequired=function(e){for(var t=a.TILE_SIZE+8,i=0,r=e.rings;i<r.length;i++){var n=r[i],o=n.length;if(!(o<3)){var s=n[0][0],l=n[0][1];if(s<-8||t<s||l<-8||t<l)return!0;for(var u=1;u<o;++u)if(s+=n[u][0],l+=n[u][1],s<-8||t<s||l<-8||t<l)return!0}}return!1},t.prototype._clip=function(e,t){var i,r;this._tileClipper.reset(3);for(var n=0,o=e.rings;n<o.length;n++){var s=o[n],a=s.length;if(!(a<3)){i=s[0][0],r=s[0][1],this._tileClipper.moveTo(i,r);for(var l=1;l<a;++l)i+=s[l][0],r+=s[l][1],this._tileClipper.lineTo(i,r);this._tileClipper.close()}}return this._tileClipper.result(t)},t.prototype._writeMeshLibtess=function(e,t,i,r,n,o,s,a){if(n&&n.length){var l=this._materialStore.get(this.materialId),u=[],h=t.indexVector,c=t.get("geometry"),f=t.get("visibility"),p=new d(r,this.geometryType,this.materialId),_=this._getOffset(c,l),m=o;p.vertexFrom=_,p.indexFrom=h.length,this._tesselator.beginPolygon(v,u);for(var g=0,y=n;g<y.length;g++){var x=y[g];if(!(x.length<3)){this._tesselator.beginContour();var b=void 0,S=void 0;S=m?(b=x[0].x,x[0].y):(b=x[0][0],x[0][1]);var T=[b,S,0];this._tesselator.addVertex(T,T);for(var w=1;w<x.length-1;w++){m?(b=x[w].x,S=x[w].y):(b+=x[w][0],S+=x[w][1]);var E=[b,S,0];this._tesselator.addVertex(E,E)}this._tesselator.endContour()}}this._tesselator.endPolygon(),this._writeVerticesLibTess(p,c,f,r,v,l,a),this._writeIndicesLibTess(p,h,_,u),0<p.indexCount&&e.push(p)}},t.prototype._writeMeshEarcut=function(e,t,i,r,n,o,s,a){if(n&&n.length){var l=this._materialStore.get(this.materialId),u=t.indexVector,h=t.get("geometry"),c=t.get("visibility"),f=new d(r,this.geometryType,this.materialId),p=this._getOffset(h,l);f.vertexFrom=p,f.indexFrom=u.length,e.push(f);for(var _=0,g=0,y=o,x=0,b=n;x<b.length;x++){var S=b[x],T=g,w=void 0,E=void 0;E=y?(w=S[0].x,S[0].y):(w=S[0][0],S[0][1]),v[g++]=w,v[g++]=E;for(var V=0,I=1;I<S.length;++I){var C=void 0,M=void 0;if(y){var O=w,L=E;C=(w=S[I].x)-O,M=(E=S[I].y)-L}else w+=C=S[I][0],E+=M=S[I][1];V-=C*(E+E+M),v[g++]=w,v[g++]=E}0<V?(0<T-_&&(this._write(f,u,h,c,p,r,v,m,_,T,l,a),_=T),m.length=0):V<0&&0<T-_?m.push(.5*(T-_)):g=T}0<g-_&&this._write(f,u,h,c,p,r,v,m,_,g,l,a),v.length=m.length=0}},t.prototype._write=function(e,t,i,r,n,s,a,l,u,h,c,d){var f=o(a.slice(u,h),l,2);if(f.length){var p=this._getOffset(i,c);this._writeVertices(e,i,r,s,a,l,c,d),this._writeIndices(e,t,p,f)}},t.prototype._getOffset=function(e,t){var i=t.materialKeyInfo.hasVV()?9:7;return e.length/i},t.prototype._writeVertices=function(e,t,i,r,n,o,s,a){for(var l=0;l<n.length;l+=2){var u=h.i1616to32(n[l],n[l+1]);t.push(u),t.push(r),t.push(this.fillColor),t.push(this.tl),t.push(this.br),t.push(this.aux1),t.push(this.aux2),this._writeVV(t,a,s),i.push(255),e.vertexCount++}},t.prototype._writeIndices=function(e,t,i,r){for(var n=i,o=0;o<r.length;o+=3)t.push(n+r[o]),t.push(n+r[o+1]),t.push(n+r[o+2]),e.indexCount+=3},t.prototype._writeVerticesLibTess=function(e,t,i,r,n,o,s){for(var a=0;a<n.length;a+=2){var l=h.i1616to32(n[a],n[a+1]);t.push(l),t.push(r),t.push(this.fillColor),t.push(this.tl),t.push(this.br),t.push(this.aux1),t.push(this.aux2),this._writeVV(t,s,o),i.push(255),e.vertexCount++}},t.prototype._writeIndicesLibTess=function(e,t,i,r){for(var n=i,o=0;o<r.length;o++)t.push(n+r[o]),e.indexCount++},t.prototype._writeVV=function(e,t,i){i.materialKeyInfo.hasVV()&&(this.isBFS?(e.writeF32(1e-30),e.writeF32(1e-30)):(e.push(t[l.VVType.COLOR]),e.push(t[l.VVType.OPACITY])))},t}(p.default);t.default=y}.apply(null,r))||(e.exports=n)},1923:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(7),i(1924)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=i.getLogger("esri.views.2d.engine.webgl.mesh.templates.Tesselator"),o=function(){function e(){this._currentVertexIndex=0,this._indexCounter=0,this._triangleIndices=[-1,-1,-1],this.glu=new r.GluTesselator,this.glu.gluTessCallback(r.gluEnum.GLU_TESS_BEGIN,this._begincallback.bind(this)),this.glu.gluTessCallback(r.gluEnum.GLU_TESS_VERTEX_DATA,this._vertexCallback.bind(this)),this.glu.gluTessCallback(r.gluEnum.GLU_TESS_END,this._endcallback.bind(this)),this.glu.gluTessCallback(r.gluEnum.GLU_TESS_COMBINE,this._combinecallback.bind(this)),this.glu.gluTessCallback(r.gluEnum.GLU_TESS_ERROR,this._errorcallback.bind(this)),this.glu.gluTessCallback(r.gluEnum.GLU_TESS_EDGE_FLAG,this._edgeCallback.bind(this)),this.glu.gluTessProperty(r.gluEnum.GLU_TESS_WINDING_RULE,r.windingRule.GLU_TESS_WINDING_ODD)}return e.prototype.beginPolygon=function(e,t){this._triangleIndices[0]=-1,this._triangleIndices[1]=-1,this._triangleIndices[2]=-1,this._currentVertexIndex=0,this._indexCounter=0,this.glu.gluTessBeginPolygon(e),this._indices=t},e.prototype.endPolygon=function(){this.glu.gluTessEndPolygon()},e.prototype.beginContour=function(){this.glu.gluTessBeginContour()},e.prototype.endContour=function(){this.glu.gluTessEndContour()},e.prototype.addVertex=function(e,t){this.glu.gluTessVertex(e,t)},e.prototype._vertexCallback=function(e,t){if(t[t.length]=e[0],t[t.length]=e[1],this._triangleIndices[this._currentVertexIndex]=-1,2<=this._currentVertexIndex){for(var i=0;i<3;i++)-1===this._triangleIndices[i]&&(this._triangleIndices[i]=this._indexCounter++),this._indices[this._indices.length]=this._triangleIndices[i];this._currentVertexIndex=0}else this._currentVertexIndex++},e.prototype._begincallback=function(e){this._triangleIndices[0]=-1,this._triangleIndices[1]=-1,this._triangleIndices[2]=-1,this._currentVertexIndex=0},e.prototype._endcallback=function(){this._currentVertexIndex=0},e.prototype._errorcallback=function(e){n.error("Encountered error during tesselation: "+e)},e.prototype._combinecallback=function(e,t,i){return[e[0],e[1],e[2]]},e.prototype._edgeCallback=function(e){},e}();t.default=o}.apply(null,r))||(e.exports=n)},1924:function(e,t,i){var r;
  /**
     * @license
     * Copyright 2000, Silicon Graphics, Inc. All Rights Reserved.
     * Copyright 2015, Google Inc. All Rights Reserved.
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy
     * of this software and associated documentation files (the "Software"), to
     * deal in the Software without restriction, including without limitation the
     * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
     * sell copies of the Software, and to permit persons to whom the Software is
     * furnished to do so, subject to the following conditions:
     *
     * The above copyright notice including the dates of first publication and
     * either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/
     * shall be included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
     * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
     * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
     * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     *
     * Original Code. The Original Code is: OpenGL Sample Implementation,
     * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
     * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
     * Copyright in any portions created by third parties is as indicated
     * elsewhere herein. All Rights Reserved.
     */void 0===(r=function(){"use strict";var e={DEBUG:!1,assert:function(t,i){if(e.DEBUG&&!t)throw new Error("Assertion failed"+(i?": "+i:""))},GLU_TESS_MAX_COORD:1e150,TRUE_PROJECT:!1,GLU_TESS_DEFAULT_TOLERANCE:0,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111,GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901}};return e.PQHandle,e.geom={},e.geom.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},e.geom.vertLeq=function(e,t){return e.s<t.s||e.s===t.s&&e.t<=t.t},e.geom.edgeEval=function(t,i,r){e.assert(e.geom.vertLeq(t,i)&&e.geom.vertLeq(i,r));var n=i.s-t.s,o=r.s-i.s;return n+o>0?n<o?i.t-t.t+(t.t-r.t)*(n/(n+o)):i.t-r.t+(r.t-t.t)*(o/(n+o)):0},e.geom.edgeSign=function(t,i,r){e.assert(e.geom.vertLeq(t,i)&&e.geom.vertLeq(i,r));var n=i.s-t.s,o=r.s-i.s;return n+o>0?(i.t-r.t)*n+(i.t-t.t)*o:0},e.geom.transLeq=function(e,t){return e.t<t.t||e.t===t.t&&e.s<=t.s},e.geom.transEval=function(t,i,r){e.assert(e.geom.transLeq(t,i)&&e.geom.transLeq(i,r));var n=i.t-t.t,o=r.t-i.t;return n+o>0?n<o?i.s-t.s+(t.s-r.s)*(n/(n+o)):i.s-r.s+(r.s-t.s)*(o/(n+o)):0},e.geom.transSign=function(t,i,r){e.assert(e.geom.transLeq(t,i)&&e.geom.transLeq(i,r));var n=i.t-t.t,o=r.t-i.t;return n+o>0?(i.s-r.s)*n+(i.s-t.s)*o:0},e.geom.edgeGoesLeft=function(t){return e.geom.vertLeq(t.dst(),t.org)},e.geom.edgeGoesRight=function(t){return e.geom.vertLeq(t.org,t.dst())},e.geom.vertL1dist=function(e,t){return Math.abs(e.s-t.s)+Math.abs(e.t-t.t)},e.geom.vertCCW=function(e,t,i){return e.s*(t.t-i.t)+t.s*(i.t-e.t)+i.s*(e.t-t.t)>=0},e.geom.interpolate_=function(e,t,i,r){return(e=e<0?0:e)<=(i=i<0?0:i)?0===i?(t+r)/2:t+e/(e+i)*(r-t):r+i/(e+i)*(t-r)},e.geom.edgeIntersect=function(t,i,r,n,o){var s,a,l;e.geom.vertLeq(t,i)||(l=t,t=i,i=l),e.geom.vertLeq(r,n)||(l=r,r=n,n=l),e.geom.vertLeq(t,r)||(l=t,t=r,r=l,l=i,i=n,n=l),e.geom.vertLeq(r,i)?e.geom.vertLeq(i,n)?((s=e.geom.edgeEval(t,r,i))+(a=e.geom.edgeEval(r,i,n))<0&&(s=-s,a=-a),o.s=e.geom.interpolate_(s,r.s,a,i.s)):((s=e.geom.edgeSign(t,r,i))+(a=-e.geom.edgeSign(t,n,i))<0&&(s=-s,a=-a),o.s=e.geom.interpolate_(s,r.s,a,n.s)):o.s=(r.s+i.s)/2,e.geom.transLeq(t,i)||(l=t,t=i,i=l),e.geom.transLeq(r,n)||(l=r,r=n,n=l),e.geom.transLeq(t,r)||(l=t,t=r,r=l,l=i,i=n,n=l),e.geom.transLeq(r,i)?e.geom.transLeq(i,n)?((s=e.geom.transEval(t,r,i))+(a=e.geom.transEval(r,i,n))<0&&(s=-s,a=-a),o.t=e.geom.interpolate_(s,r.t,a,i.t)):((s=e.geom.transSign(t,r,i))+(a=-e.geom.transSign(t,n,i))<0&&(s=-s,a=-a),o.t=e.geom.interpolate_(s,r.t,a,n.t)):o.t=(r.t+i.t)/2},e.mesh={},e.mesh.makeEdge=function(t){var i=e.mesh.makeEdgePair_(t.eHead);return e.mesh.makeVertex_(i,t.vHead),e.mesh.makeVertex_(i.sym,t.vHead),e.mesh.makeFace_(i,t.fHead),i},e.mesh.meshSplice=function(t,i){var r=!1,n=!1;t!==i&&(i.org!==t.org&&(n=!0,e.mesh.killVertex_(i.org,t.org)),i.lFace!==t.lFace&&(r=!0,e.mesh.killFace_(i.lFace,t.lFace)),e.mesh.splice_(i,t),n||(e.mesh.makeVertex_(i,t.org),t.org.anEdge=t),r||(e.mesh.makeFace_(i,t.lFace),t.lFace.anEdge=t))},e.mesh.deleteEdge=function(t){var i=t.sym,r=!1;t.lFace!==t.rFace()&&(r=!0,e.mesh.killFace_(t.lFace,t.rFace())),t.oNext===t?e.mesh.killVertex_(t.org,null):(t.rFace().anEdge=t.oPrev(),t.org.anEdge=t.oNext,e.mesh.splice_(t,t.oPrev()),r||e.mesh.makeFace_(t,t.lFace)),i.oNext===i?(e.mesh.killVertex_(i.org,null),e.mesh.killFace_(i.lFace,null)):(t.lFace.anEdge=i.oPrev(),i.org.anEdge=i.oNext,e.mesh.splice_(i,i.oPrev())),e.mesh.killEdge_(t)},e.mesh.addEdgeVertex=function(t){var i=e.mesh.makeEdgePair_(t),r=i.sym;return e.mesh.splice_(i,t.lNext),i.org=t.dst(),e.mesh.makeVertex_(r,i.org),i.lFace=r.lFace=t.lFace,i},e.mesh.splitEdge=function(t){var i=e.mesh.addEdgeVertex(t).sym;return e.mesh.splice_(t.sym,t.sym.oPrev()),e.mesh.splice_(t.sym,i),t.sym.org=i.org,i.dst().anEdge=i.sym,i.sym.lFace=t.rFace(),i.winding=t.winding,i.sym.winding=t.sym.winding,i},e.mesh.connect=function(t,i){var r=!1,n=e.mesh.makeEdgePair_(t),o=n.sym;return i.lFace!==t.lFace&&(r=!0,e.mesh.killFace_(i.lFace,t.lFace)),e.mesh.splice_(n,t.lNext),e.mesh.splice_(o,i),n.org=t.dst(),o.org=i.org,n.lFace=o.lFace=t.lFace,t.lFace.anEdge=o,r||e.mesh.makeFace_(n,t.lFace),n},e.mesh.zapFace=function(t){var i,r=t.anEdge,n=r.lNext;do{if(n=(i=n).lNext,i.lFace=null,null===i.rFace()){i.oNext===i?e.mesh.killVertex_(i.org,null):(i.org.anEdge=i.oNext,e.mesh.splice_(i,i.oPrev()));var o=i.sym;o.oNext===o?e.mesh.killVertex_(o.org,null):(o.org.anEdge=o.oNext,e.mesh.splice_(o,o.oPrev())),e.mesh.killEdge_(i)}}while(i!==r);var s=t.prev,a=t.next;a.prev=s,s.next=a},e.mesh.meshUnion=function(e,t){var i=e.fHead,r=e.vHead,n=e.eHead,o=t.fHead,s=t.vHead,a=t.eHead;return o.next!==o&&(i.prev.next=o.next,o.next.prev=i.prev,o.prev.next=i,i.prev=o.prev),s.next!==s&&(r.prev.next=s.next,s.next.prev=r.prev,s.prev.next=r,r.prev=s.prev),a.next!==a&&(n.sym.next.sym.next=a.next,a.next.sym.next=n.sym.next,a.sym.next.sym.next=n,n.sym.next=a.sym.next),e},e.mesh.deleteMesh=function(e){},e.mesh.makeEdgePair_=function(t){var i=new e.GluHalfEdge,r=new e.GluHalfEdge,n=t.sym.next;return r.next=n,n.sym.next=i,i.next=t,t.sym.next=r,i.sym=r,i.oNext=i,i.lNext=r,r.sym=i,r.oNext=r,r.lNext=i,i},e.mesh.splice_=function(e,t){var i=e.oNext,r=t.oNext;i.sym.lNext=t,r.sym.lNext=e,e.oNext=r,t.oNext=i},e.mesh.makeVertex_=function(t,i){var r=i.prev,n=new e.GluVertex(i,r);r.next=n,i.prev=n,n.anEdge=t;var o=t;do{o.org=n,o=o.oNext}while(o!==t)},e.mesh.makeFace_=function(t,i){var r=i.prev,n=new e.GluFace(i,r);r.next=n,i.prev=n,n.anEdge=t,n.inside=i.inside;var o=t;do{o.lFace=n,o=o.lNext}while(o!==t)},e.mesh.killEdge_=function(e){var t=e.next,i=e.sym.next;t.sym.next=i,i.sym.next=t},e.mesh.killVertex_=function(e,t){var i=e.anEdge,r=i;do{r.org=t,r=r.oNext}while(r!==i);var n=e.prev,o=e.next;o.prev=n,n.next=o},e.mesh.killFace_=function(e,t){var i=e.anEdge,r=i;do{r.lFace=t,r=r.lNext}while(r!==i);var n=e.prev,o=e.next;o.prev=n,n.next=o},e.normal={},e.normal.S_UNIT_X_=1,e.normal.S_UNIT_Y_=0,e.normal.projectPolygon=function(t,i,r,n){var o=!1,s=[i,r,n];0===i&&0===r&&0===n&&(e.normal.computeNormal_(t,s),o=!0);var a,l=e.normal.longAxis_(s),u=t.mesh.vHead;if(e.TRUE_PROJECT){e.normal.normalize_(s);var h=[0,0,0],c=[0,0,0];h[l]=0,h[(l+1)%3]=e.normal.S_UNIT_X_,h[(l+2)%3]=e.normal.S_UNIT_Y_;var d=e.normal.dot_(h,s);for(h[0]-=d*s[0],h[1]-=d*s[1],h[2]-=d*s[2],e.normal.normalize_(h),c[0]=s[1]*h[2]-s[2]*h[1],c[1]=s[2]*h[0]-s[0]*h[2],c[2]=s[0]*h[1]-s[1]*h[0],e.normal.normalize_(c),a=u.next;a!==u;a=a.next)a.s=e.normal.dot_(a.coords,h),a.t=e.normal.dot_(a.coords,c)}else{var f=(l+1)%3,p=(l+2)%3,_=s[l]>0?1:-1;for(a=u.next;a!==u;a=a.next)a.s=a.coords[f],a.t=_*a.coords[p]}o&&e.normal.checkOrientation_(t)},e.normal.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.normal.normalize_=function(t){var i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];e.assert(i>0),i=Math.sqrt(i),t[0]/=i,t[1]/=i,t[2]/=i},e.normal.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},e.normal.computeNormal_=function(t,i){var r,n=[-2*e.GLU_TESS_MAX_COORD,-2*e.GLU_TESS_MAX_COORD,-2*e.GLU_TESS_MAX_COORD],o=[2*e.GLU_TESS_MAX_COORD,2*e.GLU_TESS_MAX_COORD,2*e.GLU_TESS_MAX_COORD],s=[],a=[],l=t.mesh.vHead;for(r=l.next;r!==l;r=r.next)for(var u=0;u<3;++u){var h=r.coords[u];h<o[u]&&(o[u]=h,a[u]=r),h>n[u]&&(n[u]=h,s[u]=r)}var c=0;if(n[1]-o[1]>n[0]-o[0]&&(c=1),n[2]-o[2]>n[c]-o[c]&&(c=2),o[c]>=n[c])return i[0]=0,i[1]=0,void(i[2]=1);var d=0,f=a[c],p=s[c],_=[0,0,0],v=[f.coords[0]-p.coords[0],f.coords[1]-p.coords[1],f.coords[2]-p.coords[2]],m=[0,0,0];for(r=l.next;r!==l;r=r.next){m[0]=r.coords[0]-p.coords[0],m[1]=r.coords[1]-p.coords[1],m[2]=r.coords[2]-p.coords[2],_[0]=v[1]*m[2]-v[2]*m[1],_[1]=v[2]*m[0]-v[0]*m[2],_[2]=v[0]*m[1]-v[1]*m[0];var g=_[0]*_[0]+_[1]*_[1]+_[2]*_[2];g>d&&(d=g,i[0]=_[0],i[1]=_[1],i[2]=_[2])}d<=0&&(i[0]=i[1]=i[2]=0,i[e.normal.longAxis_(v)]=1)},e.normal.checkOrientation_=function(e){for(var t=0,i=e.mesh.fHead,r=i.next;r!==i;r=r.next){var n=r.anEdge;if(!(n.winding<=0))do{t+=(n.org.s-n.dst().s)*(n.org.t+n.dst().t),n=n.lNext}while(n!==r.anEdge)}if(t<0)for(var o=e.mesh.vHead,s=o.next;s!==o;s=s.next)s.t=-s.t},e.render={},e.render.renderMesh=function(t,i,r){for(var n=!1,o=-1,s=i.fHead.prev;s!==i.fHead;s=s.prev)if(s.inside){n||(t.callBeginCallback(e.primitiveType.GL_TRIANGLES),n=!0);var a=s.anEdge;e.assert(a.lNext.lNext.lNext===a,"renderMesh called with non-triangulated mesh");do{if(r){var l=a.rFace().inside?0:1;o!==l&&(o=l,t.callEdgeFlagCallback(!!o))}t.callVertexCallback(a.org.data),a=a.lNext}while(a!==s.anEdge)}n&&t.callEndCallback()},e.render.renderBoundary=function(t,i){for(var r=i.fHead.next;r!==i.fHead;r=r.next)if(r.inside){t.callBeginCallback(e.primitiveType.GL_LINE_LOOP);var n=r.anEdge;do{t.callVertexCallback(n.org.data),n=n.lNext}while(n!==r.anEdge);t.callEndCallback()}},e.sweep={},e.sweep.SENTINEL_COORD_=4*e.GLU_TESS_MAX_COORD,e.sweep.TOLERANCE_NONZERO_=!1,e.sweep.computeInterior=function(t){t.fatalError=!1,e.sweep.removeDegenerateEdges_(t),e.sweep.initPriorityQ_(t),e.sweep.initEdgeDict_(t);for(var i;null!==(i=t.pq.extractMin());){for(;;){var r=t.pq.minimum();if(null===r||!e.geom.vertEq(r,i))break;r=t.pq.extractMin(),e.sweep.spliceMergeVertices_(t,i.anEdge,r.anEdge)}e.sweep.sweepEvent_(t,i)}var n=t.dict.getMin().getKey();t.event=n.eUp.org,e.sweep.doneEdgeDict_(t),e.sweep.donePriorityQ_(t),e.sweep.removeDegenerateFaces_(t.mesh),t.mesh.checkMesh()},e.sweep.addWinding_=function(e,t){e.winding+=t.winding,e.sym.winding+=t.sym.winding},e.sweep.edgeLeq_=function(t,i,r){var n=t.event,o=i.eUp,s=r.eUp;return o.dst()===n?s.dst()===n?e.geom.vertLeq(o.org,s.org)?e.geom.edgeSign(s.dst(),o.org,s.org)<=0:e.geom.edgeSign(o.dst(),s.org,o.org)>=0:e.geom.edgeSign(s.dst(),n,s.org)<=0:s.dst()===n?e.geom.edgeSign(o.dst(),n,o.org)>=0:e.geom.edgeEval(o.dst(),n,o.org)>=e.geom.edgeEval(s.dst(),n,s.org)},e.sweep.deleteRegion_=function(t,i){i.fixUpperEdge&&e.assert(0===i.eUp.winding),i.eUp.activeRegion=null,t.dict.deleteNode(i.nodeUp),i.nodeUp=null},e.sweep.fixUpperEdge_=function(t,i){e.assert(t.fixUpperEdge),e.mesh.deleteEdge(t.eUp),t.fixUpperEdge=!1,t.eUp=i,i.activeRegion=t},e.sweep.topLeftRegion_=function(t){var i=t.eUp.org;do{t=t.regionAbove()}while(t.eUp.org===i);if(t.fixUpperEdge){var r=e.mesh.connect(t.regionBelow().eUp.sym,t.eUp.lNext);e.sweep.fixUpperEdge_(t,r),t=t.regionAbove()}return t},e.sweep.topRightRegion_=function(e){var t=e.eUp.dst();do{e=e.regionAbove()}while(e.eUp.dst()===t);return e},e.sweep.addRegionBelow_=function(t,i,r){var n=new e.ActiveRegion;return n.eUp=r,n.nodeUp=t.dict.insertBefore(i.nodeUp,n),r.activeRegion=n,n},e.sweep.isWindingInside_=function(t,i){switch(t.windingRule){case e.windingRule.GLU_TESS_WINDING_ODD:return 0!=(1&i);case e.windingRule.GLU_TESS_WINDING_NONZERO:return 0!==i;case e.windingRule.GLU_TESS_WINDING_POSITIVE:return i>0;case e.windingRule.GLU_TESS_WINDING_NEGATIVE:return i<0;case e.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return i>=2||i<=-2}return e.assert(!1),!1},e.sweep.computeWinding_=function(t,i){i.windingNumber=i.regionAbove().windingNumber+i.eUp.winding,i.inside=e.sweep.isWindingInside_(t,i.windingNumber)},e.sweep.finishRegion_=function(t,i){var r=i.eUp,n=r.lFace;n.inside=i.inside,n.anEdge=r,e.sweep.deleteRegion_(t,i)},e.sweep.finishLeftRegions_=function(t,i,r){for(var n=i,o=i.eUp;n!==r;){n.fixUpperEdge=!1;var s=n.regionBelow(),a=s.eUp;if(a.org!==o.org){if(!s.fixUpperEdge){e.sweep.finishRegion_(t,n);break}a=e.mesh.connect(o.lPrev(),a.sym),e.sweep.fixUpperEdge_(s,a)}o.oNext!==a&&(e.mesh.meshSplice(a.oPrev(),a),e.mesh.meshSplice(o,a)),e.sweep.finishRegion_(t,n),o=s.eUp,n=s}return o},e.sweep.addRightEdges_=function(t,i,r,n,o,s){var a=!0,l=r;do{e.assert(e.geom.vertLeq(l.org,l.dst())),e.sweep.addRegionBelow_(t,i,l.sym),l=l.oNext}while(l!==n);null===o&&(o=i.regionBelow().eUp.rPrev());for(var u,h=i,c=o;(l=(u=h.regionBelow()).eUp.sym).org===c.org;)l.oNext!==c&&(e.mesh.meshSplice(l.oPrev(),l),e.mesh.meshSplice(c.oPrev(),l)),u.windingNumber=h.windingNumber-l.winding,u.inside=e.sweep.isWindingInside_(t,u.windingNumber),h.dirty=!0,!a&&e.sweep.checkForRightSplice_(t,h)&&(e.sweep.addWinding_(l,c),e.sweep.deleteRegion_(t,h),e.mesh.deleteEdge(c)),a=!1,h=u,c=l;h.dirty=!0,e.assert(h.windingNumber-l.winding===u.windingNumber),s&&e.sweep.walkDirtyRegions_(t,h)},e.sweep.callCombine_=function(t,i,r,n,o){var s=[i.coords[0],i.coords[1],i.coords[2]];i.data=null,i.data=t.callCombineCallback(s,r,n),null===i.data&&(o?t.fatalError||(t.callErrorCallback(e.errorType.GLU_TESS_NEED_COMBINE_CALLBACK),t.fatalError=!0):i.data=r[0])},e.sweep.spliceMergeVertices_=function(t,i,r){var n=[null,null,null,null];n[0]=i.org.data,n[1]=r.org.data,e.sweep.callCombine_(t,i.org,n,[.5,.5,0,0],!1),e.mesh.meshSplice(i,r)},e.sweep.vertexWeights_=function(t,i,r,n,o){var s=e.geom.vertL1dist(i,t),a=e.geom.vertL1dist(r,t),l=o,u=o+1;n[l]=.5*a/(s+a),n[u]=.5*s/(s+a),t.coords[0]+=n[l]*i.coords[0]+n[u]*r.coords[0],t.coords[1]+=n[l]*i.coords[1]+n[u]*r.coords[1],t.coords[2]+=n[l]*i.coords[2]+n[u]*r.coords[2]},e.sweep.getIntersectData_=function(t,i,r,n,o,s){var a=[0,0,0,0],l=[r.data,n.data,o.data,s.data];i.coords[0]=i.coords[1]=i.coords[2]=0,e.sweep.vertexWeights_(i,r,n,a,0),e.sweep.vertexWeights_(i,o,s,a,2),e.sweep.callCombine_(t,i,l,a,!0)},e.sweep.checkForRightSplice_=function(t,i){var r=i.regionBelow(),n=i.eUp,o=r.eUp;if(e.geom.vertLeq(n.org,o.org)){if(e.geom.edgeSign(o.dst(),n.org,o.org)>0)return!1;e.geom.vertEq(n.org,o.org)?n.org!==o.org&&(t.pq.remove(n.org.pqHandle),e.sweep.spliceMergeVertices_(t,o.oPrev(),n)):(e.mesh.splitEdge(o.sym),e.mesh.meshSplice(n,o.oPrev()),i.dirty=r.dirty=!0)}else{if(e.geom.edgeSign(n.dst(),o.org,n.org)<0)return!1;i.regionAbove().dirty=i.dirty=!0,e.mesh.splitEdge(n.sym),e.mesh.meshSplice(o.oPrev(),n)}return!0},e.sweep.checkForLeftSplice_=function(t,i){var r,n=i.regionBelow(),o=i.eUp,s=n.eUp;if(e.assert(!e.geom.vertEq(o.dst(),s.dst())),e.geom.vertLeq(o.dst(),s.dst())){if(e.geom.edgeSign(o.dst(),s.dst(),o.org)<0)return!1;i.regionAbove().dirty=i.dirty=!0,r=e.mesh.splitEdge(o),e.mesh.meshSplice(s.sym,r),r.lFace.inside=i.inside}else{if(e.geom.edgeSign(s.dst(),o.dst(),s.org)>0)return!1;i.dirty=n.dirty=!0,r=e.mesh.splitEdge(s),e.mesh.meshSplice(o.lNext,s.sym),r.rFace().inside=i.inside}return!0},e.sweep.checkForIntersect_=function(t,i){var r=i.regionBelow(),n=i.eUp,o=r.eUp,s=n.org,a=o.org,l=n.dst(),u=o.dst(),h=new e.GluVertex;if(e.assert(!e.geom.vertEq(u,l)),e.assert(e.geom.edgeSign(l,t.event,s)<=0),e.assert(e.geom.edgeSign(u,t.event,a)>=0),e.assert(s!==t.event&&a!==t.event),e.assert(!i.fixUpperEdge&&!r.fixUpperEdge),s===a)return!1;if(Math.min(s.t,l.t)>Math.max(a.t,u.t))return!1;if(e.geom.vertLeq(s,a)){if(e.geom.edgeSign(u,s,a)>0)return!1}else if(e.geom.edgeSign(l,a,s)<0)return!1;e.geom.edgeIntersect(l,s,u,a,h),e.assert(Math.min(s.t,l.t)<=h.t),e.assert(h.t<=Math.max(a.t,u.t)),e.assert(Math.min(u.s,l.s)<=h.s),e.assert(h.s<=Math.max(a.s,s.s)),e.geom.vertLeq(h,t.event)&&(h.s=t.event.s,h.t=t.event.t);var c=e.geom.vertLeq(s,a)?s:a;if(e.geom.vertLeq(c,h)&&(h.s=c.s,h.t=c.t),e.geom.vertEq(h,s)||e.geom.vertEq(h,a))return e.sweep.checkForRightSplice_(t,i),!1;if(!e.geom.vertEq(l,t.event)&&e.geom.edgeSign(l,t.event,h)>=0||!e.geom.vertEq(u,t.event)&&e.geom.edgeSign(u,t.event,h)<=0){if(u===t.event)return e.mesh.splitEdge(n.sym),e.mesh.meshSplice(o.sym,n),n=(i=e.sweep.topLeftRegion_(i)).regionBelow().eUp,e.sweep.finishLeftRegions_(t,i.regionBelow(),r),e.sweep.addRightEdges_(t,i,n.oPrev(),n,n,!0),!0;if(l===t.event){e.mesh.splitEdge(o.sym),e.mesh.meshSplice(n.lNext,o.oPrev()),r=i;var d=(i=e.sweep.topRightRegion_(i)).regionBelow().eUp.rPrev();return r.eUp=o.oPrev(),o=e.sweep.finishLeftRegions_(t,r,null),e.sweep.addRightEdges_(t,i,o.oNext,n.rPrev(),d,!0),!0}return e.geom.edgeSign(l,t.event,h)>=0&&(i.regionAbove().dirty=i.dirty=!0,e.mesh.splitEdge(n.sym),n.org.s=t.event.s,n.org.t=t.event.t),e.geom.edgeSign(u,t.event,h)<=0&&(i.dirty=r.dirty=!0,e.mesh.splitEdge(o.sym),o.org.s=t.event.s,o.org.t=t.event.t),!1}return e.mesh.splitEdge(n.sym),e.mesh.splitEdge(o.sym),e.mesh.meshSplice(o.oPrev(),n),n.org.s=h.s,n.org.t=h.t,n.org.pqHandle=t.pq.insert(n.org),e.sweep.getIntersectData_(t,n.org,s,l,a,u),i.regionAbove().dirty=i.dirty=r.dirty=!0,!1},e.sweep.walkDirtyRegions_=function(t,i){for(var r=i.regionBelow();;){for(;r.dirty;)i=r,r=r.regionBelow();if(!i.dirty&&(r=i,null===(i=i.regionAbove())||!i.dirty))return;i.dirty=!1;var n=i.eUp,o=r.eUp;if(n.dst()!==o.dst()&&e.sweep.checkForLeftSplice_(t,i)&&(r.fixUpperEdge?(e.sweep.deleteRegion_(t,r),e.mesh.deleteEdge(o),o=(r=i.regionBelow()).eUp):i.fixUpperEdge&&(e.sweep.deleteRegion_(t,i),e.mesh.deleteEdge(n),n=(i=r.regionAbove()).eUp)),n.org!==o.org)if(n.dst()===o.dst()||i.fixUpperEdge||r.fixUpperEdge||n.dst()!==t.event&&o.dst()!==t.event)e.sweep.checkForRightSplice_(t,i);else if(e.sweep.checkForIntersect_(t,i))return;n.org===o.org&&n.dst()===o.dst()&&(e.sweep.addWinding_(o,n),e.sweep.deleteRegion_(t,i),e.mesh.deleteEdge(n),i=r.regionAbove())}},e.sweep.connectRightVertex_=function(t,i,r){var n,o=r.oNext,s=i.regionBelow(),a=i.eUp,l=s.eUp,u=!1;(a.dst()!==l.dst()&&e.sweep.checkForIntersect_(t,i),e.geom.vertEq(a.org,t.event)&&(e.mesh.meshSplice(o.oPrev(),a),o=(i=e.sweep.topLeftRegion_(i)).regionBelow().eUp,e.sweep.finishLeftRegions_(t,i.regionBelow(),s),u=!0),e.geom.vertEq(l.org,t.event)&&(e.mesh.meshSplice(r,l.oPrev()),r=e.sweep.finishLeftRegions_(t,s,null),u=!0),u)?e.sweep.addRightEdges_(t,i,r.oNext,o,o,!0):(n=e.geom.vertLeq(l.org,a.org)?l.oPrev():a,n=e.mesh.connect(r.lPrev(),n),e.sweep.addRightEdges_(t,i,n,n.oNext,n.oNext,!1),n.sym.activeRegion.fixUpperEdge=!0,e.sweep.walkDirtyRegions_(t,i))},e.sweep.connectLeftDegenerate_=function(t,i,r){var n=i.eUp;if(e.geom.vertEq(n.org,r))return e.assert(e.sweep.TOLERANCE_NONZERO_),void(e.sweep.TOLERANCE_NONZERO_&&e.sweep.spliceMergeVertices_(t,n,r.anEdge));if(!e.geom.vertEq(n.dst(),r))return e.mesh.splitEdge(n.sym),i.fixUpperEdge&&(e.mesh.deleteEdge(n.oNext),i.fixUpperEdge=!1),e.mesh.meshSplice(r.anEdge,n),void e.sweep.sweepEvent_(t,r);if(e.assert(e.sweep.TOLERANCE_NONZERO_),e.sweep.TOLERANCE_NONZERO_){var o=(i=e.sweep.topRightRegion_(i)).regionBelow(),s=o.eUp.sym,a=s.oNext,l=a;o.fixUpperEdge&&(e.assert(a!==s),e.sweep.deleteRegion_(t,o),e.mesh.deleteEdge(s),s=a.oPrev()),e.mesh.meshSplice(r.anEdge,s),e.geom.edgeGoesLeft(a)||(a=null),e.sweep.addRightEdges_(t,i,s.oNext,l,a,!0)}},e.sweep.connectLeftVertex_=function(t,i){var r=new e.ActiveRegion;r.eUp=i.anEdge.sym;var n=t.dict.search(r).getKey(),o=n.regionBelow(),s=n.eUp,a=o.eUp;if(0!==e.geom.edgeSign(s.dst(),i,s.org)){var l,u=e.geom.vertLeq(a.dst(),s.dst())?n:o;n.inside||u.fixUpperEdge?(l=u===n?e.mesh.connect(i.anEdge.sym,s.lNext):e.mesh.connect(a.dNext(),i.anEdge).sym,u.fixUpperEdge?e.sweep.fixUpperEdge_(u,l):e.sweep.computeWinding_(t,e.sweep.addRegionBelow_(t,n,l)),e.sweep.sweepEvent_(t,i)):e.sweep.addRightEdges_(t,n,i.anEdge,i.anEdge,null,!0)}else e.sweep.connectLeftDegenerate_(t,n,i)},e.sweep.sweepEvent_=function(t,i){t.event=i;for(var r=i.anEdge;null===r.activeRegion;)if((r=r.oNext)===i.anEdge)return void e.sweep.connectLeftVertex_(t,i);var n=e.sweep.topLeftRegion_(r.activeRegion),o=n.regionBelow(),s=o.eUp,a=e.sweep.finishLeftRegions_(t,o,null);a.oNext===s?e.sweep.connectRightVertex_(t,n,a):e.sweep.addRightEdges_(t,n,a.oNext,s,s,!0)},e.sweep.addSentinel_=function(t,i){var r=new e.ActiveRegion,n=e.mesh.makeEdge(t.mesh);n.org.s=e.sweep.SENTINEL_COORD_,n.org.t=i,n.dst().s=-e.sweep.SENTINEL_COORD_,n.dst().t=i,t.event=n.dst(),r.eUp=n,r.windingNumber=0,r.inside=!1,r.fixUpperEdge=!1,r.sentinel=!0,r.dirty=!1,r.nodeUp=t.dict.insert(r)},e.sweep.initEdgeDict_=function(t){t.dict=new e.Dict(t,e.sweep.edgeLeq_),e.sweep.addSentinel_(t,-e.sweep.SENTINEL_COORD_),e.sweep.addSentinel_(t,e.sweep.SENTINEL_COORD_)},e.sweep.doneEdgeDict_=function(t){for(var i,r=0;null!==(i=t.dict.getMin().getKey());)i.sentinel||(e.assert(i.fixUpperEdge),e.assert(1==++r)),e.assert(0===i.windingNumber),e.sweep.deleteRegion_(t,i);t.dict=null},e.sweep.removeDegenerateEdges_=function(t){for(var i,r=t.mesh.eHead,n=r.next;n!==r;n=i){i=n.next;var o=n.lNext;e.geom.vertEq(n.org,n.dst())&&n.lNext.lNext!==n&&(e.sweep.spliceMergeVertices_(t,o,n),e.mesh.deleteEdge(n),o=(n=o).lNext),o.lNext===n&&(o!==n&&(o!==i&&o!==i.sym||(i=i.next),e.mesh.deleteEdge(o)),n!==i&&n!==i.sym||(i=i.next),e.mesh.deleteEdge(n))}},e.sweep.initPriorityQ_=function(t){var i=new e.PriorityQ;t.pq=i;var r,n=t.mesh.vHead;for(r=n.next;r!==n;r=r.next)r.pqHandle=i.insert(r);i.init()},e.sweep.donePriorityQ_=function(e){e.pq.deleteQ(),e.pq=null},e.sweep.removeDegenerateFaces_=function(t){for(var i,r=t.fHead.next;r!==t.fHead;r=i){i=r.next;var n=r.anEdge;e.assert(n.lNext!==n),n.lNext.lNext===n&&(e.sweep.addWinding_(n.oNext,n),e.mesh.deleteEdge(n))}},e.tessmono={},e.tessmono.tessellateMonoRegion_=function(t){var i=t.anEdge;for(e.assert(i.lNext!==i&&i.lNext.lNext!==i);e.geom.vertLeq(i.dst(),i.org);i=i.lPrev());for(;e.geom.vertLeq(i.org,i.dst());i=i.lNext);for(var r,n=i.lPrev();i.lNext!==n;)if(e.geom.vertLeq(i.dst(),n.org)){for(;n.lNext!==i&&(e.geom.edgeGoesLeft(n.lNext)||e.geom.edgeSign(n.org,n.dst(),n.lNext.dst())<=0);)n=(r=e.mesh.connect(n.lNext,n)).sym;n=n.lPrev()}else{for(;n.lNext!==i&&(e.geom.edgeGoesRight(i.lPrev())||e.geom.edgeSign(i.dst(),i.org,i.lPrev().org)>=0);)r=e.mesh.connect(i,i.lPrev()),i=r.sym;i=i.lNext}for(e.assert(n.lNext!==i);n.lNext.lNext!==i;)n=(r=e.mesh.connect(n.lNext,n)).sym},e.tessmono.tessellateInterior=function(t){for(var i,r=t.fHead.next;r!==t.fHead;r=i)i=r.next,r.inside&&e.tessmono.tessellateMonoRegion_(r)},e.tessmono.discardExterior=function(t){for(var i,r=t.fHead.next;r!==t.fHead;r=i)i=r.next,r.inside||e.mesh.zapFace(r)},e.tessmono.setWindingNumber=function(t,i,r){for(var n,o=t.eHead.next;o!==t.eHead;o=n)n=o.next,o.rFace().inside!==o.lFace.inside?o.winding=o.lFace.inside?i:-i:r?e.mesh.deleteEdge(o):o.winding=0},e.Dict=function(t,i){this.head_=new e.DictNode,this.frame_=t,this.leq_=i},e.Dict.prototype.deleteDict_=function(){},e.Dict.prototype.insertBefore=function(t,i){do{t=t.prev}while(null!==t.key&&!this.leq_(this.frame_,t.key,i));var r=new e.DictNode(i,t.next,t);return t.next.prev=r,t.next=r,r},e.Dict.prototype.insert=function(e){return this.insertBefore(this.head_,e)},e.Dict.prototype.deleteNode=function(e){e.next.prev=e.prev,e.prev.next=e.next},e.Dict.prototype.search=function(e){var t=this.head_;do{t=t.next}while(null!==t.key&&!this.leq_(this.frame_,e,t.key));return t},e.Dict.prototype.getMin=function(){return this.head_.next},e.Dict.prototype.getMax=function(){return this.head_.prev},e.DictNode=function(e,t,i){this.key=e||null,this.next=t||this,this.prev=i||this},e.DictNode.prototype.getKey=function(){return this.key},e.DictNode.prototype.getSuccessor=function(){return this.next},e.DictNode.prototype.getPredecessor=function(){return this.prev},e.GluTesselator=function(){this.state_=e.GluTesselator.tessState_.T_DORMANT,this.lastEdge_=null,this.mesh=null,this.errorCallback_=null,this.normal_=[0,0,0],this.windingRule=e.windingRule.GLU_TESS_WINDING_ODD,this.fatalError=!1,this.dict=null,this.pq=null,this.event=null,this.combineCallback_=null,this.boundaryOnly_=!1,this.beginCallback_=null,this.edgeFlagCallback_=null,this.vertexCallback_=null,this.endCallback_=null,this.meshCallback_=null,this.polygonData_=null},e.GluTesselator.tessState_={T_DORMANT:0,T_IN_POLYGON:1,T_IN_CONTOUR:2},e.GluTesselator.prototype.gluDeleteTess=function(){this.requireState_(e.GluTesselator.tessState_.T_DORMANT)},e.GluTesselator.prototype.gluTessProperty=function(t,i){switch(t){case e.gluEnum.GLU_TESS_TOLERANCE:return;case e.gluEnum.GLU_TESS_WINDING_RULE:var r=i;switch(r){case e.windingRule.GLU_TESS_WINDING_ODD:case e.windingRule.GLU_TESS_WINDING_NONZERO:case e.windingRule.GLU_TESS_WINDING_POSITIVE:case e.windingRule.GLU_TESS_WINDING_NEGATIVE:case e.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return void(this.windingRule=r)}break;case e.gluEnum.GLU_TESS_BOUNDARY_ONLY:return void(this.boundaryOnly_=!!i);default:return void this.callErrorCallback(e.gluEnum.GLU_INVALID_ENUM)}this.callErrorCallback(e.gluEnum.GLU_INVALID_VALUE)},e.GluTesselator.prototype.gluGetTessProperty=function(t){switch(t){case e.gluEnum.GLU_TESS_TOLERANCE:return 0;case e.gluEnum.GLU_TESS_WINDING_RULE:var i=this.windingRule;return e.assert(i===e.windingRule.GLU_TESS_WINDING_ODD||i===e.windingRule.GLU_TESS_WINDING_NONZERO||i===e.windingRule.GLU_TESS_WINDING_POSITIVE||i===e.windingRule.GLU_TESS_WINDING_NEGATIVE||i===e.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO),i;case e.gluEnum.GLU_TESS_BOUNDARY_ONLY:return e.assert(!0===this.boundaryOnly_||!1===this.boundaryOnly_),this.boundaryOnly_;default:this.callErrorCallback(e.gluEnum.GLU_INVALID_ENUM)}return!1},e.GluTesselator.prototype.gluTessNormal=function(e,t,i){this.normal_[0]=e,this.normal_[1]=t,this.normal_[2]=i},e.GluTesselator.prototype.gluTessCallback=function(t,i){var r=i||null;switch(t){case e.gluEnum.GLU_TESS_BEGIN:case e.gluEnum.GLU_TESS_BEGIN_DATA:return void(this.beginCallback_=r);case e.gluEnum.GLU_TESS_EDGE_FLAG:case e.gluEnum.GLU_TESS_EDGE_FLAG_DATA:return void(this.edgeFlagCallback_=r);case e.gluEnum.GLU_TESS_VERTEX:case e.gluEnum.GLU_TESS_VERTEX_DATA:return void(this.vertexCallback_=r);case e.gluEnum.GLU_TESS_END:case e.gluEnum.GLU_TESS_END_DATA:return void(this.endCallback_=r);case e.gluEnum.GLU_TESS_ERROR:case e.gluEnum.GLU_TESS_ERROR_DATA:return void(this.errorCallback_=r);case e.gluEnum.GLU_TESS_COMBINE:case e.gluEnum.GLU_TESS_COMBINE_DATA:return void(this.combineCallback_=r);case e.gluEnum.GLU_TESS_MESH:return void(this.meshCallback_=r);default:return void this.callErrorCallback(e.gluEnum.GLU_INVALID_ENUM)}},e.GluTesselator.prototype.gluTessVertex=function(t,i){var r=!1,n=[0,0,0];this.requireState_(e.GluTesselator.tessState_.T_IN_CONTOUR);for(var o=0;o<3;++o){var s=t[o];s<-e.GLU_TESS_MAX_COORD&&(s=-e.GLU_TESS_MAX_COORD,r=!0),s>e.GLU_TESS_MAX_COORD&&(s=e.GLU_TESS_MAX_COORD,r=!0),n[o]=s}r&&this.callErrorCallback(e.errorType.GLU_TESS_COORD_TOO_LARGE),this.addVertex_(n,i)},e.GluTesselator.prototype.gluTessBeginPolygon=function(t){this.requireState_(e.GluTesselator.tessState_.T_DORMANT),this.state_=e.GluTesselator.tessState_.T_IN_POLYGON,this.mesh=new e.GluMesh,this.polygonData_=t},e.GluTesselator.prototype.gluTessBeginContour=function(){this.requireState_(e.GluTesselator.tessState_.T_IN_POLYGON),this.state_=e.GluTesselator.tessState_.T_IN_CONTOUR,this.lastEdge_=null},e.GluTesselator.prototype.gluTessEndContour=function(){this.requireState_(e.GluTesselator.tessState_.T_IN_CONTOUR),this.state_=e.GluTesselator.tessState_.T_IN_POLYGON},e.GluTesselator.prototype.gluTessEndPolygon=function(){if(this.requireState_(e.GluTesselator.tessState_.T_IN_POLYGON),this.state_=e.GluTesselator.tessState_.T_DORMANT,e.normal.projectPolygon(this,this.normal_[0],this.normal_[1],this.normal_[2]),e.sweep.computeInterior(this),!this.fatalError){var t=this.mesh;if(this.boundaryOnly_?e.tessmono.setWindingNumber(t,1,!0):e.tessmono.tessellateInterior(t),this.mesh.checkMesh(),this.beginCallback_||this.endCallback_||this.vertexCallback_||this.edgeFlagCallback_)if(this.boundaryOnly_)e.render.renderBoundary(this,this.mesh);else{var i=!!this.edgeFlagCallback_;e.render.renderMesh(this,this.mesh,i)}if(this.meshCallback_)return e.tessmono.discardExterior(this.mesh),this.meshCallback_(this.mesh),this.mesh=null,void(this.polygonData_=null)}e.mesh.deleteMesh(this.mesh),this.polygonData_=null,this.mesh=null},e.GluTesselator.prototype.requireState_=function(e){this.state_!==e&&this.gotoState_(e)},e.GluTesselator.prototype.gotoState_=function(t){for(;this.state_!==t;)if(this.state_<t)switch(this.state_){case e.GluTesselator.tessState_.T_DORMANT:this.callErrorCallback(e.errorType.GLU_TESS_MISSING_BEGIN_POLYGON),this.gluTessBeginPolygon(null);break;case e.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorCallback(e.errorType.GLU_TESS_MISSING_BEGIN_CONTOUR),this.gluTessBeginContour()}else switch(this.state_){case e.GluTesselator.tessState_.T_IN_CONTOUR:this.callErrorCallback(e.errorType.GLU_TESS_MISSING_END_CONTOUR),this.gluTessEndContour();break;case e.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorCallback(e.errorType.GLU_TESS_MISSING_END_POLYGON),this.gluTessEndPolygon()}},e.GluTesselator.prototype.addVertex_=function(t,i){var r=this.lastEdge_;null===r?(r=e.mesh.makeEdge(this.mesh),e.mesh.meshSplice(r,r.sym)):(e.mesh.splitEdge(r),r=r.lNext),r.org.data=i,r.org.coords[0]=t[0],r.org.coords[1]=t[1],r.org.coords[2]=t[2],r.winding=1,r.sym.winding=-1,this.lastEdge_=r},e.GluTesselator.prototype.callBeginCallback=function(e){this.beginCallback_&&this.beginCallback_(e,this.polygonData_)},e.GluTesselator.prototype.callVertexCallback=function(e){this.vertexCallback_&&this.vertexCallback_(e,this.polygonData_)},e.GluTesselator.prototype.callEdgeFlagCallback=function(e){this.edgeFlagCallback_&&this.edgeFlagCallback_(e,this.polygonData_)},e.GluTesselator.prototype.callEndCallback=function(){this.endCallback_&&this.endCallback_(this.polygonData_)},e.GluTesselator.prototype.callCombineCallback=function(e,t,i){return this.combineCallback_&&this.combineCallback_(e,t,i,this.polygonData_)||null},e.GluTesselator.prototype.callErrorCallback=function(e){this.errorCallback_&&this.errorCallback_(e,this.polygonData_)},e.GluFace=function(e,t){this.next=e||this,this.prev=t||this,this.anEdge=null,this.inside=!1},e.GluHalfEdge=function(e){this.next=e||this,this.sym=null,this.oNext=null,this.lNext=null,this.org=null,this.lFace=null,this.activeRegion=null,this.winding=0},e.GluHalfEdge.prototype.rFace=function(){return this.sym.lFace},e.GluHalfEdge.prototype.dst=function(){return this.sym.org},e.GluHalfEdge.prototype.oPrev=function(){return this.sym.lNext},e.GluHalfEdge.prototype.lPrev=function(){return this.oNext.sym},e.GluHalfEdge.prototype.dPrev=function(){return this.lNext.sym},e.GluHalfEdge.prototype.rPrev=function(){return this.sym.oNext},e.GluHalfEdge.prototype.dNext=function(){return this.rPrev().sym},e.GluHalfEdge.prototype.rNext=function(){return this.oPrev().sym},e.GluMesh=function(){this.vHead=new e.GluVertex,this.fHead=new e.GluFace,this.eHead=new e.GluHalfEdge,this.eHeadSym=new e.GluHalfEdge,this.eHead.sym=this.eHeadSym,this.eHeadSym.sym=this.eHead},e.GluMesh.prototype.checkMesh=function(){if(e.DEBUG){var t,i,r=this.fHead,n=this.vHead,o=this.eHead,s=r;for(s=r;(i=s.next)!==r;s=i){e.assert(i.prev===s),t=i.anEdge;do{e.assert(t.sym!==t),e.assert(t.sym.sym===t),e.assert(t.lNext.oNext.sym===t),e.assert(t.oNext.sym.lNext===t),e.assert(t.lFace===i),t=t.lNext}while(t!==i.anEdge)}e.assert(i.prev===s&&null===i.anEdge);var a,l=n;for(l=n;(a=l.next)!==n;l=a){e.assert(a.prev===l),t=a.anEdge;do{e.assert(t.sym!==t),e.assert(t.sym.sym===t),e.assert(t.lNext.oNext.sym===t),e.assert(t.oNext.sym.lNext===t),e.assert(t.org===a),t=t.oNext}while(t!==a.anEdge)}e.assert(a.prev===l&&null===a.anEdge&&null===a.data);var u=o;for(u=o;(t=u.next)!==o;u=t)e.assert(t.sym.next===u.sym),e.assert(t.sym!==t),e.assert(t.sym.sym===t),e.assert(null!==t.org),e.assert(null!==t.dst()),e.assert(t.lNext.oNext.sym===t),e.assert(t.oNext.sym.lNext===t);e.assert(t.sym.next===u.sym&&t.sym===this.eHeadSym&&t.sym.sym===t&&null===t.org&&null===t.dst()&&null===t.lFace&&null===t.rFace())}},e.GluVertex=function(e,t){this.next=e||this,this.prev=t||this,this.anEdge=null,this.data=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0},e.PriorityQ=function(){this.verts_=[],this.order_=null,this.size_=0,this.initialized_=!1,this.heap_=new e.PriorityQHeap},e.PriorityQ.prototype.deleteQ=function(){this.heap_=null,this.order_=null,this.verts_=null},e.PriorityQ.prototype.init=function(){this.order_=[];for(var t=0;t<this.size_;t++)this.order_[t]=t;var i=function(t){return function(i,r){return e.geom.vertLeq(t[i],t[r])?1:-1}}(this.verts_);if(this.order_.sort(i),this.initialized_=!0,this.heap_.init(),e.DEBUG){var r=0+this.size_-1;for(t=0;t<r;++t)e.assert(e.geom.vertLeq(this.verts_[this.order_[t+1]],this.verts_[this.order_[t]]))}},e.PriorityQ.prototype.insert=function(e){if(this.initialized_)return this.heap_.insert(e);var t=this.size_++;return this.verts_[t]=e,-(t+1)},e.PriorityQ.prototype.extractMin=function(){if(0===this.size_)return this.heap_.extractMin();var t=this.verts_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var i=this.heap_.minimum();if(e.geom.vertLeq(i,t))return this.heap_.extractMin()}do{--this.size_}while(this.size_>0&&null===this.verts_[this.order_[this.size_-1]]);return t},e.PriorityQ.prototype.minimum=function(){if(0===this.size_)return this.heap_.minimum();var t=this.verts_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var i=this.heap_.minimum();if(e.geom.vertLeq(i,t))return i}return t},e.PriorityQ.prototype.remove=function(t){if(t>=0)this.heap_.remove(t);else for(t=-(t+1),e.assert(t<this.verts_.length&&null!==this.verts_[t]),this.verts_[t]=null;this.size_>0&&null===this.verts_[this.order_[this.size_-1]];)--this.size_},e.PriorityQHeap=function(){this.heap_=e.PriorityQHeap.reallocNumeric_([0],e.PriorityQHeap.INIT_SIZE_+1),this.verts_=[null,null],this.handles_=[0,0],this.size_=0,this.max_=e.PriorityQHeap.INIT_SIZE_,this.freeList_=0,this.initialized_=!1,this.heap_[1]=1},e.PriorityQHeap.INIT_SIZE_=32,e.PriorityQHeap.reallocNumeric_=function(e,t){for(var i=new Array(t),r=0;r<e.length;r++)i[r]=e[r];for(;r<t;r++)i[r]=0;return i},e.PriorityQHeap.prototype.init=function(){for(var e=this.size_;e>=1;--e)this.floatDown_(e);this.initialized_=!0},e.PriorityQHeap.prototype.insert=function(t){var i,r=++this.size_;return 2*r>this.max_&&(this.max_*=2,this.handles_=e.PriorityQHeap.reallocNumeric_(this.handles_,this.max_+1)),0===this.freeList_?i=r:(i=this.freeList_,this.freeList_=this.handles_[this.freeList_]),this.verts_[i]=t,this.handles_[i]=r,this.heap_[r]=i,this.initialized_&&this.floatUp_(r),i},e.PriorityQHeap.prototype.isEmpty=function(){return 0===this.size_},e.PriorityQHeap.prototype.minimum=function(){return this.verts_[this.heap_[1]]},e.PriorityQHeap.prototype.extractMin=function(){var e=this.heap_,t=this.verts_,i=this.handles_,r=e[1],n=t[r];return this.size_>0&&(e[1]=e[this.size_],i[e[1]]=1,t[r]=null,i[r]=this.freeList_,this.freeList_=r,--this.size_>0&&this.floatDown_(1)),n},e.PriorityQHeap.prototype.remove=function(t){var i=this.heap_,r=this.verts_,n=this.handles_;e.assert(t>=1&&t<=this.max_&&null!==r[t]);var o=n[t];if(i[o]=i[this.size_],n[i[o]]=o,o<=--this.size_)if(o<=1)this.floatDown_(o);else{var s=r[i[o]],a=r[i[o>>1]];e.geom.vertLeq(a,s)?this.floatDown_(o):this.floatUp_(o)}r[t]=null,n[t]=this.freeList_,this.freeList_=t},e.PriorityQHeap.prototype.floatDown_=function(t){for(var i=this.heap_,r=this.verts_,n=this.handles_,o=t,s=i[o];;){var a=o<<1;a<this.size_&&e.geom.vertLeq(r[i[a+1]],r[i[a]])&&(a+=1),e.assert(a<=this.max_);var l=i[a];if(a>this.size_||e.geom.vertLeq(r[s],r[l]))return i[o]=s,void(n[s]=o);i[o]=l,n[l]=o,o=a}},e.PriorityQHeap.prototype.floatUp_=function(t){for(var i=this.heap_,r=this.verts_,n=this.handles_,o=t,s=i[o];;){var a=o>>1,l=i[a];if(0===a||e.geom.vertLeq(r[l],r[s]))return i[o]=s,void(n[s]=o);i[o]=l,n[l]=o,o=a}},e.ActiveRegion=function(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1},e.ActiveRegion.prototype.regionBelow=function(){return this.nodeUp.getPredecessor().getKey()},e.ActiveRegion.prototype.regionAbove=function(){return this.nodeUp.getSuccessor().getKey()},e}.apply(null,[]))||(e.exports=r)},1925:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(6)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._resolver=null}return e.prototype.isHeld=function(){return!!this._resolver},e.prototype.acquire=function(){var e=this;return this._resolver?this._resolver.promise.then(function(){return e.acquire()}):(this._resolver=i.createResolver(),i.resolve())},e.prototype.release=function(){var e=this._resolver;this._resolver=null,e.resolve()},e}();t.default=r,t.withLock=function(e,t){return e.acquire().then(function(){return t()}).then(function(){return e.release()}).catch(function(t){throw e.release(),t})}}.apply(null,r))||(e.exports=n)},1926:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,i){this._initialVelocity=e,this._stopVelocity=t,this._friction=i,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}return Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0}),e.prototype.isFinished=function(e){return e>this.duration},Object.defineProperty(e.prototype,"friction",{get:function(){return this._friction},enumerable:!0,configurable:!0}),e.prototype.value=function(e){return this.valueFromInitialVelocity(this._initialVelocity,e)},e.prototype.valueDelta=function(e,t){var i=this.value(e);return this.value(e+t)-i},e.prototype.valueFromInitialVelocity=function(e,t){t=Math.min(t,this.duration);var i=1-this.friction;return e*(Math.pow(i,t)-1)/Math.log(i)},e}();t.Momentum=r}.apply(null,r))||(e.exports=n)},1995:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1640)],void 0===(n=function(e,t,i){return function(){function e(e,t){this._width=0,this._height=0,this._free=[],this._width=e,this._height=t,this._free.push(new i(0,0,e,t))}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.allocate=function(e,t){if(e>this._width||t>this._height)return new i;for(var r=null,n=-1,o=0;o<this._free.length;++o){var s=this._free[o];e<=s.width&&t<=s.height&&(null===r||s.y<=r.y&&s.x<=r.x)&&(r=s,n=o)}return null===r?new i:(this._free.splice(n,1),r.width<r.height?(r.width>e&&this._free.push(new i(r.x+e,r.y,r.width-e,t)),r.height>t&&this._free.push(new i(r.x,r.y+t,r.width,r.height-t))):(r.width>e&&this._free.push(new i(r.x+e,r.y,r.width-e,r.height)),r.height>t&&this._free.push(new i(r.x,r.y+t,e,r.height-t))),new i(r.x,r.y,e,t))},e.prototype.release=function(e){for(var t=0;t<this._free.length;++t){var i=this._free[t];if(i.y===e.y&&i.height===e.height&&i.x+i.width===e.x)i.width+=e.width;else if(i.x===e.x&&i.width===e.width&&i.y+i.height===e.y)i.height+=e.height;else if(e.y===i.y&&e.height===i.height&&e.x+e.width===i.x)i.x=e.x,i.width+=e.width;else{if(e.x!==i.x||e.width!==i.width||e.y+e.height!==i.y)continue;i.y=e.y,i.height+=e.height}this._free.splice(t,1),this.release(e)}this._free.push(e)},e}()}.apply(null,r))||(e.exports=n)},1996:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1729)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.background={name:"background",shaders:{vertexShader:i.resolveIncludes("background/background.vert"),fragmentShader:i.resolveIncludes("background/background.frag")},attributes:{a_pos:0}}}.apply(null,r))||(e.exports=n)},1997:function(e,t,i){var r,n;r=[i.dj.c(e.i),t],void 0===(n=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.gain=e}return e.prototype.update=function(e){if(this.hasLastValue){var t=this.computeDelta(e);this.updateDelta(t)}this.lastValue=e},e.prototype.reset=function(){this.lastValue=void 0,this.filteredDelta=void 0},Object.defineProperty(e.prototype,"hasLastValue",{get:function(){return void 0!==this.lastValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasFilteredDelta",{get:function(){return void 0!==this.filteredDelta},enumerable:!0,configurable:!0}),e.prototype.computeDelta=function(e){return e-this.lastValue},e.prototype.updateDelta=function(e){this.hasFilteredDelta?this.filteredDelta=(1-this.gain)*this.filteredDelta+this.gain*e:this.filteredDelta=e},e}();t.FilteredFiniteDifference=i}.apply(null,r))||(e.exports=n)},1998:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(90),i(1997),i(1926)],void 0===(n=function(e,t,i,r,n,o){Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t,i,r){void 0===e&&(e=2.5),void 0===t&&(t=.01),void 0===i&&(i=.95),void 0===r&&(r=12),this.minimumInitialVelocity=e,this.stopVelocity=t,this.friction=i,this.maxVelocity=r,this.value=new n.FilteredFiniteDifference(.8),this.time=new n.FilteredFiniteDifference(.3)}return e.prototype.add=function(e,t){if(this.time.hasLastValue){if(this.time.computeDelta(t)<.01)return;if(this.value.hasFilteredDelta){var i=this.value.computeDelta(e);this.value.filteredDelta*i<0&&this.value.reset()}}this.time.update(t),this.value.update(e)},e.prototype.reset=function(){this.value.reset(),this.time.reset()},e.prototype.evaluateMomentum=function(){if(!this.value.hasFilteredDelta)return null;var e=this.value.filteredDelta/this.time.filteredDelta;return e=r.clamp(e,-this.maxVelocity,this.maxVelocity),Math.abs(e)<this.minimumInitialVelocity?null:this.createMomentum(e,this.stopVelocity,this.friction)},e.prototype.createMomentum=function(e,t,i){return new o.Momentum(e,t,i)},e}();t.MomentumEstimator=s}.apply(null,r))||(e.exports=n)},2272:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(10),i(6),i(44),i(36),i(1539),i(1878),i(1493),i(2280),i(2304),i(290),i(1475),i(444),i(1473),i(1484),i(1560),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m,g){Object.defineProperty(t,"__esModule",{value:!0});var y=function(e){function t(t,i){var n=e.call(this)||this;n._renderParameters={drawPhase:0,state:n.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1},n._renderRequested=!1,n._clipData=new Float32Array(8),n._upperLeft=s.vec2f64.create(),n._upperRight=s.vec2f64.create(),n._lowerLeft=s.vec2f64.create(),n._lowerRight=s.vec2f64.create(),n._mat2=s.mat2df64.create(),n._clipRendererInitialized=!1,n._supersampleScreenshots=!0,n.stage=n,n._stationary=!0,n.attached=!0;var a=r({alpha:!0,stencil:!0,renderContext:"webgl"},i);n._canvas=document.createElement("canvas"),n._canvas.setAttribute("style","width: 100%; height:100%; display:block;"),t.appendChild(n._canvas);var l={alpha:a.alpha,antialias:!1,depth:!0,stencil:a.stencil},u=p.createContextOrErrorHTML(n._canvas,l,a.renderContext);return n.context=new m(u),n.painter=new h.default(n.context),n._taskHandle=o.addFrameTask({render:function(){return n.renderFrame()}}),n._taskHandle.pause(),n._supersampleScreenshots=!a.hasOwnProperty("supersampleScreenshots")||a.supersampleScreenshots,n}return i(t,e),t.prototype.destroy=function(){this.removeAllChildren(),this.renderFrame(),this._taskHandle.remove(),this._taskHandle=null,this._boundFBO=null,this._clipFBO&&(this._clipFBO.dispose(),this._clipFBO=null),this._labelsFBO1&&(this._labelsFBO1.dispose(),this._labelsFBO1=null),this._labelsFBO2&&(this._labelsFBO2.dispose(),this._labelsFBO2=null),this._blitRenderer&&(this._blitRenderer.dispose(),this._blitRenderer=null),this._clipVAO&&(this._clipVAO.dispose(),this._clipVAO=null,this._clipVBO=null),this._clipStencilProgram&&(this._clipStencilProgram.dispose(),this._clipStencilProgram=null),this.painter.dispose(),this.context.dispose(),this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas),this._canvas=null},Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){this._state=e,this.requestRender()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stationary",{get:function(){return this._stationary},set:function(e){this._stationary!==e&&(this._stationary=e,this.requestRender())},enumerable:!0,configurable:!0}),t.prototype.requestRender=function(){this._renderRequested=!0,this._taskHandle&&this._taskHandle.resume()},t.prototype.renderFrame=function(){this._renderRequested&&(this._renderRequested=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this.processRender(this._renderParameters)),this._renderRequested||this._taskHandle.pause()},t.prototype.renderChildren=function(e){var t=this.context,i=this.children;this.beforeRenderChildren(e),e.drawPhase=u.WGLDrawPhase.MAP;for(var r=e.children?e.children:i,n=r.length,o=0;o<n;o++){(l=r[o]).attached&&l.processRender(e)}var s=t.getBoundFramebufferObject();t.bindFramebuffer(this._labelsFBO2);var a=e.stationary;if(t.setClearColor(0,0,0,a?0:1),t.clear(t.gl.COLOR_BUFFER_BIT),a){e.drawPhase=u.WGLDrawPhase.LABEL_ALPHA,e.labelFBO=this._labelsFBO1;for(o=0;o<n;o++){(l=r[o]).attached&&l.processRender(e)}}t.bindFramebuffer(s),e.labelFBO=this._labelsFBO2,e.drawPhase=u.WGLDrawPhase.LABEL;for(o=0;o<n;o++){var l;(l=r[o]).attached&&l.processRender(e)}var h=this._labelsFBO2;this._labelsFBO2=this._labelsFBO1,this._labelsFBO1=h,this.afterRenderChildren()},t.prototype.beforeRenderChildren=function(e){var t=this.context,i=this.painter,r=e.state,n=e.pixelRatio;if(i){t.enforceState();var o=r.size,a=r.rotation,l=Math.round(o[0]*n),u=Math.round(o[1]*n);if(this._boundFBO=t.getBoundFramebufferObject(),this._labelsFBO1&&this._labelsFBO1.width===l&&this._labelsFBO1.height===u||(this._labelsFBO1&&(this._labelsFBO1.dispose(),this._labelsFBO2.dispose()),this._labelsFBO1=_.createWithAttachments(t,{target:3553,pixelFormat:6408,internalFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:l,height:u},{colorTarget:0,depthStencilTarget:0}),t.bindFramebuffer(this._labelsFBO1),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),t.setClearColor(0,0,0,0),t.setClearDepth(1),t.setClearStencil(0),t.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT|t.gl.STENCIL_BUFFER_BIT),t.setDepthWriteEnabled(!1),t.bindFramebuffer(this._boundFBO),this._labelsFBO2=_.createWithAttachments(t,{target:3553,pixelFormat:6408,internalFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:l,height:u},{colorTarget:0,depthStencilTarget:0})),!(r.spatialReference&&(r.spatialReference._isWrappable?r.spatialReference._isWrappable():r.spatialReference.isWrappable)))return void(this._clipFrame=!1);var h=s.common.toRadian(a),c=Math.abs(Math.cos(h)),d=Math.abs(Math.sin(h)),f=Math.round(l*c+u*d),p=Math.round(r.worldScreenWidth);if(f<=p)return void(this._clipFrame=!1);this._clipFBO&&this._clipFBO.width===l&&this._clipFBO.height===u||(this._clipFBO=new _(t,{colorTarget:0,depthStencilTarget:3,width:l,height:u}));var v=.5*l,m=.5*u,g=1/l,y=1/u,x=.5*p*n,b=.5*(l*d+u*c),S=this._upperLeft,T=this._upperRight,w=this._lowerLeft,E=this._lowerRight;s.vec2.set(S,-x,-b),s.vec2.set(T,x,-b),s.vec2.set(w,-x,b),s.vec2.set(E,x,b),s.mat2d.identity(this._mat2),s.mat2d.translate(this._mat2,this._mat2,[v,m]),0!==a&&s.mat2d.rotate(this._mat2,this._mat2,h),s.vec2.transformMat2d(S,S,this._mat2),s.vec2.transformMat2d(T,T,this._mat2),s.vec2.transformMat2d(w,w,this._mat2),s.vec2.transformMat2d(E,E,this._mat2);var V=this._clipData;V.set([2*w[0]*g-1,2*(u-w[1])*y-1,2*E[0]*g-1,2*(u-E[1])*y-1,2*S[0]*g-1,2*(u-S[1])*y-1,2*T[0]*g-1,2*(u-T[1])*y-1]),this._clipRendererInitialized||this._initializeClipRenderer(t),this._clipVBO.setData(V),this._boundFBO=t.getBoundFramebufferObject(),t.bindFramebuffer(this._clipFBO),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),t.setClearColor(0,0,0,0),t.setClearDepth(1),t.setClearStencil(0),t.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT|t.gl.STENCIL_BUFFER_BIT),t.setDepthWriteEnabled(!1),this._clipFrame=!0}},t.prototype.afterRenderChildren=function(){var e=this.context;e.logIno(),this._clipFrame&&this._clipRendererInitialized&&(e.bindFramebuffer(this._boundFBO),this._boundFBO=null,e.bindVAO(this._clipVAO),e.bindProgram(this._clipStencilProgram),e.setDepthWriteEnabled(!1),e.setDepthTestEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(7680,7680,7681),e.setStencilWriteMask(255),e.setStencilFunction(519,1,255),e.drawElements(4,6,5123,0),e.bindVAO(),e.setColorMask(!0,!0,!0,!0),e.setBlendingEnabled(!0),e.setStencilFunction(514,1,255),this._blitRenderer.render(e,this._clipFBO.colorTexture,9728,1),e.setStencilTestEnabled(!1))},t.prototype.doRender=function(t){var i=this.context,r=t.state,n=t.pixelRatio;this._resizeCanvas(t),this.context.enforceState(),i.setViewport(0,0,n*r.size[0],n*r.size[1]),i.setDepthWriteEnabled(!0),i.setStencilWriteMask(255),i.setClearColor(0,0,0,0),i.setClearDepth(1),i.setClearStencil(0),i.clear(i.gl.COLOR_BUFFER_BIT|i.gl.DEPTH_BUFFER_BIT|i.gl.STENCIL_BUFFER_BIT),i.setDepthWriteEnabled(!1),e.prototype.doRender.call(this,t)},t.prototype.takeScreenshot=function(e,t){var i=d.screenshotSuperSampleSettings(e,this._supersampleScreenshots),r=i.framebufferWidth,o=i.framebufferHeight,s=this.context,a=e.layers,l={drawPhase:null,globalOpacity:1,stationary:!0,state:this._renderParameters.state.clone(),pixelRatio:i.pixelRatio};if(null!=e.rotation){var u=l.state.viewpoint;u.rotation=e.rotation,l.state.viewpoint=u}a.length>0&&(l.children=[],a.forEach(function(e){var i=t.find(function(t){return t.layer.id===e.id});i&&i.container&&i.attached&&l.children.push(i.container)}));var h=_.create(s,{colorTarget:0,depthStencilTarget:3,width:r,height:o}),c=s.getBoundFramebufferObject();s.bindFramebuffer(h),s.setViewport(0,0,r,o);var f=s.gl;s.setClearColor(0,0,0,0),s.setClearDepth(1),s.setClearStencil(0),s.clear(f.COLOR_BUFFER_BIT|f.DEPTH_BUFFER_BIT|f.STENCIL_BUFFER_BIT),this.renderChildren(l);var p=this._readbackScreenshot(i);s.bindFramebuffer(c);var v=this._ensureScreenshotEncodeCanvas(),m=d.encodeResult(p,e,v,{flipY:!0,premultipliedAlpha:!0});return n.resolve(m)},t.prototype._ensureScreenshotEncodeCanvas=function(){return this._screenshotEncodeCanvas||(this._screenshotEncodeCanvas=document.createElement("canvas")),this._screenshotEncodeCanvas},t.prototype._readbackScreenshot=function(e){var t=e.framebufferWidth,i=e.framebufferHeight,r=e.region,n=e.resample,o=this.context.gl;if(n){var s=d.createEmptyImageData(t,i,this._ensureScreenshotEncodeCanvas());o.readPixels(0,0,t,i,6408,5121,new Uint8Array(s.data.buffer));var a=d.createEmptyImageData(r.width,r.height,this._ensureScreenshotEncodeCanvas());return d.resampleHermite(s,a,!0,n.region.x,i-(n.region.y+n.region.height),n.region.width,n.region.height)}s=d.createEmptyImageData(r.width,r.height,this._ensureScreenshotEncodeCanvas());return o.readPixels(r.x,i-(r.y+r.height),r.width,r.height,6408,5121,new Uint8Array(s.data.buffer)),s},t.prototype._resizeCanvas=function(e){var t=this._canvas,i=t.style,r=e.state.size,n=e.pixelRatio,o=r[0],s=r[1],a=Math.round(o*n),l=Math.round(s*n);t.width===a&&t.height===l||(t.width=a,t.height=l),i.width=o+"px",i.height=s+"px"},t.prototype._initializeClipRenderer=function(e){if(this._clipRendererInitialized)return!0;this._blitRenderer=new l;var t=c.stencil.attributes,i=v.createProgram(e,c.stencil);if(!i)return!1;var r=f.createVertex(e,35040,32),n=new Uint16Array([0,1,2,2,1,3]),o=f.createIndex(e,35044,n),s=new g(e,t,{geometry:[{name:"a_pos",count:2,type:5126,offset:0,stride:8,normalized:!1,divisor:0}]},{geometry:r},o);return this._clipStencilProgram=i,this._clipVBO=r,this._clipVAO=s,this._clipRendererInitialized=!0,!0},t}(a.Container);t.Stage=y}.apply(null,r))||(e.exports=n)},2280:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(10),i(18),i(36),i(1878),i(1493),i(2281),i(2283),i(1490),i(2290),i(2291),i(2293),i(2294),i(2295),i(2296),i(2297),i(2298),i(2299),i(2303),i(1473),i(1484)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m,g,y,x,b){Object.defineProperty(t,"__esModule",{value:!0});var S=function(){function e(){this._initialized=!1}return e.prototype.registerPass=function(e,t){this._initialize();for(var i=0;i<s.WGLDrawPhase.NUM_DRAW_PHASES-2;i++){var r=1<<i;r&t&&this._passMap.set(r,e)}return this},e.prototype.getPaintPassTs=function(e){return this._initialize(),this._passMap.has(e)?[this._passMap.get(e)]:[]},e.prototype._initialize=function(){this._initialized||(this._passMap=new Map,this._initialized=!0)},e}();t.PainterOptions=S;var T=new Uint8Array(4*u.C_HITTEST_SEARCH_SIZE*u.C_HITTEST_SEARCH_SIZE),w=new Uint32Array(T.buffer),E=function(){function e(e){var t,i=this;this.context=e,this._hlPainter=new g,this._blitRenderer=new o,this._globalOpacityFBO=null,this._boundFBO=null,this.textureManager=new l,this.stencilRef=-1,this.drawImage=(t=n.vec3f32.create(),function(e,r,o,a,l,u,h,c,d,f,p){var _,v=e.getViewport(),m=v.width,g=v.height,y=i._transform,x=i._quadVertexStream;(_=p===s.WGLDrawPhase.CLIP?(e.setStencilFunction(519,i.stencilRef,255),i._transformSolidProgram):(e.setStencilFunction(514,i.stencilRef,255),i._transformTextureProgram)).setUniform1f("u_positionScale",x.positionScale),n.mat4.identity(y),n.mat4.scale(y,y,n.vec3.set(t,2*f/m,2*f/g,1)),n.mat4.translate(y,y,n.vec3.set(t,o-m/2/f,g/2/f-a,0)),n.mat4.rotateZ(y,y,h),n.mat4.translate(y,y,n.vec3.set(t,l/2,-u/2,0)),n.mat4.rotateZ(y,y,-c),n.mat4.scale(y,y,n.vec3.set(t,l/2,u/2,1)),_.setUniformMatrix4fv("u_transform",y),p!==s.WGLDrawPhase.CLIP&&(_.setUniform1f("u_texcoordScale",x.texcoordScale),e.bindTexture(r,0),_.setUniform1i("u_texture",0)),_.setUniform1f("u_opacity",d),x.draw()}),this.materialManager=new a(e),this._quadVertexStream=new h(e,[-32768,-32768,0,0,32767,-32768,32767,0,-32768,32767,0,32767,32767,32767,32767,32767],[0,1,2,1,3,2]),this._quadVertexStream.positionScale=1,this._quadVertexStream.texcoordScale=1,this._transformTextureProgram=b.createProgram(e,y.transformTexture),this._transformSolidProgram=b.createProgram(e,y.transformSolid),this._transform=n.mat4f32.create()}return e.prototype.dispose=function(){this.materialManager.dispose(),this.textureManager.dispose(),this._hlPainter&&(this._hlPainter.dispose(),this._hlPainter=null),this._blitRenderer&&(this._blitRenderer.dispose(),this._blitRenderer=null),this._globalOpacityFBO&&(this._globalOpacityFBO.dispose(),this._globalOpacityFBO=null),this._boundFBO=null,this._hittestFBO&&(this._hittestFBO.dispose(),this._hittestFBO=null),this._passes&&(this._passes.forEach(function(e){return e.dispose()}),this._passes.clear()),this._brushes&&(this._brushes.forEach(function(e){return e.forEach(function(e){return e.dispose()})}),this._brushes.clear()),this._geometryBrushes&&(this._geometryBrushes.forEach(function(e){return e.dispose()}),this._geometryBrushes.clear()),this._quadVertexStream.dispose()},e.prototype.getBrushes=function(e){if(e===s.WGLDrawPhase.MAP)throw new Error("Painter: Tried to get brush for the MAP phase; use a specific geometry type and call getMapBrush() instead.");if(!this._brushes){var t=[this.getGeometryBrush(s.WGLGeometryType.FILL),this.getGeometryBrush(s.WGLGeometryType.LINE),this.getGeometryBrush(s.WGLGeometryType.MARKER),this.getGeometryBrush(s.WGLGeometryType.TEXT)],i=new p.default,r=new c.default,n=new d.default;this._brushes=new Map,this._brushes.set(s.WGLDrawPhase.LABEL,[i]),this._brushes.set(s.WGLDrawPhase.LABEL_ALPHA,[i]),this._brushes.set(s.WGLDrawPhase.HITTEST,t),this._brushes.set(s.WGLDrawPhase.HIGHLIGHT,t),this._brushes.set(s.WGLDrawPhase.CLIP,[n]),this._brushes.set(s.WGLDrawPhase.DEBUG,[r])}if(!this._brushes.has(e))throw new Error("Painter: Tried to get brush for unknown phase: "+e);return this._brushes.get(e)},e.prototype.getGeometryBrush=function(e){if(!this._geometryBrushes){var t=new f.default,i=new _.default,r=new v.default,n=new m.default,o=new p.default;this._geometryBrushes=new Map,this._geometryBrushes.set(s.WGLGeometryType.FILL,t),this._geometryBrushes.set(s.WGLGeometryType.LINE,i),this._geometryBrushes.set(s.WGLGeometryType.MARKER,r),this._geometryBrushes.set(s.WGLGeometryType.TEXT,n),this._geometryBrushes.set(s.WGLGeometryType.LABEL,o)}return this._geometryBrushes.get(e)},e.prototype.draw=function(e,t,i,r){this._setGlobalOpacity(e,i),0==(i&(s.WGLDrawPhase.LABEL_ALPHA|s.WGLDrawPhase.LABEL))&&this._drawClippingRects(e,t);var n=this.context;n.setBlendingEnabled(!0),n.setStencilWriteMask(0),n.setBlendFunctionSeparate(1,771,1,771),this._drawPhases(e,t,i,r),this._applyGlobalOpacity(e,i),this._debugTiles(e,t)},e.prototype.setHighlightOptions=function(e){this._hlPainter.setHighlightOptions(e)},e.prototype.highlight=function(e,t){var i=this.context,r=i.getViewport();this._hlPainter.setup(i,r.width,r.height),this._hlPainter.startMaskDraw(i),this._drawClippingRects(e,t),i.setBlendingEnabled(!0),i.setStencilWriteMask(0),i.setBlendFunctionSeparate(1,771,1,771),this._drawPhases(e,t,s.WGLDrawPhase.HIGHLIGHT),this._hlPainter.draw(i)},e.prototype.hitTest=function(e,t){var i=this.context,r=u.C_HITTEST_SEARCH_SIZE,n=[0,0],o=[0,0],a=e.state;if(a.toMap(n,[0,0]),a.toMap(o,[r,r]),0===t.filter(function(e){return!(n[0]>e.bounds[2]||o[0]<e.bounds[0]||n[1]<e.bounds[1]||o[1]>e.bounds[3])}).length)return[];this._hittestFBO||(this._hittestFBO=x.create(i,{colorTarget:0,depthStencilTarget:3,width:r,height:r}));var l=i.getViewport(),h=i.getBoundFramebufferObject();i.bindFramebuffer(this._hittestFBO),i.setViewport(0,0,r,r),this._drawClippingRects(e,t);var c=i.gl;i.setClearColor(1,1,1,1),i.clear(c.COLOR_BUFFER_BIT),i.setBlendingEnabled(!1),i.setStencilWriteMask(0),this._drawPhases(e,t,s.WGLDrawPhase.HITTEST),i.setBlendingEnabled(!0),this._hittestFBO.readPixels(0,0,r,r,6408,5121,T);for(var d=r*r,f=new Set,p=0;p<d;p++){var _=w[p];4294967295!==_&&f.add(_)}i.bindFramebuffer(h),i.setViewport(l.x,l.y,l.width,l.height);var v=[];return f.forEach(function(e){v.push(e)}),v},e.prototype.startStencilBurn=function(){this.context.setStencilTestEnabled(!0),this.context.setStencilWriteMask(255),this.context.setClearStencil(0),this.context.clear(this.context.gl.STENCIL_BUFFER_BIT),this.context.setStencilOp(7680,7680,7681),this.context.setColorMask(!1,!1,!1,!1),this.context.setBlendingEnabled(!1),this._quadVertexStream.bind(),this.context.bindProgram(this._transformSolidProgram)},e.prototype.startStencilDraw=function(){this.context.setStencilWriteMask(0),this.context.setStencilOp(7680,7680,7680),this.context.setColorMask(!0,!0,!0,!0),this.context.setBlendingEnabled(!0),this.context.setBlendFunction(1,771),this._quadVertexStream.bind(),this.context.bindProgram(this._transformTextureProgram)},e.prototype.endStencilDraw=function(){this.context.setStencilTestEnabled(!1),this._quadVertexStream.unbind(),this.context.bindProgram()},e.prototype._getPaintPass=function(e){if(this._passes||(this._passes=new Map),!this._passes.has(e))try{this._passes.set(e,new e)}catch(t){throw new Error("Tried to instantiate WGLPaintPass with unknown constructor: "+e+",\n"+t)}return this._passes.get(e)},e.prototype._getPaintPasses=function(e,t){var i=this;return t.getPaintPassTs(e).map(function(e){return i._getPaintPass(e)})},e.prototype._drawPhases=function(e,t,r,n){var o=this.context;o.setStencilTestEnabled(!0);for(var a=0;a<s.WGLDrawPhase.NUM_DRAW_PHASES-2;a++){var l=1<<a;if(l&r){var u=n?this._getPaintPasses(l,n):[],h=i({},e,{drawPhase:l});u.forEach(function(t){return t.preRender(e,e.rendererInfo)});for(var c=0,d=t;c<d.length;c++)d[c].doRender(h);u.reverse().forEach(function(t){return t.postRender(e,e.rendererInfo)})}}o.setStencilTestEnabled(!1)},e.prototype._debugTiles=function(e,t){r("esri-feature-tiles-debug")&&this._drawPhases(e,t,s.WGLDrawPhase.DEBUG)},e.prototype._drawClippingRects=function(e,t){if(0!==t.length){var i=this.context;i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(7680,7680,7681),i.setClearStencil(0),i.clear(i.gl.STENCIL_BUFFER_BIT),i.setStencilWriteMask(255);for(var r=0,n=t.length;r<t.length;r++,n--){var o=t[r];o.attached&&(o.stencilRef=n)}this._drawPhases(e,t,s.WGLDrawPhase.CLIP),i.setColorMask(!0,!0,!0,!0)}},e.prototype._setGlobalOpacity=function(e,t){if(t===s.WGLDrawPhase.MAP&&1!==e.globalOpacity){var i=e.context,r=e.pixelRatio,n=e.state.size,o=n[0],a=n[1],l=Math.round(o*r),u=Math.round(a*r);null!==this._globalOpacityFBO&&this._globalOpacityFBO.width===l&&this._globalOpacityFBO.height===u||(null!==this._globalOpacityFBO&&this._globalOpacityFBO.dispose(),this._globalOpacityFBO=x.create(i,{colorTarget:0,depthStencilTarget:3,width:l,height:u})),this._boundFBO=i.getBoundFramebufferObject(),i.bindFramebuffer(this._globalOpacityFBO),i.setDepthWriteEnabled(!0),i.setStencilWriteMask(255),i.setClearColor(0,0,0,0),i.setClearDepth(1),i.setClearStencil(0),i.clear(i.gl.COLOR_BUFFER_BIT|i.gl.DEPTH_BUFFER_BIT|i.gl.STENCIL_BUFFER_BIT),i.setDepthWriteEnabled(!1)}},e.prototype._applyGlobalOpacity=function(e,t){if(t===s.WGLDrawPhase.MAP&&1!==e.globalOpacity){var i=e.context;i.bindFramebuffer(this._boundFBO);var r=this._globalOpacityFBO.colorTexture;this._blitRenderer.render(i,r,9728,e.globalOpacity),this._boundFBO=null}},e}();t.default=E}.apply(null,r))||(e.exports=n)},2281:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1493),i(1993),i(1807),i(1484)],void 0===(n=function(e,t,i,r,n,o){return function(){function e(e){this._programByKey=new Map,this._programCache=new o.ProgramCache(e)}return e.prototype.dispose=function(){this._programCache&&this._programCache.dispose()},e.prototype.getProgram=function(e,t){if(e|=t===i.WGLDrawPhase.HITTEST?8:0,e|=t===i.WGLDrawPhase.HIGHLIGHT?16:0,this._programByKey[e])return this._programByKey[e];var o=r.getMaterialVariations(e),s=null;switch(o.geometryType){case i.WGLGeometryType.MARKER:s=this._programCache.getProgram(n.icon,o.programOptions);break;case i.WGLGeometryType.TEXT:s=this._programCache.getProgram(n.text,o.programOptions);break;case i.WGLGeometryType.LABEL:s=this._programCache.getProgram(n.label,o.programOptions);break;case i.WGLGeometryType.FILL:s=this._programCache.getProgram(n.fill,o.programOptions);break;case i.WGLGeometryType.LINE:s=this._programCache.getProgram(n.line,o.programOptions)}return s&&(this._programByKey[e]=s),s},e}()}.apply(null,r))||(e.exports=n)},2283:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(141),i(92),i(55),i(193),i(9),i(7),i(6),i(2284),i(1808),i(2286),i(2287),i(2288),i(1911),i(2289),i(1490),i(1513)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d,f,p,_,v,m){var g="arial-unicode-ms-regular",y=a.getLogger("esri.views.2d.engine.webgl.TextureManager");return function(){function e(){this._invalidFontsMap=new Map,this._sdfConverter=new f.default(126),this._spriteMosaic=new _(1024,1024,250),this._glyphSource=new d(n.fontsUrl+"/{fontstack}/{range}.pbf"),this._glyphMosaic=new c(1024,1024,this._glyphSource)}return Object.defineProperty(e.prototype,"sprites",{get:function(){return this._spriteMosaic},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glyphs",{get:function(){return this._glyphMosaic},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizationCanvas=null},e.prototype.rasterizeItem=function(e,t){return void 0===t&&(t=null),e?e.type&&-1!==e.type.toLowerCase().indexOf("3d")?(y.error(new s("mapview-invalid-type","MapView does not support 3d symbol type: "+e.type,e)),l.resolve({glyphMosaicItems:[],spriteMosaicItem:null})):!e.type||"text"!==e.type&&"esriTS"!==e.type?o.safeCast(this._rasterizeSpriteSymbol(e)).then(function(e){return{spriteMosaicItem:e}}):this._rasterizeTextSymbol(e,t).then(function(e){return{glyphMosaicItems:e}}):(y.error(new s("mapview-null-resource","Unable to rasterize null resource")),l.resolve(null))},e.prototype.bindSpritePage=function(e,t,i,r){r||(r=9729),this._spriteMosaic.bind(e,r,t,i)},e.prototype.bindGlyphsPage=function(e,t,i){this._glyphMosaic.bind(e,9729,t,i)},e.prototype._rasterizeTextSymbol=function(e,t){var i=this,r=h.getFullyQualifiedFontName(e.font),n=this._invalidFontsMap.has(r);return this._glyphMosaic.getGlyphItems(n?g:r,t).catch(function(e){return y.error(new s("mapview-invalid-resource","Couldn't find font "+r+". Falling back to Arial Unicode MS Regular")),i._invalidFontsMap.set(r,!0),i._glyphMosaic.getGlyphItems(g,t)})},e.prototype._rasterizeSpriteSymbol=function(e){return i(this,void 0,void 0,function(){var t,i,n,o,s,a,l;return r(this,function(r){return(h=u=e)&&(v.isFillSymbol(u)||v.isLineSymbol(u))&&"style"in u&&("solid"===u.style||"esriSFSSolid"===h.style||"esriSLSSolid"===h.style||"none"===u.style||"esriSFSNull"===h.style||"esriSLSNull"===h.style)?[2,null]:(t=function(e){if(e.type){switch(v.normalizeSymbolType(e.type)){case"simple-marker":return e.path?"simple-marker"+e.style+e.path:"simple-marker"+e.style;case"simple-line":return"simple-line"+e.style+e.cap;case"simple-fill":return"simple-fill"+e.style}if(v.isPictureSymbol(e))return e.url?e.url:e.imageData+""+e.width+e.height}return JSON.stringify(e)}(e),this._spriteMosaic.has(t)?[2,this._spriteMosaic.getSpriteItem(t)]:"simple-marker"!==(c=e).type&&"esriSMS"!==c.type||!c.path?(d=e).url||d.imageData?[2,this._handleImage(e,t)]:(i=this._rasterizeResource(e),n=i.size,o=i.anchor,s=i.image,a=i.sdf,l=i.simplePattern,[2,this._addItemToMosaic(t,n,o,s,!v.isMarkerSymbol(e),a,l)]):[2,this._handleSVG(e,t)]);var u,h,c,d})})},e.prototype._handleSVG=function(e,t){return i(this,void 0,void 0,function(){var i,n;return r(this,function(r){switch(r.label){case 0:return i=[126,126],[4,this._sdfConverter.draw(e.path)];case 1:return n=r.sent(),[2,this._addItemToMosaic(t,i,[0,0],new Uint32Array(n.buffer),!1,!0,!0)]}})})},e.prototype._handleImage=function(e,t){return i(this,void 0,void 0,function(){var i,n,o,a,l,u,h;return r(this,function(r){switch(r.label){case 0:i=e.imageData?"data:"+e.contentType+";base64,"+e.imageData:e.url,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,m.requestImage(i)];case 2:return n=r.sent(),o=this._rasterizeResource(n),a=o.size,l=o.anchor,u=o.sdf,h=o.image,[2,this._addItemToMosaic(t,a,l,h,!v.isMarkerSymbol(e),u,!1)];case 3:return r.sent(),[2,new s("mapview-invalid-resoure","Could not fetch requested resource at "+i)];case 4:return[2]}})})},e.prototype._rasterizeResource=function(e){if(e instanceof HTMLImageElement){this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));var t=e;this._rasterizationCanvas.width=t.width,this._rasterizationCanvas.height=t.height;var i=this._rasterizationCanvas.getContext("2d");i.drawImage(t,0,0,t.width,t.height);for(var r=i.getImageData(0,0,t.width,t.height),n=new Uint8Array(r.data),o=void 0,s=0;s<n.length;s+=4)o=n[s+3]/255,n[s]=n[s]*o,n[s+1]=n[s+1]*o,n[s+2]=n[s+2]*o;var a=t.width,l=t.height,u=n;if(512<=a||512<=l){var h=t.width/t.height;1<h?(a=512,l=Math.round(512/h)):(l=512,a=Math.round(512*h)),u=new Uint8Array(4*a*l),v.resampleHermite(n,t.width,t.height,new Uint8ClampedArray(u.buffer),a,l,!1)}return{size:[a,l],anchor:[0,0],image:new Uint32Array(u.buffer),sdf:!1,simplePattern:!1}}return this._rasterizeJSON(e)},e.prototype._addItemToMosaic=function(e,t,i,r,n,o,s){return this._spriteMosaic.addSpriteItem(e,t,i,r,n,o,s)},e.prototype._rasterizeJSON=function(e){if(this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas")),"simple-fill"===e.type||"esriSFS"===e.type){var t=u.SymbolHelper.rasterizeSimpleFill(this._rasterizationCanvas,e.style),i=t[0];return{size:[t[1],t[2]],anchor:[0,0],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!0}}if("simple-line"===e.type||"esriSLS"===e.type){var r=u.SymbolHelper.rasterizeSimpleLine(this._rasterizationCanvas,e.style,e.cap);return i=r[0],{size:[r[1],r[2]],anchor:[0,0],image:new Uint32Array(i.buffer),sdf:!0,simplePattern:!0}}var n;if("simple-marker"===e.type||"esriSMS"===e.type?(n=u.CIMSymbolHelper.fromSimpleMarker(e),1):(n=e,p.SDFHelper.checkSDF(n))){var o=(new p.SDFHelper).buildSDF(n);return i=o[0],{size:[o[1],o[2]],anchor:[0,0],image:new Uint32Array(i.buffer),sdf:!0,simplePattern:!0}}var s=u.CIMSymbolHelper.rasterize(this._rasterizationCanvas,n);return i=s[0],{size:[s[1],s[2]],anchor:[s[3],s[4]],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!1}},e}()}.apply(null,r))||(e.exports=n)},2284:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(7),i(2285),i(1911),i(1523)],void 0===(n=function(e,t,i,r,n,o){Object.defineProperty(t,"__esModule",{value:!0});var s=i.getLogger("esri/views/2d/engine/webgl/CIMSymbolHelper"),a=function(){function e(){}return e.getEnvelope=function(e){if("CIMPointSymbol"!==e.type)return null;var t=new r.EnvDrawHelper;return t.drawSymbol(e,{type:"point",x:0,y:0}),t.envelope()},e.rasterize=function(e,t){var i=this.getEnvelope(t);if(!i||i.width<=0||i.height<=0)return[null,0,0,0,0];var n=96/72,o=(i.x+.5*i.width)*n,s=-(i.y+.5*i.height)*n;e.width=i.width*n+2,e.height=i.height*n+2;var a=e.getContext("2d"),l=r.Transformation.createScale(n,-n);l.translate(.5*e.width-o,.5*e.height-s),new r.CanvasDrawHelper(a,l).drawSymbol(t,{type:"point",x:0,y:0});for(var u,h=a.getImageData(0,0,e.width,e.height),c=new Uint8Array(h.data),d=0;d<c.length;d+=4)u=c[d+3]/255,c[d]=c[d]*u,c[d+1]=c[d+1]*u,c[d+2]=c[d+2]*u;return[c,e.width,e.height,o/e.width,s/e.height]},e.fromSimpleMarker=function(e){var t,i,r,n=50,s=e.style;if("circle"===s||"esriSMSCircle"===s){var a=Math.acos(.995),l=Math.ceil(o.C_PI/a/4);0===l&&(l=1),a=o.C_PI_BY_2/l,l*=4;var u=[];u.push([n,0]);for(var h=1;h<l;h++)u.push([n*Math.cos(h*a),-n*Math.sin(h*a)]);u.push([n,0]),t={rings:[u]},i={xmin:-n,ymin:-n,xmax:n,ymax:n}}else if("cross"===s||"esriSMSCross"===s)t={rings:[[[c=0,n],[c,c],[n,c],[n,-c],[c,-c],[c,-n],[-c,-n],[-c,-c],[-n,-c],[-n,c],[-c,c],[-c,n],[c,n]]]},i={xmin:-n,ymin:-n,xmax:n,ymax:n};else if("diamond"===s||"esriSMSDiamond"===s)t={rings:[[[-n,0],[0,n],[n,0],[0,-n],[-n,0]]]},i={xmin:-n,ymin:-n,xmax:n,ymax:n};else if("square"===s||"esriSMSSquare"===s)t={rings:[[[-n,-n],[-n,n],[n,n],[n,-n],[-n,-n]]]},i={xmin:-n,ymin:-n,xmax:n,ymax:n};else if("x"===s||"esriSMSX"===s){var c;t={rings:[[[0,c=0],[n-c,n],[n,n-c],[c,0],[n,c-n],[n-c,-n],[0,-c],[c-n,-n],[-n,c-n],[-c,0],[-n,n-c],[c-n,n],[0,c]]]},i={xmin:-n,ymin:-n,xmax:n,ymax:n}}else if("triangle"===s||"esriSMSTriangle"===s){var d=57.735026918962575,f=-d,p=2/3*100,_=p-100;t={rings:[[[f,_],[0,p],[d,_],[f,_]]]},i={xmin:f,ymin:_,xmax:d,ymax:p}}if(t&&i){var v=[{type:"CIMSolidFill",enable:!0,color:e.color}];e.outline&&v.push({type:"CIMSolidStroke",enable:!0,width:e.outline.width,color:e.outline.color});var m={type:"CIMPolygonSymbol",symbolLayers:v};r={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:e.angle,size:e.size,offsetX:e.xoffset,offsetY:e.yoffset,frame:i,markerGraphics:[{type:"CIMMarkerGraphic",geometry:t,symbol:m}]}]}}return r},e}();t.CIMSymbolHelper=a;var l=function(){function e(){}return e.rasterizeSimpleFill=function(e,t){"solid"!==t&&"none"!==t&&"esriSFSSolid"!==t&&"esriSFSNull"!==t||console.error("Unexpected: style does not require rasterization"),e.width=8,e.height=8;var i=e.getContext("2d");i.strokeStyle="#FFFFFF",i.beginPath(),"vertical"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSVertical"!==t||(i.moveTo(0,0),i.lineTo(0,8)),"horizontal"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSHorizontal"!==t||(i.moveTo(0,0),i.lineTo(8,0)),"forward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSDiagonalCross"!==t&&"esriSFSForwardDiagonal"!==t||(i.moveTo(0,0),i.lineTo(8,8)),"backward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSBackwardDiagonal"!==t&&"esriSFSDiagonalCross"!==t||(i.moveTo(8,0),i.lineTo(0,8)),i.stroke();for(var r,n=i.getImageData(0,0,e.width,e.height),o=new Uint8Array(n.data),s=0;s<o.length;s+=4)r=o[s+3]/255,o[s]=o[s]*r,o[s+1]=o[s+1]*r,o[s+2]=o[s+2]*r;return[o,e.width,e.height]},e.rasterizeSimpleLine=function(e,t,i){var r;switch(i){case"butt":r="Butt";break;case"square":r="Square";break;default:r="Round"}var n,o="Butt"===r;switch(t){case"dash":case"esriSLSDash":n=o?[4,3]:[3,4];break;case"dash-dot":case"esriSLSDashDot":n=o?[4,3,1,3]:[3,4,0,4];break;case"dot":case"esriSLSDot":n=o?[1,3]:[0,4];break;case"long-dash":case"esriSLSLongDash":n=o?[8,3]:[7,4];break;case"long-dash-dot":case"esriSLSLongDashDot":n=o?[8,3,1,3]:[7,4,0,4];break;case"long-dash-dot-dot":case"esriSLSDashDotDot":n=o?[8,3,1,3,1,3]:[7,4,0,4,0,4];break;case"short-dash":case"esriSLSShortDash":n=o?[4,1]:[3,2];break;case"short-dash-dot":case"esriSLSShortDashDot":n=o?[4,1,1,1]:[3,2,0,2];break;case"short-dash-dot-dot":case"esriSLSShortDashDotDot":n=o?[4,1,1,1,1,1]:[3,2,0,2,0,2];break;case"short-dot":case"esriSLSShortDot":n=o?[1,1]:[0,2];break;case"solid":case"esriSLSSolid":case"none":s.error("Unexpected: style does not require rasterization"),n=[0,0];break;default:s.error("Tried to rasterize SLS, but found an unexpected style: "+t+"!"),n=[0,0]}return this.rasterizeDash(e,n,r)},e.rasterizeDash=function(e,t,i){for(var r="Butt"===i,o="Square"===i,s=!r&&!o,a=0,l=0,u=t;l<u.length;l++)a+=u[l];for(var h=15*a,c=31*h,d=new Float32Array(c),f=s?225:15,p=0;p<c;++p)d[p]=f;for(var _=0,v=0,m=!0,g=0,y=t;g<y.length;g++){_=v,v+=15*y[g];for(var x=_;x<v;){for(var b=0;b<31;){p=b*h+x;var S=s?(b-15)*(b-15):Math.abs(b-15);d[p]=m?r?Math.max(Math.max(_+7.5-x,S),Math.max(x-v+7.5,S)):S:s?Math.min((x-_)*(x-_)+S,(x-v)*(x-v)+S):o?Math.min(Math.max(x-_,S),Math.max(v-x,S)):Math.min(Math.max(x-_+7.5,S),Math.max(v+7.5-x,S)),b++}x++}m=!m}var T=d.length,w=new Uint8Array(4*T);for(p=0;p<T;++p){var E=(s?Math.sqrt(d[p]):d[p])/15;n.packFloat(E,w,4*p)}return[w,h,31]},e}();t.SymbolHelper=l}.apply(null,r))||(e.exports=n)},2285:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(0),i(1647),i(1640)],void 0===(n=function(e,t,i,r,n,o){Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e){this._t=e}return e.createIdentity=function(){return new e([1,0,0,0,1,0])},e.prototype.clone=function(){return new e(this._t.slice())},e.prototype.transform=function(e){var t=this._t;return[t[0]*e[0]+t[1]*e[1]+t[2],t[3]*e[0]+t[4]*e[1]+t[5]]},e.createScale=function(t,i){return new e([t,0,0,0,i,0])},e.prototype.scale=function(e,t){var i=this._t;return i[0]*=e,i[1]*=e,i[2]*=e,i[3]*=t,i[4]*=t,i[5]*=t,this},e.prototype.scaleRatio=function(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])},e.createTranslate=function(t,i){return new e([0,0,t,0,0,i])},e.prototype.translate=function(e,t){var i=this._t;return i[2]+=e,i[5]+=t,this},e.createRotate=function(t){var i=Math.cos(t),r=Math.sin(t);return new e([i,-r,0,r,i,0])},e.prototype.rotate=function(t){return this.multiply(e.createRotate(t))},e.prototype.multiply=function(e){var t=this._t,i=e._t,r=t[0]*i[0]+t[3]*i[1],n=t[1]*i[0]+t[4]*i[1],o=t[2]*i[0]+t[5]*i[1]+i[2],s=t[0]*i[3]+t[3]*i[4],a=t[1]*i[3]+t[4]*i[4],l=t[2]*i[3]+t[5]*i[4]+i[5];return t[0]=r,t[1]=n,t[2]=o,t[3]=s,t[4]=a,t[5]=l,this},e}();t.Transformation=s;var a=function(){function e(e){this._transfos=[],this._sizeTransfos=[],this._transfos.push(e||s.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}return e.prototype.transformPt=function(e){return this._transfos[this._transfos.length-1].transform(e)},e.prototype.transformSize=function(e){return e*this._sizeTransfos[this._sizeTransfos.length-1]},e.prototype.back=function(){return this._transfos[this._transfos.length-1]},e.prototype.push=function(e){var t=e.scaleRatio();e.multiply(this.back()),this._transfos.push(e),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*t)},e.prototype.pop=function(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)},e.prototype.drawSolidFill=function(e,t){},e.prototype.drawSolidStroke=function(e,t,i){},e.prototype.drawSymbol=function(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(e,t)}},e.prototype.drawMultiLayerSymbol=function(e,t){if(e){var i=e.symbolLayers;if(i)for(var r=i.length;r--;){var n=i[r];if(n&&n.enable)switch(n.type){case"CIMSolidFill":this.drawSolidFill(t,n.color);break;case"CIMSolidStroke":this.drawSolidStroke(t,n.color,n.width);break;case"CIMVectorMarker":this.drawVectorMarker(n,t)}}}},e.prototype.drawVectorMarker=function(e,t){if(e){var i=e.markerGraphics;if(i){var r=e.size,o=e.frame,a=o?o.ymax-o.ymin:0,l=r&&a?r/a:1,u=s.createIdentity();o&&u.translate(.5*-(o.xmax+o.xmin),.5*-(o.ymax+o.ymin));var h=e.anchorPt;if(h){var c=h.x,d=h.y;"relative"===e.anchorPtUnits&&o&&(c*=(o.xmax-o.xmin)*l,d*=r),u.translate(-c,-d)}1!==l&&u.scale(l,l),e.rotation&&u.rotate(e.rotation*n.C_DEG_TO_RAD),u.translate(e.offsetX||0,e.offsetY||0),u.translate(t.x,t.y),this.push(u);for(var f=0,p=i;f<p.length;f++){var _=p[f];_&&this.drawSymbol(_.symbol,_.geometry)}this.pop()}}},e}(),l=function(e){function t(){var t=e.call(this)||this;return t._xmin=t._ymin=1/0,t._xmax=t._ymax=-1/0,t}return i(t,e),t.prototype.envelope=function(){return new o(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)},t.prototype._merge=function(e,t){e[0]-t<this._xmin&&(this._xmin=e[0]-t),e[0]+t>this._xmax&&(this._xmax=e[0]+t),e[1]-t<this._ymin&&(this._ymin=e[1]-t),e[1]+t>this._ymax&&(this._ymax=e[1]+t)},t.prototype.drawSolidFill=function(e,t){for(var i=0,r=e.rings;i<r.length;i++){var n=r[i],o=n?n.length:0;if(2<o){this._merge(this.transformPt(n[0]),0);for(var s=1;s<o;++s)this._merge(this.transformPt(n[s]),0)}}},t.prototype.drawSolidStroke=function(e,t,i){for(var r=.5*this.transformSize(i),n=0,o=e.rings||e.paths;n<o.length;n++){var s=o[n],a=s?s.length:0;if(1<a){this._merge(this.transformPt(s[0]),r);for(var l=1;l<a;++l)this._merge(this.transformPt(s[l]),r)}}},t}(t.CIMSymbolDrawHelper=a);t.EnvDrawHelper=l;var u=function(e){function t(t,i){var r=e.call(this,i)||this;return r._ctx=t,r}return i(t,e),t.prototype.drawSolidFill=function(e,t){var i=this._ctx;i.fillStyle="rgba("+Math.round(t[0])+","+Math.round(t[1])+","+Math.round(t[2])+","+t[3]/255+")",i.beginPath();for(var r=0,n=e.rings;r<n.length;r++){var o=n[r],s=o?o.length:0;if(2<s){var a=this.transformPt(o[0]);i.moveTo(a[0],a[1]);for(var l=1;l<s;++l)a=this.transformPt(o[l]),i.lineTo(a[0],a[1]);i.closePath()}}i.fill("evenodd")},t.prototype.drawSolidStroke=function(e,t,i){var r=this._ctx;r.strokeStyle="rgba("+Math.round(t[0])+","+Math.round(t[1])+","+Math.round(t[2])+","+t[3]/255+")",r.lineWidth=this.transformSize(i)+.5,r.beginPath();for(var n=!!e.rings,o=0,s=e.rings||e.paths;o<s.length;o++){var a=s[o],l=a?a.length:0;if(1<l){var u=this.transformPt(a[0]);r.moveTo(u[0],u[1]);for(var h=1;h<l;++h)u=this.transformPt(a[h]),r.lineTo(u[0],u[1]);n&&r.closePath()}}r.stroke()},t}(a);t.CanvasDrawHelper=u}.apply(null,r))||(e.exports=n)},2286:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(18),i(6),i(1640),i(1995),i(1471)],void 0===(n=function(e,t,i,r,n,o,s){var a;return i("stable-symbol-rendering")&&(a=new Set),function(){function e(e,t,r){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphIndex={},this._textures=[],this._rangePromises=new Map,!a&&i("stable-symbol-rendering")&&(a=new Set),this.width=e,this.height=t,this._glyphSource=r,this._binPack=new o(e-4,t-4),this._glyphData.push(new Uint8Array(e*t)),this._dirties.push(!0),this._textures.push(void 0),this._addDecorationGlyph()}return e.prototype.getGlyphItems=function(e,t){for(var n=this,o=[],s=this._glyphSource,l=new Set,u=0,h=t;u<h.length;u++){var c=h[u],d=Math.floor(c*(1/256));l.add(d)}var f=[];return l.forEach(function(t){if(t<=256){var i=e+t;if(n._rangePromises.has(i))f.push(n._rangePromises.get(i));else{var r=s.getRange(e,t).then(function(){n._rangePromises.delete(i)}).catch(function(){throw n._rangePromises.delete(i),Error("Unable to query resource")});n._rangePromises.set(i,r),f.push(r)}}}),r.all(f).then(function(r){var u,h=n._glyphIndex[e];if(h||(h={},n._glyphIndex[e]=h),i("stable-symbol-rendering")){a.clear();for(var c=0,d=t;c<d.length;c++){var f=d[c];a.add(f)}var p=[];l.forEach(function(e){p.push(e)}),p.sort(),u=[];for(var _=0,v=p;_<v.length;_++)for(var m=v[_],g=0;g<256;++g)u.push(256*m+g)}else u=t;for(var y=0,x=u;y<x.length;y++){var b=h[f=x[y]];if(b)i("stable-symbol-rendering")&&!a.has(f)||(o[f]={rect:b.rect,metrics:b.metrics,page:b.page});else{var S=s.getGlyph(e,f);if(S&&S.metrics){var T=n._recordGlyph(S,f);h[f]={rect:T,metrics:S.metrics,tileIDs:null,page:n._currentPage},i("stable-symbol-rendering")&&!a.has(f)||(o[f]={rect:T,metrics:S.metrics,page:n._currentPage}),n._dirties[n._currentPage]=!0}}}return o})},e.prototype._recordGlyph=function(e,t){var i,r=e.metrics;if(0===r.width)i=new n(0,0,0,0);else{var s=r.width+6,a=r.height+6,l=s%4?4-s%4:4,u=a%4?4-a%4:4;1===l&&(l=5),1===u&&(u=5),(i=this._binPack.allocate(s+l,a+u)).isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new o(this.width-4,this.height-4),i=this._binPack.allocate(s+l,a+u));var h=this._glyphData[this._currentPage],c=e.bitmap,d=void 0,f=void 0;if(c)for(var p=0;p<a;p++){d=s*p,f=this.width*(i.y+p+1)+i.x;for(var _=0;_<s;_++)h[f+_+1]=c[d+_]}}return i},e.prototype._addDecorationGlyph=function(){for(var e=[117,149,181,207,207,181,149,117],t=[],i=0;i<e.length;i++)for(var r=e[i],n=0;n<11;n++)t.push(r);var o={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(t)};this._recordGlyph(o,0)},e.prototype.bind=function(e,t,i,r){this._textures[i]||(this._textures[i]=new s(e,{pixelFormat:6406,dataType:5121,width:this.width,height:this.height},new Uint8Array(this.width*this.height)));var n=this._textures[i];n.setSamplingMode(t),this._dirties[i]&&n.setData(this._glyphData[i]),e.bindTexture(n,r),this._dirties[i]=!1},e.prototype.dispose=function(){this._binPack=null;for(var e=0,t=this._textures;e<t.length;e++){var i=t[e];i&&i.dispose()}this._textures.length=0,this._glyphData.length=0},e}()}.apply(null,r))||(e.exports=n)},2287:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(29),i(476),i(6)],void 0===(n=function(e,t,i,r,n){var o=function(){function e(e){for(this._metrics=[],this._bitmaps=[];e.next();)switch(e.tag()){case 1:for(var t=e.getMessage();t.next();)switch(t.tag()){case 3:for(var i=t.getMessage(),r=void 0,n=void 0,o=void 0,s=void 0,a=void 0,l=void 0,u=void 0;i.next();)switch(i.tag()){case 1:r=i.getUInt32();break;case 2:n=i.getBytes();break;case 3:o=i.getUInt32();break;case 4:s=i.getUInt32();break;case 5:a=i.getSInt32();break;case 6:l=i.getSInt32();break;case 7:u=i.getUInt32();break;default:i.skip()}r&&(this._metrics[r]={width:o,height:s,left:a,top:l,advance:u},this._bitmaps[r]=n);break;default:t.skip()}break;default:e.skip()}}return e.prototype.getMetrics=function(e){return this._metrics[e]},e.prototype.getBitmap=function(e){return this._bitmaps[e]},e}(),s=function(){function e(){this._ranges=[]}return e.prototype.getRange=function(e){return this._ranges[e]},e.prototype.addRange=function(e,t){this._ranges[e]=t},e}();return function(){function e(e){this._glyphInfo={},this._baseURL=e}return e.prototype.getRange=function(e,t){var s=this._getFontStack(e);if(s.getRange(t))return n.resolve();var a=256*t,l=a+255,u=this._baseURL.replace("{fontstack}",e).replace("{range}",a+"-"+l);return i(u,{responseType:"array-buffer"}).then(function(e){s.addRange(t,new o(new r(new Uint8Array(e.data),new DataView(e.data))))})},e.prototype.getGlyph=function(e,t){var i=this._getFontStack(e);if(i){var r=Math.floor(t/256);if(!(256<r)){var n=i.getRange(r);if(n)return{metrics:n.getMetrics(t),bitmap:n.getBitmap(t)}}}},e.prototype._getFontStack=function(e){var t=this._glyphInfo[e];return t||(t=this._glyphInfo[e]=new s),t},e}()}.apply(null,r))||(e.exports=n)},2288:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(6),i(1911)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=1e20,o=function(){function e(e){this.size=e,this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=e,this.context=this.canvas.getContext("2d"),this._gridOuter=new Float64Array(e*e),this._gridInner=new Float64Array(e*e),this._f=new Float64Array(e),this._d=new Float64Array(e),this._z=new Float64Array(e+1),this._v=new Int16Array(e);var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("style","position: absolute;"),t.setAttribute("width","0"),t.setAttribute("height","0"),document.body.appendChild(t),this._svg=t}return e.prototype.draw=function(e,t){var o=this;void 0===t&&(t=31);var s=this._createSVGString(e);return i.create(function(e){var i=new Image;i.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(s),i.onload=function(){o.context.clearRect(0,0,o.size,o.size),o.context.drawImage(i,0,0,o.size,o.size);for(var s=o.context.getImageData(0,0,o.size,o.size),a=new Uint8Array(o.size*o.size*4),l=0;l<o.size*o.size;l++){var u=s.data[4*l+3]/255;o._gridOuter[l]=1===u?0:0===u?n:Math.pow(Math.max(0,.5-u),2),o._gridInner[l]=1===u?n:0===u?0:Math.pow(Math.max(0,u-.5),2)}for(o._edt(o._gridOuter,o.size,o.size),o._edt(o._gridInner,o.size,o.size),l=0;l<o.size*o.size;l++){var h=.5-(o._gridOuter[l]-o._gridInner[l])/(2*t);r.packFloat(h,a,4*l)}e(a)}})},e.prototype._createSVGString=function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d",e),this._svg.appendChild(t);var i,r,n,o,s=t.getBBox(),a=s.width/s.height,l=this.size/2;if(1<a){r=i=l/s.width;var u=l*(1/a);n=this.size/4,o=l-u/2}else i=r=l/s.height,n=l-l*a/2,o=this.size/4;var h=-s.x*i+n,c=-s.y*r+o;t.setAttribute("style","transform: matrix("+i+", 0, 0, "+r+", "+h+", "+c+")");var d='<svg style="fill:red;" height="'+this.size+'" width="'+this.size+'" xmlns="http://www.w3.org/2000/svg">'+this._svg.innerHTML+"</svg>";return this._svg.removeChild(t),d},e.prototype._edt=function(e,t,i){for(var r=this._f,n=this._d,o=this._v,s=this._z,a=0;a<t;a++){for(var l=0;l<i;l++)r[l]=e[l*t+a];for(this._edt1d(r,n,o,s,i),l=0;l<i;l++)e[l*t+a]=n[l]}for(l=0;l<i;l++){for(a=0;a<t;a++)r[a]=e[l*t+a];for(this._edt1d(r,n,o,s,t),a=0;a<t;a++)e[l*t+a]=Math.sqrt(n[a])}},e.prototype._edt1d=function(e,t,i,r,o){r[i[0]=0]=-n,r[1]=+n;for(var s=1,a=0;s<o;s++){for(var l=(e[s]+s*s-(e[i[a]]+i[a]*i[a]))/(2*s-2*i[a]);l<=r[a];)a--,l=(e[s]+s*s-(e[i[a]]+i[a]*i[a]))/(2*s-2*i[a]);i[++a]=s,r[a]=l,r[a+1]=+n}for(s=0,a=0;s<o;s++){for(;r[a+1]<s;)a++;t[s]=(s-i[a])*(s-i[a])+e[i[a]]}},e}();t.default=o}.apply(null,r))||(e.exports=n)},2289:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1647),i(1640),i(1995),i(1471)],void 0===(n=function(e,t,i,r,n,o){return function(){function e(e,t,i){void 0===i&&(i=0),this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects=new Map,this._spriteCopyQueue=[],this.pixelRatio=1,(e<=0||t<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=e,this._pageHeight=t,0<i&&(this._maxItemSize=i),this.pixelRatio=1|window.devicePixelRatio,this._binPack=new n(this._pageWidth,this._pageHeight);var r=Math.floor(this._pageWidth),o=Math.floor(this._pageHeight);this._mosaicsData[0]=new Uint32Array(r*o),this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}return e.prototype.getWidth=function(e){return e>=this._size.length?-1:this._size[e][0]},e.prototype.getHeight=function(e){return e>=this._size.length?-1:this._size[e][1]},e.prototype.getPage=function(e){return e<this._textures.length?this._textures[e]:null},e.prototype.has=function(e){return this._mosaicRects.has(e)},Object.defineProperty(e.prototype,"itemCount",{get:function(){return this._mosaicRects.size},enumerable:!0,configurable:!0}),e.prototype.getSpriteItem=function(e){return this._mosaicRects.get(e)},e.prototype.addSpriteItem=function(e,t,i,r,n,o,s){if(this._mosaicRects.has(e))return this._mosaicRects.get(e);var a=this._allocateImage(t[0],t[1]),l=a[0],u=a[1],h=a[2];if(l.width<=0||l.height<=0)return null;var c={rect:l,width:t[0],height:t[1],anchorX:i[0],anchorY:i[1],sdf:o,simplePattern:s,pixelRatio:1,page:u};return this._mosaicRects.set(e,c),this._copy({rect:l,spriteSize:t,spriteData:r,page:u,pageSize:h,repeat:n,sdf:o}),c},e.prototype.hasItemsToProcess=function(){return 0!==this._spriteCopyQueue.length},e.prototype.processNextItem=function(){var e=this._spriteCopyQueue.pop();e&&this._copy(e)},e.prototype.getSpriteItems=function(e){for(var t={},i=0,r=e;i<r.length;i++){var n=r[i];t[n]=this.getSpriteItem(n)}return t},e.prototype.getMosaicItemPosition=function(e,t){var i=this.getSpriteItem(e),r=i&&i.rect;if(!r)return null;r.width=i.width,r.height=i.height;var n=i.width,o=i.height;return{size:[i.width,i.height],tl:[(r.x+1)/this._size[i.page][0],(r.y+1)/this._size[i.page][1]],br:[(r.x+1+n)/this._size[i.page][0],(r.y+1+o)/this._size[i.page][1]],page:i.page}},e.prototype.bind=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0),this._textures[i]||(this._textures[i]=new o(e,{pixelFormat:6408,dataType:5121,width:this._size[i][0],height:this._size[i][1]},new Uint8Array(this._mosaicsData[i].buffer)));var n=this._textures[i];n.setSamplingMode(t),this._dirties[i]&&(n.setData(new Uint8Array(this._mosaicsData[i].buffer)),n.generateMipmap()),e.bindTexture(n,r),this._dirties[i]=!1},e._copyBits=function(e,t,i,r,n,o,s,a,l,u,h){var c=r*t+i,d=a*o+s;if(h){d-=o;for(var f=-1;f<=u;c=((++f+u)%u+r)*t+i,d+=o)for(var p=-1;p<=l;p++)n[d+p]=e[c+(p+l)%l]}else for(f=0;f<u;f++){for(p=0;p<l;p++)n[d+p]=e[c+p];c+=t,d+=o}},e.prototype._copy=function(t){if(!(t.page>=this._mosaicsData.length)){var i=t.spriteData,r=this._mosaicsData[t.page];r&&i||console.error("Source or target images are uninitialized!"),e._copyBits(i,t.spriteSize[0],0,0,r,t.pageSize[0],t.rect.x+1,t.rect.y+1,t.spriteSize[0],t.spriteSize[1],t.repeat),this._dirties[t.page]=!0}},e.prototype._allocateImage=function(e,t){e+=2,t+=2;var o=Math.max(e,t);if(this._maxItemSize&&this._maxItemSize<o){var s=Math.pow(2,Math.ceil(i.log2(e))),a=Math.pow(2,Math.ceil(i.log2(t))),l=new r(0,0,e,t);return this._mosaicsData.push(new Uint32Array(s*a)),this._dirties.push(!0),this._size.push([s,a]),this._textures.push(void 0),[l,this._mosaicsData.length-1,[s,a]]}var u=e%4?4-e%4:0,h=t%4?4-t%4:0,c=this._binPack.allocate(e+u,t+h);return c.width<=0?(this._dirties[this._currentPage]||(this._mosaicsData[this._currentPage]=null),this._currentPage=this._mosaicsData.length,this._mosaicsData.push(new Uint32Array(this._pageWidth*this._pageHeight)),this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0),this._binPack=new n(this._pageWidth,this._pageHeight),this._allocateImage(e,t)):[c,this._currentPage,[this._pageWidth,this._pageHeight]]},e.prototype.dispose=function(){this._binPack=null;for(var e=0,t=this._textures;e<t.length;e++){var i=t[e];i&&i.dispose()}this._textures.length=0,this._mosaicsData.length=0,this._mosaicRects.clear()},e}()}.apply(null,r))||(e.exports=n)},2290:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(1475),i(1478)],void 0===(n=function(e,t,i,r,n){return function(){function e(e,t,i){this.rctx=e,this.positionScale=1,this.texcoordScale=1,this._vertexBuffer=r.createVertex(e,35044,new Int16Array(t).buffer),this._indexBuffer=r.createIndex(e,35044,new Uint16Array(i)),this._vao=new n(e,{a_position:0,a_texcoord:1},{geometry:[{name:"a_position",count:2,type:5122,offset:0,stride:8,normalized:!0},{name:"a_texcoord",count:2,type:5122,offset:4,stride:8,normalized:!0}]},{geometry:this._vertexBuffer},this._indexBuffer)}return e.prototype.bind=function(){this._vao.bind()},e.prototype.unbind=function(){this._vao.unbind()},e.prototype.dispose=function(){this._vao.dispose(!1),this._vertexBuffer.dispose(),this._indexBuffer.dispose()},e.prototype.draw=function(){this.rctx.drawElements(4,this._indexBuffer.size,5123,0)},e}()}.apply(null,r))||(e.exports=n)},2291:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1517),i(1647),i(1913),i(1996),i(2292),i(1475),i(1484),i(1471),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d){Object.defineProperty(t,"__esModule",{value:!0});var f=function(e){function t(){var t=e.call(this)||this;return t._initialized=!1,t._color=r.vec4f32.fromValues(1,0,0,1),t._maxWidth=0,t}return i(t,e),t.prototype.dispose=function(){this._outlineProgram&&(this._outlineProgram.dispose(),this._outlineProgram=null),this._tileInfoProgram&&(this._tileInfoProgram.dispose(),this._tileInfoProgram=null),this._outlineVertexArrayObject&&(this._outlineVertexArrayObject.dispose(),this._outlineVertexArrayObject=null),this._tileInfoVertexArrayObject&&(this._tileInfoVertexArrayObject.dispose(),this._tileInfoVertexArrayObject=null),this._canvas=null},t.prototype.draw=function(e,t){var i=e.context;if(t.isReady){this._initialized||this._initialize(i),i.bindVAO(this._outlineVertexArrayObject),i.bindProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),this._outlineProgram.setUniform1f("u_coord_range",n.TILE_SIZE),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),i.setLineWidth(2),i.drawArrays(3,0,4),i.bindVAO();var r=this._getTexture(i,t);r&&(i.bindVAO(this._tileInfoVertexArrayObject),i.bindProgram(this._tileInfoProgram),i.bindTexture(r,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform1f("u_coord_ratio",1),this._tileInfoProgram.setUniform2f("u_delta",8,8),this._tileInfoProgram.setUniform2f("u_dimensions",r.descriptor.width,r.descriptor.height),i.drawArrays(5,0,4),i.bindVAO())}},t.prototype._initialize=function(e){if(this._initialized)return!0;var t=h.createProgram(e,a.background),i=h.createProgram(e,l.tileInfo),r={geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:2,normalized:!1,divisor:0}]},n=new Int8Array([0,0,1,0,1,1,0,1]),o=u.createVertex(e,35044,n),s=new d(e,a.background.attributes,r,{geometry:o}),c=new Int8Array([0,0,1,0,0,1,1,1]),f=u.createVertex(e,35044,c),p=new d(e,l.tileInfo.attributes,r,{geometry:f});return this._outlineProgram=t,this._tileInfoProgram=i,this._outlineVertexArrayObject=s,this._tileInfoVertexArrayObject=p,this._initialized=!0},t.prototype._getTexture=function(e,t){if(t.texture)return t.texture;this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","canvas2d"),this._canvas.setAttribute("width","256"),this._canvas.setAttribute("height","32"),this._canvas.setAttribute("style","display:none"));var i=t.key.id,r=this._canvas.getContext("2d");r.font="24px sans-serif",r.textAlign="left",r.textBaseline="middle";var n=r.measureText(i),s=Math.pow(2,Math.ceil(o.log2(n.width+2)));return s>this._maxWidth&&(this._maxWidth=s),r.clearRect(0,0,this._maxWidth,32),r.fillStyle="blue",r.fillText(i,0,16),t.texture=new c(e,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728},this._canvas),t.texture},t}(s.default);t.default=f}.apply(null,r))||(e.exports=n)},2292:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1729)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.tileInfo={name:"tileInfo",shaders:{vertexShader:i.resolveIncludes("tileInfo/tileInfo.vert"),fragmentShader:i.resolveIncludes("tileInfo/tileInfo.frag")},attributes:{a_pos:0}}}.apply(null,r))||(e.exports=n)},2293:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1517),i(1913),i(1996),i(1475),i(1484),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u){Object.defineProperty(t,"__esModule",{value:!0});var h=function(e){function t(){var t=e.call(this)||this;return t._color=r.vec4f32.fromValues(1,0,0,1),t._initialized=!1,t}return i(t,e),t.prototype.dispose=function(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)},t.prototype.draw=function(e,t){var i=e.context;this._initialized||this._initialize(i),i.setStencilFunctionSeparate(1032,519,t.stencilRef,255),i.bindVAO(this._solidVertexArrayObject),i.bindProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),this._solidProgram.setUniform1f("u_coord_range",n.TILE_SIZE),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),i.drawArrays(5,0,4),i.bindVAO()},t.prototype._initialize=function(e){if(this._initialized)return!0;var t=l.createProgram(e,s.background);if(!t)return!1;var i=new Int8Array([0,0,1,0,0,1,1,1]),r=a.createVertex(e,35044,i),n=new u(e,s.background.attributes,{geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:2,normalized:!1,divisor:0}]},{geometry:r});return this._solidProgram=t,this._solidVertexArrayObject=n,this._initialized=!0},t}(o.default);t.default=h}.apply(null,r))||(e.exports=n)},2294:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1493),i(1490),i(1827),i(1807),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l){Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isInitialized=!1,t._spritesTextureSize=r.vec2f32.create(),t}return i(t,e),t.prototype.dispose=function(){},t.prototype.getGeometryType=function(){return n.WGLGeometryType.FILL},t.prototype.drawGeometry=function(e,t,i,r){var n=e.context,o=e.painter,s=e.rendererInfo,a=e.requiredLevel,l=i.indexCount,u=i.indexFrom;this._initialize();var h=i.materialInfo.materialKeyInfo,c=e.painter.materialManager.getProgram(i.materialInfo.materialKey,e.drawPhase);if(c){n.bindProgram(c);var d=this._getVAO(n,t,h.hasVV());if(n.bindVAO(d),0<i.materialInfo.texBindingInfo.length){var f=i.materialInfo.texBindingInfo[0],p=f.pageId,_=e.painter.textureManager.sprites;this._spritesTextureSize[0]=_.getWidth(p),this._spritesTextureSize[1]=_.getHeight(p);var v=1/Math.pow(2,a-t.key.level)/e.pixelRatio;c.setUniform1f("u_zoomFactor",v),o.textureManager.bindSpritePage(n,p,f.unit,9729),c.setUniform1i(f.semantic,f.unit),c.setUniform2fv("u_mosaicSize",this._spritesTextureSize)}c.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),h.vvColor&&(c.setUniform1fv("u_vvColorValues",s.vvColorValues),c.setUniform4fv("u_vvColors",s.vvColors)),h.vvOpacity&&(c.setUniform1fv("u_vvOpacityValues",s.vvOpacityValues),c.setUniform1fv("u_vvOpacities",s.vvOpacities)),n.drawElements(4,l,5125,4*u),n.bindVAO(null)}},t.prototype._initialize=function(){if(this._isInitialized)return!0;this._fillVertexAttributeLayout={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:28,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:4,stride:28,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:8,stride:28,normalized:!0,divisor:0},{name:"a_tlbr",count:4,type:5123,offset:12,stride:28,normalized:!1,divisor:0},{name:"a_aux1",count:4,type:5121,offset:20,stride:28,normalized:!1,divisor:0},{name:"a_aux2",count:2,type:5123,offset:24,stride:28,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},this._fillVertexAttributeLayoutVV={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:36,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:4,stride:36,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:8,stride:36,normalized:!0,divisor:0},{name:"a_tlbr",count:4,type:5123,offset:12,stride:36,normalized:!1,divisor:0},{name:"a_aux1",count:4,type:5121,offset:20,stride:36,normalized:!1,divisor:0},{name:"a_aux2",count:2,type:5123,offset:24,stride:36,normalized:!1,divisor:0},{name:"a_vv",count:2,type:5126,offset:28,stride:36,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},this._isInitialized=!0},t.prototype._getVAO=function(e,t,i){if(t.fillGeometry.vao)return t.fillGeometry.vao;var r=t.fillGeometry.vertexBufferMap[o.C_VBO_GEOMETRY],n=t.fillGeometry.vertexBufferMap[o.C_VBO_VISIBILITY],s=t.fillGeometry.indexBuffer;return r&&s?(t.fillGeometry.vao=new l(e,a.fill.attributes,i?this._fillVertexAttributeLayoutVV:this._fillVertexAttributeLayout,{geometry:r,visibility:n},s),t.fillGeometry.vao):null},t}(s.default);t.default=u}.apply(null,r))||(e.exports=n)},2295:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1493),i(1490),i(1827),i(1807),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l){Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._vertexAttributeLayout={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:24,normalized:!1,divisor:0},{name:"a_color",count:4,type:5121,offset:4,stride:24,normalized:!0,divisor:0},{name:"a_vertexOffset",count:2,type:5122,offset:8,stride:24,normalized:!1,divisor:0},{name:"a_texAndSize",count:4,type:5121,offset:12,stride:24,normalized:!1,divisor:0},{name:"a_refSymbolAndPlacementOffset",count:4,type:5121,offset:16,stride:24,normalized:!1,divisor:0},{name:"a_vvSize",count:1,type:5126,offset:20,stride:24,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}],visibilityRange:[{name:"a_visibilityRange",count:2,type:5121,offset:0,stride:2,normalized:!1,divisor:0}]},t._glyphsTextureSize=r.vec2f32.create(),t}return i(t,e),t.prototype.dispose=function(){},t.prototype.drawGeometry=function(e,t,i,r){var o=e.context,s=e.painter,a=e.drawPhase,l=e.state,u=e.rendererInfo,h=i.materialInfo,c=i.indexCount,d=i.indexFrom,f=h.materialKeyInfo,p=f.isMapAligned()?1:0;if(e.requiredLevel===t.key.level||p){var _=e.drawPhase===n.WGLDrawPhase.LABEL_ALPHA,v=h.materialKey;_&&(v|=8);var m=s.materialManager.getProgram(v,a);if(m){o.setStencilTestEnabled(!1),o.bindProgram(m);var g=this._getVAO(o,t);if(o.bindVAO(g),_)o.setBlendingEnabled(!1),m.setUniform1f("u_fadeStep",t.fader.value);else{var y=h.texBindingInfo[0],x=y.pageId;s.textureManager.bindGlyphsPage(o,x,y.unit),m.setUniform1i(y.semantic,y.unit)}var b=s.textureManager.glyphs;this._glyphsTextureSize[0]=b.width/4,this._glyphsTextureSize[1]=b.height/4;var S=1===p?l.displayViewMat3:l.displayMat3;f.vvSizeMinMaxValue&&m.setUniform4fv("u_vvSizeMinMaxValue",u.vvSizeMinMaxValue),f.vvSizeScaleStops&&m.setUniform1f("u_vvSizeScaleStopsValue",u.vvSizeScaleStopsValue),f.vvSizeFieldStops&&(m.setUniform1fv("u_vvSizeFieldStopsValues",u.vvSizeFieldStopsValues),m.setUniform1fv("u_vvSizeFieldStopsSizes",u.vvSizeFieldStopsSizes)),f.vvSizeUnitValue&&m.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",u.vvSizeUnitValueToPixelsRatio),o.bindTexture(e.labelFBO.colorTexture,3),m.setUniform1i("u_referenceTex",3),m.setUniform1f("u_mapRotation",Math.floor(l.rotation/360*254)),m.setUniform1f("u_mapAligned",p),m.setUniformMatrix3fv("u_displayMat3",S),m.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),m.setUniform2fv("u_mosaicSize",this._glyphsTextureSize),m.setUniform1f("u_pixelRatio",e.pixelRatio),m.setUniform1f("u_opacity",1),m.setUniform1f("u_zoomLevel",Math.round(10*e.displayLevel)),m.setUniform2fv("u_screenSize",e.state.size),o.drawElements(4,c,5125,4*d),o.bindVAO(null),o.setStencilTestEnabled(!0),o.setBlendingEnabled(!0)}}},t.prototype.getGeometryType=function(){return n.WGLGeometryType.LABEL},t.prototype._getVAO=function(e,t){var i=t.labelGeometry;if(i&&i.vao)return i.vao;var r=i.vertexBufferMap[o.C_VBO_GEOMETRY],n=i.vertexBufferMap[o.C_VBO_VISIBILITY],s=i.vertexBufferMap[o.C_VBO_VISIBILITY_RANGE],u=i.indexBuffer;return r&&u&&s?(i.vao=new l(e,a.label.attributes,this._vertexAttributeLayout,{geometry:r,visibility:n,visibilityRange:s},u),i.vao):null},t}(s.default);t.default=u}.apply(null,r))||(e.exports=n)},2296:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1493),i(1490),i(1827),i(1807),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l){Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._lineVertexAttributeLayout={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:32,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:4,stride:32,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:8,stride:32,normalized:!0,divisor:0},{name:"a_offsetAndNormal",count:4,type:5120,offset:12,stride:32,normalized:!1,divisor:0},{name:"a_accumulatedDistanceAndHalfWidth",count:2,type:5123,offset:16,stride:32,normalized:!1,divisor:0},{name:"a_tlbr",count:4,type:5123,offset:20,stride:32,normalized:!1,divisor:0},{name:"a_segmentDirection",count:4,type:5120,offset:28,stride:32,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},t._lineVertexAttributeLayoutVV={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:44,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:4,stride:44,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:8,stride:44,normalized:!0,divisor:0},{name:"a_offsetAndNormal",count:4,type:5120,offset:12,stride:44,normalized:!1,divisor:0},{name:"a_accumulatedDistanceAndHalfWidth",count:2,type:5123,offset:16,stride:44,normalized:!1,divisor:0},{name:"a_tlbr",count:4,type:5123,offset:20,stride:44,normalized:!1,divisor:0},{name:"a_segmentDirection",count:4,type:5120,offset:28,stride:44,normalized:!1,divisor:0},{name:"a_vv",count:3,type:5126,offset:32,stride:44,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},t._spritesTextureSize=r.vec2f32.create(),t}return i(t,e),t.prototype.dispose=function(){},t.prototype.getGeometryType=function(){return n.WGLGeometryType.LINE},t.prototype.drawGeometry=function(e,t,i,r){var n=e.context,o=e.painter,s=e.rendererInfo,a=e.requiredLevel,l=e.drawPhase,u=e.state,h=i.indexFrom,c=i.indexCount,d=i.materialInfo,f=d.materialKeyInfo,p=o.materialManager.getProgram(d.materialKey,l);if(p){n.bindProgram(p);var _=this._getVAO(n,t,f.hasVV());n.bindVAO(_);var v=1/e.pixelRatio;if(0<d.texBindingInfo.length){var m=d.texBindingInfo[0],g=m.pageId,y=o.textureManager.sprites;this._spritesTextureSize[0]=y.getWidth(g),this._spritesTextureSize[1]=y.getHeight(g),o.textureManager.bindSpritePage(n,g,m.unit),p.setUniform1i(m.semantic,m.unit),p.setUniform2fv("u_mosaicSize",this._spritesTextureSize)}var x=Math.pow(2,a-t.key.level)/e.pixelRatio;p.setUniform1f("u_zoomFactor",x),p.setUniformMatrix3fv("u_dvMat3",u.displayViewMat3),p.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),p.setUniform1f("u_blur",0+v),p.setUniform1f("u_antialiasing",v),p.setUniform1f("u_zoomFactor",x),f.vvSizeMinMaxValue&&p.setUniform4fv("u_vvSizeMinMaxValue",s.vvSizeMinMaxValue),f.vvSizeScaleStops&&p.setUniform1f("u_vvSizeScaleStopsValue",s.vvSizeScaleStopsValue),f.vvSizeFieldStops&&(p.setUniform1fv("u_vvSizeFieldStopsValues",s.vvSizeFieldStopsValues),p.setUniform1fv("u_vvSizeFieldStopsSizes",s.vvSizeFieldStopsSizes)),f.vvSizeUnitValue&&p.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",s.vvSizeUnitValueToPixelsRatio),f.vvColor&&(p.setUniform1fv("u_vvColorValues",s.vvColorValues),p.setUniform4fv("u_vvColors",s.vvColors)),f.vvOpacity&&(p.setUniform1fv("u_vvOpacityValues",s.vvOpacityValues),p.setUniform1fv("u_vvOpacities",s.vvOpacities)),n.setFaceCullingEnabled(!0),n.setFrontFace(2305),n.setCullFace(1029),n.drawElements(4,c,5125,4*h),n.setFaceCullingEnabled(!1),n.bindVAO(null)}},t.prototype._getVAO=function(e,t,i){if(t.lineGeometry.vao)return t.lineGeometry.vao;var r=t.lineGeometry.vertexBufferMap[o.C_VBO_GEOMETRY],n=t.lineGeometry.vertexBufferMap[o.C_VBO_VISIBILITY],s=t.lineGeometry.indexBuffer;return r&&s?(t.lineGeometry.vao=new l(e,a.line.attributes,i?this._lineVertexAttributeLayoutVV:this._lineVertexAttributeLayout,{geometry:r,visibility:n},s),t.lineGeometry.vao):null},t}(s.default);t.default=u}.apply(null,r))||(e.exports=n)},2297:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1493),i(1490),i(1827),i(1807),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l){Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._iconVertexAttributes={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:24,normalized:!1,divisor:0},{name:"a_vertexOffsetAndTex",count:4,type:5120,offset:4,stride:24,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:8,stride:24,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:12,stride:24,normalized:!0,divisor:0},{name:"a_outlineColor",count:4,type:5121,offset:16,stride:24,normalized:!0,divisor:0},{name:"a_sizeAndOutlineWidth",count:4,type:5121,offset:20,stride:24,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},t._iconVertexAttributesWithVV={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:40,normalized:!1,divisor:0},{name:"a_vertexOffsetAndTex",count:4,type:5120,offset:4,stride:40,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:8,stride:40,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:12,stride:40,normalized:!0,divisor:0},{name:"a_outlineColor",count:4,type:5121,offset:16,stride:40,normalized:!0,divisor:0},{name:"a_sizeAndOutlineWidth",count:4,type:5121,offset:20,stride:40,normalized:!1,divisor:0},{name:"a_vv",count:4,type:5126,offset:24,stride:40,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},t._spritesTextureSize=r.vec2f32.create(),t}return i(t,e),t.prototype.dispose=function(){},t.prototype.getGeometryType=function(){return n.WGLGeometryType.MARKER},t.prototype.drawGeometry=function(e,t,i,r){var n=e.context,o=e.painter,s=e.rendererInfo,a=e.drawPhase,l=e.state,u=i.indexCount,h=i.indexFrom,c=i.materialInfo,d=c.materialKeyInfo,f=o.materialManager.getProgram(c.materialKey,a);if(f){n.bindProgram(f);var p=this._getVAO(n,t,d.hasVV());n.bindVAO(p);var _=c.texBindingInfo[0],v=_.pageId;o.textureManager.bindSpritePage(n,v,_.unit),f.setUniform1i(_.semantic,_.unit);var m=o.textureManager.sprites;this._spritesTextureSize[0]=m.getWidth(v)/4,this._spritesTextureSize[1]=m.getHeight(v)/4;var g=d.vvRotation?l.displayViewMat3:l.displayMat3;f.setUniformMatrix3fv("u_displayMat3",g),f.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),f.setUniform2fv("u_mosaicSize",this._spritesTextureSize),d.vvSizeMinMaxValue&&f.setUniform4fv("u_vvSizeMinMaxValue",s.vvSizeMinMaxValue),d.vvSizeScaleStops&&f.setUniform1f("u_vvSizeScaleStopsValue",s.vvSizeScaleStopsValue),d.vvSizeFieldStops&&(f.setUniform1fv("u_vvSizeFieldStopsValues",s.vvSizeFieldStopsValues),f.setUniform1fv("u_vvSizeFieldStopsSizes",s.vvSizeFieldStopsSizes)),d.vvSizeUnitValue&&f.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",s.vvSizeUnitValueToPixelsRatio),d.vvColor&&(f.setUniform1fv("u_vvColorValues",s.vvColorValues),f.setUniform4fv("u_vvColors",s.vvColors)),d.vvOpacity&&(f.setUniform1fv("u_vvOpacityValues",s.vvOpacityValues),f.setUniform1fv("u_vvOpacities",s.vvOpacities)),d.vvRotation&&f.setUniform1f("u_vvRotationType","geographic"===s.vvMaterialParameters.vvRotationType?0:1),n.drawElements(4,u,5125,4*h),n.bindVAO(null)}},t.prototype._getVAO=function(e,t,i){if(t.iconGeometry.vao)return t.iconGeometry.vao;var r=t.iconGeometry.vertexBufferMap[o.C_VBO_GEOMETRY],n=t.iconGeometry.vertexBufferMap[o.C_VBO_VISIBILITY],s=t.iconGeometry.indexBuffer;return r&&s?(t.iconGeometry.vao=new l(e,a.icon.attributes,i?this._iconVertexAttributesWithVV:this._iconVertexAttributes,{geometry:r,visibility:n},s),t.iconGeometry.vao):null},t}(s.default);t.default=u}.apply(null,r))||(e.exports=n)},2298:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1493),i(1490),i(1827),i(1807),i(1478)],void 0===(n=function(e,t,i,r,n,o,s,a,l){Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._vertexAttributeLayout={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:20,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:4,stride:20,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:8,stride:20,normalized:!0,divisor:0},{name:"a_vertexOffset",count:2,type:5122,offset:12,stride:20,normalized:!1,divisor:0},{name:"a_texFontSize",count:4,type:5120,offset:16,stride:20,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},t._vertexAttributeLayoutVV={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:36,normalized:!1,divisor:0},{name:"a_id",count:4,type:5121,offset:4,stride:36,normalized:!0,divisor:0},{name:"a_color",count:4,type:5121,offset:8,stride:36,normalized:!0,divisor:0},{name:"a_vertexOffset",count:2,type:5122,offset:12,stride:36,normalized:!1,divisor:0},{name:"a_texFontSize",count:4,type:5120,offset:16,stride:36,normalized:!1,divisor:0},{name:"a_vv",count:4,type:5126,offset:20,stride:36,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}]},t._glyphsTextureSize=r.vec2f32.create(),t}return i(t,e),t.prototype.dispose=function(){},t.prototype.getGeometryType=function(){return n.WGLGeometryType.TEXT},t.prototype.drawGeometry=function(e,t,i,r){var n=e.context,o=e.painter,s=e.rendererInfo,a=e.drawPhase,l=e.state,u=i.materialInfo,h=i.indexCount,c=i.indexFrom,d=u.materialKeyInfo,f=d.vvSizeMinMaxValue||d.vvSizeScaleStops||d.vvSizeFieldStops||d.vvSizeUnitValue||d.vvColor||d.vvRotation||d.vvOpacity,p=o.materialManager.getProgram(u.materialKey,a);if(p){n.bindProgram(p);var _=this._getVAO(n,t,f,this.getGeometryType());n.bindVAO(_);var v=u.texBindingInfo[0],m=v.pageId;o.textureManager.bindGlyphsPage(n,m,v.unit),p.setUniform1i(v.semantic,v.unit);var g=o.textureManager.glyphs;this._glyphsTextureSize[0]=g.width/4,this._glyphsTextureSize[1]=g.height/4,p.setUniformMatrix3fv("u_displayMat3",l.displayMat3),p.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),p.setUniform2fv("u_mosaicSize",this._glyphsTextureSize),p.setUniform1f("u_pixelRatio",1),d.vvSizeMinMaxValue&&p.setUniform4fv("u_vvSizeMinMaxValue",s.vvSizeMinMaxValue),d.vvSizeScaleStops&&p.setUniform1f("u_vvSizeScaleStopsValue",s.vvSizeScaleStopsValue),d.vvSizeFieldStops&&(p.setUniform1fv("u_vvSizeFieldStopsValues",s.vvSizeFieldStopsValues),p.setUniform1fv("u_vvSizeFieldStopsSizes",s.vvSizeFieldStopsSizes)),d.vvSizeUnitValue&&p.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",s.vvSizeUnitValueToPixelsRatio),d.vvColor&&(p.setUniform1fv("u_vvColorValues",s.vvColorValues),p.setUniform4fv("u_vvColors",s.vvColors)),d.vvOpacity&&(p.setUniform1fv("u_vvOpacityValues",s.vvOpacityValues),p.setUniform1fv("u_vvOpacities",s.vvOpacities)),d.vvRotation&&p.setUniform1f("u_vvRotationType","geographic"===s.vvMaterialParameters.vvRotationType?0:1),n.drawElements(4,h,5125,4*c),n.bindVAO(null)}},t.prototype._getVAO=function(e,t,i,r){var n=t.getGeometry(r);if(n&&n.vao)return n.vao;var s=n.vertexBufferMap[o.C_VBO_GEOMETRY],u=n.vertexBufferMap[o.C_VBO_VISIBILITY],h=n.indexBuffer;return s&&h?(n.vao=new l(e,a.text.attributes,i?this._vertexAttributeLayoutVV:this._vertexAttributeLayout,{geometry:s,visibility:u},h),n.vao):null},t}(s.default);t.default=u}.apply(null,r))||(e.exports=n)},2299:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(18),i(2300),i(2302)],void 0===(n=function(e,t,i,r,n){var o=.75;return function(){function e(){this._hlRenderer=new r,this._hlSurfaces=new n,this._width=void 0,this._height=void 0,this._adjustedWidth=void 0,this._adjustedHeight=void 0}return e.prototype.dispose=function(){this._hlSurfaces&&this._hlSurfaces.dispose(),this._hlRenderer&&this._hlRenderer.dispose(),this._boundFBO=null},e.prototype.setup=function(e,t,i){var r=(this._width=t)%4,n=(this._height=i)%4;t+=r<2?-r:4-r,i+=n<2?-n:4-n,this._adjustedWidth=t,this._adjustedHeight=i,this._boundFBO=e.getBoundFramebufferObject();var s=Math.round(t*o),a=Math.round(i*o);this._hlRenderer.setup(e,s,a),this._hlSurfaces.setup(e,s,a)},e.prototype.setHighlightOptions=function(e){this._hlRenderer.setHighlightOptions({fillColor:e.fillColor,outlineColor:e.outlineColor,outlineWidth:e.outlineWidth*o,outerHaloWidth:e.outerHaloWidth*o,innerHaloWidth:e.innerHaloWidth*o,outlinePosition:e.outlinePosition*o})},e.prototype.startMaskDraw=function(e){e.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),e.setClearColor(0,0,0,0),e.setClearStencil(0),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.STENCIL_BUFFER_BIT),e.setViewport(0,0,this._adjustedWidth*o,this._adjustedHeight*o)},e.prototype.draw=function(e){e.setStencilTestEnabled(!1),e.setBlendingEnabled(!1),e.bindFramebuffer(this._hlSurfaces.sharedBlur2Fbo),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT),this._hlRenderer.preBlur(e,this._hlSurfaces.sharedBlur1Tex),i("esri-feature-highlight-debug")?(e.bindFramebuffer(null),e.clear(e.gl.COLOR_BUFFER_BIT),this._hlRenderer.finalBlur(e,this._hlSurfaces.sharedBlur2Tex)):(e.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT),this._hlRenderer.finalBlur(e,this._hlSurfaces.sharedBlur2Tex),e.bindFramebuffer(this._boundFBO),e.setBlendingEnabled(!0),e.setViewport(0,0,this._width,this._height),this._hlRenderer.renderHighlight(e,this._hlSurfaces.sharedBlur1Tex),this._boundFBO=null)},e}()}.apply(null,r))||(e.exports=n)},2300:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(2301),i(1475),i(1484),i(1471),i(1478)],void 0===(n=function(e,t,i,r,n,o,s){var a=256,l=[void 0,void 0,void 0,1],u=[3,4],h=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return function(){function e(){this._width=void 0,this._height=void 0,this._highlightOptions={fillColor:[.2,.6,.9,.75],outlineColor:[.2,.6,.9,.9],outlinePosition:0,outlineWidth:3.4,innerHaloWidth:2,outerHaloWidth:3.3},this._resources=null}return e.prototype.dispose=function(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources.shadeTex.dispose(),this._resources=null)},e.prototype.preBlur=function(e,t){e.bindTexture(t,u[0]),e.bindProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",h),e.bindVAO(this._resources.quadVAO),e.drawArrays(5,0,4),e.bindVAO()},e.prototype.finalBlur=function(e,t){e.bindTexture(t,u[0]),e.bindProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",c),e.bindVAO(this._resources.quadVAO),e.drawArrays(5,0,4),e.bindVAO()},e.prototype.renderHighlight=function(e,t){e.bindTexture(t,u[0]),e.bindTexture(this._resources.shadeTex,u[1]),e.bindProgram(this._resources.highlightProgram),e.bindVAO(this._resources.quadVAO),e.drawArrays(5,0,4),e.bindVAO()},e.prototype._initialize=function(e,t,h){this._width=t,this._height=h;var c=new r(e,34962,35044,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),d=new s(e,{a_position:0,a_texcoord:1},{geometry:[{name:"a_position",count:2,type:5120,offset:0,stride:4,normalized:!1},{name:"a_texcoord",count:2,type:5121,offset:2,stride:4,normalized:!1}]},{geometry:c}),f=n.createProgram(e,i.highlight),p=n.createProgram(e,i.blur);f.setUniform1i("u_texture",u[0]),f.setUniform1i("u_shade",u[1]),f.setUniform4fv("u_sigmas",l),p.setUniform1i("u_texture",u[0]),p.setUniform4fv("u_sigmas",l);var _=new o(e,{target:3553,pixelFormat:6408,dataType:5121,wrapMode:33071,width:a,height:1,samplingMode:9728});this._resources={quadGeometry:c,quadVAO:d,highlightProgram:f,blurProgram:p,shadeTex:_}},e.prototype.setHighlightOptions=function(e){if(this._highlightOptions=e,this._resources){var t=e.outlinePosition-e.outlineWidth/2-e.outerHaloWidth,i=e.outlinePosition-e.outlineWidth/2,r=e.outlinePosition+e.outlineWidth/2,n=e.outlinePosition+e.outlineWidth/2+e.innerHaloWidth,o=Math.sqrt(Math.PI/2)*l[3],s=Math.abs(t)>o?Math.round(10*(Math.abs(t)-o))/10:0,u=Math.abs(n)>o?Math.round(10*(Math.abs(n)-o))/10:0;s&&!u?console.warn("The outer rim of the highlight is "+s+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!s&&u?console.warn("The inner rim of the highlight is "+u+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):s&&u&&console.warn("The highlight is "+Math.max(s,u)+"px away from the edge of the feature; consider reducing some width values.");for(var h,c=new Uint8Array(4*a),d=[void 0,void 0,void 0,void 0],f=0;f<a;++f)(h=t+f/255*(n-t))<t?(c[4*f+0]=0,c[4*f+1]=0,c[4*f+2]=0,c[4*f+3]=0):h<i?p([0,0,0,0],e.outlineColor,(h-t)/(i-t)):h<r?(d[0]=e.outlineColor[0],d[1]=e.outlineColor[1],d[2]=e.outlineColor[2],d[3]=e.outlineColor[3]):h<n?p(e.outlineColor,e.fillColor,(h-r)/(n-r)):(c[4*f+0]=e.fillColor[0],c[4*f+1]=e.fillColor[1],c[4*f+2]=e.fillColor[2],c[4*f+3]=e.fillColor[3]),c[4*f+0]=255*d[0]*d[3],c[4*f+1]=255*d[1]*d[3],c[4*f+2]=255*d[2]*d[3],c[4*f+3]=255*d[3];this._resources.highlightProgram.setUniform2fv("u_minMaxDistance",[t,n]),this._resources.shadeTex.updateData(0,0,0,a,1,c)}function p(e,t,i){d[0]=(1-i)*e[0]+i*t[0],d[1]=(1-i)*e[1]+i*t[1],d[2]=(1-i)*e[2]+i*t[2],d[3]=(1-i)*e[3]+i*t[3]}},e.prototype.setup=function(e,t,i){this._resources?(this._width=t,this._height=i):(this._initialize(e,t,i),this.setHighlightOptions(this._highlightOptions))},e}()}.apply(null,r))||(e.exports=n)},2301:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1729)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.highlight={name:"highlight",shaders:{vertexShader:i.resolveIncludes("highlight/textured.vert"),fragmentShader:i.resolveIncludes("highlight/highlight.frag")},attributes:{a_position:0,a_texcoord:1}},t.blur={name:"blur",shaders:{vertexShader:i.resolveIncludes("highlight/textured.vert"),fragmentShader:i.resolveIncludes("highlight/blur.frag")},attributes:{a_position:0,a_texcoord:1}}}.apply(null,r))||(e.exports=n)},2302:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1473),i(1471)],void 0===(n=function(e,t,i,r){function n(e,t,n){var o=new r(e,{target:3553,pixelFormat:6408,dataType:5121,wrapMode:33071,width:t,height:n,samplingMode:9729});return[o,i.createWithAttachments(e,o,{colorTarget:0,depthStencilTarget:2})]}return function(){function e(){this._width=void 0,this._height=void 0,this._resources=null}return e.prototype.dispose=function(){this._resources&&(this._resources.sharedBlur1Tex.dispose(),this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Tex.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)},e.prototype._initialize=function(e,t,i){var r=n(e,this._width=t,this._height=i),o=r[0],s=r[1],a=n(e,t,i),l=a[0],u=a[1];this._resources={sharedBlur1Tex:o,sharedBlur1Fbo:s,sharedBlur2Tex:l,sharedBlur2Fbo:u}},e.prototype.setup=function(e,t,i){!this._resources||this._width===t&&this._height===i||this.dispose(),this._resources||this._initialize(e,t,i)},Object.defineProperty(e.prototype,"sharedBlur1Tex",{get:function(){return this._resources.sharedBlur1Tex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sharedBlur1Fbo",{get:function(){return this._resources.sharedBlur1Fbo},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sharedBlur2Tex",{get:function(){return this._resources.sharedBlur2Tex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sharedBlur2Fbo",{get:function(){return this._resources.sharedBlur2Fbo},enumerable:!0,configurable:!0}),e}()}.apply(null,r))||(e.exports=n)},2303:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1729)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.transformTexture={name:"transform-texture",shaders:{vertexShader:i.resolveIncludes("raster/transform.vert"),fragmentShader:i.resolveIncludes("raster/texture.frag")},attributes:{a_position:0,a_texcoord:1}},t.transformSolid={name:"transform-solid",shaders:{vertexShader:i.resolveIncludes("raster/transform.vert"),fragmentShader:i.resolveIncludes("raster/solid.frag")},attributes:{a_position:0}}}.apply(null,r))||(e.exports=n)},2304:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1729)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.stencil={name:"stencil",shaders:{vertexShader:i.resolveIncludes("stencil/stencil.vert"),fragmentShader:i.resolveIncludes("stencil/stencil.frag")},attributes:{a_pos:0}}}.apply(null,r))||(e.exports=n)},2305:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(5),i(1512),i(483),i(2),i(2306),i(2309)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u){Object.defineProperty(t,"__esModule",{value:!0});var h=64,c=function(e){function t(t){var i=e.call(this)||this;return i._applyVisivilityPassThrottled=s.throttle(i._applyVisivilityPass,h,i),i._previousResolution=Number.POSITIVE_INFINITY,i.lastUpdateId=-1,i.updateRequested=!1,i.view=null,i}return i(t,e),t.prototype.initialize=function(){var e=this;this.collisionEngine=new l.default(this.view.featuresTilingScheme),this._layerViewSorter=new u.default(function(t,i){e.collisionEngine.registerLayer(t.layer,i);var r=t.tileRenderer;r&&r.forEachTile(function(i){i.isDirty=!0,e.addTile(t.layer.uid,i)}),e.requestUpdate()},function(t){e.collisionEngine.unregisterLayer(t.layer),e.requestUpdate()}),this.handles.add(this.view.allLayerViews.on("change",function(t){e._layerViewSorter.update(t)}))},t.prototype.destroy=function(){this._layerViewSorter.destroy(),this._layerViewSorter=null,this.collisionEngine=null,this._applyVisivilityPassThrottled.remove()},Object.defineProperty(t.prototype,"updating",{get:function(){return this.updateRequested},enumerable:!0,configurable:!0}),t.prototype.update=function(e){var t=this._previousResolution,i=e.state.resolution;this._previousResolution=i,i===t&&this._applyVisivilityPassThrottled(e)},t.prototype.viewChange=function(){this.requestUpdate()},t.prototype.requestUpdate=function(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate(this))},t.prototype.processUpdate=function(e){this._set("updateParameters",e),this.updateRequested&&(this.update(e),this.updateRequested=!1)},t.prototype.addTile=function(e,t){this.collisionEngine.addTile(e,t)},t.prototype.removeTile=function(e,t){this.collisionEngine.removeTile(e,t)},t.prototype._applyVisivilityPass=function(e){var t=this.view.featuresTilingScheme.getClosestInfoForScale(e.state.scale).level;this.collisionEngine.run(e.state,t)},r([a.property()],t.prototype,"updateRequested",void 0),r([a.property({readOnly:!0})],t.prototype,"updateParameters",void 0),r([a.property({dependsOn:["updateRequested"]})],t.prototype,"updating",null),r([a.property()],t.prototype,"view",void 0),r([a.subclass("esri.views.2d.layers.labels.LabelManager")],t)}(a.declared(n,o));t.default=c}.apply(null,r))||(e.exports=n)},2306:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(294),i(1540),i(1517),i(2307),i(1880),i(1762),i(90)],void 0===(n=function(e,t,i,r,n,o,s,a,l){Object.defineProperty(t,"__esModule",{value:!0});var u=n.TILE_SIZE/n.COLLISION_BUCKET_SIZE,h=u,c=function(){function e(e){this._layers=new r.default,this._collisionBuckets=new r.default,this._tilingScheme=e}return Object.defineProperty(e.prototype,"collisionInfos",{get:function(){var e=[];return a.forEachIter(this._layers.values(),function(t){return e.push(t)}),e},enumerable:!0,configurable:!0}),e.prototype.registerLayer=function(e,t){if(e&&!this._layers.has(e.uid)){var i=s.default.create(e,t,this.collisionInfos,this._tilingScheme);this._layers.set(e.uid,i),this._collisionBuckets.forEach(function(e){return e.onRegisterLayer(i.index)})}},e.prototype.unregisterLayer=function(e){var t=this;if(e&&this._layers.has(e.uid)){var i=this._layers.get(e.uid);s.default.delete(i.index,this.collisionInfos),this._layers.delete(e.uid),this._collisionBuckets.forEach(function(e,r){var n=e.getTile(i.index);n&&(n.dirty=!1,e.onUnregisterLayer(i.index),e.canDelete()&&t._collisionBuckets.delete(r))})}},e.prototype.addTile=function(e,t){var i=t.key.id;this._layers.has(e)&&(this._collisionBuckets.has(i)||this._collisionBuckets.set(i,new o.default(t.key,this._layers.size)),this._collisionBuckets.get(i).getTile(this._getIndex(e)).reference=t)},e.prototype.removeTile=function(e,t){this._layers.has(e)&&this._collisionBuckets.has(t)&&(this._collisionBuckets.get(t).getTile(this._getIndex(e)).reference=null)},e.prototype.run=function(e,t){for(var r=i.from(this._collisionBuckets.values()).filter(function(e){return e.key.level===t}).sort(function(e,t){return e.key.compareRowMajor(t.key)}),n=this._checkRotation(e.rotation),o=0,a=r;o<a.length;o++){var l=a[o];n=n||l.isDirty;for(var u=0;u<this._layers.size;u++){var h=s.default.find(u,this.collisionInfos);l.computeNeighbors(this._collisionBuckets),l.reset(e,n,h)}}for(var c=0;c<this._layers.size;c++){h=s.default.find(c,this.collisionInfos);for(var d=0,f=r;d<f.length;d++)l=f[d],this._run(l,h,t)}for(var p=0,_=r;p<_.length;p++)(l=_[p]).ready()},e.prototype._run=function(e,t,i){var r=e.getReference(t.index);r&&r.isDirty&&r.hasData&&this._runVisibility(e,r,t,i)},e.prototype._runVisibility=function(e,t,i,r){for(var n=0,o=t.displayObjects;n<o.length;n++){for(var s=o[n],a=0,l=0;l<s.metrics.length;l++){var u=s.metrics[l],h=this._computeLabelVisibility(s,u,i.index,e,t,u.baseZoom,r);a=Math.max(h,a)}for(var c=0,d=s.metrics;c<d.length;c++)u=d[c],t.setVisibilityRange(s.id,u.range.from,u.range.count,a),u.minZoom=a}},e.prototype._computeLabelVisibility=function(e,t,i,r,n,o,s){for(var a=o,l=t.xBucket,c=t.yBucket,d=t.xOverflow,f=t.yOverflow,p=l-d,_=l+d+1,v=c+f+1,m=c-f;m<v;m++)for(var g=p;g<_;g++)if(!(g<-u||m<-h||u<g||h<m))for(var y=0;y<=i;y++){var x=this._getRelativeSubBucket(y,r,n,g,m);if(x)for(var b=0,S=x;b<S.length;b++){var T=S[b];if(T.id!==e.id){var w=this._compareLabels(t,T,a,s);a=Math.max(w,a)}}}return a},e.prototype._compareLabels=function(e,t,i,r){var o=10*(r+n.COLLISION_MAX_ZOOM_DELTA);if(-1===t.minZoom||t.minZoom>o||t.minZoom>Math.floor(10*r))return i;var s=e.findCollisionDelta(t),a=l.clamp(Math.floor(10*(s+r)),0,255);return t.minZoom>=a?i:Math.max(i,a)},e.prototype._getNeighboringTile=function(e,t,i,r,n){var o=3*(1+n)+(1+r),s=t.neighbors[o];return s&&s.getTile(e)},e.prototype._getRelativeSubBucket=function(e,t,i,r,n){var o=l.sign(Math.floor(r/4)),s=l.sign(Math.floor(n/4)),a=this._getNeighboringTile(e,t,i,o,s);return a&&a.reference&&a.index&&a.reference.hasData?a.index[n-4*s][r-4*o]:null},e.prototype._checkRotation=function(e){if(!this._lastRotation)return this._lastRotation=e,!1;var t=e!==this._lastRotation;return this._lastRotation=e,t},e.prototype._getIndex=function(e){return this._layers.get(e).index},e}();t.default=c}.apply(null,r))||(e.exports=n)},2307:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(472),i(2308)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.neighbors=new Array(9),this._tiles=new Array(t);for(var i=0;i<t;i++)this._tiles[i]=new r.default;this.key=e}return Object.defineProperty(e.prototype,"isDirty",{get:function(){for(var e=0,t=this._tiles;e<t.length;e++)if(t[e].dirty)return!0;return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._tiles.length},enumerable:!0,configurable:!0}),e.prototype.getTile=function(e){return this._tiles[e]},e.prototype.getReference=function(e){var t=this._tiles[e];return t&&t.reference},e.prototype.onRegisterLayer=function(e){this.invalidateRange(e),this._add(e)},e.prototype.onUnregisterLayer=function(e){this.invalidateRange(e),this._remove(e)},e.prototype.onLabelsRendered=function(){},e.prototype.invalidateRange=function(e){for(var t=e;t<this._tiles.length;t++)this._tiles[t].dirty=!0},e.prototype.add=function(e){this._add(e)},e.prototype.remove=function(e){this._remove(e)},e.prototype.canDelete=function(){return 0===this._tiles.length},e.prototype.ready=function(){for(var e=0,t=this._tiles;e<t.length;e++)t[e].dirty=!1},e.prototype.computeNeighbors=function(e){this.neighbors[0]=this._getNeighbor(e,-1,-1),this.neighbors[1]=this._getNeighbor(e,0,-1),this.neighbors[2]=this._getNeighbor(e,1,-1),this.neighbors[3]=this._getNeighbor(e,-1,0),(this.neighbors[4]=this).neighbors[5]=this._getNeighbor(e,1,0),this.neighbors[6]=this._getNeighbor(e,-1,1),this.neighbors[7]=this._getNeighbor(e,0,1),this.neighbors[8]=this._getNeighbor(e,1,1)},e.prototype.reset=function(e,t,i){for(var r=0,n=this._tiles;r<n.length;r++){var o=n[r];o&&o.reset(e,t,i)}},e.prototype._add=function(e){var t=[];if(e>=this._tiles.length)this._tiles.push(new r.default);else{for(var i=0;i<this._tiles.length;i++)i===e&&t.push(new r.default),t.push(this._tiles[i]);this._tiles=t}},e.prototype._remove=function(e){for(var t=[],i=0;i<this._tiles.length;i++)i!==e&&t.push(this._tiles[i]);this._tiles=t},e.prototype._getNeighbor=function(e,t,r){var n=this.key,o=n.col+t,s=n.row+r,a=n.level,l=n.world,u=i.TileKey.getId(a,s,o,l);return e.has(u)?e.get(u):null},e}();t.default=n}.apply(null,r))||(e.exports=n)},2308:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(36)],void 0===(n=function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._reference=null}return Object.defineProperty(e.prototype,"dirty",{get:function(){return this.reference&&this.reference.isDirty},set:function(e){this.reference&&this.reference.hasData&&(this.reference.isDirty=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this._reference&&this._reference.labelIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reference",{get:function(){return this._reference},set:function(e){this._reference=e},enumerable:!0,configurable:!0}),e.prototype.reset=function(e,t,r){var n=this.reference;if(!n||!n.hasData)return!1;t&&(n.isDirty=!0);for(var o=n.labelMat2d,s=n.labelMat2d[4],a=n.labelMat2d[5],l=0,u=n.displayObjects;l<u.length;l++)for(var h=0,c=u[l].metrics;h<c.length;h++){var d=c[h];r.hasVV()&&d.computeOffset(r.vvEval);var f=d.bounds.center,p=d.bounds.centerT;n.isDirty&&(d.minZoom=-1);var _=i.vec2.copy(p,d.anchor);if(e.rotation?i.vec2.transformMat2d(_,_,o):(p[0]=_[0]+s,p[1]=_[1]+a),i.vec2.add(p,_,f),p[0]+=d.offsetX,p[1]+=d.offsetY,d.boxes)for(var v=0,m=d.boxes;v<m.length;v++){var g=m[v],y=g.center,x=d.anchor,b=g.centerT;i.vec2.add(b,x,y),e.rotation?i.vec2.transformMat2d(b,b,o):(b[0]=b[0]+s,b[1]=b[1]+a)}}return!0},e}();t.default=r}.apply(null,r))||(e.exports=n)},2309:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1540)],void 0===(n=function(e,t,i){function r(e){return"esri.views.2d.layers.FeatureLayerView2D"===e.declaredClass||"esri.views.2d.layers.StreamLayerView2D"===e.declaredClass}function n(e){switch(e.get("layer.renderer.type")){case"class-breaks":case"simple":case"unique-value":return!0;default:return!1}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this.registerLayer=e,this.unregisterLayer=t,this._layerViewState=new i.default}return e.prototype.findIndex=function(e){return e.view.allLayerViews.findIndex(function(t){return t.uid===e.uid})},e.prototype.update=function(e){for(var t=e.added,i=0,o=e.removed;i<o.length;i++)r(l=o[i])&&this._layerViewState.has(l)&&this._deleteState(l);for(var s=0,a=t;s<a.length;s++){var l;r(l=a[s])&&n(l)&&!this._layerViewState.has(l)&&this._createState(l)}this._recomputeOrder()},e.prototype.destroy=function(){var e=this;this._layerViewState.forEach(function(t,i){return e._deleteState(i)})},e.prototype._createState=function(e){var t={priority:-1,handle:null};return t.handle=e.watch("labelsVisible",this._recomputeOrder.bind(this)),this._layerViewState.set(e,t),t},e.prototype._deleteState=function(e){if(this._layerViewState.has(e)){var t=this._layerViewState.get(e);t.handle.remove(),-1!==t.priority&&this.unregisterLayer(e),this._layerViewState.delete(e)}},e.prototype._recomputeOrder=function(){var e=this;this._layerViewState.forEach(function(t,i){var r=i.view.map.allLayers.findIndex(function(e){return e.uid===i.layer.uid}),n=i.layer,o=n.visible&&n.labelsVisible&&n.labelingInfo?4294967295-r:-1;o!==t.priority&&(t.priority=o,e.unregisterLayer(i),-1!==o&&e.registerLayer(i,o))})},e}();t.default=o}.apply(null,r))||(e.exports=n)},2314:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(212),i(5),i(2),i(25),i(124),i(2315),i(2316),i(2318),i(2321)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u,h,c,d){Object.defineProperty(t,"__esModule",{value:!0});var f=new n({targetGeometry:new a}),p=[0,0],_=function(e){function t(t){var i=e.call(this)||this;return i._endTimer=null,i.animationManager=null,i}return i(t,e),t.prototype.initialize=function(){this.pan=new h({navigation:this}),this.rotate=new d({navigation:this}),this.pinch=new c({navigation:this}),this.zoomBox=new u({view:this.view,navigation:this})},t.prototype.destroy=function(){this.zoomBox.destroy(),this.zoomBox=null,this.animationManager=null},t.prototype.begin=function(){this._set("interacting",!0)},t.prototype.end=function(){var e=this;this._endTimer&&(clearTimeout(this._endTimer),this._endTimer=0),this._endTimer=setTimeout(function(){e._set("interacting",!1)},0)},t.prototype.zoom=function(e,t){if(void 0===t&&(t=this._getDefaultAnchor()),this.stop(),this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return e<1?this.zoomIn(t):this.zoomOut(t);this.setViewpoint(t,e,0,[0,0])},t.prototype.zoomIn=function(e){void 0===e&&(e=this._getDefaultAnchor());var t=this.view,i=t.scale,r=t.constraints.snapToNextScale(i);return t.goTo(this._scaleAndRotateViewpoint(f,e,r/i,0))},t.prototype.zoomOut=function(e){void 0===e&&(e=this._getDefaultAnchor());var t=this.view,i=t.scale,r=t.constraints.snapToPreviousScale(i);return t.goTo(this._scaleAndRotateViewpoint(f,e,r/i,0))},t.prototype.setViewpoint=function(e,t,i,r){this.begin(),this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,e,t,i,r),this.end()},t.prototype.animateViewpoint=function(e,t,i){return this.view.goTo(this._scaleAndRotateViewpoint(f,e,t,i))},t.prototype.continousRotateClockwise=function(){var e=this.get("view.viewpoint");this.animationManager.animateContinous(e,function(e){l.rotateBy(e,e,-1)})},t.prototype.continousRotateCounterclockwise=function(){var e=this.get("view.viewpoint");this.animationManager.animateContinous(e,function(e){l.rotateBy(e,e,1)})},t.prototype.resetRotation=function(){this.view.rotation=0},t.prototype.continousPanLeft=function(){var e=this.get("view.viewpoint");this.animationManager.animateContinous(e,function(e){l.translateBy(e,e,[-10,0])})},t.prototype.continousPanRight=function(){var e=this.get("view.viewpoint");this.animationManager.animateContinous(e,function(e){l.translateBy(e,e,[10,0])})},t.prototype.continousPanUp=function(){var e=this.get("view.viewpoint");this.animationManager.animateContinous(e,function(e){l.translateBy(e,e,[0,10])})},t.prototype.continousPanDown=function(){var e=this.get("view.viewpoint");this.animationManager.animateContinous(e,function(e){l.translateBy(e,e,[0,-10])})},t.prototype.stop=function(){this.pan.stopMomentumNavigation(),this.animationManager.stop(),this.end(),this._endTimer&&(clearTimeout(this._endTimer),this._endTimer=0)},t.prototype._getDefaultAnchor=function(){var e=this.view.size;return p[0]=.5*e[0],p[1]=.5*e[1],p},t.prototype._scaleAndRotateViewpoint=function(e,t,i,r){var n=this.view,o=n.size,s=n.padding,a=n.constraints,u=n.scale,h=n.viewpoint,c=u*i,d=a.canZoomInTo(c),f=a.canZoomOutTo(c);return i<1&&!d||i>1&&!f?h:l.padAndScaleAndRotateBy(e,h,i,r,t,o,s)},t.prototype._scaleRotateTranslateViewpoint=function(e,t,i,r,n){var o=this.view,s=o.size,a=o.padding,u=o.constraints,h=o.scale,c=o.viewpoint,d=h*i,f=u.canZoomInTo(d),p=u.canZoomOutTo(d);return(i<1&&!f||i>1&&!p)&&(i=1),l.translateBy(c,c,n),l.padAndScaleAndRotateBy(e,c,i,r,t,s,a)},r([s.property()],t.prototype,"animationManager",void 0),r([s.property({type:Boolean,readOnly:!0})],t.prototype,"interacting",void 0),r([s.property()],t.prototype,"pan",void 0),r([s.property()],t.prototype,"pinch",void 0),r([s.property()],t.prototype,"rotate",void 0),r([s.property()],t.prototype,"view",void 0),r([s.property()],t.prototype,"zoomBox",void 0),r([s.subclass("esri.views.2d.navigation.MapViewNavigation")],t)}(s.declared(o));t.default=_}.apply(null,r))||(e.exports=n)},2315:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(5),i(2)],void 0===(n=function(e,t,i,r,n,o){var s="esri-zoom-box__container",a="esri-zoom-box__overlay",l="esri-zoom-box__overlay-background",u="esri-zoom-box__outline",h="Shift",c="Ctrl";return function(e){function t(t){var i=e.call(this,t)||this;return i._container=null,i._overlay=null,i._backgroundShape=null,i._boxShape=null,i._box={x:0,y:0,width:0,height:0},i._redraw=i._redraw.bind(i),i}return i(t,e),t.prototype.destroy=function(){this.view=null},Object.defineProperty(t.prototype,"view",{set:function(e){var t=this;this._handles&&this._handles.forEach(function(e){e.remove()}),this._handles=null,this._destroyOverlay(),this._set("view",e),e&&(e.on("drag",[h],function(e){return t._handleDrag(e,1)}),e.on("drag",[h,c],function(e){return t._handleDrag(e,-1)}))},enumerable:!0,configurable:!0}),t.prototype._start=function(e,t,i,r){this._createContainer(),this._createOverlay(),this.navigation.begin()},t.prototype._update=function(e,t,i,r){this._box.x=e,this._box.y=t,this._box.width=i,this._box.height=r,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))},t.prototype._end=function(e,t,i,r,n){var o=this.view,s=o.toMap(e+.5*i,t+.5*r),a=Math.max(i/o.width,r/o.height);-1===n&&(a=1/a),this._destroyOverlay(),this.navigation.end(),o.goTo({center:s,scale:o.scale*a})},t.prototype._updateBox=function(e,t,i,r){var n=this._boxShape;n.setAttributeNS(null,"x",""+e),n.setAttributeNS(null,"y",""+t),n.setAttributeNS(null,"width",""+i),n.setAttributeNS(null,"height",""+r),n.setAttributeNS(null,"class",u)},t.prototype._updateBackground=function(e,t,i,r){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(e,t,i,r,this.view.width,this.view.height))},t.prototype._createContainer=function(){var e=document.createElement("div");e.className=s,this.view.root.appendChild(e),this._container=e},t.prototype._createOverlay=function(){var e=this.view.width,t=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+e+" 0 L "+e+" "+t+" L 0 "+t+" Z"),i.setAttributeNS(null,"class",l);var r=document.createElementNS("http://www.w3.org/2000/svg","rect"),n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),n.setAttributeNS(null,"class",a),n.appendChild(i),n.appendChild(r),this._container.appendChild(n),this._backgroundShape=i,this._boxShape=r,this._overlay=n},t.prototype._destroyOverlay=function(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null},t.prototype._toSVGPath=function(e,t,i,r,n,o){var s=e+i,a=t+r;return"M 0 0 L "+n+" 0 L "+n+" "+o+" L 0 "+o+" ZM "+e+" "+t+" L "+e+" "+a+" L "+s+" "+a+" L "+s+" "+t+" Z"},t.prototype._handleDrag=function(e,t){var i,r,n,o,s=e.x,a=e.y,l=e.origin.x,u=e.origin.y;switch(s>l?(i=l,n=s-l):(i=s,n=l-s),a>u?(r=u,o=a-u):(r=a,o=u-a),e.action){case"start":this._start(i,r,n,o);break;case"update":this._update(i,r,n,o);break;case"end":this._end(i,r,n,o,t)}e.stopPropagation()},t.prototype._redraw=function(){if(this._rafId&&(this._rafId=null,this._overlay)){var e=this._box,t=e.x,i=e.y,r=e.width,n=e.height;this._updateBox(t,i,r,n),this._updateBackground(t,i,r,n),this._rafId=requestAnimationFrame(this._redraw)}},r([o.property()],t.prototype,"navigation",void 0),r([o.property()],t.prototype,"view",null),r([o.subclass("esri.views.2d.navigation.ZoomBox")],t)}(o.declared(n))}.apply(null,r))||(e.exports=n)},2316:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(5),i(2),i(36),i(124),i(2317)],void 0===(n=function(e,t,i,r,n,o,s,a,l){return function(e){function t(t){var i=e.call(this)||this;return i.animationTime=0,i.momentumEstimator=new l.PanPlanarMomentumEstimator(500,6,.92),i.momentum=null,i.tmpMomentum=s.vec3f64.create(),i.momentumFinished=!1,i.viewpoint=a.create(),i.watch("momentumFinished",function(e){e&&i.navigation.stop()}),i}return i(t,e),t.prototype.begin=function(e,t){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(t),this.previousDrag=t},t.prototype.update=function(e,t){this.addToEstimator(t);var i=t.center.x,r=t.center.y,n=this.previousDrag;i=n?n.center.x-i:-i,r=n?r-n.center.y:r,e.viewpoint=a.translateBy(this.viewpoint,e.viewpoint,[i||0,r||0]),this.previousDrag=t},t.prototype.end=function(e,t){this.addToEstimator(t),this.momentum=this.momentumEstimator.evaluateMomentum(),this.animationTime=0,this.momentum&&this.onAnimationUpdate(e),this.previousDrag=null,this.navigation.end()},t.prototype.addToEstimator=function(e){var t=e.center.x,i=e.center.y,r=s.vec3f64.fromValues(-t,i,0);this.momentumEstimator.add(r,r,.001*e.timestamp)},t.prototype.onAnimationUpdate=function(e){var t=this;this.navigation.animationManager.animateContinous(e.viewpoint,function(i,r){t.momentumFinished=!t.momentum||t.momentum.isFinished(t.animationTime);var n=.001*r;if(!t.momentumFinished){var o=t.momentum.valueDelta(t.animationTime,n);s.vec3.scale(t.tmpMomentum,t.momentum.direction,o),e.viewpoint=a.translateBy(i,i,t.tmpMomentum)}t.animationTime+=n})},t.prototype.stopMomentumNavigation=function(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())},r([o.property()],t.prototype,"momentumFinished",void 0),r([o.property()],t.prototype,"viewpoint",void 0),r([o.property()],t.prototype,"navigation",void 0),r([o.subclass("esri.views.2d.navigation.actions.Pan")],t)}(o.declared(n))}.apply(null,r))||(e.exports=n)},2317:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(36),i(1997),i(1926)],void 0===(n=function(e,t,i,r,n,o){Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t,i,r,n,o){var s=e.call(this,t,i,r)||this;return s.sceneVelocity=n,s.direction=o,s}return i(t,e),t.prototype.value=function(t){return e.prototype.valueFromInitialVelocity.call(this,this.sceneVelocity,t)},t}(o.Momentum);t.PanPlanarMomentum=s;var a=function(){function e(e,t,i){void 0===e&&(e=300),void 0===t&&(t=12),void 0===i&&(i=.84),this.minimumInitialVelocity=e,this.stopVelocity=t,this.friction=i,this.time=new n.FilteredFiniteDifference(.6),this.screen=[new n.FilteredFiniteDifference(.4),new n.FilteredFiniteDifference(.4)],this.scene=[new n.FilteredFiniteDifference(.6),new n.FilteredFiniteDifference(.6),new n.FilteredFiniteDifference(.6)],this.tmpDirection=r.vec3f64.create()}return e.prototype.add=function(e,t,i){this.time.hasLastValue&&this.time.computeDelta(i)<.015||(this.screen[0].update(e[0]),this.screen[1].update(e[1]),this.scene[0].update(t[0]),this.scene[1].update(t[1]),this.scene[2].update(t[2]),this.time.update(i))},e.prototype.reset=function(){this.screen[0].reset(),this.screen[1].reset(),this.scene[0].reset(),this.scene[1].reset(),this.scene[2].reset(),this.time.reset()},e.prototype.evaluateMomentum=function(){if(!this.screen[0].hasFilteredDelta)return null;var e=this.screen[0].filteredDelta,t=this.screen[1].filteredDelta,i=Math.sqrt(e*e+t*t)/this.time.filteredDelta;return Math.abs(i)<this.minimumInitialVelocity?null:this.createMomentum(i,this.stopVelocity,this.friction)},e.prototype.createMomentum=function(e,t,i){r.vec3.set(this.tmpDirection,this.scene[0].filteredDelta,this.scene[1].filteredDelta,this.scene[2].filteredDelta);var n=r.vec3.length(this.tmpDirection);n>0&&r.vec3.scale(this.tmpDirection,this.tmpDirection,1/n);var o=n/this.time.filteredDelta;return new s(e,t,i,o,this.tmpDirection)},e}();t.PanPlanarMomentumEstimator=a}.apply(null,r))||(e.exports=n)},2318:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(5),i(2),i(36),i(124),i(2319),i(2320)],void 0===(n=function(e,t,i,r,n,o,s,a,l,u){return function(e){function t(t){var i=e.call(this,t)||this;return i._animationTime=0,i._momentumFinished=!1,i._rotationMomentumEstimator=new l.RotationMomentumEstimator(.6,.15,.95),i._rotationDirection=1,i._zoomDirection=1,i._zoomMomentumEstimator=new u.ZoomMomentumEstimator,i._zoomOnly=null,i.zoomMomentum=null,i.rotateMomentum=null,i.viewpoint=a.create(),i.watch("_momentumFinished",function(e){e&&i.navigation.stop()}),i}return i(t,e),t.prototype.begin=function(e,t){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=t.angle,this._previousRadius=this._startRadius=t.radius,this._previousCenter=t.center,this._updateTimestamp=null,e.constraints.rotationEnabled&&this.addToRotateEstimator(0,t.timestamp),this.addToZoomEstimator(t,1)},t.prototype.update=function(e,t){null===this._updateTimestamp&&(this._updateTimestamp=t.timestamp);var i=t.angle,r=t.radius,n=t.center,o=Math.abs(180*(i-this._startAngle)/Math.PI),s=Math.abs(r-this._startRadius),a=this._startRadius/r;if(this._previousRadius){var l=r/this._previousRadius,u=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=u>=0?1:-1,this._zoomDirection=l>=1?1:-1,e.constraints.rotationEnabled?(null===this._zoomOnly&&t.timestamp-this._updateTimestamp>200&&(this._zoomOnly=s-o>0),null===this._zoomOnly||this._zoomOnly?u=0:this.addToRotateEstimator(i-this._startAngle,t.timestamp)):u=0,this.addToZoomEstimator(t,a),this.navigation.setViewpoint([n.x,n.y],1/l,u,[this._previousCenter.x-n.x,n.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=r,this._previousCenter=n},t.prototype.end=function(e,t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(e),this.navigation.end()},t.prototype.addToRotateEstimator=function(e,t){this._rotationMomentumEstimator.add(e,.001*t)},t.prototype.addToZoomEstimator=function(e,t){this._zoomMomentumEstimator.add(t,.001*e.timestamp)},t.prototype.canZoomIn=function(e){var t=e.scale,i=e.constraints.effectiveMaxScale;return 0===i||t>i},t.prototype.canZoomOut=function(e){var t=e.scale,i=e.constraints.effectiveMinScale;return 0===i||t<i},t.prototype.onAnimationUpdate=function(e){var t=this;this.navigation.animationManager.animateContinous(e.viewpoint,function(i,r){var n=!t.canZoomIn(e)&&t._zoomDirection>1||!t.canZoomOut(e)&&t._zoomDirection<1,o=!t.rotateMomentum||t.rotateMomentum.isFinished(t._animationTime),l=n||!t.zoomMomentum||t.zoomMomentum.isFinished(t._animationTime),u=.001*r;if(t._momentumFinished=o&&l,!t._momentumFinished){var h=t.rotateMomentum?Math.abs(t.rotateMomentum.valueDelta(t._animationTime,u))*t._rotationDirection*180/Math.PI:0,c=t.zoomMomentum?Math.abs(t.zoomMomentum.valueDelta(t._animationTime,u)):1,d=s.vec2f64.create(),f=s.vec2f64.create();if(t._previousCenter){s.vec2.set(d,t._previousCenter.x,t._previousCenter.y),a.getPaddingScreenTranslation(f,e.size,e.padding),s.vec2.add(d,d,f);var p=e.constraints,_=e.scale,v=_*c;c<1&&!p.canZoomInTo(v)?(c=_/p.effectiveMaxScale,t.zoomMomentum=null,t.rotateMomentum=null):c>1&&!p.canZoomOutTo(v)&&(c=_/p.effectiveMinScale,t.zoomMomentum=null,t.rotateMomentum=null),a.scaleAndRotateBy(i,e.viewpoint,c,h,d,e.size)}}t._animationTime+=u})},t.prototype.stopMomentumNavigation=function(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())},r([o.property()],t.prototype,"_momentumFinished",void 0),r([o.property()],t.prototype,"viewpoint",void 0),r([o.property()],t.prototype,"navigation",void 0),r([o.subclass("esri.views.2d.navigation.actions.Pinch")],t)}(o.declared(n))}.apply(null,r))||(e.exports=n)},2319:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(1998)],void 0===(n=function(e,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(t,i,r,n){return void 0===t&&(t=3),void 0===i&&(i=.01),void 0===r&&(r=.95),void 0===n&&(n=12),e.call(this,t,i,r,n)||this}return i(t,e),t.prototype.add=function(t,i){if(this.value.hasLastValue){for(var r=this.value.lastValue,n=t-r;n>Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;t=r+n}e.prototype.add.call(this,t,i)},t}(r.MomentumEstimator);t.RotationMomentumEstimator=n}.apply(null,r))||(e.exports=n)},2320:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(28),i(1926),i(1998)],void 0===(n=function(e,t,i,r,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return i(t,e),t.prototype.value=function(t){var i=e.prototype.value.call(this,t);return Math.exp(i)},t.prototype.valueDelta=function(t,i){var r=e.prototype.value.call(this,t),n=e.prototype.value.call(this,t+i)-r;return Math.exp(n)},t}(r.Momentum);t.ZoomMomentum=o;var s=function(e){function t(t,i,r,n){return void 0===t&&(t=2.5),void 0===i&&(i=.01),void 0===r&&(r=.95),void 0===n&&(n=12),e.call(this,t,i,r,n)||this}return i(t,e),t.prototype.add=function(t,i){e.prototype.add.call(this,Math.log(t),i)},t.prototype.createMomentum=function(e,t,i){return new o(e,t,i)},t}(n.MomentumEstimator);t.ZoomMomentumEstimator=s}.apply(null,r))||(e.exports=n)},2321:function(e,t,i){var r,n;r=[i.dj.c(e.i),t,i(1),i(0),i(5),i(2),i(36),i(124)],void 0===(n=function(e,t,i,r,n,o,s,a){var l=s.vec2f64.create(),u=s.vec2f64.create();return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._previousCenter=s.vec2f64.create(),t.viewpoint=a.create(),t}return i(t,e),t.prototype.begin=function(e,t){this.navigation.begin(),s.vec2.set(this._previousCenter,t.center.x,t.center.y)},t.prototype.update=function(e,t){var i=e.state,r=i.size,n=i.padding;s.vec2.set(l,t.center.x,t.center.y),a.getAnchor(u,r,n),e.viewpoint=a.rotateBy(this.viewpoint,e.content.viewpoint,a.angleBetween(u,this._previousCenter,l)),s.vec2.copy(this._previousCenter,l)},t.prototype.end=function(e,t){this.navigation.end()},r([o.property()],t.prototype,"viewpoint",void 0),r([o.property()],t.prototype,"navigation",void 0),r([o.subclass("esri.views.2d.actions.Rotate")],t)}(o.declared(n))}.apply(null,r))||(e.exports=n)}}]);