text: (function(){var e={"esri/views/2d/layers/features/tileRenderers/support/visualVariablesUtils":467,"esri/views/2d/layers/features/support/AttributeStore":561,"esri/views/2d/layers/features/processors/BaseProcessor":1086,"esri/views/2d/layers/features/processors/SymbolProcessor":2278,"esri/views/2d/layers/features/batchUtils":2279},t=this||window,r=t.webpackJsonp=t.webpackJsonp||[];r.registerAbsMids?r.registerAbsMids(e):(r.absMidsWaiting=r.absMidsWaiting||[]).push(e)})(),(window.webpackJsonp=window.webpackJsonp||[]).push([[108],{1086:function(e,t,r){var i,n;i=[r.dj.c(e.i),t,r(117),r(236),r(151)],void 0===(n=function(e,t,r,i,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.initialize=function(){},t.prototype.destroy=function(){},Object.defineProperty(t.prototype,"supportsTileUpdates",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spatialReference",{get:function(){var e=this.get("tileStore.tileScheme.spatialReference");return e&&e.toJSON()||null},enumerable:!0,configurable:!0}),r.__decorate([n.property({readOnly:!0})],t.prototype,"supportsTileUpdates",null),r.__decorate([n.property({constructOnly:!0})],t.prototype,"remoteClient",void 0),r.__decorate([n.property({constructOnly:!0})],t.prototype,"service",void 0),r.__decorate([n.property({dependsOn:["tileStore.tileScheme.spatialReference"]})],t.prototype,"spatialReference",null),r.__decorate([n.property({constructOnly:!0})],t.prototype,"tileInfo",void 0),r.__decorate([n.property({constructOnly:!0})],t.prototype,"tileStore",void 0),r.__decorate([n.subclass("esri.views.2d.layers.features.processors.BaseProcessor")],t)}(i.HandleOwner);t.default=a}.apply(null,i))||(e.exports=n)},2278:function(e,t,r){var i,n;i=[r.dj.c(e.i),t,r(117),r(154),r(164),r(156),r(152),r(153),r(151),r(170),r(437),r(1208),r(316),r(186),r(408),r(972),r(2279),r(976),r(1086),r(561)],void 0===(n=function(e,t,r,i,n,a,o,s,l,u,c,p,h,d,f,_,y,g,v,b){Object.defineProperty(t,"__esModule",{value:!0});var m=a.getLogger("esri.views.2d.layers.features.processors.SymbolProcessor"),w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._symbolToMosaicItemMap=new Map,t._visualSetPromises=new Map,t.type="symbol",t}return r.__extends(t,e),t.prototype.initialize=function(){this._factory=this._createFactory()},t.prototype.destroy=function(){this._visualSetPromises.clear(),this._symbolToMosaicItemMap.clear(),this.notifyChange("updating")},Object.defineProperty(t.prototype,"supportsTileUpdates",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelingInfo",{get:function(){return!this.config||o.isNone(this.config.labelingInfo)?null:this.config.labelingInfo.map((function(e){return c.fromJSON(e)}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelingInfoFeatureReduction",{get:function(){var e,t;if(!this.config||o.isNone(this.config.featureReduction))return null;var r=this.config.featureReduction;return"cluster"===r.type&&o.isSome(null===(e=r.drawingInfo)||void 0===e?void 0:e.labelingInfo)?null===(t=r.drawingInfo)||void 0===t?void 0:t.labelingInfo.map((function(e){return c.fromJSON(e)})):null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasLabels",{get:function(){return!(!this.labelingInfo&&!this.labelingInfoFeatureReduction)},enumerable:!0,configurable:!0}),t.prototype._updateLabelClassInfos=function(){return r.__awaiter(this,void 0,void 0,(function(){var e,t,n,a,l,u=this;return r.__generator(this,(function(c){switch(c.label){case 0:return o.isNone(this.labelingInfo)&&o.isNone(this.labelingInfoFeatureReduction)?[2,s.resolve()]:(e=function(e){return r.__awaiter(u,void 0,void 0,(function(){var t,n,a;return r.__generator(this,(function(r){switch(r.label){case 0:t=null,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,p.createLabelFunction(e,this.service.fields,this.spatialReference)];case 2:return t=r.sent(),[3,4];case 3:return n=r.sent(),a=e.where?"where":"arcade",m.error(new i("mapview-labeling","Failed to evaluate "+a+" expression",{labelClass:e,error:n})),[3,4];case 4:return[2,t]}}))}))},t=[],o.isSome(this.labelingInfo)&&t.push.apply(t,this.labelingInfo.map((function(t,i){return r.__awaiter(u,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return n=o.andThen,[4,e(t)];case 1:return[2,n.apply(void 0,[r.sent(),function(e){return{type:"feature",labelClass:t,index:i,minScale:t.minScale,maxScale:t.maxScale,builder:e,symbol:t.symbol,symbolJSON:t.symbol.toJSON()}}])]}}))}))}))),o.isSome(this.labelingInfoFeatureReduction)&&(n=t.length,t.push.apply(t,this.labelingInfoFeatureReduction.map((function(t,i){return r.__awaiter(u,void 0,void 0,(function(){var a;return r.__generator(this,(function(r){switch(r.label){case 0:return a=o.andThen,[4,e(t)];case 1:return[2,a.apply(void 0,[r.sent(),function(e){return{type:"aggregate",labelClass:t,index:n+i,minScale:t.minScale,maxScale:t.maxScale,builder:e,symbol:t.symbol,symbolJSON:t.symbol.toJSON()}}])]}}))}))})))),[4,s.all(t)]);case 1:return a=c.sent(),l=a.filter((function(e){return e})),this._labelClassInfos=l,[2]}}))}))},Object.defineProperty(t.prototype,"hydrate",{get:function(){return f.createHydrateFactory(this.service.geometryType)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderer",{get:function(){return this.config?h.fromJSON(this.config.renderer):(n("esri-2d-debug")&&console.debug("Unable to create renderer for undefined configuration"),null)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updating",{get:function(){return this._visualSetPromises.size>0},enumerable:!0,configurable:!0}),t.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,i;return r.__generator(this,(function(r){switch(r.label){case 0:return t=this._getMeshHash(),this._set("config",e),[4,this._updateLabelClassInfos()];case 1:return r.sent(),t!==this._getMeshHash()&&(this._factory=this._createFactory()),i=this._labelClassInfos,this._factory.update(i,this.renderer,this.tileStore.tileScheme.tileInfo),[2]}}))}))},t.prototype.onTileData=function(e,t,r){var i=this,n=this._onTileData(e,t,r);return this._visualSetPromises.set(e,n),s.always(n,(function(){return i._cleanPromise(e)})),this.notifyChange("updating"),n},t.prototype.onTileError=function(e,t,r){var i=this,n=r.signal,a={tileKey:e.id,error:t},o=this.remoteClient.invoke("tileRenderer.onTileError",a,{signal:n});return this._visualSetPromises.set(e,o),s.always(o,(function(){return i._cleanPromise(e)})),this.notifyChange("updating"),o},t.prototype._getMeshHash=function(){var e=_.getVVFlags("visualVariables"in this.renderer&&this.renderer.visualVariables||[]);return this.renderer.getMeshHash()+"."+e},t.prototype._createFactory=function(){var e=this,t=this.service,r=t.geometryType,i=t.objectIdField,n={geometryType:r,fields:t.fields,spatialReference:u.fromJSON(this.spatialReference)},a=new d.WGLTemplateStore((function(t,r){return e.remoteClient.invoke("tileRenderer.getMaterialItems",t,r)}),!1);return this._store=a,this._matcher=d.createMatcher(a,n,this.renderer),new d.WGLMeshFactory(r,i,this.renderer,a)},t.prototype._cleanPromise=function(e){this._visualSetPromises.delete(e),this.notifyChange("updating")},t.prototype._onTileData=function(e,t,i){return r.__awaiter(this,void 0,void 0,(function(){var n,a,s,l,u,c,p,h,d,f,_;return r.__generator(this,(function(r){switch(r.label){case 0:n=t.addOrUpdate,a=t.remove,s=t.clear,l=this._processFeatures(e,n,t.transformParams,i),u=i.signal,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,l];case 2:return c=r.sent(),p=o.andThen(c,(function(e){return e.message})),h=o.andThen(c,(function(e){return e.transferList}))||[],d={addOrUpdate:p,remove:a,clear:s},f={transferList:o.unwrap(h)||[],signal:u},[2,this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:d},f)];case 3:return _=r.sent(),this._handleError(e,_,i),[3,4];case 4:return[2]}}))}))},t.prototype._processFeatures=function(e,t,i,n){return r.__awaiter(this,void 0,void 0,(function(){var a,o,l,u,c;return r.__generator(this,(function(r){switch(r.label){case 0:return t&&t.length?(a=this._factory,o={viewingMode:"",scale:e.scale},[4,this._matcher]):[2,null];case 1:return l=r.sent(),[4,this._getLabelInfos(e,t,i)];case 2:return u=r.sent(),[4,a.analyze(t,l,i,o)];case 3:return c=r.sent(),s.throwIfAborted(n),[2,this._writeFeatures(e,c,i,u,a,n)]}}))}))},t.prototype._writeFeatures=function(e,t,a,s,l,u){return r.__awaiter(this,void 0,void 0,(function(){var c,p,h;return r.__generator(this,(function(d){switch(d.label){case 0:return c=l.createMeshData(t.length),p={viewingMode:"",scale:e.scale},h=r.__assign(r.__assign({},u),{batchSize:200}),[4,y.executeForEachAsync(t,(function(t){try{var r=o.isSome(s)?s.get(t.localId):null;l.write(c,t,a,p,e.level,r)}catch(e){n("esri-2d-debug")&&m.error(new i("mapview-mesh-factory","Failed to write feature",{error:e,feature:t}))}}),h)];case 1:return d.sent(),[2,this._encodeDisplayData(c)]}}))}))},t.prototype._encodeDisplayData=function(e){var t={},r=new Array;return e.encode(t,r),{message:t,transferList:r}},t.prototype._handleError=function(e,t,r){if(!s.isAbortError(t)){var i={tileKey:e.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:r.signal})}},t.prototype._getLabelClassInfosForScale=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this._labelClassInfos.filter((function(t){var r=t.minScale,i=t.maxScale;return(!r||r>=e||0===r)&&(!i||i<=e||0===i)}))]}))}))},t.prototype._shouldDiscard=function(e,t){switch(this.service.geometryType){case"esriGeometryPoint":var r=t.geometry,i=r.x,n=r.y;return e.checkOverlap(i,n);case"esriGeometryPolygon":var a=t.centroid;return i=a.x,n=a.y,e.checkOverlap(i,n);default:return!1}},t.prototype._markUsed=function(e,t){switch(this.service.geometryType){case"esriGeometryPoint":var r=t.geometry,i=r.x,n=r.y;return e.markUsed(i,n);case"esriGeometryPolygon":var a=t.centroid;return i=a.x,n=a.y,e.markUsed(i,n)}},t.prototype._getLabelInfos=function(e,t,i){return r.__awaiter(this,void 0,void 0,(function(){var n,a,s,l,c,p,h,f,_;return r.__generator(this,(function(y){switch(y.label){case 0:return this.hasLabels&&t&&0!==t.length?[4,this._getLabelClassInfosForScale(e.scale)]:[2,null];case 1:if(0===(n=y.sent()).length)return[2,null];for(a=new Map,s=new d.CollisionGrid(d.definitions.COLLISION_EARLY_REJECT_BUCKET_SIZE),l=function(e){var t=e.localId;if(c._shouldDiscard(s,e))return a.has(t)||a.set(t,null),"continue";for(var l=function(e,t){for(var r=new Array(e),i=0;i<r.length;i++)r[i]=null;return r}(n.length),p=!1,h=function(a){var s,h=n[a],f=h.type,_=h.index,y=h.builder,v=h.symbolJSON;if((b.isAggregateId(t)&&e.attributes.cluster_count>1?"aggregate":"feature")!==f)return"continue";if(!i)return m.error("mapview-labeling","Tried to evaluate geometry expression but no transformation found"),{value:void 0};var w=i.transform,S=i.hasZ,T=i.hasM,x=c.hydrate(e.geometry,w,S,T),I=r.__assign(r.__assign({},e),{geometry:x});x.spatialReference=u.fromJSON(c.spatialReference),s=I;var E=y.evaluate(s);if(o.isNone(E)||""===E)return"continue";var A=d.bidiText(E),M=A[0],O=A[1];p=!0,c._store.getMosaicItem(v,!1,g.codepoints(M)).then((function(e){l[_]={glyphs:e.glyphMosaicItems,rtl:O,classIndex:_}}))},f=0;f<n.length;f++){var _=h(f);if("object"==typeof _)return _}a.set(t,l),p&&c._markUsed(s,e)},c=this,p=0,h=t;p<h.length;p++)if(f=h[p],"object"==typeof(_=l(f)))return[2,_.value];return[2,a]}}))}))},r.__decorate([l.property({readOnly:!0})],t.prototype,"supportsTileUpdates",null),r.__decorate([l.property()],t.prototype,"config",void 0),r.__decorate([l.property({dependsOn:["config"]})],t.prototype,"labelingInfo",null),r.__decorate([l.property({dependsOn:["config"]})],t.prototype,"labelingInfoFeatureReduction",null),r.__decorate([l.property({dependsOn:["labelingInfo","labelingInfoFeatureReduction"]})],t.prototype,"hasLabels",null),r.__decorate([l.property({dependsOn:["service"]})],t.prototype,"hydrate",null),r.__decorate([l.property({dependsOn:["config"],readOnly:!0})],t.prototype,"renderer",null),r.__decorate([l.property({readOnly:!0})],t.prototype,"updating",null),r.__decorate([l.subclass("esri.views.2d.layers.features.processors.SymbolProcessor")],t)}(v.default);t.default=w}.apply(null,i))||(e.exports=n)},2279:function(e,t,r){var i,n;i=[r.dj.c(e.i),t,r(153)],void 0===(n=function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.executeForEachAsync=function(e,t,i){var n,a=null!==(n=null==i?void 0:i.batchSize)&&void 0!==n?n:100,o=r.createResolver(),s=0,l=function(){for(var n=Date.now(),u=!1,c=0;!u&&c<500;){try{for(i&&r.throwIfAborted(i);s<Math.min(s+a,e.length);s++)t(e[s])}catch(e){o.reject(e)}c=Date.now()-n,u=s>=e.length}u?o.resolve():setTimeout(l,0)};return l(),o.promise}}.apply(null,i))||(e.exports=n)},467:function(e,t,r){var i,n;i=[r.dj.c(e.i),t,r(117),r(171),r(186),r(206),r(450)],void 0===(n=function(e,t,r,i,n,a,o){Object.defineProperty(t,"__esModule",{value:!0});var s=n.enums.WGLVVFlag;function l(e){return{value:e.value,size:i.toPt(e.size)}}function u(e){return e.map((function(e){return l(e)}))}function c(e){if("string"==typeof e||"number"==typeof e)return i.toPt(e);var t=e;return{type:"size",expression:t.expression,stops:u(t.stops)}}t.getVisualVariableSizeValueRepresentationRatio=function(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},t.stopToSizeStop=l,t.normalizeSizeStops=u,t.normalizeSizeElement=c,t.getVisualVariablesFields=function(e){var t=e&&e.length>0?{}:null;return t&&e.forEach((function(e){var r=e.type;e.field&&(t[r]=e.field)})),t};var p=function(e){for(var t=[],r=[],n=u(e),o=n.length,s=0;s<6;s++){var l=n[Math.min(s,o-1)];t.push(l.value),r.push(null==l.size?a.NAN_MAGIC_NUMBER:i.pt2px(l.size))}return{values:new Float32Array(t),sizes:new Float32Array(r)}};function h(e){var t={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if(n.Utils.isString(e.field)){if(!e.stops)return null;if(e.stops.length>8)return null;for(var r=e.stops,i=0;i<8;++i){var a=r[Math.min(i,r.length-1)];t.values[i]=a.value,t.opacities[i]=a.opacity}}else{if(!(e.stops&&e.stops.length>=0))return null;var o=e.stops&&e.stops.length>=0&&e.stops[0].opacity;for(i=0;i<8;i++)t.values[i]=1/0,t.opacities[i]=o}return t}t.convertVisualVariables=function(e){var t=e&&e.length>0?{}:null,i=t?{}:null;if(!t)return{vvFields:t,vvRanges:i};for(var a=0,l=e;a<l.length;a++){var d=l[a],f=d.type;if(d.field&&(t[f]=d.field),"size"===f){i.size||(i.size={});var _=d;switch(n.getTypeOfSizeVisualVariable(_)){case s.SIZE_MINMAX_VALUE:i.size.minMaxValue={minDataValue:_.minDataValue,maxDataValue:_.maxDataValue,minSize:c(_.minSize),maxSize:c(_.maxSize)};break;case s.SIZE_SCALE_STOPS:i.size.scaleStops={stops:u(_.stops)};break;case s.SIZE_FIELD_STOPS:if(_.levels){var y={};for(var g in _.levels)y[g]=p(_.levels[g]);i.size.fieldStops={type:"level-dependent",levels:y}}else i.size.fieldStops=r.__assign({type:"static"},p(_.stops));break;case s.SIZE_UNIT_VALUE:i.size.unitValue={unit:_.valueUnit,valueRepresentation:_.valueRepresentation}}}else if("color"===f){var v=o.convertVisualVariables([d],{modelSize:null,symbolSize:null,unitInMeters:1,transformation:null});if(!v)continue;i.color=v.color;for(var b=0;b<32;b+=4)n.color.premultiplyAlpha(i.color.colors,b,!0)}else if("opacity"===f)i.opacity=h(d);else if("rotation"===f){var m=d;i.rotation={type:m.rotationType}}}return{vvFields:t,vvRanges:i}}}.apply(null,i))||(e.exports=n)},561:function(e,t,r){var i,n;i=[r.dj.c(e.i),t,r(117),r(154),r(164),r(156),r(168),r(152),r(153),r(255),r(246),r(186),r(408),r(206),r(467),r(161)],void 0===(n=function(e,t,i,n,a,o,s,l,u,c,p,h,d,f,_){Object.defineProperty(t,"__esModule",{value:!0});var y=o.getLogger("esri.views.layers.2d.features.support.AttributeStore"),g=h.debug.createDebugLogger(h.debug.DEBUG_ATTR_UPDATES,y);t.LOCAL_ID_TYPE_AGGREGATE=1;var v=function(e){return(2147483648&e)>>>31},b=function(e){return 2147483647&e};t.isAggregateId=function(e){return v(e)===t.LOCAL_ID_TYPE_AGGREGATE};var m=function(e,t){return function(r,i,n){var a;try{a=t(r,i,n)}catch(e){a=NaN}return(null===a||isNaN(a)||a===1/0)&&e||a}},w={sharedArrayBuffer:a("esri-shared-array-buffer"),oesTextureFloat:a("esri-webgl-texture-float"),maxTextureSize:a("esri-webgl-max-texture-size"),atomics:a("esri-atomics")},S=function(){function e(e,t,r,i){this.texelSize=4;var n=i.pixelType,a=i.layout,o=i.textureOnly;this.textureOnly=o||!1,this.pixelType=n,this._ctype=t,this.layout=a,this._resetRange(),this._shared=e,o||(this.data=this._initData(n,r,e,t))}return Object.defineProperty(e.prototype,"buffer",{get:function(){return l.andThen(this.data,(function(e){return e.buffer}))},enumerable:!0,configurable:!0}),e.prototype.getData=function(e,t){var r=b(e);return l.unwrap(this.data)[r*this.texelSize+t]},e.prototype.setData=function(e,t,r){var i=b(e),n=1<<t;0!=(this.layout&n)?(this.data[i*this.texelSize+t]=r,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)):y.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")},e.prototype.lock=function(){5121===this.pixelType?this._shared&&w.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1):a("esri-2d-debug")&&y.error("AttributeStore-Bad-Type","Tried to unlock non integer array type with float array")},e.prototype.unlock=function(){5121===this.pixelType?this._shared&&w.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0):a("esri-2d-debug")&&y.error("AttributeStore-Bad-Type","Tried to unlock non integer array type with float array")},e.prototype.expand=function(e){if(!this.textureOnly){var t=this._initData(this.pixelType,e,this._shared,this._ctype),r=l.unwrap(this.data);t.set(r),this.data=t}},e.prototype.toMessage=function(){var e=this.dirtyStart,t=this.dirtyEnd,r=this.texelSize;if(e>t)return null;this._resetRange();var i=!(this._shared||"local"===this._ctype),n=this.pixelType,a=this.layout,o=l.unwrap(this.data);return o.slice?{start:e,end:t,data:i&&o.slice(e*r,(t+1)*r)||null,pixelType:n,layout:a}:i?{start:e,end:t,data:new(h.Utils.getPixelArrayCtor(this.pixelType))(Array.prototype.slice.call(this.data,e*r,(t+1)*r)),pixelType:n,layout:a}:{start:e,end:t,data:null,pixelType:n,layout:a}},e.prototype._initData=function(e,t,r,i){for(var n=r&&"local"!==i?SharedArrayBuffer:ArrayBuffer,a=h.Utils.getPixelArrayCtor(e),o=new a(new n(t*t*4*a.BYTES_PER_ELEMENT)),s=0;s<o.length;s+=4)o[s+1]=255;return o},e.prototype._resetRange=function(){this.dirtyStart=2147483647,this.dirtyEnd=0},e}(),T=function(){function e(e){this._attributeComputeMap=new Map,this._blocks=new Array,this._idMap=new Map,this._localToObjectId=new Map,this._filters=new Array(h.definitions.MAX_FILTERS),this._freeTexelsList=[],this._abortController=u.createAbortController(),this._hasScaleExpr=!1,this._size=32,this._idCounter=1,this._idsToHighlight=new Set;var t=w.oesTextureFloat?5126:5121;g("Creating AttributeStore "+(w.sharedArrayBuffer?"with":"without")+" shared memory"),a("esri-2d-debug")&&w.sharedArrayBuffer&&!w.atomics&&y.warn("Browser supports SharedArrayBuffer but not Atomics. Rendering may be impacted"),this._client=e,this._blockDescriptors=[{pixelType:5121,layout:1},{pixelType:5121,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15}],this._blocks=this._blockDescriptors.map((function(){return null}))}return e.prototype.destroy=function(){this._abortController.abort()},Object.defineProperty(e.prototype,"hasScaleExpr",{get:function(){return this._hasScaleExpr},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_signal",{get:function(){return this._abortController.signal},enumerable:!0,configurable:!0}),e.prototype.invalidateResources=function(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=u.createAbortController()},e.prototype.createLocalId=function(e,t){if(void 0===t&&(t=!1),!this._idMap.has(e)){var r=function(e,t){return((t?2147483648:0)|e)>>>0}(this._getFreeTexel(),t);this._idMap.set(e,-1===r?0:r),this._localToObjectId.set(r,e)}return this._idMap.get(e)},e.prototype.addLocalId=function(e){this._getBlock(0).setData(e,0,0),this._freeTexelsList.push(b(e))},e.prototype.removeLocalId=function(e){var t=this._idMap.get(e);return this._idMap.delete(e),this._localToObjectId.delete(t),t},e.prototype.freeLocalId=function(e){var t=this._idMap.get(e);a("esri-2d-debug")&&!t&&console.debug("Called freeLocalId for an invalid id"),this._getBlock(0).setData(t,0,0),this._idMap.delete(e),this._localToObjectId.delete(t),this._freeTexelsList.push(b(t))},e.prototype.getFeatureId=function(e){return this._localToObjectId.get(e)},e.prototype.getLocalId=function(e){return this._idMap.has(e)?this._idMap.get(e):null},e.prototype.setHighlight=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,r,n,a,o,s,l=this;return i.__generator(this,(function(i){switch(i.label){case 0:for(this._getBlock(0).lock(),this._idsToHighlight.forEach((function(e){var t=l.getLocalId(e);if(t){var r=l._getBlock(0).getData(t,0);l._getBlock(0).setData(t,0,-2&r)}})),this._idsToHighlight.clear(),t=0,r=e;t<r.length;t++)n=r[t],this._idsToHighlight.add(n);for(a=0;a<e.length;a++)null!=(o=this.getLocalId(e[a]))&&(s=this._getBlock(0).getData(o,0),this._getBlock(0).setData(o,0,1|s));return this._getBlock(0).unlock(),[4,this.sendUpdates()];case 1:return i.sent(),[2]}}))}))},e.prototype.addHighlight=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return[2]}))}))},e.prototype.removeHighlight=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return[2]}))}))},e.prototype.updateFilters=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,r,n,a,o,s=this;return i.__generator(this,(function(i){switch(i.label){case 0:return t=e.config,r=e.service,n=e.spatialReference,a=t.filters,o=a.map((function(t,i){return s._updateFilter(e,t,i,r,n)})),[4,u.all(o)];case 1:return i.sent(),[2]}}))}))},e.prototype.setAttributeBindings=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(r){switch(this._hasScaleExpr=!1,e.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return[2,this._bindVVEvaluators(e.visualVariables,t)];case"dot-density":return[2,this._bindDDEvaluators(e.attributes,t)];case"heatmap":break;default:y.error(new n("attribute-store","Found invalid renderer type: "+e))}return[2]}))}))},e.prototype.setData=function(e,t,r,i){this._getBlock(t).setData(e,r,i)},e.prototype.getData=function(e,t,r){return this._getBlock(t).getData(e,r)},e.prototype.getHighlightFlag=function(e){return this._idsToHighlight.has(e)?f.HIGHLIGHT_FLAG:0},e.prototype.setAttributeData=function(e,t,r,i){var n=this,a=e;this._getBlock(0).setData(a,0,this.getFilterFlags(t));var o=this._attributeComputeMap,l=w.oesTextureFloat?1:2;o.forEach((function(e,o){var u=o*l%4,c=Math.floor(o*l/4),p=n._getBlock(c+f.ATTRIBUTE_DATA_VV),d=e(t,{$view:i},r);if(w.oesTextureFloat)p.setData(a,u,d);else if(d===h.definitions.NAN_MAGIC_NUMBER)p.setData(a,u,255),p.setData(a,u+1,255);else{var _=s.clamp(Math.round(d),-32767,32766)+32768,y=255&_,g=(65280&_)>>8;p.setData(a,u,y),p.setData(a,u+1,g)}}))},e.prototype.sendUpdates=function(){var e=this;if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=u.createResolver(),this._nextUpdate.promise;var t={blocks:this._blocks.map((function(e){return l.isSome(e)?e.toMessage():null}))};return this._currUpdate=this._createResources().then((function(){var r=function(){if(e._currUpdate=null,e._nextUpdate){var t=e._nextUpdate;e._nextUpdate=null,e.sendUpdates().then((function(){return t.resolve()}))}},i=e._client.update(t,e._signal).then(r).catch(r);return e._client.render(),i})).catch((function(t){return u.isAbortError(t)?(e._createResourcesPromise=null,e._createResources()):(y.error(new n("mapview-attribute-store","Encountered an error during client update",t)),u.resolve())})),this._currUpdate},e.prototype._createResources=function(){var e=this;if(l.isSome(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(f.ATTRIBUTE_DATA_ANIMATION),g("Initializing AttributeStore");var t={shared:w.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:l.mapMany(this._blocks,(function(e){return{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}}))},r=this._client.initialize(t,this._signal).catch((function(t){u.isAbortError(t)?e._createResourcesPromise=null:y.error(new n("mapview-attribute-store","Encountered an error during client initialization",t))}));return this._createResourcesPromise=r,r.then((function(){return l.isNone(e._createResourcesPromise)?e._createResources():void 0})),r},e.prototype._getBlock=function(e){var t=this._blocks[e];if(l.isSome(t))return t;g("Initializing AttributeBlock at index "+e);var r=w.sharedArrayBuffer,i=this._client.type,n=new S(r,i,this._size,this._blockDescriptors[e]);return this._blocks[e]=n,this._createResourcesPromise=null,n},e.prototype._expand=function(){if(this._size<w.maxTextureSize){var e=this._size<<=1;return g("Expanding block size to",e,this._blocks),l.forEachSome(this._blocks,(function(t){return t.expand(e)})),this._createResourcesPromise=null,this._size=e,0}return y.error(new n("mapview-limitations","Maximum number of onscreen features exceeded.")),-1},e.prototype._getFreeTexel=function(){return this._freeTexelsList.length?this._freeTexelsList.pop():this._idCounter>=this._size*this._size&&this._expand()?-1:this._idCounter++},e.prototype._updateFilter=function(e,r,n,a,o){return i.__awaiter(this,void 0,void 0,(function(){var s,u,c,p,h,d,f,_=this;return i.__generator(this,(function(i){switch(i.label){case 0:return s=this._filters[n],(l.isSome(s)&&s.hash)===JSON.stringify(r)?[2]:(u=1<<n+1,l.isNone(r)?(this._filters[n]=null,this._idMap.forEach((function(e){var t=_._getBlock(0).getData(e,0);_._getBlock(0).setData(e,0,t|u)})),[2]):[4,e.queryObjectIds(r)]);case 1:return c=i.sent(),r.hiddenIds&&r.hiddenIds.length&&(c=c.filter((function(e){return-1===r.hiddenIds.indexOf(e)}))),p=c.map((function(e){return _._idMap.get(e)})),[4,this._getFilter(n,a)];case 2:for(i.sent().update(r,o),this._getBlock(0).lock(),this._idMap.forEach((function(e){if(v(e)!==t.LOCAL_ID_TYPE_AGGREGATE){var r=_._getBlock(0).getData(e,0);_._getBlock(0).setData(e,0,r&~u)}})),h=0;h<p.length;h++)null!=(d=p[h])&&(f=this._getBlock(0).getData(d,0),this._getBlock(0).setData(d,0,f|u));return this._getBlock(0).unlock(),[2]}}))}))},e.prototype._getFilter=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,a,o;return i.__generator(this,(function(i){switch(i.label){case 0:return n=this._filters[e],l.isSome(n)?[2,n]:[4,new Promise((function(e,t){Promise.all([r.e(5),r.e(7),r.e(144)]).then(function(){var t=[r(848)];e.apply(null,t)}.bind(this)).catch(t.bind(this))}))];case 1:return a=i.sent().default,o=new a({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:new c(t.fields)}),this._filters[e]=o,[2,o]}}))}))},e.prototype.isVisible=function(e){return!!(2&this._getBlock(0).getData(e.localId,0))},e.prototype.getFilterFlags=function(e){for(var r,i=0,n=(r=e.localId,v(r)===t.LOCAL_ID_TYPE_AGGREGATE?254:255),a=0;a<this._filters.length;a++){var o=!!(n&1<<a),s=this._filters[a];i|=(!o||l.isNone(s)||s.check(e)?1:0)<<a}var u=this.getFeatureId(e.localId);return i<<1|this.getHighlightFlag(u)},e.prototype._bindVVEvaluators=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var r=this;return i.__generator(this,(function(n){switch(n.label){case 0:return this._attributeComputeMap.clear(),l.isSome(e)?[4,u.all(e.map((function(e){return i.__awaiter(r,void 0,void 0,(function(){var r,n;return i.__generator(this,(function(i){switch(i.label){case 0:return r=h.Utils.getVVType(e.type),[4,this._createGetValueFunction(e,t)];case 1:return n=i.sent(),l.isSome(n)&&this._attributeComputeMap.set(r,n),[2]}}))}))})))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype._bindDDEvaluators=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var r,n,a,o=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this._attributeComputeMap.clear(),e.length>h.definitions.DOT_DENSITY_MAX_FIELDS&&y.warn("mapview-invalid-value","DotDensityRenderer supports a maximum of "+h.definitions.DOT_DENSITY_MAX_FIELDS+" attribtues, but found "+e.length),[4,u.all(e.map((function(e){return o._createNormalizedFunction(e,t)})))];case 1:for(r=i.sent().map((function(e){return m(0,e)})),n=0;n<h.definitions.DOT_DENSITY_MAX_FIELDS;n++)(a=n<e.length&&r[n])?this._attributeComputeMap.set(n,a):this._attributeComputeMap.has(n)&&this._attributeComputeMap.delete(n);return[2]}}))}))},e.prototype._createGetValueFunction=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var r,n,a,o,s,l,u;return i.__generator(this,(function(i){switch(i.label){case 0:return"size"!==e.type?[3,2]:(r=h.getTypeOfSizeVisualVariable(e))===h.enums.WGLVVFlag.SIZE_SCALE_STOPS?[2,null]:(n=r===h.enums.WGLVVFlag.SIZE_UNIT_VALUE,a=n&&function(t){return _.getVisualVariableSizeValueRepresentationRatio(t,e.valueRepresentation)},o=m,s=[h.definitions.NAN_MAGIC_NUMBER],[4,this._createNormalizedFunction(e,t,a)]);case 1:return[2,o.apply(void 0,s.concat([i.sent()]))];case 2:return l=m,u=[h.definitions.NAN_MAGIC_NUMBER],[4,this._createNormalizedFunction(e,t)];case 3:return[2,l.apply(void 0,u.concat([i.sent()]))]}}))}))},e.prototype._createNormalizedFunction=function(e,t,r){return i.__awaiter(this,void 0,void 0,(function(){var a,o,s;return i.__generator(this,(function(i){switch(i.label){case 0:return(a=e.field)?"string"==typeof a?(o=e.normalizationField)?[2,function(e){if(e.attributes[a]&&e.attributes[o]){var t=e.attributes[a]/e.attributes[o];return r?r(t):t}}]:[2,r?function(e){return r(e.attributes[a])}:function(e){return e.attributes[a]}]:(y.error(new n("mapview-rendering:invalid-type","The field for a vv must be a string or a number, but got "+typeof a)),[2,function(){}]):e.valueExpression?(this._hasScaleExpr=this._hasScaleExpr||-1!==e.valueExpression.indexOf("scale"),[4,p.createVVExpression(e.valueExpression,t.spatialReference,t.fields)]):[3,2];case 1:return s=i.sent(),[2,d.callWithOptimizedFeature.bind(null,s)];case 2:return y.error("Unable to create a normalized function for visual variable: "+e),[2,function(){}]}}))}))},e}();t.default=T}.apply(null,i))||(e.exports=n)}}]);
  //# sourceMappingURL=108.js.map