chunk-39b24b6e.2b725828.js 57 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-39b24b6e"],{"175e":function(e,t,s){"use strict";s.d(t,"a",(function(){return r})),s.d(t,"b",(function(){return h})),s.d(t,"c",(function(){return o})),s.d(t,"d",(function(){return f})),s.d(t,"e",(function(){return d})),s.d(t,"f",(function(){return u})),s.d(t,"g",(function(){return c})),s.d(t,"h",(function(){return l}));const r=8388607,i=8388608,n=254,a=255,o=0,h=1,c=e=>(e&i)>>>23,u=e=>e&r,d=e=>c(e)===h?n:a;function l(e){return c(e)===h}function f(e,t){return((t?i:0)|e)>>>0}},2855:function(e,t,s){"use strict";s.d(t,"a",(function(){return d}));var r=s("a29a"),i=s("1c92"),n=s("8c71"),a=s("3349"),o=s("738e"),h=s("8c81"),c=s("e4b1");class u{acquire(e){return{refCount:1,version:-1,labelMat2d:Object(n["b"])(),tileMat3:Object(n["b"])(),dvs:Object(n["b"])()}}release(e){}}class d extends c["a"]{constructor(e,t,s){super(e,t,s,h["P"],h["P"])}destroy(){super.destroy(),this._transforms&&d.TransformCache.release(this.key.hash)}setTransform(e,t){const s=t/(e.resolution*e.pixelRatio),n=this.transforms.tileMat3,[h,c]=e.toScreenNoRotation([0,0],[this.x,this.y]),u=this.width/this.rangeX*s,d=this.height/this.rangeY*s;Object(i["o"])(n,u,0,0,0,d,0,h,c,1),Object(i["l"])(this.transforms.dvs,e.displayViewMat3,n);const l=this.transforms.labelMat2d,f=e.getScreenTransform(l,t),_=Object(o["a"])();Object(a["t"])(_,[this.x,this.y],f),Object(r["a"])(l,_),Object(r["f"])(l,e.viewMat2d,l)}_createTransforms(){return d.TransformCache.acquire(this.key.hash)}}d.TransformCache=new u},6722:function(e,t,s){"use strict";s.d(t,"a",(function(){return c}));var r=s("c120"),i=s("c84e"),n=s("9a02"),a=s("6f75"),o=s("ec5e");const h=(e,t)=>e.key.level-t.key.level!=0?e.key.level-t.key.level:e.key.row-t.key.row!=0?e.key.row-t.key.row:e.key.col-t.key.col;class c extends n["a"]{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(h),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,s=super.createRenderParams(e);return s.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,s.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),s}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[o["a"]],drawPhase:i["c"].DEBUG|i["c"].MAP|i["c"].HIGHLIGHT,target:()=>this.getStencilTarget()})),Object(r["a"])("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[a["a"]],drawPhase:i["c"].DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}updateTransforms(e){for(const t of this.children){const s=this._tileInfoView.getTileResolution(t.key);t.setTransform(e,s)}}setStencilReference(e){let t=1;for(const s of this.children)s.stencilRef=t++}}},"6f2d":function(e,t,s){"use strict";s.d(t,"a",(function(){return k}));var r=s("f4cc"),i=s("8ca7"),n=s("ce50"),a=s("c120"),o=s("e92d"),h=s("b2b2"),c=s("8c81"),u=s("175e"),d=s("c8dd"),l=s("97cb"),f=s("d17d"),_=s("d267"),p=s("a1ff");const b=o["a"].getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),g=Object(l["b"])(l["a"],b);class y{constructor(e,t,s){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:r,pixelType:i,textureOnly:n}=e,a=Object(d["l"])(i);this.shared=s,this.pixelType=i,this.size=t,this.textureOnly=n,n||(this.data=new a(Object(h["t"])(r))),this._resetRange()}destroy(){Object(h["b"])(this._texture,e=>e.dispose());for(const e in this._fbos)Object(h["b"])(this._fbos[e],t=>{"0"===e&&t.detachColorTexture(),t.dispose()}),this._fbos[e]=null;this._texture=null}get _textureDesc(){return{target:f["A"].TEXTURE_2D,wrapMode:f["B"].CLAMP_TO_EDGE,pixelFormat:f["p"].RGBA,dataType:this.pixelType,samplingMode:f["z"].NEAREST,width:this.size,height:this.size}}setData(e,t,s){const r=Object(u["f"])(e),i=Object(h["t"])(this.data),n=r*this.texelSize+t;!i||n>=i.length||(i[n]=s,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r))}getData(e,t){if(Object(h["j"])(this.data))return null;const s=Object(u["f"])(e)*this.texelSize+t;return!this.data||s>=this.data.length?null:this.data[s]}getTexture(e){return Object(h["u"])(this._texture,()=>this._initTexture(e))}getFBO(e,t=0){if(Object(h["j"])(this._fbos[t])){const s={colorTarget:f["y"].TEXTURE,depthStencilTarget:f["m"].NONE},r=0===t?this.getTexture(e):this._textureDesc;this._fbos[t]=new _["a"](e,s,r)}return this._fbos[t]}get locked(){return!(this.pixelType!==f["q"].UNSIGNED_BYTE||!this.shared||this.textureOnly||!Object(a["a"])("esri-atomics")||!this.data)&&1===Atomics.load(this.data,0)}get hasDirty(){const e=this.dirtyStart;return this.dirtyEnd>=e}updateTexture(e,t){if(!this.locked){try{const t=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const r=Object(h["t"])(this.data).buffer,i=this.getTexture(e),a=4,o=(t-t%this.size)/this.size,c=(s-s%this.size)/this.size,u=o,l=this.size,f=c,_=o*this.size*a,p=(l+f*this.size)*a-_,g=Object(d["l"])(this.pixelType),y=new g(r,_*g.BYTES_PER_ELEMENT,p),x=this.size,m=f-u+1;if(m>this.size)return void b.error(new n["a"]("mapview-webgl","Out-of-bounds index when updating AttributeData"));i.updateData(0,0,u,x,m,y)}catch(s){}t()}}update(e){const{data:t,start:s,end:r}=e;if(Object(h["k"])(t)){const r=this.data,i=s*this.texelSize;for(let s=0;s<t.length;s++){const n=1<<s%this.texelSize;e.layout&n&&(r[i+s]=t[s])}}this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,r)}resize(e,t){const s=this.size;if(this.size=t,this.textureOnly)return void(s!==this.size&&(this._lastTexture=this._texture,this._texture=null));const r=Object(d["l"])(this.pixelType);this.destroy(),this.data=new r(Object(h["t"])(e.buffer))}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(e){const t=new p["a"](e,this._textureDesc,Object(h["u"])(this.data,void 0));if(Object(h["k"])(this._lastTexture)&&this._fbos[0]){const s=this._lastTexture.descriptor.width,r=this._lastTexture.descriptor.height,i=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(e),o=Object(d["m"])(i),h=new(Object(d["l"])(i))(new ArrayBuffer(s*r*o*this.texelSize)),c=e.getBoundFramebufferObject(),{x:u,y:l,width:f,height:_}=e.getViewport();e.bindFramebuffer(a),a.readPixels(0,0,s,r,n,i,h),t.updateData(0,0,0,2*s,r/2,h),e.setViewport(u,l,f,_),e.bindFramebuffer(c)}return this.destroy(),this._texture=t,this._texture}}class x{constructor(e){this._onUpdate=e,this._initialized=!1,this._forceNextUpload=!1,this._locked=!1}initialize(e){const{blocks:t,shared:s,size:r}=e;if(this.shared=s,this.size=r,g("Initializing AttributeStoreView",e),Object(h["j"])(this._data))this._data=Object(h["m"])(t,e=>new y(e,r,s));else for(let i=0;i<this._data.length;i++){const e=this._data[i],n=t[i];Object(h["k"])(n)&&(Object(h["j"])(e)?this._data[i]=new y(n,r,s):e.resize(n,r))}this._initialized=!0}destroy(){Object(h["b"])(this._data,e=>Object(h["m"])(e,e=>e.destroy())),Object(h["b"])(this._defaultTexture,e=>e.dispose())}isEmpty(){const e=this._data;return Object(h["j"])(e)}isUpdating(){const e=Object(h["k"])(this._pendingAttributeUpdate),t=e;return Object(a["a"])("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${t}\n -> hasPendingUpdate ${e}`),t}getBlock(e){return Object(h["j"])(this._data)?null:this._data[e]}setLabelMinZoom(e,t){this.setData(e,0,1,t)}getLabelMinZoom(e){return this.getData(e,0,1,255)}getFilterFlags(e){return this.getData(e,0,0,0)}getVVSize(e){return this.getData(e,c["e"],0,0)}getData(e,t,s,r){if(!this._data)return 0;const i=Object(h["t"])(this._data)[t];if(Object(h["j"])(i))return 0;const n=i.getData(e,s);return Object(h["k"])(n)?n:r}setData(e,t,s,r){const i=Object(h["t"])(this._data)[t];Object(h["t"])(i).setData(e,s,r)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(e){if(this._pendingAttributeUpdate)return void b.error(new n["a"]("mapview-webgl","Tried to update attribute data with a pending update"));const t=Object(r["g"])();return g("AttributeStoreView Update Requested",e),this._pendingAttributeUpdate={data:e,resolver:t},t.promise}update(){if(this._initialized&&Object(h["k"])(this._pendingAttributeUpdate)){const{data:e,resolver:t}=this._pendingAttributeUpdate,s=Object(h["t"])(this._data);for(let r=0;r<e.blocks.length;r++){const t=e.blocks[r],i=s[r];Object(h["b"])(i,e=>Object(h["b"])(t,t=>{g("Updating block "+r,t),e.update(t)}))}this._pendingAttributeUpdate=null,t(),this._onUpdate()}}bindTextures(e,t=!0){this.update();const s=this._getDefaultTexture(e);if(!this._initialized)return e.bindTexture(s,c["B"]),void(t&&(e.bindTexture(s,c["C"]),e.bindTexture(s,c["D"]),e.bindTexture(s,c["E"]),e.bindTexture(s,c["H"])));const r=Object(h["t"])(this._data);this._locked&&!this._forceNextUpload||(Object(h["h"])(r,t=>t.updateTexture(e,()=>this._onUpdate())),this._forceNextUpload=!1),e.bindTexture(Object(h["n"])(r[c["c"]],s,t=>t.getTexture(e)),c["B"]),t&&(e.bindTexture(Object(h["n"])(r[c["d"]],s,t=>t.getTexture(e)),c["H"]),e.bindTexture(Object(h["n"])(r[c["a"]],s,t=>t.getTexture(e)),c["C"]),e.bindTexture(Object(h["n"])(r[c["e"]],s,t=>t.getTexture(e)),c["D"]),e.bindTexture(Object(h["n"])(r[c["b"]],s,t=>t.getTexture(e)),c["E"]))}_getDefaultTexture(e){if(Object(h["j"])(this._defaultTexture)){const t={wrapMode:f["B"].CLAMP_TO_EDGE,pixelFormat:f["p"].RGBA,dataType:f["q"].UNSIGNED_BYTE,samplingMode:f["z"].NEAREST,width:1,height:1};this._defaultTexture=new p["a"](e,t,new Uint8Array(4))}return this._defaultTexture}}var m=s("6722"),E=s("9ef0"),v=s("a915"),w=s("8048"),O=s("9b40"),j=s("b2af");function R(e,t){const s=t.length;if(e<t[0].value||1===s)return t[0].size;for(let r=1;r<s;r++)if(e<t[r].value){const s=(e-t[r-1].value)/(t[r].value-t[r-1].value);return t[r-1].size+s*(t[r].size-t[r-1].size)}return t[s-1].size}function T(e,t,s=0){if(Object(h["j"])(t))return e[s+0]=0,e[s+1]=0,e[s+2]=0,void(e[s+3]=0);const{r:r,g:i,b:n,a:a}=t;e[s+0]=r*a/255,e[s+1]=i*a/255,e[s+2]=n*a/255,e[s+3]=a}class S{constructor(){this.symbolLevels=[],this.vvColorValues=new Float32Array(8),this.vvColors=new Float32Array(32),this.vvOpacityValues=new Float32Array(8),this.vvOpacities=new Float32Array(8),this.vvSizeMinMaxValue=new Float32Array(4),this.ddColors=new Float32Array(32),this.ddBackgroundColor=new Float32Array(4),this.ddActiveDots=new Float32Array(8),this._vvMaterialParameters={vvSizeEnabled:!1,vvColorEnabled:!1,vvRotationEnabled:!1,vvRotationType:"geographic",vvOpacityEnabled:!1}}getSizeVVFieldStops(e){const t=this._vvSizeFieldStops;switch(t.type){case"static":return t;case"level-dependent":return Object(h["u"])(t.levels[e],()=>{let s=1/0,r=0;for(const o in t.levels){const t=parseFloat(o),i=Math.abs(e-t);i<s&&(s=i,r=t)}if(s===1/0)return{sizes:new Float32Array([0,0,0,0,0,0]),values:new Float32Array([0,0,0,0,0,0])};const i=2**((e-r)/2),n=Object(h["t"])(t.levels[r]),a=new Float32Array(n.values);return a[2]*=i,a[3]*=i,{sizes:Object(h["t"])(n.sizes),values:a}})}}get vvMaterialParameters(){return this._vvMaterialParameters}update(e){Object(h["k"])(this._vvInfo)&&this._updateVisualVariables(this._vvInfo.vvRanges,e)}setInfo(e,t,s){this._updateEffects(s),this._vvInfo=t,"dot-density"===e.type&&this._updateDotDensityInfo(e)}getVariation(){return{ddDotBlending:this.ddDotBlending,outsideLabelsVisible:this.outsideLabelsVisible,oesTextureFloat:Object(j["a"])().supportsTextureFloat}}getVariationHash(){return(this.ddDotBlending?1:0)|(this.outsideLabelsVisible?1:0)<<1}_updateEffects(e){Object(h["k"])(e)?this.outsideLabelsVisible=e.excludedLabelsVisible:this.outsideLabelsVisible=!1}_updateVisualVariables(e,t){const s=this._vvMaterialParameters;if(s.vvOpacityEnabled=!1,s.vvSizeEnabled=!1,s.vvColorEnabled=!1,s.vvRotationEnabled=!1,!e)return;const r=e.size;if(r){if(s.vvSizeEnabled=!0,r.minMaxValue){const e=r.minMaxValue;let s,i;if(Object(d["r"])(e.minSize)&&Object(d["r"])(e.maxSize))if(Object(d["u"])(e.minSize)&&Object(d["u"])(e.maxSize))s=Object(v["g"])(e.minSize),i=Object(v["g"])(e.maxSize);else{const r=t.scale;s=Object(v["g"])(R(r,e.minSize.stops)),i=Object(v["g"])(R(r,e.maxSize.stops))}this.vvSizeMinMaxValue.set([e.minDataValue,e.maxDataValue,s,i])}if(r.scaleStops&&(this.vvSizeScaleStopsValue=Object(v["g"])(R(t.scale,r.scaleStops.stops))),r.unitValue){const e=Object(w["f"])(t.spatialReference)/O["a"][r.unitValue.unit];this.vvSizeUnitValueToPixelsRatio=e/t.resolution}r.fieldStops&&(this._vvSizeFieldStops=r.fieldStops)}const i=e.color;i&&(s.vvColorEnabled=!0,this.vvColorValues.set(i.values),this.vvColors.set(i.colors));const n=e.opacity;n&&(s.vvOpacityEnabled=!0,this.vvOpacityValues.set(n.values),this.vvOpacities.set(n.opacities));const a=e.rotation;a&&(s.vvRotationEnabled=!0,s.vvRotationType=a.type)}_updateDotDensityInfo(e){const t=e.attributes;this.ddDotValue=e.dotValue,this.ddDotScale=e.referenceScale,this.ddDotSize=e.dotSize,this.ddDotBlending=e.dotBlendingEnabled,this.ddSeed=e.seed;for(let s=0;s<c["o"];s++){const e=s>=t.length?new E["a"]([0,0,0,0]):t[s].color;T(this.ddColors,e,4*s)}for(let s=0;s<8;s++)this.ddActiveDots[s]=s<e.attributes.length?1:0;T(this.ddBackgroundColor,e.backgroundColor)}}class k extends m["a"]{constructor(e){super(e),this._rendererInfo=new S,this._materialItemsRequestQueue=new i["a"],this.attributeView=new x(()=>this.onAttributeStoreUpdate())}destroy(){this.removeAllChildren(),this.children.forEach(e=>e.destroy()),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(e,t,s){this._rendererInfo.setInfo(e,t,s),this.requestRender()}async getMaterialItems(e,t){if(!e||0===e.length)return null;const s=Object(r["g"])();return this._materialItemsRequestQueue.push({items:e,abortOptions:t,resolver:s}),this.requestRender(),s.promise}doRender(e){if(e.context.capabilities.enable("textureFloat"),e.context.capabilities.enable("vao"),this._materialItemsRequestQueue.length>0){let t=this._materialItemsRequestQueue.pop();for(;t;)this._processMaterialItemRequest(e,t),t=this._materialItemsRequestQueue.pop()}super.doRender(e)}renderChildren(e){for(const t of this.children)t.commit(e);this._rendererInfo.update(e.state),super.renderChildren(e)}createRenderParams(e){const t=super.createRenderParams(e);return t.rendererInfo=this._rendererInfo,t.attributeView=this.attributeView,t}onAttributeStoreUpdate(){}_processMaterialItemRequest(e,{items:t,abortOptions:s,resolver:r}){const{painter:i,pixelRatio:n}=e,a=t.map(e=>i.textureManager.rasterizeItem(e.symbol,n,e.glyphIds,s));Promise.all(a).then(e=>{if(!this.stage)return void r.reject();const s=e.map((e,s)=>({id:t[s].id,mosaicItem:e}));r.resolve(s)},r.reject)}}},8332:function(e,t,s){"use strict";s.d(t,"a",(function(){return _})),s.d(t,"b",(function(){return c}));var r=s("b2b2"),i=s("a915"),n=s("a9a2"),a=s("8c81"),o=s("c84e"),h=s("3484");function c(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}function u(e){return{value:e.value,size:Object(i["j"])(e.size)}}function d(e){return e.map(e=>u(e))}function l(e){if("string"==typeof e||"number"==typeof e)return Object(i["j"])(e);const t=e;return{type:"size",expression:t.expression,stops:d(t.stops)}}const f=e=>{const t=[],s=[],r=d(e),n=r.length;for(let o=0;o<6;o++){const e=r[Math.min(o,n-1)];t.push(e.value),s.push(null==e.size?a["x"]:Object(i["g"])(e.size))}return{values:new Float32Array(t),sizes:new Float32Array(s)}};function _(e){const t=e&&e.length>0?{}:null,s=t?{}:null;if(!t)return{vvFields:t,vvRanges:s};for(const r of e)if(r.field&&(t[r.type]=r.field),"size"===r.type){s.size||(s.size={});const e=r;switch(Object(h["a"])(e)){case o["e"].SIZE_MINMAX_VALUE:s.size.minMaxValue={minDataValue:e.minDataValue,maxDataValue:e.maxDataValue,minSize:l(e.minSize),maxSize:l(e.maxSize)};break;case o["e"].SIZE_SCALE_STOPS:s.size.scaleStops={stops:d(e.stops)};break;case o["e"].SIZE_FIELD_STOPS:if(e.levels){const t={};for(const s in e.levels)t[s]=f(e.levels[s]);s.size.fieldStops={type:"level-dependent",levels:t}}else s.size.fieldStops={type:"static",...f(e.stops)};break;case o["e"].SIZE_UNIT_VALUE:s.size.unitValue={unit:e.valueUnit,valueRepresentation:e.valueRepresentation}}}else if("color"===r.type)s.color=g(r);else if("opacity"===r.type)s.opacity=p(r);else if("rotation"===r.type){const e=r;s.rotation={type:e.rotationType}}return{vvFields:t,vvRanges:s}}function p(e){const t={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if("string"==typeof e.field){if(!e.stops)return null;{if(e.stops.length>8)return null;const s=e.stops;for(let e=0;e<8;++e){const r=s[Math.min(e,s.length-1)];t.values[e]=r.value,t.opacities[e]=r.opacity}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const s=e.stops&&e.stops.length>=0&&e.stops[0].opacity;for(let e=0;e<8;e++)t.values[e]=1/0,t.opacities[e]=s}}return t}function b(e,t,s){e[4*t+0]=s.r/255,e[4*t+1]=s.g/255,e[4*t+2]=s.b/255,e[4*t+3]=s.a}function g(e){if(Object(r["j"])(e))return null;if(e.normalizationField)return null;const t={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if("string"==typeof e.field){if(!e.stops)return null;{if(e.stops.length>8)return null;t.field=e.field;const s=e.stops;for(let e=0;e<8;++e){const r=s[Math.min(e,s.length-1)];t.values[e]=r.value,b(t.colors,e,r.color)}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const s=e.stops&&e.stops.length>=0&&e.stops[0].color;for(let e=0;e<8;e++)t.values[e]=1/0,b(t.colors,e,s)}}for(let s=0;s<32;s+=4)Object(n["b"])(t.colors,s,!0);return t}},"971e":function(e,t,s){"use strict";s.d(t,"a",(function(){return i}));var r=s("b2b2");class i{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(0===this.size)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return 0===this.size?null:this._buffer[this._start]}find(e){if(0===this.size)return null;for(const t of this._buffer)if(Object(r["k"])(t)&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;Object(r["k"])(t);)e&&e(t),t=this.dequeue()}}},"97cb":function(e,t,s){"use strict";s.d(t,"a",(function(){return i})),s.d(t,"b",(function(){return r}));const r=(e,t)=>e&&((...e)=>t.warn("DEBUG:",...e))||(()=>null),i=!1},"9a02":function(e,t,s){"use strict";s.d(t,"a",(function(){return S}));s("c120");var r=s("b2b2"),i=s("8c71"),n=s("3b1a"),a=s("00c0"),o=s("ce50"),h=s("e92d"),c=s("7c4b"),u=s("9812"),d=s("3349"),l=s("02f1"),f=s("6655"),_=s("8152"),p=s("d114"),b=s("7ce4"),g=s("d17d");const y=h["a"].getLogger("esri.views.2d.engine.webgl.Mesh2D"),x=e=>{switch(e.BYTES_PER_ELEMENT){case 1:return g["k"].UNSIGNED_BYTE;case 2:return g["k"].UNSIGNED_SHORT;case 4:return g["k"].UNSIGNED_INT;default:throw new o["a"]("Cannot get DataType of array")}},m=(e,t,s,r)=>{let i=0;for(let n=1;n<s;n++){const s=e[2*(t+n-1)],r=e[2*(t+n-1)+1];i+=(e[2*(t+n)]-s)*(e[2*(t+n)+1]+r)}return r?i>0:i<0},E=({coords:e,lengths:t},s)=>{const r=[];for(let i=0,n=0;i<t.length;n+=t[i],i+=1){const a=n,o=[];for(;i<t.length-1&&m(e,n+t[i],t[i+1],s);i+=1,n+=t[i])o.push(n+t[i]-a);const h=e.slice(2*a,2*(n+t[i])),c=Object(u["a"])(h,o,2);for(const e of c)r.push(e+a)}return r};class v{constructor(e,t,s,r=!1){this._cache={},this.vertices=e,this.indices=t,this.primitiveType=s,this.isMapSpace=r}static fromRect({x:e,y:t,width:s,height:r}){const i=e,n=t,a=i+s,o=n+r;return v.fromScreenExtent({xmin:i,ymin:n,xmax:a,ymax:o})}static fromPath(e){const t=Object(f["f"])(new _["a"],e.path,!1,!1),s=t.coords,r=new Uint32Array(E(t,!0)),i=new Uint32Array(s.length/2);for(let n=0;n<i.length;n++)i[n]=Object(p["a"])(Math.floor(s[2*n]),Math.floor(s[2*n+1]));return new v({geometry:i},r,g["r"].TRIANGLES)}static fromGeometry(e,t){const s=t.geometry.type;switch(s){case"polygon":return v.fromPolygon(e,t.geometry);case"extent":return v.fromMapExtent(e,t.geometry);default:return y.error(new o["a"]("mapview-bad-type","Unable to create a mesh from type "+s,t)),v.fromRect({x:0,y:0,width:1,height:1})}}static fromPolygon(e,t){const s=Object(f["h"])(new _["a"],t,!1,!1),r=s.coords,i=new Uint32Array(E(s,!1)),n=new Uint32Array(r.length/2),a=Object(l["b"])(),o=Object(l["b"])();for(let h=0;h<n.length;h++)Object(d["s"])(a,r[2*h],r[2*h+1]),e.toScreen(o,a),n[h]=Object(p["a"])(Math.floor(o[0]),Math.floor(o[1]));return new v({geometry:n},i,g["r"].TRIANGLES,!0)}static fromScreenExtent({xmin:e,xmax:t,ymin:s,ymax:r}){const i={geometry:new Uint32Array([Object(p["a"])(e,s),Object(p["a"])(t,s),Object(p["a"])(e,r),Object(p["a"])(e,r),Object(p["a"])(t,s),Object(p["a"])(t,r)])},n=new Uint32Array([0,1,2,3,4,5]);return new v(i,n,g["r"].TRIANGLES)}static fromMapExtent(e,t){const[s,r]=e.toScreen([0,0],[t.xmin,t.ymin]),[i,n]=e.toScreen([0,0],[t.xmax,t.ymax]),a={geometry:new Uint32Array([Object(p["a"])(s,r),Object(p["a"])(i,r),Object(p["a"])(s,n),Object(p["a"])(s,n),Object(p["a"])(i,r),Object(p["a"])(i,n)])},o=new Uint32Array([0,1,2,3,4,5]);return new v(a,o,g["r"].TRIANGLES)}destroy(){Object(r["k"])(this._cache.indexBuffer)&&this._cache.indexBuffer.dispose();for(const e in this._cache.vertexBuffers)Object(r["k"])(this._cache.vertexBuffers[e])&&this._cache.vertexBuffers[e].dispose()}get elementType(){return x(this.indices)}getIndexBuffer(e,t=g["D"].STATIC_DRAW){return this._cache.indexBuffer||(this._cache.indexBuffer=b["a"].createIndex(e,t,this.indices)),this._cache.indexBuffer}getVertexBuffers(e,t=g["D"].STATIC_DRAW){return this._cache.vertexBuffers||(this._cache.vertexBuffers=Object.keys(this.vertices).reduce((s,r)=>({...s,[r]:b["a"].createVertex(e,t,this.vertices[r])}),{})),this._cache.vertexBuffers}}var w=s("0fa6");const O=h["a"].getLogger("esri.views.2d.engine.webgl.ClippingInfo"),j=e=>parseFloat(e)/100;class R extends c["a"]{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=t.watch("version",()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new R(e,t)}_destroyGL(){Object(r["k"])(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),Object(r["k"])(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,s,i){const[n,a]=t.size;if("geometry"!==this._clip.type&&this._lastWidth===n&&this._lastHeight===a||(this._lastWidth=n,this._lastHeight=a,this._destroyGL()),Object(r["j"])(this._cache.vao)){const r=this._createMesh(t,this._clip),n=r.getIndexBuffer(e),a=r.getVertexBuffers(e);this._cache.mesh=r,this._cache.vao=new w["a"](e,s,i,a,n)}return this._cache.vao}_createTransforms(){return{dvs:Object(i["b"])()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,t){const[s,r]=e.size,i="string"==typeof t.left?j(t.left)*s:t.left,n="string"==typeof t.right?j(t.right)*s:t.right,a="string"==typeof t.top?j(t.top)*r:t.top,o="string"==typeof t.bottom?j(t.bottom)*r:t.bottom,h=i,c=a;return{x:h,y:c,width:Math.max(s-n-h,0),height:Math.max(r-o-c,0)}}_createMesh(e,t){switch(t.type){case"rect":return v.fromRect(this._createScreenRect(e,t));case"path":return v.fromPath(t);case"geometry":return v.fromGeometry(e,t);default:return O.error(new o["a"]("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),v.fromRect({x:0,y:0,width:1,height:1})}}}var T=s("c84e");class S extends a["a"]{constructor(){super(...arguments),this.name=this.constructor.name}set clips(e){this._clips=e,this.children.forEach(t=>t.clips=e),this._updateClippingInfo()}_createTransforms(){return{dvs:Object(i["b"])()}}doRender(e){const t=this.createRenderParams(e),{painter:s,globalOpacity:r,profiler:i,drawPhase:n}=t,a=n===T["c"].LABEL||n===T["c"].HIGHLIGHT?1:r*this.computedOpacity;i.recordContainerStart(this.name),s.beforeRenderLayer(t,this._clippingInfos?255:0,a),this.updateTransforms(e.state),this.renderChildren(t),s.compositeLayer(t,a),i.recordContainerEnd()}renderChildren(e){Object(r["j"])(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const s of this.children)s.beforeRender(e);for(const s of this._renderPasses)try{s.render(e)}catch(t){}for(const s of this.children)s.afterRender(e)}createRenderParams(e){return e.requireFBO=this.requiresDedicatedFBO,e}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[n["a"].clip],target:()=>this._clippingInfos,drawPhase:T["c"].MAP|T["c"].LABEL|T["c"].LABEL_ALPHA|T["c"].DEBUG|T["c"].HIGHLIGHT})]}updateTransforms(e){for(const t of this.children)t.setTransform(e)}onAttach(){super.onAttach(),this._updateClippingInfo()}onDetach(){super.onDetach(),this._updateClippingInfo()}_updateClippingInfo(){if(Object(r["k"])(this._clippingInfos)&&(this._clippingInfos.forEach(e=>e.destroy()),this._clippingInfos=null),!this.stage)return;const e=this._clips;Object(r["k"])(e)&&e.length&&(this._clippingInfos=e.items.map(e=>R.fromClipArea(this.stage,e))),this.requestRender()}}},"9f6d":function(e,t,s){"use strict";s.d(t,"a",(function(){return a}));var r=s("b2b2"),i=s("8c81");const n=2147483647;class a{constructor(e){this._head=e,this._cursor=e}static from(e,t=0,s=e.byteLength/o.BYTES_PER_RECORD-t){const r=new o(new Int32Array(e,t*o.BYTES_PER_RECORD,s*o.ELEMENTS_PER_RECORD));return new a(r)}size(){let e=this._cursor,t=0;for(;e;)t+=e.size(),e=e._link;return t}get id(){return this._cursor.id}set id(e){this._cursor.id=e}get materialKey(){return this._cursor.materialKey}set materialKey(e){this._cursor.materialKey=e}get insertAfter(){return this._cursor.insertAfter}get indexFrom(){return this._cursor.indexFrom}set indexFrom(e){this._cursor.indexFrom=e}get indexCount(){return this._cursor.indexCount}set indexCount(e){this._cursor.indexCount=e}get vertexFrom(){return this._cursor.vertexFrom}set vertexFrom(e){this._cursor.vertexFrom=e}get vertexCount(){return this._cursor.vertexCount}set vertexCount(e){this._cursor.vertexCount=e}get sortKey(){return this._cursor.sortKey}set sortKey(e){this._cursor.sortKey=e}get index(){return this._cursor._indexStart+this._cursor._index}seekIndex(e){let t=e;for(this._cursor=this._head;this._cursor;){const e=this._cursor.size();if(t<e)return this._cursor._index=t,!0;t-=e,this._cursor=this._cursor._link}return!1}forEach(e){const t=this.getCursor();for(;t.next();)e(t)}link(e){if(!this._head)return void(this._head=e._head);let t=this._head;for(;t._link;)t=t._link;t._link=e._head,t._link._indexStart=t._indexStart+t.size()}getCursor(){return this.copy()}lookup(e){for(this._cursor=this._head;this._cursor&&!this._cursor.lookup(e);){if(!this._cursor._link)return!1;this._cursor=this._cursor._link}return!!this._cursor}copy(){var e;const t=new a(null==(e=this._head)?void 0:e.copy());if(!t._head)return t;let s=t._head,r=t._head._link;for(;r;)s._link=r.copy(),s=r,r=s._link;return t}next(){return!!this._cursor&&(!!this._cursor.next()||!!this._cursor._link&&(this._cursor=this._cursor._link,this.next()))}peekId(){var e;return null!=(e=this._cursor.peekId())?e:this._cursor._link.peekId()}delete(e){let t=this._head,s=null;for(;t;){if(t.delete(e))return t.isEmpty()&&(Object(r["k"])(s)&&(s._link=t._link),t===this._head&&(this._head=t._link),t===this._cursor&&(this._cursor=t._link)),!0;s=t,t=t._link}return!1}}a.ELEMENTS_PER_RECORD=i["n"],a.BYTES_PER_RECORD=a.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT;class o{constructor(e){this._link=null,this._index=-1,this._indexStart=0,this._deletedCount=0,this._offsets={instance:null},this._packedRecords=e}static from(e,t=0,s=e.byteLength/this.BYTES_PER_RECORD-t){return new o(new Int32Array(e,t*this.BYTES_PER_RECORD,s*this.ELEMENTS_PER_RECORD))}delete(e){const t=this._index,s=this.lookup(e);if(s)for(this.id=n,++this._deletedCount;this.next()&&this.id===e;)this.id=n,++this._deletedCount;return this._index=t,s}isEmpty(){return this._deletedCount===this.size()}link(e){this._link?this._link.link(e):this._link=e}lookup(e){if(Object(r["j"])(this._offsets.instance)){this._offsets.instance=new Map;const e=this.copy();e._index=-1;let t=0;for(;e.next();)e.id!==t&&(this._offsets.instance.set(e.id,e._index),t=e.id)}if(!this._offsets.instance.has(e))return!1;const t=this._index;return this._index=this._offsets.instance.get(e),this.id!==n||(this._index=t,!1)}get id(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD]}set id(e){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD]=e}get materialKey(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+1]}set materialKey(e){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+1]=e}get insertAfter(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+2]}get indexFrom(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+3]}set indexFrom(e){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+3]=e}get indexCount(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+4]}set indexCount(e){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+4]=e}get vertexFrom(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+5]}set vertexFrom(e){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+5]=e}get vertexCount(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+6]}set vertexCount(e){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+6]=e}get sortKey(){return this._packedRecordsF32||(this._packedRecordsF32=new Float32Array(this._packedRecords.buffer)),this._packedRecordsF32[this._index*o.ELEMENTS_PER_RECORD+7]}set sortKey(e){this._packedRecordsF32||(this._packedRecordsF32=new Float32Array(this._packedRecords.buffer)),this._packedRecordsF32[this._index*o.ELEMENTS_PER_RECORD+7]=e}get index(){return this._index}size(){return this._packedRecords.length/o.ELEMENTS_PER_RECORD}next(){for(;++this._index<this.size()&&this.id===n;);return this._index<this.size()}peekId(){const e=(this._index+1)*o.ELEMENTS_PER_RECORD;return e>=this._packedRecords.length?0:this._packedRecords[e]}getCursor(){return this.copy()}copy(){const e=new o(this._packedRecords);return e._indexStart=this._indexStart,e._link=this._link,e._index=this._index,e._offsets=this._offsets,e._deletedCount=this._deletedCount,e}}o.ELEMENTS_PER_RECORD=i["n"],o.BYTES_PER_RECORD=o.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT},c1f7:function(e,t,s){"use strict";s.r(t),s.d(t,"default",(function(){return te}));var r=s("a4ee"),i=s("c120"),n=s("f4cc"),a=(s("e92d"),s("cea0"),s("b50f"),s("2dd4"),s("d386")),o=s("9180"),h=s("971e"),c=s("b2b2"),u=s("a29a"),d=s("2c63"),l=s("3349"),f=s("738e"),_=s("c84e"),p=s("c8dd"),b=s("2855");const g=6,y=4294967296;class x{constructor(e){this._head=e,this._cursor=e}static from(e){const t=m.from(new Float32Array(e));return new x(t)}get id(){return this._cursor.id}get baseZoom(){return this._cursor.baseZoom}get anchorX(){return this._cursor.anchorX}get anchorY(){return this._cursor.anchorY}get directionX(){return this._cursor.directionX}get directionY(){return this._cursor.directionY}get size(){return this._cursor.size}get materialKey(){return this._cursor.materialKey}get boundsCount(){return this._cursor.boundsCount}computedMinZoom(){return this._cursor.computedMinZoom()}setComputedMinZoom(e){return this._cursor.setComputedMinZoom(e)}boundsComputedAnchorX(e){return this._cursor.boundsComputedAnchorX(e)}boundsComputedAnchorY(e){return this._cursor.boundsComputedAnchorY(e)}setBoundsComputedAnchorX(e,t){return this._cursor.setBoundsComputedAnchorX(e,t)}setBoundsComputedAnchorY(e,t){return this._cursor.setBoundsComputedAnchorY(e,t)}boundsX(e){return this._cursor.boundsX(e)}boundsY(e){return this._cursor.boundsY(e)}boundsWidth(e){return this._cursor.boundsWidth(e)}boundsHeight(e){return this._cursor.boundsHeight(e)}link(e){if(Object(c["k"])(e._head))return this._cursor.link(e._head)}getCursor(){return this.copy()}copy(){var e;const t=new x(null==(e=this._head)?void 0:e.copy());if(!t._head)return t;let s=t._head,r=t._head._link;for(;r;)s._link=r.copy(),s=r,r=s._link;return t}peekId(){var e;return null!=(e=this._cursor.peekId())?e:this._cursor._link.peekId()}nextId(){const e=this.id;for(;e===this.id;)if(!this.next())return!1;return!0}save(){this._savedCursor=this._cursor,this._savedOffset=this._cursor._offset}restore(){this._cursor=this._savedCursor,this._cursor._offset=this._savedOffset}next(){if(!this._cursor)return!1;if(!this._cursor.next()){if(!this._cursor._link)return!1;this._cursor=this._cursor._link,this._cursor._offset=0}return!0}lookup(e){for(this._cursor=this._head;this._cursor&&!this._cursor.lookup(e);){if(!this._cursor._link)return!1;this._cursor=this._cursor._link}return!!this._cursor}delete(e){let t=this._head,s=null;for(;t;){if(t.delete(e))return t.isEmpty()&&Object(c["k"])(s)&&(s._link=t._link),!0;s=t,t=t._link}return!1}}class m{constructor(e){this._offset=-1,this._link=null,this._count=0,this._deletedCount=0,this._offsets={instance:null},this._buffer=e}static from(e){return new m(new Float32Array(e))}isEmpty(){return this._deletedCount===this.count}get count(){return this._count||(this._count=this._computeCount()),this._count}get id(){return this._buffer[this._offset+0]}set id(e){this._buffer[this._offset+0]=e}get baseZoom(){return this._buffer[this._offset+1]}get anchorX(){return this._buffer[this._offset+2]}get anchorY(){return this._buffer[this._offset+3]}get directionX(){return this._buffer[this._offset+4]}get directionY(){return this._buffer[this._offset+5]}get size(){return this._buffer[this._offset+6]}get materialKey(){return this._buffer[this._offset+7]}computedMinZoom(){return this._buffer[this._offset+8]}setComputedMinZoom(e){this._buffer[this._offset+8]=e}get boundsCount(){return this._buffer[this._offset+9]}boundsComputedAnchorX(e){return this._buffer[this._offset+10+e*g+0]}boundsComputedAnchorY(e){return this._buffer[this._offset+10+e*g+1]}setBoundsComputedAnchorX(e,t){this._buffer[this._offset+10+e*g+0]=t}setBoundsComputedAnchorY(e,t){this._buffer[this._offset+10+e*g+1]=t}boundsX(e){return this._buffer[this._offset+10+e*g+2]}boundsY(e){return this._buffer[this._offset+10+e*g+3]}boundsWidth(e){return this._buffer[this._offset+10+e*g+4]}boundsHeight(e){return this._buffer[this._offset+10+e*g+5]}link(e){let t=this;for(;t._link;)t=t._link;t._link=e}getCursor(){return this.copy()}copy(){const e=new m(this._buffer);return e._link=this._link,e._offset=this._offset,e._deletedCount=this._deletedCount,e._offsets=this._offsets,e._count=this._count,e}peekId(){const e=this._offset+10+this.boundsCount*g+0;return e>=this._buffer.length?0:this._buffer[e]}next(){let e=0;for(;this._offset<this._buffer.length&&e++<100&&(-1===this._offset?this._offset=0:this._offset+=10+this.boundsCount*g,this.id===y););return this.id!==y&&this._offset<this._buffer.length}delete(e){const t=this._offset,s=this.lookup(e);if(s)for(this.id=4294967295,++this._deletedCount;this.next()&&this.id===e;)this.id=4294967295,++this._deletedCount;return this._offset=t,s}lookup(e){const t=this._offset;if(Object(c["j"])(this._offsets.instance)){this._offsets.instance=new Map;const e=this.copy();e._offset=-1;let t=0;for(;e.next();)e.id!==t&&(this._offsets.instance.set(e.id,e._offset),t=e.id)}return!!this._offsets.instance.has(e)&&(this._offset=this._offsets.instance.get(e),this.id!==y||(this._offset=t,!1))}_computeCount(){const e=this._offset;let t=0;for(this._offset=-1;this.next();)t++;return this._offset=e,t}}class E{constructor(e){if(!Array.isArray(e))return void(this.data=e);this.data=e[0];let t=this;for(let s=1;s<e.length;s++)t.next=new E([e[s]]),t=t.next}*values(){let e=this;for(;e;)yield e.data,e=e.next}forEach(e){let t=this;for(;t;)e(t.data),t=t.next}find(e){var t;return e(this.data)?this:null==(t=this.next)?void 0:t.find(e)}max(e,t=this){const s=e(this.data)>e(t.data)?this:t;return this.next?this.next.max(e,s):s}remove(e,t=null){return this===e?t?(t.next=this.next,t):this.next:this.next.remove(e,this)}get last(){return this.next?this.next.last:this}}class v{constructor(e){this._head=null,Object(c["j"])(e)||(this._head=new E(e))}get head(){return this._head}maxAvailableSpace(){if(Object(c["j"])(this._head))return 0;const e=this._head.max(e=>e.end-e.start);return e.data.end-e.data.start}firstFit(e){if(Object(c["j"])(this._head))return null;let t=null,s=this._head;for(;s;){const r=s.data.end-s.data.start;if(r===e)return t?t.next=s.next:this._head=s.next,s.data.start;if(r>e){const t=s.data.start;return s.data.start+=e,t}t=s,s=s.next}return null}free(e,t){const s=e+t;if(Object(c["j"])(this._head)){const t=new E({start:e,end:s});return void(this._head=t)}if(s<=this._head.data.start){if(s===this._head.data.start)return void(this._head.data.start-=t);const r=new E({start:e,end:s});return r.next=this._head,void(this._head=r)}let r=this._head,i=r.next;for(;i;){if(i.data.start>=s){if(r.data.end===e){if(r.data.end+=t,r.data.end===i.data.start){const e=i.data.end-i.data.start;return r.data.end+=e,void(r.next=i.next)}return}if(i.data.start===s)return void(i.data.start-=t);const n=new E({start:e,end:s});return n.next=r.next,void(r.next=n)}r=i,i=i.next}if(e===r.data.end)return void(r.data.end+=t);const n=new E({start:e,end:s});r.next=n}}class w{constructor(e,t,s,r,i){this.target=e,this.geometryType=t,this.materialKey=s,this.indexFrom=r,this.indexCount=i}get indexEnd(){return this.indexFrom+this.indexCount}extend(e){this.indexCount+=e}}class O{constructor(e,t){this.geometryType=0,this._target=e,this.geometryType=t}static from(e,t,s,r){const i=new O(e,t);if(Object(c["k"])(r))for(const n of r)s.seekIndex(n),i.addRecord(s);else for(;s.next();)i.addRecord(s);return i}addRecord(e){const t=this._target,s=this.geometryType,r=e.materialKey;let i=e.indexFrom,n=e.indexCount;const a=e.vertexFrom,o=e.vertexCount;if(n||(i=a,n=o),Object(c["j"])(this._head)){const e=new w(t,s,r,i,n);return void(this._head=new E(e))}let h=null,u=this._head;for(;u;){if(i<u.data.indexFrom)return this._insert(r,i,n,h,u);h=u,u=u.next}this._insert(r,i,n,h,null)}forEach(e){Object(c["k"])(this._head)&&this._head.forEach(e)}*infos(){if(Object(c["k"])(this._head))for(const e of this._head.values())yield e}_insert(e,t,s,r,i){if(Object(c["j"])(r)&&Object(c["j"])(i)){const r=new w(this._target,this.geometryType,e,t,s);this._head=new E(r)}return Object(c["j"])(r)&&Object(c["k"])(i)?this._insertAtHead(e,t,s,i):Object(c["k"])(r)&&Object(c["j"])(i)?this._insertAtEnd(e,t,s,r):Object(c["k"])(r)&&Object(c["k"])(i)?this._insertAtMiddle(e,t,s,r,i):void 0}_insertAtHead(e,t,s,r){const i=t+s;if(e===r.data.materialKey&&i===r.data.indexFrom)r.data.indexFrom=t,r.data.indexCount+=s;else{const i=new w(this._target,this.geometryType,e,t,s);this._head=new E(i),this._head.next=r}}_insertAtEnd(e,t,s,r){if(r.data.materialKey===e&&r.data.indexEnd===t)r.data.indexCount+=s;else{const i=new w(this._target,this.geometryType,e,t,s),n=new E(i);r.next=n}}_insertAtMiddle(e,t,s,r,i){const n=t+s;if(r.data.materialKey===e&&r.data.indexEnd===t)r.data.indexCount+=s,r.data.materialKey===i.data.materialKey&&r.data.indexEnd===i.data.indexFrom&&(r.data.indexCount+=i.data.indexCount,r.next=i.next);else if(e===i.data.materialKey&&n===i.data.indexFrom)i.data.indexFrom=t,i.data.indexCount+=s;else{const n=new w(this._target,this.geometryType,e,t,s),a=new E(n);r.next=a,a.next=i}}}const j=Object(i["a"])("esri-2d-log-allocations");class R{constructor(e){this._array=e}get array(){return this._array}get length(){return this._array.length}static create(e){const t=k.acquire(e);return new R(t)}expand(e){const t=k.acquire(e);t.set(this._array),k.release(this._array),this._array=t}destroy(){k.release(this._array)}set(e,t){this._array.set(e._array,t)}slice(){const e=k.acquire(this._array.byteLength);return e.set(this._array),new R(e)}}class T{constructor(){this._data=new ArrayBuffer(T.BYTE_LENGTH),this._freeList=new v({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 64e6}get buffer(){return this._data}allocate(e){const t=this._freeList.firstFit(e);return Object(c["j"])(t)?null:new Uint32Array(this._data,t,e/Uint32Array.BYTES_PER_ELEMENT)}free(e){this._freeList.free(e.byteOffset,e.byteLength)}}class S{constructor(){this._bytesAllocated=0,this._pages=[],this._pagesByBuffer=new Map,this._addPage()}get _bytesTotal(){return this._pages.length*T.BYTE_LENGTH}acquire(e){if(this._bytesAllocated+=e,j&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>T.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const t of this._pages){const s=t.allocate(e);if(Object(c["k"])(s))return s}return Object(c["v"])(this._addPage().allocate(e),"Expected to allocate page")}release(e){this._bytesAllocated-=e.byteLength,j&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const t=this._pagesByBuffer.get(e.buffer);t&&t.free(e)}_addPage(){const e=new T;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}}const k=new S;var C=s("7ce4"),A=s("d17d");const M=1.25,B=32767,I=B<<16|B;class V{constructor(e,t,s){const r=R.create(t*s*Uint32Array.BYTES_PER_ELEMENT);this.size=t,this.strideInt=s,this.bufferType=e,this.dirty={start:1/0,end:0},this._gpu=null,this._cpu=r,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get invalidated(){return this.bufferSize&&!this._gpu}invalidate(){this._invalidateTriangleBuffer(),Object(c["b"])(this._gpu,e=>e.dispose()),this._gpu=null}_invalidateTriangleBuffer(){Object(c["b"])(this._gpuComputeTriangles,e=>e.dispose()),this._gpuComputeTriangles=null}destroy(){Object(c["b"])(this._gpu,e=>e.dispose()),Object(c["b"])(this._gpuComputeTriangles,e=>e.dispose()),Object(c["b"])(this._cpu,e=>e.destroy()),Object(c["b"])(this._cpu2,e=>e.destroy())}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new v({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(e){if(!(this.maxAvailableSpace()>=e)&&e*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const t=this._cpu.length/this.strideInt,s=Math.round((t+e)*M),r=s*this.strideInt;this._cpu.expand(r*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(t,s-t)}}set(e,t){this._cpu.array[e]!==t&&(this._cpu.array[e]=t,this.dirty.start=Math.min(e,this.dirty.start),this.dirty.end=Math.max(e,this.dirty.end))}getGPUBuffer(e,t=!1){if(!this.bufferSize)return null;if(t){if("index"!==this.bufferType)throw new Error("Tired to get triangle buffer, but target is not an index buffer");return Object(c["j"])(this._gpuComputeTriangles)&&(this._gpuComputeTriangles=this._createComputeBuffer(e)),this._gpuComputeTriangles}return Object(c["j"])(this._gpu)&&(this._gpu=this._createBuffer(e)),this._gpu}getCPUBuffer(){if(!this._cpu2){const e=this._cpu.slice();this._cpu2=e}return this._cpu2.length!==this._cpu.length&&this._cpu2.expand(this._cpu.length*this._cpu.array.BYTES_PER_ELEMENT),this._cpu2.set(this._cpu),this._cpu2}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(e,t,s,r){const i=s*this.strideInt;if(!i)return 0;const n=t*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,a=new Uint32Array(e,n,i),o=Object(c["v"])(this.freeList.firstFit(s),"First fit region must be defined")*this.strideInt,h=i,u=o/this.strideInt-t;if(0!==r)for(let c=0;c<a.length;c++)a[c]+=r;return this._cpu.array.set(a,o),this.dirty.start=Math.min(this.dirty.start,o),this.dirty.end=Math.max(this.dirty.end,o+h),this.fillPointer=Math.max(this.fillPointer,o+h),u}free(e,t,s){const r=e*this.strideInt,i=(e+t)*this.strideInt;if(!0===s)for(let n=e;n!==e+t;n++)this._cpu.array[n*this.strideInt]=I;this.dirty.start=Math.min(this.dirty.start,r),this.dirty.end=Math.max(this.dirty.end,i),this.freeList.free(e,t)}upload(){if(this.dirty.end){if(this._invalidateTriangleBuffer(),Object(c["j"])(this._gpu))return this.dirty.start=1/0,void(this.dirty.end=0);this._gpu.setSubDataFromView(this._cpu.array,this.dirty.start,this.dirty.start,this.dirty.end),this.dirty.start=1/0,this.dirty.end=0}}_createBuffer(e){const t=A["D"].DYNAMIC_DRAW;return"index"===this.bufferType?C["a"].createIndex(e,t,this._cpu.array):C["a"].createVertex(e,t,this._cpu.array)}_createComputeBuffer(e){const t=A["D"].DYNAMIC_DRAW,s=new Uint32Array(this.fillPointer/3);for(let r=0;r<this.fillPointer;r+=3)s[r/3]=this._cpu.array[r];return C["a"].createIndex(e,t,s)}}var L=s("9f6d"),z=s("0fa6");const P=0,D=1;class U{constructor(e,t){this._vaos=new Map,this._indicesInvalid=!1,this.geometryType=e}destroy(){for(const[e,t]of this._vaos)Object(c["k"])(t)&&t.dispose(!1);this._indexBuffer=Object(c["d"])(this._indexBuffer),this._vertexBuffer=Object(c["d"])(this._vertexBuffer)}insert(e,t,s){if(!e.records.byteLength)return;const r=e.stride;if(this._vertexBuffer&&this._indexBuffer){const s=e.indices.byteLength/4,i=e.vertices.byteLength/r;this._indexBuffer.ensure(s),this._vertexBuffer.ensure(i);const{vertices:n,indices:a}=e,o=L["a"].from(e.records),h=this._vertexBuffer.insert(n,0,n.byteLength/r,0),u=this._indexBuffer.insert(a,0,a.byteLength/4,h);if(o.forEach(e=>{e.indexFrom+=u,e.vertexFrom+=h}),Object(c["v"])(this._records,"Expected records to be defined").link(o),t)this._indicesInvalid=!0;else if(this._displayList){const e=o.getCursor();for(;e.next();)this._displayList.addRecord(e)}}else{const s=e.indices.byteLength/4,i=e.vertices.byteLength/r,n=r/Uint32Array.BYTES_PER_ELEMENT;this._records=L["a"].from(e.records),this._indexBuffer=new V("index",s,1),this._vertexBuffer=new V("vertex",i,n),this._indexBuffer.insert(e.indices,0,e.indices.byteLength/4,0),this._vertexBuffer.insert(e.vertices,0,e.vertices.byteLength/r,0),t&&(this._indicesInvalid=!0)}}remove(e){if(!Object(c["j"])(this._records))for(const t of e){const e=this._records.getCursor();if(!e.lookup(t))continue;const s=e.indexFrom,r=e.vertexFrom;let i=e.indexCount,n=e.vertexCount;for(;e.next()&&e.id===t;)i+=e.indexCount,n+=e.vertexCount;this._indexBuffer.free(s,i),this._vertexBuffer.free(r,n,!0),this._records.delete(t)}}getVAO(e,t,s,r){if(!this._vertexBuffer||!this._indexBuffer||Object(c["j"])(this._records)||!this._vertexBuffer.bufferSize)return null;const i=r?D:P;let n=this._vaos.get(i);(this._vertexBuffer.invalidated||this._indexBuffer.invalidated)&&(Object(c["b"])(n,e=>e.dispose(!1)),n=null),this._vertexBuffer.upload(),this._indexBuffer.upload();const a=this._indexBuffer.getGPUBuffer(e,1===i),o=this._vertexBuffer.getGPUBuffer(e);return n||(n=new z["a"](e,s,t,{geometry:o},a),this._vaos.set(i,n)),n}forEachCommand(e){if(!Object(c["j"])(this._records)){if(this._sortIndices(this._records),!this._displayList){const e=this._cursorIndexOrder;this._displayList=O.from(this,this.geometryType,this._records.getCursor(),e)}this._displayList.forEach(e)}}_sortIndices(e){const t=!!this._indexBuffer.bufferSize;if(!this._indicesInvalid)return;this._indicesInvalid=!1;let s=0;const r=e.getCursor(),i=[],n=[],a=[];for(;r.next();)n.push(r.index),a.push(r.sortKey),i.push(r.id);n.sort((e,t)=>{const s=a[t],r=a[e];return r===s?i[t]-i[e]:s-r});const o=e.getCursor(),h=t?this._indexBuffer.getCPUBuffer():this._vertexBuffer.getCPUBuffer();for(const c of n){if(!o.seekIndex(c))throw new Error("Expected to find index");if(t){const{indexFrom:e,indexCount:t}=o;o.indexFrom=s;for(let r=0;r<t;r++)this._indexBuffer.set(s++,h.array[e+r])}else{const{vertexFrom:e,vertexCount:t}=o,r=this._vertexBuffer.strideInt,i=e*r,n=i+t*r;o.vertexFrom=s/r;for(let a=i;a<n;a++)this._vertexBuffer.set(s++,h.array[a])}}this._cursorIndexOrder=n,this._displayList=null}}const F=50,N=4,q=8,Y=100;let G=0;class H extends b["a"]{constructor(e,t,s,r,i){super(e,t,s),this.instanceId=G++,this.patchCount=0,this._renderState={current:{geometry:new Map,metrics:null},next:null,swap:!1,swapFrames:0,locked:!1},this._patches=new h["a"](Y),this._bufferPatches=new h["a"](Y),this._lastCommitTime=0,this._lastMessageWasClear=!1,this.transforms.labelMat2d=Object(d["a"])(),this._store=r,this._requestLabelUpdate=i}destroy(){super.destroy(),this._renderState.current.geometry.forEach(e=>e.destroy())}get labelMetrics(){return this._renderState.current.metrics}get hasData(){return!!this._renderState.current.geometry.size}getGeometry(e){return this._renderState.current.geometry.get(e)}setTransform(e,t){super.setTransform(e,t);const s=this.transforms.labelMat2d,r=e.getScreenTransform(s,t),i=Object(f["a"])();Object(l["t"])(i,[this.x,this.y],r),Object(u["a"])(s,i),Object(u["f"])(s,e.viewMat2d,s)}patch(e,t){if(this.patchCount++,e.clear&&this._lastMessageWasClear)return;this._lastMessageWasClear=e.clear,e.clear&&this._patches.size>=F&&this._dropPatches();const s=e,r=s.addOrUpdate&&this.key.id!==s.addOrUpdate.tileKeyOrigin;t&&r?this._bufferPatches.enqueue(s):(s.sort=s.sort&&!t,this._patches.enqueue(s)),this.requestRender()}commit(e){if(this._lastCommitTime!==e.time){this._lastCommitTime=e.time;for(let e=0;e<N;e++)this._updateMesh(),this.isReady&&this._updateBufferMesh();this._renderState.swap&&(this._swapRenderStates(),this.requestRender())}}lock(){this._renderState.locked=!0}unlock(){this._renderState.locked=!1,this._flushUpdates(),this._swap()}_swapRenderStates(){if(this._renderState.next){if(this._renderState.locked)return this._renderState.swap=!0,void this.requestRender();if(this._renderState.swap=!0,0===this._renderState.swapFrames)return this._renderState.swapFrames=q,void this.requestRender();1==this._renderState.swapFrames--?this._swap():this.requestRender()}}_swap(){this._renderState.swap&&(this._renderState.swap=!1,Object(c["k"])(this._renderState.next)&&(this._renderState.current.geometry.forEach(e=>e.destroy()),this._renderState.current=this._renderState.next,this._renderState.next=null,this._requestLabelUpdate()))}_flushUpdates(){let e=this._patches.maxSize;for(;this._patches.size&&e--;)this._updateMesh(),this._swap()}_updateBufferMesh(){const e=this._bufferPatches.peek();if(!Object(c["k"])(e)||!e.clear||null===this._renderState.next)for(;this._bufferPatches.size;){const e=this._bufferPatches.dequeue();Object(c["k"])(e)&&this._patchBuffer(e)}}_updateMesh(){const e=this._patches.peek();if(Object(c["k"])(e)&&e.clear&&null!==this._renderState.next)return;const t=this._patches.dequeue();if(Object(c["k"])(t)){if(!0===t.clear){if(!this.isReady)return;return this._renderState.next,void(this._renderState.next={geometry:new Map,metrics:null})}this.requestRender(),this._patch(t),t.end&&(this.ready(),this._swapRenderStates())}}_patch(e){Object(p["h"])(t=>{this._remove(t,e.remove),this._insert(t,e,!1)})}_patchBuffer(e){Object(p["h"])(t=>{this._insert(t,e,!0)})}_insert(e,t,s){try{var r;const i=Object(c["u"])(this._renderState.next,this._renderState.current),n=null==(r=t.addOrUpdate)?void 0:r.data[e],a=i.geometry;if(Object(c["j"])(n))return;a.has(e)||a.set(e,new U(e,this.stage)),a.get(e).insert(n,t.sort,s),e===_["d"].LABEL&&this._insertLabelMetrics(t.type,n.metrics,t.clear)}catch(i){}}_insertLabelMetrics(e,t,s){const r=Object(c["u"])(this._renderState.next,this._renderState.current);if(Object(c["j"])(t))return;const i=x.from(t);if(Object(c["j"])(r.metrics))r.metrics=i;else{if("update"===e){const e=i.getCursor();for(;e.next();)r.metrics.delete(e.id)}r.metrics.link(i)}}_remove(e,t){const s=Object(c["u"])(this._renderState.next,this._renderState.current).geometry.get(e);t&&t.length&&s&&(s.remove(t),this._removeLabelMetrics(t))}_removeLabelMetrics(e){const{metrics:t}=Object(c["u"])(this._renderState.next,this._renderState.current);if(!Object(c["j"])(t)&&e.length)for(const s of e)for(;t.delete(s););}_dropPatches(){const e=new Array;let t=!1;for(;this._patches.size;){const s=this._patches.dequeue();if(Object(c["j"])(s))break;if(s.clear){if(t)break;t=!0}e.push(s)}this._patches.clear(),e.forEach(e=>this._patches.enqueue(e))}}var K=s("b433"),X=s("e314"),Z=s("8332"),$=s("3b1a"),W=s("6f2d");const Q=Object(i["a"])("featurelayer-order-by-server-enabled");class J extends W["a"]{constructor(e,t,s,r){super(e),this._pointToCallbacks=[],this._layer=s,this._layerView=t,this._onUpdate=r}renderChildren(e){this.attributeView.update(),this.hasAnimation&&e.painter.effects.integrate.draw(e,e.attributeView),super.renderChildren(e)}hasEmptyAttributeView(){return this.attributeView.isEmpty()}isUpdating(){return this.attributeView.isUpdating()}hitTest(e){const t=Object(n["g"])();return this._pointToCallbacks.push({point:e,resolver:t}),this.requestRender(),t.promise}onTileData(e,t){const s=Q&&"orderBy"in this._layer&&this._layer.orderBy,r=(null==s?void 0:s.length)&&!s[0].valueExpression&&s[0].field,i=s&&this._layerView.orderByFields===r;e.patch(t,i),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){this.contains(e)||this.addChild(e)}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}onAttributeStoreUpdate(){this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._onUpdate()}get hasAnimation(){return this.hasLabels}setStencilReference(e){if(e.rendererInfo.ddDotSize>1){const e=1;for(const t of this.children)t.stencilRef=t.key.level+e}else super.setStencilReference(e)}get hasLabels(){if("sublayers"in this._layer)return this._layer.sublayers.some(e=>e.labelingInfo&&e.labelingInfo.length&&e.labelsVisible);const e=this._layer.featureReduction,t=e&&"cluster"===e.type&&e.labelsVisible&&e.labelingInfo&&e.labelingInfo.length;return this._layer.labelingInfo&&this._layer.labelingInfo.length&&this._layer.labelsVisible||!!t}prepareRenderPasses(e){const t=e.registerRenderPass({name:"label",brushes:[$["a"].label],target:()=>this.hasLabels?this.children:null,drawPhase:_["c"].LABEL|_["c"].LABEL_ALPHA}),s=e.registerRenderPass({name:"geometry",brushes:[$["a"].fill,$["a"].line,$["a"].marker,$["a"].text],target:()=>this.children,enableDefaultDraw:()=>!this._layerView.featureEffectView.hasEffects,effects:[{apply:e.effects.outsideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.excludedEffects},{apply:e.effects.insideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.includedEffects},{apply:e.effects.hittest,enable:()=>!!this._pointToCallbacks.length,args:()=>this._pointToCallbacks}]}),r=e.registerRenderPass({name:"highlight",brushes:[$["a"].fill,$["a"].line,$["a"].marker,$["a"].text],target:()=>this.children,drawPhase:_["c"].HIGHLIGHT,enableDefaultDraw:()=>!1,effects:[{apply:e.effects.highlight,enable:()=>!!this._layerView.hasHighlight()}]});return[...super.prepareRenderPasses(e),s,r,t]}}let ee=class extends X["a"]{install(e){const t=()=>this.notifyChange("updating"),s=new J(this.tileInfoView,this.layerView,this.layer,t);this.featuresView=s,e.addChild(s)}uninstall(e){e.removeChild(this.featuresView),this.featuresView.destroy(),this.featuresView=null}fetchResource(e,t){const{url:s}=e,r=this.featuresView.stage;try{return r.resourceManager.fetchResource(s,{signal:t.signal})}catch(i){return Object(n["m"])(i)?Promise.resolve({width:0,height:0}):Promise.reject(i)}}isUpdating(){var e;const t=super.isUpdating(),s=!this.featuresView||this.featuresView.isUpdating(),r=null==(e=this.featuresView)?void 0:e.hasEmptyAttributeView(),n=t||s||t&&r;return Object(i["a"])("esri-2d-log-updating")&&console.log(`Updating SymbolTileRenderer ${n}\n -> updatingTiles ${t}\n -> hasFeaturesView ${!!this.featuresView}\n -> updatingFeaturesView ${s}`),n}hitTest(e){return this.featuresView.hitTest(e)}supportsRenderer(e){return null!=e&&-1!==["simple","class-breaks","unique-value","dot-density","dictionary"].indexOf(e.type)}onConfigUpdate(e){let t=null;if("visualVariables"in e){const s=(Object(K["a"])(e).visualVariables||[]).map(e=>{const t=e.clone();return"normalizationField"in e&&(t.normalizationField=null),e.valueExpression&&"$view.scale"!==e.valueExpression&&(t.valueExpression=null,t.field="nop"),t});t=Object(Z["a"])(s)}this.featuresView.setRendererInfo(e,t,this.layerView.featureEffect)}onTileData(e){const t=this.tiles.get(e.tileKey);t&&e.data&&this.featuresView.onTileData(t,e.data),this.layerView.view.labelManager.requestUpdate()}onTileError(e){const t=this.tiles.get(e.tileKey);t&&this.featuresView.onTileError(t)}forceAttributeTextureUpload(){this.featuresView.attributeView.forceTextureUpload()}lockGPUUploads(){this.featuresView.attributeView.lockTextureUpload(),this.tiles.forEach(e=>e.lock())}unlockGPUUploads(){this.featuresView.attributeView.unlockTextureUpload(),this.tiles.forEach(e=>e.unlock())}async getMaterialItems(e){return this.featuresView.getMaterialItems(e)}invalidateLabels(){this.featuresView.hasLabels&&this.layerView.view.labelManager.requestUpdate()}createTile(e){const t=this.tileInfoView.getTileBounds(Object(o["l"])(),e),s=()=>this.layerView.view.labelManager.requestUpdate();return new H(e,t[0],t[3],this.featuresView.attributeView,s)}disposeTile(e){this.featuresView.removeChild(e),e.destroy(),this.layerView.view.labelManager.requestUpdate()}};ee=Object(r["a"])([Object(a["a"])("esri.views.2d.layers.features.tileRenderers.SymbolTileRenderer")],ee);const te=ee},e314:function(e,t,s){"use strict";s.d(t,"a",(function(){return h}));var r=s("a4ee"),i=s("9096"),n=s("59b2"),a=(s("b50f"),s("c120"),s("cea0"),s("d386"));let o=class extends i["a"]{constructor(e){super(e),this.tiles=new Map}destroy(){this.tiles.clear(),this.layer=this.layerView=this.tileInfoView=this.tiles=null}get updating(){return this.isUpdating()}acquireTile(e){const t=this.createTile(e);return t.once("isReady",()=>this.notifyChange("updating")),this.tiles.set(e.id,t),t}forceAttributeTextureUpload(){}forEachTile(e){this.tiles.forEach(e)}releaseTile(e){this.tiles.delete(e.key.id),this.disposeTile(e)}isUpdating(){let e=!0;return this.tiles.forEach(t=>{e=e&&t.isReady}),!e}setHighlight(){}invalidateLabels(){}requestUpdate(){this.layerView.requestUpdate()}};Object(r["a"])([Object(n["b"])()],o.prototype,"layer",void 0),Object(r["a"])([Object(n["b"])()],o.prototype,"layerView",void 0),Object(r["a"])([Object(n["b"])()],o.prototype,"tileInfoView",void 0),Object(r["a"])([Object(n["b"])()],o.prototype,"updating",null),o=Object(r["a"])([Object(a["a"])("esri.views.2d.layers.features.tileRenderers.BaseTileRenderer")],o);const h=o}}]);
  2. //# sourceMappingURL=chunk-39b24b6e.2b725828.js.map