{"size": 117426, "ext": "js", "max_stars_repo_path": "static/js/48.eba53c7b.chunk.js", "max_stars_repo_name": "Esri/cim-symbol-builder-js", "max_stars_repo_stars_event_min_datetime": "2021-01-05T13:20:07.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-28T07:38:52.000Z", "max_issues_repo_path": "static/js/48.eba53c7b.chunk.js", "max_issues_repo_name": "Esri/cim-symbol-builder-js", "max_issues_repo_issues_event_min_datetime": "2021-09-23T18:28:39.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-04T16:44:04.000Z", "max_forks_repo_path": "static/js/48.eba53c7b.chunk.js", "max_forks_repo_name": "Esri/cim-symbol-builder-js", "max_forks_repo_forks_event_min_datetime": "2021-03-25T09:10:54.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-28T07:38:34.000Z"}
{"max_stars_count": 8, "max_issues_count": 4, "max_forks_count": 3, "avg_line_length": 58713.0, "max_line_length": 117380, "alphanum_fraction": 0.7027319333}
(this["webpackJsonpmy-app"]=this["webpackJsonpmy-app"]||[]).push([[48],{537:function(t,e,i){"use strict";i.d(e,"a",(function(){return d})),i.d(e,"b",(function(){return p})),i.d(e,"c",(function(){return _})),i.d(e,"d",(function(){return y})),i.d(e,"e",(function(){return c})),i.d(e,"f",(function(){return m})),i.d(e,"g",(function(){return o})),i.d(e,"h",(function(){return h}));var s=i(9),r=i(534),n=i(632);function a(t,e=!1){const i=r.e.SIZE_FIELD_STOPS|r.e.SIZE_MINMAX_VALUE|r.e.SIZE_SCALE_STOPS|r.e.SIZE_UNIT_VALUE,s=(t&(r.f.FIELD_TARGETS_OUTLINE|r.f.MINMAX_TARGETS_OUTLINE|r.f.SCALE_TARGETS_OUTLINE|r.f.UNIT_TARGETS_OUTLINE))>>>4;return e?i&s:i&~s}function o(t,e,i,s,n){switch(t){case r.d.FILL:return d.from(e,s);case r.d.LINE:return _.from(e,i);case r.d.MARKER:return y.from(e);case r.d.TEXT:return m.from(e);case r.d.LABEL:return p.from(e,n);default:throw new Error("Unable to createMaterialKey for unknown geometryType "+t)}}function h(t){switch(c.load(t).geometryType){case r.d.MARKER:return new y(t);case r.d.FILL:return new d(t);case r.d.LINE:return new _(t);case r.d.TEXT:return new m(t);case r.d.LABEL:return new p(t)}}class c{constructor(t){this._data=0,this._data=t}static load(t){const e=this.shared;return e.data=t,e}set data(t){this._data=t}get data(){return this._data}get geometryType(){return this.bits(8,11)}set geometryType(t){this.setBits(t,8,11)}get mapAligned(){return!!this.bit(20)}set mapAligned(t){this.setBit(20,t)}get sdf(){return!!this.bit(11)}set sdf(t){this.setBit(11,t)}get pattern(){return!!this.bit(12)}set pattern(t){this.setBit(12,t)}get textureBinding(){return this.bits(0,8)}set textureBinding(t){this.setBits(t,0,8)}get geometryTypeString(){switch(this.geometryType){case r.d.FILL:return"fill";case r.d.MARKER:return"marker";case r.d.LINE:return"line";case r.d.TEXT:return"text";case r.d.LABEL:return"label";default:throw new s.a("Unable to handle unknown geometryType: "+this.geometryType)}}setBit(t,e){const i=1<<t;e?this._data|=i:this._data&=~i}bit(t){return(this._data&1<<t)>>t}setBits(t,e,i){for(let s=e,r=0;s<i;s++,r++)this.setBit(s,0!=(t&1<<r))}bits(t,e){let i=0;for(let s=t,r=0;s<e;s++,r++)i|=this.bit(s)<<r;return i}hasVV(){return!1}setVV(t,e){}getVariation(){return{mapAligned:this.mapAligned,pattern:this.pattern,sdf:this.sdf}}getVariationHash(){return this._data&~(7&this.textureBinding)}}c.shared=new c(0);const l=t=>class extends t{get vvSizeMinMaxValue(){return 0!==this.bit(16)}set vvSizeMinMaxValue(t){this.setBit(16,t)}get vvSizeScaleStops(){return 0!==this.bit(17)}set vvSizeScaleStops(t){this.setBit(17,t)}get vvSizeFieldStops(){return 0!==this.bit(18)}set vvSizeFieldStops(t){this.setBit(18,t)}get vvSizeUnitValue(){return 0!==this.bit(19)}set vvSizeUnitValue(t){this.setBit(19,t)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(t,e){super.setVV(t,e);const i=a(t,e)&t;this.vvSizeMinMaxValue=!!(i&r.e.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(i&r.e.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(i&r.e.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(i&r.e.SIZE_SCALE_STOPS)}},u=t=>class extends t{get vvRotation(){return 0!==this.bit(15)}set vvRotation(t){this.setBit(15,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e&&!!(t&r.e.ROTATION)}},f=t=>class extends t{get vvColor(){return 0!==this.bit(13)}set vvColor(t){this.setBit(13,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e&&!!(t&r.e.COLOR)}},x=t=>class extends t{get vvOpacity(){return 0!==this.bit(14)}set vvOpacity(t){this.setBit(14,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e&&!!(t&r.e.OPACITY)}};class d extends(f(x(c))){static load(t){const e=this.shared;return e.data=t,e}static from(t,e){const i=this.load(0);return i.geometryType=r.d.FILL,e?i.dotDensity=!0:i.setVV(t,!1),i.data}getVariation(){return{...super.getVariation(),dotDensity:this.dotDensity,vvColor:this.vvColor,vvOpacity:this.vvOpacity}}get dotDensity(){return!!this.bit(15)}set dotDensity(t){this.setBit(15,t)}}d.shared=new d(0);class y extends(f(x(u(l(c))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=r.d.MARKER,e.setVV(t,!1),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}y.shared=new y(0);class _ extends(f(x(l(c)))){static load(t){const e=this.shared;return e.data=t,e}static from(t,e){const i=this.load(0);return i.geometryType=r.d.LINE,i.setVV(t,e),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}_.shared=new _(0);class m extends(f(x(u(l(c))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(t);return e.geometryType=r.d.TEXT,e.setVV(t,!1),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}m.shared=new m(0);class p extends(l(c)){static load(t){const e=this.shared;return e.data=t,e}static from(t,e){const i=this.load(0);return i.geometryType=r.d.LABEL,i.setVV(t,!1),i.mapAligned=Object(n.a)(e),i.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}p.shared=new p(0)},541:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return h})),i.d(e,"d",(function(){return l})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return c})),i.d(e,"g",(function(){return o})),i.d(e,"h",(function(){return n}));const s=0,r=100;function n(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function a(t,e){return Math.sqrt(t*t+e*e)}function o(t){const e=a(t[0],t[1]);t[0]/=e,t[1]/=e}function h(t,e){return a(t[0]-e[0],t[1]-e[1])}function c(t){return"function"==typeof t}function l(t=2){return 1/Math.max(t,1)}function u(t,e){return[!!t.minScale&&e.scaleToZoom(t.minScale)||s,!!t.maxScale&&e.scaleToZoom(t.maxScale)||r]}},551:function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));var s=i(3),r=i(46),n=i(343),a=i(305);class o{static executeEffects(t,e){const i=Object(r.c)(e);let s=new n.a(i);for(const r of t){const t=Object(a.a)(r);t&&(s=t.execute(s,r,96/72))}return s}static next(t){const e=t.next();return Object(r.d)(e),e}}class h{bindFeature(t,e,i){}write(t,e,i){if(Object(s.i)(this._effects))return this._write(t,e);const r=o.executeEffects(this._effects,e.readLegacyGeometryForDisplay());let n=o.next(r);for(;n;)this._write(t,e,n),n=o.next(r)}_write(t,e,i){}}},552:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i(9);function r(t,e){if(t&&"name"in t){const i=t;return e&&e.error(new s.a(i.name,i.message,i.details)),!1}return!0}},560:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t,e){this._pos=0;const i=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(i),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}get length(){return this._pos}_roundToNearest(t,e){const i=Math.round(t);return i+(e-i%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest(1.5*(this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),s=new this._ctor(i);s.set(this._buffer,0),this._array=i,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length<t)throw new Error("Increment index overflows the target buffer");this._buffer[t]++}decr(t){this._buffer[t]--}writeRegion(t){this._ensureSize(t.length);const e=this._pos;return this._buffer.set(t,this._pos),this._pos+=t.length,e}writeManyFrom(t,e,i){this._ensureSize(i-e);for(let s=e;s!==i;s++)this.writeFixed(t._buffer[s])}buffer(){const t=this._array.slice(0,4*this._pos);return this.destroy(),t}toArray(){const t=this._array,e=[];for(let i=0;i<t.byteLength/4;i++)e.push(t[i]);return e}seek(t){this._pos=t}destroy(){this._array=null,this._buffer=null}}},561:function(t,e,i){"use strict";i.d(e,"a",(function(){return l})),i.d(e,"b",(function(){return h})),i.d(e,"c",(function(){return c})),i.d(e,"d",(function(){return o}));Number.POSITIVE_INFINITY;const s=Math.PI,r=128/s,n=1/Math.LN2;function a(t,e){return(t%=e)>=0?t:t+e}function o(t){return a(t*r,256)}function h(t){return a(t*(256/360),256)}function c(t){return Math.log(t)*n}function l(t,e,i){return t>=e&&t<=i||t>=i&&t<=e}},564:function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return h}));var s=i(42),r=i(5);let n=null,a=null;async function o(){return n||(n=async function(){const t=Object(r.a)("csp-restrictions")?await Promise.all([i.e(71),i.e(160)]).then(i.bind(null,651)).then((function(t){return t.l})):await i.e(98).then(i.bind(null,652)).then((function(t){return t.l}));a=await t.load({locateFile:()=>Object(s.a)("esri/core/libs/libtess/libtess.wasm")})}()),n}function h(t,e){const i=Math.max(t.length,128e3);return a.triangulate(t,e,i)}},574:function(t,e,i){"use strict";function s(t){const e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}i.d(e,"a",(function(){return s}))},577:function(t,e,i){"use strict";i.d(e,"a",(function(){return x}));var s=i(18),r=i(550),n=i(540),a=i(533),o=i(536),h=i(537),c=i(541),l=i(578),u=i(551),f=i(558);class x extends(Object(l.a)(u.a)){constructor(t,e,i,n,c,l,u,f,x,d,y,_,m,p,g,b,v,O=!1,w,M){super(),this._xOffset=Object(s.c)(_),this._yOffset=Object(s.c)(m),this._decoration=x||"none",this._color=n,this._haloColor=c,this._haloSize=Math.min(Math.floor(5*Object(s.c)(Object(s.e)(i))),127),this._size=Math.min(Math.round(Object(s.c)(e)),127);const j=Math.min(Math.round(Object(s.c)(e)),127);this._referenceSize=Math.round(Math.sqrt(256*j)),this._scale=this._size/24,this._angle=y,this._justify=Object(r.c)(l||"center"),this._xAlignD=Object(r.d)(l||"center"),this._yAlignD=Object(r.f)(u||"baseline"),this._baseline="baseline"===(u||"baseline"),this._bitset=(1===f?1:0)|(d?1:0)<<1;const S=h.e.load(t);S.sdf=!0,this._materialKey=S.data,this._lineWidth=Object(s.c)(p)||512,this._lineHeight=g||1,this._textPlacement=b,this._effects=v,this._isCIM=O,this._minMaxZoom=Object(o.a)(Math.round(w*a.l),Math.round(M*a.l))}static fromText(t,e){const i=new x(t.materialKey,t.font.size,t.haloSize||0,t.color&&Object(n.d)(t.color)||0,t.haloColor&&Object(n.d)(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,0,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,c.b,c.a),[,s]=Object(f.a)(t.text);return i.bindTextInfo(e,s),i._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,i}static fromCIMText(t,e,i){const s=t.scaleFactor||1,r=t.size*t.sizeRatio*s,[a,o]=Object(c.e)(t.scaleInfo,i),h=new x(t.materialKey,r,t.outlineSize*t.sizeRatio,Object(n.c)(t.color),Object(n.c)(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*s,t.offsetY*t.sizeRatio*s,512,1,t.markerPlacement,t.effects,!0,a,o),[,l]=Object(f.a)(t.text);return h.bindTextInfo(e,l),h._vertexBoundsScale=t.maxVVSize?t.maxVVSize/r:1,h}}},578:function(t,e,i){"use strict";i.d(e,"a",(function(){return f}));var s=i(3),r=i(18),n=i(299),a=i(579),o=i(533),h=i(534),c=i(536),l=i(537),u=i(583);const f=t=>class extends t{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=h.d.TEXT,this._aux=Object(c.b)(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=Object(s.a)(t,t=>Object(u.a)(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:o.j*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM})):this._shapingInfo=null}_write(t,e,i){const s=e.getDisplayId();this._writeGeometry(t,e,s,i)}_writeGeometry(t,e,i,r){const a=this._shapingInfo;if(Object(s.i)(a))return;if(Object(s.j)(this._textPlacement)){const s=null!=r?r:e.readLegacyGeometryForDisplay();return this._writePlacedText(t,i,s,a)}const o=r?Object(n.p)(Object(n.d)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s.i)(o)){if(o.isPoint){const[e,s]=o.coords;return this._writeGlyphs(t,i,{x:e,y:s},a)}o.forEachVertex((e,s)=>this._writeGlyphs(t,i,{x:e,y:s},a))}}_writePlacedText(t,e,i,n){const o=Object(s.q)(this._textPlacement),h=a.a.getPlacement(i,o,Object(r.c)(1));if(!h)return;let c=h.next();for(;null!=c;){const i=c.getAngle();n.setRotation(i);const s=c.tx,r=c.ty;s<0||s>=512||r<0||r>=512||(this._writeGlyphs(t,e,{x:s,y:r},n),n.setRotation(-i)),c=h.next()}}_writeGlyphs(t,e,i,s){const r=l.e.load(this._materialKey),n=Object(c.a)(Math.round(8*i.x),Math.round(8*i.y)),a=this._vertexBoundsScale,o=s.bounds,h=2*Math.max(o.width,o.height);for(const c of s.glyphs)r.textureBinding=c.textureBinding,t.recordStart(e,r.data,this.geometryType,!1,!0),t.vertexBounds(i.x+o.x+this._xOffset,i.y+o.y-this._yOffset,h*a,h*a),this._writeVertices(t,e,n,c),t.recordEnd()}_writeGlyph(t,e,i,s,r){const n=l.e.load(this._materialKey),a=Object(c.a)(Math.round(8*i),Math.round(8*s));n.textureBinding=r.textureBinding,t.recordStart(e,n.data,this.geometryType,!1,!0);const o=r.bounds,h=this._vertexBoundsScale;t.vertexBounds(i+o.x*h,s+o.y*h,o.width*h,o.height*h),this._writeVertices(t,e,a,r),t.recordEnd()}_writeVertices(t,e,i,s){const r=t.vertexCount();this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperLeft),t.vertexWrite(s.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperRight),t.vertexWrite(s.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerLeft),t.vertexWrite(s.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerRight),t.vertexWrite(s.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,a=Object(c.b)(0,0,this._referenceSize,this._bitset),o=Object(c.b)(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(o),t.vertexWrite(a),t.vertexWrite(this._minMaxZoom)}}},579:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i(46),r=i(305);class n{static getPlacement(t,e,i){const n=Object(r.b)(e);if(!n)return null;const a=Object(s.c)(t);return n.execute(a,e,i)}}},580:function(t,e,i){"use strict";i.d(e,"a",(function(){return d}));var s=i(3),r=i(18),n=i(327),a=i(300),o=i(540),h=i(533),c=i(536),l=i(537),u=i(541),f=i(581),x=i(551);class d extends(Object(f.a)(x.a)){constructor(t,e,i,s,r,o,u,f,x,d,y,_,m,p,g,b,v,O,w,M,j,S,T){super(),this.angle=s,this.height=u,this.width=o,this.xOffset=e*w,this.yOffset=i*w,this._markerPlacement=M,this._effects=j,this._anchorX=.5-(.5+b)*g.width/g.width,this._anchorY=.5-(.5+v)*g.height/g.height,this._minMaxZoom=Object(c.a)(Math.round(S*h.l),Math.round(T*h.l));const L=(1===p?1:0)|(y?1:0)<<1|(m?1:0)<<2|(_?1:0)<<3,z=g&&g.sdf,I=l.d.load(t);I.sdf=z,I.pattern=!0,I.textureBinding=g.textureBinding,this._materialKey=I.data,this._fillColor=r,this._outlineColor=x,this._sizeOutlineWidth=Object(c.b)(Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*u),255)),Math.round(Math.min(Math.sqrt(128*d),255)),Math.round(Math.min(Math.sqrt(128*f),255)));const P=g.rect.x+h.p,V=g.rect.y+h.p,C=P+g.width,E=V+g.height;this._offsets.xUpperLeft=P,this._offsets.yUpperLeft=V,this._offsets.xUpperRight=C,this._offsets.yUpperRight=V,this._offsets.xBottomLeft=P,this._offsets.yBottomLeft=E,this._offsets.xBottomRight=C,this._offsets.yBottomRight=E,this._texUpperLeft=Object(c.a)(P,V),this._texUpperRight=Object(c.a)(C,V),this._texBottomLeft=Object(c.a)(P,E),this._texBottomRight=Object(c.a)(C,E),o*=O,u*=O,o*=w,u*=w;const R=Math.round(64*O);this._bitestAndDistRatio=Object(c.a)(L,R),this._computedWidth=o,this._computedHeight=u;const W=Object(a.a)(),k=Object(n.a)();this._applyTransformation(k,W)}static fromCIMMarker(t,e,i){const n=e&&e.width||1,a=e&&e.height||1,h=t.size,c=n/a*t.scaleX,l=t.scaleSymbolsProportionally&&t.frameHeight?h/t.frameHeight:1,f=Object(o.c)(t.color),x=Object(o.c)(t.outlineColor),y=Object(r.c)(h),_=y*c,m=Object(r.c)(t.offsetX||0),p=Object(r.c)(t.offsetY||0),g=Object(r.c)(t.outlineWidth||0)*l,b=t.alignment||0,v=Object(r.c)(t.referenceSize),[O,w]=Object(u.e)(t.scaleInfo,i);let M=t.rotation||0;t.rotateClockwise||(M=-M);let j=0,S=0;const T=t.anchorPoint;T&&(t.isAbsoluteAnchorPoint?h&&(j=-T.x/(h*c),S=T.y/h):(j=T.x,S=T.y));const L=new d(t.materialKey,m,p,M,f,_,y,v,x,g,t.colorLocked,t.scaleSymbolsProportionally,!1,b,e,j,S,t.sizeRatio,Object(s.r)(t.scaleFactor,1),t.markerPlacement,t.effects,O,w);return L._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/_:1,L._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/y:1,L}static fromPictureMarker(t,e){const i=Math.round(Object(r.c)(t.width)),s=Math.round(Object(r.c)(t.height)),n=h.o,a=Math.round(Object(r.c)(t.xoffset||0)),o=Math.round(Object(r.c)(t.yoffset||0)),c=new d(t.materialKey,a,o,t.angle,n,i,s,s,0,0,!1,!1,!1,0,e,0,0,1,1,null,null,u.b,u.a);return c._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,c._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,c}static fromSimpleMarker(t,e){const i=Object(o.d)(t.color),s=Math.round(Object(r.c)(t.size)),n=s,a=Math.round(Object(r.c)(t.xoffset||0)),h=Math.round(Object(r.c)(t.yoffset||0)),c=t.style,l=t.outline,f=0|(l&&l.color&&Object(o.d)(l.color)),x=0|(l&&l.width&&Math.round(Object(r.c)(l.width))),y=new d(t.materialKey,a,h,t.angle,i,s,n,n,f,x,!1,!1,"esriSMSCross"===c||"esriSMSX"===c,0,e,0,0,126/64,1,null,null,u.b,u.a);return y.boundsType="esriSMSCircle"===c?"circle":"square",y._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,y._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,y}static fromLineSymbolMarker(t,e){const i=Object(o.d)(t.color),s=Math.round(Object(r.c)(6*t.lineWidth)),n=s,a="cross"===t.style||"x"===t.style;let h;switch(t.placement){case"begin-end":h="Both";break;case"begin":h="JustBegin";break;case"end":h="JustEnd";break;default:h="None"}const c={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:h,offsetAlongLine:0},l=new d(t.materialKey,0,0,0,i,s,n,n/6,i,a?Math.round(Object(r.c)(t.lineWidth)):0,!1,!1,a,1,e,0,0,126/64,1,c,null,u.b,u.a);return l.boundsType="circle"===t.style?"circle":"square",l}}},581:function(t,e,i){"use strict";i.d(e,"a",(function(){return d}));var s=i(3),r=i(18),n=i(76),a=i(327),o=i(29),h=i(300),c=i(299),l=i(579),u=i(534),f=i(536);const x=3.14159265359/180,d=t=>class extends t{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=u.d.MARKER}_write(t,e,i){const s=e.getDisplayId();t.recordStart(s,this._materialKey,this.geometryType,!1,!0),this._writeGeometry(t,e,s,i),t.recordEnd()}_writeGeometry(t,e,i,r){if(Object(s.j)(this._markerPlacement))return this._writePlacedMarkers(t,e,r);const n=r?Object(c.p)(Object(c.d)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s.i)(n)){if(n.isPoint){const[e,s]=n.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<-1||e>=513||s<-1||s>=513))return;return this._writeVertices(t,i,this._getPos(e,s),e,s)}n.forEachVertex((e,s)=>this._writeVertices(t,i,this._getPos(e,s),e,s))}}_writePlacedMarkers(t,e,i){const n=null!=i?i:e.readLegacyGeometryForDisplay(),o=l.a.getPlacement(n,Object(s.q)(this._markerPlacement),Object(r.c)(1));if(!o)return;const c=e.getDisplayId(),u=Object(h.a)(),f=Object(a.a)();let d=o.next();for(;null!=d;){const{tx:e,ty:i}=d;e>=-128&&e<=640&&i>=-128&&i<=640&&(this._applyTransformation(f,u,d.getAngle()/x),this._writeVertices(t,c,this._getPos(e,i),e,i)),d=o.next()}}_writeVertices(t,e,i,s,r){const n=t.vertexCount();t.vertexBounds(s+this.xOffset,r-this.yOffset,this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY),t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2)}_applyTransformation(t,e,i=0){Object(n.d)(t),Object(n.h)(t,t,Object(h.b)(this.xOffset,-this.yOffset)),this.angle+i!==0&&Object(n.f)(t,t,x*(this.angle+i));const s=this._computedWidth,r=this._computedHeight,a=(this._anchorX-.5)*s,c=(this._anchorY-.5)*r;Object(o.m)(e,a,c),Object(o.n)(e,e,t),this._offsetUpperLeft=Object(f.a)(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],Object(o.m)(e,a+s,c),Object(o.n)(e,e,t),this._offsetUpperRight=Object(f.a)(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],Object(o.m)(e,a,c+r),Object(o.n)(e,e,t),this._offsetBottomLeft=Object(f.a)(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],Object(o.m)(e,a+s,c+r),Object(o.n)(e,e,t),this._offsetBottomRight=Object(f.a)(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return Object(f.a)(Math.round(8*t),Math.round(8*e))}}},582:function(t,e,i){"use strict";i.d(e,"a",(function(){return It})),i.d(e,"b",(function(){return zt}));var s=i(9),r=i(4),n=i(12),a=i(337),o=i(49),h=i(18),c=i(540),l=i(533),u=i(561),f=i(536),x=i(537),d=i(541),y=i(3),_=i(299),m=i(534),p=(i(618),i(564)),g=i(103),b=i(595);function v(t,e,i,s,r,n,a){G=0;const o=(s-i)*n,h=r&&r.length,c=h?(r[0]-i)*n:o;let l,u,f,x,d,y=O(e,i,s,0,c,n,!0);if(y&&y.next!==y.prev){if(h&&(y=function(t,e,i,s,r,n){const a=new Array;for(let o=0,h=s.length;o<h;o++){const r=O(t,e,i,s[o]*n,o<h-1?s[o+1]*n:i*n,n,!1);r===r.next&&(r.steiner=!0),a.push(z(r))}a.sort(k);for(const o of a)I(o,r),r=w(r,r.next);return r}(e,i,s,r,y,n)),o>80*n){l=f=e[0+i*n],u=x=e[1+i*n];for(let t=n;t<c;t+=n){const s=e[t+i*n],r=e[t+1+i*n];l=Math.min(l,s),u=Math.min(u,r),f=Math.max(f,s),x=Math.max(x,r)}d=Math.max(f-l,x-u),d=0!==d?1/d:0}M(y,t,n,l,u,d,a,0)}}function O(t,e,i,s,r,n,a){let o;if(a===function(t,e,i,s,r,n){let a=0;for(let o=s,h=r-n;o<r;o+=n)a+=(t[h+e*n]-t[o+e*n])*(t[o+1+e*n]+t[h+1+e*n]),h=o;return a}(t,e,0,s,r,n)>0)for(let h=s;h<r;h+=n)o=T(h+e*n,t[h+e*n],t[h+1+e*n],o);else for(let h=r-n;h>=s;h-=n)o=T(h+e*n,t[h+e*n],t[h+1+e*n],o);return o&&W(o,o.next)&&(L(o),o=o.next),o}function w(t,e=t){if(!t)return t;let i,s=t;do{if(i=!1,s.steiner||!W(s,s.next)&&0!==P(s.prev,s,s.next))s=s.next;else{if(L(s),s=e=s.prev,s===s.next)break;i=!0}}while(i||s!==e);return e}function M(t,e,i,s,r,n,a,o){if(!t)return;!o&&n&&(t=function t(e,i,s,r){for(let n;n!==e;n=n.next){if(n=n||e,null===n.z&&(n.z=R(n.x,n.y,i,s,r)),n.prev.next!==n||n.next.prev!==n)return n.prev.next=n,n.next.prev=n,t(e,i,s,r);n.prevZ=n.prev,n.nextZ=n.next}return e.prevZ.nextZ=null,e.prevZ=null,function(t){let e,i=1;for(;;){let s,r=t;t=null,e=null;let n=0;for(;r;){n++,s=r;let a=0;for(;a<i&&s;a++)s=s.nextZ;let o=i;for(;a>0||o>0&&s;){let i;0===a?(i=s,s=s.nextZ,o--):0!==o&&s?r.z<=s.z?(i=r,r=r.nextZ,a--):(i=s,s=s.nextZ,o--):(i=r,r=r.nextZ,a--),e?e.nextZ=i:t=i,i.prevZ=e,e=i}r=s}if(e.nextZ=null,i*=2,n<2)return t}}(e)}(t,s,r,n));let h=t;for(;t.prev!==t.next;){const c=t.prev,l=t.next;if(n?S(t,s,r,n):j(t))e.push(c.index/i+a),e.push(t.index/i+a),e.push(l.index/i+a),L(t),t=l.next,h=l.next;else if((t=l)===h){o?1===o?M(t=A(t,e,i,a),e,i,s,r,n,a,2):2===o&&F(t,e,i,s,r,n,a):M(w(t),e,i,s,r,n,a,1);break}}}function j(t){const e=t.prev,i=t,s=t.next;if(P(e,i,s)>=0)return!1;let r=t.next.next;const n=r;let a=0;for(;r!==t.prev&&(0===a||r!==n);){if(a++,C(e.x,e.y,i.x,i.y,s.x,s.y,r.x,r.y)&&P(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function S(t,e,i,s){const r=t.prev,n=t,a=t.next;if(P(r,n,a)>=0)return!1;const o=r.x<n.x?r.x<a.x?r.x:a.x:n.x<a.x?n.x:a.x,h=r.y<n.y?r.y<a.y?r.y:a.y:n.y<a.y?n.y:a.y,c=r.x>n.x?r.x>a.x?r.x:a.x:n.x>a.x?n.x:a.x,l=r.y>n.y?r.y>a.y?r.y:a.y:n.y>a.y?n.y:a.y,u=R(o,h,e,i,s),f=R(c,l,e,i,s);let x=t.prevZ,d=t.nextZ;for(;x&&x.z>=u&&d&&d.z<=f;){if(x!==t.prev&&x!==t.next&&C(r.x,r.y,n.x,n.y,a.x,a.y,x.x,x.y)&&P(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,d!==t.prev&&d!==t.next&&C(r.x,r.y,n.x,n.y,a.x,a.y,d.x,d.y)&&P(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;x&&x.z>=u;){if(x!==t.prev&&x!==t.next&&C(r.x,r.y,n.x,n.y,a.x,a.y,x.x,x.y)&&P(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&C(r.x,r.y,n.x,n.y,a.x,a.y,d.x,d.y)&&P(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function T(t,e,i,s){const r=Z.create(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function L(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function z(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function I(t,e){if(e=function(t,e){let i=e;const s=t.x,r=t.y;let n,a=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>a){if(a=t,t===s){if(r===i.y)return i;if(r===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(s===a)return n.prev;const o=n,h=n.x,c=n.y;let l,u=1/0;for(i=n.next;i!==o;)s>=i.x&&i.x>=h&&s!==i.x&&C(r<c?s:a,r,h,c,r<c?a:s,r,i.x,i.y)&&(l=Math.abs(r-i.y)/(s-i.x),(l<u||l===u&&i.x>n.x)&&E(i,t)&&(n=i,u=l)),i=i.next;return n}(t,e)){const i=D(e,t);w(i,i.next)}}function P(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function V(t,e,i,s){return!!(W(t,e)&&W(i,s)||W(t,s)&&W(i,e))||P(t,e,i)>0!=P(t,e,s)>0&&P(i,s,t)>0!=P(i,s,e)>0}function C(t,e,i,s,r,n,a,o){return(r-a)*(e-o)-(t-a)*(n-o)>=0&&(t-a)*(s-o)-(i-a)*(e-o)>=0&&(i-a)*(n-o)-(r-a)*(s-o)>=0}function E(t,e){return P(t.prev,t,t.next)<0?P(t,e,t.next)>=0&&P(t,t.prev,e)>=0:P(t,e,t.prev)<0||P(t,t.next,e)<0}function R(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function W(t,e){return t.x===e.x&&t.y===e.y}function k(t,e){return t.x-e.x}function A(t,e,i,s){let r=t;do{const n=r.prev,a=r.next.next;!W(n,a)&&V(n,r,r.next,a)&&E(n,a)&&E(a,n)&&(e.push(n.index/i+s),e.push(r.index/i+s),e.push(a.index/i+s),L(r),L(r.next),r=t=a),r=r.next}while(r!==t);return r}function F(t,e,i,s,r,n,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.index!==t.index&&B(o,t)){let h=D(o,t);return o=w(o,o.next),h=w(h,h.next),M(o,e,i,s,r,n,a,0),void M(h,e,i,s,r,n,a,0)}t=t.next}o=o.next}while(o!==t)}function B(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!function(t,e){let i=t;do{if(i.index!==t.index&&i.next.index!==t.index&&i.index!==e.index&&i.next.index!==e.index&&V(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&E(t,e)&&E(e,t)&&function(t,e){let i=t,s=!1;const r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)}function D(t,e){const i=Z.create(t.index,t.x,t.y),s=Z.create(e.index,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}class Z{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const s=G<K.length?K[G++]:new Z;return s.index=t,s.x=e,s.y=i,s.prev=null,s.next=null,s.z=null,s.prevZ=null,s.nextZ=null,s.steiner=!1,s}}const K=new Array;let G=0;for(let Pt=0;Pt<8096;Pt++)K.push(new Z);const N=new b.b(0,0,0,1,0),U=new b.b(0,0,0,1,0);function X(t,e,i){let s=0;for(let r=1;r<i;r++){const i=t[2*(e+r-1)],n=t[2*(e+r-1)+1];s+=(t[2*(e+r)]-i)*(t[2*(e+r)+1]+n)}return s}function q(t,e,i,s,r){let n=0;for(let a=i;a<s;a+=3){const i=2*(t.getValue(a)-r),s=2*(t.getValue(a+1)-r),o=2*(t.getValue(a+2)-r);n+=Math.abs((e[i]-e[o])*(e[s+1]-e[i+1])-(e[i]-e[s])*(e[o+1]-e[i+1]))}return n}N.setExtent(l.D),U.setExtent(l.D);const Y=t=>class extends t{constructor(...t){super(...t),this.forceLibtess=!1,this.geometryType=m.d.FILL}_write(t,e,i){const s="esriGeometryPoint"===e.geometryType,r=x.a.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r.dotDensity,s),this._writeGeometry(t,e,r,i,s),t.recordEnd()}_writeGeometry(t,e,i,s,r){const n=this._getGeometry(e,s,r);if(Object(y.i)(n))return;const a=t.indexCount();if(!(n.maxLength>100)&&!this.forceLibtess&&function(t,e){const{coords:i,lengths:s,hasIndeterminateRingOrder:r}=e,n=t.indexWriter(),a=t.vertexCount();if(r)return!1;const o=n.length;let h=0;for(let c=0;c<s.length;){let t=c,e=s[c],r=X(i,h,e);const l=[];for(;++t<s.length;){const n=s[t],a=X(i,h+e,n);if(!(a>0))break;r+=a,l.push(h+e),e+=n}const u=n.length;v(n,i,h,h+e,l,2,a);const f=q(n,i,u,n.length,a),x=Math.abs(r);if(Math.abs((f-x)/Math.max(1e-7,x))>1e-5)return n.seek(o),!1;c=t,h+=e}return!0}(t,n))return void(!(a===t.indexCount())&&this._writeVertices(t,e,n.coords,n.lengths,i));const o=function(t,e){const i=t.indexWriter(),s=t.vertexCount(),{coords:r,lengths:n}=e,{buffer:a,vertexCount:o}=Object(p.b)(r,n);i.ensureSize(o);for(let h=0;h<o;h++)i.push(h+s);return a}(t,n);a!==t.indexCount()&&this._writeVertices(t,e,o,[o.length/2],i)}_writeVertices(t,e,i,s,r){const n=e.getDisplayId();let a=0;const o=s.reduce((t,e)=>t+e),h=r.dotDensity?4:10;t.vertexEnsureSize(h*o);for(const c of s){const s=c+a;for(let o=a;o<s;o++){const s=i[2*o],a=i[2*o+1],h=Object(f.a)(1*s,1*a);t.vertexBounds(s,a,0,0),t.vertexWrite(h),t.vertexWrite(n),r.dotDensity?t.vertexWriteF32(1/Math.abs(e.readGeometryArea())):(t.vertexWrite(this.fillColor),t.vertexWrite(this.tl),t.vertexWrite(this.br),t.vertexWrite(this.aux1),t.vertexWrite(this.aux2),t.vertexWrite(this.aux3),t.vertexWrite(this._minMaxZoom))}a+=c}}_getGeometry(t,e,i){const s=e?Object(_.p)(Object(_.d)(e),2):t.readGeometryForDisplay();return s?function(t,e){if(Object(y.i)(t))return null;if(!function(t,e,i){let s=0;for(let r=0;r<t.lengths.length;r++){const n=t.lengths[r];for(let r=0;r<n;r++){const n=t.coords[2*(r+s)],a=t.coords[2*(r+s)+1];if(n<e||n>i||a<e||a>i)return!0}s+=n}return!1}(t,-128,l.D+128))return t;N.setPixelMargin(e),N.reset(3);let i=0;for(let a=0;a<t.lengths.length;a++){const e=t.lengths[a];let s=t.coords[2*(0+i)],r=t.coords[2*(0+i)+1];N.moveTo(s,r);for(let n=1;n<e;n++)s=t.coords[2*(n+i)],r=t.coords[2*(n+i)+1],N.lineTo(s,r);N.close(),i+=e}const s=N.result(!1);if(!s)return null;const r=[],n=[];for(const a of s){let t=0;for(const e of a)n.push(e.x),n.push(e.y),t++;r.push(t)}return new g.a(r,n)}(s,i?256:8):null}};var H=i(304),Q=i(551);const J=r.a.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");class $ extends Q.a{constructor(t){super(),this._ongoingMaterialRequestMap=new Map,this._materialCache=new Map,this._dynamicPropertyMap=new Map,this._cimLayer=t}analyze(t,e,i,s){const r=e.readLegacyFeature(),n=this._materialCache,a=this._cimLayer.materialHash;if(!a)return J.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const o="function"==typeof a?a(r,i,s):a;if(n.has(o)){const t=n.get(o);return Promise.resolve(t)}if(this._ongoingMaterialRequestMap.has(o))return this._ongoingMaterialRequestMap.get(o);const h=Object(H.a)(this._cimLayer.cim,this._cimLayer.materialOverrides);h.mosaicHash=o;const c=t.getMosaicItem(h).then(t=>(this._ongoingMaterialRequestMap.delete(o),n.set(o,t),t)).catch(t=>(this._ongoingMaterialRequestMap.delete(o),J.error(".analyze()",t.message),null));return this._ongoingMaterialRequestMap.set(o,c),c}}var tt=i(552);class et extends(Y($)){constructor(t,e,i){var s;if(super(t),this._minMaxZoom=Object(f.a)(Math.round(e*l.l),Math.round(i*l.l)),Object(d.f)(t.color)){const e=(e,i,s)=>{const r=t.color(e,i,s);return r&&Object(c.c)(r)||0};this._dynamicPropertyMap.set("fillColor",e)}else{const e=t.color;this.fillColor=e&&Object(c.c)(e)||0}let r=0;Object(d.f)(t.height)||(r=t.height||0);const n="CIMMarkerPlacementInsidePolygon"===(null==(s=t.cim.placement)?void 0:s.type)&&t.cim.placement.shiftOddRows?2:1;this._dynamicPropertyMap.set("_height",(e,i,s)=>Object(d.f)(t.height)?t.height(e,i,s)*n:r*n);let a=0;Object(d.f)(t.offsetX)||(a=Object(h.c)(t.offsetX||0)+128,a>255&&(a=255));this._dynamicPropertyMap.set("_offsetX",(e,i,s)=>{if(Object(d.f)(t.offsetX)){let r=Object(h.c)(t.offsetX(e,i,s))+128;return r>255&&(r=255),r}return a});let o=1;Object(d.f)(t.scaleX)||(o=t.scaleX||1);this._dynamicPropertyMap.set("_scaleX",(e,i,s)=>Object(d.f)(t.scaleX)?t.scaleX(e,i,s):o);let y=0;Object(d.f)(t.offsetY)||(y=Object(h.c)(-t.offsetY||0)+128,y>255&&(y=255));this._dynamicPropertyMap.set("_offsetY",(e,i,s)=>{if(Object(d.f)(t.offsetY)){let r=Object(h.c)(-t.offsetY(e,i,s))+128;return r>255&&(r=255),r}return y});let _=0;Object(d.f)(t.angle)||(_=Object(u.d)(t.angle)||0);this._dynamicPropertyMap.set("_angle",(e,i,s)=>Object(d.f)(t.angle)?Object(u.d)(t.angle(e,i,s)):_),this._effects=t.effects,this._cimFillLayer=t,this._fillMaterialKey=x.a.load(t.materialKey)}static fromCIMFill(t,e){const[i,s]=Object(d.e)(t.scaleInfo,e);return new et(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)});const r=this._fillMaterialKey,n=this._materialCache,a=this._cimFillLayer;this.aux3=Object(f.b)(0,0,this._angle,a.colorLocked?1:0);const c=(0,a.materialHash)(s,e,i),u=n.get(c);let x=null;if(u&&Object(tt.a)(u.spriteMosaicItem)&&(x=u.spriteMosaicItem),x){const{rect:t,width:e,height:i}=x,s=t.x+l.p,n=t.y+l.p,a=s+e,c=n+i;let u=Object(o.k)(Object(h.c)(this._height));u>255?u=255:u<=0&&(u=Object(o.k)(c-n));let d=Object(o.k)(Object(h.c)(this._height/i*e||0));d>255?d=255:d<=0&&(d=Object(o.k)(a-s));const y=this._scaleX,_=1;this.tl=Object(f.a)(s,n),this.br=Object(f.a)(a,c),this.aux1=Object(f.b)(d,u,this._offsetX,this._offsetY),this.aux2=Object(f.a)(128*y,128*_),r.sdf=x.sdf,r.pattern=!0,r.textureBinding=x.textureBinding}else this.tl=0,this.br=0,this.aux1=0,this.aux2=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}var it=i(594);const st=t=>class extends t{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=m.d.LINE}_initializeTessellator(t){const e=x.c.load(this._materialKey),i=this._tessellationOptions,s=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,r=this.tessellationProperties._halfWidth<l.C;this.tessellationProperties.minMaxZoom=this._minMaxZoom;const n=r&&!t&&!s;i.wrapDistance=65535,i.textured=this._isDashed||this._hasPattern,i.offset=this.tessellationProperties.offset,i.halfWidth=this.tessellationProperties._halfWidth;const a=n?0:1;this._lineTessellator=new it.a(rt(this.tessellationProperties,a,a),nt(this.tessellationProperties),n)}_write(t,e,i){const s="esriGeometryPoint"===e.geometryType;t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,!1,s),this._writeGeometry(t,e,i,s),t.recordEnd()}_writeGeometry(t,e,i,s){const r=null!=i?i:e.readLegacyGeometryForDisplay(),n=this._getLines(r,s);Object(y.i)(n)||this._writeVertices(t,e,n)}_getLines(t,e){if(Object(y.i)(t))return null;const i=t.paths||t.rings;return Object(y.i)(i)?null:function(t,e){U.setPixelMargin(e);const i=U,s=-e,r=l.D+e;let n=[],a=!1,o=0;for(;o<t.length;){const e=[],h=t[o];if(!h)return null;i.reset(2);let[c,l]=h[0];if(a)i.moveTo(c,l);else{if(c<s||c>r||l<s||l>r){a=!0;continue}e.push({x:c,y:l})}let u=!1;const f=h.length;for(let t=1;t<f;++t)if(c+=h[t][0],l+=h[t][1],a)i.lineTo(c,l);else{if(c<s||c>r||l<s||l>r){u=!0;break}e.push({x:c,y:l})}if(u)a=!0;else{if(a){const t=i.resultWithStarts();if(t)for(const e of t)n.push(e)}else n.push({line:e,start:0});o++,a=!1}}return n=n.filter(t=>t.line.length>1),0===n.length?null:n}(i,e?256:16)}_writeVertices(t,e,i){const s=e.getDisplayId(),r=t.vertexCount(),n=this.tessellationProperties,a=this._tessellationOptions;n.out=t,n.id=s,n.indexCount=0,n.vertexCount=0,n.offset=r,a.capType=this._capType,a.joinType=this._joinType;for(const{line:o,start:h}of i)a.initialDistance=h%65535,this._lineTessellator.tessellate(o,a)}},rt=(t,e,i)=>(s,r,n,a,o,h,c,l,u,x,d)=>{const y=Object(f.a)(d,Math.ceil(1024*t._halfWidth)),_=Object(f.b)(Math.round(31*c),Math.round(31*l),Math.round(31*u),Math.round(31*x)),m=Object(f.b)(31*o,31*h,0,t._bitset),p=t.out;return p.vertexBounds(s,r,e,i),p.vertexWrite(Object(f.a)(8*s,8*r)),p.vertexWrite(t.id),p.vertexWrite(t._fillColor),p.vertexWrite(_),p.vertexWrite(y),p.vertexWrite(t._tl),p.vertexWrite(t._br),p.vertexWrite(m),p.vertexWrite(Object(f.a)(Math.ceil(1024*t._halfReferenceWidth),0)),p.vertexWrite(t.minMaxZoom),p.vertexEnd(),t.offset+t.vertexCount++},nt=t=>(e,i,s)=>{const r=t.out;r.indexWrite(e),r.indexWrite(i),r.indexWrite(s),t.indexCount+=3};class at extends(st($)){constructor(t,e,i){super(t),this._minMaxZoom=Object(f.a)(Math.round(e*l.l),Math.round(i*l.l)),this._cimLineLayer=t;let s=0;Object(d.f)(t.width)||(s=.5*Object(h.c)(t.width));if(this._dynamicPropertyMap.set("_halfWidth",(e,i,r)=>Object(d.f)(t.width)?.5*Object(h.c)(t.width(e,i,r)):s),Object(d.f)(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,Object(d.f)(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join,Object(d.f)(t.color)){const e=(e,i,s)=>{const r=t.color(e,i,s);return r&&Object(c.c)(r)||0};this._dynamicPropertyMap.set("_fillColor",e)}else{const e=t.color;this._fillColor=e&&Object(c.c)(e)||0}if(Object(d.f)(t.miterLimit)){const e=(e,i,s)=>Object(d.d)(t.miterLimit(e,i,s));this._dynamicPropertyMap.set("_miterLimitCosine",e)}else this._miterLimitCosine=Object(d.d)(t.miterLimit);this._scaleFactor=t.scaleFactor||1,this._isDashed=t.isDashed,this._effects=t.effects,this.tessellationProperties._bitset=t.colorLocked?1:0,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,s]=Object(d.e)(t.scaleInfo,e);return new at(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,n=(0,this._cimLineLayer.materialHash)(s,e,i),a=r.get(n);let o=null;if(a&&Object(tt.a)(a.spriteMosaicItem)&&(o=a.spriteMosaicItem),o){this._hasPattern=!0;const{rect:t,width:e,height:i}=o,s=t.x+l.p,r=t.y+l.p,n=s+e,a=r+i;this.tessellationProperties._tl=Object(f.a)(s,r),this.tessellationProperties._br=Object(f.a)(n,a)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const h=x.c.load(this._materialKey);o&&(h.sdf=o.sdf,h.pattern=!0,h.textureBinding=o.textureBinding),this._materialKey=h.data}}var ot=i(327),ht=i(300),ct=i(581);const lt=Object(ht.a)(),ut=Object(ot.a)(),ft=r.a.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate");class xt extends(Object(ct.a)($)){constructor(t,e,i){if(super(t),this._cimMarkerLayer=t,this._minMaxZoom=Object(f.a)(Math.round(e*l.l),Math.round(i*l.l)),Object(d.f)(t.color)){const e=(e,i,s)=>Object(c.c)(t.color(e,i,s));this._dynamicPropertyMap.set("_fillColor",e)}else this._fillColor=Object(c.c)(t.color);if(Object(d.f)(t.outlineColor)){const e=(e,i,s)=>Object(c.c)(t.outlineColor(e,i,s));this._dynamicPropertyMap.set("_outlineColor",e)}else this._outlineColor=Object(c.c)(t.outlineColor);if(Object(d.f)(t.size)){const e=(e,i,s)=>Object(h.c)(t.size(e,i,s));this._dynamicPropertyMap.set("_size",e)}else this._size=Object(h.c)(t.size)||0;if(Object(d.f)(t.scaleX)?this._dynamicPropertyMap.set("_scaleX",t.scaleX):this._scaleX=t.scaleX||1,Object(d.f)(t.offsetX)){const e=(e,i,s)=>Object(h.c)(t.offsetX(e,i,s));this._dynamicPropertyMap.set("xOffset",e)}else this.xOffset=Object(h.c)(t.offsetX)||0;if(Object(d.f)(t.offsetY)){const e=(e,i,s)=>Object(h.c)(t.offsetY(e,i,s));this._dynamicPropertyMap.set("yOffset",e)}else this.yOffset=Object(h.c)(t.offsetY)||0;if(Object(d.f)(t.outlineWidth)){const e=(e,i,s)=>Object(h.c)(t.outlineWidth(e,i,s));this._dynamicPropertyMap.set("_outlineWidth",e)}else this._outlineWidth=Object(h.c)(t.outlineWidth)||0;Object(d.f)(t.rotation)?this._dynamicPropertyMap.set("_angle",t.rotation):this._angle=t.rotation||0,this._scaleFactor=Object(y.r)(t.scaleFactor,1),this._markerPlacement=t.markerPlacement,this._effects=t.effects,this._bitSet=(1===t.alignment?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,s]=Object(d.e)(t.scaleInfo,e);return new xt(t,i,s)}bindFeature(t,e,i){const r=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,s)=>{this[s]=t(r,e,i)});const n=this._cimMarkerLayer.materialHash,a="function"==typeof n?n(r,e,i):n,o=this._materialCache.get(a);if(!o||!Object(tt.a)(o.spriteMosaicItem)||!o.spriteMosaicItem)return void ft.error(new s.a("mapview-cim","Encountered an error when binding feature"));const c=o.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,d=c.width/c.height*this._scaleX,y=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let _=this._size,m=_*d;const p=this.xOffset,g=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const b=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/Object(h.c)(this._cimMarkerLayer.frameHeight):1,v=this._outlineWidth*b,O=Object(h.c)(this._cimMarkerLayer.referenceSize);let w=0,M=0;const j=this._cimMarkerLayer.anchorPoint;j&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(w=-j.x/(this._size*d),M=j.y/this._size):(w=j.x,M=j.y)),this._sizeOutlineWidth=Object(f.b)(Math.round(Math.min(Math.sqrt(128*m),255)),Math.round(Math.min(Math.sqrt(128*_),255)),Math.round(Math.min(Math.sqrt(128*v),255)),Math.round(Math.min(Math.sqrt(128*O),255))),this.angle=y;const S=Math.round(64*u);this._bitestAndDistRatio=Object(f.a)(this._bitSet,S);const T=c.rect.x+l.p,L=c.rect.y+l.p,z=T+c.width,I=L+c.height;this._texUpperLeft=Object(f.a)(T,L),this._texUpperRight=Object(f.a)(z,L),this._texBottomLeft=Object(f.a)(T,I),this._texBottomRight=Object(f.a)(z,I);const P=x.d.load(this._materialKey);P.sdf=c.sdf,P.pattern=!0,P.textureBinding=c.textureBinding,this._materialKey=P.data,this._anchorX=.5-(.5+w)*c.width/c.width,this._anchorY=.5-(.5+M)*c.height/c.height,m*=u,_*=u,m*=this._scaleFactor,_*=this._scaleFactor,m*=c.rect.width/c.width,_*=c.rect.height/c.height,this._computedWidth=m,this._computedHeight=_,this._applyTransformation(ut,lt),this.xOffset=p,this.yOffset=g}}var dt=i(550),yt=i(578),_t=i(574);class mt extends(Object(yt.a)($)){constructor(t,e,i){super(t),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=Object(f.a)(Math.round(e*l.l),Math.round(i*l.l));const s=t.scaleFactor||1;if(this._cimTextLayer=t,Object(d.f)(t.color)){const e=(e,i,s)=>Object(c.c)(t.color(e,i,s));this._dynamicPropertyMap.set("_color",e)}else this._color=Object(c.c)(t.color);if(Object(d.f)(t.color)){const e=(e,i,s)=>Object(c.c)(t.outlineColor(e,i,s));this._dynamicPropertyMap.set("_haloColor",e)}else this._haloColor=Object(c.c)(t.outlineColor);let r;Object(d.f)(t.size)||(r=Math.min(Math.round(Object(h.c)(t.size*t.sizeRatio)),127));if(this._dynamicPropertyMap.set("_size",(e,i,s)=>Object(d.f)(t.size)?Math.min(Math.round(Object(h.c)(t.size(e,i,s)*t.sizeRatio)),127):r),Object(d.f)(t.outlineSize)){const e=(e,i,s)=>Math.min(Math.floor(5*Object(h.c)(t.outlineSize(e,i,s)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",e)}else this._haloSize=Math.min(Math.floor(5*Object(h.c)(t.outlineSize*t.sizeRatio)),127);let n;Object(d.f)(t.offsetX)||(n=Math.round(Object(h.c)(t.offsetX*t.sizeRatio)));let a;this._dynamicPropertyMap.set("_xOffset",(e,i,s)=>Object(d.f)(t.offsetX)?Math.round(Object(h.c)(t.offsetX(e,i,s)*t.sizeRatio)):n),Object(d.f)(t.offsetY)||(a=Math.round(Object(h.c)(t.offsetY*t.sizeRatio)));this._dynamicPropertyMap.set("_yOffset",(e,i,s)=>Object(d.f)(t.offsetY)?Math.round(Object(h.c)(t.offsetY(e,i,s)*t.sizeRatio)):a),Object(d.f)(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,Object(d.f)(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,Object(d.f)(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,this._scaleFactor=s,Object(d.f)(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text;const o=Math.min(Math.round(Object(h.c)(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*o)),this._materialKey=t.materialKey;const u=x.f.load(this._materialKey);u.sdf=!0,this._bitset=(1===t.alignment?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=u.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._textPlacement=t.markerPlacement,this._effects=t.effects,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=Object(d.e)(t.scaleInfo,e);return new mt(t,i,s)}async analyze(t,e,i,s){const r=e.readLegacyFeature(),n=function(t,e,i,s){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,i,s):""}(this._cimTextLayer,r,i,s),a=await t.getMosaicItem(this._cimTextLayer.cim,Object(_t.a)(n));return this._textToGlyphs.set(n,a.glyphMosaicItems),a}bindFeature(t,e,i){const s=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/24,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=Object(dt.d)(this._horizontalAlignment||"center"),this._yAlignD=Object(dt.f)(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}class pt extends(Y(Q.a)){constructor(t,e,i,s,r,n,a,o,h,c,u){super(),this._effects=h;const d=x.a.load(t);e&&(d.sdf=e.sdf,d.pattern=!0,d.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux1=n,this.aux2=a,this.aux3=o,this._minMaxZoom=Object(f.a)(Math.round(c*l.l),Math.round(u*l.l)),this._materialKey=d.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&Object(c.c)(s)||0,n=t.materialKey,[a,x]=Object(d.e)(t.scaleInfo,i);if(!e){const e=Object(f.b)(0,0,0,t.colorLocked?1:0);return new pt(n,null,r,0,0,0,0,e,t.effects,a,x)}const{rect:y,width:_,height:m}=e,p=y.x+l.p,g=y.y+l.p,b=p+_,v=g+m;let O=Object(o.k)(m);O>255?O=255:O<=0&&(O=Object(o.k)(v-g));let w=Object(o.k)(_||0);w>255?w=255:w<=0&&(w=Object(o.k)(b-p));let M=Object(h.c)(t.offsetX||0)+128;M>255&&(M=255);let j=Object(h.c)(-t.offsetY||0)+128;j>255&&(j=255);const S=t.scaleX||1,T=Object(f.a)(p,g),L=Object(f.a)(b,v),z=Object(f.b)(w,O,M,j),I=Object(f.a)(128*S,128),P=Object(f.b)(0,0,Object(u.b)(t.angle),t.colorLocked?1:0);return new pt(n,e,r,T,L,z,I,P,t.effects,a,x)}static fromSimpleFill(t,e,i=!1){const{color:s}=t,r=s&&"esriSFSNull"!==t.style&&Object(c.d)(s)||0,n=Object(f.b)(0,0,0,i?255:0),a=t.materialKey;if(!e)return new pt(a,null,r,0,0,0,0,n,null,d.b,d.a);const{rect:h,width:u,height:x}=e,y=h.x+l.p,_=h.y+l.p,m=y+u,p=_+x,g=Object(f.a)(y,_),b=Object(f.a)(m,p),v=Object(f.b)(Object(o.k)(m-y),Object(o.k)(p-_),0,0),O=Object(f.a)(128,128);return new pt(a,e,r,g,b,v,O,n,null,d.b,d.a)}static fromPictureFill(t,e,i=!1){const s=l.o,{rect:r,width:n,height:a}=e,c=r.x+l.p,u=r.y+l.p,x=c+n,y=u+a,_=Object(f.a)(c,u),m=Object(f.a)(x,y);let p=Object(o.k)(Object(h.c)(t.width));p>255&&(p=255);let g=Object(o.k)(Object(h.c)(t.height));g>255&&(g=255);let b=Object(h.c)(t.xoffset)+128;b>255&&(b=255);let v=Object(h.c)(-t.yoffset)+128;v>255&&(v=255);const O=Object(f.b)(p,g,b,v),w=Object(f.a)(128*t.xscale,128*t.yscale),M=Object(f.b)(0,0,0,i?255:0),j=t.materialKey;return new pt(j,e,s,_,m,O,w,M,null,d.b,d.a)}}var gt=i(538);const bt=r.a.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate");class vt extends(st(Q.a)){constructor(t,e,i,s,r,n,a,o,h,c,u,y,_,m,p,g,b){super();const v=x.c.load(t);e&&(v.sdf=e.sdf,v.pattern=!0,v.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Object(d.d)(n),this.tessellationProperties._fillColor=a,this.tessellationProperties._tl=o,this.tessellationProperties._br=h,this._hasPattern=c,this._isDashed=u,this._isColorLocked=y,this._zOrder=m,this._effects=p,this._minMaxZoom=Object(f.a)(Math.round(g*l.l),Math.round(b*l.l)),this._materialKey=v.data,this.tessellationProperties._bitset=y?1:0,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*_,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const s=t.color,r=t.scaleFactor||1,n=t.isDashed;let a=t.cap;n&&1===a&&(a=2);const o=t.join,u=Object(h.c)(t.width)*r,x=Object(h.c)(t.referenceWidth),y=Object(h.c)(t.miterLimit),_=s&&Object(c.c)(s)||0,[m,p]=Object(d.e)(t.scaleInfo,i);if(!e)return new vt(t.materialKey,e,u,a,o,y,_,0,0,!1,n,t.colorLocked,x,t.zOrder,t.effects,m,p);const{rect:g,width:b,height:v}=e,O=g.x+l.p,w=g.y+l.p,M=O+b,j=w+v,S=Object(f.a)(O,w),T=Object(f.a)(M,j);return new vt(t.materialKey,e,u,a,o,y,_,S,T,!0,n,t.colorLocked,x,t.zOrder,t.effects,m,p)}static fromSimpleLine(t,e){const{color:i}=t,s="esriSLSSolid"!==t.style&&"esriSLSNull"!==t.style,r=Object(gt.h)(t.cap||"round"),n=Object(gt.i)(t.join||"round");let a=i&&"esriSLSNull"!==t.style&&Object(c.d)(i)||0;"esriSLSNull"===t.style&&(a=0);const o=Object(h.c)(t.width),u=t.miterLimit;if(!e)return new vt(t.materialKey,e,o,r,n,u,a,0,0,!1,s,!1,o,0,null,d.b,d.a);const{rect:x,width:y,height:_}=e,m=x.x+l.p,p=x.y+l.p,g=m+y,b=p+_,v=Object(f.a)(m,p),O=Object(f.a)(g,b);return new vt(t.materialKey,e,o,r,n,u,a,v,O,!0,s,!1,o,0,null,d.b,d.a)}static fromPictureLineSymbol(t,e,i,s){return bt.error("PictureLineSymbol support does not exist!"),null}}var Ot=i(580),wt=i(577);class Mt{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){if(!this._resolver)return this._resolver=Object(n.g)(),Promise.resolve();await this._resolver.promise,await this.acquire()}release(){const t=this._resolver;this._resolver=null,t.resolve()}}var jt=i(559);const St=r.a.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),Tt=new Array;function Lt(t,e){const i=t.length;return t.push(null),e.then(e=>t[i]=e),t}function zt(t){return!!(1&t)}class It{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new Mt,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const i=t.hash;if(this._symbolToTemplate.has(i))return this._symbolToTemplate.get(i);const s=new Array;e&&this._createMeshTemplates(s,e,!0),this._createMeshTemplates(s,t,!1);const r=this._createGroupId("expanded-cim"===t.type);return this._idToTemplateGroup.set(r,s),this._symbolToTemplate.set(i,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):Tt}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(zt(t)||St.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):Tt}getMosaicItem(t,e){const i=this._createTemplateId(),s=new Promise(t=>this._idToResolver.set(i,t));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),s}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?async function(t,e,i){try{await t.acquire(),await e(i),t.release()}catch(s){throw t.release(),s}}(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],Object(jt.c)(a.c),!1),marker:this._createMeshTemplates([],Object(jt.c)(a.b),!1),line:this._createMeshTemplates([],Object(jt.c)(a.d),!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(t=>{for(const{id:e,mosaicItem:i}of t)this._idToResolver.get(e)(i),this._idToResolver.delete(e)})).catch(t=>{Object(n.m)(t)?this._fetchQueue=this._fetchQueue.concat(e):"worker:port-closed"===t.name||St.error(new s.a("mapview-template-store","Unable to fetch requested texture resources",t))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(tt.a)(e,St)?Ot.a.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(tt.a)(e,St)?Ot.a.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(tt.a)(i,St)?pt.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(tt.a)(i,St)?pt.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(tt.a)(i,St)?vt.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(tt.a)(e,St)?Ot.a.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return wt.a.fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t.cim,Object(_t.a)(t.text));return Object(tt.a)(e,St)?wt.a.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t.cim);return Object(tt.a)(e,St)?pt.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t.cim);return Object(tt.a)(e,St)?vt.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t.cim);return Object(tt.a)(e,St)?Ot.a.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);const i={...t,cim:{...t.cim,mosaicHash:t.materialHash}};let s;switch(i.type){case"marker":s=this._createCIMMarker(i);break;case"line":s=this._createCIMLine(i);break;case"fill":s=this._createCIMFill(i);break;case"text":s=this._createCIMText(i)}return s.then(t=>this._cimTemplateCache.set(e,t)),s}_createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=xt.fromCIMMarker(t,this._tileInfo);break;case"line":i=at.fromCIMLine(t,this._tileInfo);break;case"fill":i=et.fromCIMFill(t,this._tileInfo);break;case"text":i=mt.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return Lt(t,this._createSMS(e));case"esriPMS":return Lt(t,this._createPMS(e));case"esriSFS":return Lt(t,this._createSFS(e,i));case"line-marker":return Lt(t,this._createLMS(e));case"esriPFS":return Lt(t,this._createPFS(e,i));case"esriSLS":return Lt(t,this._createSLS(e,!1));case"esriTS":return Lt(t,this._createTS(e));default:return St.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(-1!==e.type.indexOf("3d"))return St.error("3D symbols are not supported with MapView"),t;if("expanded-cim"===e.type){for(const i of e.layers)"function"==typeof i.materialHash?t.push(this._createDynamicCIM(i)):Lt(t,this._createCIM(i));return t}if("composite-symbol"===e.type){for(const s of e.layers)this._createPrimitiveMeshTemplates(t,s,i);return t}return"cim"===e.type||"label"===e.type||"web-style"===e.type?t:this._createPrimitiveMeshTemplates(t,e,i)}}},584:function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));i(41);var s=i(304),r=i(534),n=i(537);const a={marker:r.d.MARKER,fill:r.d.FILL,line:r.d.LINE,text:r.d.TEXT};class o{constructor(t,e,i,s){const r={minScale:null==e?void 0:e.minScale,maxScale:null==e?void 0:e.maxScale},o=function(t){return t.minScale||t.maxScale?t.minScale+"-"+t.maxScale:""}(r);this.layers=t,this.data=e,this.hash=this._createHash()+o,this.rendererKey=i;for(const h of t){const t=a[h.type];h.materialKey=Object(n.g)(t,this.rendererKey,!1,!1),h.maxVVSize=s,h.scaleInfo=r,h.templateHash+=o}}get type(){return"expanded-cim"}_createHash(){let t="";for(const e of this.layers)t+=e.templateHash;return t}}var h=i(105);const c=async(t,e)=>new o(await Object(s.b)(t.data,e),t.data,t.rendererKey,t.maxVVSize),l=async(t,e,i)=>{if(!t)return null;if("cim"===t.type)return c(t,e);if("web-style"===t.type){const s=h.a.fromJSON(t),r={type:"cim",data:(await s.fetchCIMSymbol(i)).data,rendererKey:t.rendererKey,maxVVSize:t.maxVVSize};return c(r,e)}return t}},586:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t,e){this.x=t,this.y=e}clone(){return new s(this.x,this.y)}equals(t,e){return t===this.x&&e===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,e){this.x=t,this.y=e}normalize(){const t=this.x,e=this.y,i=Math.sqrt(t*t+e*e);this.x/=i,this.y/=i}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,e){this.x+=t,this.y+=e}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,e){this.x=t.x+e.x,this.y=t.y+e.y}assignSub(t,e){this.x=t.x-e.x,this.y=t.y-e.y}rotate(t,e){const i=this.x,s=this.y;this.x=i*t-s*e,this.y=i*e+s*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}static distance(t,e){const i=e.x-t.x,s=e.y-t.y;return Math.sqrt(i*i+s*s)}static add(t,e){return new s(t.x+e.x,t.y+e.y)}static sub(t,e){return new s(t.x-e.x,t.y-e.y)}}},594:function(t,e,i){"use strict";i.d(e,"a",(function(){return d}));var s=i(533);function r(t,e){return t.x===e.x&&t.y===e.y}function n(t){if(!t)return;const e=t.length;if(e<=1)return;let i=0;for(let s=1;s<e;s++)r(t[s],t[i])||++i===s||(t[i]=t[s]);t.length=i+1}function a(t,e){return t.x=e.y,t.y=-e.x,t}function o(t,e){return t.x=-e.y,t.y=e.x,t}function h(t,e){return t.x=e.x,t.y=e.y,t}function c(t,e){return t.x=-e.x,t.y=-e.y,t}function l(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function u(t,e){return t.x*e.y-t.y*e.x}function f(t,e){return t.x*e.x+t.y*e.y}function x(t,e,i,s){return t.x=e.x*i+e.y*s,t.y=e.x*s-e.y*i,t}class d{constructor(t,e,i){this.writeVertex=t,this.writeTriangle=e,this.canUseThinTessellation=i,this.prevNormal={x:void 0,y:void 0},this.nextNormal={x:void 0,y:void 0},this.textureNormalLeft={x:0,y:1},this.textureNormalRight={x:0,y:-1},this.textureNormal={x:void 0,y:void 0},this.joinNormal={x:void 0,y:void 0},this.inner={x:void 0,y:void 0},this.outer={x:void 0,y:void 0},this.roundStart={x:void 0,y:void 0},this.roundEnd={x:void 0,y:void 0},this.startBreak={x:void 0,y:void 0},this.endBreak={x:void 0,y:void 0},this.innerPrev={x:void 0,y:void 0},this.innerNext={x:void 0,y:void 0},this.bevelStart={x:void 0,y:void 0},this.bevelEnd={x:void 0,y:void 0},this.bevelMiddle={x:void 0,y:void 0}}tessellate(t,e){n(t),this.canUseThinTessellation&&e.halfWidth<s.C&&!e.offset?this.tessellateThin_(t,e):this.tessellate_(t,e)}tessellateThin_(t,e){if(t.length<2)return;const i=e.wrapDistance||65535;let s=e.initialDistance||0,r=!1,n=t[0].x,a=t[0].y;const o=t.length;for(let h=1;h<o;++h){r&&(r=!1,s=0);let e=t[h].x,o=t[h].y,c=e-n,l=o-a,u=Math.sqrt(c*c+l*l);if(c/=u,l/=u,s+u>i){r=!0;const t=(i-s)/u;u=i-s,e=(1-t)*n+t*e,o=(1-t)*a+t*o,--h}const f=this.writeVertex(n,a,0,0,c,l,l,-c,0,-1,s),x=this.writeVertex(n,a,0,0,c,l,-l,c,0,1,s);s+=u;const d=this.writeVertex(e,o,0,0,c,l,l,-c,0,-1,s),y=this.writeVertex(e,o,0,0,c,l,-l,c,0,1,s);this.writeTriangle(f,x,d),this.writeTriangle(x,d,y),n=e,a=o}}tessellate_(t,e){const i=t[0],s=t[t.length-1],n=r(i,s),d=n?3:2;if(t.length<d)return;const y=e.pixelCoordRatio,_=null!=e.capType?e.capType:0,m=null!=e.joinType?e.joinType:2,p=null!=e.miterLimit?Math.min(e.miterLimit,4):2,g=null!=e.roundLimit?Math.min(e.roundLimit,1.05):1.05,b=null!=e.halfWidth?e.halfWidth:2,v=!!e.textured;let O,w,M=null,j=null;const S=this.prevNormal,T=this.nextNormal;let L=-1,z=-1;const I=this.joinNormal;let P,V;const C=this.textureNormalLeft,E=this.textureNormalRight,R=this.textureNormal;let W=-1,k=-1;const A=e.wrapDistance||65535;let F=e.initialDistance||0;const B=this.writeVertex,D=this.writeTriangle,Z=function(t,e,i,s,r,n){const a=B(O,w,P,V,i,s,t,e,r,n,F);return W>=0&&k>=0&&a>=0&&D(W,k,a),W=k,k=a,a};n&&(M=t[t.length-2],T.x=s.x-M.x,T.y=s.y-M.y,z=l(T),T.x/=z,T.y/=z);let K=!1;for(let r=0;r<t.length;++r){if(K&&(K=!1,F=0),M&&(S.x=-T.x,S.y=-T.y,L=z,F+L>A&&(K=!0)),K){const e=(A-F)/L;L=A-F,M={x:(1-e)*M.x+e*t[r].x,y:(1-e)*M.y+e*t[r].y},--r}else M=t[r];O=M.x,w=M.y;const e=r<=0&&!K,i=r===t.length-1;if(e||(F+=L),j=i?n?t[1]:null:t[r+1],j?(T.x=j.x-O,T.y=j.y-w,z=l(T),T.x/=z,T.y/=z):(T.x=void 0,T.y=void 0),!n){if(e){o(I,T),P=I.x,V=I.y,2===_&&(Z(-T.y-T.x,T.x-T.y,T.x,T.y,0,-1),Z(T.y-T.x,-T.x-T.y,T.x,T.y,0,1)),1===_&&(Z(-T.y-T.x,T.x-T.y,T.x,T.y,-1,-1),Z(T.y-T.x,-T.x-T.y,T.x,T.y,-1,1)),1!==_&&0!==_||(Z(-T.y,T.x,T.x,T.y,0,-1),Z(T.y,-T.x,T.x,T.y,0,1));continue}if(i){a(I,S),P=I.x,V=I.y,1!==_&&0!==_||(Z(S.y,-S.x,-S.x,-S.y,0,-1),Z(-S.y,S.x,-S.x,-S.y,0,1)),2===_&&(Z(S.y-S.x,-S.x-S.y,-S.x,-S.y,0,-1),Z(-S.y-S.x,S.x-S.y,-S.x,-S.y,0,1)),1===_&&(Z(S.y-S.x,-S.x-S.y,-S.x,-S.y,1,-1),Z(-S.y-S.x,S.x-S.y,-S.x,-S.y,1,1));continue}}let s,d,B=-u(S,T);if(Math.abs(B)<.01)f(S,T)>0?(I.x=S.x,I.y=S.y,B=1,s=Number.MAX_VALUE,d=!0):(o(I,T),B=1,s=1,d=!1);else{I.x=(S.x+T.x)/B,I.y=(S.y+T.y)/B,s=l(I);const t=(s-1)*b*y;d=s>4||t>L&&t>z}P=I.x,V=I.y;let D=m;switch(m){case 0:s<1.05&&(D=2);break;case 1:s<g&&(D=2);break;case 2:s>p&&(D=0)}switch(D){case 2:if(Z(I.x,I.y,-S.x,-S.y,0,-1),Z(-I.x,-I.y,-S.x,-S.y,0,1),i)break;if(v){const t=K?0:F;W=this.writeVertex(O,w,P,V,T.x,T.y,I.x,I.y,0,-1,t),k=this.writeVertex(O,w,P,V,T.x,T.y,-I.x,-I.y,0,1,t)}break;case 0:{const t=B<0;let e,s,r,n;if(t){const t=W;W=k,k=t,e=C,s=E}else e=E,s=C;if(d)r=t?o(this.innerPrev,S):a(this.innerPrev,S),n=t?a(this.innerNext,T):o(this.innerNext,T);else{const e=t?c(this.inner,I):h(this.inner,I);r=e,n=e}const l=t?a(this.bevelStart,S):o(this.bevelStart,S);Z(r.x,r.y,-S.x,-S.y,e.x,e.y);const u=Z(l.x,l.y,-S.x,-S.y,s.x,s.y);if(i)break;const f=t?o(this.bevelEnd,T):a(this.bevelEnd,T);if(d){const t=this.writeVertex(O,w,P,V,-S.x,-S.y,0,0,0,0,F);W=this.writeVertex(O,w,P,V,T.x,T.y,n.x,n.y,e.x,e.y,F),k=this.writeVertex(O,w,P,V,T.x,T.y,f.x,f.y,s.x,s.y,F),this.writeTriangle(u,t,k)}else{if(v){const t=this.bevelMiddle;t.x=(l.x+f.x)/2,t.y=(l.y+f.y)/2,x(R,t,-S.x,-S.y),Z(t.x,t.y,-S.x,-S.y,R.x,R.y),x(R,t,T.x,T.y),W=this.writeVertex(O,w,P,V,T.x,T.y,t.x,t.y,R.x,R.y,F),k=this.writeVertex(O,w,P,V,T.x,T.y,n.x,n.y,e.x,e.y,F)}else{const t=W;W=k,k=t}Z(f.x,f.y,T.x,T.y,s.x,s.y)}if(t){const t=W;W=k,k=t}break}case 1:{const t=B<0;let e,r;if(t){const t=W;W=k,k=t,e=C,r=E}else e=E,r=C;const n=t?c(this.inner,I):h(this.inner,I);let l,u;d?(l=t?o(this.innerPrev,S):a(this.innerPrev,S),u=t?a(this.innerNext,T):o(this.innerNext,T)):(l=n,u=n);const y=t?a(this.roundStart,S):o(this.roundStart,S),_=t?o(this.roundEnd,T):a(this.roundEnd,T),m=Z(l.x,l.y,-S.x,-S.y,e.x,e.y),p=Z(y.x,y.y,-S.x,-S.y,r.x,r.y);if(i)break;const g=this.writeVertex(O,w,P,V,-S.x,-S.y,0,0,0,0,F);d||this.writeTriangle(W,k,g);const b=c(this.outer,n),M=this.writeVertex(O,w,P,V,T.x,T.y,_.x,_.y,r.x,r.y,F);let j,L;const z=s>2;if(z){let e;s!==Number.MAX_VALUE?(b.x/=s,b.y/=s,e=f(S,b),e=(s*(e*e-1)+1)/e):e=-1,j=t?a(this.startBreak,S):o(this.startBreak,S),j.x+=S.x*e,j.y+=S.y*e,L=t?o(this.endBreak,T):a(this.endBreak,T),L.x+=T.x*e,L.y+=T.y*e}x(R,b,-S.x,-S.y);const A=this.writeVertex(O,w,P,V,-S.x,-S.y,b.x,b.y,R.x,R.y,F);x(R,b,T.x,T.y);const D=v?this.writeVertex(O,w,P,V,T.x,T.y,b.x,b.y,R.x,R.y,F):A,K=g,G=v?this.writeVertex(O,w,P,V,T.x,T.y,0,0,0,0,F):g;let N=-1,U=-1;if(z&&(x(R,j,-S.x,-S.y),N=this.writeVertex(O,w,P,V,-S.x,-S.y,j.x,j.y,R.x,R.y,F),x(R,L,T.x,T.y),U=this.writeVertex(O,w,P,V,T.x,T.y,L.x,L.y,R.x,R.y,F)),v?z?(this.writeTriangle(K,p,N),this.writeTriangle(K,N,A),this.writeTriangle(G,D,U),this.writeTriangle(G,U,M)):(this.writeTriangle(K,p,A),this.writeTriangle(G,D,M)):z?(this.writeTriangle(g,p,N),this.writeTriangle(g,N,U),this.writeTriangle(g,U,M)):(this.writeTriangle(g,p,A),this.writeTriangle(g,D,M)),d?(W=this.writeVertex(O,w,P,V,T.x,T.y,u.x,u.y,e.x,e.y,F),k=M):(W=v?this.writeVertex(O,w,P,V,T.x,T.y,u.x,u.y,e.x,e.y,F):m,this.writeTriangle(W,G,M),k=M),t){const t=W;W=k,k=t}break}}}}}},595:function(t,e,i){"use strict";i.d(e,"a",(function(){return h})),i.d(e,"b",(function(){return o}));var s=i(533),r=i(586),n=i(561);class a{constructor(t,e,i){this.ratio=t,this.x=e,this.y=i}}class o{constructor(t,e,i,r=8,n=8){this.lines=[],this.starts=[],this.validateTessellation=!0,this.pixelRatio=r,this.pixelMargin=n,this.tileSize=s.D*r,this.dz=t,this.yPos=e,this.xPos=i}setPixelMargin(t){t!==this.pixelMargin&&(this.pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this.finalRatio=this.tileSize/t*(1<<this.dz);let e=this.pixelRatio*this.pixelMargin;e/=this.finalRatio;const i=t>>this.dz;e>i&&(e=i),this.margin=e,this.xmin=i*this.xPos-e,this.ymin=i*this.yPos-e,this.xmax=this.xmin+i+2*e,this.ymax=this.ymin+i+2*e}reset(t){this.type=t,this.lines=[],this.starts=[],this.line=null,this.start=0}moveTo(t,e){this._pushLine(),this._prevIsIn=this._isIn(t,e),this._moveTo(t,e,this._prevIsIn),this._prevPt=new r.a(t,e),this._firstPt=new r.a(t,e),this._dist=0}lineTo(t,e){const i=this._isIn(t,e),s=new r.a(t,e),n=r.a.distance(this._prevPt,s);let o,h,c,l,u,f,x,d;if(i)this._prevIsIn?this._lineTo(t,e,!0):(o=this._prevPt,h=s,c=this._intersect(h,o),this.start=this._dist+n*(1-this._r),this._lineTo(c.x,c.y,!0),this._lineTo(h.x,h.y,!0));else if(this._prevIsIn)h=this._prevPt,o=s,c=this._intersect(h,o),this._lineTo(c.x,c.y,!0),this._lineTo(o.x,o.y,!1);else{const t=this._prevPt,e=s;if(t.x<=this.xmin&&e.x<=this.xmin||t.x>=this.xmax&&e.x>=this.xmax||t.y<=this.ymin&&e.y<=this.ymin||t.y>=this.ymax&&e.y>=this.ymax)this._lineTo(e.x,e.y,!1);else{const i=[];if((t.x<this.xmin&&e.x>this.xmin||t.x>this.xmin&&e.x<this.xmin)&&(l=(this.xmin-t.x)/(e.x-t.x),d=t.y+l*(e.y-t.y),d<=this.ymin?f=!1:d>=this.ymax?f=!0:i.push(new a(l,this.xmin,d))),(t.x<this.xmax&&e.x>this.xmax||t.x>this.xmax&&e.x<this.xmax)&&(l=(this.xmax-t.x)/(e.x-t.x),d=t.y+l*(e.y-t.y),d<=this.ymin?f=!1:d>=this.ymax?f=!0:i.push(new a(l,this.xmax,d))),(t.y<this.ymin&&e.y>this.ymin||t.y>this.ymin&&e.y<this.ymin)&&(l=(this.ymin-t.y)/(e.y-t.y),x=t.x+l*(e.x-t.x),x<=this.xmin?u=!1:x>=this.xmax?u=!0:i.push(new a(l,x,this.ymin))),(t.y<this.ymax&&e.y>this.ymax||t.y>this.ymax&&e.y<this.ymax)&&(l=(this.ymax-t.y)/(e.y-t.y),x=t.x+l*(e.x-t.x),x<=this.xmin?u=!1:x>=this.xmax?u=!0:i.push(new a(l,x,this.ymax))),0===i.length)u?f?this._lineTo(this.xmax,this.ymax,!0):this._lineTo(this.xmax,this.ymin,!0):f?this._lineTo(this.xmin,this.ymax,!0):this._lineTo(this.xmin,this.ymin,!0);else if(i.length>1&&i[0].ratio>i[1].ratio)this.start=this._dist+n*i[1].ratio,this._lineTo(i[1].x,i[1].y,!0),this._lineTo(i[0].x,i[0].y,!0);else{this.start=this._dist+n*i[0].ratio;for(let t=0;t<i.length;t++)this._lineTo(i[t].x,i[t].y,!0)}this._lineTo(e.x,e.y,!1)}}this._dist+=n,this._prevIsIn=i,this._prevPt=s}close(){if(this.line.length>2){const t=this._firstPt,e=this._prevPt;t.x===e.x&&t.y===e.y||this.lineTo(t.x,t.y);const i=this.line;let s=i.length;for(;s>=4&&(i[0].x===i[1].x&&i[0].x===i[s-2].x||i[0].y===i[1].y&&i[0].y===i[s-2].y);)i.pop(),i[0].x=i[s-2].x,i[0].y=i[s-2].y,--s}}result(t=!0){return this._pushLine(),0===this.lines.length?null:(3===this.type&&t&&c.simplify(this.tileSize,this.margin*this.finalRatio,this.lines),this.lines)}resultWithStarts(){if(2!==this.type)throw new Error("Only valid for lines");this._pushLine();const t=this.lines,e=t.length;if(0===e)return null;const i=[];for(let s=0;s<e;s++)i.push({line:t[s],start:this.starts[s]||0});return i}_isIn(t,e){return t>=this.xmin&&t<=this.xmax&&e>=this.ymin&&e<=this.ymax}_intersect(t,e){let i,s,n;if(e.x>=this.xmin&&e.x<=this.xmax)s=e.y<=this.ymin?this.ymin:this.ymax,n=(s-t.y)/(e.y-t.y),i=t.x+n*(e.x-t.x);else if(e.y>=this.ymin&&e.y<=this.ymax)i=e.x<=this.xmin?this.xmin:this.xmax,n=(i-t.x)/(e.x-t.x),s=t.y+n*(e.y-t.y);else{s=e.y<=this.ymin?this.ymin:this.ymax,i=e.x<=this.xmin?this.xmin:this.xmax;const r=(i-t.x)/(e.x-t.x),a=(s-t.y)/(e.y-t.y);r<a?(n=r,s=t.y+r*(e.y-t.y)):(n=a,i=t.x+a*(e.x-t.x))}return this._r=n,new r.a(i,s)}_pushLine(){this.line&&(1===this.type?this.line.length>0&&(this.lines.push(this.line),this.starts.push(this.start)):2===this.type?this.line.length>1&&(this.lines.push(this.line),this.starts.push(this.start)):3===this.type&&this.line.length>3&&(this.lines.push(this.line),this.starts.push(this.start))),this.line=[],this.start=0}_moveTo(t,e,i){3!==this.type?i&&(t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.push(new r.a(t,e))):(i||(t<this.xmin&&(t=this.xmin),t>this.xmax&&(t=this.xmax),e<this.ymin&&(e=this.ymin),e>this.ymax&&(e=this.ymax)),t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.push(new r.a(t,e)),this._is_h=!1,this._is_v=!1)}_lineTo(t,e,i){let s,n;if(3!==this.type)if(i){if(t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.length>0&&(s=this.line[this.line.length-1],s.equals(t,e)))return;this.line.push(new r.a(t,e))}else this.line&&this.line.length>0&&this._pushLine();else if(i||(t<this.xmin&&(t=this.xmin),t>this.xmax&&(t=this.xmax),e<this.ymin&&(e=this.ymin),e>this.ymax&&(e=this.ymax)),t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line&&this.line.length>0){s=this.line[this.line.length-1];const i=s.x===t,a=s.y===e;if(i&&a)return;this._is_h&&i||this._is_v&&a?(s.x=t,s.y=e,n=this.line[this.line.length-2],n.x===t&&n.y===e?(this.line.pop(),this.line.length<=1?(this._is_h=!1,this._is_v=!1):(n=this.line[this.line.length-2],this._is_h=n.x===t,this._is_v=n.y===e)):(this._is_h=n.x===t,this._is_v=n.y===e)):(this.line.push(new r.a(t,e)),this._is_h=i,this._is_v=a)}else this.line.push(new r.a(t,e))}}class h{setExtent(t){this._ratio=4096===t?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this.lines=[],this.line=null}moveTo(t,e){this.line&&this.lines.push(this.line),this.line=[];const i=this._ratio;this.line.push(new r.a(t*i,e*i))}lineTo(t,e){const i=this._ratio;this.line.push(new r.a(t*i,e*i))}close(){const t=this.line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this.line&&this.lines.push(this.line),0===this.lines.length?null:this.lines}}class c{static simplify(t,e,i){if(!i)return;const s=-e,r=t+e,n=-e,a=t+e,o=[],h=[],l=i.length;for(let c=0;c<l;++c){const t=i[c];if(!t||t.length<2)continue;let e,l=t[0];const u=t.length;for(let i=1;i<u;++i)e=t[i],l.x===e.x&&(l.x<=s&&(l.y>e.y?(o.push(c),o.push(i),o.push(0),o.push(-1)):(h.push(c),h.push(i),h.push(0),h.push(-1))),l.x>=r&&(l.y<e.y?(o.push(c),o.push(i),o.push(1),o.push(-1)):(h.push(c),h.push(i),h.push(1),h.push(-1)))),l.y===e.y&&(l.y<=n&&(l.x<e.x?(o.push(c),o.push(i),o.push(2),o.push(-1)):(h.push(c),h.push(i),h.push(2),h.push(-1))),l.y>=a&&(l.x>e.x?(o.push(c),o.push(i),o.push(3),o.push(-1)):(h.push(c),h.push(i),h.push(3),h.push(-1)))),l=e}if(0===o.length||0===h.length)return;c.fillParent(i,h,o),c.fillParent(i,o,h);const u=[];c.calcDeltas(u,h,o),c.calcDeltas(u,o,h),c.addDeltas(u,i)}static fillParent(t,e,i){const s=i.length,r=e.length;for(let a=0;a<r;a+=4){const r=e[a],o=e[a+1],h=e[a+2],c=t[r][o-1],l=t[r][o];let u=8092,f=-1;for(let e=0;e<s;e+=4){if(i[e+2]!==h)continue;const s=i[e],r=i[e+1],a=t[s][r-1],o=t[s][r];switch(h){case 0:case 1:if(Object(n.a)(c.y,a.y,o.y)&&Object(n.a)(l.y,a.y,o.y)){const t=Math.abs(o.y-a.y);t<u&&(u=t,f=e)}break;case 2:case 3:if(Object(n.a)(c.x,a.x,o.x)&&Object(n.a)(l.x,a.x,o.x)){const t=Math.abs(o.x-a.x);t<u&&(u=t,f=e)}}}e[a+3]=f}}static calcDeltas(t,e,i){const s=e.length;for(let r=0;r<s;r+=4){const s=[],n=c.calcDelta(r,e,i,s);t.push(e[r]),t.push(e[r+1]),t.push(e[r+2]),t.push(n)}}static calcDelta(t,e,i,s){const r=e[t+3];if(-1===r)return 0;const n=s.length;return n>1&&s[n-2]===r?0:(s.push(r),c.calcDelta(r,i,e,s)+1)}static addDeltas(t,e){const i=t.length;let s=0;for(let r=0;r<i;r+=4){const e=t[r+3];e>s&&(s=e)}for(let r=0;r<i;r+=4){const i=e[t[r]],n=t[r+1],a=s-t[r+3];switch(t[r+2]){case 0:i[n-1].x-=a,i[n].x-=a,1===n&&(i[i.length-1].x-=a),n===i.length-1&&(i[0].x-=a);break;case 1:i[n-1].x+=a,i[n].x+=a,1===n&&(i[i.length-1].x+=a),n===i.length-1&&(i[0].x+=a);break;case 2:i[n-1].y-=a,i[n].y-=a,1===n&&(i[i.length-1].y-=a),n===i.length-1&&(i[0].y-=a);break;case 3:i[n-1].y+=a,i[n].y+=a,1===n&&(i[i.length-1].y+=a),n===i.length-1&&(i[0].y+=a)}}}}},597:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));i(308);function s(t,e,i,s){const r=t.clone(),n=1<<r.level,a=r.col+e,o=r.row+i;return s&&a<0?(r.col=a+n,r.world-=1):a>=n?(r.col=a-n,r.world+=1):r.col=a,r.row=o,r}},606:function(t,e,i){"use strict";i.d(e,"a",(function(){return f}));var s=i(9),r=i(4),n=i(340),a=i(72),o=i(584),h=i(35),c=i(309),l=i(559);const u=r.a.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function f(t,e,i){switch(t.type){case"simple":return x.fromBasicRenderer(t,e,i);case"map":return _.fromUVRenderer(t,e,i);case"interval":return y.fromCBRenderer(t,e,i);case"dictionary":return m.fromDictionaryRenderer(t,e,i);case"subtype":return d.fromSubtypes(t,e,i)}}class x{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i){const s=new x;if(t.symbol){const r=await Object(o.a)(t.symbol,i),n=e.createTemplateGroup(r,null);s.setDefault(n)}return s}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,s,r){return this.getDefault()}async analyze(t,e,i,s,r){return null}}class d extends x{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i){const s=new Map,r=[];for(const n in t.renderers){const a=parseInt(n,10),o=f(t.renderers[n],e,i).then(t=>s.set(a,t));r.push(o)}return await Promise.all(r),new d(s,t.subtypeField)}match(t,e,i,s,r){const n=e.readAttribute(this._subtypeField),a=this._subMatchers.get(n);return a?a.match(t,e,i,s,r):null}}class y extends x{constructor(t,e,i,s){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=s,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i){const{isMaxInclusive:s,normalizationField:r,normalizationTotal:n,normalizationType:a}=t,h=t.field,c=new y(h,s,{normalizationField:r,normalizationTotal:n,normalizationType:a},t.fieldIndex),l=await Object(o.a)(t.backgroundFillSymbol,i);await Promise.all(t.intervals.map(async t=>{const s=await Object(o.a)(t.symbol,i),r=await e.createTemplateGroup(s,l),n={min:t.min,max:t.max};c.add(n,r)}));const u=await Object(o.a)(t.defaultSymbol,i);if(u){const t=await e.createTemplateGroup(u,l);c.setDefault(t)}return c}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((t,e)=>t.interval.min-e.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,s,r){if(null==this._fieldIndex&&!this._field)return this.getDefault();const n=null!=this._fieldIndex?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(!n&&(null==n||isNaN(n)))return this.getDefault();for(let a=0;a<this._intervals.length;a++){const{interval:t,result:e}=this._intervals[a],i=n>=t.min,s=this._isMaxInclusive?n<=t.max:n<t.max;if(i&&s)return e}return this.getDefault()}_needsNormalization(){const t=this._normalizationInfo;return t&&(t.normalizationField||t.normalizationTotal||t.normalizationType)}_getValueFromField(t){const e=t.readAttribute(this._field);if(!this._needsNormalization()||null==e)return e;const{normalizationField:i,normalizationTotal:s,normalizationType:r}=this._normalizationInfo,n=!!i&&t.readAttribute(i);if(r)switch(r){case"esriNormalizeByField":return n?e/n:void 0;case"esriNormalizeByLog":return Math.log(e)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return e/s*100;default:return void u.error("Found unknown normalization type: "+r)}else u.error("Normalization is required, but no type was set!")}}class _ extends x{constructor(t,e,i){super(),this.type="map",this._nullResult=null,this._resultsMap=new Map,this._fieldsIndex=i,this._fields=t,this._seperator=e||""}static async fromUVRenderer(t,e,i){const s=t.fieldDelimiter,r=[t.field];t.field2&&r.push(t.field2),t.field3&&r.push(t.field3);const n=await Object(o.a)(t.backgroundFillSymbol,i),a=new _(r,s,t.fieldIndex);await Promise.all(t.map.map(async t=>{const s=await Object(o.a)(t.symbol,i),r=await e.createTemplateGroup(s,n);"<Null>"===t.value?a.setNullResult(r):a.add(t.value,r)}));const h=await Object(o.a)(t.defaultSymbol,i);if(h){const t=await e.createTemplateGroup(h,n);a.setDefault(t)}return a}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,s,r){if(null==this._fieldsIndex&&!this._fields)return this.getDefault();const n=null!=this._fieldsIndex?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(null!==this._nullResult&&(null==n||""===n||"<Null>"===n))return this._nullResult;if(!n&&null==n)return this.getDefault();const a=n.toString();return this._resultsMap.has(a)?this._resultsMap.get(a):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const s=t.readAttribute(i);null==s||""===s?e.push("<Null>"):e.push(s)}return e.join(this._seperator)}}class m extends x{constructor(t,e,i,s){super(),this.type="dictionary",this._groupIdCache=new n.a(100),this._renderer=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=s}static async fromDictionaryRenderer(t,e,s){const r=(await Promise.resolve().then(i.bind(null,303))).default.fromJSON(t.renderer);await r.fetchResources({spatialReference:s.spatialReference,fields:s.fields});const n=await async function(t,e){const i=t||1;if("number"==typeof i)return(t,e,s)=>i;const s=await Object(a.d)(i,e.spatialReference,e.fields);return(t,i,r)=>Object(c.a)(s,t,{$view:r},e.geometryType,i)||1}(r.scaleExpression,s);return new m(r,e,s,n)}async _analyzeFeature(t,e,i,r){const n=t.readLegacyFeature(),a=this._scaleFn(n,e,i),c=this._attributeHash(n)+"-"+a,f=this._groupIdCache.get(c);if(f)return f;const x={...i,spatialReference:this._info.spatialReference,abortOptions:r,fields:this._info.fields},d=await this._renderer.getSymbolAsync(n,x),y=Object(l.c)(d,this._renderer),_=Object(o.a)(y,this._info,r).then(t=>{if("expanded-cim"!==t.type)return u.error(new s.a("mapview-bad-type",`Found unexpected type ${t.type} in dictionary response`)),null;t.hash+="-"+a;for(const e of t.layers)e.scaleFactor=a,e.templateHash+="-"+a,"text"===e.type&&"string"==typeof e.text&&e.text.indexOf("[")>-1&&(e.text=Object(h.c)(this._fieldMap,e.text,e.cim.textCase));return this._templates.createTemplateGroup(t,null)});return this._groupIdCache.put(c,_,1),_}async analyze(t,e,i,s,r){const n=e.getCursor(),a=[];for(;n.next();)a.push(this._analyzeFeature(n,i,s,r));return Promise.all(a)}match(t,e,i,s,r){return null}_attributeHash(t){let e="";for(const i of this._symbolFields){const s=this._fieldMap[i];s&&(e+=t.attributes[s]+"-")}return e}}},608:function(t,e,i){"use strict";i.d(e,"a",(function(){return d}));i(403),i(336);var s=i(124),r=(i(401),i(402),i(533)),n=i(534),a=i(538);const o=new Map;o.set(n.d.MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),o.set(n.d.LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),o.set(n.d.FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),o.set(n.d.TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),o.set(n.d.LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});var h=i(560);class c{constructor(t,e,i){this._start={index:0,vertex:0};const s=function(t,e,i){const{indicesPerRecord:s,multiplier:n,verticesPerRecord:a}=o.get(t);return{recordBytes:i*r.d*Uint32Array.BYTES_PER_ELEMENT,indexBytes:n*s*i*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:n*a*i*e}}(t,e,i),n=e/4;this.geometryType=t,this._records=new h.a(Int32Array,s.recordBytes),this._indices=new h.a(Uint32Array,s.indexBytes),this._vertices=new h.a(Uint32Array,s.vertexBytes),this._metrics=new h.a(Float32Array,0),this._strideInt=n}serialize(t){const e=this._records.buffer(),i=this._indices.buffer(),s=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null,n=4*this._strideInt;return t.push(e,i,s),{stride:n,records:e,indices:i,vertices:s,metrics:r}}get strideInt(){return this._strideInt}get recordCount(){return this._records.length/r.d}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(t){this._vertices.ensureSize(t)}indexEnsureSize(t){this._indices.ensureSize(t)}recordStart(){this._start.index=this._indices.length,this._start.vertex=this._vertices.length}recordEnd(t,e,i,s,r,n,a,o){this._records.push(t),this._records.push(e),this._records.push(i),this._records.push(s),this._records.push(r),this._records.push(n),this._records.push(a),this._records.writeF32(o)}writeIndex(t){this._indices.push(t)}writeVertex(t){this._vertices.push(t)}writeVertexF32(t){this._vertices.writeF32(t)}copyLastFrom(t,e,i){const s=t._records.length-r.d,n=t._records.getValue(s),a=t._records.getValue(s+1),o=t._records.getValue(s+2),h=t._records.getValue(s+4),c=t._records.getValue(s+6),l=t._records.getValue(s+7),u=this._vertices.length,f=(t._start.vertex-this._vertices.length)/this._strideInt,x=this._indices.length,d=this.vertexCount;for(let r=t._start.index;r!==t._indices.length;r++){const e=t._indices.getValue(r);this._indices.push(e-f)}for(let r=t._start.vertex;r!==t._vertices.length;r++){const e=t._vertices.getValue(r);this._vertices.push(e)}for(let r=u;r<=this._vertices.length;r+=this._strideInt)this._vertices.i1616Add(r,e,i);this._records.push(n),this._records.push(a),this._records.push(o),this._records.push(x),this._records.push(h),this._records.push(d),this._records.push(c),this._records.push(l)}}var l=i(557),u=i(597);function f(t){switch(t){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function x(t){switch(t){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class d{constructor(t,e,i,s,r){this._hasDotDensity=!1,this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=e,this.tileKey=t,this._hasDotDensity=i,this._hasAggregate=s,this._pixelBufferEnabled=r}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(t){const e=[];return e.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach((i,r)=>{const n=1<<r,a=f(n),o=x(n),h=Object(u.a)(new s.a(this.tileKey),a,o,t),c=this._serializeTileVertexData(this.tileKey,h.id,i.vertexData);c.message.bufferIds=i.displayIds,e.push(c)}),e}_serializeTileVertexData(t,e,i){var s,r,a,o,h;const c=new Array;return{message:{tileKeyOrigin:t,tileKey:e,data:{[n.d.MARKER]:null==(s=i.get(n.d.MARKER))?void 0:s.serialize(c),[n.d.FILL]:null==(r=i.get(n.d.FILL))?void 0:r.serialize(c),[n.d.LINE]:null==(a=i.get(n.d.LINE))?void 0:a.serialize(c),[n.d.TEXT]:null==(o=i.get(n.d.TEXT))?void 0:o.serialize(c),[n.d.LABEL]:null==(h=i.get(n.d.LABEL))?void 0:h.serialize(c)}},transferList:c}}featureStart(t,e){this._current.insertAfter=t,this._current.sortKey=e}featureEnd(){}recordStart(t,e,i,s,r){this._current.writer=this._getVertexWriter(i,s),this._current.overlaps=0,this._current.indexStart=this._current.writer.indexCount,this._current.vertStart=this._current.writer.vertexCount,this._current.bufferingEnabled=r,this._current.id=t,this._current.materialKey=e,this._current.geometryType=i,this._current.isDotDensity=!1,this._current.writer.recordStart()}recordCount(){return this._current.writer.recordCount}vertexCount(){return this._current.writer.vertexCount}indexCount(){return this._current.writer.indexCount}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexBounds(t,e,i,s){this._current.bufferingEnabled&&this._addOverlap(t,e,i,s)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}vertexEnd(){}vertexWriter(){return this._current.writer.vertexWriter}indexWrite(t){this._current.writer.writeIndex(t)}indexWriter(){return this._current.writer.indexWriter}metricWriter(){return this._current.writer.metricWriter}metricStart(t,e,i,s,r,a,o,h){this._current.writer=this._getVertexWriter(n.d.LABEL,!1);const c=this._current.writer.metricWriter;c.push(Object(l.b)(t)),c.push(e),c.push(i),c.push(s),c.push(r),c.push(a),c.push(o),c.push(h),c.push(255),this._current.metricBoxLenPointer=c.push(0)}metricEnd(){const t=this._current.writer.metricWriter;0===t.getValue(this._current.metricBoxLenPointer)&&t.seek(t.length-10)}metricBoxWrite(t,e,i,s){const r=this._current.writer.metricWriter;r.incr(this._current.metricBoxLenPointer),r.push(0),r.push(0),r.push(t),r.push(e),r.push(i),r.push(s)}recordEnd(){const t=this._current.indexStart,e=this._current.writer.indexCount;if(t===e)return!1;this.hasRecords=!0;const i=e-t,s=this._current.vertStart,o=this._current.writer.vertexCount-s;if(this._current.writer.recordEnd(this._current.id,this._current.materialKey,this._current.insertAfter,t,i,s,o,this._current.sortKey),!this._pixelBufferEnabled||this._hasAggregate||0===this._current.overlaps||this._current.geometryType===n.d.LABEL)return!0;const h=this._current.writer;for(let n=0;n<8;n++){const t=1<<n;if(this._current.overlaps&t){this._data.neighbors[n]||(this._data.neighbors[n]={vertexData:new Map,displayIds:new Set});const e=this._data.neighbors[n],i=this._current.geometryType;if(!e.vertexData.has(i)){const t=Object(a.l)(i,this._current.isDotDensity).geometry,s=new c(i,t,r.n);e.vertexData.set(i,s)}const s=e.vertexData.get(this._current.geometryType),o=8,l=512*-f(t)*o,u=512*-x(t)*o;s.copyLastFrom(h,l,u),e.displayIds.add(this._current.id)}}return!0}_addOverlap(t,e,i,s){const n=255^((t<0+i?148:t>=r.D-i?41:189)|(e<0+s?224:e>=r.D-s?7:231));this._current.overlaps|=n}_getVertexWriter(t,e){if(!this._data.self.has(t)){const e=this._data.self,i=Object(a.l)(t,this._hasDotDensity).geometry;e.set(t,new c(t,i,this.hint.records))}return this._data.self.get(t)}}},609:function(t,e,i){"use strict";i.d(e,"a",(function(){return E}));i(5);var s=i(3),r=i(12),n=i(564),a=i(9),o=i(4),h=i(49),c=i(18),l=i(550),u=i(540),f=i(533),x=i(534),d=i(536),y=i(537),_=i(632),m=i(541);function p(t){return t.length-1}function g(t){let e=0;for(let i=0;i<p(t);i++)e+=b(t,i);return e}function b(t,e,i=1){const[s,r]=function(t,e){return t[e+1]}(t,e);return Math.sqrt(s*s+r*r)*i}class v{constructor(t,e,i,s,r){this._segments=t,this._index=e,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(t){return new v(t,0,0,t[0][0],t[0][1])}clone(){return new v(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(t){return this._index===t._index||t._index===this._index-1&&(0===this._distance||1===t._distance)||t._index===this._index+1&&(1===this._distance||0===t._distance)}leq(t){return this._index<t._index||this._index===t._index&&this._distance<=t._distance}geq(t){return this._index>t._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<p(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(t,e){const i=this.backwardLength;if(t<=i)return this._distance=(i-t)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}}function O(t,e,i){const s=g(t),r=v.create(t),n=s/2,a=(s-e)/2,o=Math.floor(a/e),h=n-o*e;r.seek(h);for(let c=-o;c<=o;c++)r.x<512&&r.x>=0&&r.y<512&&r.y>=0&&i(r.clone(),c,n+c*e,s),r.seek(e)}function w(t,e){const i=1e-6;if(e<=0)return;const s=t.length;if(s<3)return;const r=[];let n=0;r.push(0);for(let u=1;u<s;u++)n+=Object(m.c)(t[u],t[u-1]),r.push(n);e=Math.min(e,.2*n);const a=[];a.push(t[0][0]),a.push(t[0][1]);const o=t[s-1][0],h=t[s-1][1],c=Object(m.h)([0,0],t[0],t[1]);Object(m.g)(c),t[0][0]+=e*c[0],t[0][1]+=e*c[1],Object(m.h)(c,t[s-1],t[s-2]),Object(m.g)(c),t[s-1][0]+=e*c[0],t[s-1][1]+=e*c[1];for(let u=1;u<s;u++)r[u]+=e;r[s-1]+=e;const l=.5*e;for(let u=1;u<s-1;u++){let n=0,o=0,h=0;for(let s=u-1;s>=0&&!(r[s+1]<r[u]-l);s--){const a=l+r[s+1]-r[u],c=r[s+1]-r[s],f=r[u]-r[s]<l?1:a/c;if(Math.abs(f)<i)break;const x=f*f,d=f*a-.5*x*c,y=f*c/e,_=t[s+1],m=t[s][0]-_[0],p=t[s][1]-_[1];n+=y/d*(_[0]*f*a+.5*x*(a*m-c*_[0])-x*f*c*m/3),o+=y/d*(_[1]*f*a+.5*x*(a*p-c*_[1])-x*f*c*p/3),h+=y}for(let a=u+1;a<s&&!(r[a-1]>r[u]+l);a++){const s=l-r[a-1]+r[u],c=r[a]-r[a-1],f=r[a]-r[u]<l?1:s/c;if(Math.abs(f)<i)break;const x=f*f,d=f*s-.5*x*c,y=f*c/e,_=t[a-1],m=t[a][0]-_[0],p=t[a][1]-_[1];n+=y/d*(_[0]*f*s+.5*x*(s*m-c*_[0])-x*f*c*m/3),o+=y/d*(_[1]*f*s+.5*x*(s*p-c*_[1])-x*f*c*p/3),h+=y}a.push(n/h),a.push(o/h)}a.push(o),a.push(h);for(let u=0,f=0;u<s;u++)t[u][0]=a[f++],t[u][1]=a[f++]}var M=i(577);const j=o.a.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate");const S=function(t){const e=new Map;return i=>(e.has(i)||e.set(i,t(i)),e.get(i))}(t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e}),T=t=>Math.floor(127*t+127),L=t=>Math.floor(10*t),z=t=>Math.round(t*(254/360));class I extends M.a{constructor(t,e,i,s){super(t,i.font.size,i.haloSize||0,i.color&&Object(u.d)(i.color)||0,i.haloColor&&Object(u.d)(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,Object(_.a)(e.labelPlacement)?1:0,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=x.d.LABEL;const r=function(t,e){const i=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return Object(h.d)(i,0,25.5)}(e,s),n=function(t,e){const i=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return Object(h.d)(i,0,25.5)}(e,s),a=e.labelPlacement,[o,d]=Object(l.b)(a);this._xAlignD=o,this._yAlignD=d,this._minZoom=r,this._maxZoom=n,this._refPlacementPadding=Object(c.c)(i.haloSize)+f.B;const m=y.b.load(t);m.sdf=!0,this._materialKey=m.data}static fromLabelClass(t,e){if("esriServerLinePlacementCenterAlong"===t.labelPlacement){const e=t.symbol;e.xoffset=0,e.yoffset=0,e.angle=0,e.font.decoration="none"}return new I(t.materialKey,t,t.symbol,e)}get _shapedBox(){return Object(s.q)(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=Object(l.e)(this._xAlignD),i=Object(l.g)(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,Object(s.i)(t))return void(this._refSymbolAndPlacementOffset=Object(d.b)(0,0,T(e),T(i)));if("circle"===t.boundsType&&(e||i)){const t=Math.sqrt(e*e+i*i);e/=t,i/=t}const r=Math.max(t.height,t.width),n=4*this._refPlacementPadding;this._refSymbolAndPlacementOffset=Object(d.b)(n,r,T(e),T(i)),this._referenceSize=r,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(Object(s.i)(this._shapingInfo))return;const i=this._shapingInfo,r=e.getDisplayId(),n="esriGeometryPolygon"===e.geometryType?e.readLegacyCentroid():e.readLegacyGeometry();if(n)switch(this.current={out:t,inId:r,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(n);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(n);break;default:((t,e="mapview-labeling")=>{j.error(new a.a(e,t))})("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=L(this.current.zoomLevel);return L(t)<=i&&i<=L(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:s}=this.current;this._writeGlyphs(e,i,t,s)}_placeLineLabels(t){const e=function(t,e){const i=e;for(let s=0;s<t.length;s++){let e=t[s];const r=[];r.push(e[0]);for(let t=1;t<e.length;t++){let[i,s]=r[t-1];i+=e[t][0],s+=e[t][1],r.push([i,s])}w(r,i);const n=[];n.push(r[0]);for(let t=1;t<r.length;t++){const[e,i]=r[t-1],[s,a]=r[t],o=Math.round(s-e),h=Math.round(a-i);n.push([o,h])}t[s]=n,e=n}return t}(t.paths,this.current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),s=(this._shapedBox.width+128)/2;for(const r of e)O(r,s,i)}_placeSubdivGlyphs(t,e,i,s){const r=S(e),n=this._shapedBox.width/2,a=Math.min(i,s-i),o=Object(h.j)(a/(8+n/2)),c=0===e?o:Math.min(r,o),l=Math.max(this._minZoom,this.current.zoomLevel+1-c),u=this.current.zoomLevel-l,f=this._shapedBox.width/2*2**u;this.current.inShaping.isMultiline?0===e&&this._placeStraight(t,l):this._placeCurved(t,l,f)}_placeStraight(t,e){const{out:i,inId:s,inShaping:r}=this.current;this._writeGlyphs(i,s,t,r,e)}_placeCurved(t,e,i){const{out:s,inId:r}=this.current;s.metricStart(r,e,t.x,t.y,0,0,0,0);const n=t.clone(),a=t.angle*(180/Math.PI)%360,o=(t.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=z(a),this._placeFirst(n,e,1),this._placeBack(t,n,e,i,1),this._placeForward(t,n,e,i,1),this._outLineLabelAngle=z(o),this._placeFirst(n,e,0),this._placeBack(t,n,e,i,0),this._placeForward(t,n,e,i,0),s.metricEnd()}_placeBack(t,e,i,s,r){const n=t.clone();let a=t.backwardLength+0;for(;n.prev()&&!(a>=s);)this._placeOnSegment(n,e,a,i,-1,r),a+=n.length+0}_placeForward(t,e,i,s,r){const n=t.clone();let a=t.remainingLength+0;for(;n.next()&&!(a>=s);)this._placeOnSegment(n,e,a,i,1,r),a+=n.length+0}_placeFirst(t,e,i){const s=t,r=this.current.inShaping,n=r.glyphs,a=this.current.zoomLevel,{out:o,inId:c}=this.current;for(const l of n){const n=l.x>r.bounds.x?i:1-i,u=n*t.remainingLength+(1-n)*t.backwardLength,f=Math.abs(l.x+l.width/2-r.bounds.x),x=Math.max(0,a+Object(h.j)(f/(u+0))),d=Math.max(e,x);if(l.maxZoom=25,l.angle=t.angle+(1-i)*Math.PI,l.minZoom=d,this._writeGlyph(o,c,s.x,s.y,l),i&&this._isVisible(l.minZoom,l.maxZoom)){const t=l.bounds;o.metricBoxWrite(t.center[0],t.center[1],t.width,t.height)}}}_placeOnSegment(t,e,i,s,r,n){const a=this.current.inShaping.glyphs,{out:o,inId:c}=this.current,l=this.current.inShaping,u=this.current.zoomLevel,f=t.dx/t.length,x=t.dy/t.length,d={x:t.x+i*-r*f,y:t.y+i*-r*x};for(const y of a){const a=y.x>l.bounds.x?n:1-n;if(!(a&&1===r||!a&&-1===r))continue;const f=Math.abs(y.x+y.width/2-l.bounds.x),x=Math.max(0,u+Object(h.j)(f/i)-.1),_=Math.max(s,u+Object(h.j)(f/(i+t.length+0)));if(0!==x&&(y.angle=t.angle+(1-n)*Math.PI,y.minZoom=_,y.maxZoom=x,this._writeGlyph(o,c,d.x,d.y,y),n&&this._isVisible(y.minZoom,y.maxZoom))){const i=y.bounds,s=t.x-e.x,r=t.y-e.y;o.metricBoxWrite(i.center[0]+s,i.center[1]+r,i.width,i.height)}}}_writeGlyphs(t,e,i,s,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const n=i.x+this._refOffsetX,a=i.y-this._refOffsetY;for(const l of s.glyphs)l.minZoom=r,l.maxZoom=this._maxZoom,this._writeGlyph(t,e,n,a,l);const o=this._refPlacementDirX,h=this._refPlacementDirY,c=s.boundsT;t.metricStart(e,r,n,a,o,h,this._referenceSize,this._materialKey),t.metricBoxWrite(c.center[0],c.center[1],c.width,c.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,a=Object(d.b)(0,0,this._size,this._haloSize),o=Math.max(s.minZoom,this._minZoom),h=Math.min(s.maxZoom,this._maxZoom),c=Object(d.b)(L(o),L(h),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(c)}}var P=i(580),V=i(582),C=i(557);class E{constructor(t,e,i){this._loadPromise=Object(n.a)(),this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){Object(s.j)(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if("simple"===t.type){for(const s of t.classes){const t=I.fromLabelClass(s,e);i.set(s.index,t)}return i}for(const s in t.classes){const r=t.classes[s];for(const t of r){const s=I.fromLabelClass(t,e);i.set(t.index,s)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,n,a,o){if(Object(r.n)(o))return;let h;"dictionary"===e.type&&(h=await e.analyze(this._idField,t.copy(),n,a,o));let c=0;for(;t.next();){let r;if(r=h?h[c++]:Object(s.j)(i)&&Object(C.c)(t.getDisplayId())&&1!==t.readAttribute("cluster_count")?i.match(this._idField,t,this._geometryType,n,a):e.match(this._idField,t,this._geometryType,n,a),t.setGroupId(r),Object(V.b)(r)){const e=this._templateStore.getDynamicTemplateGroup(r);for(const i of e)i&&i.analyze&&i.analyze(this._templateStore,t,n,a)}}return await this._loadPromise,this._templateStore.finalize(o)}async analyzeGraphics(t,e,i,s,n){if(Object(r.n)(n))return;const a=t.getCursor();for(e&&await e.analyze(this._idField,a.copy(),i,s,n);a.next();){let t=a.getGroupId();if(null!=t&&-1!==t||(t=e.match(this._idField,a,a.geometryType,i,s),a.setGroupId(t)),Object(V.b)(t)){const e=this._templateStore.getDynamicTemplateGroup(t);for(const t of e)t&&t.analyze&&t.analyze(this._templateStore,a,i,s)}a.setGroupId(t)}return await this._loadPromise,this._templateStore.finalize(n)}writeGraphic(t,e,i){const s=e.getGroupId(),r=e.getDisplayId(),n=this._templateStore.getTemplateGroup(s);if(t.featureStart(e.insertAfter,0),null!=r){if(Object(V.b)(s))for(const t of n)t.bindFeature(e,null,null);if(n){for(const s of n)s&&s.write(t,e,i);t.featureEnd()}}}writeCursor(t,e,i,r,n,a){const o=e.getGroupId(),h=e.getDisplayId(),c=this._templateStore.getTemplateGroup(o),l=this._schema.mesh.sortKey;let u=0;if(Object(s.j)(l)&&(u=null!=l.fieldIndex?e.getComputedNumericAtIndex(l.fieldIndex):null!=l.field?e.readAttribute(l.field):e.readAttribute(this._idField),u*="asc"===l.order?1:-1),t.featureStart(0,null==u||isNaN(u)?0:u),null!=h&&c){if(Object(V.b)(o))for(const t of c)t.bindFeature(e,i,r);for(const i of c)i.write(t,e,n);if(Object(s.j)(a)&&t.hasRecords){const i=a&&this._findLabelRef(c);this._writeLabels(t,e,a,i,n)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof P.a)return e;return null}_writeLabels(t,e,i,r,n){for(const a of i)if(Object(s.j)(a)&&a){const{glyphs:i,rtl:s,index:o}=a,h=this._labelTemplates.get(o);h.setZoomLevel(n),h.bindReferenceTemplate(r),h.bindTextInfo(i,s),h.write(t,e,null)}}}},618:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s,r,n,a={exports:{}};s=a,r=function(){function t(t,i,r){r=r||2;var n,a,o,c,l,u,f,x=i&&i.length,d=x?i[0]*r:t.length,y=e(t,0,d,r,!0),_=[];if(!y||y.next===y.prev)return _;if(x&&(y=h(t,i,y,r)),t.length>80*r){n=o=t[0],a=c=t[1];for(var m=r;m<d;m+=r)(l=t[m])<n&&(n=l),(u=t[m+1])<a&&(a=u),l>o&&(o=l),u>c&&(c=u);f=0!==(f=Math.max(o-n,c-a))?1/f:0}return s(y,_,r,n,a,f),_}function e(t,e,i,s,r){var n,a;if(r===L(t,e,i,s)>0)for(n=e;n<i;n+=s)a=j(n,t[n],t[n+1],a);else for(n=i-s;n>=e;n-=s)a=j(n,t[n],t[n+1],a);if(a&&g(a,a.next)){var o=a.next;S(a),a=o}return a}function i(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!g(s,s.next)&&0!==p(s.prev,s,s.next))s=s.next;else{var r=s.prev;if(S(s),(s=e=r)===s.next)break;i=!0}}while(i||s!==e);return e}function s(t,e,h,c,l,u,f){if(t){!f&&u&&x(t,c,l,u);for(var d,y,_=t;t.prev!==t.next;)if(d=t.prev,y=t.next,u?n(t,c,l,u):r(t))e.push(d.i/h),e.push(t.i/h),e.push(y.i/h),S(t),t=y.next,_=y.next;else if((t=y)===_){f?1===f?s(t=a(i(t),e,h),e,h,c,l,u,2):2===f&&o(t,e,h,c,l,u):s(i(t),e,h,c,l,u,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(p(e,i,s)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(_(e.x,e.y,i.x,i.y,s.x,s.y,r.x,r.y)&&p(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function n(t,e,i,s){var r=t.prev,n=t,a=t.next;if(p(r,n,a)>=0)return!1;for(var o=r.x<n.x?r.x<a.x?r.x:a.x:n.x<a.x?n.x:a.x,h=r.y<n.y?r.y<a.y?r.y:a.y:n.y<a.y?n.y:a.y,c=r.x>n.x?r.x>a.x?r.x:a.x:n.x>a.x?n.x:a.x,l=r.y>n.y?r.y>a.y?r.y:a.y:n.y>a.y?n.y:a.y,u=d(o,h,e,i,s),f=d(c,l,e,i,s),x=t.prevZ,y=t.nextZ;x&&x.z>=u&&y&&y.z<=f;){if(x!==t.prev&&x!==t.next&&_(r.x,r.y,n.x,n.y,a.x,a.y,x.x,x.y)&&p(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,y!==t.prev&&y!==t.next&&_(r.x,r.y,n.x,n.y,a.x,a.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;x&&x.z>=u;){if(x!==t.prev&&x!==t.next&&_(r.x,r.y,n.x,n.y,a.x,a.y,x.x,x.y)&&p(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;y&&y.z<=f;){if(y!==t.prev&&y!==t.next&&_(r.x,r.y,n.x,n.y,a.x,a.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function a(t,e,s){var r=t;do{var n=r.prev,a=r.next.next;!g(n,a)&&b(n,r,r.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/s),e.push(r.i/s),e.push(a.i/s),S(r),S(r.next),r=t=a),r=r.next}while(r!==t);return i(r)}function o(t,e,r,n,a,o){var h=t;do{for(var c=h.next.next;c!==h.prev;){if(h.i!==c.i&&m(h,c)){var l=M(h,c);return h=i(h,h.next),l=i(l,l.next),s(h,e,r,n,a,o),void s(l,e,r,n,a,o)}c=c.next}h=h.next}while(h!==t)}function h(t,s,r,n){var a,o,h,l=[];for(a=0,o=s.length;a<o;a++)(h=e(t,s[a]*n,a<o-1?s[a+1]*n:t.length,n,!1))===h.next&&(h.steiner=!0),l.push(y(h));for(l.sort(c),a=0;a<l.length;a++)r=i(r=u(l[a],r),r.next);return r}function c(t,e){return t.x-e.x}function l(t){if(t.next.prev===t)return t;let e=t;for(;;){const i=e.next;if(i.prev===e||i===e||i===t)break;e=i}return e}function u(t,e){var s=function(t,e){var i,s=e,r=t.x,n=t.y,a=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var o=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=r&&o>a){if(a=o,o===r){if(n===s.y)return s;if(n===s.next.y)return s.next}i=s.x<s.next.x?s:s.next}}s=s.next}while(s!==e);if(!i)return null;if(r===a)return i;var h,c=i,l=i.x,u=i.y,x=1/0;s=i;do{r>=s.x&&s.x>=l&&r!==s.x&&_(n<u?r:a,n,l,u,n<u?a:r,n,s.x,s.y)&&(h=Math.abs(n-s.y)/(r-s.x),w(s,t)&&(h<x||h===x&&(s.x>i.x||s.x===i.x&&f(i,s)))&&(i=s,x=h)),s=s.next}while(s!==c);return i}(t,e);if(!s)return e;var r=M(s,t),n=i(s,s.next);let a=l(r);return i(a,a.next),n=l(n),l(e===s?n:e)}function f(t,e){return p(t.prev,t,e.prev)<0&&p(e.next,t,t.next)<0}function x(t,e,i,s){var r=t;do{if(null===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,x(t,e,i,s);r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,a,o,h,c=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,s=i,o=0,e=0;e<c&&(o++,s=s.nextZ);e++);for(h=c;o>0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,c*=2}while(a>1)}(r)}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function y(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function _(t,e,i,s,r,n,a,o){return(r-a)*(e-o)-(t-a)*(n-o)>=0&&(t-a)*(s-o)-(i-a)*(e-o)>=0&&(i-a)*(n-o)-(r-a)*(s-o)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&b(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(p(t.prev,t,e.prev)||p(t,e.prev,e))||g(t,e)&&p(t.prev,t,t.next)>0&&p(e.prev,e,e.next)>0)}function p(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function g(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,i,s){var r=O(p(t,e,i)),n=O(p(t,e,s)),a=O(p(i,s,t)),o=O(p(i,s,e));return r!==n&&a!==o||!(0!==r||!v(t,i,e))||!(0!==n||!v(t,s,e))||!(0!==a||!v(i,t,s))||!(0!==o||!v(i,e,s))}function v(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function O(t){return t>0?1:t<0?-1:0}function w(t,e){return p(t.prev,t,t.next)<0?p(t,e,t.next)>=0&&p(t,t.prev,e)>=0:p(t,e,t.prev)<0||p(t,t.next,e)<0}function M(t,e){var i=new T(t.i,t.x,t.y),s=new T(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function j(t,e,i,s){var r=new T(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function T(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(t,e,i,s){for(var r=0,n=e,a=i-s;n<i;n+=s)r+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return r}return t.deviation=function(t,e,i,s){var r=e&&e.length,n=r?e[0]*i:t.length,a=Math.abs(L(t,0,n,i));if(r)for(var o=0,h=e.length;o<h;o++){var c=e[o]*i,l=o<h-1?e[o+1]*i:t.length;a-=Math.abs(L(t,c,l,i))}var u=0;for(o=0;o<s.length;o+=3){var f=s[o]*i,x=s[o+1]*i,d=s[o+2]*i;u+=Math.abs((t[f]-t[d])*(t[x+1]-t[f+1])-(t[f]-t[x])*(t[d+1]-t[f+1]))}return 0===a&&0===u?0:Math.abs((u-a)/a)},t.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},s=0,r=0;r<t.length;r++){for(var n=0;n<t[r].length;n++)for(var a=0;a<e;a++)i.vertices.push(t[r][n][a]);r>0&&(s+=t[r-1].length,i.holes.push(s))}return i},t},void 0!==(n=r())&&(s.exports=n);var o=a.exports},632:function(t,e,i){"use strict";function s(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}i.d(e,"a",(function(){return s}))},852:function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));var s=i(0),r=i(102),n=i(1),a=(i(5),i(6),i(4),i(2));let o=class extends r.a{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const t=this.get("tileStore.tileScheme.spatialReference");return t&&t.toJSON()||null}};Object(s.a)([Object(n.b)({readOnly:!0})],o.prototype,"supportsTileUpdates",null),Object(s.a)([Object(n.b)({constructOnly:!0})],o.prototype,"remoteClient",void 0),Object(s.a)([Object(n.b)({constructOnly:!0})],o.prototype,"service",void 0),Object(s.a)([Object(n.b)()],o.prototype,"spatialReference",null),Object(s.a)([Object(n.b)({constructOnly:!0})],o.prototype,"tileInfo",void 0),Object(s.a)([Object(n.b)({constructOnly:!0})],o.prototype,"tileStore",void 0),o=Object(s.a)([Object(a.a)("esri.views.2d.layers.features.processors.BaseProcessor")],o);var h=o},987:function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return O}));var s=i(0),r=(i(9),i(5)),n=i(4),a=i(3),o=i(12),h=(i(1),i(6),i(2)),c=i(338),l=i(26),u=i(608),f=i(609),x=i(582),d=i(558),y=i(606),_=i(574),m=i(852),p=i(557);function g(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}function b(t){const e=t.message,i={message:{data:{},tileKey:e.tileKey,tileKeyOrigin:e.tileKeyOrigin},transferList:new Array};for(const s in e.data){const t=e.data[s];if(i.message.data[s]=null,Object(a.j)(t)){const e=t.stride,r=t.indices.slice(0),n=t.vertices.slice(0),o=t.records.slice(0),h={stride:e,indices:r,vertices:n,records:o,metrics:Object(a.a)(t.metrics,t=>t.slice(0))};i.transferList.push(r,n,o),i.message.data[s]=h}}return i}n.a.getLogger("esri.views.2d.layers.features.processors.SymbolProcessor");let v=class extends m.a{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))])}destroy(){}get supportsTileUpdates(){return!0}forEachBufferId(t){this._bufferIds.forEach(e=>{e.forEach(t)})}async update(t,e){const i=e.schema.processors[0];if("symbol"!==i.type)return;const s=Object(c.a)(this._schema,i);Object(c.b)(s,"mesh")&&(Object(r.a)("esri-2d-update-debug")&&console.debug("Applying Update - Processor:",s),t.mesh=!0,t.why.mesh.push("Symbology changed"),this._schema=i,this._factory=this._createFactory(i),this._factory.update(i,this.tileStore.tileScheme.tileInfo))}onTileMessage(t,e,i,s){return Object(o.v)(s),this._onTileData(t,e,i,s)}onTileClear(t){return this._bufferData.delete(t.key.id),this._bufferIds.delete(t.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:{clear:!0}})}onTileError(t,e,i){const s=i.signal,r={tileKey:t.id,error:e};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:s})}onTileUpdate(t){for(const e of t.removed)this._bufferData.has(e.key.id)&&this._bufferData.delete(e.key.id),this._bufferIds.has(e.key.id)&&this._bufferIds.delete(e.key.id);for(const e of t.added)this._bufferData.forEach(t=>{for(const i of t)i.message.tileKey===e.id&&this._updateTileMesh("append",e,b(i),[],!1,!1,null)})}_addBufferData(t,e){this._bufferData.has(t)||this._bufferData.set(t,[]),this._bufferData.get(t).push(b(e))}_createFactory(t){const{geometryType:e,objectIdField:i,fields:s}=this.service,r={geometryType:e,fields:s,spatialReference:l.a.fromJSON(this.spatialReference)},n=new x.a((t,e)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",t,e),this.tileStore.tileScheme.tileInfo),{matcher:o,aggregateMatcher:h}=t.mesh;return this._store=n,this._matchers.feature=Object(y.a)(o,n,r),this._matchers.aggregate=Object(a.a)(h,t=>Object(y.a)(t,n,r)),new f.a(e,i,n)}async _onTileData(t,e,i,s){Object(o.v)(s);const{type:r,addOrUpdate:n,remove:h}=e,c=e.end,l=!!this._schema.mesh.sortKey;if(!n){const e={type:r,addOrUpdate:null,remove:h,clear:!1,end:c,sort:l};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},s)}const u=this._processFeatures(t,n,i,s);try{const i=await u;if(Object(a.i)(i)){const e={type:r,addOrUpdate:null,remove:h,clear:!1,end:c,sort:l};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},s)}const n=[];for(const e of i){let i=!1;const s=e.message.bufferIds,r=t.key.id,o=e.message.tileKey;if(r!==o&&Object(a.j)(s)){if(!this.tileStore.get(o))continue;let t=this._bufferIds.get(o);t||(t=new Set,this._bufferIds.set(o,t));const e=Array.from(s);for(const s of e){if(t.has(s)){i=!0;break}t.add(s)}}i||(this._addBufferData(r,e),n.push(e))}await Object(o.b)(n.map(i=>{const n=t.key.id===i.message.tileKey,a=n?e.remove:[],o=n&&e.end;return this._updateTileMesh(r,t,i,a,o,e.clear,s.signal)}))}catch(f){this._handleError(t,f,s)}}async _updateTileMesh(t,e,i,s,r,n,h){const c=t,l=i.message.tileKey,u=!!this._schema.mesh.sortKey;l!==e.key.id&&(r=!1);const f=Object(a.a)(i,t=>t.message),x=Object(a.a)(i,t=>t.transferList)||[],d={type:c,addOrUpdate:f,remove:s,clear:!1,end:r,sort:u},y={transferList:Object(a.q)(x)||[],signal:h};return Object(o.v)(y),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:l,data:d},y)}async _processFeatures(t,e,i,s){if(Object(a.i)(e)||!e.hasFeatures)return null;const r={transform:t.transform,hasZ:!1,hasM:!1},n=this._factory,h={viewingMode:"",scale:t.scale},c=await this._matchers.feature,l=await this._matchers.aggregate;Object(o.v)(s);const u=this._getLabelInfos(t,e);return await n.analyze(e.getCursor(),c,l,r,h),Object(o.v)(s),this._writeFeatureSet(t,e,r,u,n,i)}_writeFeatureSet(t,e,i,s,r,n){const o=e.getSize(),h="simple"===this._schema.mesh.matcher.type&&this._schema.mesh.matcher.isDotDensity,c=new u.a(t.key.id,{features:o,records:o,metrics:0},h,n,!0),l={viewingMode:"",scale:t.scale},f=e.getCursor();for(;f.next();)try{const e=f.getDisplayId(),n=Object(a.j)(s)?s.get(e):null;r.writeCursor(c,f,i,l,t.level,n)}catch(d){}const x=t.tileInfoView.tileInfo.isWrappable;return c.serialize(x)}_handleError(t,e,i){if(!Object(o.m)(e)){const s={tileKey:t.id,error:e.message};return this.remoteClient.invoke("tileRenderer.onTileError",s,{signal:i.signal})}}_getLabelingSchemaForScale(t){const e=this._schema.mesh.labels;if(Object(a.i)(e))return null;if("subtype"===e.type){const i={type:"subtype",classes:{}};let s=!1;for(const r in e.classes){const n=e.classes[r].filter(e=>g(e,t.scale));s=s||!!n.length,i.classes[r]=n}return s?i:null}const i=e.classes.filter(e=>g(e,t.scale));return i.length?{type:"simple",classes:i}:null}_getLabels(t,e){if("subtype"===e.type){var i;const s=this.service.subtypeField,r=Object(a.s)(s,"Expected to find subtype Field"),n=t.readAttribute(r);return null==n?[]:null!=(i=e.classes[n])?i:[]}return e.classes}_getLabelInfos(t,e){const i=this._getLabelingSchemaForScale(t);if(Object(a.i)(i))return null;const s=new Map,r=e.getCursor();for(;r.next();){const t=r.getDisplayId(),e=[],n=Object(p.c)(t),a=n&&1!==r.readAttribute("cluster_count")?"aggregate":"feature",o=this._getLabels(r,i);for(const i of o){if(i.target!==a)continue;const s=r.getStorage(),o=n&&"feature"===a?s.getComputedStringAtIndex(r.readAttribute("referenceId"),i.fieldIndex):s.getComputedStringAtIndex(t,i.fieldIndex);if(!o)continue;const h=Object(d.a)(o.toString()),c=h[0],l=h[1];this._store.getMosaicItem(i.symbol,Object(_.a)(c)).then(t=>{e[i.index]={glyphs:t.glyphMosaicItems,rtl:l,index:i.index}})}s.set(t,e)}return s}};v=Object(s.a)([Object(h.a)("esri.views.2d.layers.features.processors.SymbolProcessor")],v);var O=v}}]);
//# sourceMappingURL=48.eba53c7b.chunk.js.map