text: (this["webpackJsonpmy-app"]=this["webpackJsonpmy-app"]||[]).push([[122,60,268],{1073:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return X}));var n=i(0),r=i(73),s=i(24),a=i(31),o=i(1),l=(i(9),i(5),i(4),i(3)),c=i(354),u=i(925),h=i(661),d=i(710),f=i(905),m=i(20),p=i(11),_=i(2),g=i(12),x=i(659),y=i(724),v=i(654),b=i(693),O=i(767);const S=p.a.getLogger("esri.views.2d.layers.imagery.ImageryView2D");let T=class extends m.a{constructor(){super(...arguments),this.attached=!1,this.container=new v.a,this.updateRequested=!1,this.type="imagery",this._bitmapView=new y.a}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch(e=>{Object(g.l)(e)||S.error(e)})}hitTest(e){return new r.a({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new O.a({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(e=>{e.source instanceof HTMLImageElement?e.requestRender():this.layer.applyRenderer({pixelBlock:e.source.pixelBlock}).then(t=>{const i=e.source;i.pixelBlock=t.pixelBlock,i.filter=e=>this.layer.applyFilter(e),this.container.requestRender()})})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(1===e.length&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,i=e.map(e=>e.source).filter(e=>e.extent&&e.extent.intersects(t)).map(e=>({extent:e.extent,pixelBlock:e.originalPixelBlock})),n=Object(x.m)(i,t);return Object(_.j)(n)?{extent:n.extent,pixelBlock:n.pixelBlock}:null}return null}_fetchImage(e,t,i,n){return(n=n||{}).timeExtent=this.timeExtent,n.requestAsImageElement=!0,this.layer.fetchImage(e,t,i,n).then(e=>e.imageElement?e.imageElement:this.layer.applyRenderer(e.pixelData,{signal:n.signal}).then(t=>{const i=new b.a(t.pixelBlock,t.extent.clone(),e.pixelData.pixelBlock);return i.filter=e=>this.layer.applyFilter(e),i}))}};Object(n.a)([Object(o.b)()],T.prototype,"attached",void 0),Object(n.a)([Object(o.b)()],T.prototype,"container",void 0),Object(n.a)([Object(o.b)()],T.prototype,"layer",void 0),Object(n.a)([Object(o.b)()],T.prototype,"strategy",void 0),Object(n.a)([Object(o.b)()],T.prototype,"timeExtent",void 0),Object(n.a)([Object(o.b)()],T.prototype,"view",void 0),Object(n.a)([Object(o.b)()],T.prototype,"updateRequested",void 0),Object(n.a)([Object(o.b)()],T.prototype,"updating",null),Object(n.a)([Object(o.b)()],T.prototype,"type",void 0),T=Object(n.a)([Object(l.a)("esri.views.2d.layers.imagery.ImageryView2D")],T);const w=T;var j=i(47),I=i(85),M=i(35),E=i(735),C=i(722),R=i(656),D=i(615),P=i(648);class A extends P.a{constructor(){super(...arguments),this.symbolTypes=["triangle"]}get requiresDedicatedFBO(){return!1}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf)",brushes:[R.a],target:()=>this.children,drawPhase:D.c.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===D.c.MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}}var z=i(906);const L=p.a.getLogger("esri.views.2d.layers.imagery.VectorFieldView2D");let F=class extends m.a{constructor(e){super(e),this.update=Object(g.h)((e,t)=>this._update(e,t).catch(e=>{Object(g.l)(e)||L.error(e)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes="wind_speed"===e.style?["scalar","triangle"]:"simple_scalar"===e.style?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,i){if(!e.stationary)return;const{extent:n,spatialReference:r}=e.state,s=new M.a({xmin:n.xmin,ymin:n.ymin,xmax:n.xmax,ymax:n.ymax,spatialReference:r}),[a,o]=e.state.size;this._loading=this.fetchPixels(s,a,o,i);const l=await this._loading;this._addToDisplay(l,t,e.state),this._loading=null}_addToDisplay(e,t,i){if(Object(_.i)(e.pixelBlock))return this.container.children.forEach(e=>e.destroy()),void this.container.removeAllChildren();const{extent:n,pixelBlock:r}=e,s=new z.a(r);s.offset=[0,0],s.symbolizerParameters=t,s.rawPixelData=e,s.invalidateVAO(),s.x=n.xmin,s.y=n.ymax,s.pixelRatio=i.pixelRatio,s.rotation=i.rotation,s.resolution=i.resolution,s.width=r.width*t.symbolTileSize,s.height=r.height*t.symbolTileSize,this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.container.symbolTypes="wind_speed"===t.style?["scalar","triangle"]:"simple_scalar"===t.style?["scalar"]:["triangle"],this.container.addChild(s)}};Object(n.a)([Object(o.b)()],F.prototype,"fetchPixels",void 0),Object(n.a)([Object(o.b)()],F.prototype,"container",void 0),Object(n.a)([Object(o.b)()],F.prototype,"_loading",void 0),Object(n.a)([Object(o.b)()],F.prototype,"updating",null),F=Object(n.a)([Object(l.a)("esri.views.2d.layers.imagery.ImageryVFStrategy")],F);const V=F;let N=class extends I.a{constructor(){super(...arguments),this.attached=!1,this.container=new A,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,i,n)=>{const r=await this._projectFullExtentPromise,{symbolTileSize:s}=this.layer.renderer,{extent:a,width:o,height:l}=Object(C.h)(e,t,i,s,r);if(Object(_.j)(r)&&!r.intersects(e))return{extent:a,pixelBlock:null};const c={bbox:`${a.xmin}, ${a.ymin}, ${a.xmax}, ${a.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:s,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(c)){const e=this.getPixelData();if(Object(_.j)(e)&&`${e.extent.xmin}, ${e.extent.ymin}, ${e.extent.xmax}, ${e.extent.ymax}`===c.bbox)return e}const{pixelData:u}=await this.layer.fetchImage(a,o,l,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:n});return this._dataParameters=c,Object(_.i)(u.pixelBlock)?{extent:a,pixelBlock:null}:{extent:a,pixelBlock:"vector-uv"===this.layer.rasterInfo.dataType?Object(_.q)(Object(C.b)(u.pixelBlock,"vector-uv")):u.pixelBlock}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new V({container:this.container,fetchPixels:this._fetchpixels}),this.handles.add(Object(a.e)(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),a.d),"vector-field-view-update")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.handles.remove("vector-field-view-update"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){if(this.updating||!this.container.children.length)return null;const{extent:e,pixelBlock:t}=this.container.children[0].rawPixelData;return{extent:e,pixelBlock:t}}hitTest(e){return new r.a({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams)}redraw(){this._updateSymbolizerParams(this.layer.renderer),this._strategy.redraw(this._symbolizerParams)}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,i=this._dataParameters.time===e.time,n=this._dataParameters.symbolTileSize===e.symbolTileSize,r=this._dataParameters.bbox===e.bbox;return t&&i&&n&&r}async _getProjectedFullExtent(e){try{return await Object(E.h)(this.layer.fullExtent,e)}catch(t){try{const t=(await Object(j.default)(this.layer.url,{query:{option:"footprints",outSR:e.wkid||JSON.stringify(e.toJSON()),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return t?M.a.fromJSON(t):null}catch{return null}}}_updateSymbolizerParams(e){"vector-field"===e.type&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};Object(n.a)([Object(o.b)()],N.prototype,"attached",void 0),Object(n.a)([Object(o.b)()],N.prototype,"container",void 0),Object(n.a)([Object(o.b)()],N.prototype,"layer",void 0),Object(n.a)([Object(o.b)()],N.prototype,"timeExtent",void 0),Object(n.a)([Object(o.b)()],N.prototype,"type",void 0),Object(n.a)([Object(o.b)()],N.prototype,"view",void 0),Object(n.a)([Object(o.b)()],N.prototype,"updating",null),N=Object(n.a)([Object(l.a)("esri.views.2d.layers.imagery.VectorFieldView2D")],N);const U=N;var k=i(8),B=i(28),G=i(102),W=i(72),H=i(765);const q=e=>{let t=class extends e{constructor(){super(...arguments),this.view=null}async fetchPopupFeatures(e,t){const{layer:i}=this;if(!e)throw new k.a("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:n}=i,r=Object(H.a)(i,t);if(!n||!Object(_.j)(r))throw new k.a("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:n,popupTemplate:r});const s=await r.getRequiredFields(),a=new W.a;a.timeExtent=this.timeExtent,a.geometry=e,a.outFields=s,a.outSpatialReference=e.spatialReference;const o=this.view.resolution,l="2d"===this.view.type?new B.a(o,o,this.view.spatialReference):new B.a(.5*o,.5*o,this.view.spatialReference),{returnTopmostRaster:c,showNoDataRecords:u}=r.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},h={returnDomainValues:!0,returnTopmostRaster:c,pixelSize:l,showNoDataRecords:u,signal:Object(_.j)(t)?t.signal:null};return i.queryVisibleRasters(a,h).then(e=>e)}canResume(){var e;return!!super.canResume()&&(null==(e=this.timeExtent)||!e.isEmpty)}};return Object(n.a)([Object(o.b)()],t.prototype,"layer",void 0),Object(n.a)([Object(o.b)()],t.prototype,"suspended",void 0),Object(n.a)([Object(o.b)(G.a)],t.prototype,"timeExtent",void 0),Object(n.a)([Object(o.b)()],t.prototype,"view",void 0),t=Object(n.a)([Object(l.a)("esri.views.layers.ImageryLayerView")],t),t};var Z=i(660),Y=i(713);let K=class extends(q(Object(Y.a)(Object(h.a)(Z.a)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new c.a,this.subview=null}get pixelData(){return this.updating?null:"getPixelData"in this.subview?this.subview.getPixelData():null}get updating(){return!!(!this.subview||"updating"in this.subview&&this.subview.updating)}async hitTest(e,t){return this.subview?[this.subview.hitTest(e)]:null}update(e){var t;null==(t=this.subview)||t.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new d.a({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new f.a(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.handles.add([Object(a.e)(()=>{var e;return null!=(e=this.layer.blendMode)?e:"normal"},e=>this.subview.container.blendMode=e,a.d),Object(a.e)(()=>{var e;return null!=(e=this.layer.effect)?e:null},e=>this.subview.container.effect=e,a.d),Object(a.e)(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},a.c),Object(a.e)(()=>this.timeExtent,e=>{this.subview.timeExtent=e,"redraw"in this.subview?this.requestUpdate():this.subview.redrawOrRefetch()},a.c),this.layer.on("redraw",()=>{"redraw"in this.subview?this.subview.redraw():this.subview.redrawOrRefetch()}),Object(a.e)(()=>this.layer.renderer,()=>this._setSubView())],"imagerylayerview-update")}detach(){var e,t;this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),null==(e=this.subview)||e.destroy(),this.handles.remove("imagerylayerview-update"),this.subview=null,null==(t=this._highlightView)||t.destroy(),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,t){if(!((Array.isArray(e)?e[0]:s.a.isCollection(e)?e.getItemAt(0):e)instanceof r.a))return{remove:()=>{}};let i=[];return Array.isArray(e)||s.a.isCollection(e)?i=e.map(e=>e.clone()):e instanceof r.a&&(i=[e.clone()]),this._highlightGraphics.addMany(i),{remove:()=>{this._highlightGraphics.removeMany(i)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating}_setSubView(){var e;if(!this.view)return;const t=null==(e=this.layer.renderer)?void 0:e.type;let i="imagery";if("vector-field"===t&&"lerc"===this.layer.format?i="imageryVF":"flow"===t&&(i="flow"),this.subview){var n;if(this.subview.type===i)return this._attachSubview(this.subview),void("flow"===this.subview.type&&this.subview.redrawOrRefetch());this._detachSubview(this.subview),null==(n=this.subview)||n.destroy()}this.subview="imagery"===i?new w({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):"imageryVF"===i?new U({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new u.a({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){null!=e&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};Object(n.a)([Object(o.b)()],K.prototype,"pixelData",null),Object(n.a)([Object(o.b)({readOnly:!0})],K.prototype,"updating",null),Object(n.a)([Object(o.b)()],K.prototype,"subview",void 0),K=Object(n.a)([Object(l.a)("esri.views.2d.layers.ImageryLayerView2D")],K);const X=K},617:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(){this.name=this.constructor.name||"UnnamedBrush"}prepareState(e,t,i){}draw(e,t,i){}drawMany(e,t,i){for(const n of t)this.draw(e,n,i)}}},622:function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return m})),i.d(t,"c",(function(){return n})),i.d(t,"d",(function(){return l})),i.d(t,"e",(function(){return s})),i.d(t,"f",(function(){return o})),i.d(t,"g",(function(){return c})),i.d(t,"h",(function(){return h})),i.d(t,"i",(function(){return u})),i.d(t,"j",(function(){return r}));var n,r,s,a,o,l,c,u,h,d,f=i(14);(d=n||(n={}))[d.BACKGROUND=0]="BACKGROUND",d[d.FILL=1]="FILL",d[d.LINE=2]="LINE",d[d.SYMBOL=3]="SYMBOL",d[d.CIRCLE=4]="CIRCLE",function(e){e[e.VISIBLE=0]="VISIBLE",e[e.NONE=1]="NONE"}(r||(r={})),function(e){e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.LINE_CENTER=2]="LINE_CENTER"}(s||(s={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT",e[e.AUTO=2]="AUTO"}(a||(a={})),function(e){e[e.AUTO=0]="AUTO",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT"}(o||(o={})),function(e){e[e.CENTER=0]="CENTER",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.TOP=3]="TOP",e[e.BOTTOM=4]="BOTTOM",e[e.TOP_LEFT=5]="TOP_LEFT",e[e.TOP_RIGHT=6]="TOP_RIGHT",e[e.BOTTOM_LEFT=7]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"}(l||(l={})),function(e){e[e.NONE=0]="NONE",e[e.UPPERCASE=1]="UPPERCASE",e[e.LOWERCASE=2]="LOWERCASE"}(c||(c={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT"}(u||(u={})),function(e){e[e.HORIZONTAL=0]="HORIZONTAL",e[e.VERTICAL=1]="VERTICAL"}(h||(h={}));class m{}m.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:r.VISIBLE}},m.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:r.VISIBLE}},m.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:r.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:f.d.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:f.o.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}},m.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:r.VISIBLE},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:s.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:l.CENTER},"icon-ignore-placement":{type:"boolean",default:!1},"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:a.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:l.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:o.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:a.AUTO},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:c.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[h.HORIZONTAL]}},m.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:r.VISIBLE}},m.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}},m.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:u.MAP}},m.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:u.MAP},"line-width":{type:"number",minimum:0,default:1}},m.symbolPaintDefinition={"icon-color":{type:"color",default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:u.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:u.MAP}},m.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}},m.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:u.MAP}}},624:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return l})),i.d(t,"d",(function(){return u})),i.d(t,"e",(function(){return h})),i.d(t,"f",(function(){return c})),i.d(t,"g",(function(){return o})),i.d(t,"h",(function(){return s}));const n=0,r=100;function s(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function a(e,t){return Math.sqrt(e*e+t*t)}function o(e){const t=a(e[0],e[1]);e[0]/=t,e[1]/=t}function l(e,t){return a(e[0]-t[0],e[1]-t[1])}function c(e){return"function"==typeof e}function u(e=2){return 1/Math.max(e,1)}function h(e,t){return[!!e.minScale&&t.scaleToZoom(e.minScale)||n,!!e.maxScale&&t.scaleToZoom(e.maxScale)||r]}},625:function(e,t,i){"use strict";function n(){return new Float32Array(4)}function r(e,t,i,n){const r=new Float32Array(4);return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r}function s(){return n()}function a(){return r(1,1,1,1)}function o(){return r(1,0,0,0)}function l(){return r(0,1,0,0)}function c(){return r(0,0,1,0)}function u(){return r(0,0,0,1)}i.d(t,"a",(function(){return r}));const h=s(),d=a(),f=o(),m=l(),p=c(),_=u();Object.freeze({__proto__:null,create:n,clone:function(e){const t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:r,createView:function(e,t){return new Float32Array(e,t,4)},zeros:s,ones:a,unitX:o,unitY:l,unitZ:c,unitW:u,ZEROS:h,ONES:d,UNIT_X:f,UNIT_Y:m,UNIT_Z:p,UNIT_W:_})},627:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i(650);function r(e,t,i=""){return new n.a(e,i+t.shaders.vertexShader,i+t.shaders.fragmentShader,t.attributes)}},629:function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return s})),i.d(t,"d",(function(){return h})),i.d(t,"e",(function(){return c})),i.d(t,"f",(function(){return l})),i.d(t,"g",(function(){return o})),i.d(t,"h",(function(){return u}));const n=8388607,r=8388608,s=0,a=1,o=e=>(e&r)>>>23,l=e=>e&n,c=e=>o(e)===a?254:255;function u(e){return o(e)===a}function h(e,t){return((t?r:0)|e)>>>0}},630:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i(637);const r={shaders:{vertexShader:Object(n.a)("background/background.vert"),fragmentShader:Object(n.a)("background/background.frag")},attributes:new Map([["a_pos",0]])}},632:function(e,t,i){"use strict";i.d(t,"a",(function(){return u})),i.d(t,"b",(function(){return l})),i.d(t,"c",(function(){return c})),i.d(t,"d",(function(){return o}));Number.POSITIVE_INFINITY;const n=Math.PI,r=128/n,s=1/Math.LN2;function a(e,t){return(e%=t)>=0?e:e+t}function o(e){return a(e*r,256)}function l(e){return a(e*(256/360),256)}function c(e){return Math.log(e)*s}function u(e,t,i){return e>=t&&e<=i||e>=i&&e<=t}},634:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(619),r=i(614),s=i(620),a=i(631);class o{constructor(e,t){this.rctx=e,this._vertexBuffer=n.a.createVertex(e,r.D.STATIC_DRAW,new Uint16Array(t)),this._vao=new s.a(e,new Map([["a_position",0]]),{geometry:[new a.a("a_position",2,r.k.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=t.length/2}bind(){this._vao.bind()}unbind(){this._vao.unbind()}dispose(){this._vao.dispose(!1),this._vertexBuffer.dispose()}draw(){this.rctx.bindVAO(this._vao),this.rctx.drawArrays(r.r.TRIANGLE_STRIP,0,this._count)}}},635:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(2),r=i(344);class s{bindFeature(e,t,i){}write(e,t,i,s){var a;if(Object(n.i)(this._effects)||0===(null==(a=this._effects)?void 0:a.length))return this._write(e,t,s);const o=r.a.executeEffects(this._effects,t.readLegacyGeometryForDisplay(),s.geometryEngine);let l=r.a.next(o);for(;l;)this._write(e,t,s,l),l=r.a.next(o)}_write(e,t,i,n){}}},636:function(e,t,i){"use strict";i.r(t),i.d(t,"createSymbolSchema",(function(){return o}));var n=i(615),r=i(618);function s(e){var t;return"line-marker"===e.type?{type:"line-marker",color:null==(t=e.color)?void 0:t.toJSON(),placement:e.placement,style:e.style}:e.constructor.fromJSON(e.toJSON()).toJSON()}function a(e){return hydrateKey(e)}function o(e,t,i){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return c(e,t,i);case"simple-marker":case"picture-marker":return h(e,t,i);case"simple-line":return u(e,t,i);case"text":return d(e,t,i);case"label":return l(e,t,i);case"cim":return{type:"cim",rendererKey:t.vvFlags,data:e.data,maxVVSize:t.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:t.vvFlags,data:e,maxVVSize:t.maxVVSize};case"web-style":return{...s(e),type:"web-style",hash:e.hash(),rendererKey:t.vvFlags,maxVVSize:t.maxVVSize};default:throw new Error("symbol not supported "+e.type)}}function l(e,t,i){const s=e.toJSON(),o=Object(r.g)(n.d.LABEL,{...t,placement:s.labelPlacement});return{materialKey:i?a(o):o,hash:e.hash(),...s,labelPlacement:s.labelPlacement}}function c(e,t,i){const o=t.supportsOutlineFills,l=Object(r.g)(n.d.FILL,{...t,isOutlinedFill:o}),c=i?a(l):l,u=e.clone(),h=u.outline;t.supportsOutlineFills||(u.outline=null);const d={materialKey:c,hash:u.hash(),isOutlinedFill:!!t.supportsOutlineFills,...s(u)};if(t.supportsOutlineFills)return d;const f=[];if(f.push(d),h){const e=Object(r.g)(n.d.LINE,{...t,isOutline:!0}),o={materialKey:i?a(e):e,hash:h.hash(),...s(h)};f.push(o)}return{type:"composite-symbol",layers:f,hash:f.reduce((e,t)=>t.hash+e,"")}}function u(e,t,i){const o=Object(r.g)(n.d.LINE,t),l=i?a(o):o,c=e.clone(),u=c.marker;c.marker=null;const h=[];if(h.push({materialKey:l,hash:c.hash(),...s(c)}),u){var d;const e=Object(r.g)(n.d.MARKER,t),o=i?a(e):e;u.color=null!=(d=u.color)?d:c.color,h.push({materialKey:o,hash:u.hash(),lineWidth:c.width,...s(u)})}return{type:"composite-symbol",layers:h,hash:h.reduce((e,t)=>t.hash+e,"")}}function h(e,t,i){const o=Object(r.g)(n.d.MARKER,t),l=i?a(o):o,c=s(e);return{materialKey:l,hash:e.hash(),...c,angle:e.angle,maxVVSize:t.maxVVSize}}function d(e,t,i){const o=Object(r.g)(n.d.TEXT,t),l=i?a(o):o,c=s(e);return{materialKey:l,hash:e.hash(),...c,angle:e.angle,maxVVSize:t.maxVVSize}}},637:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));const n={background:{"background.frag":"uniform lowp vec4 u_color;\nvoid main() {\ngl_FragColor = u_color;\n}","background.vert":"attribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump vec2 u_coord_range;\nuniform mediump float u_depth;\nvoid main() {\nvec3 v_pos = u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0);\ngl_Position = vec4(v_pos.xy, 0.0, 1.0);\n}"},bitBlit:{"bitBlit.frag":"uniform lowp sampler2D u_tex;\nuniform lowp float u_opacity;\nvarying mediump vec2 v_uv;\nvoid main() {\nlowp vec4 color = texture2D(u_tex, v_uv);\ngl_FragColor = color *  u_opacity;\n}","bitBlit.vert":"attribute vec2 a_pos;\nattribute vec2 a_tex;\nvarying mediump vec2 v_uv;\nvoid main(void) {\ngl_Position = vec4(a_pos, 0.0, 1.0);\nv_uv = a_tex;\n}"},blend:{"blend.frag":"precision mediump float;\nuniform sampler2D u_layerTexture;\nuniform lowp float u_opacity;\nuniform lowp float u_inFadeOpacity;\n#ifndef NORMAL\nuniform sampler2D u_backbufferTexture;\n#endif\nvarying mediump vec2 v_uv;\nfloat rgb2v(in vec3 c) {\nreturn max(c.x, max(c.y, c.z));\n}\nvec3 rgb2hsv(in vec3 c) {\nvec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d = q.x - min(q.w, q.y);\nfloat e = 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(in vec3 c) {\nvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec3 tint(in vec3 Cb, in vec3 Cs) {\nfloat vIn = rgb2v(Cb);\nvec3 hsvTint = rgb2hsv(Cs);\nvec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);\nreturn hsv2rgb(hsvOut);\n}\nfloat overlay(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * (1.0 - 2.0 * (1.0 - Cs ) * (1.0 - Cb)) + step(0.5, Cs) * (2.0 * Cs * Cb);\n}\nfloat colorDodge(in float Cb, in float Cs) {\nreturn (Cb == 0.0) ? 0.0 : (Cs == 1.0) ? 1.0 : min(1.0, Cb / (1.0 - Cs));\n}\nfloat colorBurn(in float Cb, in float Cs) {\nreturn (Cb == 1.0) ? 1.0 : (Cs == 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - Cb) / Cs);\n}\nfloat hardLight(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * (2.0 * Cs * Cb) + step(0.5, Cs) * (1.0 - 2.0 * (1.0 - Cs) * (1.0 - Cb));\n}\nfloat reflectBlend(in float Cb, in float Cs) {\nreturn (Cs == 1.0) ? Cs : min(Cb * Cb / (1.0 - Cs), 1.0);\n}\nfloat softLight(in float Cb, in float Cs) {\nif (Cs <= 0.5) {\nreturn Cb - (1.0 - 2.0 * Cs) * Cb * (1.0 - Cb);\n}\nif (Cb <= 0.25) {\nreturn Cb + (2.0 * Cs - 1.0) * Cb * ((16.0 * Cb - 12.0) * Cb + 3.0);\n}\nreturn Cb + (2.0 * Cs - 1.0) * (sqrt(Cb) - Cb);\n}\nfloat vividLight(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * colorBurn(Cb, 2.0 * Cs) + step(0.5, Cs) * colorDodge(Cb, (2.0 * (Cs - 0.5)));\n}\nfloat minv3(in vec3 c) {\nreturn min(min(c.r, c.g), c.b);\n}\nfloat maxv3(in vec3 c) {\nreturn max(max(c.r, c.g), c.b);\n}\nfloat lumv3(in vec3 c) {\nreturn dot(c, vec3(0.3, 0.59, 0.11));\n}\nfloat satv3(vec3 c) {\nreturn maxv3(c) - minv3(c);\n}\nvec3 clipColor(vec3 color) {\nfloat lum = lumv3(color);\nfloat mincol = minv3(color);\nfloat maxcol = maxv3(color);\nif (mincol < 0.0) {\ncolor = lum + ((color - lum) * lum) / (lum - mincol);\n}\nif (maxcol > 1.0) {\ncolor = lum + ((color - lum) * (1.0 - lum)) / (maxcol - lum);\n}\nreturn color;\n}\nvec3 setLum(vec3 cbase, vec3 clum) {\nfloat lbase = lumv3(cbase);\nfloat llum = lumv3(clum);\nfloat ldiff = llum - lbase;\nvec3 color = cbase + vec3(ldiff);\nreturn clipColor(color);\n}\nvec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum)\n{\nfloat minbase = minv3(cbase);\nfloat sbase = satv3(cbase);\nfloat ssat = satv3(csat);\nvec3 color;\nif (sbase > 0.0) {\ncolor = (cbase - minbase) * ssat / sbase;\n} else {\ncolor = vec3(0.0);\n}\nreturn setLum(color, clum);\n}\nvoid main() {\nvec4 src = texture2D(u_layerTexture, v_uv);\n#ifdef NORMAL\ngl_FragColor = src *  u_opacity;\n#else\nvec4 dst = texture2D(u_backbufferTexture, v_uv);\nvec3 Cs = src.a == 0.0 ? src.rgb : vec3(src.rgb / src.a);\nvec3 Cb = dst.a == 0.0 ? dst.rgb : vec3(dst.rgb / dst.a);\nfloat as = u_opacity * src.a;\nfloat ab = dst.a;\n#ifdef DESTINATION_OVER\ngl_FragColor = vec4(as * Cs * (1.0 - ab) + ab * Cb, as + ab - as * ab);\n#endif\n#ifdef SOURCE_IN\nvec4 color = vec4(as * Cs * ab, as * ab);\nvec4 fadeColor = (1.0 - u_opacity) * u_inFadeOpacity * vec4(ab * Cb, ab);\ngl_FragColor = color + fadeColor;\n#endif\n#ifdef DESTINATION_IN\nvec4 color = vec4(ab * Cb * as, ab * as);\nvec4 fadeColor = (1.0 - u_opacity) * u_inFadeOpacity * vec4(ab * Cb, ab);\ngl_FragColor = color + fadeColor;\n#endif\n#ifdef SOURCE_OUT\ngl_FragColor = vec4(as * Cs * (1.0 - ab), as * (1.0 - ab));\n#endif\n#ifdef DESTINATION_OUT\ngl_FragColor = vec4(ab * Cb * (1.0 - as), ab * (1.0 - as));\n#endif\n#ifdef SOURCE_ATOP\ngl_FragColor = vec4(as * Cs * ab + ab * Cb * (1.0 - as), ab);\n#endif\n#ifdef DESTINATION_ATOP\ngl_FragColor = vec4(as * Cs * (1.0 - ab) + ab * Cb * as, as);\n#endif\n#ifdef XOR\ngl_FragColor = vec4(as * Cs * (1.0 - ab) + ab * Cb * (1.0 - as),\nas * (1.0 - ab) + ab * (1.0 - as));\n#endif\n#ifdef MULTIPLY\ngl_FragColor = vec4(as * Cs * ab * Cb + (1.0 - ab) * as * Cs + (1.0 - as) * ab * Cb,\nas + ab * (1.0 - as));\n#endif\n#ifdef SCREEN\ngl_FragColor = vec4((Cs + Cb - Cs * Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef OVERLAY\nvec3 f = vec3(overlay(Cb.r, Cs.r), overlay(Cb.g, Cs.g), overlay(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef DARKEN\ngl_FragColor = vec4(min(Cs, Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef LIGHTER\ngl_FragColor = vec4(as * Cs + ab * Cb, as + ab);\n#endif\n#ifdef LIGHTEN\ngl_FragColor = vec4(max(Cs, Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR_DODGE\nvec3 f = vec3(colorDodge(Cb.r, Cs.r), colorDodge(Cb.g, Cs.g), colorDodge(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR_BURN\nvec3 f = vec3(colorBurn(Cb.r, Cs.r), colorBurn(Cb.g, Cs.g), colorBurn(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef HARD_LIGHT\nvec3 f = vec3(hardLight(Cb.r, Cs.r), hardLight(Cb.g, Cs.g), hardLight(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef SOFT_LIGHT\nvec3 f = vec3(softLight(Cb.r, Cs.r), softLight(Cb.g, Cs.g), softLight(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef DIFFERENCE\ngl_FragColor = vec4(abs(Cb - Cs) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef EXCLUSION\nvec3 f = Cs + Cb - 2.0 * Cs * Cb;\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef INVERT\ngl_FragColor = vec4((1.0 - Cb) * as * ab + Cb * ab * (1.0 - as), ab);\n#endif\n#ifdef VIVID_LIGHT\nvec3 f = vec3(vividLight(Cb.r, Cs.r),\nvividLight(Cb.g, Cs.g),\nvividLight(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef HUE\nvec3 f = setLumSat(Cs,Cb,Cb);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef SATURATION\nvec3 f = setLumSat(Cb,Cs,Cb);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR\nvec3 f = setLum(Cs,Cb);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef LUMINOSITY\nvec3 f = setLum(Cb,Cs);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef PLUS\ngl_FragColor = clamp(vec4(src.r + Cb.r, src.g + Cb.g, src.b + Cb.b, as + ab), 0.0, 1.0);\n#endif\n#ifdef MINUS\ngl_FragColor = vec4(clamp(vec3(Cb.r - src.r, Cb.g - src.g, Cb.b - src.b), 0.0, 1.0), ab * as);\n#endif\n#ifdef AVERAGE\nvec3 f = (Cb + Cs) / 2.0;\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef REFLECT\nvec3 f = vec3(reflectBlend(Cb.r, Cs.r),\nreflectBlend(Cb.g, Cs.g),\nreflectBlend(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#endif\n}","blend.vert":"attribute vec2 a_position;\nvarying mediump vec2 v_uv;\nvoid main(void) {\ngl_Position = vec4(a_position , 0.0, 1.0);\nv_uv = (a_position + 1.0) / 2.0;\n}"},dot:{dot:{"dot.frag":"precision mediump float;\nvarying vec4 v_color;\nvarying float v_dotRatio;\nvarying float v_invEdgeRatio;\nuniform highp float u_tileZoomFactor;\nvoid main()\n{\nfloat dist = length(gl_PointCoord - vec2(.5, .5)) * 2.;\nfloat alpha = smoothstep(0., 1., v_invEdgeRatio * (dist - v_dotRatio) + 1.);\ngl_FragColor = v_color * alpha;\n}","dot.vert":"precision highp float;\nattribute vec2 a_pos;\nuniform sampler2D u_texture;\nuniform highp mat3 u_dvsMat3;\nuniform highp float u_tileZoomFactor;\nuniform highp float u_dotSize;\nuniform highp float u_pixelRatio;\nvarying vec2 v_pos;\nvarying vec4 v_color;\nvarying float v_dotRatio;\nvarying float v_invEdgeRatio;\nconst float EPSILON = 0.000001;\nvoid main()\n{\nmat3 tileToTileTexture = mat3(  1., 0., 0.,\n0., -1., 0.,\n0., 1., 1.  );\nvec3 texCoords = tileToTileTexture * vec3(a_pos.xy / 512., 1.);\nv_color = texture2D(u_texture, texCoords.xy);\nfloat smoothEdgeWidth = max(u_dotSize / 2., 1.) ;\nfloat z = 0.;\nz += 2.0 * step(v_color.a, EPSILON);\ngl_PointSize = (smoothEdgeWidth + u_dotSize);\ngl_Position = vec4((u_dvsMat3 * vec3(a_pos + .5, 1.)).xy, z, 1.);\nv_dotRatio = u_dotSize / gl_PointSize;\nv_invEdgeRatio = -1. / ( smoothEdgeWidth / gl_PointSize );\ngl_PointSize  *= (u_pixelRatio * u_tileZoomFactor);\n}"}},filtering:{"bicubic.glsl":"vec4 computeWeights(float v) {\nfloat b = 1.0 / 6.0;\nfloat v2 = v * v;\nfloat v3 = v2 * v;\nfloat w0 = b * (-v3 + 3.0 * v2 - 3.0 * v + 1.0);\nfloat w1 = b * (3.0 * v3  - 6.0 * v2 + 4.0);\nfloat w2 = b * (-3.0 * v3 + 3.0 * v2 + 3.0 * v + 1.0);\nfloat w3 = b * v3;\nreturn vec4(w0, w1, w2, w3);\n}\nvec4 bicubicOffsetsAndWeights(float v) {\nvec4 w = computeWeights(v);\nfloat g0 = w.x + w.y;\nfloat g1 = w.z + w.w;\nfloat h0 = 1.0 - (w.y / g0) + v;\nfloat h1 = 1.0 + (w.w / g1) - v;\nreturn vec4(h0, h1, g0, g1);\n}\nvec4 sampleBicubicBSpline(sampler2D sampler, vec2 coords, vec2 texSize) {\nvec2 eX = vec2(1.0 / texSize.x, 0.0);\nvec2 eY = vec2(0.0, 1.0 / texSize.y);\nvec2 texel = coords * texSize - 0.5;\nvec3 hgX = bicubicOffsetsAndWeights(fract(texel).x).xyz;\nvec3 hgY = bicubicOffsetsAndWeights(fract(texel).y).xyz;\nvec2 coords10 = coords + hgX.x * eX;\nvec2 coords00 = coords - hgX.y * eX;\nvec2 coords11 = coords10 + hgY.x * eY;\nvec2 coords01 = coords00 + hgY.x * eY;\ncoords10 = coords10 - hgY.y * eY;\ncoords00 = coords00 - hgY.y * eY;\nvec4 color00 = texture2D(sampler, coords00);\nvec4 color10 = texture2D(sampler, coords10);\nvec4 color01 = texture2D(sampler, coords01);\nvec4 color11 = texture2D(sampler, coords11);\ncolor00 = mix(color00, color01, hgY.z);\ncolor10 = mix(color10, color11, hgY.z);\ncolor00 = mix(color00, color10, hgX.z);\nreturn color00;\n}","bilinear.glsl":"vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) {\nvec2 texelStart = floor(coords * texSize);\nvec2 coord0 = texelStart / texSize;\nvec2 coord1 = (texelStart +  vec2(1.0, 0.0)) / texSize;\nvec2 coord2 = (texelStart +  vec2(0.0, 1.0)) / texSize;\nvec2 coord3 = (texelStart +  vec2(1.0, 1.0)) / texSize;\nvec4 color0 = texture2D(sampler, coord0);\nvec4 color1 = texture2D(sampler, coord1);\nvec4 color2 = texture2D(sampler, coord2);\nvec4 color3 = texture2D(sampler, coord3);\nvec2 blend = fract(coords * texSize);\nvec4 color01 = mix(color0, color1, blend.x);\nvec4 color23 = mix(color2, color3, blend.x);\nvec4 color = mix(color01, color23, blend.y);\n#ifdef NNEDGE\nfloat alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5);\ncolor = color * alpha + (1.0 - alpha) * texture2D(sampler, coords);\n#endif\nreturn color;\n}","epx.glsl":"vec4 sampleEPX(sampler2D sampler, float size, vec2 coords, vec2 texSize) {\nvec2 invSize = 1.0 / texSize;\nvec2 texel = coords * texSize;\nvec2 texel_i = floor(texel);\nvec2 texel_frac = fract(texel);\nvec4 colorP = texture2D(sampler, texel_i * invSize);\nvec4 colorP1 = vec4(colorP);\nvec4 colorP2 = vec4(colorP);\nvec4 colorP3 = vec4(colorP);\nvec4 colorP4 = vec4(colorP);\nvec4 colorA = texture2D(sampler, (texel_i - vec2(0.0, 1.0)) * invSize);\nvec4 colorB = texture2D(sampler, (texel_i + vec2(1.0, 0.0)) * invSize);\nvec4 colorC = texture2D(sampler, (texel_i - vec2(1.0, 0.0)) * invSize);\nvec4 colorD = texture2D(sampler, (texel_i + vec2(0.0, 1.0)) * invSize);\nif (colorC == colorA && colorC != colorD && colorA != colorB) {\ncolorP1 = colorA;\n}\nif (colorA == colorB && colorA != colorC && colorB != colorD) {\ncolorP2 = colorB;\n}\nif (colorD == colorC && colorD != colorB && colorC != colorA) {\ncolorP3 = colorC;\n}\nif (colorB == colorD && colorB != colorA && colorD != colorC) {\ncolorP4 = colorD;\n}\nvec4 colorP12 = mix(colorP1, colorP2, texel_frac.x);\nvec4 colorP34 = mix(colorP1, colorP2, texel_frac.x);\nreturn mix(colorP12, colorP34, texel_frac.y);\n}"},fx:{integrate:{"integrate.frag":"precision mediump float;\nuniform lowp sampler2D u_sourceTexture;\nuniform lowp sampler2D u_maskTexture;\nuniform mediump float u_zoomLevel;\nuniform highp float u_timeDelta;\nuniform highp float u_animationTime;\nvarying highp vec2 v_texcoord;\n#include <materials/utils.glsl>\nvoid main()\n{\n#ifdef DELTA\nvec4 texel = texture2D(u_sourceTexture, v_texcoord);\nvec4 data0 = texture2D(u_maskTexture, v_texcoord);\nfloat flags = data0.r * 255.0;\nfloat groupMinZoom = data0.g * 255.0;\nfloat isVisible = getFilterBit(flags, 0);\nfloat wouldClip = step(groupMinZoom, u_zoomLevel);\nfloat direction = wouldClip * 1.0 + (1.0 - wouldClip) * -1.0;\nfloat dt = u_timeDelta / max(u_animationTime, 0.0001);\nvec4 nextState = vec4(texel + direction * dt);\ngl_FragColor =  vec4(nextState);\n#elif defined(UPDATE)\nvec4 texel = texture2D(u_sourceTexture, v_texcoord);\ngl_FragColor = texel;\n#endif\n}","integrate.vert":"precision mediump float;\nattribute vec2 a_pos;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos;\ngl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n}"}},highlight:{"blur.frag":"varying mediump vec2 v_texcoord;\nuniform mediump vec4 u_direction;\nuniform mediump mat4 u_channelSelector;\nuniform mediump float u_sigma;\nuniform sampler2D u_texture;\nmediump float gauss1(mediump vec2 dir) {\nreturn exp(-dot(dir, dir) / (2.0 * u_sigma * u_sigma));\n}\nmediump vec4 selectChannel(mediump vec4 sample) {\nreturn u_channelSelector * sample;\n}\nvoid accumGauss1(mediump float i, inout mediump float tot, inout mediump float weight) {\nmediump float w = gauss1(i * u_direction.xy);\ntot += selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw))[3] * w;\nweight += w;\n}\nvoid main(void) {\nmediump float tot = 0.0;\nmediump float weight = 0.0;\naccumGauss1(-5.0, tot, weight);\naccumGauss1(-4.0, tot, weight);\naccumGauss1(-3.0, tot, weight);\naccumGauss1(-2.0, tot, weight);\naccumGauss1(-1.0, tot, weight);\naccumGauss1(0.0, tot, weight);\naccumGauss1(1.0, tot, weight);\naccumGauss1(2.0, tot, weight);\naccumGauss1(3.0, tot, weight);\naccumGauss1(4.0, tot, weight);\naccumGauss1(5.0, tot, weight);\ngl_FragColor = vec4(0.0, 0.0, 0.0, tot / weight);\n}","highlight.frag":"varying mediump vec2 v_texcoord;\nuniform sampler2D u_texture;\nuniform mediump float u_sigma;\nuniform sampler2D u_shade;\nuniform mediump vec2 u_minMaxDistance;\nmediump float estimateDistance() {\nmediump float y = texture2D(u_texture, v_texcoord)[3];\nconst mediump float y0 = 0.5;\nmediump float m0 = 1.0 / (sqrt(2.0 * 3.1415) * u_sigma);\nmediump float d = (y - y0) / m0;\nreturn d;\n}\nmediump vec4 shade(mediump float d) {\nmediump float mappedDistance = (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x);\nmappedDistance = clamp(mappedDistance, 0.0, 1.0);\nreturn texture2D(u_shade, vec2(mappedDistance, 0.5));\n}\nvoid main(void) {\nmediump float d = estimateDistance();\ngl_FragColor = shade(d);\n}","textured.vert":"attribute mediump vec2 a_position;\nattribute mediump vec2 a_texcoord;\nvarying mediump vec2 v_texcoord;\nvoid main(void) {\ngl_Position = vec4(a_position, 0.0, 1.0);\nv_texcoord = a_texcoord;\n}"},magnifier:{"magnifier.frag":"uniform lowp vec4 u_background;\nuniform mediump sampler2D u_readbackTexture;\nuniform mediump sampler2D u_maskTexture;\nuniform mediump sampler2D u_overlayTexture;\nuniform bool u_maskEnabled;\nuniform bool u_overlayEnabled;\nvarying mediump vec2 v_texCoord;\nconst lowp float barrelFactor = 1.1;\nlowp vec2 barrel(lowp vec2 uv) {\nlowp vec2 uvn = uv * 2.0 - 1.0;\nif (uvn.x == 0.0 && uvn.y == 0.0) {\nreturn vec2(0.5, 0.5);\n}\nlowp float theta = atan(uvn.y, uvn.x);\nlowp float r = pow(length(uvn), barrelFactor);\nreturn r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5;\n}\nvoid main(void)\n{\nlowp vec4 color = texture2D(u_readbackTexture, barrel(v_texCoord));\ncolor = (color + (1.0 - color.a) * u_background);\nlowp float mask = u_maskEnabled ? texture2D(u_maskTexture, v_texCoord).a : 1.0;\ncolor *= mask;\nlowp vec4 overlayColor = u_overlayEnabled ? texture2D(u_overlayTexture, v_texCoord) : vec4(0);\ngl_FragColor = overlayColor + (1.0 - overlayColor.a) * color;\n}","magnifier.vert":"precision mediump float;\nattribute mediump vec2 a_pos;\nuniform mediump vec4 u_drawPos;\nvarying mediump vec2 v_texCoord;\nvoid main(void)\n{\nv_texCoord = a_pos;\ngl_Position = vec4(u_drawPos.xy + vec2(a_pos - 0.5) * u_drawPos.zw, 0.0, 1.0);\n}"},materials:{"attributeData.glsl":"uniform highp sampler2D u_attributeData0;\nuniform highp sampler2D u_attributeData1;\nuniform highp sampler2D u_attributeData2;\nuniform highp sampler2D u_attributeData3;\nuniform highp int u_attributeTextureSize;\nhighp vec2 getAttributeDataCoords(in highp vec3 id) {\nhighp vec3  texel = unpackDisplayIdTexel(id);\nhighp float size = float(u_attributeTextureSize);\nhighp float u32 = float(int(texel.r) + int(texel.g) * 256 + int(texel.b) * 256 * 256);\nhighp float col = mod(u32, size);\nhighp float row = (u32 - col) / size;\nhighp float u = col / size;\nhighp float v = row / size;\nreturn vec2(u, v);\n}\nhighp vec2 getAttributeDataTextureCoords(in highp vec3 id) {\nreturn (getAttributeDataCoords(id) * 2.0) - 1.0 + (.5 / vec2(u_attributeTextureSize));\n}\nhighp vec4 getAttributeData0(in highp vec3 id) {\nvec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData0, coords);\n}\nhighp vec4 getAttributeData1(in highp vec3 id) {\nhighp vec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData1, coords);\n}\nhighp vec4 getAttributeData2(in highp vec3 id) {\nhighp vec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData2, coords);\n}\nhighp vec4 getAttributeData3(in highp vec3 id) {\nhighp vec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData3, coords);\n}\nfloat u88VVToFloat(in vec2 v) {\nbool isMagic = v.x == 255.0 && v.y == 255.0;\nif (isMagic) {\nreturn NAN_MAGIC_NUMBER;\n}\nreturn (v.x + v.y * float(0x100)) - 32768.0;\n}","constants.glsl":"const float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst float C_256_TO_RAD = 3.14159265359 / 128.0;\nconst float SIGNED_BYTE_TO_UNSIGNED = 128.0;\nconst float POSITION_PRECISION = 1.0 / 8.0;\nconst float FILL_POSITION_PRECISION = 1.0 / 1.0;\nconst float SOFT_EDGE_RATIO = 1.0;\nconst float THIN_LINE_WIDTH_FACTOR = 1.1;\nconst float THIN_LINE_HALF_WIDTH = 1.0;\nconst float EXTRUDE_SCALE_PLACEMENT_PADDING = 1.0 / 4.0;\nconst float OFFSET_PRECISION = 1.0 / 8.0;\nconst float OUTLINE_SCALE = 1.0 / 5.0;\nconst float SDF_FONT_SIZE = 24.0;\nconst float MAX_SDF_DISTANCE = 8.0;\nconst float PLACEMENT_PADDING = 8.0;\nconst float EPSILON = 0.0000001;\nconst int MAX_FILTER_COUNT = 2;\nconst int ATTR_VV_SIZE = 0;\nconst int ATTR_VV_COLOR = 1;\nconst int ATTR_VV_OPACITY = 2;\nconst int ATTR_VV_ROTATION = 3;\nconst highp float NAN_MAGIC_NUMBER = 1e-30;\nconst int BITSET_GENERIC_LOCK_COLOR = 1;\nconst int BITSET_MARKER_ALIGNMENT_MAP = 0;\nconst int BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE = 2;\nconst int BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY = 3;\nconst int BITSET_TYPE_FILL_OUTLINE = 0;\nconst int BITSET_LINE_SCALE_DASH = 2;",fill:{"common.glsl":"#ifdef PATTERN\nuniform mediump vec2 u_mosaicSize;\n#endif\n#ifdef DOT_DENSITY\nuniform lowp vec4 u_isActive[ 2 ];\nuniform highp float u_dotValue;\nuniform highp float u_tileDotsOverArea;\nuniform highp float u_dotTextureDotCount;\nuniform mediump float u_tileZoomFactor;\n#endif\nvarying highp vec3 v_id;\nvarying lowp vec4 v_color;\nvarying lowp float v_opacity;\nvarying mediump vec4 v_aux1;\n#ifdef PATTERN\nvarying mediump vec2 v_tileTextureCoord;\n#endif\n#ifdef OUTLINED_FILL\nvarying lowp float v_isOutline;\n#endif\n#ifdef DOT_DENSITY\nvarying highp vec2 v_dotTextureCoords;\nvarying highp vec4 v_dotThresholds[ 2 ];\n#endif","fill.frag":"precision highp float;\n#include <materials/constants.glsl>\n#include <materials/utils.glsl>\n#include <materials/fill/common.glsl>\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\n#endif\n#ifdef DOT_DENSITY\nuniform mediump mat4 u_dotColors[ 2 ];\nuniform sampler2D u_dotTextures[ 2 ];\nuniform vec4 u_dotBackgroundColor;\n#endif\n#ifdef OUTLINED_FILL\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.frag>\nlowp vec4 drawLine() {\nfloat v_lineWidth = v_aux1.x;\nvec2  v_normal    = v_aux1.yz;\nLineData inputs = LineData(\nv_color,\nv_normal,\nv_lineWidth,\nv_opacity,\nv_id\n);\nreturn shadeLine(inputs);\n}\n#endif\nlowp vec4 drawFill() {\nlowp vec4 out_color = vec4(0.);\n#ifdef HITTEST\nout_color = vec4(1.0, 0.0, 0.0, 0.0);\n#elif defined(PATTERN)\nmediump vec4 v_tlbr = v_aux1;\nmediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\nout_color = v_opacity * v_color * color;\n#elif defined(DOT_DENSITY) && !defined(HIGHLIGHT)\nvec4 textureThresholds0 = texture2D(u_dotTextures[0], v_dotTextureCoords);\nvec4 textureThresholds1 = texture2D(u_dotTextures[1], v_dotTextureCoords);\nvec4 difference0 = v_dotThresholds[0] - textureThresholds0;\nvec4 difference1 = v_dotThresholds[1] - textureThresholds1;\n#ifdef DD_DOT_BLENDING\nvec4 isPositive0 = step(0.0, difference0);\nvec4 isPositive1 = step(0.0, difference1);\nfloat weightSum = dot(isPositive0, difference0) + dot(isPositive1, difference1);\nfloat lessThanEqZero = step(weightSum, 0.0);\nfloat greaterThanZero = 1.0 - lessThanEqZero ;\nfloat divisor = (weightSum + lessThanEqZero);\nvec4 weights0 = difference0 * isPositive0 / divisor;\nvec4 weights1 = difference1 * isPositive1 / divisor;\nvec4 dotColor = u_dotColors[0] * weights0 + u_dotColors[1] * weights1;\nvec4 preEffectColor = greaterThanZero * dotColor + lessThanEqZero * u_dotBackgroundColor;\n#else\nfloat diffMax = max(max4(difference0), max4(difference1));\nfloat lessThanZero = step(diffMax, 0.0);\nfloat greaterOrEqZero = 1.0 - lessThanZero;\nvec4 isMax0 = step(diffMax, difference0);\nvec4 isMax1 = step(diffMax, difference1);\nvec4 dotColor = u_dotColors[0] * isMax0 + u_dotColors[1] * isMax1;\nvec4 preEffectColor = greaterOrEqZero * dotColor + lessThanZero * u_dotBackgroundColor;\n#endif\nout_color = preEffectColor;\n#else\nout_color = v_opacity * v_color;\n#endif\n#ifdef HIGHLIGHT\nout_color.a = 1.0;\n#endif\nreturn out_color;\n}\nvoid main() {\n#ifdef OUTLINED_FILL\nif (v_isOutline > 0.5) {\ngl_FragColor = drawLine();\n} else {\ngl_FragColor = drawFill();\n}\n#else\ngl_FragColor = drawFill();\n#endif\n}","fill.vert":"#define PACKED_LINE\nprecision highp float;\nattribute float a_bitset;\n#ifdef DOT_DENSITY\nattribute float a_inverseArea;\nvec4 a_color = vec4(0.0, 0.0, 0.0, 1.0);\nvec2 a_zoomRange = vec2(0.0, 10000.0);\n#else\nattribute vec4 a_color;\nattribute vec4 a_aux2;\nattribute vec4 a_aux3;\n#ifndef SIMPLE\nattribute vec4 a_aux1;\nattribute vec2 a_zoomRange;\n#else\nvec2 a_zoomRange = vec2(0.0, 10000.0);\n#endif\n#endif\nuniform vec2 u_tileOffset;\n#include <materials/vcommon.glsl>\n#include <materials/fill/common.glsl>\n#include <materials/fill/hittest.glsl>\n#ifdef DOT_DENSITY\nvec4 dotThreshold(vec4 featureAttrOverFeatureArea, float dotValue, float tileDotsOverArea) {\nreturn featureAttrOverFeatureArea * (1.0 / dotValue)  * (1.0 / tileDotsOverArea);\n}\n#endif\n#ifdef OUTLINED_FILL\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.vert>\nvoid drawLine(out lowp vec4 out_color, out highp vec3 out_pos) {\nLineData outputs = buildLine(\nout_pos,\na_id,\na_pos,\na_color,\n(a_aux3.xy - 128.) / 16.,\n(a_aux3.zw - 128.) / 16.,\n0.,\na_aux2.z / 16.,\na_bitset,\nvec4(0.),\nvec2(0.),\na_aux2.w / 16.\n);\nv_id      = outputs.id;\nv_color   = outputs.color;\nv_opacity = outputs.opacity;\nv_aux1    = vec4(outputs.lineHalfWidth, outputs.normal, 0.);\nout_color = outputs.color;\n}\n#endif\nvoid drawFill(out lowp vec4 out_color, out highp vec3 out_pos) {\nfloat a_bitSet = a_bitset;\nv_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR);\nv_opacity = getOpacity();\nv_id      = norm(a_id);\nout_color = v_color;\n#ifdef DOT_DENSITY\nmat3 tileToTileNormalized = mat3(  2. / 512.,  0.,  0.,\n0., -2. / 512.,  0.,\n-1.,  1.,  1.  );\nout_pos   = tileToTileNormalized * vec3((a_pos * FILL_POSITION_PRECISION), 1.);\n#else\nout_pos   = u_dvsMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.);\n#endif\n#ifdef PATTERN\nvec4  a_tlbr   = a_aux1;\nfloat a_width  = a_aux2.x;\nfloat a_height = a_aux2.y;\nvec2  a_offset = a_aux2.zw;\nvec2  a_scale  = a_aux3.xy;\nfloat a_angle  = a_aux3.z;\nvec2 scale = (1.0 / SIGNED_BYTE_TO_UNSIGNED) * a_scale;\nfloat width = u_pixelRatio * u_zoomFactor * a_width * scale.x;\nfloat height = u_pixelRatio * u_zoomFactor * a_height * scale.y;\nfloat angle = C_256_TO_RAD * a_angle;\nfloat sinA = sin(angle);\nfloat cosA = cos(angle);\nmat3 patternMatrix = mat3(cosA / width, sinA / height, 0,\n-sinA / width, cosA / height, 0,\n0,            0,             1);\nvec2 tileOffset = vec2(u_tileOffset.x * cosA - u_tileOffset.y * sinA, u_tileOffset.x * sinA + u_tileOffset.y * cosA);\ntileOffset = mod(tileOffset, vec2(a_aux2.x, a_aux2.y));\nvec2 symbolOffset = (a_offset - tileOffset - SIGNED_BYTE_TO_UNSIGNED) / vec2(width, height);\nv_tileTextureCoord = (patternMatrix * vec3(a_pos * FILL_POSITION_PRECISION, 1.0)).xy - symbolOffset;\nv_aux1 = a_tlbr / u_mosaicSize.xyxy;\n#elif defined(DOT_DENSITY)\nvec4 ddAttributeData0 = getAttributeData2(a_id) * u_isActive[0] * a_inverseArea;\nvec4 ddAttributeData1 = getAttributeData3(a_id) * u_isActive[1] * a_inverseArea;\nfloat size = u_tileZoomFactor * 512.0 * 1.0 / u_pixelRatio;\nv_dotThresholds[0] = dotThreshold(ddAttributeData0, u_dotValue, u_tileDotsOverArea);\nv_dotThresholds[1] = dotThreshold(ddAttributeData1, u_dotValue, u_tileDotsOverArea);\nv_dotTextureCoords = (a_pos * FILL_POSITION_PRECISION + 0.5) / size;\n#endif\n}\n#ifdef HITTEST\nvoid draw(out lowp vec4 out_color, out highp vec3 out_pos) {\n#ifdef OUTLINED_FILL\nif (getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE) > 0.5) {\nout_pos = vec3(0., 0., 2.);\nreturn;\n}\n#endif\nout_pos = hittestFill();\ngl_PointSize = 1.0;\n}\n#elif defined(OUTLINED_FILL)\nvoid draw(out lowp vec4 out_color, out highp vec3 out_pos) {\nv_isOutline = getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE);\nif (v_isOutline > 0.5) {\ndrawLine(out_color, out_pos);\n} else {\ndrawFill(out_color, out_pos);\n}\n}\n#else\n#define draw drawFill\n#endif\nvoid main()\n{\nINIT;\nlowp vec4 color = vec4(0.);\nhighp vec3 pos  = vec3(0.);\ndraw(color, pos);\ngl_Position = vec4(clip(color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}","hittest.glsl":"#include <materials/hittest/common.glsl>\n#ifdef HITTEST\nattribute vec2 a_pos1;\nattribute vec2 a_pos2;\nbool hasSameSide(vec3 p0, vec3 p1, vec3 a, vec3 b) {\nvec3 cp0 = cross(b - a, p0 - a);\nvec3 cp1 = cross(b - a, p1 - a);\nreturn dot(cp0, cp1) >= 0.;\n}\nbool intersectPointTriangle(vec3 p, vec3 a, vec3 b, vec3 c) {\nreturn hasSameSide(p, a, b, c) && hasSameSide(p, b, a, c) && hasSameSide(p, c, a, b);\n}\nbool intersectCircleTriange(vec3 p, vec3 a, vec3 b, vec3 c, float radius) {\nvec2 ba = b.xy - a.xy;\nvec2 ca = c.xy - a.xy;\nbool isParallel = ba.x * ca.y - ca.x * ba.y == 0.;\nif (isParallel) {\nreturn false;\n}\nif (distance(p, a) <= radius) {\nreturn true;\n}\nif (distance(p, b) <= radius) {\nreturn true;\n}\nif (distance(p, c) <= radius) {\nreturn true;\n}\nvec3 p0 = p - normalize(p - a) * radius;\nif (intersectPointTriangle(p0, a, b, c)) {\nreturn true;\n}\nvec3 p1 = p - normalize(p - b) * radius;\nif (intersectPointTriangle(p1, a, b, c)) {\nreturn true;\n}\nvec3 p2 = p - normalize(p - c) * radius;\nreturn intersectPointTriangle(p2, a, b, c);\n}\nvec3 hittestFill() {\nvec3 pos        = u_viewMat3 * u_tileMat3 * vec3(a_pos  * FILL_POSITION_PRECISION, 1.);\nvec3 pos1       = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * FILL_POSITION_PRECISION, 1.);\nvec3 pos2       = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * FILL_POSITION_PRECISION, 1.);\nvec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0);\nvec3  hittestPos = vec3(u_hittestPos, 1.);\nfloat hittestDist = u_hittestDist;\nif (!intersectCircleTriange(hittestPos, pos, pos1, pos2, hittestDist)) {\noutTextureCoords.z += 2.0;\n}\nreturn outTextureCoords;\n}\n#endif"},hittest:{"common.glsl":"#ifdef HITTEST\nuniform float u_hittestDist;\nuniform highp vec2 u_hittestPos;\n#endif"},icon:{"common.glsl":"uniform lowp vec2 u_mosaicSize;\nvarying lowp vec4 v_color;\nvarying highp vec3 v_id;\nvarying highp vec4 v_sizeTex;\nvarying mediump vec3 v_pos;\nvarying highp float v_filters;\nvarying lowp float v_opacity;\n#ifdef SDF\nvarying lowp vec4 v_outlineColor;\nvarying mediump float v_outlineWidth;\nvarying mediump float v_distRatio;\nvarying mediump float v_overridingOutlineColor;\nvarying mediump float v_isThin;\n#endif","hittest.glsl":"#include <materials/hittest/common.glsl>\n#ifdef HITTEST\nvec3 hittestMarker(vec2 size) {\nvec3 pos        = u_viewMat3 * u_tileMat3 * vec3(a_pos  * POSITION_PRECISION, 1.);\nvec3  hittestPos = vec3(u_hittestPos, 1.);\nfloat hittestDist = u_hittestDist;\nvec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0);\nfloat maxHalfSize = max(size.x, size.y) / 2.;\nif (distance(pos, hittestPos) - maxHalfSize > hittestDist) {\noutTextureCoords.z += 2.0;\n}\nreturn outTextureCoords;\n}\n#endif","icon.frag":"precision mediump float;\n#include <materials/constants.glsl>\n#include <materials/utils.glsl>\n#include <util/encoding.glsl>\n#include <materials/constants.glsl>\n#include <materials/icon/common.glsl>\nuniform lowp sampler2D u_texture;\n#ifdef HITTEST\nvec4 getColor() {\nreturn vec4(1.);\n}\n#elif defined(SDF)\nvec4 getColor() {\nvec2 v_size = v_sizeTex.xy;\nvec2 v_tex  = v_sizeTex.zw;\nlowp vec4 fillPixelColor = v_color;\nfloat d = 0.5 - rgba2float(texture2D(u_texture, v_tex));\nfloat size = max(v_size.x, v_size.y);\nfloat dist = d * size * SOFT_EDGE_RATIO * v_distRatio;\nfillPixelColor *= clamp(0.5 - dist, 0.0, 1.0);\nfloat outlineWidth = v_outlineWidth;\n#ifdef HIGHLIGHT\noutlineWidth = max(outlineWidth, 4.0 * v_isThin);\n#endif\nif (outlineWidth > 0.25) {\nlowp vec4 outlinePixelColor = v_overridingOutlineColor * v_color + (1.0 - v_overridingOutlineColor) * v_outlineColor;\nfloat clampedOutlineSize = min(outlineWidth, size);\noutlinePixelColor *= clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0);\nreturn v_opacity * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor);\n}\nreturn v_opacity * fillPixelColor;\n}\n#else\nvec4 getColor() {\nvec2 v_tex  = v_sizeTex.zw;\nlowp vec4 texColor = texture2D(u_texture, v_tex);\nreturn v_opacity * texColor * v_color;\n}\n#endif\nvoid main()\n{\nvec4 color = getColor();\n#ifdef HIGHLIGHT\ncolor.a = step(1.0 / 255.0, color.a);\n#endif\ngl_FragColor = color;\n}","icon.vert":"precision highp float;\nattribute vec4 a_color;\nattribute vec4 a_outlineColor;\nattribute vec4 a_sizeAndOutlineWidth;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nattribute vec2 a_bitSetAndDistRatio;\nattribute vec2 a_zoomRange;\n#include <materials/vcommon.glsl>\n#include <materials/icon/common.glsl>\n#include <materials/icon/hittest.glsl>\nvec2 getMarkerSize(inout vec2 offset, inout vec2 baseSize, inout float outlineSize, in float referenceSize, in float bitSet) {\nvec2 outSize = baseSize;\n#ifdef VV_SIZE\nfloat r = getSize(referenceSize) / referenceSize;\noutSize.xy *= r;\noffset.xy *= r;\nfloat scaleSymbolProportionally = getBit(bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY);\noutlineSize *= scaleSymbolProportionally * (r - 1.0) + 1.0;\n#endif\nreturn outSize;\n}\nvec3 getOffset(in vec2 in_offset, float a_bitSet) {\nfloat isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP);\nvec3  offset       = getRotation() * vec3(in_offset, 0.0);\nreturn getMatrix(isMapAligned) * offset;\n}\nvoid main()\n{\nINIT;\nvec2  a_size   = a_sizeAndOutlineWidth.xy * a_sizeAndOutlineWidth.xy / 128.0;\nvec2  a_offset = a_vertexOffset / 16.0;\nfloat a_outlineSize = a_sizeAndOutlineWidth.z * a_sizeAndOutlineWidth.z / 128.0;\nfloat a_bitSet = a_bitSetAndDistRatio.x;\nvec2 v_size = getMarkerSize(a_offset, a_size, a_outlineSize, a_sizeAndOutlineWidth.w * a_sizeAndOutlineWidth.w / 128.0, a_bitSet);\nvec2 v_tex      = a_texCoords / u_mosaicSize;\nv_color    = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR);\nv_opacity  = getOpacity();\nv_id       = norm(a_id);\nv_filters  = getFilterFlags();\nv_pos      = u_dvsMat3 * vec3(a_pos * POSITION_PRECISION, 1.0) + getOffset(a_offset, a_bitSet);\nv_sizeTex  = vec4(v_size.xy, v_tex.xy);\n#ifdef SDF\nv_isThin   = getBit(a_bitSet, BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE);\n#ifdef VV_COLOR\nv_overridingOutlineColor = v_isThin;\n#else\nv_overridingOutlineColor = 0.0;\n#endif\nv_outlineWidth = min(a_outlineSize, max(max(v_size.x, v_size.y) - 0.99, 0.0));\nv_outlineColor = a_outlineColor;\nv_distRatio = a_bitSetAndDistRatio.y / 126.0;\n#endif\n#ifdef HITTEST\nvec3 pos = hittestMarker(v_size.xy);\ngl_PointSize = 1.;\ngl_Position = vec4(clip(v_color, pos, v_filters, a_zoomRange), 1.0);\n#else\ngl_Position = vec4(clip(v_color, v_pos, v_filters, a_zoomRange), 1.0);\n#endif\n}"},label:{"common.glsl":"uniform mediump float u_zoomLevel;\nuniform mediump float u_mapRotation;\nuniform mediump float u_mapAligned;\nuniform mediump vec2 u_mosaicSize;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying mediump vec2 v_tex;\nvarying mediump vec4 v_color;\nvarying lowp vec4 v_animation;","label.frag":"#include <materials/text/text.frag>","label.vert":"precision highp float;\n#include <materials/vcommon.glsl>\n#include <materials/text/common.glsl>\nattribute vec4 a_color;\nattribute vec4 a_haloColor;\nattribute vec4 a_texAndSize;\nattribute vec4 a_refSymbolAndPlacementOffset;\nattribute vec4 a_glyphData;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nuniform float u_isHalo;\nuniform float u_mapRotation;\nuniform float u_mapAligned;\nfloat getZ(in float minZoom, in float maxZoom, in float angle) {\nfloat glyphAngle = angle * 360.0 / 254.0;\nfloat mapAngle = u_mapRotation * 360.0 / 254.0;\nfloat diffAngle = min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle));\nfloat z = 0.0;\nz += u_mapAligned * (2.0 * (1.0 - step(minZoom, u_currentZoom)));\nz += u_mapAligned * 2.0 * step(90.0, diffAngle);\nz += 2.0 * (1.0 - step(u_currentZoom, maxZoom));\nreturn z;\n}\nvoid main()\n{\nINIT;\nfloat groupMinZoom    = getMinZoom();\nfloat glyphMinZoom    = a_glyphData.x;\nfloat glyphMaxZoom    = a_glyphData.y;\nfloat glyphAngle      = a_glyphData.z;\nfloat a_minZoom          = max(groupMinZoom, glyphMinZoom);\nfloat a_placementPadding = a_refSymbolAndPlacementOffset.x * EXTRUDE_SCALE_PLACEMENT_PADDING;\nvec2  a_placementDir     = unpack_u8_nf32(a_refSymbolAndPlacementOffset.zw);\nfloat a_refSymbolSize    = a_refSymbolAndPlacementOffset.y;\nfloat fontSize           = a_texAndSize.z;\nfloat haloSize           = a_texAndSize.w * OUTLINE_SCALE;\nvec2  vertexOffset = a_vertexOffset * OFFSET_PRECISION;\nvec3  pos          = vec3(a_pos * POSITION_PRECISION, 1.0);\nfloat z            = getZ(a_minZoom, glyphMaxZoom, glyphAngle);\nfloat fontScale    = fontSize / SDF_FONT_SIZE;\nfloat halfSize     = getSize(a_refSymbolSize) / 2.0;\nfloat animation    = pow(getAnimationState(), vec4(2.0)).r;\nv_color     = animation * ((1.0 - u_isHalo) * a_color + (u_isHalo * a_haloColor));\nv_opacity   = 1.0;\nv_tex       = a_texCoords / u_mosaicSize;\nv_edgeDistanceOffset = u_isHalo * haloSize / fontScale / MAX_SDF_DISTANCE;\nv_antialiasingWidth  = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio;\nvec2 placementOffset = a_placementDir * (halfSize + a_placementPadding);\nvec3 glyphOffset     = u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0);\nvec3 v_pos           = vec3((u_dvsMat3 * pos + glyphOffset).xy, z);\ngl_Position = vec4(v_pos, 1.0);\n#ifdef DEBUG\nv_color = vec4(a_color.rgb, z == 0.0 ? 1.0 : 0.645);\n#endif\n}"},line:{"common.glsl":"varying lowp vec4 v_color;\nvarying highp vec3 v_id;\nvarying mediump vec2 v_normal;\nvarying mediump float v_lineHalfWidth;\nvarying lowp float v_opacity;\n#ifdef PATTERN\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\n#endif\n#if defined(PATTERN) || defined(SDF)\nvarying highp float v_accumulatedDistance;\n#endif\n#ifdef SDF\nvarying mediump float v_lineWidthRatio;\n#endif","hittest.glsl":"#include <materials/hittest/common.glsl>\n#ifdef HITTEST\nattribute vec2 a_pos1;\nattribute vec2 a_pos2;\nbool intersectCircleLineInner(vec3 p, vec3 a, vec3 b, float radius) {\nvec3 v0 = a - p;\nvec3 b2 = b - p;\nvec3 v  = b2 - v0;\nfloat D = 4. * dot(v0, v) * dot(v0, v) - 4. * dot(v, v) * ( dot(v0, v0) - radius * radius );\nif (D < 0.) {\nreturn false;\n}\nfloat sqrtD = sqrt(D);\nfloat t0 = (-2. * dot(v0, v) + sqrtD) / (2. * dot(v, v));\nfloat t1 = (-2. * dot(v0, v) - sqrtD) / (2. * dot(v, v));\nreturn ((t0 >= 0. && t0 <= 1.) || (t1 >= 0. && t1 <= 1.));\n}\nbool intersectCircleLine(vec3 p, vec3 a, vec3 b, vec3 c, float radius) {\nreturn intersectCircleLineInner(p, a, b, radius) || intersectCircleLineInner(p, b, c, radius);\n}\nvec3 hittestLine(float halfWidth) {\nvec3 pos        = u_viewMat3 * u_tileMat3 * vec3(a_pos  * POSITION_PRECISION, 1.);\nvec3 pos1       = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * POSITION_PRECISION, 1.);\nvec3 pos2       = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * POSITION_PRECISION, 1.);\nvec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0);\nvec3  hittestPos = vec3(u_hittestPos, 1.);\nfloat hittestDist = u_hittestDist;\nif (!intersectCircleLine(hittestPos, pos, pos1, pos2, hittestDist + halfWidth)) {\noutTextureCoords.z += 2.0;\n}\nreturn outTextureCoords;\n}\n#endif","line.frag":"precision lowp float;\n#include <util/encoding.glsl>\n#include <materials/constants.glsl>\n#include <materials/line/common.glsl>\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.frag>\n#ifdef HITTEST\nvoid main() {\ngl_FragColor = vec4(1.);\n}\n#else\nvoid main() {\nLineData inputs = LineData(\nv_color,\nv_normal,\nv_lineHalfWidth,\nv_opacity,\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nv_tlbr,\nv_patternSize,\n#endif\n#ifdef SDF\nv_lineWidthRatio,\n#endif\n#if defined(PATTERN) || defined(SDF)\nv_accumulatedDistance,\n#endif\n#endif\nv_id\n);\ngl_FragColor = shadeLine(inputs);\n}\n#endif","line.vert":"precision highp float;\nattribute vec4 a_color;\nattribute vec4 a_offsetAndNormal;\nattribute vec2 a_accumulatedDistanceAndHalfWidth;\nattribute vec4 a_tlbr;\nattribute vec4 a_segmentDirection;\nattribute vec2 a_aux;\nattribute vec2 a_zoomRange;\n#include <materials/vcommon.glsl>\n#include <materials/line/common.glsl>\n#include <materials/line/hittest.glsl>\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.vert>\n#ifdef HITTEST\nvoid draw() {\nfloat aa        = 0.5 * u_antialiasing;\nfloat a_halfWidth = a_accumulatedDistanceAndHalfWidth.y / 16.;\nfloat a_cimHalfWidth = a_aux.x / 16. ;\nvec2  a_offset = a_offsetAndNormal.xy / 16.;\nfloat baseWidth = getBaseLineHalfWidth(a_halfWidth, a_cimHalfWidth);\nfloat halfWidth = getLineHalfWidth(baseWidth, aa);\ngl_PointSize = 1.;\nvec3 pos = hittestLine(halfWidth);\ngl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}\n#else\nvoid draw()\n{\nhighp vec3 pos = vec3(0.);\nLineData outputs = buildLine(\npos,\na_id,\na_pos,\na_color,\na_offsetAndNormal.xy / 16.,\na_offsetAndNormal.zw / 16.,\na_accumulatedDistanceAndHalfWidth.x,\na_accumulatedDistanceAndHalfWidth.y / 16.,\na_segmentDirection.w,\na_tlbr,\na_segmentDirection.xy / 16.,\na_aux.x / 16.\n);\nv_id              = outputs.id;\nv_color           = outputs.color;\nv_normal          = outputs.normal;\nv_lineHalfWidth   = outputs.lineHalfWidth;\nv_opacity         = outputs.opacity;\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nv_tlbr          = outputs.tlbr;\nv_patternSize   = outputs.patternSize;\n#endif\n#ifdef SDF\nv_lineWidthRatio = outputs.lineWidthRatio;\n#endif\n#if defined(PATTERN) || defined(SDF)\nv_accumulatedDistance = outputs.accumulatedDistance;\n#endif\n#endif\ngl_Position = vec4(clip(outputs.color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}\n#endif\nvoid main() {\nINIT;\ndraw();\n}"},shared:{line:{"common.glsl":"#if !defined(OUTLINED_FILL) && defined(PATTERN)\nuniform mediump vec2 u_mosaicSize;\n#endif\nstruct LineData {\nlowp vec4 color;\nmediump vec2 normal;\nmediump float lineHalfWidth;\nlowp float opacity;\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nmediump vec4 tlbr;\nmediump vec2 patternSize;\n#endif\n#ifdef SDF\nmediump float lineWidthRatio;\n#endif\n#if defined(PATTERN) || defined(SDF)\nhighp float accumulatedDistance;\n#endif\n#endif\nhighp vec3 id;\n};","line.frag":"uniform lowp float u_blur;\n#if !defined(OUTLINED_FILL) && !defined(HIGHLIGHT)\n#if defined(PATTERN) || defined(SDF)\nuniform sampler2D u_texture;\nuniform highp float u_pixelRatio;\n#endif\n#endif\n#if defined(SDF) && !defined(HIGHLIGHT) && !defined(OUTLINED_FILL)\nlowp vec4 getLineColor(LineData line) {\nmediump float adjustedPatternWidth = line.patternSize.x * 2.0 * line.lineWidthRatio;\nmediump float relativeTexX = fract(u_pixelRatio * line.accumulatedDistance / adjustedPatternWidth);\nmediump float relativeTexY = 0.5 + 0.25 * line.normal.y;\nmediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist = d * line.lineHalfWidth;\nreturn line.opacity * clamp(0.5 - dist, 0.0, 1.0) * line.color;\n}\n#elif defined(PATTERN) && !defined(HIGHLIGHT) && !defined(OUTLINED_FILL)\nlowp vec4 getLineColor(LineData line) {\nmediump float lineHalfWidth = line.lineHalfWidth;\nmediump float adjustedPatternWidth = line.patternSize.x * 2.0 * lineHalfWidth / line.patternSize.y;\nmediump float relativeTexX = fract(u_pixelRatio * line.accumulatedDistance / adjustedPatternWidth);\nmediump float relativeTexY = 0.5 + 0.5 * line.normal.y;\nmediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexY, relativeTexX));\nlowp vec4 color = texture2D(u_texture, texCoord);\nreturn line.opacity * line.color * color;\n}\n#else\nlowp vec4 getLineColor(LineData line) {\nreturn line.opacity * line.color;\n}\n#endif\nvec4 shadeLine(LineData line)\n{\nmediump float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(line.lineHalfWidth, THIN_LINE_HALF_WIDTH), 1.0);\nmediump float fragDist = length(line.normal) * line.lineHalfWidth;\nlowp float alpha = clamp(thinLineFactor * (line.lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0);\nlowp vec4 out_color = getLineColor(line) * alpha;\n#ifdef HIGHLIGHT\nout_color.a = step(1.0 / 255.0, out_color.a);\n#endif\n#ifdef ID\nif (out_color.a < 1.0 / 255.0) {\ndiscard;\n}\nout_color = vec4(line.id, 0.0);\n#endif\nreturn out_color;\n}","line.vert":"float getBaseLineHalfWidth(in float lineHalfWidth, in float referenceHalfWidth) {\n#ifdef VV_SIZE\nfloat refLineWidth = 2.0 * referenceHalfWidth;\nreturn 0.5 * (lineHalfWidth / referenceHalfWidth) * getSize(refLineWidth);\n#else\nreturn lineHalfWidth;\n#endif\n}\nfloat getLineHalfWidth(in float baseWidth, in float aa) {\nfloat halfWidth = max(baseWidth + aa, 0.45) + 0.1 * aa;\n#ifdef HIGHLIGHT\nhalfWidth = max(halfWidth, 2.0);\n#endif\nreturn halfWidth;\n}\nvec2 getDist(in vec2 offset, in float halfWidth) {\nfloat thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(halfWidth, THIN_LINE_HALF_WIDTH), 1.0);\nreturn thinLineFactor * halfWidth * offset;\n}\nLineData buildLine(\nout vec3 out_pos,\nin vec3 in_id,\nin vec2 in_pos,\nin vec4 in_color,\nin vec2 in_offset,\nin vec2 in_normal,\nin float in_accumulatedDist,\nin float in_lineHalfWidth,\nin float in_bitSet,\nin vec4 in_tlbr,\nin vec2 in_segmentDirection,\nin float in_referenceHalfWidth\n)\n{\nfloat aa        = 0.5 * u_antialiasing;\nfloat baseWidth = getBaseLineHalfWidth(in_lineHalfWidth, in_referenceHalfWidth);\nfloat halfWidth = getLineHalfWidth(baseWidth, aa);\nfloat z         = 2.0 * step(baseWidth, 0.0);\nvec2  dist      = getDist(in_offset, halfWidth);\nvec3  offset    = u_displayViewMat3 * vec3(dist, 0.0);\nvec3  pos       = u_dvsMat3 * vec3(in_pos * POSITION_PRECISION, 1.0) + offset;\n#ifdef OUTLINED_FILL\nvec4  color     = in_color;\nfloat opacity   = 1.0;\n#else\nvec4  color     = getColor(in_color, in_bitSet, 0);\nfloat opacity   = getOpacity();\n#ifdef SDF\nconst float SDF_PATTERN_HALF_WIDTH = 15.5;\nfloat scaleDash = getBit(in_bitSet, BITSET_LINE_SCALE_DASH);\nfloat lineWidthRatio = (scaleDash * max(halfWidth - 0.55 * u_antialiasing, 0.25) + (1.0 - scaleDash)) / SDF_PATTERN_HALF_WIDTH;\n#endif\n#endif\nout_pos = vec3(pos.xy, z);\nreturn LineData(\ncolor,\nin_normal,\nhalfWidth,\nopacity,\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nin_tlbr / u_mosaicSize.xyxy,\nvec2(in_tlbr.z - in_tlbr.x, in_tlbr.w - in_tlbr.y),\n#endif\n#ifdef SDF\nlineWidthRatio,\n#endif\n#if defined(PATTERN) || defined(SDF)\nin_accumulatedDist * u_zoomFactor + dot(in_segmentDirection, dist),\n#endif\n#endif\nnorm(in_id)\n);\n}"}},text:{"common.glsl":"uniform highp vec2 u_mosaicSize;\nvarying highp vec3 v_id;\nvarying mediump vec3 v_pos;\nvarying lowp float v_opacity;\nvarying lowp vec4 v_color;\nvarying highp vec2 v_tex;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying lowp float v_transparency;","hittest.glsl":"#include <materials/hittest/common.glsl>\n#ifdef HITTEST\nvec3 hittestGlyph(in vec3 in_pos, in vec3 offset, in float fontSize) {\nvec3 pos        = u_viewMat3 * u_tileMat3 * in_pos + u_tileMat3 * offset;\nvec3  hittestPos = vec3(u_hittestPos, 1.);\nfloat hittestDist = u_hittestDist;\nvec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0);\nfloat halfFontSize = fontSize / 2.;\nif (distance(pos, hittestPos) > hittestDist + halfFontSize) {\noutTextureCoords.z += 2.0;\n}\nreturn outTextureCoords;\n}\n#endif","text.frag":"precision mediump float;\n#include <materials/text/common.glsl>\nuniform lowp sampler2D u_texture;\n#ifdef HITTEST\nvec4 getColor() {\nreturn vec4(1.);\n}\n#else\nvec4 getColor()\n{\nfloat SDF_CUTOFF = (2.0 / 8.0);\nfloat SDF_BASE_EDGE_DIST = 1.0 - SDF_CUTOFF;\nlowp float dist = texture2D(u_texture, v_tex).a;\nmediump float edge = SDF_BASE_EDGE_DIST - v_edgeDistanceOffset;\n#ifdef HIGHLIGHT\nedge /= 2.0;\n#endif\nlowp float aa = v_antialiasingWidth;\nlowp float alpha = smoothstep(edge - aa, edge + aa, dist);\nreturn alpha * v_color * v_opacity;\n}\n#endif\nvoid main()\n{\ngl_FragColor = getColor();\n}","text.vert":"precision highp float;\n#include <materials/utils.glsl>\n#include <materials/vcommon.glsl>\n#include <materials/text/common.glsl>\n#include <materials/text/hittest.glsl>\nattribute vec4 a_color;\nattribute vec4 a_haloColor;\nattribute vec4 a_texFontSize;\nattribute vec4 a_aux;\nattribute vec2 a_zoomRange;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nuniform float u_isHalo;\nfloat getTextSize(inout vec2 offset, inout float baseSize, in float referenceSize) {\n#ifdef VV_SIZE\nfloat r = getSize(referenceSize) / referenceSize;\nbaseSize *= r;\noffset.xy *= r;\nreturn baseSize;\n#endif\nreturn baseSize;\n}\nvoid main()\n{\nINIT;\nfloat a_referenceSize = a_aux.z * a_aux.z / 256.0;\nfloat a_bitSet        = a_aux.w;\nfloat a_fontSize      = a_texFontSize.z;\nvec2  a_offset        = a_vertexOffset * OFFSET_PRECISION;\nvec3  in_pos        = vec3(a_pos * POSITION_PRECISION, 1.0);\nfloat fontSize      = getTextSize(a_offset, a_fontSize, a_referenceSize);\nfloat fontScale     = fontSize / SDF_FONT_SIZE;\nvec3  offset        = getRotation() * vec3(a_offset, 0.0);\nmat3  extrudeMatrix = getBit(a_bitSet, 0) == 1.0 ? u_displayViewMat3 : u_displayMat3;\nv_color   = u_isHalo * a_haloColor + (1.0 - u_isHalo) * getColor(a_color, a_bitSet, 1);\nv_opacity = getOpacity();\nv_id      = norm(a_id);\nv_tex     = a_texCoords / u_mosaicSize;\nv_pos     = u_dvsMat3 * in_pos + extrudeMatrix * offset;\nv_edgeDistanceOffset = u_isHalo * OUTLINE_SCALE * a_texFontSize.w / fontScale / MAX_SDF_DISTANCE;\nv_antialiasingWidth  = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio;\n#ifdef HITTEST\nvec3 pos = hittestGlyph(in_pos, offset, fontSize);\ngl_PointSize = 1.;\ngl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0);\n#else\ngl_Position =  vec4(clip(v_color, v_pos, getFilterFlags(), a_zoomRange), 1.0);\n#endif\n}"},"utils.glsl":"float rshift(in float u32, in int amount) {\nreturn floor(u32 / pow(2.0, float(amount)));\n}\nfloat getBit(in float bitset, in int bitIndex) {\nfloat offset = pow(2.0, float(bitIndex));\nreturn mod(floor(bitset / offset), 2.0);\n}\nfloat getFilterBit(in float bitset, in int bitIndex) {\nreturn getBit(bitset, bitIndex + 1);\n}\nfloat getHighlightBit(in float bitset) {\nreturn getBit(bitset, 0);\n}\nhighp vec3 unpackDisplayIdTexel(in highp vec3 bitset) {\nfloat isAggregate = getBit(bitset.b, 7);\nreturn (1.0 - isAggregate) * bitset + isAggregate * (vec3(bitset.rgb) - vec3(0.0, 0.0, float(0x80)));\n}\nvec4 unpack(in float u32) {\nfloat r = mod(rshift(u32, 0), 255.0);\nfloat g = mod(rshift(u32, 8), 255.0);\nfloat b = mod(rshift(u32, 16), 255.0);\nfloat a = mod(rshift(u32, 24), 255.0);\nreturn vec4(r, g, b, a);\n}\nvec3 norm(in vec3 v) {\nreturn v /= 255.0;\n}\nvec4 norm(in vec4 v) {\nreturn v /= 255.0;\n}\nfloat max4(vec4 target) {\nreturn max(max(max(target.x, target.y), target.z), target.w);\n}\nvec2 unpack_u8_nf32(vec2 bytes) {\nreturn (bytes - 127.0) / 127.0;\n}","vcommon.glsl":"#include <materials/constants.glsl>\n#include <materials/utils.glsl>\n#include <materials/attributeData.glsl>\n#include <materials/vv.glsl>\nattribute vec2 a_pos;\nattribute highp vec3 a_id;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform highp mat3 u_tileMat3;\nuniform highp mat3 u_viewMat3;\nuniform highp float u_pixelRatio;\nuniform mediump float u_zoomFactor;\nuniform mediump float u_antialiasing;\nuniform mediump float u_currentZoom;\nvec4 VV_ADATA = vec4(0.0);\nvoid loadVisualVariableData(inout vec4 target) {\n#ifdef OES_TEXTURE_FLOAT\ntarget.rgba = getAttributeData2(a_id);\n#else\nvec4 data0 = getAttributeData2(a_id);\nvec4 data1 = getAttributeData3(a_id);\ntarget.r = u88VVToFloat(data0.rg * 255.0);\ntarget.g = u88VVToFloat(data0.ba * 255.0);\ntarget.b = u88VVToFloat(data1.rg * 255.0);\ntarget.a = u88VVToFloat(data1.ba * 255.0);\n#endif\n}\n#ifdef VV\n#define INIT loadVisualVariableData(VV_ADATA)\n#else\n#define INIT\n#endif\nvec4 getColor(in vec4 a_color, in float a_bitSet, int index) {\n#ifdef VV_COLOR\nfloat isColorLocked   = getBit(a_bitSet, index);\nreturn getVVColor(VV_ADATA[ATTR_VV_COLOR], a_color, isColorLocked);\n#else\nreturn a_color;\n#endif\n}\nfloat getOpacity() {\n#ifdef VV_OPACITY\nreturn getVVOpacity(VV_ADATA[ATTR_VV_OPACITY]);\n#else\nreturn 1.0;\n#endif\n}\nfloat getSize(in float in_size) {\n#ifdef VV_SIZE\nreturn getVVSize(in_size, VV_ADATA[ATTR_VV_SIZE]);\n#else\nreturn in_size;\n#endif\n}\nmat3 getRotation() {\n#ifdef VV_ROTATION\nreturn getVVRotationMat3(mod(VV_ADATA[ATTR_VV_ROTATION], 360.0));\n#else\nreturn mat3(1.0);\n#endif\n}\nfloat getFilterFlags() {\n#ifdef IGNORES_SAMPLER_PRECISION\nreturn ceil(getAttributeData0(a_id).x * 255.0);\n#else\nreturn getAttributeData0(a_id).x * 255.0;\n#endif\n}\nvec4 getAnimationState() {\nreturn getAttributeData1(a_id);\n}\nfloat getMinZoom() {\nvec4 data0 = getAttributeData0(a_id) * 255.0;\nreturn data0.g;\n}\nmat3 getMatrix(float isMapAligned) {\nreturn isMapAligned * u_displayViewMat3 + (1.0 - isMapAligned) * u_displayMat3;\n}\nvec3 clip(inout vec4 color, inout vec3 pos, in float filterFlags, in vec2 minMaxZoom) {\npos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 0));\n#ifdef INSIDE\npos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 1));\n#elif defined(OUTSIDE)\npos.z += 2.0 * getFilterBit(filterFlags, 1);\n#elif defined(HIGHLIGHT)\n#if !defined(HIGHLIGHT_ALL)\npos.z += 2.0 * (1.0 - getHighlightBit(filterFlags));\n#endif\n#endif\npos.z += 2.0 * (step(minMaxZoom.y, u_currentZoom) + (1.0 - step(minMaxZoom.x, u_currentZoom)));\nreturn pos;\n}","vv.glsl":"#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n#define VV_SIZE\n#endif\n#if defined(VV_COLOR) || defined(VV_SIZE) || defined(VV_OPACITY) || defined(VV_ROTATION)\n#define VV\n#endif\n#ifdef VV_COLOR\nuniform highp float u_vvColorValues[8];\nuniform vec4 u_vvColors[8];\n#endif\n#ifdef VV_SIZE_MIN_MAX_VALUE\nuniform highp vec4 u_vvSizeMinMaxValue;\n#endif\n#ifdef VV_SIZE_SCALE_STOPS\nuniform highp float u_vvSizeScaleStopsValue;\n#endif\n#ifdef VV_SIZE_FIELD_STOPS\nuniform highp float u_vvSizeFieldStopsValues[6];\nuniform float u_vvSizeFieldStopsSizes[6];\n#endif\n#ifdef VV_SIZE_UNIT_VALUE\nuniform highp float u_vvSizeUnitValueWorldToPixelsRatio;\n#endif\n#ifdef VV_OPACITY\nuniform highp float u_vvOpacityValues[8];\nuniform float u_vvOpacities[8];\n#endif\n#ifdef VV_ROTATION\nuniform lowp float u_vvRotationType;\n#endif\nbool isNan(float val) {\nreturn (val == NAN_MAGIC_NUMBER);\n}\n#ifdef VV_SIZE_MIN_MAX_VALUE\nfloat getVVMinMaxSize(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nfloat interpolationRatio = (sizeValue  - u_vvSizeMinMaxValue.x) / (u_vvSizeMinMaxValue.y - u_vvSizeMinMaxValue.x);\ninterpolationRatio = clamp(interpolationRatio, 0.0, 1.0);\nreturn u_vvSizeMinMaxValue.z + interpolationRatio * (u_vvSizeMinMaxValue.w - u_vvSizeMinMaxValue.z);\n}\n#endif\n#ifdef VV_SIZE_FIELD_STOPS\nconst int VV_SIZE_N = 6;\nfloat getVVStopsSize(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nif (sizeValue <= u_vvSizeFieldStopsValues[0]) {\nreturn u_vvSizeFieldStopsSizes[0];\n}\nfor (int i = 1; i < VV_SIZE_N; ++i) {\nif (u_vvSizeFieldStopsValues[i] >= sizeValue) {\nfloat f = (sizeValue - u_vvSizeFieldStopsValues[i-1]) / (u_vvSizeFieldStopsValues[i] - u_vvSizeFieldStopsValues[i-1]);\nreturn mix(u_vvSizeFieldStopsSizes[i-1], u_vvSizeFieldStopsSizes[i], f);\n}\n}\nreturn u_vvSizeFieldStopsSizes[VV_SIZE_N - 1];\n}\n#endif\n#ifdef VV_SIZE_UNIT_VALUE\nfloat getVVUnitValue(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nreturn u_vvSizeUnitValueWorldToPixelsRatio * sizeValue;\n}\n#endif\n#ifdef VV_OPACITY\nconst int VV_OPACITY_N = 8;\nfloat getVVOpacity(float opacityValue) {\nif (isNan(opacityValue)) {\nreturn 1.0;\n}\nif (opacityValue <= u_vvOpacityValues[0]) {\nreturn u_vvOpacities[0];\n}\nfor (int i = 1; i < VV_OPACITY_N; ++i) {\nif (u_vvOpacityValues[i] >= opacityValue) {\nfloat f = (opacityValue - u_vvOpacityValues[i-1]) / (u_vvOpacityValues[i] - u_vvOpacityValues[i-1]);\nreturn mix(u_vvOpacities[i-1], u_vvOpacities[i], f);\n}\n}\nreturn u_vvOpacities[VV_OPACITY_N - 1];\n}\n#endif\n#ifdef VV_ROTATION\nmat4 getVVRotation(float rotationValue) {\nif (isNan(rotationValue)) {\nreturn mat4(1, 0, 0, 0,\n0, 1, 0, 0,\n0, 0, 1, 0,\n0, 0, 0, 1);\n}\nfloat rotation = rotationValue;\nif (u_vvRotationType == 1.0) {\nrotation = 90.0 - rotation;\n}\nfloat angle = C_DEG_TO_RAD * rotation;\nfloat sinA = sin(angle);\nfloat cosA = cos(angle);\nreturn mat4(cosA, sinA, 0, 0,\n-sinA,  cosA, 0, 0,\n0,     0, 1, 0,\n0,     0, 0, 1);\n}\nmat3 getVVRotationMat3(float rotationValue) {\nif (isNan(rotationValue)) {\nreturn mat3(1, 0, 0,\n0, 1, 0,\n0, 0, 1);\n}\nfloat rotation = rotationValue;\nif (u_vvRotationType == 1.0) {\nrotation = 90.0 - rotation;\n}\nfloat angle = C_DEG_TO_RAD * -rotation;\nfloat sinA = sin(angle);\nfloat cosA = cos(angle);\nreturn mat3(cosA, -sinA, 0,\nsinA, cosA, 0,\n0,    0,    1);\n}\n#endif\n#ifdef VV_COLOR\nconst int VV_COLOR_N = 8;\nvec4 getVVColor(float colorValue, vec4 fallback, float isColorLocked) {\nif (isNan(colorValue) || isColorLocked == 1.0) {\nreturn fallback;\n}\nif (colorValue <= u_vvColorValues[0]) {\nreturn u_vvColors[0];\n}\nfor (int i = 1; i < VV_COLOR_N; ++i) {\nif (u_vvColorValues[i] >= colorValue) {\nfloat f = (colorValue - u_vvColorValues[i-1]) / (u_vvColorValues[i] - u_vvColorValues[i-1]);\nreturn mix(u_vvColors[i-1], u_vvColors[i], f);\n}\n}\nreturn u_vvColors[VV_COLOR_N - 1];\n}\n#endif\nfloat getVVSize(in float size, in float vvSize)  {\n#ifdef VV_SIZE_MIN_MAX_VALUE\nreturn getVVMinMaxSize(vvSize, size);\n#elif defined(VV_SIZE_SCALE_STOPS)\nreturn u_vvSizeScaleStopsValue;\n#elif defined(VV_SIZE_FIELD_STOPS)\nfloat outSize = getVVStopsSize(vvSize, size);\nreturn isNan(outSize) ? size : outSize;\n#elif defined(VV_SIZE_UNIT_VALUE)\nreturn getVVUnitValue(vvSize, size);\n#else\nreturn size;\n#endif\n}"},"post-processing":{blit:{"blit.frag":"precision mediump float;\nuniform sampler2D u_texture;\nvarying vec2 v_uv;\nvoid main() {\ngl_FragColor = texture2D(u_texture, v_uv);\n}"},bloom:{composite:{"composite.frag":"precision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_blurTexture1;\nuniform sampler2D u_blurTexture2;\nuniform sampler2D u_blurTexture3;\nuniform sampler2D u_blurTexture4;\nuniform sampler2D u_blurTexture5;\nuniform float u_bloomStrength;\nuniform float u_bloomRadius;\nuniform float u_bloomFactors[NUMMIPS];\nuniform vec3 u_bloomTintColors[NUMMIPS];\nfloat lerpBloomFactor(const in float factor) {\nfloat mirrorFactor = 1.2 - factor;\nreturn mix(factor, mirrorFactor, u_bloomRadius);\n}\nvoid main() {\ngl_FragColor = u_bloomStrength * (\nlerpBloomFactor(u_bloomFactors[0]) * vec4(u_bloomTintColors[0], 1.0) * texture2D(u_blurTexture1, v_uv) +\nlerpBloomFactor(u_bloomFactors[1]) * vec4(u_bloomTintColors[1], 1.0) * texture2D(u_blurTexture2, v_uv) +\nlerpBloomFactor(u_bloomFactors[2]) * vec4(u_bloomTintColors[2], 1.0) * texture2D(u_blurTexture3, v_uv) +\nlerpBloomFactor(u_bloomFactors[3]) * vec4(u_bloomTintColors[3], 1.0) * texture2D(u_blurTexture4, v_uv) +\nlerpBloomFactor(u_bloomFactors[4]) * vec4(u_bloomTintColors[4], 1.0) * texture2D(u_blurTexture5, v_uv)\n);\n}"},gaussianBlur:{"gaussianBlur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nuniform vec2 u_direction;\nvarying vec2 v_uv;\n#define KERNEL_RADIUS RADIUS\n#define SIGMA RADIUS\nfloat gaussianPdf(in float x, in float sigma) {\nreturn 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma;\n}\nvoid main() {\nvec2 invSize = 1.0 / u_texSize;\nfloat fSigma = float(SIGMA);\nfloat weightSum = gaussianPdf(0.0, fSigma);\nvec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum;\nfor (int i = 1; i < KERNEL_RADIUS; i ++) {\nfloat x = float(i);\nfloat w = gaussianPdf(x, fSigma);\nvec2 uvOffset = u_direction * invSize * x;\nvec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset);\nvec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset);\npixelColorSum += (sample1 + sample2) * w;\nweightSum += 2.0 * w;\n}\ngl_FragColor = pixelColorSum /weightSum;\n}"},luminosityHighPass:{"luminosityHighPass.frag":"precision mediump float;\nuniform sampler2D u_texture;\nuniform vec3 u_defaultColor;\nuniform float u_defaultOpacity;\nuniform float u_luminosityThreshold;\nuniform float u_smoothWidth;\nvarying vec2 v_uv;\nvoid main() {\nvec4 texel = texture2D(u_texture, v_uv);\nvec3 luma = vec3(0.299, 0.587, 0.114);\nfloat v = dot(texel.xyz, luma);\nvec4 outputColor = vec4(u_defaultColor.rgb, u_defaultOpacity);\nfloat alpha = smoothstep(u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v);\ngl_FragColor = mix(outputColor, texel, alpha);\n}"}},blur:{gaussianBlur:{"gaussianBlur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nuniform vec2 u_direction;\nuniform float u_sigma;\nvarying vec2 v_uv;\n#define KERNEL_RADIUS RADIUS\nfloat gaussianPdf(in float x, in float sigma) {\nreturn 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma;\n}\nvoid main() {\nvec2 invSize = 1.0 / u_texSize;\nfloat fSigma = u_sigma;\nfloat weightSum = gaussianPdf(0.0, fSigma);\nvec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum;\nfor (int i = 1; i < KERNEL_RADIUS; i ++) {\nfloat x = float(i);\nfloat w = gaussianPdf(x, fSigma);\nvec2 uvOffset = u_direction * invSize * x;\nvec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset);\nvec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset);\npixelColorSum += (sample1 + sample2) * w;\nweightSum += 2.0 * w;\n}\ngl_FragColor = pixelColorSum /weightSum;\n}"},"radial-blur":{"radial-blur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nconst float sampleDist = 1.0;\nconst float sampleStrength = 2.2;\nvoid main(void) {\nfloat samples[10];\nsamples[0] = -0.08;\nsamples[1] = -0.05;\nsamples[2] = -0.03;\nsamples[3] = -0.02;\nsamples[4] = -0.01;\nsamples[5] =  0.01;\nsamples[6] =  0.02;\nsamples[7] =  0.03;\nsamples[8] =  0.05;\nsamples[9] =  0.08;\nvec2 dir = 0.5 - v_uv;\nfloat dist = sqrt(dir.x * dir.x + dir.y * dir.y);\ndir = dir / dist;\nvec4 color = texture2D(u_colorTexture,v_uv);\nvec4 sum = color;\nfor (int i = 0; i < 10; i++) {\nsum += texture2D(u_colorTexture, v_uv + dir * samples[i] * sampleDist);\n}\nsum *= 1.0 / 11.0;\nfloat t = dist * sampleStrength;\nt = clamp(t, 0.0, 1.0);\ngl_FragColor = mix(color, sum, t);\n}"}},dra:{"dra.frag":"precision mediump float;\nuniform sampler2D u_minColor;\nuniform sampler2D u_maxColor;\nuniform sampler2D u_texture;\nvarying vec2 v_uv;\nvoid main() {\nvec4 minColor = texture2D(u_minColor, vec2(0.5));\nvec4 maxColor = texture2D(u_maxColor, vec2(0.5));\nvec4 color = texture2D(u_texture, v_uv);\nvec3 minColorUnpremultiply = minColor.rgb / minColor.a;\nvec3 maxColorUnpremultiply = maxColor.rgb / maxColor.a;\nvec3 colorUnpremultiply = color.rgb / color.a;\nvec3 range = maxColorUnpremultiply - minColorUnpremultiply;\ngl_FragColor = vec4(color.a * (colorUnpremultiply - minColorUnpremultiply) / range, color.a);\n}","min-max":{"min-max.frag":"#extension GL_EXT_draw_buffers : require\nprecision mediump float;\n#define CELL_SIZE 2\nuniform sampler2D u_minTexture;\nuniform sampler2D u_maxTexture;\nuniform vec2 u_srcResolution;\nuniform vec2 u_dstResolution;\nvarying vec2 v_uv;\nvoid main() {\nvec2 srcPixel = floor(gl_FragCoord.xy) * float(CELL_SIZE);\nvec2 onePixel = vec2(1.0) / u_srcResolution;\nvec2 uv = (srcPixel + 0.5) / u_srcResolution;\nvec4 minColor = vec4(1.0);\nvec4 maxColor = vec4(0.0);\nfor (int y = 0; y < CELL_SIZE; ++y) {\nfor (int x = 0; x < CELL_SIZE; ++x) {\nvec2 offset = uv + vec2(x, y) * onePixel;\nminColor = min(minColor, texture2D(u_minTexture, offset));\nmaxColor = max(maxColor, texture2D(u_maxTexture, offset));\n}\n}\ngl_FragData[0] = minColor;\ngl_FragData[1] = maxColor;\n}"}},"drop-shadow":{composite:{"composite.frag":"precision mediump float;\nuniform sampler2D u_layerFBOTexture;\nuniform sampler2D u_blurTexture;\nuniform vec4 u_shadowColor;\nuniform vec2 u_shadowOffset;\nuniform highp mat3 u_displayViewMat3;\nvarying vec2 v_uv;\nvoid main() {\nvec3 offset = u_displayViewMat3 * vec3(u_shadowOffset, 0.0);\nvec4 layerColor = texture2D(u_layerFBOTexture, v_uv);\nvec4 blurColor = texture2D(u_blurTexture, v_uv - offset.xy / 2.0);\ngl_FragColor = ((1.0 - layerColor.a) * blurColor.a * u_shadowColor + layerColor);\n}"}},"edge-detect":{"frei-chen":{"frei-chen.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nvarying vec2 v_uv;\nvec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[9];\nconst mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );\nconst mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );\nconst mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );\nconst mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );\nconst mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );\nconst mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );\nconst mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );\nconst mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );\nconst mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );\nvoid main() {\nG[0] = g0,\nG[1] = g1,\nG[2] = g2,\nG[3] = g3,\nG[4] = g4,\nG[5] = g5,\nG[6] = g6,\nG[7] = g7,\nG[8] = g8;\nmat3 I;\nfloat cnv[9];\nvec3 sample;\nfor (float i = 0.0; i < 3.0; i++) {\nfor (float j = 0.0; j < 3.0; j++) {\nsample = texture2D(u_colorTexture, v_uv + texel * vec2(i - 1.0,j - 1.0)).rgb;\nI[int(i)][int(j)] = length(sample);\n}\n}\nfor (int i = 0; i < 9; i++) {\nfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] = dp3 * dp3;\n}\nfloat M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);\nfloat S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);\ngl_FragColor = vec4(vec3(sqrt(M / S)), texture2D(u_colorTexture, v_uv).a);\n}"},sobel:{"sobel.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nuniform vec2 u_texSize;\nvec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[2];\nconst mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );\nconst mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );\nvoid main() {\nmat3 I;\nfloat cnv[2];\nvec3 sample;\nG[0] = g0;\nG[1] = g1;\nfor (float i = 0.0; i < 3.0; i++) {\nfor (float j = 0.0; j < 3.0; j++) {\nsample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb;\nI[int(i)][int(j)] = length(sample);\n}\n}\nfor (int i = 0; i < 2; i++) {\nfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] = dp3 * dp3;\n}\ngl_FragColor = vec4(vec3(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1])), texture2D(u_colorTexture, v_uv).a);\n}"}},"edge-enhance":{"edge-enhance.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nuniform vec2 u_texSize;\nvec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[2];\nconst mat3 g0 = mat3( 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0 );\nconst mat3 g1 = mat3( 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -1.0, -1.0, -1.0 );\nvoid main() {\nmat3 I;\nfloat cnv[2];\nvec3 sample;\nG[0] = g0;\nG[1] = g1;\nfor (float i = 0.0; i < 3.0; i++) {\nfor (float j = 0.0; j < 3.0; j++) {\nsample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb;\nI[int(i)][int(j)] = length(sample);\n}\n}\nfor (int i = 0; i < 2; i++) {\nfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] = dp3 * dp3;\n}\nvec4 color = texture2D(u_colorTexture, v_uv);\ngl_FragColor = vec4(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1]) * color);\n}"},filterEffect:{"filterEffect.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform mat4 u_coefficients;\nvarying vec2 v_uv;\nvoid main() {\nvec4 color = texture2D(u_colorTexture, v_uv);\nvec4 rgbw = u_coefficients * vec4(color.a > 0.0 ? color.rgb / color.a : vec3(0.0), 1.0);\nfloat a = color.a;\ngl_FragColor = vec4(a * rgbw.rgb, a);\n}"},pp:{"pp.vert":"precision mediump float;\nattribute vec2 a_position;\nvarying vec2 v_uv;\nvoid main() {\ngl_Position = vec4(a_position, 0.0, 1.0);\nv_uv = (a_position + 1.0) / 2.0;\n}"}},raster:{bitmap:{"bitmap.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\nuniform sampler2D u_texture;\nuniform highp vec2 u_coordScale;\nuniform lowp float u_opacity;\n#include <filtering/bicubic.glsl>\nvoid main() {\n#ifdef BICUBIC\nvec4 color = sampleBicubicBSpline(u_texture, v_texcoord, u_coordScale);\n#else\nvec4 color = texture2D(u_texture, v_texcoord);\n#endif\nfloat alpha = u_opacity * color.a;\ngl_FragColor = vec4(alpha * color.rgb, alpha);\n}","bitmap.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"},common:{"common.glsl":"uniform sampler2D u_image;\nuniform int u_bandCount;\nuniform bool u_isFloatTexture;\nuniform bool u_flipY;\nuniform float u_opacity;\nuniform int u_resampling;\nuniform vec2 u_srcImageSize;\n#ifdef APPLY_PROJECTION\n#include <raster/common/projection.glsl>\n#endif\n#ifdef BICUBIC\n#include <filtering/bicubic.glsl>\n#endif\n#ifdef BILINEAR\n#include <filtering/bilinear.glsl>\n#endif\nvec2 getPixelLocation(vec2 coords) {\nvec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords;\n#ifdef APPLY_PROJECTION\ntargetLocation = projectPixelLocation(targetLocation);\n#endif\nreturn targetLocation;\n}\nbool isOutside(vec2 coords){\nif (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) {\nreturn true;\n} else {\nreturn false;\n}\n}\nvec4 getPixel(vec2 pixelLocation) {\n#ifdef BICUBIC\nvec4 color = sampleBicubicBSpline(u_image, pixelLocation, u_srcImageSize);\n#elif defined(BILINEAR)\nvec4 color = sampleBilinear(u_image, pixelLocation, u_srcImageSize);\n#else\nvec4 color = texture2D(u_image, pixelLocation);\n#endif\nreturn color;\n}","contrastBrightness.glsl":"uniform float u_contrastOffset;\nuniform float u_brightnessOffset;\nvec4 adjustContrastBrightness(vec4 currentPixel, bool isFloat) {\nvec4 pixelValue = isFloat ? currentPixel * 255.0 : currentPixel;\nfloat maxI = 255.0;\nfloat mid = 128.0;\nfloat c = u_contrastOffset;\nfloat b = u_brightnessOffset;\nvec4 v;\nif (c > 0.0 && c < 100.0) {\nv = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid;\n} else if (c <= 0.0 && c > -100.0) {\nv = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid;\n} else if (c == 100.0) {\nv = (200.0 * pixelValue - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b);\nv = (sign(v) + 1.0) / 2.0;\n} else if (c == -100.0) {\nv = vec4(mid, mid, mid, currentPixel.a);\n}\nreturn vec4(v.r / 255.0, v.g / 255.0, v.b / 255.0, currentPixel.a);\n}","projection.glsl":"uniform sampler2D u_transformGrid;\nuniform vec2 u_transformSpacing;\nuniform vec2 u_transformGridSize;\nuniform vec2 u_targetImageSize;\nvec2 projectPixelLocation(vec2 coords) {\n#ifdef LOOKUP_PROJECTION\nvec4 pv = texture2D(u_transformGrid, coords);\nreturn vec2(pv.r, pv.g);\n#endif\nvec2 index_image = floor(coords * u_targetImageSize);\nvec2 oneTransformPixel = vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t);\nvec2 index_transform = floor(index_image / u_transformSpacing) / u_transformGridSize;\nvec2 pos = fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing);\nvec2 srcLocation;\nvec2 transform_location = index_transform + oneTransformPixel * 0.5;\nif (pos.s <= pos.t) {\nvec4 ll_abc = texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t));\nvec4 ll_def = texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t));\nsrcLocation.s = dot(ll_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t = dot(ll_def.rgb, vec3(pos, 1.0));\n} else {\nvec4 ur_abc = texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t));\nvec4 ur_def = texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t));\nsrcLocation.s = dot(ur_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t = dot(ur_def.rgb, vec3(pos, 1.0));\n}\nreturn srcLocation;\n}"},flow:{"flow.frag":"precision highp float;\nvarying float v_side;\nvarying float v_time;\nvarying float v_totalTime;\nvarying float v_timeSeed;\nvarying vec4 v_lineColor;\nvarying float v_lineRenderWidth;\nuniform float u_time;\nuniform float u_fadeDuration;\nuniform float u_lineSpeed;\nvoid main(void) {\nvec4 color = v_lineColor;\nfloat edgeWidth = min(2.0 * v_lineRenderWidth - 1.0, 1.0);\nfloat edgeStart = (v_lineRenderWidth - edgeWidth) / v_lineRenderWidth;\nif (edgeStart < 0.95) {\nfloat s = step(edgeStart, abs(v_side));\ncolor.a *= (1.0 - s) + s * (1.0 - (abs(v_side) - edgeStart) / (1.0 - edgeStart));\n}\nfloat t = mod(v_timeSeed * (v_totalTime + u_fadeDuration) + u_time * u_lineSpeed, v_totalTime + u_fadeDuration) - v_time;\ncolor.a *= step(0.0, t) * exp(-2.3 * t / u_fadeDuration);\ncolor.rgb *= color.a;\ngl_FragColor = color;\n}","flow.vert":"precision highp float;\nattribute vec3 a_positionAndSide;\nattribute vec3 a_timeInfo;\nattribute vec2 a_extrude;\nattribute float a_speed;\nuniform mat3 u_dvsMat3;\nuniform mat3 u_displayViewMat3;\nvarying float v_side;\nvarying float v_time;\nvarying float v_totalTime;\nvarying float v_timeSeed;\nvarying vec4 v_lineColor;\nvarying float v_lineRenderWidth;\n#define MAX_STOPS 8\n#ifdef VV_LINE_COLOR\nuniform float u_lineColor_stops[MAX_STOPS];\nuniform vec4 u_lineColor_values[MAX_STOPS];\nuniform int u_lineColor_count;\n#else\nuniform vec4 u_lineColor;\n#endif\n#ifdef VV_LINE_OPACITY\nuniform float u_lineOpacity_stops[MAX_STOPS];\nuniform float u_lineOpacity_values[MAX_STOPS];\nuniform int u_lineOpacity_count;\n#else\nuniform float u_lineOpacity;\n#endif\n#ifdef VV_LINE_RENDER_WIDTH\nuniform float u_lineRenderWidth_stops[MAX_STOPS];\nuniform float u_lineRenderWidth_values[MAX_STOPS];\nuniform int u_lineRenderWidth_count;\n#else\nuniform float u_lineRenderWidth;\n#endif\nvoid main(void) {\nfloat x = a_speed;\n#ifdef VV_LINE_COLOR\nvec4 lineColor = u_lineColor_values[0];\n{\nfor (int i = 1; i < MAX_STOPS; i++) {\nif (i >= u_lineColor_count) {\nbreak;\n}\nfloat x1 = u_lineColor_stops[i - 1];\nif (x < x1) {\nbreak;\n}\nfloat x2 = u_lineColor_stops[i];\nvec4 y2 = u_lineColor_values[i];\nif (x < x2) {\nvec4 y1 = u_lineColor_values[i - 1];\nlineColor = y1 + (y2 - y1) * (x - x1) / (x2 - x1);\n} else {\nlineColor = y2;\n}\n}\n}\n#else\nvec4 lineColor = u_lineColor;\n#endif\n#ifdef VV_LINE_OPACITY\nfloat lineOpacity = u_lineOpacity_values[0];\n{\nfor (int i = 1; i < MAX_STOPS; i++) {\nif (i >= u_lineOpacity_count) {\nbreak;\n}\nfloat x1 = u_lineOpacity_stops[i - 1];\nif (x < x1) {\nbreak;\n}\nfloat x2 = u_lineOpacity_stops[i];\nfloat y2 = u_lineOpacity_values[i];\nif (x < x2) {\nfloat y1 = u_lineOpacity_values[i - 1];\nlineOpacity = y1 + (y2 - y1) * (x - x1) / (x2 - x1);\n} else {\nlineOpacity = y2;\n}\n}\n}\n#else\nfloat lineOpacity = u_lineOpacity;\n#endif\n#ifdef VV_LINE_RENDER_WIDTH\nfloat lineRenderWidth = u_lineRenderWidth_values[0];\n{\nfor (int i = 1; i < MAX_STOPS; i++) {\nif (i >= u_lineRenderWidth_count) {\nbreak;\n}\nfloat x1 = u_lineRenderWidth_stops[i - 1];\nif (x < x1) {\nbreak;\n}\nfloat x2 = u_lineRenderWidth_stops[i];\nfloat y2 = u_lineRenderWidth_values[i];\nif (x < x2) {\nfloat y1 = u_lineRenderWidth_values[i - 1];\nlineRenderWidth = y1 + (y2 - y1) * (x - x1) / (x2 - x1);\n} else {\nlineRenderWidth = y2;\n}\n}\n}\n#else\nfloat lineRenderWidth = u_lineRenderWidth;\n#endif\nvec2 position = a_positionAndSide.xy;\nfloat side = a_positionAndSide.z;\nvec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(a_extrude * lineRenderWidth, 0.0)).xy;\ngl_Position = vec4(xy, 0.0, 1.0);\nv_side = side;\nv_time = a_timeInfo.x;\nv_totalTime = a_timeInfo.y;\nv_timeSeed = a_timeInfo.z;\nv_lineColor = vec4(lineColor.rgb, lineColor.a * lineOpacity);\nv_lineRenderWidth = lineRenderWidth;\n}"},hillshade:{"hillshade.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include <raster/common/common.glsl>\nuniform int u_hillshadeType;\nuniform float u_sinZcosAs[6];\nuniform float u_sinZsinAs[6];\nuniform float u_cosZs[6];\nuniform float u_weights[6];\nuniform vec2 u_factor;\nuniform float u_minValue;\nuniform float u_maxValue;\n#include <raster/lut/colorize.glsl>\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nvec3 rgb2hsv(vec3 c) {\nvec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d = q.x - min(q.w, q.y);\nfloat e = 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(vec3 c) {\nvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec4 overlay(float val, float minValue, float maxValue, float hillshade) {\nval = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0);\nvec4 rgb = colorize(vec4(val, val, val, 1.0), 255.0);\nvec3 hsv = rgb2hsv(rgb.xyz);\nhsv.z = hillshade;\nreturn vec4(hsv2rgb(hsv), 1.0) * rgb.a;\n}\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\nif (currentPixel.a == 0.0) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec2 axy = vec2(-1.0, -1.0);\nvec2 bxy = vec2(0.0, -1.0);\nvec2 cxy = vec2(1.0, -1.0);\nvec2 dxy = vec2(-1.0, 0.0);\nvec2 fxy = vec2(1.0, 0.0);\nvec2 gxy = vec2(-1.0, 1.0);\nvec2 hxy = vec2(0.0, 1.0);\nvec2 ixy = vec2(1.0, 1.0);\nvec2 onePixel = 1.0 / u_srcImageSize;\nif (pixelLocation.s < onePixel.s) {\naxy[0] = 1.0;\ndxy[0] = 1.0;\ngxy[0] = 1.0;\n}\nif (pixelLocation.t < onePixel.t) {\naxy[1] = 1.0;\nbxy[1] = 1.0;\ncxy[1] = 1.0;\n}\nif (pixelLocation.s > 1.0 - onePixel.s) {\ncxy[0] = -1.0;\nfxy[0] = -1.0;\nixy[0] = -1.0;\n}\nif (pixelLocation.t > 1.0 - onePixel.t) {\ngxy[1] = -1.0;\nhxy[1] = -1.0;\nixy[1] = -1.0;\n}\nvec4 va = texture2D(u_image, pixelLocation + onePixel * axy);\nvec4 vb = texture2D(u_image, pixelLocation + onePixel * bxy);\nvec4 vc = texture2D(u_image, pixelLocation + onePixel * cxy);\nvec4 vd = texture2D(u_image, pixelLocation + onePixel * dxy);\nvec4 ve = texture2D(u_image, pixelLocation);\nvec4 vf = texture2D(u_image, pixelLocation + onePixel * fxy);\nvec4 vg = texture2D(u_image, pixelLocation + onePixel * gxy);\nvec4 vh = texture2D(u_image, pixelLocation + onePixel * hxy);\nvec4 vi = texture2D(u_image, pixelLocation + onePixel * ixy);\nfloat dzx = (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_factor.s;\nfloat dzy = (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_factor.t;\nfloat dzd = sqrt(1.0 + dzx * dzx + dzy * dzy);\nfloat hillshade = 0.0;\nif (u_hillshadeType == 0){\nfloat cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx;\nfloat z = (u_cosZs[0] + cosDelta) / dzd;\nif (z < 0.0)  z = 0.0;\nhillshade = z;\n} else {\nfor (int k = 0; k < 6; k++) {\nfloat cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx;\nfloat z = (u_cosZs[k] + cosDelta) / dzd;\nif (z < 0.0) z = 0.0;\nhillshade = hillshade + z * u_weights[k];\nif (k == 5) break;\n}\n}\nfloat alpha = getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\n#ifdef APPLY_COLORMAP\ngl_FragColor = overlay(ve.r, u_minValue, u_maxValue, hillshade) * alpha * u_opacity;\n#else\ngl_FragColor = vec4(hillshade, hillshade, hillshade, 1.0) * alpha * u_opacity;\n#endif\n}","hillshade.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"},lut:{"colorize.glsl":"uniform sampler2D u_colormap;\nuniform float u_colormapOffset;\nuniform float u_colormapMaxIndex;\nvec4 colorize(vec4 currentPixel, float scaleFactor) {\nfloat clrIndex = clamp(currentPixel.r * scaleFactor - u_colormapOffset, 0.0, u_colormapMaxIndex);\nvec2 clrPosition = vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0);\nvec4 color = texture2D(u_colormap, clrPosition);\nvec4 result = vec4(color.rgb, color.a * currentPixel.a);\nreturn result;\n}","lut.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include <raster/common/common.glsl>\n#include <raster/lut/colorize.glsl>\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\nvec4 result = colorize(currentPixel, 1.0);\ngl_FragColor = vec4(result.xyz, 1.0) * result.a * u_opacity;\n}","lut.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform highp float u_scale;\nuniform highp vec2 u_offset;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos * u_scale + u_offset;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"},magdir:{"magdir.frag":"precision mediump float;\nvarying vec4 v_color;\nuniform lowp float u_opacity;\nvoid main() {\ngl_FragColor = v_color * u_opacity;\n}","magdir.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_vv;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform vec2 u_symbolSize;\nuniform vec2 u_symbolPercentRange;\nuniform vec2 u_dataRange;\nuniform float u_rotation;\nuniform vec4 u_colors[12];\nvarying vec4 v_color;\nvoid main()\n{\nfloat angle = a_offset.y + u_rotation;\n#ifndef ROTATION_GEOGRAPHIC\nangle = 3.14159265359 * 2.0 - angle - 3.14159265359 / 2.0;\n#endif\nvec2 offset = vec2(cos(angle), sin(angle)) * a_offset.x;\n#ifdef DATA_RANGE\nfloat valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0);\nfloat sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x);\nfloat sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y);\n#else\nfloat sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0;\n#endif\nvec2 pos = a_pos + offset * sizePercentage * u_symbolSize;\nv_color = u_colors[int(a_vv.x)];\ngl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0);\n}"},reproject:{"reproject.frag":"precision mediump float;\nvarying vec2 v_texcoord;\n#include <raster/common/common.glsl>\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\ngl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity;\n}","reproject.vert":"precision mediump float;\nattribute vec2 a_position;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_position;\ngl_Position = vec4(2.0 * (a_position - 0.5), 0.0, 1.0);\n}"},scalar:{"scalar.frag":"precision mediump float;\nuniform lowp float u_opacity;\nvarying vec2 v_pos;\nconst vec4 outlineColor = vec4(0.2, 0.2, 0.2, 1.0);\nconst float outlineSize = 0.02;\nconst float innerRadius = 0.25;\nconst float outerRadius = 0.42;\nconst float innerSquareLength = 0.15;\nvoid main() {\nmediump float dist = length(v_pos);\nmediump float fillalpha1 = smoothstep(outerRadius, outerRadius + outlineSize, dist);\nfillalpha1 *= (1.0-smoothstep(outerRadius + outlineSize, outerRadius + 0.1 + outlineSize, dist));\n#ifdef INNER_CIRCLE\nmediump float fillalpha2 = smoothstep(innerRadius, innerRadius + outlineSize, dist);\nfillalpha2 *= (1.0-smoothstep(innerRadius + outlineSize, innerRadius + 0.1 + outlineSize, dist));\n#else\nmediump float fillalpha2 = (abs(v_pos.x) < innerSquareLength ? 1.0 : 0.0) * (abs(v_pos.y) < innerSquareLength ? 1.0 : 0.0);\n#endif\ngl_FragColor = (fillalpha2 + fillalpha1) * outlineColor * u_opacity;\n}","scalar.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_vv;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform vec2 u_symbolSize;\nuniform vec2 u_symbolPercentRange;\nuniform vec2 u_dataRange;\nvarying vec2 v_pos;\nvoid main()\n{\n#ifdef DATA_RANGE\nfloat valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0);\nfloat sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x);\nfloat sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y);\n#else\nfloat sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0;\n#endif\nvec2 size = u_symbolSize * sizePercentage;\nvec2 pos = a_pos + a_offset * size;\nv_pos = a_offset;\ngl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0);\n}"},stretch:{"stretch.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include <raster/common/common.glsl>\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput;\nuniform float u_maxOutput;\nuniform float u_factor[3];\nuniform bool u_useGamma;\nuniform float u_gamma[3];\nuniform float u_gammaCorrection[3];\n#include <raster/lut/colorize.glsl>\nfloat stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) {\nif (val >= maxCutOff) {\nreturn maxOutput;\n} else if (val <= minCutOff) {\nreturn minOutput;\n}\nfloat stretchedVal;\nif (useGamma) {\nfloat tempf = 1.0;\nfloat outRange = maxOutput - minOutput;\nfloat relativeVal = (val - minCutOff) / (maxCutOff - minCutOff);\nif (gamma > 1.0) {\ntempf -= pow(1.0 / outRange, relativeVal * gammaCorrection);\n}\nstretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0;\n} else {\nstretchedVal = minOutput + (val - minCutOff) * factor;\n}\nreturn stretchedVal;\n}\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\n#ifdef NOOP\ngl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity;\nreturn;\n#endif\nif (u_bandCount == 1) {\nfloat grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);\n#ifdef APPLY_COLORMAP\nvec4 result = colorize(vec4(grayVal, grayVal, grayVal, 1.0), u_useGamma ? 255.0 : 1.0);\ngl_FragColor = vec4(result.xyz, 1.0) * result.a * currentPixel.a * u_opacity;\n#else\ngl_FragColor = vec4(grayVal, grayVal, grayVal, 1.0) * currentPixel.a * u_opacity;\n#endif\n} else {\nfloat redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);\nfloat greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]);\nfloat blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]);\ngl_FragColor = vec4(redVal, greenVal, blueVal, 1.0) * currentPixel.a * u_opacity;\n}\n}","stretch.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform highp float u_scale;\nuniform highp vec2 u_offset;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos * u_scale + u_offset;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"}},stencil:{"stencil.frag":"void main() {\ngl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n}","stencil.vert":"attribute vec2 a_pos;\nvoid main() {\ngl_Position = vec4(a_pos, 0.0, 1.0);\n}"},tileInfo:{"tileInfo.frag":"uniform mediump sampler2D u_texture;\nvarying mediump vec2 v_tex;\nvoid main(void) {\nlowp vec4 color = texture2D(u_texture, v_tex);\ngl_FragColor = 0.75 * color;\n}","tileInfo.vert":"attribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_depth;\nuniform mediump vec2 u_coord_ratio;\nuniform mediump vec2 u_delta;\nuniform mediump vec2 u_dimensions;\nvarying mediump vec2 v_tex;\nvoid main() {\nmediump vec2 offset = u_coord_ratio * vec2(u_delta + a_pos * u_dimensions);\nvec3 v_pos = u_dvsMat3 * vec3(offset, 1.0);\ngl_Position = vec4(v_pos.xy, 0.0, 1.0);\nv_tex = a_pos;\n}"},util:{"encoding.glsl":"const vec4 rgba2float_factors = vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}"}};const r=new(i(651).a)((function(e){let t=n;return e.split("/").forEach(e=>{t&&(t=t[e])}),t}));function s(e){return r.resolveIncludes(e)}},638:function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return a}));var n=i(614),r=i(631);const s={geometry:[new r.a("a_pos",2,n.k.BYTE,0,2)]},a={geometry:[new r.a("a_pos",2,n.k.BYTE,0,4),new r.a("a_tex",2,n.k.BYTE,2,4)]},o={geometry:[new r.a("a_pos",2,n.k.UNSIGNED_SHORT,0,4)]}},639:function(e,t,i){"use strict";i.d(t,"a",(function(){return l})),i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return o})),i.d(t,"d",(function(){return h})),i.d(t,"e",(function(){return u})),i.d(t,"f",(function(){return c})),i.d(t,"g",(function(){return f})),i.d(t,"h",(function(){return d})),i.d(t,"i",(function(){return m})),i.d(t,"j",(function(){return _})),i.d(t,"k",(function(){return p}));var n=i(106),r=i(614),s=(i(633),i(623));function a(e,t,i="nearest",a=!1){var o;const l=!(a&&"u8"===t.pixelType),c=l?r.q.FLOAT:r.q.UNSIGNED_BYTE,u=null==t.pixels||0===t.pixels.length?null:l?t.getAsRGBAFloat():t.getAsRGBA(),h=null==(o=e.capabilities.textureFloat)?void 0:o.textureFloatLinear,d={width:t.width,height:t.height,target:r.A.TEXTURE_2D,pixelFormat:r.p.RGBA,internalFormat:e.type===n.a.WEBGL2&&l?r.v.RGBA32F:r.p.RGBA,samplingMode:!h||"bilinear"!==i&&"cubic"!==i?r.z.NEAREST:r.z.LINEAR,dataType:c,wrapMode:r.B.CLAMP_TO_EDGE,flipped:!1};return new s.a(e,d,u)}function o(e,t){const{spacing:i,offsets:a,coefficients:o,size:[l,c]}=t,u=i[0]>1,h={width:u?4*l:l,height:c,target:r.A.TEXTURE_2D,pixelFormat:r.p.RGBA,internalFormat:e.type===n.a.WEBGL2?r.v.RGBA32F:r.p.RGBA,dataType:r.q.FLOAT,samplingMode:r.z.NEAREST,wrapMode:r.B.CLAMP_TO_EDGE,flipped:!1},d=new Float32Array(u?l*c*16:2*a.length);if(u)for(let n=0,r=0;n<o.length;n++)d[r++]=o[n],n%3==2&&(d[r++]=1);else for(let n=0;n<c;n++)for(let e=0;e<l;e++){const t=4*(n*l+e),i=2*(e*c+n);d[t]=a[i],d[t+1]=a[i+1],d[t+3]=-1===a[i]?0:1}return new s.a(e,h,d)}function l(e,t){const i={width:t.length/4,height:1,target:r.A.TEXTURE_2D,pixelFormat:r.p.RGBA,internalFormat:r.p.RGBA,dataType:r.q.UNSIGNED_BYTE,samplingMode:r.z.NEAREST,wrapMode:r.B.CLAMP_TO_EDGE,flipped:!1};return new s.a(e,i,t)}function c(e,t,i,n=1,r=!0,s=!1){return{u_flipY:r,u_isFloatTexture:s,u_applyTransform:!!e,u_opacity:n,u_transformSpacing:e?e.spacing:null,u_transformGridSize:e?e.size:null,u_targetImageSize:t,u_srcImageSize:i}}function u(e,t){return{u_colormapOffset:t||0,u_colormapMaxIndex:e?e.length/4-1:null}}function h(e,t){return{u_scale:e,u_offset:t}}function d(e){return{u_bandCount:e.bandCount,u_minOutput:e.outMin,u_maxOutput:e.outMax,u_minCutOff:e.minCutOff,u_maxCutOff:e.maxCutOff,u_factor:e.factor,u_useGamma:e.useGamma,u_gamma:e.gamma,u_gammaCorrection:e.gammaCorrection}}function f(e){return{u_hillshadeType:e.hillshadeType,u_sinZcosAs:e.sinZcosAs,u_sinZsinAs:e.sinZsinAs,u_cosZs:e.cosZs,u_weights:e.weights,u_factor:e.factor,u_minValue:e.minValue,u_maxValue:e.maxValue}}function m(e,t){const i=e.gl,n=t.glName,r=i.getProgramParameter(n,i.ACTIVE_UNIFORMS),s=new Map;let a;for(let o=0;o<r;o++)a=i.getActiveUniform(n,o),a&&s.set(a.name,{location:i.getUniformLocation(n,a.name),info:a});return s}function p(e,t,i){Object.keys(i).forEach(n=>{const s=t.get(n)||t.get(n+"[0]");s&&function(e,t,i,n){if(null===n||null==i)return!1;const{info:s}=n;switch(s.type){case r.C.FLOAT:s.size>1?e.setUniform1fv(t,i):e.setUniform1f(t,i);break;case r.C.FLOAT_VEC2:e.setUniform2fv(t,i);break;case r.C.FLOAT_VEC3:e.setUniform3fv(t,i);break;case r.C.FLOAT_VEC4:e.setUniform4fv(t,i);break;case r.C.FLOAT_MAT3:e.setUniformMatrix3fv(t,i);break;case r.C.FLOAT_MAT4:e.setUniformMatrix4fv(t,i);break;case r.C.INT:s.size>1?e.setUniform1iv(t,i):e.setUniform1i(t,i);break;case r.C.BOOL:e.setUniform1i(t,i?1:0);break;case r.C.INT_VEC2:case r.C.BOOL_VEC2:e.setUniform2iv(t,i);break;case r.C.INT_VEC3:case r.C.BOOL_VEC3:e.setUniform3iv(t,i);break;case r.C.INT_VEC4:case r.C.BOOL_VEC4:e.setUniform4iv(t,i);break;default:return!1}}(e,n,i[n],s)})}function _(e,t,i,n){i.length===n.length&&(n.some(e=>null==e)||i.some(e=>null==e)||i.forEach((i,r)=>{t.setUniform1i(i,r),e.bindTexture(n[r],r)}))}},640:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i(8);function r(e,t){if(e&&"name"in e){const i=e;return t&&t.error(new n.a(i.name,i.message,i.details)),!1}return!0}},642:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n,r,s,a={exports:{}};n=a,r=function(){function e(e,i,r){r=r||2;var s,a,o,c,u,h,d,f=i&&i.length,m=f?i[0]*r:e.length,p=t(e,0,m,r,!0),_=[];if(!p||p.next===p.prev)return _;if(f&&(p=l(e,i,p,r)),e.length>80*r){s=o=e[0],a=c=e[1];for(var g=r;g<m;g+=r)(u=e[g])<s&&(s=u),(h=e[g+1])<a&&(a=h),u>o&&(o=u),h>c&&(c=h);d=0!==(d=Math.max(o-s,c-a))?1/d:0}return n(p,_,r,s,a,d),_}function t(e,t,i,n,r){var s,a;if(r===M(e,t,i,n)>0)for(s=t;s<i;s+=n)a=w(s,e[s],e[s+1],a);else for(s=i-n;s>=t;s-=n)a=w(s,e[s],e[s+1],a);if(a&&y(a,a.next)){var o=a.next;j(a),a=o}return a}function i(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==x(n.prev,n,n.next))n=n.next;else{var r=n.prev;if(j(n),(n=t=r)===n.next)break;i=!0}}while(i||n!==t);return t}function n(e,t,l,c,u,h,d){if(e){!d&&h&&f(e,c,u,h);for(var m,p,_=e;e.prev!==e.next;)if(m=e.prev,p=e.next,h?s(e,c,u,h):r(e))t.push(m.i/l),t.push(e.i/l),t.push(p.i/l),j(e),e=p.next,_=p.next;else if((e=p)===_){d?1===d?n(e=a(i(e),t,l),t,l,c,u,h,2):2===d&&o(e,t,l,c,u,h):n(i(e),t,l,c,u,h,1);break}}}function r(e){var t=e.prev,i=e,n=e.next;if(x(t,i,n)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(_(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&x(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function s(e,t,i,n){var r=e.prev,s=e,a=e.next;if(x(r,s,a)>=0)return!1;for(var o=r.x<s.x?r.x<a.x?r.x:a.x:s.x<a.x?s.x:a.x,l=r.y<s.y?r.y<a.y?r.y:a.y:s.y<a.y?s.y:a.y,c=r.x>s.x?r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,u=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?s.y:a.y,h=m(o,l,t,i,n),d=m(c,u,t,i,n),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&_(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&x(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&_(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&x(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&_(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&x(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&_(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&x(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function a(e,t,n){var r=e;do{var s=r.prev,a=r.next.next;!y(s,a)&&v(s,r,r.next,a)&&S(s,a)&&S(a,s)&&(t.push(s.i/n),t.push(r.i/n),t.push(a.i/n),j(r),j(r.next),r=e=a),r=r.next}while(r!==e);return i(r)}function o(e,t,r,s,a,o){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=T(l,c);return l=i(l,l.next),u=i(u,u.next),n(l,t,r,s,a,o),void n(u,t,r,s,a,o)}c=c.next}l=l.next}while(l!==e)}function l(e,n,r,s){var a,o,l,u=[];for(a=0,o=n.length;a<o;a++)(l=t(e,n[a]*s,a<o-1?n[a+1]*s:e.length,s,!1))===l.next&&(l.steiner=!0),u.push(p(l));for(u.sort(c),a=0;a<u.length;a++)r=i(r=h(u[a],r),r.next);return r}function c(e,t){return e.x-t.x}function u(e){if(e.next.prev===e)return e;let t=e;for(;;){const i=t.next;if(i.prev===t||i===t||i===e)break;t=i}return t}function h(e,t){var n=function(e,t){var i,n=t,r=e.x,s=e.y,a=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var o=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=r&&o>a){if(a=o,o===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!i)return null;if(r===a)return i;var l,c=i,u=i.x,h=i.y,f=1/0;n=i;do{r>=n.x&&n.x>=u&&r!==n.x&&_(s<h?r:a,s,u,h,s<h?a:r,s,n.x,n.y)&&(l=Math.abs(s-n.y)/(r-n.x),S(n,e)&&(l<f||l===f&&(n.x>i.x||n.x===i.x&&d(i,n)))&&(i=n,f=l)),n=n.next}while(n!==c);return i}(e,t);if(!n)return t;var r=T(n,e),s=i(n,n.next);let a=u(r);return i(a,a.next),s=u(s),u(t===n?s:t)}function d(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function f(e,t,i,n){var r=e;do{null===r.z&&(r.z=m(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,i,n,r,s,a,o,l,c=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,n=i,o=0,t=0;t<c&&(o++,n=n.nextZ);t++);for(l=c;o>0||l>0&&n;)0!==o&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=n}s.nextZ=null,c*=2}while(a>1)}(r)}function m(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function _(e,t,i,n,r,s,a,o){return(r-a)*(t-o)-(e-a)*(s-o)>=0&&(e-a)*(n-o)-(i-a)*(t-o)>=0&&(i-a)*(s-o)-(r-a)*(n-o)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&v(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(S(e,t)&&S(t,e)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||y(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,i,n){var r=O(x(e,t,i)),s=O(x(e,t,n)),a=O(x(i,n,e)),o=O(x(i,n,t));return r!==s&&a!==o||!(0!==r||!b(e,i,t))||!(0!==s||!b(e,n,t))||!(0!==a||!b(i,e,n))||!(0!==o||!b(i,t,n))}function b(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function O(e){return e>0?1:e<0?-1:0}function S(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function T(e,t){var i=new I(e.i,e.x,e.y),n=new I(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function w(e,t,i,n){var r=new I(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,i,n){for(var r=0,s=t,a=i-n;s<i;s+=n)r+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return r}return e.deviation=function(e,t,i,n){var r=t&&t.length,s=r?t[0]*i:e.length,a=Math.abs(M(e,0,s,i));if(r)for(var o=0,l=t.length;o<l;o++){var c=t[o]*i,u=o<l-1?t[o+1]*i:e.length;a-=Math.abs(M(e,c,u,i))}var h=0;for(o=0;o<n.length;o+=3){var d=n[o]*i,f=n[o+1]*i,m=n[o+2]*i;h+=Math.abs((e[d]-e[m])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[m+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},e.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},n=0,r=0;r<e.length;r++){for(var s=0;s<e[r].length;s++)for(var a=0;a<t;a++)i.vertices.push(e[r][s][a]);r>0&&(n+=e[r-1].length,i.holes.push(n))}return i},e},void 0!==(s=r())&&(n.exports=s);const o=a.exports},643:function(e,t,i){"use strict";i.d(t,"a",(function(){return h}));var n=i(625),r=i(638),s=i(617),a=i(630),o=i(619),l=i(614),c=i(627),u=i(620);class h extends s.a{constructor(){super(...arguments),this._color=Object(n.a)(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:e},t){e.setDepthWriteEnabled(!1),e.setDepthTestEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(l.w.KEEP,l.w.KEEP,l.w.REPLACE),e.setStencilWriteMask(255),e.setStencilFunctionSeparate(l.n.FRONT_AND_BACK,l.h.GREATER,t.stencilRef,255)}draw(e,t){const{context:i}=e;this._initialized||this._initialize(i),i.bindVAO(this._solidVertexArrayObject),i.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),this._solidProgram.setUniform2fv("u_coord_range",[t.rangeX,t.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),i.drawArrays(l.r.TRIANGLE_STRIP,0,4),i.bindVAO()}_initialize(e){if(this._initialized)return!0;const t=Object(c.a)(e,a.a);if(!t)return!1;const i=new Int8Array([0,0,1,0,0,1,1,1]),n=o.a.createVertex(e,l.D.STATIC_DRAW,i),s=new u.a(e,a.a.attributes,r.a,{geometry:n});return this._solidProgram=t,this._solidVertexArrayObject=s,this._initialized=!0,!0}}},644:function(e,t,i){"use strict";i.d(t,"a",(function(){return x})),i.d(t,"b",(function(){return g}));var n=i(342),r=i(615),s=i(618);const a={marker:r.d.MARKER,fill:r.d.FILL,line:r.d.LINE,text:r.d.TEXT};class o{constructor(e,t,i,n){const r={minScale:null==t?void 0:t.minScale,maxScale:null==t?void 0:t.maxScale},o=function(e){return e.minScale||e.maxScale?e.minScale+"-"+e.maxScale:""}(r);this.layers=e,this.data=t,this.hash=this._createHash()+o,this.rendererKey=i;const l={isOutline:!1,isOutlinedFill:!1,placement:null,stride:{fill:"default"},vvFlags:i};for(const c of e){const e=a[c.type];c.materialKey=Object(s.g)(e,l),c.maxVVSize=n,c.scaleInfo=r,c.templateHash+=o}}get type(){return"expanded-cim"}_createHash(){let e="";for(const t of this.layers)e+=t.templateHash;return e}}var l=i(678),c=i(8),u=i(12),h=i(16),d=i(79),f=i(75),m=i(384);async function p(e,t,i){if(!e.name)return Promise.reject(new c.a("style-symbol-reference-name-missing","Missing name in style symbol reference"));if(e.styleName&&"Esri2DPointSymbolsStyle"===e.styleName)return async function(e,t){const n=m.a.replace(/\{SymbolName\}/gi,e.name);try{const e=await Object(m.d)(n,t);return Object(m.c)(e.data)}catch(i){return Object(u.t)(i),null}}(e,i);try{return async function(e,t,i,n){const r=e.data,s={portal:i&&i.portal||d.a.getDefault(),url:Object(h.M)(e.baseUrl),origin:"portal-item"},a=r.items.find(e=>e.name===t);if(!a)throw new c.a("symbolstyleutils:symbol-name-not-found",`The symbol name '${t}' could not be found`,{symbolName:t});let o=Object(f.b)(Object(m.e)(a,"cimRef"),s);Object(l.b)()&&(o=Object(l.a)(o));try{const e=await Object(m.d)(o,n);return Object(m.c)(e.data)}catch(p){return Object(u.t)(p),null}}(await Object(m.b)(e,t,i),e.name,t,i)}catch(n){return Object(u.t)(n),null}}const _=async(e,t,i)=>new o(await Object(n.b)(e.data,t,i),e.data,e.rendererKey,e.maxVVSize),g=async(e,t,i,n)=>{if(!e)return null;if("cim"===e.type)return _(e,t,i);if("web-style"===e.type){const r={type:"cim",data:await p(e,null,n),rendererKey:e.rendererKey,maxVVSize:e.maxVVSize};return _(r,t,i)}return e};function x(e){if(!e)return null;const{type:t,cim:i,url:n,materialHash:r}=e,s={cim:i,type:t,mosaicHash:r,url:n,size:null,dashTemplate:null,path:null,text:null,fontName:null};switch(t){case"marker":s.size=e.size,s.path=e.path;break;case"line":s.dashTemplate=e.dashTemplate;break;case"text":s.text=e.text,s.fontName=e.fontName}return s}},645:function(e,t,i){"use strict";i.d(t,"a",(function(){return p}));var n=i(625),r=i(638),s=i(617),a=i(630),o=i(637);const l={shaders:{vertexShader:Object(o.a)("tileInfo/tileInfo.vert"),fragmentShader:Object(o.a)("tileInfo/tileInfo.frag")},attributes:new Map([["a_pos",0]])};var c=i(619),u=i(614),h=i(627),d=i(623),f=i(620);const m=300;class p extends s.a{constructor(){super(...arguments),this._color=Object(n.a)(1,0,0,1)}dispose(){this._outlineProgram&&(this._outlineProgram.dispose(),this._outlineProgram=null),this._tileInfoProgram&&(this._tileInfoProgram.dispose(),this._tileInfoProgram=null),this._outlineVertexArrayObject&&(this._outlineVertexArrayObject.dispose(),this._outlineVertexArrayObject=null),this._tileInfoVertexArrayObject&&(this._tileInfoVertexArrayObject.dispose(),this._tileInfoVertexArrayObject=null),this._canvas=null}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(u.b.ONE,u.b.ONE_MINUS_SRC_ALPHA,u.b.ONE,u.b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1)}draw(e,t){const{context:i}=e;if(!t.isReady)return;this._loadWGLResources(i),i.bindVAO(this._outlineVertexArrayObject),i.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),this._outlineProgram.setUniform2f("u_coord_range",t.rangeX,t.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),i.drawArrays(u.r.LINE_STRIP,0,4);const n=this._getTexture(i,t);n?(i.bindVAO(this._tileInfoVertexArrayObject),i.useProgram(this._tileInfoProgram),i.bindTexture(n,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",t.rangeX/t.width,t.rangeY/t.height),this._tileInfoProgram.setUniform2f("u_delta",8,8),this._tileInfoProgram.setUniform2f("u_dimensions",n.descriptor.width,n.descriptor.height),i.drawArrays(u.r.TRIANGLE_STRIP,0,4),i.bindVAO()):i.bindVAO()}_loadWGLResources(e){if(this._outlineProgram&&this._tileInfoProgram)return;const t=Object(h.a)(e,a.a),i=Object(h.a)(e,l),n=new Int8Array([0,0,1,0,1,1,0,1]),s=c.a.createVertex(e,u.D.STATIC_DRAW,n),o=new f.a(e,a.a.attributes,r.a,{geometry:s}),d=new Int8Array([0,0,1,0,0,1,1,1]),m=c.a.createVertex(e,u.D.STATIC_DRAW,d),p=new f.a(e,l.attributes,r.a,{geometry:m});this._outlineProgram=t,this._tileInfoProgram=i,this._outlineVertexArrayObject=o,this._tileInfoVertexArrayObject=p}_getTexture(e,t){if(t.texture&&t.triangleCountReportedInDebug===t.triangleCount)return t.texture;t.triangleCountReportedInDebug=t.triangleCount,this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","canvas2d"),this._canvas.setAttribute("width","300"),this._canvas.setAttribute("height","32"),this._canvas.setAttribute("style","display:none"));const i=t.triangleCount;let n=t.key.id;t.triangleCount>0&&(n+=", "+i);const r=this._canvas,s=r.getContext("2d");return s.font="24px sans-serif",s.textAlign="left",s.textBaseline="top",s.clearRect(0,0,m,32),i>1e5?(s.fillStyle="red",s.fillRect(0,0,m,32),s.fillStyle="black"):(s.clearRect(0,0,m,32),s.fillStyle="blue"),s.fillText(n,0,0),t.texture=new d.a(e,{target:u.A.TEXTURE_2D,pixelFormat:u.p.RGBA,dataType:u.q.UNSIGNED_BYTE,samplingMode:u.z.NEAREST,wrapMode:u.B.CLAMP_TO_EDGE},r),t.texture}}},646:function(e,t,i){"use strict";i.d(t,"a",(function(){return G}));var n=i(655),r=i(658),s=i(634),a=i(617),o=i(614),l=i(639);class c extends a.a{constructor(){super(...arguments),this._desc={lut:{vsPath:"raster/lut",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])},stretch:{vsPath:"raster/stretch",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])},hillshade:{vsPath:"raster/hillshade",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])}},this._rendererUniformInfos=new Map}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e},t){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(o.b.ONE,o.b.ONE_MINUS_SRC_ALPHA,o.b.ONE,o.b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(o.h.EQUAL,t.stencilRef,255)}draw(e,t){var i;if(!Object(r.b)(t)||t.suspended)return;e.timeline.begin(this.name);const n=!(null!=(i=e.context.capabilities.textureFloat)&&i.textureFloatLinear);t.updateTexture(e);const s=this._getShaderVariations(t,n),a=e.painter.materialManager.getProgram(e,this._desc[t.symbolizerParameters.type],s);this._drawWithProgram(e.context,a,t),e.timeline.end(this.name)}_drawWithProgram(e,t,i,n=1,r=[0,0],a=!1){this._quad||(this._quad=new s.a(e,[0,0,1,0,0,1,1,1]));const{symbolizerParameters:o,transformGrid:c,width:u,height:h,opacity:d}=i,f=o.type;e.useProgram(t);const m=this._getShaderVariations(i),p=this._getUniformInfos(f,e,t,m),{names:_,textures:g}=i.getTextures();Object(l.j)(e,t,_,g);const x=Object(l.d)(n,r),y=Object(l.f)(c,[u,h],[i.source.width,i.source.height],d,a);if(Object(l.k)(t,p,{u_coordScale:i.coordScale,u_dvsMat3:i.transforms.dvs,...x,...y}),o.colormap){const{colormap:e,colormapOffset:i}=o,n=Object(l.e)(e,i);Object(l.k)(t,p,n)}if("stretch"===o.type){const e=Object(l.h)(o);Object(l.k)(t,p,e)}else if("hillshade"===o.type){const e=Object(l.g)(o);Object(l.k)(t,p,e)}this._quad.draw()}_getUniformInfos(e,t,i,n){const r=n.length>0?e+"-"+n.join("-"):e;if(this._rendererUniformInfos.has(r))return this._rendererUniformInfos.get(r);const s=Object(l.i)(t,i);return this._rendererUniformInfos.set(r,s),s}_getShaderVariations(e,t=!1){const i=[],{interpolation:n}=e,{type:r,colormap:s}=e.symbolizerParameters;return"cubic"===n?i.push("bicubic"):"bilinear"===n&&"stretch"===r&&null!=s?(i.push("bilinear"),i.push("nnedge")):t&&"bilinear"===n&&i.push("bilinear"),e.isRendereredSource?i.push("noop"):s&&i.push("applyColormap"),e.transformGrid&&(i.push("applyProjection"),1===e.transformGrid.spacing[0]&&i.push("lookupProjection")),i}}var u=i(656),h=i(226);const d={nearest:{defines:[],samplingMode:o.z.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:o.z.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:o.z.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:o.z.LINEAR_MIPMAP_LINEAR,mips:!0}};class f extends a.a{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_position",0],["a_texcoord",1]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e},t){e.setBlendingEnabled(!0),"additive"===t.blendFunction?e.setBlendFunctionSeparate(o.b.ONE,o.b.ONE,o.b.ONE,o.b.ONE):e.setBlendFunctionSeparate(o.b.ONE,o.b.ONE_MINUS_SRC_ALPHA,o.b.ONE,o.b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(o.h.EQUAL,t.stencilRef,255)}draw(e,t){const{context:i,renderingOptions:n,painter:r}=e;if(!t.source)return;e.timeline.begin(this.name),this._quad||(this._quad=new s.a(i,[0,0,1,0,0,1,1,1]));const a=((e,t,i)=>{if("dynamic"===i.samplingMode){const{state:i}=e,n=t.resolution/t.pixelRatio/i.resolution,r=Math.round(e.pixelRatio)!==e.pixelRatio,s=n>1.05||n<.95;return i.rotation||s||r||t.isSourceScaled||t.rotation?d.bilinear:d.nearest}return d[i.samplingMode]})(e,t,n),o=r.materialManager.getProgram(e,this._desc,a.defines),{coordScale:l,computedOpacity:c,transforms:u}=t;t.setSamplingProfile(a),t.bind(e.context,h.F),i.useProgram(o),o.setUniformMatrix3fv("u_dvsMat3",u.dvs),o.setUniform1i("u_texture",h.F),o.setUniform2fv("u_coordScale",l),o.setUniform1f("u_opacity",c),this._quad.draw(),e.timeline.end(this.name)}}var m=i(2),p=i(625),_=i(616),g=i(630),x=i(627);class y extends a.a{constructor(){super(...arguments),this._color=Object(p.a)(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:e}){e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setFaceCullingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(o.w.KEEP,o.w.KEEP,o.w.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(o.h.ALWAYS,0,255)}draw(e,t){const{context:i,state:n}=e,r=Object(_.g)("clip",{geometry:[{location:0,name:"a_pos",count:2,type:o.k.SHORT}]}),s=t.getVAO(i,n,r.attributes,r.bufferLayouts);Object(m.i)(s.indexBuffer)||(this._program||(this._program=Object(x.a)(i,g.a)),i.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",n.displayMat3),i.bindVAO(s),i.drawElements(o.r.TRIANGLES,s.indexBuffer.size,o.k.UNSIGNED_INT,0),i.bindVAO())}}var v=i(645),b=i(643),O=i(49),S=i(281),T=i(615),w=i(174),j=i(619),I=i(620);class M extends a.a{constructor(){super(...arguments),this._color=Object(p.a)(1,0,0,1),this._patternMatrix=Object(S.b)(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,t){const{context:i,painter:n,styleLayerUID:r}=e;this._loadWGLResources(e);const s=e.displayLevel,a=e.styleLayer,l=a.backgroundMaterial,c=n.vectorTilesMaterialManager,u=a.getPaintValue("background-color",s),d=a.getPaintValue("background-opacity",s),f=a.getPaintValue("background-pattern",s),p=void 0!==f,_=u[3]*d,g=1|window.devicePixelRatio,x=e.spriteMosaic;let y,v;const b=g>h.Q?2:1,S=e.drawPhase===T.c.HITTEST,j=this._programOptions;j.id=S,j.pattern=p;const I=c.getMaterialProgram(i,l,j);if(i.bindVAO(this._vao),i.useProgram(I),p){const e=x.getMosaicItemPosition(f,!0);if(Object(m.j)(e)){const{tl:t,br:n,page:r}=e;y=n[0]-t[0],v=n[1]-t[1];const s=x.getPageSize(r);Object(m.j)(s)&&(x.bind(i,o.z.LINEAR,r,h.S),I.setUniform4f("u_tlbr",t[0],t[1],n[0],n[1]),I.setUniform2fv("u_mosaicSize",s),I.setUniform1i("u_texture",h.S))}I.setUniform1f("u_opacity",d)}else this._color[0]=_*u[0],this._color[1]=_*u[1],this._color[2]=_*u[2],this._color[3]=_,I.setUniform4fv("u_color",this._color);if(I.setUniform1f("u_depth",a.z||0),S){const e=Object(w.c)(r+1);I.setUniform4fv("u_id",e)}for(const h of t){if(I.setUniform1f("u_coord_range",h.rangeX),I.setUniformMatrix3fv("u_dvsMat3",h.transforms.dvs),p){const e=Math.max(2**(Math.round(s)-h.key.level),1),t=b*h.width*e,i=t/Object(O.j)(y),n=t/Object(O.j)(v);this._patternMatrix[0]=i,this._patternMatrix[4]=n,I.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}i.setStencilFunction(o.h.EQUAL,h.stencilRef,255),i.drawArrays(o.r.TRIANGLE_STRIP,0,4)}}_loadWGLResources(e){if(this._vao)return;const{context:t,styleLayer:i}=e,n=i.backgroundMaterial,r=new Int8Array([0,0,1,0,0,1,1,1]),s=j.a.createVertex(t,o.D.STATIC_DRAW,r),a=new I.a(t,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:s});this._vao=a}}var E=i(622);class C extends a.a{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(e,t){const{context:i,displayLevel:n,requiredLevel:r,state:s,drawPhase:a,painter:l,spriteMosaic:c,styleLayerUID:u}=e;if(!t.some(e=>{var t,i;return null!=(t=null==(i=e.layerData.get(u))?void 0:i.circleIndexCount)&&t}))return;const h=e.styleLayer,d=h.circleMaterial,f=l.vectorTilesMaterialManager,p=h.getPaintValue("circle-translate",n),_=h.getPaintValue("circle-translate-anchor",n),g=a===T.c.HITTEST,x=this._programOptions;x.id=g;const y=f.getMaterialProgram(i,d,x);i.useProgram(y),y.setUniformMatrix3fv("u_displayMat3",_===E.i.VIEWPORT?s.displayMat3:s.displayViewMat3),y.setUniform2fv("u_circleTranslation",p),y.setUniform1f("u_depth",h.z),y.setUniform1f("u_antialiasingWidth",1.2);let v=-1;if(g){const e=Object(w.c)(u+1);y.setUniform4fv("u_id",e)}for(const b of t){if(!b.layerData.has(u))continue;b.key.level!==v&&(v=b.key.level,d.setDataUniforms(y,n,h,v,c));const e=b.layerData.get(u);if(!e.circleIndexCount)continue;e.prepareForRendering(i);const t=e.circleVertexArrayObject;Object(m.i)(t)||(i.bindVAO(t),y.setUniformMatrix3fv("u_dvsMat3",b.transforms.dvs),r!==b.key.level?i.setStencilFunction(o.h.EQUAL,b.stencilRef,255):i.setStencilFunction(o.h.GREATER,255,255),i.drawElements(o.r.TRIANGLES,e.circleIndexCount,o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*e.circleIndexStart),b.triangleCount+=e.circleIndexCount/3)}}}class R extends a.a{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,t){const{displayLevel:i,drawPhase:n,renderPass:r,spriteMosaic:s,styleLayerUID:a}=e;let o=!1;for(const v of t)if(v.layerData.has(a)){const e=v.layerData.get(a);if(e.fillIndexCount>0||e.outlineIndexCount>0){o=!0;break}}if(!o)return;const l=e.styleLayer,c=l.getPaintProperty("fill-pattern"),u=void 0!==c,h=u&&c.isDataDriven;let d;if(u&&!h){const e=c.getValue(i);d=s.getMosaicItemPosition(e,!0)}const f=!u&&l.getPaintValue("fill-antialias",i);let m,p=!0,_=1;if(!u){const e=l.getPaintProperty("fill-color"),t=l.getPaintProperty("fill-opacity");if(!(null!=e&&e.isDataDriven||null!=t&&t.isDataDriven)){const e=l.getPaintValue("fill-color",i);_=l.getPaintValue("fill-opacity",i)*e[3],_>=1&&(p=!1)}}if(p&&"opaque"===r)return;n===T.c.HITTEST&&(m=Object(w.c)(a+1));const g=l.getPaintValue("fill-translate",i),x=l.getPaintValue("fill-translate-anchor",i);(p||"translucent"!==r)&&this._drawFill(e,a,l,t,g,x,u,d,h,m);const y=!l.hasDataDrivenOutlineColor&&l.outlineUsesFillColor&&_<1;f&&"opaque"!==r&&!y&&this._drawOutline(e,a,l,t,g,x,m)}_drawFill(e,t,i,n,r,s,a,l,c,u){if(a&&!c&&Object(m.i)(l))return;const{context:d,displayLevel:f,state:p,drawPhase:_,painter:g,pixelRatio:x,spriteMosaic:y}=e,v=i.fillMaterial,b=g.vectorTilesMaterialManager,O=x>h.Q?2:1,S=_===T.c.HITTEST,w=this._fillProgramOptions;w.id=S,w.pattern=a;const j=b.getMaterialProgram(d,v,w);if(d.useProgram(j),Object(m.j)(l)){const{page:e}=l,t=y.getPageSize(e);Object(m.j)(t)&&(y.bind(d,o.z.LINEAR,e,h.S),j.setUniform2fv("u_mosaicSize",t),j.setUniform1i("u_texture",h.S))}j.setUniformMatrix3fv("u_displayMat3",s===E.i.VIEWPORT?p.displayMat3:p.displayViewMat3),j.setUniform2fv("u_fillTranslation",r),j.setUniform1f("u_depth",i.z+1/65536),S&&j.setUniform4fv("u_id",u);let I=-1;for(const T of n){if(!T.layerData.has(t))continue;T.key.level!==I&&(I=T.key.level,v.setDataUniforms(j,f,i,I,y));const e=T.layerData.get(t);if(!e.fillIndexCount)continue;e.prepareForRendering(d);const n=e.fillVertexArrayObject;if(!Object(m.i)(n)){if(d.bindVAO(n),j.setUniformMatrix3fv("u_dvsMat3",T.transforms.dvs),d.setStencilFunction(o.h.EQUAL,T.stencilRef,255),a){const e=Math.max(2**(Math.round(f)-T.key.level),1),t=T.rangeX/(O*T.width*e);j.setUniform1f("u_patternFactor",t)}if(c){const t=e.patternMap;if(!t)continue;for(const[e,i]of t){const t=y.getPageSize(e);Object(m.j)(t)&&(y.bind(d,o.z.LINEAR,e,h.S),j.setUniform2fv("u_mosaicSize",t),j.setUniform1i("u_texture",h.S),d.drawElements(o.r.TRIANGLES,i[1],o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]))}}else d.drawElements(o.r.TRIANGLES,e.fillIndexCount,o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*e.fillIndexStart);T.triangleCount+=e.fillIndexCount/3}}}_drawOutline(e,t,i,n,r,s,a){const{context:l,displayLevel:c,state:u,drawPhase:h,painter:d,pixelRatio:f,spriteMosaic:p}=e,_=i.outlineMaterial,g=d.vectorTilesMaterialManager,x=.75/f,y=h===T.c.HITTEST,v=this._outlineProgramOptions;v.id=y;const b=g.getMaterialProgram(l,_,v);l.useProgram(b),b.setUniformMatrix3fv("u_displayMat3",s===E.i.VIEWPORT?u.displayMat3:u.displayViewMat3),b.setUniform2fv("u_fillTranslation",r),b.setUniform1f("u_depth",i.z+1/65536),b.setUniform1f("u_outline_width",x),y&&b.setUniform4fv("u_id",a);let O=-1;for(const S of n){if(!S.layerData.has(t))continue;S.key.level!==O&&(O=S.key.level,_.setDataUniforms(b,c,i,O,p));const e=S.layerData.get(t);if(e.prepareForRendering(l),!e.outlineIndexCount)continue;const n=e.outlineVertexArrayObject;Object(m.i)(n)||(l.bindVAO(n),b.setUniformMatrix3fv("u_dvsMat3",S.transforms.dvs),l.setStencilFunction(o.h.EQUAL,S.stencilRef,255),l.drawElements(o.r.TRIANGLES,e.outlineIndexCount,o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*e.outlineIndexStart),S.triangleCount+=e.outlineIndexCount/3)}}}class D extends a.a{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,t){const{context:i,displayLevel:n,state:r,drawPhase:s,painter:a,pixelRatio:l,spriteMosaic:c,styleLayerUID:u}=e;if(!t.some(e=>{var t,i;return null!=(t=null==(i=e.layerData.get(u))?void 0:i.lineIndexCount)&&t}))return;const d=e.styleLayer,f=d.lineMaterial,p=a.vectorTilesMaterialManager,_=d.getPaintValue("line-translate",n),g=d.getPaintValue("line-translate-anchor",n),x=d.getPaintProperty("line-pattern"),y=void 0!==x,v=y&&x.isDataDriven;let b,O;if(y&&!v){const e=x.getValue(n);b=c.getMosaicItemPosition(e)}let S=!1;if(!y){const e=d.getPaintProperty("line-dasharray");if(O=void 0!==e,S=O&&e.isDataDriven,O&&!S){const t=e.getValue(n),i=d.getDashKey(t,d.getLayoutValue("line-cap",n));b=c.getMosaicItemPosition(i)}}const j=1/l,I=s===T.c.HITTEST,M=this._programOptions;M.id=I,M.pattern=y,M.sdf=O;const C=p.getMaterialProgram(i,f,M);if(i.useProgram(C),C.setUniformMatrix3fv("u_displayViewMat3",r.displayViewMat3),C.setUniformMatrix3fv("u_displayMat3",g===E.i.VIEWPORT?r.displayMat3:r.displayViewMat3),C.setUniform2fv("u_lineTranslation",_),C.setUniform1f("u_depth",d.z),C.setUniform1f("u_antialiasing",j),I){const e=Object(w.c)(u+1);C.setUniform4fv("u_id",e)}if(b&&Object(m.j)(b)){const{page:e}=b,t=c.getPageSize(e);Object(m.j)(t)&&(c.bind(i,o.z.LINEAR,e,h.S),C.setUniform2fv("u_mosaicSize",t),C.setUniform1i("u_texture",h.S))}let R=-1;for(const T of t){if(!T.layerData.has(u))continue;T.key.level!==R&&(R=T.key.level,f.setDataUniforms(C,n,d,R,c));const e=2**(n-R)/l;C.setUniform1f("u_zoomFactor",e);const t=T.layerData.get(u);if(!t.lineIndexCount)continue;t.prepareForRendering(i);const r=t.lineVertexArrayObject;if(!Object(m.i)(r)){if(i.bindVAO(r),C.setUniformMatrix3fv("u_dvsMat3",T.transforms.dvs),i.setStencilFunction(o.h.EQUAL,T.stencilRef,255),v||S){const e=t.patternMap;if(!e)continue;for(const[t,n]of e){const e=c.getPageSize(t);Object(m.j)(e)&&(c.bind(i,o.z.LINEAR,t,h.S),C.setUniform2fv("u_mosaicSize",e),C.setUniform1i("u_texture",h.S),i.drawElements(o.r.TRIANGLES,n[1],o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*n[0]))}}else i.drawElements(o.r.TRIANGLES,t.lineIndexCount,o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t.lineIndexStart);T.triangleCount+=t.lineIndexCount/3}}}}var P=i(175),A=i(649),z=i(632);class L extends a.a{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=Object(P.a)()}dispose(){}drawMany(e,t){const{drawPhase:i,styleLayerUID:n}=e,r=e.styleLayer;let s;i===T.c.HITTEST&&(s=Object(w.c)(n+1)),this._drawIcons(e,r,t,s),this._drawText(e,r,t,s)}_drawIcons(e,t,i,n){const{context:r,displayLevel:s,drawPhase:a,painter:o,spriteMosaic:l,state:c,styleLayerUID:u}=e,d=t.iconMaterial,f=o.vectorTilesMaterialManager;let p,_=!1;for(const h of i)if(h.layerData.has(u)&&(p=h.layerData.get(u),p.iconPerPageElementsMap.size>0)){_=!0;break}if(!_)return;const g=t.getPaintValue("icon-translate",s),x=t.getPaintValue("icon-translate-anchor",s);let y=t.getLayoutValue("icon-rotation-alignment",s);y===E.a.AUTO&&(y=t.getLayoutValue("symbol-placement",s)===E.e.POINT?E.a.VIEWPORT:E.a.MAP);const v=y===E.a.MAP,b=t.getLayoutValue("icon-keep-upright",s)&&v,O=p.isIconSDF,S=a===T.c.HITTEST,w=this._iconProgramOptions;w.id=S,w.sdf=O;const j=f.getMaterialProgram(r,d,w);r.useProgram(j),j.setUniformMatrix3fv("u_displayViewMat3",y===E.a.MAP?c.displayViewMat3:c.displayMat3),j.setUniformMatrix3fv("u_displayMat3",x===E.i.VIEWPORT?c.displayMat3:c.displayViewMat3),j.setUniform2fv("u_iconTranslation",g),j.setUniform1f("u_depth",t.z),j.setUniform1f("u_mapRotation",Object(z.b)(c.rotation)),j.setUniform1f("u_keepUpright",b?1:0),j.setUniform1f("u_level",10*s),j.setUniform1i("u_texture",h.S),j.setUniform1f("u_fadeDuration",A.d/1e3),S&&j.setUniform4fv("u_id",n);let I=-1;for(const h of i){if(!h.layerData.has(u))continue;if(h.key.level!==I&&(I=h.key.level,d.setDataUniforms(j,s,t,I,l)),p=h.layerData.get(u),0===p.iconPerPageElementsMap.size)continue;p.prepareForRendering(r),p.updateOpacityInfo();const i=p.iconVertexArrayObject;if(!Object(m.i)(i)){r.bindVAO(i),j.setUniformMatrix3fv("u_dvsMat3",h.transforms.dvs),j.setUniform1f("u_time",(performance.now()-p.lastOpacityUpdate)/1e3);for(const[t,i]of p.iconPerPageElementsMap)this._renderIconRange(e,j,i,t,h)}}}_renderIconRange(e,t,i,n,r){const{context:s,spriteMosaic:a}=e;this._spritesTextureSize[0]=a.getWidth(n)/4,this._spritesTextureSize[1]=a.getHeight(n)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),a.bind(s,o.z.LINEAR,n,h.S),s.setStencilTestEnabled(!0),s.setStencilFunction(o.h.GREATER,255,255),s.setStencilWriteMask(0),s.drawElements(o.r.TRIANGLES,i[1],o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),r.triangleCount+=i[1]/3}_drawText(e,t,i,n){const{context:r,displayLevel:s,drawPhase:a,glyphMosaic:l,painter:c,pixelRatio:u,spriteMosaic:d,state:f,styleLayerUID:p}=e,_=t.textMaterial,g=c.vectorTilesMaterialManager;let x,y=!1;for(const o of i)if(o.layerData.has(p)&&(x=o.layerData.get(p),x.glyphPerPageElementsMap.size>0)){y=!0;break}if(!y)return;const v=t.getPaintProperty("text-opacity");if(v&&!v.isDataDriven&&0===v.getValue(s))return;const b=t.getPaintProperty("text-color"),O=!b||b.isDataDriven||b.getValue(s)[3]>0,S=t.getPaintProperty("text-halo-width"),w=t.getPaintProperty("text-halo-color"),j=(!S||S.isDataDriven||S.getValue(s)>0)&&(!w||w.isDataDriven||w.getValue(s)[3]>0);if(!O&&!j)return;let I=t.getLayoutValue("text-rotation-alignment",s);I===E.a.AUTO&&(I=t.getLayoutValue("symbol-placement",s)===E.e.POINT?E.a.VIEWPORT:E.a.MAP);const M=I===E.a.MAP,C=t.getLayoutValue("text-keep-upright",s)&&M,R=a===T.c.HITTEST,D=.8*3/u;this._glyphTextureSize||(this._glyphTextureSize=Object(P.b)(l.width/4,l.height/4));const L=t.getPaintValue("text-translate",s),F=t.getPaintValue("text-translate-anchor",s),V=this._sdfProgramOptions;V.id=R;const N=g.getMaterialProgram(r,_,V);r.useProgram(N),N.setUniformMatrix3fv("u_displayViewMat3",I===E.a.MAP?f.displayViewMat3:f.displayMat3),N.setUniformMatrix3fv("u_displayMat3",F===E.i.VIEWPORT?f.displayMat3:f.displayViewMat3),N.setUniform2fv("u_textTranslation",L),N.setUniform1f("u_depth",t.z+1/65536),N.setUniform2fv("u_mosaicSize",this._glyphTextureSize),N.setUniform1f("u_mapRotation",Object(z.b)(f.rotation)),N.setUniform1f("u_keepUpright",C?1:0),N.setUniform1f("u_level",10*s),N.setUniform1i("u_texture",h.R),N.setUniform1f("u_antialiasingWidth",D),N.setUniform1f("u_fadeDuration",A.d/1e3),R&&N.setUniform4fv("u_id",n);let U=-1;for(const h of i){if(!h.layerData.has(p))continue;if(h.key.level!==U&&(U=h.key.level,_.setDataUniforms(N,s,t,U,d)),x=h.layerData.get(p),0===x.glyphPerPageElementsMap.size)continue;x.prepareForRendering(r),x.updateOpacityInfo();const e=x.textVertexArrayObject;if(Object(m.i)(e))continue;r.bindVAO(e),N.setUniformMatrix3fv("u_dvsMat3",h.transforms.dvs),r.setStencilTestEnabled(!0),r.setStencilFunction(o.h.GREATER,255,255),r.setStencilWriteMask(0);const i=(performance.now()-x.lastOpacityUpdate)/1e3;N.setUniform1f("u_time",i),x.glyphPerPageElementsMap.forEach((e,t)=>{this._renderGlyphRange(r,e,t,l,N,j,O,h)})}}_renderGlyphRange(e,t,i,n,r,s,a,l){n.bind(e,o.z.LINEAR,i,h.R),s&&(r.setUniform1f("u_halo",1),e.drawElements(o.r.TRIANGLES,t[1],o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),l.triangleCount+=t[1]/3),a&&(r.setUniform1f("u_halo",0),e.drawElements(o.r.TRIANGLES,t[1],o.k.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),l.triangleCount+=t[1]/3)}}var F=i(379);class V extends a.a{constructor(){super(...arguments),this._computeDesc=null}prepareState({context:e},t,i){const n=i&&-1!==i.indexOf("hittest");e.setBlendingEnabled(!n),e.setBlendFunctionSeparate(o.b.ONE,o.b.ONE_MINUS_SRC_ALPHA,o.b.ONE,o.b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(o.h.EQUAL,t.stencilRef,255)}draw(e,t,i){const n=this.getGeometryType();t.commit(e);const r=t.getGeometry(n);Object(m.i)(r)||(e.timeline.begin(this.name),e.attributeView.bindTextures(e.context),r.forEachCommand(n=>this.drawGeometry(e,t,n,i)))}_setSharedUniforms(e,t,i){const{displayLevel:n,pixelRatio:r,state:s,passOptions:a}=t;Object(m.j)(a)&&"hittest"===a.type&&(e.setUniform2fv("u_hittestPos",a.position),e.setUniform1f("u_hittestDist",a.distance)),e.setUniform1f("u_pixelRatio",r),e.setUniformMatrix3fv("u_tileMat3",i.transforms.tileMat3),e.setUniformMatrix3fv("u_viewMat3",s.viewMat3),e.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs),e.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),e.setUniform1f("u_currentZoom",Math.round(n*h.w)),e.setUniform1i("u_attributeTextureSize",t.attributeView.size),e.setUniform1i("u_attributeData0",h.B),e.setUniform1i("u_attributeData1",h.C),e.setUniform1i("u_attributeData2",h.D),e.setUniform1i("u_attributeData3",h.E)}_setSizeVVUniforms(e,t,i,n){if(e.vvSizeMinMaxValue&&t.setUniform4fv("u_vvSizeMinMaxValue",i.vvSizeMinMaxValue),e.vvSizeScaleStops&&t.setUniform1f("u_vvSizeScaleStopsValue",i.vvSizeScaleStopsValue),e.vvSizeFieldStops){const e=i.getSizeVVFieldStops(n.key.level);t.setUniform1fv("u_vvSizeFieldStopsValues",e.values),t.setUniform1fv("u_vvSizeFieldStopsSizes",e.sizes)}e.vvSizeUnitValue&&t.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",i.vvSizeUnitValueToPixelsRatio)}_setColorAndOpacityVVUniforms(e,t,i){e.vvColor&&(t.setUniform1fv("u_vvColorValues",i.vvColorValues),t.setUniform4fv("u_vvColors",i.vvColors)),e.vvOpacity&&(t.setUniform1fv("u_vvOpacityValues",i.vvOpacityValues),t.setUniform1fv("u_vvOpacities",i.vvOpacities))}_setRotationVVUniforms(e,t,i){e.vvRotation&&t.setUniform1f("u_vvRotationType","geographic"===i.vvMaterialParameters.vvRotationType?0:1)}_getTriangleDesc(e){if(!this._computeDesc){const t=e.strides,i=e.strides.geometry,n=new Map(e.attributes),r=e.bufferLayouts.geometry.map(e=>({...e})),s=Math.max(...e.attributes.values()),a={geometry:r};a.geometry.push({count:2,name:"a_pos1",divisor:0,normalized:!1,offset:i,stride:i,type:o.k.SHORT}),a.geometry.push({count:2,name:"a_pos2",divisor:0,normalized:!1,offset:2*i,stride:i,type:o.k.SHORT}),n.set("a_pos1",s+1),n.set("a_pos2",s+2),this._computeDesc={bufferLayouts:a,attributes:n,strides:t}}return this._computeDesc}}var N=i(618),U=i(633),k=i(685),B=i(623);const G={marker:class extends V{dispose(){}getGeometryType(){return T.d.MARKER}drawGeometry(e,t,i,n){const{context:r,painter:s,rendererInfo:a,state:l,passOptions:c}=e,u=N.d.load(i.materialKey),{bufferLayouts:h,attributes:d}=(p=u,Object(_.g)(p.data,{geometry:[{location:0,name:"a_pos",count:2,type:o.k.SHORT},{location:1,name:"a_vertexOffset",count:2,type:o.k.SHORT},{location:2,name:"a_texCoords",count:2,type:o.k.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:o.k.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:o.k.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:o.k.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:o.k.UNSIGNED_SHORT}]})),f=s.materialManager.getMaterialProgram(e,u,"materials/icon",d,n);var p;r.useProgram(f),u.textureBinding&&s.textureManager.bindTextures(r,f,u,!0);let g=o.r.TRIANGLES;Object(m.j)(c)&&"hittest"===c.type&&(g=o.r.POINTS),this._setSharedUniforms(f,e,t);const x=u.vvRotation?l.displayViewMat3:l.displayMat3;f.setUniformMatrix3fv("u_displayMat3",x),this._setSizeVVUniforms(u,f,a,t),this._setColorAndOpacityVVUniforms(u,f,a),this._setRotationVVUniforms(u,f,a);const y=i.target.getVAO(r,h,d),v=i.indexFrom*Uint32Array.BYTES_PER_ELEMENT;r.bindVAO(y),r.drawElements(g,i.indexCount,o.k.UNSIGNED_INT,v)}},line:class extends V{dispose(){}getGeometryType(){return T.d.LINE}drawGeometry(e,t,i,n){const{context:r,painter:s,rendererInfo:a,displayLevel:l,passOptions:c}=e,u=N.c.load(i.materialKey);let h=(f=u,Object(_.g)(f.data,{geometry:[{location:0,name:"a_pos",count:2,type:o.k.SHORT},{location:1,name:"a_id",count:4,type:o.k.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_offsetAndNormal",count:4,type:o.k.BYTE},{location:4,name:"a_accumulatedDistanceAndHalfWidth",count:2,type:o.k.UNSIGNED_SHORT},{location:5,name:"a_tlbr",count:4,type:o.k.UNSIGNED_SHORT},{location:6,name:"a_segmentDirection",count:4,type:o.k.BYTE},{location:7,name:"a_aux",count:2,type:o.k.UNSIGNED_SHORT},{location:8,name:"a_zoomRange",count:2,type:o.k.UNSIGNED_SHORT}]})),d=o.r.TRIANGLES;var f;Object(m.j)(c)&&"hittest"===c.type&&(h=this._getTriangleDesc(h),d=o.r.POINTS);const{attributes:p,bufferLayouts:g}=h,x=s.materialManager.getMaterialProgram(e,u,"materials/line",p,n),y=1/e.pixelRatio;r.useProgram(x),this._setSharedUniforms(x,e,t),u.textureBinding&&s.textureManager.bindTextures(r,x,u);const v=2**(l-t.key.level)/e.pixelRatio;x.setUniform1f("u_zoomFactor",v),x.setUniform1f("u_blur",0+y),x.setUniform1f("u_antialiasing",y),this._setSizeVVUniforms(u,x,a,t),this._setColorAndOpacityVVUniforms(u,x,a),r.setFaceCullingEnabled(!1);const b=Object(m.j)(c)&&"hittest"===c.type,O=i.target.getVAO(r,g,p,b);let S=i.indexCount,T=i.indexFrom*Uint32Array.BYTES_PER_ELEMENT;b&&(S/=3,T/=3),r.bindVAO(O),r.drawElements(d,S,o.k.UNSIGNED_INT,T)}},fill:class extends V{constructor(){super(...arguments),this._dotTextureSize=0,this._dotTextures=null,this._dotSamplers=new Int32Array([h.K,h.L]),this._dotVAO=null,this._dotDesc={vsPath:"dot/dot",fsPath:"dot/dot",attributes:new Map([["a_pos",0]])}}dispose(){this._disposeTextures(),this._dotFBO=Object(m.e)(this._dotFBO),this._dotVAO=Object(m.e)(this._dotVAO)}getGeometryType(){return T.d.FILL}drawGeometry(e,t,i,n){const{context:r,painter:s,rendererInfo:a,requiredLevel:l,passOptions:c}=e,u=N.a.load(i.materialKey),h=s.materialManager;let d=o.r.TRIANGLES,f=(e=>{const t={geometry:[{location:0,name:"a_pos",count:2,type:o.k.SHORT},{location:1,name:"a_id",count:3,type:o.k.UNSIGNED_BYTE},{location:2,name:"a_bitset",count:1,type:o.k.UNSIGNED_BYTE}]};return e.dotDensity?(t.geometry.push({location:3,name:"a_inverseArea",count:1,type:o.k.FLOAT}),Object(_.g)(e.data,t)):(t.geometry.push({location:3,name:"a_color",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0}),e.simple||t.geometry.push({location:4,name:"a_aux1",count:4,type:o.k.UNSIGNED_SHORT}),t.geometry.push({location:5,name:"a_aux2",count:4,type:o.k.UNSIGNED_BYTE},{location:6,name:"a_aux3",count:4,type:o.k.UNSIGNED_BYTE}),e.simple||t.geometry.push({location:7,name:"a_zoomRange",count:2,type:o.k.UNSIGNED_SHORT}),Object(_.g)(e.data,t))})(u);Object(m.j)(c)&&"hittest"===c.type&&(f=this._getTriangleDesc(f),d=o.r.POINTS);const{attributes:p,bufferLayouts:g}=f,x=h.getMaterialProgram(e,u,"materials/fill",p,n);if(r.useProgram(x),this._setSharedUniforms(x,e,t),x.setUniform2f("u_tileOffset",512*t.key.col,512*t.key.row),u.textureBinding){s.textureManager.bindTextures(r,x,u);const i=1/2**(l-t.key.level)/e.pixelRatio;x.setUniform1f("u_zoomFactor",i)}const y=1/e.pixelRatio;x.setUniform1f("u_blur",y),x.setUniform1f("u_antialiasing",y),this._setSizeVVUniforms(u,x,a,t),this._setColorAndOpacityVVUniforms(u,x,a);const v=Object(m.j)(c)&&"hittest"===c.type,b=i.target.getVAO(r,g,p,v);let O=i.indexCount,S=i.indexFrom*Uint32Array.BYTES_PER_ELEMENT;if(v&&(O/=3,S/=3),r.bindVAO(b),!u.dotDensity||v)r.drawElements(d,O,o.k.UNSIGNED_INT,S);else{const i=this._drawDotLocations(e,t,x,O,S);this._drawDotDensity(e,t,i)}}_drawDotDensity(e,t,i){const{context:n,painter:r,rendererInfo:s}=e,a=r.materialManager.getProgram(e,this._dotDesc),l=this._createDotDensityMesh(n,this._dotDesc.attributes,{geometry:[{name:"a_pos",count:2,type:o.k.SHORT,divisor:0,normalized:!1,offset:0,stride:4}]});n.setStencilTestEnabled(!0),n.useProgram(a),a.setUniform1f("u_tileZoomFactor",1),a.setUniform1i("u_texture",this._dotSamplers[0]),a.setUniform1f("u_dotSize",Math.max(s.ddDotSize,1)),a.setUniform1f("u_pixelRatio",window.devicePixelRatio),this._setSharedUniforms(a,e,t),n.bindTexture(i,this._dotSamplers[0]),n.bindVAO(l),n.drawArrays(o.r.POINTS,0,262144)}_drawDotLocations(e,t,i,n,r){const{context:s,rendererInfo:a,requiredLevel:l}=e,c=s.getViewport();s.setViewport(0,0,512,512);const u=s.getBoundFramebufferObject(),d=this._createFBO(s);s.bindFramebuffer(d),s.setClearColor(0,0,0,0),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.STENCIL_BUFFER_BIT),s.setStencilTestEnabled(!1);const f=1/2**(l-t.key.level),m=h.P,p=m*window.devicePixelRatio*m*window.devicePixelRatio,_=1/f*(1/f),g=a.ddDotScale?e.state.scale/a.ddDotScale:1;return i.setUniform1f("u_tileZoomFactor",f),i.setUniform1f("u_tileDotsOverArea",p/(h.P*window.devicePixelRatio*h.P*window.devicePixelRatio)),i.setUniformMatrix4fv("u_dotColors",a.ddColors),i.setUniform4fv("u_isActive",a.ddActiveDots),i.setUniform4fv("u_dotBackgroundColor",a.ddBackgroundColor),i.setUniform1f("u_dotValue",Math.max(1,a.ddDotValue*g*_)),this._bindDotDensityTextures(s,i,a,m),s.drawElements(o.r.TRIANGLES,n,o.k.UNSIGNED_INT,r),s.setViewport(c.x,c.y,c.width,c.height),s.bindFramebuffer(u),d.colorTexture}_createFBO(e){if(Object(m.i)(this._dotFBO)){const t=512,i=512,n={target:o.A.TEXTURE_2D,pixelFormat:o.p.RGBA,dataType:o.q.UNSIGNED_BYTE,samplingMode:o.z.NEAREST,wrapMode:o.B.CLAMP_TO_EDGE,width:t,height:i},r={colorTarget:o.y.TEXTURE,depthStencilTarget:o.m.DEPTH_STENCIL_RENDER_BUFFER},s=new k.a(e,{width:t,height:i,internalFormat:o.s.DEPTH_STENCIL});this._dotFBO=new U.a(e,r,n,s)}return this._dotFBO}_disposeTextures(){if(this._dotTextures){for(let e=0;e<this._dotTextures.length;e++)this._dotTextures[e].dispose();this._dotTextures=null}}_bindDotDensityTextures(e,t,i,n){const r=this._createDotDensityTextures(e,n,i.ddSeed);t.setUniform1iv("u_dotTextures",this._dotSamplers);for(let s=0;s<r.length;s++)e.bindTexture(r[s],this._dotSamplers[s])}_createDotDensityMesh(e,t,i){if(Object(m.i)(this._dotVAO)){const n=2,r=new Int16Array(262144*n);for(let e=0;e<512;e++)for(let t=0;t<512;t++)r[n*(t+512*e)]=t,r[n*(t+512*e)+1]=e;const s=j.a.createVertex(e,o.D.STATIC_DRAW,r);this._dotVAO=new I.a(e,t,i,{geometry:s},null)}return this._dotVAO}_createDotDensityTextures(e,t,i){if(this._dotTextureSize===t&&this._seed===i||(this._disposeTextures(),this._dotTextureSize=t,this._seed=i),null===this._dotTextures){const n=new F.a(i);this._dotTextures=[this._allocDotDensityTexture(e,t,n),this._allocDotDensityTexture(e,t,n)]}return this._dotTextures}_allocDotDensityTexture(e,t,i){const n=new Float32Array(t*t*4);for(let r=0;r<n.length;r++)n[r]=i.getFloat();return new B.a(e,{wrapMode:o.B.REPEAT,pixelFormat:o.p.RGBA,dataType:o.q.FLOAT,samplingMode:o.z.NEAREST,width:t,height:t},n)}},text:class extends V{dispose(){}getGeometryType(){return T.d.TEXT}drawGeometry(e,t,i,n){const{context:r,painter:s,rendererInfo:a,state:l,passOptions:c}=e,u=N.f.load(i.materialKey),{bufferLayouts:h,attributes:d}=(p=u,Object(_.g)(p.data,{geometry:[{location:0,name:"a_pos",count:2,type:o.k.SHORT},{location:1,name:"a_id",count:4,type:o.k.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texFontSize",count:4,type:o.k.UNSIGNED_BYTE},{location:5,name:"a_aux",count:4,type:o.k.BYTE},{location:6,name:"a_zoomRange",count:2,type:o.k.UNSIGNED_SHORT},{location:7,name:"a_vertexOffset",count:2,type:o.k.SHORT},{location:8,name:"a_texCoords",count:2,type:o.k.UNSIGNED_SHORT}]})),f=s.materialManager.getMaterialProgram(e,u,"materials/text",d,n);var p;r.useProgram(f);let g=o.r.TRIANGLES;Object(m.j)(c)&&"hittest"===c.type&&(g=o.r.POINTS),this._setSharedUniforms(f,e,t),s.textureManager.bindTextures(r,f,u),f.setUniformMatrix3fv("u_displayMat3",l.displayMat3),f.setUniformMatrix3fv("u_displayViewMat3",l.displayViewMat3),this._setSizeVVUniforms(u,f,a,t),this._setColorAndOpacityVVUniforms(u,f,a),this._setRotationVVUniforms(u,f,a),f.setUniform1f("u_isHalo",1);const x=i.target.getVAO(r,h,d),y=i.indexFrom*Uint32Array.BYTES_PER_ELEMENT;r.bindVAO(x),r.drawElements(o.r.TRIANGLES,i.indexCount,o.k.UNSIGNED_INT,y),f.setUniform1f("u_isHalo",0),r.drawElements(g,i.indexCount,o.k.UNSIGNED_INT,y)}},label:class extends V{dispose(){}getGeometryType(){return T.d.LABEL}drawGeometry(e,t,i,n){const{context:r,painter:s,state:a,rendererInfo:l}=e,c=N.b.load(i.materialKey),u=c.mapAligned?1:0;if(!u&&Math.abs(t.key.level-Math.round(100*e.displayLevel)/100)>=1)return;const{bufferLayouts:h,attributes:d}=(e=>Object(_.g)(e.data,{geometry:[{location:0,name:"a_pos",count:2,type:o.k.SHORT},{location:1,name:"a_id",count:4,type:o.k.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:o.k.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texAndSize",count:4,type:o.k.UNSIGNED_BYTE},{location:5,name:"a_refSymbolAndPlacementOffset",count:4,type:o.k.UNSIGNED_BYTE},{location:6,name:"a_glyphData",count:4,type:o.k.UNSIGNED_BYTE},{location:7,name:"a_vertexOffset",count:2,type:o.k.SHORT},{location:8,name:"a_texCoords",count:2,type:o.k.UNSIGNED_SHORT}]}))(c),f=s.materialManager.getMaterialProgram(e,c,"materials/label",d,n);e.context.setStencilFunction(o.h.EQUAL,0,255),r.useProgram(f),this._setSharedUniforms(f,e,t),s.textureManager.bindTextures(r,f,c);const m=1===u?a.displayViewMat3:a.displayMat3;this._setSizeVVUniforms(c,f,l,t),f.setUniform1f("u_mapRotation",Math.floor(a.rotation/360*254)),f.setUniform1f("u_mapAligned",u),f.setUniformMatrix3fv("u_displayMat3",m),f.setUniform1f("u_opacity",1),f.setUniform2fv("u_screenSize",e.state.size),f.setUniform1f("u_isHalo",1);const p=i.target.getVAO(r,h,d),g=i.indexFrom*Uint32Array.BYTES_PER_ELEMENT;r.bindVAO(p),r.drawElements(o.r.TRIANGLES,i.indexCount,o.k.UNSIGNED_INT,g),f.setUniform1f("u_isHalo",0),r.drawElements(o.r.TRIANGLES,i.indexCount,o.k.UNSIGNED_INT,g),r.setStencilTestEnabled(!0),r.setBlendingEnabled(!0)}},clip:y,stencil:b.a,bitmap:f,raster:c,rasterVF:u.a,flow:n.a,tileInfo:v.a,vtlBackground:M,vtlFill:R,vtlLine:D,vtlCircle:C,vtlSymbol:L}},647:function(e,t,i){"use strict";i.d(t,"a",(function(){return f})),i.d(t,"b",(function(){return d})),i.d(t,"c",(function(){return x})),i.d(t,"d",(function(){return g})),i.d(t,"e",(function(){return m})),i.d(t,"f",(function(){return _})),i.d(t,"g",(function(){return p})),i.d(t,"h",(function(){return y}));var n=i(256),r=i(2),s=i(21),a=i(86),o=i(60),l=i(94),c=i(154),u=i(226),h=i(286);const d=512,f=50;function m(e,t){if(!t.isWrappable)return null;const[i,n]=Object(l.c)(t);return e[2]>n?[Object(o.g)([e[0],e[1],n,e[3]]),Object(o.g)([i,e[1],i+e[2]-n,e[3]])]:e[0]<i?[Object(o.g)([i,e[1],e[2],e[3]]),Object(o.g)([n-(i-e[0]),e[1],n,e[3]])]:null}function p(e){return"text"===e||"esriTS"===e}function _(e){return"simple-marker"===e||"picture-marker"===e||"esriSMS"===e||"esriPMS"===e}function g(e){switch(Object(r.q)(e.geometry).type){case"point":case"multipoint":return 0;case"polyline":return 1;case"polygon":case"extent":return 2}return 0}function x(e,t,i){var r,a,o;if(!i||0===i.glyphMosaicItems.length)return e;const l=Object(n.a)(t.text)[1],d=i.glyphMosaicItems,f=Object(h.a)(d,l,{scale:Object(s.c)(t.font.size)/u.r,angle:null!=(r=t.angle)?r:0,xOffset:null!=(a=t.xoffset)?a:0,yOffset:null!=(o=t.yoffset)?o:0,hAlign:Object(c.e)(t.horizontalAlignment||"center"),vAlign:Object(c.g)(t.verticalAlignment||"baseline"),maxLineWidth:Math.max(32,Math.min(t.lineWidth||512,512)),lineHeight:u.u*Math.max(.25,Math.min(t.lineHeight||1,4)),decoration:t.font.decoration||"none",isCIM:!1}).bounds;return e[0]=Object(s.c)(f.x-f.halfWidth),e[1]=Object(s.c)(f.y-f.halfHeight),e[2]=Object(s.c)(f.width),e[3]=Object(s.c)(f.height),e}function y(e){if(!e)return null;const{xmin:t,ymin:i,xmax:n,ymax:r,spatialReference:s}=e;return new a.a({rings:[[[t,i],[t,r],[n,r],[n,i],[t,i]]],spatialReference:s})}},648:function(e,t,i){"use strict";i.d(t,"a",(function(){return I}));i(5);var n=i(2),r=i(281),s=i(646),a=i(654),o=i(8),l=i(11),c=i(628),u=i(642),h=i(32),d=i(76),f=i(340),m=i(109),p=i(174),_=i(619),g=i(614);const x=l.a.getLogger("esri.views.2d.engine.webgl.Mesh2D"),y=(e,t,i,n)=>{let r=0;for(let s=1;s<i;s++){const i=e[2*(t+s-1)],n=e[2*(t+s-1)+1];r+=(e[2*(t+s)]-i)*(e[2*(t+s)+1]+n)}return n?r>0:r<0},v=({coords:e,lengths:t},i)=>{const n=[];for(let r=0,s=0;r<t.length;s+=t[r],r+=1){const a=s,o=[];for(;r<t.length-1&&y(e,s+t[r],t[r+1],i);r+=1,s+=t[r])o.push(s+t[r]-a);const l=e.slice(2*a,2*(s+t[r])),c=Object(u.a)(l,o,2);for(const e of c)n.push(e+a)}return n};class b{constructor(e,t,i,n=!1){this._cache={},this.vertices=e,this.indices=t,this.primitiveType=i,this.isMapSpace=n}static fromRect({x:e,y:t,width:i,height:n}){const r=e,s=t,a=r+i,o=s+n;return b.fromScreenExtent({xmin:r,ymin:s,xmax:a,ymax:o})}static fromPath(e){const t=Object(f.f)(new m.a,e.path,!1,!1),i=t.coords,n=new Uint32Array(v(t,!0)),r=new Uint32Array(i.length/2);for(let s=0;s<r.length;s++)r[s]=Object(p.a)(Math.floor(i[2*s]),Math.floor(i[2*s+1]));return new b({geometry:r},n,g.r.TRIANGLES)}static fromGeometry(e,t){const i=t.geometry.type;switch(i){case"polygon":return b.fromPolygon(e,t.geometry);case"extent":return b.fromMapExtent(e,t.geometry);default:return x.error(new o.a("mapview-bad-type","Unable to create a mesh from type "+i,t)),b.fromRect({x:0,y:0,width:1,height:1})}}static fromPolygon(e,t){const i=Object(f.g)(new m.a,t,!1,!1),n=i.coords,r=new Uint32Array(v(i,!1)),s=new Uint32Array(n.length/2),a=Object(d.a)(),o=Object(d.a)();for(let l=0;l<s.length;l++)Object(h.m)(a,n[2*l],n[2*l+1]),e.toScreen(o,a),s[l]=Object(p.a)(Math.floor(o[0]),Math.floor(o[1]));return new b({geometry:s},r,g.r.TRIANGLES,!0)}static fromScreenExtent({xmin:e,xmax:t,ymin:i,ymax:n}){const r={geometry:new Uint32Array([Object(p.a)(e,i),Object(p.a)(t,i),Object(p.a)(e,n),Object(p.a)(e,n),Object(p.a)(t,i),Object(p.a)(t,n)])},s=new Uint32Array([0,1,2,3,4,5]);return new b(r,s,g.r.TRIANGLES)}static fromMapExtent(e,t){const[i,n]=e.toScreen([0,0],[t.xmin,t.ymin]),[r,s]=e.toScreen([0,0],[t.xmax,t.ymax]),a={geometry:new Uint32Array([Object(p.a)(i,n),Object(p.a)(r,n),Object(p.a)(i,s),Object(p.a)(i,s),Object(p.a)(r,n),Object(p.a)(r,s)])},o=new Uint32Array([0,1,2,3,4,5]);return new b(a,o,g.r.TRIANGLES)}destroy(){Object(n.j)(this._cache.indexBuffer)&&this._cache.indexBuffer.dispose();for(const e in this._cache.vertexBuffers)Object(n.j)(this._cache.vertexBuffers[e])&&this._cache.vertexBuffers[e].dispose()}get elementType(){return(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")}})(this.indices)}getIndexBuffer(e,t=g.D.STATIC_DRAW){return this._cache.indexBuffer||(this._cache.indexBuffer=_.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((i,n)=>({...i,[n]:_.a.createVertex(e,t,this.vertices[n])}),{})),this._cache.vertexBuffers}}var O=i(620);const S=l.a.getLogger("esri.views.2d.engine.webgl.ClippingInfo"),T=e=>parseFloat(e)/100;class w 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 w(e,t)}_destroyGL(){Object(n.j)(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),Object(n.j)(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,i,r){const[s,a]=t.size;if("geometry"!==this._clip.type&&this._lastWidth===s&&this._lastHeight===a||(this._lastWidth=s,this._lastHeight=a,this._destroyGL()),Object(n.i)(this._cache.vao)){const n=this._createMesh(t,this._clip),s=n.getIndexBuffer(e),a=n.getVertexBuffers(e);this._cache.mesh=n,this._cache.vao=new O.a(e,i,r,a,s)}return this._cache.vao}_createTransforms(){return{dvs:Object(r.b)()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,t){const[i,n]=e.size,r="string"==typeof t.left?T(t.left)*i:t.left,s="string"==typeof t.right?T(t.right)*i:t.right,a="string"==typeof t.top?T(t.top)*n:t.top,o="string"==typeof t.bottom?T(t.bottom)*n:t.bottom,l=r,c=a;return{x:l,y:c,width:Math.max(i-s-l,0),height:Math.max(n-o-c,0)}}_createMesh(e,t){switch(t.type){case"rect":return b.fromRect(this._createScreenRect(e,t));case"path":return b.fromPath(t);case"geometry":return b.fromGeometry(e,t);default:return S.error(new o.a("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),b.fromRect({x:0,y:0,width:1,height:1})}}}var j=i(615);class I 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(r.b)()}}doRender(e){const t=this.createRenderParams(e),{painter:i,globalOpacity:n,profiler:r,drawPhase:s}=t,a=s===j.c.LABEL||s===j.c.HIGHLIGHT?1:n*this.computedOpacity;r.recordContainerStart(this.name),i.beforeRenderLayer(t,this._clippingInfos?255:0,a),this.updateTransforms(e.state),this.renderChildren(t),i.compositeLayer(t,a),r.recordContainerEnd()}renderChildren(e){Object(n.i)(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const i of this.children)i.beforeRender(e);for(const i of this._renderPasses)try{i.render(e)}catch(t){}for(const i of this.children)i.afterRender(e)}createRenderParams(e){return e.requireFBO=this.requiresDedicatedFBO,e}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[s.a.clip],target:()=>this._clippingInfos,drawPhase:j.c.MAP|j.c.LABEL|j.c.LABEL_ALPHA|j.c.DEBUG|j.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(n.j)(this._clippingInfos)&&(this._clippingInfos.forEach(e=>e.destroy()),this._clippingInfos=null),!this.stage)return;const e=this._clips;Object(n.j)(e)&&e.length&&(this._clippingInfos=e.items.map(e=>w.fromClipArea(this.stage,e))),this.requestRender()}}},649:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return s})),i.d(t,"c",(function(){return n})),i.d(t,"d",(function(){return a}));const n=!0,r=32,s=1.5,a=200},650:function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));i(5);var n=i(2),r=i(681),s=i(106),a=i(614),o=i(653);class l{constructor(e,t,i,n,l=new Map){this._context=e,this._locations=n,this._uniformBlockBindings=l,this._refCount=1,this._compiled=!1,this._nameToUniformLocation={},this._nameToUniform1={},this._nameToUniform1v={},this._nameToUniform2={},this._nameToUniform3={},this._nameToUniform4={},this._nameToUniformMatrix3={},this._nameToUniformMatrix4={},e||console.error("RenderingContext isn't initialized!"),0===t.length&&console.error("Shaders source should not be empty!"),this._context.type===s.a.WEBGL2&&(t=Object(o.a)(t,a.u.VERTEX_SHADER),i=Object(o.a)(i,a.u.FRAGMENT_SHADER)),this._vShader=u(this._context,a.u.VERTEX_SHADER,t),this._fShader=u(this._context,a.u.FRAGMENT_SHADER,i),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(a.t.Shader,this),Object(r.c)()&&(this.vertexShader=t,this.fragmentShader=i)}get glName(){if(Object(n.j)(this._glName))return this._glName;if(Object(n.i)(this._vShader))return null;const e=this._context.gl,t=e.createProgram();if(e.attachShader(t,this._vShader),e.attachShader(t,this._fShader),this._locations.forEach((i,n)=>e.bindAttribLocation(t,i,n)),e.linkProgram(t),Object(r.c)()&&!e.getProgramParameter(t,e.LINK_STATUS)&&console.error(`Could not link shader\nvalidated: ${e.getProgramParameter(t,e.VALIDATE_STATUS)}, gl error ${e.getError()}, vertex: ${e.getShaderParameter(this._vShader,e.COMPILE_STATUS)}, fragment: ${e.getShaderParameter(this._fShader,e.COMPILE_STATUS)}, info log: ${e.getProgramInfoLog(t)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`),this._context.type===s.a.WEBGL2){const i=e;for(const[e,n]of this._uniformBlockBindings){const r=i.getUniformBlockIndex(t,e);r<4294967295&&i.uniformBlockBinding(t,r,n)}}return this._glName=t,this._context.instanceCounter.increment(a.t.Program,this),t}get hasGLName(){return Object(n.j)(this._glName)}get isCompiled(){if(this._compiled)return!0;const e=this._context.gl.getExtension("KHR_parallel_shader_compile");return null==e?(this._compiled=!0,!0):(this._compiled=!!this._context.gl.getProgramParameter(this.glName,e.COMPLETION_STATUS_KHR),this._compiled)}dispose(){if(--this._refCount>0)return;const e=this._context.gl;this._vShader&&(e.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(a.t.Shader,this)),this._fShader&&(e.deleteShader(this._fShader),this._fShader=null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.t.Program,this))}ref(){++this._refCount}_getUniformLocation(e){return void 0===this._nameToUniformLocation[e]&&(this._nameToUniformLocation[e]=this._context.gl.getUniformLocation(this.glName,e)),this._nameToUniformLocation[e]}hasUniform(e){return null!==this._getUniformLocation(e)}setUniform1i(e,t){const i=this._nameToUniform1[e];void 0!==i&&t===i||(this._context.gl.uniform1i(this._getUniformLocation(e),t),this._nameToUniform1[e]=t)}setUniform1iv(e,t){const i=this._nameToUniform1v[e];c(i,t)&&(this._context.gl.uniform1iv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform1v[e]=Array.from(t):h(t,i))}setUniform2iv(e,t){const i=this._nameToUniform2[e];c(i,t)&&(this._context.gl.uniform2iv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform2[e]=Array.from(t):h(t,i))}setUniform3iv(e,t){const i=this._nameToUniform3[e];c(i,t)&&(this._context.gl.uniform3iv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform3[e]=Array.from(t):h(t,i))}setUniform4iv(e,t){const i=this._nameToUniform4[e];c(i,t)&&(this._context.gl.uniform4iv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform4[e]=Array.from(t):h(t,i))}setUniform1f(e,t){const i=this._nameToUniform1[e];void 0!==i&&t===i||(this._context.gl.uniform1f(this._getUniformLocation(e),t),this._nameToUniform1[e]=t)}setUniform1fv(e,t){const i=this._nameToUniform1v[e];c(i,t)&&(this._context.gl.uniform1fv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform1v[e]=Array.from(t):h(t,i))}setUniform2f(e,t,i){const n=this._nameToUniform2[e];void 0!==n&&t===n[0]&&i===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(e),t,i),void 0===n?this._nameToUniform2[e]=[t,i]:(n[0]=t,n[1]=i))}setUniform2fv(e,t){const i=this._nameToUniform2[e];c(i,t)&&(this._context.gl.uniform2fv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform2[e]=Array.from(t):h(t,i))}setUniform3f(e,t,i,n){const r=this._nameToUniform3[e];void 0!==r&&t===r[0]&&i===r[1]&&n===r[2]||(this._context.gl.uniform3f(this._getUniformLocation(e),t,i,n),void 0===r?this._nameToUniform3[e]=[t,i,n]:(r[0]=t,r[1]=i,r[2]=n))}setUniform3fv(e,t){const i=this._nameToUniform3[e];c(i,t)&&(this._context.gl.uniform3fv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform3[e]=Array.from(t):h(t,i))}setUniform4f(e,t,i,n,r){const s=this._nameToUniform4[e];void 0!==s&&t===s[0]&&i===s[1]&&n===s[2]&&r===s[3]||(this._context.gl.uniform4f(this._getUniformLocation(e),t,i,n,r),void 0===s?this._nameToUniform4[e]=[t,i,n,r]:(s[0]=t,s[1]=i,s[2]=n,s[3]=r))}setUniform4fv(e,t){const i=this._nameToUniform4[e];c(i,t)&&(this._context.gl.uniform4fv(this._getUniformLocation(e),t),void 0===i?this._nameToUniform4[e]=Array.from(t):h(t,i))}setUniformMatrix3fv(e,t,i=!1){const r=this._nameToUniformMatrix3[e];(function(e,t){return!!Object(n.i)(e)||(9!==e.length?c(e,t):9!==e.length||e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||e[4]!==t[4]||e[5]!==t[5]||e[6]!==t[6]||e[7]!==t[7]||e[8]!==t[8])})(r,t)&&(this._context.gl.uniformMatrix3fv(this._getUniformLocation(e),i,t),void 0===r?this._nameToUniformMatrix3[e]=Array.from(t):h(t,r))}setUniformMatrix4fv(e,t,i=!1){const r=this._nameToUniformMatrix4[e];(function(e,t){return!!Object(n.i)(e)||(16!==e.length?c(e,t):16!==e.length||e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||e[4]!==t[4]||e[5]!==t[5]||e[6]!==t[6]||e[7]!==t[7]||e[8]!==t[8]||e[9]!==t[9]||e[10]!==t[10]||e[11]!==t[11]||e[12]!==t[12]||e[13]!==t[13]||e[14]!==t[14]||e[15]!==t[15])})(r,t)&&(this._context.gl.uniformMatrix4fv(this._getUniformLocation(e),i,t),void 0===r?this._nameToUniformMatrix4[e]=Array.from(t):h(t,r))}stop(){}}function c(e,t){if(Object(n.i)(e)||e.length!==t.length)return!0;for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!0;return!1}function u(e,t,i){const n=e.gl,o=n.createShader(t);return n.shaderSource(o,i),n.compileShader(o),Object(r.c)()&&!n.getShaderParameter(o,n.COMPILE_STATUS)&&(console.error("Compile error in ".concat(t===a.u.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(n.getShaderInfoLog(o)),console.error(function(e){let t=2;return e.replace(/\n/g,()=>"\n"+function(e){return e>=1e3?e.toString():("  "+e).slice(-3)}(t++)+":")}(i)),e.type===s.a.WEBGL2&&(console.log("Shader source before transpilation:"),console.log(i))),o}function h(e,t){for(let i=0;i<e.length;++i)t[i]=e[i]}},651:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(e){this.readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,t=new Map){if(t.has(e))return t.get(e);const i=this._read(e);if(!i)throw new Error("cannot find shader file "+e);const n=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let r=n.exec(i);const s=[];for(;null!=r;)s.push({path:r[1],start:r.index,length:r[0].length}),r=n.exec(i);let a=0,o="";return s.forEach(e=>{o+=i.slice(a,e.start),o+=t.has(e.path)?"":this._resolve(e.path,t),a=e.start+e.length}),o+=i.slice(a),t.set(e,o),o}_read(e){return this.readFile(e)}}},652:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));class n{constructor(e,t){this.x=e,this.y=t}clone(){return new n(this.x,this.y)}equals(e,t){return e===this.x&&t===this.y}isEqual(e){return e.x===this.x&&e.y===this.y}setCoords(e,t){this.x=e,this.y=t}normalize(){const e=this.x,t=this.y,i=Math.sqrt(e*e+t*t);this.x/=i,this.y/=i}rightPerpendicular(){const e=this.x;this.x=this.y,this.y=-e}move(e,t){this.x+=e,this.y+=t}assign(e){this.x=e.x,this.y=e.y}assignAdd(e,t){this.x=e.x+t.x,this.y=e.y+t.y}assignSub(e,t){this.x=e.x-t.x,this.y=e.y-t.y}rotate(e,t){const i=this.x,n=this.y;this.x=i*e-n*t,this.y=i*t+n*e}scale(e){this.x*=e,this.y*=e}length(){const e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}static distance(e,t){const i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}static add(e,t){return new n(e.x+t.x,e.y+t.y)}static sub(e,t){return new n(e.x-t.x,e.y-t.y)}}var r;!function(e){e[e.Unknown=0]="Unknown",e[e.Point=1]="Point",e[e.LineString=2]="LineString",e[e.Polygon=3]="Polygon"}(r||(r={}))},653:function(e,t,i){"use strict";i.d(t,"a",(function(){return j}));i(5);var n=i(2),r=i(614);const s=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var a,o={exports:{}};void 0!==(a=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])&&(o.exports=a);const l=o.exports;var c,u={exports:{}};c=u,function(e){var t=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];void 0!==t&&(c.exports=t)}();const h=u.exports;var d,f={exports:{}};d=f,function(e){var t=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"];void 0!==t&&(d.exports=t)}();const m=f.exports;var p=999,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function g(){var e,t,i,n=0,r=0,s=p,a=[],o=[],c=1,u=0,d=0,f=!1,g=!1,x="";return function(e){return o=[],null!==e?v(e.replace?e.replace(/\r\n/g,"\n"):e):(a.length&&y(a.join("")),s=10,y("(eof)"),o)};function y(e){e.length&&o.push({type:_[s],data:e,position:d,line:c,column:u})}function v(t){var a;for(n=0,i=(x+=t).length;e=x[n],n<i;){switch(a=n,s){case 0:n=T();break;case 1:case 2:n=S();break;case 3:n=w();break;case 4:n=M();break;case 11:n=I();break;case 5:n=E();break;case 9999:n=C();break;case 9:n=O();break;case p:n=b()}a!==n&&("\n"===x[a]?(u=0,++c):++u)}return r+=n,x=x.slice(n),o}function b(){return a=a.length?[]:a,"/"===t&&"*"===e?(d=r+n-1,s=0,t=e,n+1):"/"===t&&"/"===e?(d=r+n-1,s=1,t=e,n+1):"#"===e?(s=2,d=r+n,n):/\s/.test(e)?(s=9,d=r+n,n):(f=/\d/.test(e),g=/[^\w_]/.test(e),d=r+n,s=f?4:g?3:9999,n)}function O(){return/[^\s]/g.test(e)?(y(a.join("")),s=p,n):(a.push(e),t=e,n+1)}function S(){return"\r"!==e&&"\n"!==e||"\\"===t?(a.push(e),t=e,n+1):(y(a.join("")),s=p,n)}function T(){return"/"===e&&"*"===t?(a.push(e),y(a.join("")),s=p,n+1):(a.push(e),t=e,n+1)}function w(){if("."===t&&/\d/.test(e))return s=5,n;if("/"===t&&"*"===e)return s=0,n;if("/"===t&&"/"===e)return s=1,n;if("."===e&&a.length){for(;j(a););return s=5,n}if(";"===e||")"===e||"("===e){if(a.length)for(;j(a););return y(e),s=p,n+1}var i=2===a.length&&"="!==e;if(/[\w_\d\s]/.test(e)||i){for(;j(a););return s=p,n}return a.push(e),t=e,n+1}function j(e){for(var t,i,n=0;;){if(t=h.indexOf(e.slice(0,e.length+n).join("")),i=h[t],-1===t){if(n--+e.length>0)continue;i=e.slice(0,1).join("")}return y(i),d+=i.length,(a=a.slice(i.length)).length}}function I(){return/[^a-fA-F0-9]/.test(e)?(y(a.join("")),s=p,n):(a.push(e),t=e,n+1)}function M(){return"."===e||/[eE]/.test(e)?(a.push(e),s=5,t=e,n+1):"x"===e&&1===a.length&&"0"===a[0]?(s=11,a.push(e),t=e,n+1):/[^\d]/.test(e)?(y(a.join("")),s=p,n):(a.push(e),t=e,n+1)}function E(){return"f"===e&&(a.push(e),t=e,n+=1),/[eE]/.test(e)||"-"===e&&/[eE]/.test(t)?(a.push(e),t=e,n+1):/[^\d]/.test(e)?(y(a.join("")),s=p,n):(a.push(e),t=e,n+1)}function C(){if(/[^\d\w_]/.test(e)){var i=a.join("");return s=l.indexOf(i)>-1?8:m.indexOf(i)>-1?7:6,y(a.join("")),s=p,n}return a.push(e),t=e,n+1}}function x(e){return function(e){var t=g(),i=[];return(i=i.concat(t(e))).concat(t(null))}(e)}const y=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function v(e,t){for(let i=t-1;i>=0;i--){const t=e[i];if("whitespace"!==t.type&&"block-comment"!==t.type){if("keyword"!==t.type)break;if("attribute"===t.data||"in"===t.data)return!0}}return!1}function b(e,t,i,n){n=n||i;for(const r of e)if("ident"===r.type&&r.data===i)return n in t?t[n]++:t[n]=0,b(e,t,n+"_"+t[n],n);return i}function O(e,t,i="afterVersion"){function n(e,t){for(let i=t;i<e.length;i++){const t=e[i];if("operator"===t.type&&";"===t.data)return i}return null}const r={data:"\n",type:"whitespace"},s=t=>t<e.length&&/[^\r\n]$/.test(e[t].data);let a=function(e){let t=-1,r=0,s=-1;for(let a=0;a<e.length;a++){const o=e[a];if("preprocessor"===o.type&&(o.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++r:o.data.match(/\#endif\s*.*/)&&--r),"afterVersion"!==i&&"afterPrecision"!==i||"preprocessor"===o.type&&/^#version/.test(o.data)&&(s=Math.max(s,a)),"afterPrecision"===i&&"keyword"===o.type&&"precision"===o.data){const t=n(e,a);if(null===t)throw new Error("precision statement not followed by any semicolons!");s=Math.max(s,t)}t<s&&0===r&&(t=a)}return t+1}(e);s(a-1)&&e.splice(a++,0,r);for(const o of t)e.splice(a++,0,o);s(a-1)&&s(a)&&e.splice(a,0,r)}function S(e,t,i,n="lowp"){O(e,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:n},{type:"whitespace",data:" "},{type:"keyword",data:i},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function T(e,t,i,n,r="lowp"){O(e,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"="},{type:"whitespace",data:" "},{type:"integer",data:n.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"keyword",data:i},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function w(e,t){let i,n,r=-1;for(let s=t;s<e.length;s++){const t=e[s];if("operator"===t.type&&("["===t.data&&(i=s),"]"===t.data)){n=s;break}"integer"===t.type&&(r=parseInt(t.data,10))}return i&&n&&e.splice(i,n-i+1),r}function j(e,t){const i=function(e){return I?M.get(e):null}(e);if(Object(n.j)(i))return i;const a=x(e);if("300 es"===function(e,t="100",i="300 es"){const n=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const r of e)if("preprocessor"===r.type){const e=n.exec(r.data);if(e){const n=e[1].replace(/\s\s+/g," ");if(n===i)return n;if(n===t)return r.data="#version "+i,t;throw new Error("unknown glsl version: "+n)}}return e.splice(0,0,{type:"preprocessor",data:"#version "+i},{type:"whitespace",data:"\n"}),null}(a,"100","300 es"))return e;let o=null,l=null;const c={},u={};for(let n=0;n<a.length;++n){const e=a[n];switch(e.type){case"keyword":t===r.u.VERTEX_SHADER&&"attribute"===e.data?e.data="in":"varying"===e.data&&(e.data=t===r.u.VERTEX_SHADER?"out":"in");break;case"builtin":if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(e.data.trim())&&(e.data=e.data.replace(/(2D|Cube|EXT)/g,"")),t===r.u.FRAGMENT_SHADER&&"gl_FragColor"===e.data&&(o||(o=b(a,c,"fragColor"),S(a,o,"vec4")),e.data=o),t===r.u.FRAGMENT_SHADER&&"gl_FragData"===e.data){const t=w(a,n+1),i=b(a,c,"fragData");T(a,i,"vec4",t,"mediump"),e.data=i}else t===r.u.FRAGMENT_SHADER&&"gl_FragDepthEXT"===e.data&&(l||(l=b(a,c,"gl_FragDepth")),e.data=l);break;case"ident":if(s.indexOf(e.data)>=0){if(t===r.u.VERTEX_SHADER&&v(a,n))throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");e.data in u||(u[e.data]=b(a,c,e.data)),e.data=u[e.data]}}}for(let n=a.length-1;n>=0;--n){const e=a[n];if("preprocessor"===e.type){const t=e.data.match(/\#extension\s+(.*)\:/);if(t&&t[1]&&y.indexOf(t[1].trim())>=0){const e=a[n+1];a.splice(n,e&&"whitespace"===e.type?2:1)}const i=e.data.match(/\#ifdef\s+(.*)/);i&&i[1]&&y.indexOf(i[1].trim())>=0&&(e.data="#if 1");const r=e.data.match(/\#ifndef\s+(.*)/);r&&r[1]&&y.indexOf(r[1].trim())>=0&&(e.data="#if 0")}}return function(e,t){return I&&M.set(e,t),t}(e,function(e){return e.map(e=>"eof"!==e.type?e.data:"").join("")}(a))}const I=!1,M=new Map},655:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i(2),r=i(617),s=i(614);class a extends r.a{dispose(){}prepareState(e){const{context:t}=e;t.setColorMask(!0,!0,!0,!0),t.setStencilFunction(s.h.EQUAL,0,255)}draw(e,t){const{context:i}=e,{displayData:r}=t;if(Object(n.i)(r))return;if("loaded"===r.state.name&&r.prepareForRendering(i),"attached"!==r.state.name)return;const a=r.state.resources;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunctionSeparate(s.b.ONE,s.b.ONE_MINUS_SRC_ALPHA,s.b.ONE,s.b.ONE);const o=[];"ramp"===a.values.lineColor.kind&&o.push("vvLineColor"),"ramp"===a.values.lineOpacity.kind&&o.push("vvLineOpacity"),"ramp"===a.values.lineRenderWidth.kind&&o.push("vvLineRenderWidth");const c=e.painter.materialManager.getProgram(e,{vsPath:"raster/flow",fsPath:"raster/flow",attributes:a.locations},o);i.useProgram(c),c.setUniform1f("u_time",e.time/1e3),c.setUniform1f("u_fadeDuration",r.flowStyle.renderSettings.fadeDuration),c.setUniform1f("u_lineSpeed",r.flowStyle.renderSettings.lineSpeed),c.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),c.setUniformMatrix3fv("u_displayViewMat3",e.state.displayViewMat3),l(c,"lineColor","vec4",r.flowStyle.renderSettings.lineColor),l(c,"lineOpacity","float",r.flowStyle.renderSettings.lineOpacity),l(c,"lineRenderWidth","float",r.flowStyle.renderSettings.lineRenderWidth),i.bindVAO(a.vertexArray),i.drawElements(s.r.TRIANGLES,a.indexBuffer.size,s.k.UNSIGNED_INT,0),r.flowStyle.animated&&t.requestRender()}}function o(e,t,i,n){switch(t){case"int":e.setUniform1iv(i,n);break;case"float":e.setUniform1fv(i,n);break;case"vec2":e.setUniform2fv(i,n);break;case"vec3":e.setUniform3fv(i,n);break;case"vec4":e.setUniform4fv(i,n)}}function l(e,t,i,n){"constant"===n.kind?o(e,i,"u_"+t,n.value):(o(e,"float",`u_${t}_stops`,n.stops),o(e,i,`u_${t}_values`,n.values),o(e,"int",`u_${t}_count`,[n.count]))}},656:function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var n=i(2),r=i(617),s=i(614);const a=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),o={beaufort_ft:a,beaufort_m:a,beaufort_km:a,beaufort_mi:a,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),single_arrow:new Float32Array([0,92/255,230/255,1]),wind_speed:new Float32Array([0,0,0,1])};class l extends r.a{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:e},t){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(s.b.ONE,s.b.ONE_MINUS_SRC_ALPHA,s.b.ONE,s.b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(s.w.KEEP,s.w.KEEP,s.w.REPLACE),e.setStencilFunction(s.h.EQUAL,t.stencilRef,255)}draw(e,t){if(Object(n.i)(t.source)||0===t.source.validPixelCount)return;const{timeline:i}=e;if(i.begin(this.name),t.updateVectorFieldVAO(e),"scalar"===e.renderPass){const i=t.vaoData.scalar;i&&this._drawScalars(e,t,i.vao,i.elementCount)}else{const i=t.vaoData.magdir;i&&this._drawTriangles(e,t,i.vao,i.elementCount)}i.end(this.name)}_drawTriangles(e,t,i,n){const{context:r,painter:a}=e,{symbolizerParameters:l}=t,c=l.dataRange?["dataRange"]:[];"geographic"===l.rotationType&&c.push("rotationGeographic");const u=a.materialManager.getProgram(e,this._desc.magdir,c);r.useProgram(u);const{coordScale:h,opacity:d,transforms:f}=t;u.setUniform2fv("u_coordScale",h),u.setUniform1f("u_opacity",d),u.setUniformMatrix3fv("u_dvsMat3",f.dvs);const{style:m,dataRange:p,rotation:_,symbolPercentRange:g}=l;u.setUniform4fv("u_colors",o[m]||o.single_arrow),u.setUniform2fv("u_dataRange",p),u.setUniform1f("u_rotation",_),u.setUniform2fv("u_symbolPercentRange",g);const x=this._getSymbolSize(e,t);u.setUniform2fv("u_symbolSize",x),r.bindVAO(i),r.drawElements(s.r.TRIANGLES,n,s.k.UNSIGNED_INT,0)}_drawScalars(e,t,i,n){const{context:r,painter:a}=e,{symbolizerParameters:o}=t,l=[];"wind_speed"===o.style?l.push("innerCircle"):o.dataRange&&l.push("dataRange"),"geographic"===o.rotationType&&l.push("rotationGeographic");const c=a.materialManager.getProgram(e,this._desc.scalar,l);r.useProgram(c);const{coordScale:u,opacity:h,transforms:d}=t;c.setUniform2fv("u_coordScale",u),c.setUniform1f("u_opacity",h),c.setUniformMatrix3fv("u_dvsMat3",d.dvs);const{dataRange:f,symbolPercentRange:m}=o;c.setUniform2fv("u_dataRange",f),c.setUniform2fv("u_symbolPercentRange",m);const p=this._getSymbolSize(e,t);c.setUniform2fv("u_symbolSize",p),r.bindVAO(i),r.drawElements(s.r.TRIANGLES,n,s.k.UNSIGNED_INT,0)}_getSymbolSize(e,t){const i=t.key?2**(e.displayLevel-t.key.level):t.resolution/e.state.resolution,{symbolTileSize:n}=t.symbolizerParameters;return[n/(Math.round((t.width-t.offset[0])/n)*n)/i,n/(Math.round((t.height-t.offset[1])/n)*n)/i]}}},657:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(e,t){this._pos=0;const i=t?this._roundToNearest(t,e.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(i),this._buffer=new e(this._array),this._ctor=e,this._i16View=new Int16Array(this._array)}get length(){return this._pos}_roundToNearest(e,t){const i=Math.round(e);return i+(t-i%t)}_ensureSize(e){if(this._pos+e>=this._buffer.length){const t=this._roundToNearest(1.25*(this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(t),n=new this._ctor(i);n.set(this._buffer,0),this._array=i,this._buffer=n,this._i16View=new Int16Array(this._array)}}ensureSize(e){this._ensureSize(e)}writeF32(e){this._ensureSize(1);const t=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,t}push(e){this._ensureSize(1);const t=this._pos;return this._buffer[this._pos++]=e,t}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,t){this._buffer[e]=t}i1616Add(e,t,i){this._i16View[2*e]+=t,this._i16View[2*e+1]+=i}getValue(e){return this._buffer[e]}incr(e){if(this._buffer.length<e)throw new Error("Increment index overflows the target buffer");this._buffer[e]++}decr(e){this._buffer[e]--}writeRegion(e){this._ensureSize(e.length);const t=this._pos;return this._buffer.set(e,this._pos),this._pos+=e.length,t}writeManyFrom(e,t,i){this._ensureSize(i-t);for(let n=t;n!==i;n++)this.writeFixed(e._buffer[n])}buffer(){const e=this._array.slice(0,4*this._pos);return this.destroy(),e}toArray(){const e=this._array,t=[];for(let i=0;i<e.byteLength/4;i++)t.push(e[i]);return t}seek(e){this._pos=e}destroy(){this._array=null,this._buffer=null}}},658:function(e,t,i){"use strict";i.d(t,"a",(function(){return d})),i.d(t,"b",(function(){return f}));var n=i(2),r=i(208),s=i(281),a=i(175),o=i(659),l=i(628),c=i(614),u=i(639);const h={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class d extends l.a{constructor(e=null,t=null,i=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._supportsBilinearTexture=!0,this.stencilRef=0,this.coordScale=[1,1],this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=i}destroy(){const e=this.getTextures();null==e||e.textures.forEach(e=>e.dispose()),this._rasterTexture=null,this._transformGridTexture=null,this._colormapTexture=null}get symbolizerParameters(){return this._symbolizerParameters||h}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdschanged(e)&&this.invalidateTexture()}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(e)?c.z.LINEAR:c.z.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture&&(this._transformGridTexture.dispose(),this._transformGridTexture=null)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}_createTransforms(){return{dvs:Object(s.b)()}}setTransform(e){const t=Object(r.b)(this.transforms.dvs),[i,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,l=s*this.height,c=Math.PI*this.rotation/180;Object(r.c)(t,t,Object(a.b)(i,n)),Object(r.c)(t,t,Object(a.b)(o/2,l/2)),Object(r.k)(t,t,-c),Object(r.c)(t,t,Object(a.b)(-o/2,-l/2)),Object(r.g)(t,t,Object(a.b)(o,l)),Object(r.i)(this.transforms.dvs,e.displayViewMat3,t)}getTextures(){if(!this._rasterTexture)return null;const e=[],t=[];return this._transformGridTexture&&(t.push(this._transformGridTexture),e.push("u_transformGrid")),this._rasterTexture&&(t.push(this._rasterTexture),e.push("u_image")),this._colormapTexture&&(t.push(this._colormapTexture),e.push("u_colormap")),{names:e,textures:t}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){var t,i,n;if(!this.stage)return null==(t=this._rasterTexture)||t.dispose(),null==(i=this._transformGridTexture)||i.dispose(),null==(n=this._colormapTexture)||n.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,void(this._colormapTexture=null);const r=this._isValidSource(this.source);r&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(r?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=Object(u.c)(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}_createOrDestroyRasterTexture(e){var t,i;const r=Object(n.j)(this.source)?Object(o.h)(this.source,this.bandIds):null;if(!this._isValidSource(r))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=null==(t=e.capabilities.textureFloat)?void 0:t.textureFloatLinear;const a=this._getTextureSamplingMethod(this.interpolation),l=this.isRendereredSource||!(null!=(i=e.capabilities.textureFloat)&&i.textureFloat);this._rasterTexture=Object(u.b)(e,r,a,l),this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(e){const t=this._rasterTextureBandIds;return!(null==t&&null==e||t&&e&&t.join("")===e.join(""))}_isValidSource(e){var t;return Object(n.j)(e)&&(null==(t=e.pixels)?void 0:t.length)>0}_getTextureSamplingMethod(e){const{type:t,colormap:i}=this.symbolizerParameters,r="lut"===t||"stretch"===t&&Object(n.j)(i);return!this._supportsBilinearTexture||r||"bilinear"!==e&&"cubic"!==e?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,i=this.symbolizerParameters.colormap;return i?t?i.length!==t.length||i.some((e,i)=>e!==t[i])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=Object(u.a)(e,i),void(this._colormap=i)):void 0:(this._colormapTexture=Object(u.a)(e,i),void(this._colormap=i)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}}function f(e){return Object(n.j)(e.source)}},660:function(e,t,i){"use strict";i.d(t,"a",(function(){return m}));var n=i(0),r=i(20),s=i(101),a=i(85),o=i(284),l=i(11),c=i(2),u=i(156),h=i(1),d=(i(9),i(5),i(4),i(3));let f=class extends(Object(a.b)(Object(o.a)(Object(u.b)(s.a.EventedMixin(r.a))))){constructor(e){super(e),this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if("layerview:create-error"!==e.name){const t=this.layer&&this.layer.id||"no id",i=this.layer&&this.layer.title||"no title";throw l.a.getLogger(this.declaredClass).error("#resolve()",`Failed to resolve layer view (layer title: '${i}', id: '${t}')`,e),e}})}get fullOpacity(){return Object(c.r)(this.get("layer.opacity"),1)*Object(c.r)(this.get("parent.fullOpacity"),1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer.legendEnabled}get updating(){var e;return!!(null!=(e=this.updatingHandles)&&e.updating||this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){var e;return!0===(null==(e=this.layer)?void 0:e.visible)}set visible(e){void 0!==e?this._override("visible",e):this._clearOverride("visible")}canResume(){var e,t,i;return this.visible&&(null==(e=this.layer)?void 0:e.loaded)&&!(null!=(t=this.parent)&&t.suspended)&&(null==(i=this.view)?void 0:i.ready)||!1}getSuspendInfo(){const e=this.parent&&this.parent.suspended?this.parent.suspendInfo:{};return this.view&&this.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};Object(n.a)([Object(h.b)()],f.prototype,"fullOpacity",null),Object(n.a)([Object(h.b)()],f.prototype,"layer",void 0),Object(n.a)([Object(h.b)()],f.prototype,"parent",void 0),Object(n.a)([Object(h.b)({readOnly:!0})],f.prototype,"suspended",null),Object(n.a)([Object(h.b)({readOnly:!0})],f.prototype,"suspendInfo",null),Object(n.a)([Object(h.b)({readOnly:!0})],f.prototype,"legendEnabled",null),Object(n.a)([Object(h.b)({type:Boolean,readOnly:!0})],f.prototype,"updating",null),Object(n.a)([Object(h.b)({readOnly:!0})],f.prototype,"updatingProgress",null),Object(n.a)([Object(h.b)()],f.prototype,"visible",null),Object(n.a)([Object(h.b)()],f.prototype,"view",void 0),f=Object(n.a)([Object(d.a)("esri.views.layers.LayerView")],f);const m=f},661:function(e,t,i){"use strict";i.d(t,"a",(function(){return M}));var n=i(0),r=i(24),s=i(107),a=i(8),o=i(31),l=i(1),c=(i(9),i(5),i(4),i(3)),u=i(654),h=i(10);i(11),i(119);let d=class extends h.a{};d=Object(n.a)([Object(c.a)("esri.views.layers.support.ClipArea")],d);const f=d;var m;let p=m=class extends f{constructor(){super(...arguments),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new m({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}get version(){return(this._get("version")||0)+1}};Object(n.a)([Object(l.b)({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),Object(n.a)([Object(l.b)({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),Object(n.a)([Object(l.b)({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),Object(n.a)([Object(l.b)({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),Object(n.a)([Object(l.b)({readOnly:!0})],p.prototype,"version",null),p=m=Object(n.a)([Object(c.a)("esri.views.layers.support.ClipRect")],p);const _=p;i(64);var g,x=i(68),y=i(15),v=i(35),b=i(86);const O={base:x.a,key:"type",typeMap:{extent:v.a,polygon:b.a}};let S=g=class extends f{constructor(){super(...arguments),this.type="geometry",this.geometry=null}get version(){return(this._get("version")||0)+1}clone(){return new g({geometry:this.geometry.clone()})}};Object(n.a)([Object(l.b)({types:O,json:{read:y.a,write:!0}})],S.prototype,"geometry",void 0),Object(n.a)([Object(l.b)({readOnly:!0})],S.prototype,"version",null),S=g=Object(n.a)([Object(c.a)("esri.views.layers.support.Geometry")],S);const T=S;let w=class extends f{constructor(){super(...arguments),this.type="path",this.path=[]}get version(){return(this._get("version")||0)+1}};Object(n.a)([Object(l.b)({type:[[[Number]]],json:{write:!0}})],w.prototype,"path",void 0),Object(n.a)([Object(l.b)({readOnly:!0})],w.prototype,"version",null),w=Object(n.a)([Object(c.a)("esri.views.layers.support.Path")],w);const j=w,I=r.a.ofType({key:"type",base:f,typeMap:{rect:_,path:j,geometry:T}}),M=e=>{let t=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new I,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1}initialize(){var e,t,i,n;const r=null==(e=null==(t=this.view)?void 0:t.spatialReferenceLocked)||e;(null==(i=this.view)?void 0:i.spatialReference)&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new a.a("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new u.a),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([Object(o.e)(()=>this.suspended,e=>{this.container&&(this.container.visible=!e),this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},o.d),Object(o.e)(()=>{var e,t;return null!=(e=null==(t=this.layer)?void 0:t.opacity)?e:1},e=>{this.container&&(this.container.opacity=e)},o.d),Object(o.e)(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",e=>{this.container&&(this.container.blendMode=e)},o.d),Object(o.e)(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},o.d),Object(o.b)(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)})]),null!=(n=this.view)&&n.whenLayerView?this.view.whenLayerView(this.layer).then(e=>{e===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var e;const t=null==(e=this.view)?void 0:e.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){var e;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!(null==(e=this.updatingHandles)||!e.updating))}get visibleAtCurrentScale(){return this.isVisibleAtScale(this.view.scale)}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.detach(),this.updateRequested=!1)}isVisibleAtScale(e){const t=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!t)return!0;const{minScale:i,maxScale:n}=t;return(0===i||e<=i)&&(0===n||e>=n)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}hitTest(e,t){return Promise.resolve(null)}supportsSpatialReference(e){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const e=super.getSuspendInfo(),t=!this.spatialReferenceSupported,i=this.visibleAtCurrentScale;return t&&(e.spatialReferenceNotSupported=t),i&&(e.outsideScaleRange=i),e}};return Object(n.a)([Object(l.b)()],t.prototype,"attached",void 0),Object(n.a)([Object(l.b)({type:I,set(e){const t=Object(s.b)(e,this._get("clips"),I);this._set("clips",t)}})],t.prototype,"clips",void 0),Object(n.a)([Object(l.b)()],t.prototype,"container",void 0),Object(n.a)([Object(l.b)()],t.prototype,"moving",void 0),Object(n.a)([Object(l.b)({readOnly:!0})],t.prototype,"spatialReferenceSupported",null),Object(n.a)([Object(l.b)({readOnly:!0})],t.prototype,"updateParameters",void 0),Object(n.a)([Object(l.b)()],t.prototype,"updateRequested",void 0),Object(n.a)([Object(l.b)()],t.prototype,"updating",null),Object(n.a)([Object(l.b)()],t.prototype,"view",void 0),Object(n.a)([Object(l.b)({readOnly:!0})],t.prototype,"visibleAtCurrentScale",null),t=Object(n.a)([Object(c.a)("esri.views.2d.layers.LayerView2D")],t),t}},662:function(e,t,i){"use strict";i.d(t,"a",(function(){return w}));i(64);var n,r,s,a=i(5),o=i(2),l=i(679),c=i(340),u=i(109),h=i(667),d=i(15);let f=0;const m=null!=(n=Object(a.a)("featurelayer-simplify-thresholds"))?n:[.5,.5,.5,.5],p=m[0],_=m[1],g=m[2],x=m[3],y=null!=(r=Object(a.a)("featurelayer-simplify-payload-size-factors"))?r:[1,2,4],v=y[0],b=y[1],O=y[2],S=null!=(s=Object(a.a)("featurelayer-simplify-mobile-factor"))?s:2,T=Object(a.a)("esri-mobile");class w{constructor(e,t){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.instance=e,this._layerSchema=t}static createInstance(){return f++,f=f>65535?0:f,f}get isEmpty(){return Object(o.j)(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let i=1;const n=T?S:1;t>4e6?i=O*n:t>1e6?i=b*n:t>5e5?i=v*n:t>1e5&&(i=n);let r=0;e>4e3?r=x*i:e>2e3?r=g*i:e>100?r=_:e>15&&(r=p);let s=8;return this._level<4?s=1:this._level<5?s=2:this._level<6&&(s=4),r*s}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,i,n){const r=this.copy();return r._tx+=e,r._ty+=t,r._sx*=i,r._sy*=n,r}readAttribute(e,t=!1){const i=this._readAttribute(e,t);if(void 0!==i)return i;for(const n of this._joined){n.setIndex(this.getIndex());const i=n._readAttribute(e,t);if(void 0!==i)return i}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const i=t._readAttributes();for(const t of Object.keys(i))e[t]=i[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}geometry(){const e=this.readHydratedGeometry(),t=Object(c.k)(e,this.geometryType,this.hasZ,this.hasM),i=Object(d.a)(t);return i&&(i.spatialReference=this._arcadeSpatialReference),i}field(e){if(this.hasField(e))return this.readAttribute(e,!0);for(const t of this._joined)if(t.setIndex(this.getIndex()),t.hasField(e))return t._readAttribute(e,!0);throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.getFieldNames()}castToText(){return JSON.stringify(this.readLegacyFeature())}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===(null==e?void 0:e.keepGeometryType)?this.geometry():this.geometry().toJSON()}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(Object(o.i)(this._objectIdToIndex)){const e=new Map,t=this.getCursor();for(;t.next();)e.set(t.getObjectId(),t.getIndex());this._objectIdToIndex=e}const t=this._objectIdToIndex;for(const i of e)t.has(i)&&this.removeAtIndex(t.get(i))}removeAtIndex(e){Object(o.i)(this._deleted)&&(this._deleted=h.a.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return Object(o.i)(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=Object(o.r)(this.getQuantizationTransform(),null);return Object(l.a)(new u.a,e,this.hasM,this.hasZ,t)}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}}},663:function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var n=i(8),r=i(11),s=i(615),a=i(616);const o=r.a.getLogger("esri.views.2d.engine.webgl");function l(e){return Object(a.u)(e.minDataValue)&&Object(a.u)(e.maxDataValue)&&null!=e.minSize&&null!=e.maxSize?s.e.SIZE_MINMAX_VALUE:(e.expression&&"view.scale"===e.expression||e.valueExpression&&"$view.scale"===e.valueExpression)&&Array.isArray(e.stops)?s.e.SIZE_SCALE_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&(Array.isArray(e.stops)||"levels"in e&&e.levels)?s.e.SIZE_FIELD_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&null!=e.valueUnit?s.e.SIZE_UNIT_VALUE:(o.error(new n.a("mapview-bad-type","Found invalid size VisualVariable",e)),s.e.NONE)}},664:function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return l}));var n=i(45),r=i(5);let s=null,a=null;async function o(){return s||(s=async function(){const e=Object(r.a)("esri-csp-restrictions")?await Promise.all([i.e(152),i.e(197)]).then(i.bind(null,737)).then(e=>e.l):await i.e(161).then(i.bind(null,738)).then(e=>e.l);a=await e.load({locateFile:()=>Object(n.a)("esri/core/libs/libtess/libtess.wasm")})}()),s}function l(e,t){const i=Math.max(e.length,128e3);return a.triangulate(e,t,i)}},665:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i(208),r=i(628),s=i(138);class a extends r.a{constructor(e,t,i,n,r,a=n,o=r){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new s.a(e),this.x=t,this.y=i,this.width=n,this.height=r,this.rangeX=a,this.rangeY=o}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(e,t){const i=t/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[s,a]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*i,l=this.height/this.rangeY*i;Object(n.l)(r,o,0,0,0,l,0,s,a,1),Object(n.i)(this.transforms.dvs,e.displayViewMat3,r)}}},666:function(e,t,i){"use strict";i.d(t,"a",(function(){return d})),i.d(t,"b",(function(){return p})),i.d(t,"c",(function(){return g}));var n=i(2),r=i(77),s=i(677),a=i(27),o=i(52);const l=[0,0];function c(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,l),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,l),[i.xmax,i.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:u(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:u(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:h(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:void 0}function u(e,t){const i=[];for(const n of e)i.push(h(n,t));return i}function h(e,t){const i=[];for(const n of e){const e=t(n[0],n[1],[0,0]);i.push(e),n.length>2&&e.push(n[2]),n.length>3&&e.push(n[3])}return i}async function d(e,t){if(!t)return;const i=Array.isArray(e)?e.map(e=>Object(n.j)(e.geometry)&&e.geometry.spatialReference):[e];await Object(r.d)(i.map(e=>({source:e,dest:t})))}const f=c.bind(null,o.c),m=c.bind(null,o.f);function p(e,t,i){if(!e)return e;if(i||(i=t,t=e.spatialReference),!Object(a.l)(t)||!Object(a.l)(i)||Object(a.d)(t,i))return e;if(Object(o.a)(t,i)){const t=Object(a.p)(i)?f(e):m(e);return t.spatialReference=i,t}return Object(r.i)(s.a,[e],t,i,null)[0]}const _=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i){if(!e||!e.length||!t||!i||Object(a.d)(t,i))return e;const n={geometries:e,inSpatialReference:t,outSpatialReference:i,resolve:null};return this._jobs.push(n),new Promise(e=>{n.resolve=e,null===this._timer&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:n,resolve:l}=e;Object(o.a)(i,n)?Object(a.p)(n)?l(t.map(f)):l(t.map(m)):l(Object(r.i)(s.a,t,i,n,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function g(e,t,i){return _.push(e,t,i)}},667:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(e,t){this._mask=0,this._buf=e,this._mask=t}static fromBuffer(e,t){return new n(e,t)}static create(e,t=4294967295){const i=new Uint32Array(Math.ceil(e/32));return new n(i,t)}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<<t%32)}hasRange(e,t){let i=e,n=t;for(;i%32&&i!==n;){if(this.has(i))return!0;i++}for(;n%32&&i!==n;){if(this.has(i))return!0;n--}if(i===n)return!1;for(let r=i/32;r!==n/32;r++)if(this._buf[r])return!0;return!1}set(e){const t=this._mask&e,i=this._getIndex(t),n=1<<t%32;this._buf[i]|=n}setRange(e,t){let i=e,n=t;for(;i%32&&i!==n;)this.set(i++);for(;n%32&&i!==n;)this.set(n--);if(i!==n)for(let r=i/32;r!==n/32;r++)this._buf[r]=4294967295}unset(e){const t=this._mask&e,i=this._getIndex(t),n=1<<t%32;this._buf[i]&=4294967295^n}resize(e){const t=this._buf,i=new Uint32Array(Math.ceil(e/32));i.set(t),this._buf=i}or(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=e._buf[t];return this}and(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=e._buf[t];return this}xor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=e._buf[t];return this}ior(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=~e._buf[t];return this}iand(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=~e._buf[t];return this}ixor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=~e._buf[t];return this}any(){for(let e=0;e<this._buf.length;e++)if(this._buf[e])return!0;return!1}copy(e){for(let t=0;t<this._buf.length;t++)this._buf[t]=e._buf[t];return this}clone(){return new n(this._buf.slice(),this._mask)}clear(){for(let e=0;e<this._buf.length;e++)this._buf[e]=0}forEachSet(e){for(let t=0;t<this._buf.length;t++){let i=this._buf[t],n=32*t;if(i)for(;i;)1&i&&e(n),i>>>=1,n++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}}},668:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));const n=(e,t)=>e&&((...e)=>t.warn("DEBUG:",...e))||(()=>null),r=!1},669:function(e,t,i){"use strict";function n(e){const t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}i.d(t,"a",(function(){return n}))},670:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var n=i(5),r=i(615),s=i(648),a=i(645),o=i(643);const l=(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 s.a{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(l),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,i=super.createRenderParams(e);return i.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,i.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),i}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[o.a],drawPhase:r.c.DEBUG|r.c.MAP|r.c.HIGHLIGHT,target:()=>this.getStencilTarget()})),Object(n.a)("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[a.a],drawPhase:r.c.DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}updateTransforms(e){for(const t of this.children){const i=this._tileInfoView.getTileResolution(t.key);t.setTransform(e,i)}}setStencilReference(e){let t=1;for(const i of this.children)i.stencilRef=t++}}},671:function(e,t,i){"use strict";i.d(t,"a",(function(){return m}));var n=i(256),r=i(21),s=i(14),a=i(154),o=i(621),l=i(226),c=i(174),u=i(618),h=i(624),d=i(672),f=i(635);class m extends(Object(d.a)(f.a)){constructor(e,t,i,n,o,h,d,f,m,p,_,g,x,y,v,b,O,S,T=!1,w,j){super(),this._xOffset=Object(r.c)(x),this._yOffset=Object(r.c)(y),this._decoration=p||"none",this._color=o,this._haloColor=h,this._haloSize=Math.min(Math.floor(5*Object(r.c)(Object(r.e)(i))),127),this._size=Math.min(Math.round(Object(r.c)(t)),127);const I=Math.min(Math.round(Object(r.c)(n||t)),127);this._referenceSize=Math.round(Math.sqrt(256*I)),this._scale=this._size/l.r,this._angle=g,this._justify=Object(a.d)(d||"center"),this._xAlignD=Object(a.e)(d||"center"),this._yAlignD=Object(a.g)(f||"baseline"),this._baseline="baseline"===(f||"baseline"),this._bitset=(m===s.a.MAP?1:0)|(_?1:0)<<1;const M=u.e.load(e);M.sdf=!0,this._materialKey=M.data,this._lineWidth=Object(r.c)(v)||512,this._lineHeight=b||1,this._textPlacement=O,this._effects=S,this._isCIM=T,this._minMaxZoom=Object(c.a)(Math.round(w*l.w),Math.round(j*l.w))}static fromText(e,t){const i=new m(e.materialKey,e.font.size,e.haloSize||0,e.font.size,e.color&&Object(o.d)(e.color)||0,e.haloColor&&Object(o.d)(e.haloColor)||0,e.horizontalAlignment,e.verticalAlignment,s.a.SCREEN,e.font.decoration,!1,e.angle||0,e.xoffset,e.yoffset,e.lineWidth,e.lineHeight,null,null,!1,h.b,h.a),[,r]=Object(n.a)(e.text);return i.bindTextInfo(t,r),i._vertexBoundsScale=e.maxVVSize?e.maxVVSize/e.font.size:1,i}static fromCIMText(e,t,i){const r=e.scaleFactor||1,s=e.size*e.sizeRatio*r,[a,l]=Object(h.e)(e.scaleInfo,i),c=new m(e.materialKey,s,e.outlineSize*e.sizeRatio,e.referenceSize,Object(o.c)(e.color),Object(o.c)(e.outlineColor),e.horizontalAlignment,e.verticalAlignment,e.alignment,e.decoration,e.colorLocked,e.angle,e.offsetX*e.sizeRatio*r,e.offsetY*e.sizeRatio*r,512,1,e.markerPlacement,e.effects,!0,a,l),[,u]=Object(n.a)(e.text);return c.bindTextInfo(t,u),c._vertexBoundsScale=e.maxVVSize?e.maxVVSize/s:1,c}}},672:function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));var n=i(2),r=i(21),s=i(340),a=i(673),o=i(226),l=i(615),c=i(174),u=i(618),h=i(286);const d=e=>class extends e{constructor(...e){super(...e),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=l.d.TEXT,this._aux=Object(c.b)(0,0,this._referenceSize,this._bitset)}bindTextInfo(e,t){e&&e.length?this._shapingInfo=Object(n.b)(e,e=>Object(h.a)(e,t,{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.u*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM})):this._shapingInfo=null}_write(e,t,i,n){const r=t.getDisplayId();this._writeGeometry(e,t,r,i,n)}_writeGeometry(e,t,i,r,a){const o=this._shapingInfo;if(Object(n.i)(o))return;if(Object(n.j)(this._textPlacement)){const n=null!=a?a:t.readLegacyGeometryForDisplay();return this._writePlacedText(e,i,n,o,r)}const l=a?Object(s.p)(Object(s.d)(a),2):"esriGeometryPolygon"===t.geometryType?t.readCentroid():t.readGeometryForDisplay();if(!Object(n.i)(l)){if(l.isPoint){const[t,n]=l.coords;if(!e.hasAggregates&&e.hasPixelBufferEnabled&&(t<0||t>=512||n<0||n>=512))return;return this._writeGlyphs(e,i,{x:t,y:n},o)}l.forEachVertex((t,n)=>this._writeGlyphs(e,i,{x:t,y:n},o))}}_writePlacedText(e,t,i,s,o){const l=Object(n.q)(this._textPlacement),c=a.a.getPlacement(i,l,Object(r.c)(1),o.geometryEngine);if(!c)return;let u=c.next();for(;null!=u;){const i=-u.getAngle();s.setRotation(i);const n=u.tx,r=-u.ty;n<0||n>=512||r<0||r>=512||(this._writeGlyphs(e,t,{x:n,y:r},s),s.setRotation(-i)),u=c.next()}}_writeGlyphs(e,t,i,n){const r=u.e.load(this._materialKey),s=Object(c.a)(Math.round(8*i.x),Math.round(8*i.y)),a=this._vertexBoundsScale,o=n.bounds,l=2*Math.max(o.width,o.height);for(const c of n.glyphs)r.textureBinding=c.textureBinding,e.recordStart(t,r.data,this.geometryType,!0),e.vertexBounds(i.x+o.x+this._xOffset,i.y+o.y-this._yOffset,l*a,l*a),this._writeVertices(e,t,s,c),e.recordEnd()}_writeGlyph(e,t,i,n,r){const s=u.e.load(this._materialKey),a=Object(c.a)(Math.round(8*i),Math.round(8*n));s.textureBinding=r.textureBinding,e.recordStart(t,s.data,this.geometryType,!0);const o=r.bounds,l=this._vertexBoundsScale;e.vertexBounds(i+o.x*l,n+o.y*l,o.width*l,o.height*l),this._writeVertices(e,t,a,r),e.recordEnd()}_writeVertices(e,t,i,n){const r=e.vertexCount();this._writeVertexCommon(e,t,i,n),e.vertexWrite(n.offsets.upperLeft),e.vertexWrite(n.texcoords.upperLeft),e.vertexEnd(),this._writeVertexCommon(e,t,i,n),e.vertexWrite(n.offsets.upperRight),e.vertexWrite(n.texcoords.upperRight),e.vertexEnd(),this._writeVertexCommon(e,t,i,n),e.vertexWrite(n.offsets.lowerLeft),e.vertexWrite(n.texcoords.lowerLeft),e.vertexEnd(),this._writeVertexCommon(e,t,i,n),e.vertexWrite(n.offsets.lowerRight),e.vertexWrite(n.texcoords.lowerRight),e.vertexEnd(),e.indexWrite(r+0),e.indexWrite(r+1),e.indexWrite(r+2),e.indexWrite(r+1),e.indexWrite(r+3),e.indexWrite(r+2)}_writeVertexCommon(e,t,i,n){const r=this._color,s=this._haloColor,a=Object(c.b)(0,0,this._referenceSize,this._bitset),o=Object(c.b)(0,0,this._size,this._haloSize);e.vertexWrite(i),e.vertexWrite(t),e.vertexWrite(r),e.vertexWrite(s),e.vertexWrite(o),e.vertexWrite(a),e.vertexWrite(this._minMaxZoom)}}},673:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(44),r=i(230);class s{static getPlacement(e,t,i,s){const a=Object(r.b)(t);if(!a)return null;const o=Object(n.c)(e);return a.execute(o,t,i,s)}}},674:function(e,t,i){"use strict";i.d(t,"a",(function(){return p}));var n=i(2),r=i(21),s=i(155),a=i(175),o=i(14),l=i(621),c=i(226),u=i(174),h=i(618),d=i(624),f=i(675),m=i(635);class p extends(Object(f.a)(m.a)){constructor(e,t,i,n,r,l,d,f,m,p,_,g,x,y,v,b,O,S,T,w,j,I,M){super(),this.angle=n,this.height=d,this.width=l,this.xOffset=t*T,this.yOffset=i*T,this._markerPlacement=w,this._effects=j,this._anchorX=.5-(.5+b)*v.width/v.width,this._anchorY=.5-(.5+O)*v.height/v.height,this._minMaxZoom=Object(u.a)(Math.round(I*c.w),Math.round(M*c.w));const E=(y===o.a.MAP?c.i:c.j)|(_?c.g:0)|(x?c.k:0)|(g?c.l:0),C=v&&v.sdf,R=h.d.load(e);R.sdf=C,R.pattern=!0,R.textureBinding=v.textureBinding,this._materialKey=R.data,this._fillColor=r,this._outlineColor=m,this._sizeOutlineWidth=Object(u.b)(Math.round(Math.min(Math.sqrt(128*l),255)),Math.round(Math.min(Math.sqrt(128*d),255)),Math.round(Math.min(Math.sqrt(128*p),255)),Math.round(Math.min(Math.sqrt(128*f),255)));const D=v.rect.x+c.A,P=v.rect.y+c.A,A=D+v.width,z=P+v.height;this._offsets.xUpperLeft=D,this._offsets.yUpperLeft=P,this._offsets.xUpperRight=A,this._offsets.yUpperRight=P,this._offsets.xBottomLeft=D,this._offsets.yBottomLeft=z,this._offsets.xBottomRight=A,this._offsets.yBottomRight=z,this._texUpperLeft=Object(u.a)(D,P),this._texUpperRight=Object(u.a)(A,P),this._texBottomLeft=Object(u.a)(D,z),this._texBottomRight=Object(u.a)(A,z),l*=S,d*=S,l*=T,d*=T;const L=Math.round(64*S);this._bitestAndDistRatio=Object(u.a)(E,L),this._computedWidth=l,this._computedHeight=d;const F=Object(a.a)(),V=Object(s.a)();this._applyTransformation(V,F)}static fromCIMMarker(e,t,i){const s=t&&t.width||1,a=t&&t.height||1,c=e.size,u=s/a*e.scaleX,h=e.scaleSymbolsProportionally&&e.frameHeight?c/e.frameHeight:1;let f=Object(l.c)(e.color);const m=Object(l.c)(e.outlineColor),_=Object(r.c)(c),g=_*u,x=Object(r.c)(e.offsetX||0),y=Object(r.c)(e.offsetY||0),v=Object(r.c)(e.outlineWidth||0)*h,b=e.alignment||o.a.SCREEN,O=Object(r.c)(e.referenceSize),[S,T]=Object(d.e)(e.scaleInfo,i);t.sdf||0!==f||(f=-1);let w=e.rotation||0;e.rotateClockwise||(w=-w);let j=0,I=0;const M=e.anchorPoint;M&&(e.isAbsoluteAnchorPoint?c&&(j=-M.x/(c*u),I=M.y/c):(j=M.x,I=M.y));const E=new p(e.materialKey,x,y,w,f,g,_,O,m,v,e.colorLocked,e.scaleSymbolsProportionally,!1,b,t,j,I,e.sizeRatio,Object(n.r)(e.scaleFactor,1),e.markerPlacement,e.effects,S,T);return E._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/g:1,E._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/_:1,E}static fromPictureMarker(e,t){const i=Math.round(Object(r.c)(e.width)),n=Math.round(Object(r.c)(e.height)),s=c.z,a=Math.round(Object(r.c)(e.xoffset||0)),l=Math.round(Object(r.c)(e.yoffset||0)),u=new p(e.materialKey,a,l,e.angle,s,i,n,n,0,0,!1,!1,!1,o.a.SCREEN,t,0,0,1,1,null,null,d.b,d.a);return u._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/e.width:1,u._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/e.height:1,u}static fromSimpleMarker(e,t){const i=Object(l.d)(e.color),n=Math.round(Object(r.c)(e.size)),s=n,a=Math.round(Object(r.c)(e.xoffset||0)),c=Math.round(Object(r.c)(e.yoffset||0)),u=e.style,h=e.outline,f=0|(h&&h.color&&Object(l.d)(h.color)),m=0|(h&&h.width&&Math.round(Object(r.c)(h.width))),_=new p(e.materialKey,a,c,e.angle,i,n,s,s,f,m,!1,!1,"esriSMSCross"===u||"esriSMSX"===u,o.a.SCREEN,t,0,0,126/64,1,null,null,d.b,d.a);return _.boundsType="esriSMSCircle"===u?"circle":"square",_._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/e.size:1,_._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/e.size:1,_}static fromLineSymbolMarker(e,t){const i=Object(l.d)(e.color),n=Math.round(Object(r.c)(6*e.lineWidth)),s=n,a="cross"===e.style||"x"===e.style;let c;switch(e.placement){case"begin-end":c=o.e.Both;break;case"begin":c=o.e.JustBegin;break;case"end":c=o.e.JustEnd;break;default:c=o.e.None}const u={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:c,offsetAlongLine:0},h=new p(e.materialKey,0,0,0,i,n,s,s/6,i,a?Math.round(Object(r.c)(e.lineWidth)):0,!1,!1,a,o.a.MAP,t,0,0,126/64,1,u,null,d.b,d.a);return h.boundsType="circle"===e.style?"circle":"square",h}}},675:function(e,t,i){"use strict";i.d(t,"a",(function(){return m}));var n=i(2),r=i(21),s=i(62),a=i(155),o=i(32),l=i(175),c=i(340),u=i(673),h=i(615),d=i(174);const f=3.14159265359/180,m=e=>class extends e{constructor(...e){super(...e),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=h.d.MARKER}_write(e,t,i,n){const r=t.getDisplayId();e.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(e,t,r,i,n),e.recordEnd()}_writeGeometry(e,t,i,r,s){if(Object(n.j)(this._markerPlacement))return this._writePlacedMarkers(e,t,r,s);if(!s&&"esriGeometryPoint"===t.geometryType){const n=t.getX(),r=t.getY();if(!e.hasAggregates&&e.hasPixelBufferEnabled&&(n<0||n>=513||r<0||r>=513))return;return this._writeVertices(e,i,this._getPos(n,r),n,r)}const a=s?Object(c.p)(Object(c.d)(s),2):"esriGeometryPolygon"===t.geometryType?t.readCentroid():t.readGeometryForDisplay();if(!Object(n.i)(a)){if(a.isPoint){const[t,n]=a.coords;if(!e.hasAggregates&&e.hasPixelBufferEnabled&&(t<0||t>=512||n<0||n>=512))return;return this._writeVertices(e,i,this._getPos(t,n),t,n)}a.forEachVertex((t,n)=>this._writeVertices(e,i,this._getPos(t,n),t,n))}}_writePlacedMarkers(e,t,i,s){const o=null!=s?s:t.readLegacyGeometryForDisplay(),c=u.a.getPlacement(o,Object(n.q)(this._markerPlacement),Object(r.c)(1),i.geometryEngine);if(!c)return;const h=t.getDisplayId(),d=Object(l.a)(),m=Object(a.a)();let p=c.next();for(;null!=p;){const t=p.tx,i=-p.ty;t>=-128&&t<=640&&i>=-128&&i<=640&&(this._applyTransformation(m,d,-p.getAngle()/f),this._writeVertices(e,h,this._getPos(t,i),t,i)),p=c.next()}}_writeVertices(e,t,i,n,r){const s=e.vertexCount();if(this.angle){const t=Math.max(this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY);e.vertexBounds(n+this.xOffset,r-this.yOffset,t,t)}else e.vertexBounds(n+this.xOffset,r-this.yOffset,this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY);e.vertexWrite(i),e.vertexWrite(this._offsetUpperLeft),e.vertexWrite(this._texUpperLeft),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(t),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(i),e.vertexWrite(this._offsetUpperRight),e.vertexWrite(this._texUpperRight),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(t),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(i),e.vertexWrite(this._offsetBottomLeft),e.vertexWrite(this._texBottomLeft),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(t),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(i),e.vertexWrite(this._offsetBottomRight),e.vertexWrite(this._texBottomRight),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(t),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}_applyTransformation(e,t,i=0){Object(s.a)(e,Object(l.b)(this.xOffset,-this.yOffset)),this.angle+i!==0&&Object(s.g)(e,e,f*(this.angle+i));const n=this._computedWidth,r=this._computedHeight,a=(this._anchorX-.5)*n,c=(this._anchorY-.5)*r;Object(o.m)(t,a,c),Object(o.n)(t,t,e),this._offsetUpperLeft=Object(d.a)(16*t[0],16*t[1]),this._offsets.xUpperLeft=t[0],this._offsets.yUpperLeft=t[1],Object(o.m)(t,a+n,c),Object(o.n)(t,t,e),this._offsetUpperRight=Object(d.a)(16*t[0],16*t[1]),this._offsets.xUpperRight=t[0],this._offsets.yUpperRight=t[1],Object(o.m)(t,a,c+r),Object(o.n)(t,t,e),this._offsetBottomLeft=Object(d.a)(16*t[0],16*t[1]),this._offsets.xBottomLeft=t[0],this._offsets.yBottomLeft=t[1],Object(o.m)(t,a+n,c+r),Object(o.n)(t,t,e),this._offsetBottomRight=Object(d.a)(16*t[0],16*t[1]),this._offsets.xBottomRight=t[0],this._offsets.yBottomRight=t[1]}_getPos(e,t){return Object(d.a)(Math.round(8*e),Math.round(8*t))}}},676:function(e,t,i){"use strict";i.d(t,"a",(function(){return Fe})),i.d(t,"b",(function(){return Le}));var n=i(8),r=i(11),s=i(12),a=i(194),o=i(615),l=i(618),c=i(2),u=i(21),h=i(621),d=i(226),f=i(632),m=i(174),p=i(624),_=i(340),g=(i(642),i(664)),x=i(109),y=i(652),v=i(690);function b(e,t,i,n,r,s,a){W=0;const o=(n-i)*s,l=r&&r.length,c=l?(r[0]-i)*s:o;let u,h,d,f,m,p=O(t,i,n,0,c,s,!0);if(p&&p.next!==p.prev){if(l&&(p=function(e,t,i,n,r,s){const a=new Array;for(let o=0,l=n.length;o<l;o++){const r=O(e,t,i,n[o]*s,o<l-1?n[o+1]*s:i*s,s,!1);r===r.next&&(r.steiner=!0),a.push(E(r))}a.sort(F);for(const o of a)C(o,r),r=S(r,r.next);return r}(t,i,n,r,p,s)),o>80*s){u=d=t[0+i*s],h=f=t[1+i*s];for(let e=s;e<c;e+=s){const n=t[e+i*s],r=t[e+1+i*s];u=Math.min(u,n),h=Math.min(h,r),d=Math.max(d,n),f=Math.max(f,r)}m=Math.max(d-u,f-h),m=0!==m?1/m:0}T(p,e,s,u,h,m,a,0)}}function O(e,t,i,n,r,s,a){let o;if(a===function(e,t,i,n,r,s){let a=0;for(let o=n,l=r-s;o<r;o+=s)a+=(e[l+t*s]-e[o+t*s])*(e[o+1+t*s]+e[l+1+t*s]),l=o;return a}(e,t,0,n,r,s)>0)for(let l=n;l<r;l+=s)o=I(l+t*s,e[l+t*s],e[l+1+t*s],o);else for(let l=r-s;l>=n;l-=s)o=I(l+t*s,e[l+t*s],e[l+1+t*s],o);return o&&L(o,o.next)&&(M(o),o=o.next),o}function S(e,t=e){if(!e)return e;let i,n=e;do{if(i=!1,n.steiner||!L(n,n.next)&&0!==R(n.prev,n,n.next))n=n.next;else{if(M(n),n=t=n.prev,n===n.next)break;i=!0}}while(i||n!==t);return t}function T(e,t,i,n,r,s,a,o){if(!e)return;!o&&s&&(e=function e(t,i,n,r){for(let s;s!==t;s=s.next){if(s=s||t,null===s.z&&(s.z=z(s.x,s.y,i,n,r)),s.prev.next!==s||s.next.prev!==s)return s.prev.next=s,s.next.prev=s,e(t,i,n,r);s.prevZ=s.prev,s.nextZ=s.next}return t.prevZ.nextZ=null,t.prevZ=null,function(e){let t,i=1;for(;;){let n,r=e;e=null,t=null;let s=0;for(;r;){s++,n=r;let a=0;for(;a<i&&n;a++)n=n.nextZ;let o=i;for(;a>0||o>0&&n;){let i;0===a?(i=n,n=n.nextZ,o--):0!==o&&n?r.z<=n.z?(i=r,r=r.nextZ,a--):(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,a--),t?t.nextZ=i:e=i,i.prevZ=t,t=i}r=n}if(t.nextZ=null,i*=2,s<2)return e}}(t)}(e,n,r,s));let l=e;for(;e.prev!==e.next;){const c=e.prev,u=e.next;if(s?j(e,n,r,s):w(e))t.push(c.index/i+a),t.push(e.index/i+a),t.push(u.index/i+a),M(e),e=u.next,l=u.next;else if((e=u)===l){o?1===o?T(e=V(e,t,i,a),t,i,n,r,s,a,2):2===o&&N(e,t,i,n,r,s,a):T(S(e),t,i,n,r,s,a,1);break}}}function w(e){const t=e.prev,i=e,n=e.next;if(R(t,i,n)>=0)return!1;let r=e.next.next;const s=r;let a=0;for(;r!==e.prev&&(0===a||r!==s);){if(a++,P(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&R(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function j(e,t,i,n){const r=e.prev,s=e,a=e.next;if(R(r,s,a)>=0)return!1;const o=r.x<s.x?r.x<a.x?r.x:a.x:s.x<a.x?s.x:a.x,l=r.y<s.y?r.y<a.y?r.y:a.y:s.y<a.y?s.y:a.y,c=r.x>s.x?r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,u=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?s.y:a.y,h=z(o,l,t,i,n),d=z(c,u,t,i,n);let f=e.prevZ,m=e.nextZ;for(;f&&f.z>=h&&m&&m.z<=d;){if(f!==e.prev&&f!==e.next&&P(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&R(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,m!==e.prev&&m!==e.next&&P(r.x,r.y,s.x,s.y,a.x,a.y,m.x,m.y)&&R(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&P(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&R(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;m&&m.z<=d;){if(m!==e.prev&&m!==e.next&&P(r.x,r.y,s.x,s.y,a.x,a.y,m.x,m.y)&&R(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function I(e,t,i,n){const r=B.create(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function M(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function E(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function C(e,t){if(t=function(e,t){let i=t;const n=e.x,r=e.y;let s,a=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const e=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>a){if(a=e,e===n){if(r===i.y)return i;if(r===i.next.y)return i.next}s=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!s)return null;if(n===a)return s.prev;const o=s,l=s.x,c=s.y;let u,h=1/0;for(i=s.next;i!==o;)n>=i.x&&i.x>=l&&n!==i.x&&P(r<c?n:a,r,l,c,r<c?a:n,r,i.x,i.y)&&(u=Math.abs(r-i.y)/(n-i.x),(u<h||u===h&&i.x>s.x)&&A(i,e)&&(s=i,h=u)),i=i.next;return s}(e,t)){const i=k(t,e);S(i,i.next)}}function R(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function D(e,t,i,n){return!!(L(e,t)&&L(i,n)||L(e,n)&&L(i,t))||R(e,t,i)>0!=R(e,t,n)>0&&R(i,n,e)>0!=R(i,n,t)>0}function P(e,t,i,n,r,s,a,o){return(r-a)*(t-o)-(e-a)*(s-o)>=0&&(e-a)*(n-o)-(i-a)*(t-o)>=0&&(i-a)*(s-o)-(r-a)*(n-o)>=0}function A(e,t){return R(e.prev,e,e.next)<0?R(e,t,e.next)>=0&&R(e,e.prev,t)>=0:R(e,t,e.prev)<0||R(e,e.next,t)<0}function z(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function L(e,t){return e.x===t.x&&e.y===t.y}function F(e,t){return e.x-t.x}function V(e,t,i,n){let r=e;do{const s=r.prev,a=r.next.next;!L(s,a)&&D(s,r,r.next,a)&&A(s,a)&&A(a,s)&&(t.push(s.index/i+n),t.push(r.index/i+n),t.push(a.index/i+n),M(r),M(r.next),r=e=a),r=r.next}while(r!==e);return r}function N(e,t,i,n,r,s,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.index!==e.index&&U(o,e)){let l=k(o,e);return o=S(o,o.next),l=S(l,l.next),T(o,t,i,n,r,s,a,0),void T(l,t,i,n,r,s,a,0)}e=e.next}o=o.next}while(o!==e)}function U(e,t){return e.next.index!==t.index&&e.prev.index!==t.index&&!function(e,t){let i=e;do{if(i.index!==e.index&&i.next.index!==e.index&&i.index!==t.index&&i.next.index!==t.index&&D(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&A(e,t)&&A(t,e)&&function(e,t){let i=e,n=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)}function k(e,t){const i=B.create(e.index,e.x,e.y),n=B.create(t.index,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}class B{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(e,t,i){const n=W<G.length?G[W++]:new B;return n.index=e,n.x=t,n.y=i,n.prev=null,n.next=null,n.z=null,n.prevZ=null,n.nextZ=null,n.steiner=!1,n}}const G=new Array;let W=0;for(let Ne=0;Ne<8096;Ne++)G.push(new B);const H=new v.b(0,0,0,1,0),q=new v.b(0,0,0,1,0);function Z(e,t,i){let n=0;for(let r=1;r<i;r++){const i=e[2*(t+r-1)],s=e[2*(t+r-1)+1];n+=(e[2*(t+r)]-i)*(e[2*(t+r)+1]+s)}return n}function Y(e,t,i,n,r){let s=0;for(let a=i;a<n;a+=3){const i=2*(e[a]-r),n=2*(e[a+1]-r),o=2*(e[a+2]-r);s+=Math.abs((t[i]-t[o])*(t[n+1]-t[i+1])-(t[i]-t[n])*(t[o+1]-t[i+1]))}return s}H.setExtent(d.P),q.setExtent(d.P);var K=i(14),X=i(616),J=i(689);const $=e=>class extends e{constructor(...e){super(...e),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=o.d.LINE}writeGeometry(e,t,i,n){this._writeGeometry(e,t,i,n)}_initializeTessellator(e){const t=l.c.load(this._materialKey),i=l.a.load(this._materialKey),n=this._tessellationOptions,r=t.vvSizeFieldStops||t.vvSizeMinMaxValue||t.vvSizeScaleStops||t.vvSizeUnitValue,s=this.tessellationProperties._halfWidth<d.O&&!e&&!r;this.tessellationProperties.minMaxZoom=this._minMaxZoom,n.wrapDistance=65535,n.textured=this._isDashed||this._hasPattern,n.offset=this.tessellationProperties.offset,n.halfWidth=this.tessellationProperties._halfWidth;const a=s?0:1,o=i.outlinedFill?ee:Q;this._lineTessellator=new J.a(o(this.tessellationProperties,a,a),te(this.tessellationProperties),s)}_write(e,t,i,n){const r="esriGeometryPoint"===t.geometryType;e.recordStart(t.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(e,t,n,r),e.recordEnd()}_writeGeometry(e,t,i,n){const r=null!=i?i:t.readLegacyGeometryForDisplay(),s=this._getLines(r,n);Object(c.i)(s)||this._writeVertices(e,t,s)}_getLines(e,t){if(Object(c.i)(e))return null;const i=e.paths||e.rings;return Object(c.i)(i)?null:function(e,t){q.setPixelMargin(t);const i=q,n=-t,r=d.P+t;let s=[],a=!1,o=0;for(;o<e.length;){const t=[],l=e[o];if(!l)return null;i.reset(y.a.LineString);let[c,u]=l[0];if(a)i.moveTo(c,u);else{if(c<n||c>r||u<n||u>r){a=!0;continue}t.push({x:c,y:u})}let h=!1;const d=l.length;for(let e=1;e<d;++e)if(c+=l[e][0],u+=l[e][1],a)i.lineTo(c,u);else{if(c<n||c>r||u<n||u>r){h=!0;break}t.push({x:c,y:u})}if(h)a=!0;else{if(a){const e=i.resultWithStarts();if(e)for(const t of e)s.push(t)}else s.push({line:t,start:0});o++,a=!1}}return s=s.filter(e=>e.line.length>1),0===s.length?null:s}(i,t?256:16)}_writeVertices(e,t,i){const n=t.getDisplayId(),r=e.vertexCount(),s=this.tessellationProperties,a=this._tessellationOptions;s.out=e,s.id=n,s.indexCount=0,s.vertexCount=0,s.offset=r,a.capType=this._capType,a.joinType=this._joinType;const o=l.a.load(this._materialKey);this.tessellationProperties.key=o.outlinedFill?o:l.c.load(this._materialKey);for(const{line:l,start:c}of i)a.initialDistance=c%65535,this._lineTessellator.tessellate(l,a)}},Q=(e,t,i)=>(n,r,s,a,o,l,c,u,h,d,f)=>{const p=Object(m.a)(f,Math.ceil(16*e._halfWidth)),_=Object(m.b)(Math.round(16*c),Math.round(16*u),Math.round(16*h),Math.round(16*d)),g=Object(m.b)(16*o,16*l,0,e._bitset),x=e.out;return x.vertexBounds(n,r,t,i),x.vertexWrite(Object(m.a)(8*n,8*r)),x.vertexWrite(e.id),x.vertexWrite(e._fillColor),x.vertexWrite(_),x.vertexWrite(p),x.vertexWrite(e._tl),x.vertexWrite(e._br),x.vertexWrite(g),x.vertexWrite(Object(m.a)(Math.ceil(16*e._halfReferenceWidth),0)),x.vertexWrite(e.minMaxZoom),x.vertexEnd(),e.offset+e.vertexCount++},ee=(e,t,i)=>(n,r,s,a,o,l,c,u,h,d,f)=>{const p=Object(m.b)(0,0,16*e._halfWidth,16*e._halfReferenceWidth),_=Object(m.b)(16*c+128,16*u+128,16*h+128,16*d+128),g=e.out,x=e._bitset<<24|e.id;return g.vertexBounds(n,r,t,i),g.vertexWrite(Object(m.a)(8*n,8*r)),g.vertexWrite(x),g.vertexWrite(e._fillColor),e.key.simple||(g.vertexWrite(0),g.vertexWrite(0)),g.vertexWrite(p),g.vertexWrite(_),e.key.simple||g.vertexWrite(e.minMaxZoom),g.vertexEnd(),e.offset+e.vertexCount++},te=e=>(t,i,n)=>{const r=e.out;r.indexWrite(t),r.indexWrite(i),r.indexWrite(n),e.indexCount+=3};var ie=i(635);const ne=r.a.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate");class re extends($(ie.a)){constructor(e,t,i,n,r,s,a,o,c,u,h,f,_,g,x,y,v,b,O){super();const S=l.c.load(e);t&&(S.sdf=t.sdf,S.pattern=!0,S.textureBinding=t.textureBinding),this._capType=n,this._joinType=r,this._miterLimitCosine=Object(p.d)(s),this.tessellationProperties._fillColor=a,this.tessellationProperties._tl=o,this.tessellationProperties._br=c,this._hasPattern=u,this._isDashed=h,this._zOrder=y,this._effects=v,this._minMaxZoom=Object(m.a)(Math.round(b*d.w),Math.round(O*d.w)),this._materialKey=S.data;const T=(_?d.g:0)|(g?d.m:0)|(f?d.h:0);this.tessellationProperties._bitset=T,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*x,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(e,t,i){const n=e.color,r=e.scaleFactor||1,s=!!e.dashTemplate;let a=e.cap;s&&a===K.d.ROUND&&(a=K.d.SQUARE);const o=e.join,l=Object(u.c)(e.width)*r,c=Object(u.c)(e.referenceWidth),f=Object(u.c)(e.miterLimit),_=n&&Object(h.c)(n)||0,[g,x]=Object(p.e)(e.scaleInfo,i);if(!t)return new re(e.materialKey,t,l,a,o,f,_,0,0,!1,s,e.scaleDash,e.colorLocked,!1,c,e.zOrder,e.effects,g,x);const{rect:y,width:v,height:b}=t,O=y.x+d.A,S=y.y+d.A,T=O+v,w=S+b,j=Object(m.a)(O,S),I=Object(m.a)(T,w);return new re(e.materialKey,t,l,a,o,f,_,j,I,!0,s,e.scaleDash,e.colorLocked,!1,c,e.zOrder,e.effects,g,x)}static fromFillOutline(e){var t;return e.isOutlinedFill&&e.outline&&"esriSLSSolid"===(null==(t=e.outline)?void 0:t.style)?re.fromSimpleLine({hash:"",materialKey:e.materialKey,...e.outline},null,!0):null}static fromSimpleLine(e,t,i=!1){const{color:n}=e,r="esriSLSSolid"!==e.style&&"esriSLSNull"!==e.style,s=Object(X.i)(e.cap||"round"),a=Object(X.j)(e.join||"round");let o=n&&"esriSLSNull"!==e.style&&Object(h.d)(n)||0;"esriSLSNull"===e.style&&(o=0);const l=Object(u.c)(e.width),c=e.miterLimit;if(!t)return new re(e.materialKey,t,l,s,a,c,o,0,0,!1,r,!0,!1,i,l,0,null,p.b,p.a);const{rect:f,width:_,height:g}=t,x=f.x+d.A,y=f.y+d.A,v=x+_,b=y+g,O=Object(m.a)(x,y),S=Object(m.a)(v,b);return new re(e.materialKey,t,l,s,a,c,o,O,S,!0,r,!0,!1,i,l,0,null,p.b,p.a)}static fromPictureLineSymbol(e,t,i,n){return ne.error("PictureLineSymbol support does not exist!"),null}}const se=e=>class extends e{constructor(...e){super(...e),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=o.d.FILL}_maybeAddLineTemplate(e){this._lineTemplate=re.fromFillOutline(e)}_write(e,t,i,n){const r="esriGeometryPoint"===t.geometryType,s=l.a.load(this._materialKey);e.recordStart(t.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(e,t,s,n,r),s.outlinedFill&&Object(c.j)(this._lineTemplate)&&this._lineTemplate.writeGeometry(e,t,n,r),e.recordEnd()}_writeGeometry(e,t,i,n,r){const s=this._getGeometry(t,n,r);if(Object(c.i)(s))return;const a=[];if(!(s.maxLength>100)&&!this.forceLibtess&&function(e,t){const{coords:i,lengths:n,hasIndeterminateRingOrder:r}=t,s=e;if(r)return!1;let a=0;for(let o=0;o<n.length;){let e=o,t=n[o],r=Z(i,a,t);const l=[];for(;++e<n.length;){const s=n[e],o=Z(i,a+t,s);if(!(o>0))break;r+=o,l.push(a+t),t+=s}const c=s.length;b(s,i,a,a+t,l,2,0);const u=Y(s,i,c,s.length,0),h=Math.abs(r);if(Math.abs((u-h)/Math.max(1e-7,h))>1e-5)return s.length=0,!1;o=e,a+=t}return!0}(a,s))return void(a.length&&this._writeVertices(e,t,s.coords,s.lengths,i,a));const o=function(e){const{coords:t,lengths:i}=e,{buffer:n}=Object(g.b)(t,i);return n}(s);this._writeVertices(e,t,o,[o.length/2],i)}_writeVertex(e,t,i,n,r,s){const a=Object(m.a)(1*n,1*r);e.vertexBounds(n,r,0,0),e.vertexWrite(a),e.vertexWrite(t),i.dotDensity?e.vertexWriteF32(1/Math.abs(s.readGeometryArea())):(e.vertexWrite(this.fillColor),i.simple||(e.vertexWrite(this.tl),e.vertexWrite(this.br)),e.vertexWrite(this.aux2),e.vertexWrite(this.aux3),i.simple||e.vertexWrite(this._minMaxZoom))}_writeVertices(e,t,i,n,r,s){const a=t.getDisplayId(),o=this._bitset<<24|a,l=n.reduce((e,t)=>e+t),c=r.dotDensity?4:10,u=e.vertexCount();e.vertexEnsureSize(c*l);let h=0;if(s)for(const d of s){const n=i[2*d],s=i[2*d+1];this._writeVertex(e,o,r,n,s,t),h++}else for(let d=0;d<i.length;d+=2){const n=Math.round(i[d]),s=Math.round(i[d+1]);this._writeVertex(e,o,r,n,s,t),h++}e.indexEnsureSize(h);for(let d=0;d<h;d++)e.indexWrite(d+u)}_getGeometry(e,t,i){const n=t?Object(_.p)(Object(_.d)(t),2):e.readGeometryForDisplay();return n?function(e,t){if(Object(c.i)(e))return null;if(!function(e,t,i){let n=0;for(let r=0;r<e.lengths.length;r++){const s=e.lengths[r];for(let r=0;r<s;r++){const s=e.coords[2*(r+n)],a=e.coords[2*(r+n)+1];if(s<t||s>i||a<t||a>i)return!0}n+=s}return!1}(e,-128,d.P+128))return e;H.setPixelMargin(t),H.reset(y.a.Polygon);let i=0;for(let a=0;a<e.lengths.length;a++){const t=e.lengths[a];let n=e.coords[2*(0+i)],r=e.coords[2*(0+i)+1];H.moveTo(n,r);for(let s=1;s<t;s++)n=e.coords[2*(s+i)],r=e.coords[2*(s+i)+1],H.lineTo(n,r);H.close(),i+=t}const n=H.result(!1);if(!n)return null;const r=[],s=[];for(const a of n){let e=0;for(const t of a)s.push(t.x),s.push(t.y),e++;r.push(e)}return new x.a(r,s)}(n,i?256:8):null}};var ae=i(342),oe=i(17);const le=r.a.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");class ce extends ie.a{constructor(e){super(),this._ongoingMaterialRequestMap=new Map,this._materialCache=new Map,this._dynamicPropertyMap=new Map,this._cimLayer=e}analyze(e,t,i,n,r){if(r&&0===r.length)return null;const s=r&&r.length>0,a=t.readLegacyFeature(),o=this._materialCache,l=this._cimLayer.materialHash;if(!l)return le.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const c="function"==typeof l?l(a,i,n):l;if(o.has(c)){const e=o.get(c);return Promise.resolve(e)}const u=this._ongoingMaterialRequestMap.get(c);if(u)return u;const h=this._cimLayer,d=Object(ae.a)(h.cim,this._cimLayer.materialOverrides);d.mosaicHash=c;const{type:f,url:m}=h,p={cim:d,type:f,mosaicHash:c,url:m,size:null,dashTemplate:null,text:null,fontName:null};switch(f){case"marker":p.size=Object(oe.d)(h.size,a,i,n);break;case"line":p.dashTemplate=h.dashTemplate;break;case"text":p.text=Object(oe.d)(h.text,a,i,n),p.fontName=Object(oe.d)(h.fontName,a,i,n)}const _=e.getMosaicItem(p,r).then(e=>(s||(this._ongoingMaterialRequestMap.delete(c),o.set(c,e)),e)).catch(e=>(this._ongoingMaterialRequestMap.delete(c),le.error(".analyze()",e.message),null));return s||this._ongoingMaterialRequestMap.set(c,_),_}}var ue=i(640);class he extends(se(ce)){constructor(e,t,i){var n;if(super(e),this._minMaxZoom=Object(m.a)(Math.round(t*d.w),Math.round(i*d.w)),Object(p.f)(e.color)){const t=(t,i,n)=>{const r=e.color(t,i,n);return r&&Object(h.c)(r)||0};this._dynamicPropertyMap.set("fillColor",t)}else{const t=e.color;this.fillColor=t&&Object(h.c)(t)||0}const r="CIMMarkerPlacementInsidePolygon"===(null==(n=e.cim.placement)?void 0:n.type)&&e.cim.placement.shiftOddRows?2:1,s=e.height;if(Object(p.f)(s)){const e=(e,t,i)=>s(e,t,i)*r;this._dynamicPropertyMap.set("_height",e)}else this._height=(s||0)*r;const a=e.offsetX;if(Object(p.f)(a)){const e=(e,t,i)=>{let n=Object(u.c)(a(e,t,i))+128;return n>255?n=255:n<0&&(n=0),n};this._dynamicPropertyMap.set("_offsetX",e)}else{let e=Object(u.c)(a||0)+128;e>255?e=255:e<0&&(e=0),this._offsetX=e}const o=e.offsetY;if(Object(p.f)(o)){const e=(e,t,i)=>{let n=Object(u.c)(-o(e,t,i))+128;return n>255?n=255:n<0&&(n=0),n};this._dynamicPropertyMap.set("_offsetY",e)}else{let e=Object(u.c)(-o||0)+128;e>255?e=255:e<0&&(e=0),this._offsetY=e}const _=e.scaleX;Object(p.f)(_)?this._dynamicPropertyMap.set("_scaleX",_):this._scaleX=_||1;const g=e.angle;if(Object(p.f)(g)){const e=(e,t,i)=>Object(f.d)(g(e,t,i));this._dynamicPropertyMap.set("_angle",e)}else this._angle=Object(f.d)(g)||0;if(Object(c.j)(e.effects)){const t=e.effects;Object(p.f)(t)?this._dynamicPropertyMap.set("_effects",t):this._effects=t}this._cimFillLayer=e,this._fillMaterialKey=l.a.load(e.materialKey)}static fromCIMFill(e,t){const[i,n]=Object(p.e)(e.scaleInfo,t);return new he(e,i,n)}bindFeature(e,t,i){const n=e.readLegacyFeature();this._dynamicPropertyMap.forEach((e,r)=>{this[r]=e(n,t,i)});const r=this._fillMaterialKey,s=this._materialCache,a=(0,this._cimFillLayer.materialHash)(n,t,i),o=s.get(a);let l=null;if(o&&Object(ue.a)(o.spriteMosaicItem)&&(l=o.spriteMosaicItem),l){const{rect:e,width:t,height:i}=l,n=e.x+d.A,s=e.y+d.A,a=n+t,o=s+i;let c=Math.round(Object(u.c)(this._height));c>255?c=255:c<=0&&(c=o-s);let h=Math.round(Object(u.c)(this._height/i*t||0));h>255?h=255:h<=0&&(h=a-n);const f=this._scaleX,p=1;this.tl=Object(m.a)(n,s),this.br=Object(m.a)(a,o),this.aux2=Object(m.b)(h,c,this._offsetX,this._offsetY),this.aux3=Object(m.b)(f,p,this._angle,0),r.sdf=l.sdf,r.pattern=!0,r.textureBinding=l.textureBinding}else this.tl=0,this.br=0,this.aux2=0,this.aux3=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}class de extends($(ce)){constructor(e,t,i){super(e),this._minMaxZoom=Object(m.a)(Math.round(t*d.w),Math.round(i*d.w)),this._cimLineLayer=e;let n=0;Object(p.f)(e.width)||(n=.5*Object(u.c)(e.width));this._dynamicPropertyMap.set("_halfWidth",(t,i,r)=>Object(p.f)(e.width)?.5*Object(u.c)(e.width(t,i,r)):n),Object(p.f)(e.cap)?this._dynamicPropertyMap.set("_capType",e.cap):this._capType=e.cap,Object(p.f)(e.join)?this._dynamicPropertyMap.set("_joinType",e.join):this._joinType=e.join;const r=e.color;if(Object(p.f)(r)){const e=(e,t,i)=>Object(h.c)(r(e,t,i));this._dynamicPropertyMap.set("_fillColor",e)}else this._fillColor=r&&Object(h.c)(r)||0;const s=e.miterLimit;if(Object(p.f)(s)){const e=(e,t,i)=>Object(p.d)(s(e,t,i));this._dynamicPropertyMap.set("_miterLimitCosine",e)}else this._miterLimitCosine=Object(p.d)(s);if(Object(c.j)(e.effects)){const t=e.effects;Object(p.f)(t)?this._dynamicPropertyMap.set("_effects",t):this._effects=t}this._scaleFactor=e.scaleFactor||1,this._isDashed=null!=e.dashTemplate,this.tessellationProperties._bitset=(e.colorLocked?1:0)|(e.scaleDash?1:0)<<1,this._materialKey=e.materialKey,this._initializeTessellator(!0)}static fromCIMLine(e,t){const[i,n]=Object(p.e)(e.scaleInfo,t);return new de(e,i,n)}bindFeature(e,t,i){const n=e.readLegacyFeature();this._dynamicPropertyMap.forEach((e,r)=>{this[r]=e(n,t,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,s=(0,this._cimLineLayer.materialHash)(n,t,i),a=r.get(s);let o=null;if(a&&Object(ue.a)(a.spriteMosaicItem)&&(o=a.spriteMosaicItem),o){this._hasPattern=!0;const{rect:e,width:t,height:i}=o,n=e.x+d.A,r=e.y+d.A,s=n+t,a=r+i;this.tessellationProperties._tl=Object(m.a)(n,r),this.tessellationProperties._br=Object(m.a)(s,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 c=l.c.load(this._materialKey);o&&(c.sdf=o.sdf,c.pattern=!0,c.textureBinding=o.textureBinding),this._materialKey=c.data}}var fe=i(155),me=i(175),pe=i(675);const _e=Object(me.a)(),ge=Object(fe.a)(),xe=r.a.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate");class ye extends(Object(pe.a)(ce)){constructor(e,t,i){super(e),this._cimMarkerLayer=e,this._minMaxZoom=Object(m.a)(Math.round(t*d.w),Math.round(i*d.w));const n=e.color;if(Object(p.f)(n)){const e=(e,t,i)=>Object(h.c)(n(e,t,i));this._dynamicPropertyMap.set("_fillColor",e)}else this._fillColor=Object(h.c)(n);const r=e.outlineColor;if(Object(p.f)(r)){const e=(e,t,i)=>Object(h.c)(r(e,t,i));this._dynamicPropertyMap.set("_outlineColor",e)}else this._outlineColor=Object(h.c)(r);const s=e.size;if(Object(p.f)(s)){const e=(e,t,i)=>Object(u.c)(s(e,t,i));this._dynamicPropertyMap.set("_size",e)}else this._size=Object(u.c)(s)||0;const a=e.scaleX;Object(p.f)(a)?this._dynamicPropertyMap.set("_scaleX",a):this._scaleX=a||1;const o=e.offsetX;if(Object(p.f)(o)){const e=(e,t,i)=>Object(u.c)(o(e,t,i));this._dynamicPropertyMap.set("xOffset",e)}else this.xOffset=Object(u.c)(o)||0;const l=e.offsetY;if(Object(p.f)(l)){const e=(e,t,i)=>Object(u.c)(l(e,t,i));this._dynamicPropertyMap.set("yOffset",e)}else this.yOffset=Object(u.c)(l)||0;const f=e.outlineWidth;if(Object(p.f)(f)){const e=(e,t,i)=>Object(u.c)(f(e,t,i));this._dynamicPropertyMap.set("_outlineWidth",e)}else this._outlineWidth=Object(u.c)(f)||0;const _=e.rotation;if(Object(p.f)(_)?this._dynamicPropertyMap.set("_angle",_):this._angle=_||0,Object(c.j)(e.effects)){const t=e.effects;Object(p.f)(t)?this._dynamicPropertyMap.set("_effects",t):this._effects=t}if(Object(c.j)(e.markerPlacement)){const t=e.markerPlacement;Object(p.f)(t)?this._dynamicPropertyMap.set("_markerPlacement",t):this._markerPlacement=t}this._scaleFactor=Object(c.r)(e.scaleFactor,1),this._bitSet=(e.alignment===K.a.MAP?1:0)|(e.colorLocked?1:0)<<1|(e.scaleSymbolsProportionally?1:0)<<3,this._materialKey=e.materialKey}static fromCIMMarker(e,t){const[i,n]=Object(p.e)(e.scaleInfo,t);return new ye(e,i,n)}bindFeature(e,t,i){const r=e.readLegacyFeature();this._dynamicPropertyMap.forEach((e,n)=>{this[n]=e(r,t,i)});const s=this._cimMarkerLayer.materialHash,a="function"==typeof s?s(r,t,i):s,o=this._materialCache.get(a);if(!o||!Object(ue.a)(o.spriteMosaicItem)||!o.spriteMosaicItem)return void xe.error(new n.a("mapview-cim","Encountered an error when binding feature"));const c=o.spriteMosaicItem,h=this._cimMarkerLayer.sizeRatio,f=c.width/c.height*this._scaleX,p=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let _=this._size,g=_*f;const x=this.xOffset,y=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const v=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/Object(u.c)(this._cimMarkerLayer.frameHeight):1,b=this._outlineWidth*v,O=Object(u.c)(this._cimMarkerLayer.referenceSize);let S=0,T=0;const w=this._cimMarkerLayer.anchorPoint;w&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(S=-w.x/(this._size*f),T=w.y/this._size):(S=w.x,T=w.y)),this._sizeOutlineWidth=Object(m.b)(Math.round(Math.min(Math.sqrt(128*g),255)),Math.round(Math.min(Math.sqrt(128*_),255)),Math.round(Math.min(Math.sqrt(128*b),255)),Math.round(Math.min(Math.sqrt(128*O),255))),this.angle=p;const j=Math.round(64*h);this._bitestAndDistRatio=Object(m.a)(this._bitSet,j);const I=c.rect.x+d.A,M=c.rect.y+d.A,E=I+c.width,C=M+c.height;this._texUpperLeft=Object(m.a)(I,M),this._texUpperRight=Object(m.a)(E,M),this._texBottomLeft=Object(m.a)(I,C),this._texBottomRight=Object(m.a)(E,C);const R=l.d.load(this._materialKey);R.sdf=c.sdf,R.pattern=!0,R.textureBinding=c.textureBinding,this._materialKey=R.data,this._anchorX=.5-(.5+S)*c.width/c.width,this._anchorY=.5-(.5+T)*c.height/c.height,g*=h,_*=h,g*=this._scaleFactor,_*=this._scaleFactor,g*=c.rect.width/c.width,_*=c.rect.height/c.height,this._computedWidth=g,this._computedHeight=_,this._applyTransformation(ge,_e),this.xOffset=x,this.yOffset=y}}var ve=i(154),be=i(672),Oe=i(669);class Se extends(Object(be.a)(ce)){constructor(e,t,i){super(e),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=Object(m.a)(Math.round(t*d.w),Math.round(i*d.w));const n=e.scaleFactor||1;this._cimTextLayer=e;const r=e.color;if(Object(p.f)(r)){const e=(e,t,i)=>Object(h.c)(r(e,t,i));this._dynamicPropertyMap.set("_color",e)}else this._color=Object(h.c)(r);const s=e.outlineColor;if(Object(p.f)(s)){const e=(e,t,i)=>Object(h.c)(s(e,t,i));this._dynamicPropertyMap.set("_haloColor",e)}else this._haloColor=Object(h.c)(s);let a;Object(p.f)(e.size)||(a=Math.min(Math.round(Object(u.c)(e.size*e.sizeRatio)),127));if(this._dynamicPropertyMap.set("_size",(t,i,n)=>Object(p.f)(e.size)?Math.min(Math.round(Object(u.c)(e.size(t,i,n)*e.sizeRatio)),127):a),Object(p.f)(e.outlineSize)){const t=(t,i,n)=>Math.min(Math.floor(5*Object(u.c)(e.outlineSize(t,i,n)*e.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",t)}else this._haloSize=Math.min(Math.floor(5*Object(u.c)(e.outlineSize*e.sizeRatio)),127);let o;Object(p.f)(e.offsetX)||(o=Math.round(Object(u.c)(e.offsetX*e.sizeRatio)));let f;this._dynamicPropertyMap.set("_xOffset",(t,i,n)=>Object(p.f)(e.offsetX)?Math.round(Object(u.c)(e.offsetX(t,i,n)*e.sizeRatio)):o),Object(p.f)(e.offsetY)||(f=Math.round(Object(u.c)(e.offsetY*e.sizeRatio)));if(this._dynamicPropertyMap.set("_yOffset",(t,i,n)=>Object(p.f)(e.offsetY)?Math.round(Object(u.c)(e.offsetY(t,i,n)*e.sizeRatio)):f),Object(p.f)(e.angle)?this._dynamicPropertyMap.set("_angle",e.angle):this._angle=e.angle,Object(p.f)(e.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",e.horizontalAlignment):this._horizontalAlignment=e.horizontalAlignment,Object(p.f)(e.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",e.verticalAlignment):this._verticalAlignment=e.verticalAlignment,Object(c.j)(e.effects)){const t=e.effects;Object(p.f)(t)?this._dynamicPropertyMap.set("_effects",t):this._effects=t}if(Object(c.j)(e.markerPlacement)){const t=e.markerPlacement;Object(p.f)(t)?this._dynamicPropertyMap.set("_markerPlacement",t):this._textPlacement=t}Object(p.f)(e.text)?this._dynamicPropertyMap.set("_text",e.text):this._text=e.text,this._scaleFactor=n;const _=Math.min(Math.round(Object(u.c)(e.referenceSize*e.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*_)),this._materialKey=e.materialKey;const g=l.f.load(this._materialKey);g.sdf=!0,this._bitset=(e.alignment===K.a.MAP?1:0)|(e.colorLocked?1:0)<<1,this._materialKey=g.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(e,t){const[i,n]=Object(p.e)(e.scaleInfo,t);return new Se(e,i,n)}async analyze(e,t,i,n){const r=t.readLegacyFeature(),s=function(e,t,i,n){return"string"==typeof e.text?e.text:"function"==typeof e.text?e.text(t,i,n):""}(this._cimTextLayer,r,i,n),a=await super.analyze(e,t,i,n,Object(Oe.a)(s));return a&&a.glyphMosaicItems&&this._textToGlyphs.set(s,a.glyphMosaicItems),a}bindFeature(e,t,i){const n=e.readLegacyFeature();if(this._dynamicPropertyMap.forEach((e,r)=>{this[r]=e(n,t,i)}),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/d.r,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=Object(ve.e)(this._horizontalAlignment||"center"),this._yAlignD=Object(ve.g)(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}class Te extends(se(ie.a)){constructor(e,t,i,n,r,s,a,o,c,u,h,f,p,_,g,x){super(),this._effects=_;const y=l.a.load(e);t&&(y.sdf=t.sdf,y.pattern=!0,y.textureBinding=t.textureBinding),this.fillColor=i,this.tl=n,this.br=r,this.aux2=Object(m.b)(s,a,o,c),this.aux3=Object(m.b)(u,h,f,0),this._bitset=p,this._minMaxZoom=Object(m.a)(Math.round(g*d.w),Math.round(x*d.w)),this._materialKey=y.data}static fromCIMFill(e,t,i){const n=e.color,r=n&&Object(h.c)(n)||0,s=e.materialKey,[a,o]=Object(p.e)(e.scaleInfo,i);if(!t)return new Te(s,null,r,0,0,0,0,0,0,0,0,0,e.colorLocked?d.g:0,e.effects,a,o);const{rect:l,width:c,height:_}=t,g=e.scaleX||1,x=l.x+d.A,y=l.y+d.A,v=x+c,b=y+_,O=e.height,S=g*O;let T=Math.round(O);T>255?T=255:T<=0&&(T=b-y);let w=Math.round(S);w>255?w=255:w<=0&&(w=v-x);let j=Object(u.c)(e.offsetX||0)+128;j>255&&(j=255);let I=Object(u.c)(-e.offsetY||0)+128;I>255&&(I=255);const M=Object(m.a)(x,y),E=Object(m.a)(v,b);return new Te(s,t,r,M,E,w,T,j,I,128,128,Object(f.b)(e.angle),e.colorLocked?d.g:0,e.effects,a,o)}static fromSimpleFill(e,t,i=!1){const{color:n}=e,r=n&&"esriSFSNull"!==e.style&&Object(h.d)(n)||0,s=i?d.g:0,a=e.materialKey;let o;if(t){const{rect:e,width:i,height:n}=t,l=e.x+d.A,c=e.y+d.A,u=l+i,h=c+n,f=Object(m.a)(l,c),_=Object(m.a)(u,h);o=new Te(a,t,r,f,_,i,n,0,0,128,128,0,s,null,p.b,p.a)}else o=new Te(a,null,r,0,0,0,0,0,0,0,0,0,s,null,p.b,p.a);return o._maybeAddLineTemplate(e),o}static fromPictureFill(e,t,i=!1){const n=d.z,{rect:r,width:s,height:a}=t,o=r.x+d.A,l=r.y+d.A,c=o+s,h=l+a,f=Object(m.a)(o,l),_=Object(m.a)(c,h);let g=Math.round(Object(u.c)(e.width));g>255&&(g=255);let x=Math.round(Object(u.c)(e.height));x>255&&(x=255);let y=Object(u.c)(e.xoffset)+128;y>255&&(y=255);let v=Object(u.c)(-e.yoffset)+128;v>255&&(v=255);const b=e.materialKey,O=i?d.g:0,S=new Te(b,t,n,f,_,g,x,y,v,128*e.xscale,128*e.yscale,0,O,null,p.b,p.a);return S._maybeAddLineTemplate(e),S}}var we=i(674),je=i(671);class Ie{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){if(!this._resolver)return this._resolver=Object(s.f)(),Promise.resolve();await this._resolver.promise,await this.acquire()}release(){const e=this._resolver;this._resolver=null,e.resolve()}}var Me=i(644);const Ee=r.a.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),Ce=new Array,Re={isOutline:!1,isOutlinedFill:!1,placement:null,stride:{fill:"default"},vvFlags:0},De={...a.e,hash:JSON.stringify(a.e),materialKey:Object(l.g)(o.d.MARKER,Re)},Pe={...a.g,hash:JSON.stringify(a.g),materialKey:Object(l.g)(o.d.LINE,Re)},Ae={...a.f,hash:JSON.stringify(a.f),materialKey:Object(l.g)(o.d.FILL,Re)};function ze(e,t){const i=e.length;return e.push(null),t.then(t=>e[i]=t),e}function Le(e){return!!(1&e)}class Fe{constructor(e,t){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 Ie,this._fetchResource=e,this._tileInfo=t}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(e,t){this._initErrorTemplates();const i=e.hash;if(this._symbolToTemplate.has(i))return this._symbolToTemplate.get(i);const n=new Array;t&&this._createMeshTemplates(n,t,!0),this._createMeshTemplates(n,e,!1);const r=this._createGroupId("expanded-cim"===e.type&&Ve(e));return this._idToTemplateGroup.set(r,n),this._symbolToTemplate.set(i,r),r}getTemplateGroup(e){return this._idToTemplateGroup.has(e)?this._idToTemplateGroup.get(e):Ce}getDynamicTemplateGroup(e){return this._idToTemplateGroup.has(e)?(Le(e)||Ee.error("mapview-template-store",`Id ${e} does not refer to a dynamic template`),this._idToTemplateGroup.get(e)):Ce}getMosaicItem(e,t){const i=this._createTemplateId(),n=new Promise(e=>this._idToResolver.set(i,e));return this._fetchQueue.push({symbol:e,id:i,glyphIds:t}),n}finalize(e){return this._fetchQueue.length||this._lock.isHeld()?async function(e,t,i){try{await e.acquire(),await t(i),e.release()}catch(n){throw e.release(),n}}(this._lock,this._fetchAllQueuedResources.bind(this),e):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],Ae,!1),marker:this._createMeshTemplates([],De,!1),line:this._createMeshTemplates([],Pe,!1)})}_fetchAllQueuedResources(e){if(!this._fetchQueue.length)return Promise.resolve();const t=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(t,e).then(e=>{for(const{id:t,mosaicItem:i}of e)this._idToResolver.get(t)(i),this._idToResolver.delete(t)})).catch(e=>{Object(s.l)(e)?this._fetchQueue=this._fetchQueue.concat(t):"worker:port-closed"===e.name||Ee.error(new n.a("mapview-template-store","Unable to fetch requested texture resources",e))})}_createGroupId(e){return this._idCounter++<<1|(e?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(e){const{spriteMosaicItem:t}=await this.getMosaicItem(e);return Object(ue.a)(t,Ee)?we.a.fromSimpleMarker(e,t):this._markerError}async _createPMS(e){const{spriteMosaicItem:t}=await this.getMosaicItem(e);return Object(ue.a)(t,Ee)?we.a.fromPictureMarker(e,t):this._markerError}async _createSFS(e,t){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return Object(ue.a)(i,Ee)?Te.fromSimpleFill(e,i,t):this._fillError}async _createPFS(e,t){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return Object(ue.a)(i,Ee)?Te.fromPictureFill(e,i,t):this._fillError}async _createSLS(e,t){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return Object(ue.a)(i,Ee)?re.fromSimpleLine(e,i):this._lineError}async _createLMS(e){const{spriteMosaicItem:t}=await this.getMosaicItem(e);return Object(ue.a)(t,Ee)?we.a.fromLineSymbolMarker(e,t):this._markerError}async _createTS(e){const{glyphMosaicItems:t}=await this.getMosaicItem(e);return je.a.fromText(e,t)}async _createCIMText(e){const{glyphMosaicItems:t}=await this.getMosaicItem(Object(Me.a)(e),Object(Oe.a)(e.text));return Object(ue.a)(t,Ee)?je.a.fromCIMText(e,t,this._tileInfo):this._textError}async _createCIMFill(e){const{spriteMosaicItem:t}=await this.getMosaicItem(Object(Me.a)(e));return Object(ue.a)(t,Ee)?Te.fromCIMFill(e,t,this._tileInfo):this._fillError}async _createCIMLine(e){const{spriteMosaicItem:t}=await this.getMosaicItem(Object(Me.a)(e));return Object(ue.a)(t,Ee)?re.fromCIMLine(e,t,this._tileInfo):this._lineError}async _createCIMMarker(e){const{spriteMosaicItem:t}=await this.getMosaicItem(Object(Me.a)(e));return Object(ue.a)(t,Ee)?we.a.fromCIMMarker(e,t,this._tileInfo):this._markerError}async _createCIM(e){const t=e.templateHash;if(this._cimTemplateCache.has(t))return this._cimTemplateCache.get(t);let i;switch(e.type){case"marker":i=await this._createCIMMarker(e);break;case"line":i=await this._createCIMLine(e);break;case"fill":i=await this._createCIMFill(e);break;case"text":i=await this._createCIMText(e)}return this._cimTemplateCache.set(t,i),i}async _createDynamicCIM(e){const t=e.templateHash;if(this._cimTemplateCache.has(t))return this._cimTemplateCache.get(t);let i;switch(e.type){case"marker":i=ye.fromCIMMarker(e,this._tileInfo);break;case"line":i=de.fromCIMLine(e,this._tileInfo);break;case"fill":i=he.fromCIMFill(e,this._tileInfo);break;case"text":i=Se.fromCIMText(e,this._tileInfo)}return this._cimTemplateCache.set(t,i),i}_createPrimitiveMeshTemplates(e,t,i){switch(t.type){case"esriSMS":return ze(e,this._createSMS(t));case"esriPMS":return ze(e,this._createPMS(t));case"esriSFS":return ze(e,this._createSFS(t,i));case"line-marker":return ze(e,this._createLMS(t));case"esriPFS":return ze(e,this._createPFS(t,i));case"esriSLS":return ze(e,this._createSLS(t,!1));case"esriTS":return ze(e,this._createTS(t));default:return Ee.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),e}}_createMeshTemplates(e,t,i){if(-1!==t.type.indexOf("3d"))return Ee.error("3D symbols are not supported with MapView"),e;if("expanded-cim"===t.type){for(const i of t.layers)"function"==typeof i.materialHash?ze(e,this._createDynamicCIM(i)):ze(e,this._createCIM(i));return e}if("composite-symbol"===t.type){for(const n of t.layers)this._createPrimitiveMeshTemplates(e,n,i);return e}return"cim"===t.type||"label"===t.type||"web-style"===t.type?e:this._createPrimitiveMeshTemplates(e,t,i)}}const Ve=e=>{if(!e.layers)return!1;for(const t of e.layers)if("function"==typeof t.materialHash)return!0;return!1}},677:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));const n={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,i){const n=new r(e.getPointX(t),e.getPointY(t),i),s=e.hasZ(t),a=e.hasM(t);return s&&(n.z=e.getPointZ(t)),a&&(n.m=e.getPointM(t)),n},exportPolygon:function(e,t,i){return new s(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,i){return new a(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,i){return new o(e.exportPoints(t),i,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,i){const n=e.hasZ(t),r=e.hasM(t),s=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),i);if(n){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(r){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s}};class r{constructor(e,t,i){this.x=e,this.y=t,this.spatialReference=i,this.z=void 0,this.m=void 0}}class s{constructor(e,t,i,n){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class a{constructor(e,t,i,n){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class o{constructor(e,t,i,n){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class l{constructor(e,t,i,n,r){this.xmin=e,this.ymin=t,this.xmax=i,this.ymax=n,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},678:function(e,t,i){"use strict";function n(e){return e=e||globalThis.location.hostname,c.some(t=>{var i;return null!=(null==(i=e)?void 0:i.match(t))})}function r(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(s)||null!=t.match(o)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return n}));const s=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,o=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,s,a,/^jsapps.esri.com$/,o,l]},679:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(2);function r(e,t){return e?t?4:3:t?3:2}function s(e,t,i,s,l){if(Object(n.i)(t)||!t.lengths.length)return null;const c="upperLeft"===(null==l?void 0:l.originPosition)?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const u=e.coords,h=[],d=i?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:f,coords:m}=t,p=r(i,s);let _=0;for(const n of f){const e=a(d,m,_,n,i,s,c);e&&h.push(e),_+=n*p}if(h.sort((e,t)=>{let n=c*e[2]-c*t[2];return 0===n&&i&&(n=e[4]-t[4]),n}),h.length){let e=6*h[0][2];u[0]=h[0][0]/e,u[1]=h[0][1]/e,i&&(e=6*h[0][4],u[2]=0!==e?h[0][3]/e:0),(u[0]<d[0]||u[0]>d[1]||u[1]<d[2]||u[1]>d[3]||i&&(u[2]<d[4]||u[2]>d[5]))&&(u.length=0)}if(!u.length){const e=t.lengths[0]?o(m,0,f[0],i,s):null;if(!e)return null;u[0]=e[0],u[1]=e[1],i&&e.length>2&&(u[2]=e[2])}return e}function a(e,t,i,n,s,a,o=1){const l=r(s,a);let c=i,u=i+l,h=0,d=0,f=0,m=0,p=0;for(let r=0,g=n-1;r<g;r++,c+=l,u+=l){const i=t[c],n=t[c+1],r=t[c+2],a=t[u],o=t[u+1],l=t[u+2];let _=i*o-a*n;m+=_,h+=(i+a)*_,d+=(n+o)*_,s&&(_=i*l-a*r,f+=(r+l)*_,p+=_),i<e[0]&&(e[0]=i),i>e[1]&&(e[1]=i),n<e[2]&&(e[2]=n),n>e[3]&&(e[3]=n),s&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(m*o>0&&(m*=-1),p*o>0&&(p*=-1),!m)return null;const _=[h,d,.5*m];return s&&(_[3]=f,_[4]=.5*p),_}function o(e,t,i,n,s){const a=r(n,s);let o=t,d=t+a,f=0,m=0,p=0,_=0;for(let r=0,g=i-1;r<g;r++,o+=a,d+=a){const t=e[o],i=e[o+1],r=e[o+2],s=e[d],a=e[d+1],g=e[d+2],x=n?c(t,i,r,s,a,g):l(t,i,s,a);if(x)if(f+=x,n){const e=h(t,i,r,s,a,g);m+=x*e[0],p+=x*e[1],_+=x*e[2]}else{const e=u(t,i,s,a);m+=x*e[0],p+=x*e[1]}}return f>0?n?[m/f,p/f,_/f]:[m/f,p/f]:i>0?n?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function l(e,t,i,n){const r=i-e,s=n-t;return Math.sqrt(r*r+s*s)}function c(e,t,i,n,r,s){const a=n-e,o=r-t,l=s-i;return Math.sqrt(a*a+o*o+l*l)}function u(e,t,i,n){return[e+.5*(i-e),t+.5*(n-t)]}function h(e,t,i,n,r,s){return[e+.5*(n-e),t+.5*(r-t),i+.5*(s-i)]}},682:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(2),r=i(340),s=i(157),a=i(662);class o extends a.a{constructor(e,t,i){super(e,i),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=null==i?void 0:i.geometryType,this._features=t}static fromFeatures(e,t){const{objectIdField:i,geometryType:n}=t,s=Object(r.c)([],e,n,!1,!1,i);for(let r=0;r<s.length;r++)s[r].displayId=e[r].displayId;return o.fromOptimizedFeatures(s,t)}static fromFeatureSet(e,t){const i=Object(r.b)(e,t.objectIdField);return o.fromOptimizedFeatureSet(i,t)}static fromOptimizedFeatureSet(e,t){const{features:i}=e,n=o.fromOptimizedFeatures(i,t);n._exceededTransferLimit=e.exceededTransferLimit,n._transform=e.transform;for(const r of e.fields)"esriFieldTypeDate"===r.type&&n._dateFields.add(r.name);return n}static fromOptimizedFeatures(e,t,i){const n=a.a.createInstance(),r=new o(n,e,t);return r._transform=i,r}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(e){const t=new Set(e);this._features=this._features.filter(e=>!t.has(e.objectId))}append(e){for(const t of e)this._features.push(t)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new o(this.instance,this._features,this.fullSchema());return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return Object(r.i)(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const e=this.readGeometry();return Object(r.k)(e,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return Object(n.i)(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return Object(s.c)(this._current)?Object(r.s)(this._current.geometry,2):0}readUnquantizedGeometry(){const e=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!e)return e;const t=e.clone();return function({coords:e,lengths:t}){let i=0;for(const n of t){for(let t=1;t<n;t++)e[2*(i+t)]+=e[2*(i+t)-2],e[2*(i+t)+1]+=e[2*(i+t)-1];i+=n}}(t),t}readHydratedGeometry(){const e=this._current.geometry;if(Object(n.i)(e))return null;const t=e.clone();return Object(n.j)(this._transform)&&Object(r.z)(t,t,this.hasZ,this.hasM,this._transform),t}getXHydrated(){if(!Object(s.c)(this._current))return 0;const e=this._current.geometry.coords[0],t=this.getQuantizationTransform();return Object(n.i)(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){if(!Object(s.c)(this._current))return 0;const e=this._current.geometry.coords[1],t=this.getQuantizationTransform();return Object(n.i)(t)?e:t.translate[1]-e*t.scale[1]}getX(){return Object(s.c)(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return Object(s.c)(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!Object(s.c)(this._current))return null;const e=this._current.geometry.clone();if(e.isPoint)return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sy+this._ty,e;let t=0;for(const i of e.lengths)e.coords[2*t]=e.coords[2*t]*this._sx+this._tx,e.coords[2*t+1]=e.coords[2*t+1]*this._sy+this._ty,t+=i;return e}readCentroid(){if(!Object(s.c)(this._current))return null;if(Object(n.i)(this._current.centroid)){const e=this._computeCentroid();if(Object(n.i)(e))return null;e.coords[0]=(e.coords[0]-this._tx)/this._sx,e.coords[1]=(e.coords[1]-this._ty)/this._sy,this._current.centroid=e}const e=this._current.centroid.clone();return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sx+this._ty,e}hasField(e){return e in this._current.attributes||this.getFieldNames().map(e=>e.toLowerCase()).includes(e.toLowerCase())}getFieldNames(){return Object.keys(this._current.attributes)}_readAttribute(e,t){const i=this._current.attributes[e];if(void 0!==i)return null!=i&&t&&this._dateFields.has(e)?new Date(i):i;const n=this.readAttributes(),r=e.toLocaleLowerCase().trim();for(const s in n)if(s.toLocaleLowerCase().trim()===r){const e=this._current.attributes[s];return null!=e&&t&&this._dateFields.has(s)?new Date(e):e}}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}},683:function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return r}));const n=new(i(23).a)({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function r(e){return n.toJSON(e)}function s(e){const{bandCount:t,attributeTable:i,colormap:n,pixelType:r}=e.rasterInfo;return 1===t&&(null!=i||null!=n||"u8"===r||"s8"===r)}},684:function(e,t,i){"use strict";function n(){return new Float32Array(3)}function r(e,t,i){const n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=i,n}function s(){return n()}function a(){return r(1,1,1)}function o(){return r(1,0,0)}function l(){return r(0,1,0)}function c(){return r(0,0,1)}i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return r}));const u=s(),h=a(),d=o(),f=l(),m=c();Object.freeze({__proto__:null,create:n,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:r,createView:function(e,t){return new Float32Array(e,t,3)},zeros:s,ones:a,unitX:o,unitY:l,unitZ:c,ZEROS:u,ONES:h,UNIT_X:d,UNIT_Y:f,UNIT_Z:m})},686:function(e,t,i){"use strict";i.d(t,"a",(function(){return f})),i.d(t,"b",(function(){return n}));const n={Base64:0,Hex:1,String:2,Raw:3};function r(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function s(e){const t=[];for(let i=0,n=8*e.length;i<n;i+=8)t[i>>5]|=(255&e.charCodeAt(i/8))<<i%32;return t}function a(e){const t=[];for(let i=0,n=32*e.length;i<n;i+=8)t.push(String.fromCharCode(e[i>>5]>>>i%32&255));return t.join("")}function o(e,t,i,n,s,a){return r(function(e,t){return e<<t|e>>>32-t}(r(r(t,e),r(n,a)),s),i)}function l(e,t,i,n,r,s,a){return o(t&i|~t&n,e,t,r,s,a)}function c(e,t,i,n,r,s,a){return o(t&n|i&~n,e,t,r,s,a)}function u(e,t,i,n,r,s,a){return o(t^i^n,e,t,r,s,a)}function h(e,t,i,n,r,s,a){return o(i^(t|~n),e,t,r,s,a)}function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let i=1732584193,n=-271733879,s=-1732584194,a=271733878;for(let o=0;o<e.length;o+=16){const t=i,d=n,f=s,m=a;i=l(i,n,s,a,e[o+0],7,-680876936),a=l(a,i,n,s,e[o+1],12,-389564586),s=l(s,a,i,n,e[o+2],17,606105819),n=l(n,s,a,i,e[o+3],22,-1044525330),i=l(i,n,s,a,e[o+4],7,-176418897),a=l(a,i,n,s,e[o+5],12,1200080426),s=l(s,a,i,n,e[o+6],17,-1473231341),n=l(n,s,a,i,e[o+7],22,-45705983),i=l(i,n,s,a,e[o+8],7,1770035416),a=l(a,i,n,s,e[o+9],12,-1958414417),s=l(s,a,i,n,e[o+10],17,-42063),n=l(n,s,a,i,e[o+11],22,-1990404162),i=l(i,n,s,a,e[o+12],7,1804603682),a=l(a,i,n,s,e[o+13],12,-40341101),s=l(s,a,i,n,e[o+14],17,-1502002290),n=l(n,s,a,i,e[o+15],22,1236535329),i=c(i,n,s,a,e[o+1],5,-165796510),a=c(a,i,n,s,e[o+6],9,-1069501632),s=c(s,a,i,n,e[o+11],14,643717713),n=c(n,s,a,i,e[o+0],20,-373897302),i=c(i,n,s,a,e[o+5],5,-701558691),a=c(a,i,n,s,e[o+10],9,38016083),s=c(s,a,i,n,e[o+15],14,-660478335),n=c(n,s,a,i,e[o+4],20,-405537848),i=c(i,n,s,a,e[o+9],5,568446438),a=c(a,i,n,s,e[o+14],9,-1019803690),s=c(s,a,i,n,e[o+3],14,-187363961),n=c(n,s,a,i,e[o+8],20,1163531501),i=c(i,n,s,a,e[o+13],5,-1444681467),a=c(a,i,n,s,e[o+2],9,-51403784),s=c(s,a,i,n,e[o+7],14,1735328473),n=c(n,s,a,i,e[o+12],20,-1926607734),i=u(i,n,s,a,e[o+5],4,-378558),a=u(a,i,n,s,e[o+8],11,-2022574463),s=u(s,a,i,n,e[o+11],16,1839030562),n=u(n,s,a,i,e[o+14],23,-35309556),i=u(i,n,s,a,e[o+1],4,-1530992060),a=u(a,i,n,s,e[o+4],11,1272893353),s=u(s,a,i,n,e[o+7],16,-155497632),n=u(n,s,a,i,e[o+10],23,-1094730640),i=u(i,n,s,a,e[o+13],4,681279174),a=u(a,i,n,s,e[o+0],11,-358537222),s=u(s,a,i,n,e[o+3],16,-722521979),n=u(n,s,a,i,e[o+6],23,76029189),i=u(i,n,s,a,e[o+9],4,-640364487),a=u(a,i,n,s,e[o+12],11,-421815835),s=u(s,a,i,n,e[o+15],16,530742520),n=u(n,s,a,i,e[o+2],23,-995338651),i=h(i,n,s,a,e[o+0],6,-198630844),a=h(a,i,n,s,e[o+7],10,1126891415),s=h(s,a,i,n,e[o+14],15,-1416354905),n=h(n,s,a,i,e[o+5],21,-57434055),i=h(i,n,s,a,e[o+12],6,1700485571),a=h(a,i,n,s,e[o+3],10,-1894986606),s=h(s,a,i,n,e[o+10],15,-1051523),n=h(n,s,a,i,e[o+1],21,-2054922799),i=h(i,n,s,a,e[o+8],6,1873313359),a=h(a,i,n,s,e[o+15],10,-30611744),s=h(s,a,i,n,e[o+6],15,-1560198380),n=h(n,s,a,i,e[o+13],21,1309151649),i=h(i,n,s,a,e[o+4],6,-145523070),a=h(a,i,n,s,e[o+11],10,-1120210379),s=h(s,a,i,n,e[o+2],15,718787259),n=h(n,s,a,i,e[o+9],21,-343485551),i=r(i,t),n=r(n,d),s=r(s,f),a=r(a,m)}return[i,n,s,a]}function f(e,t=n.Hex){const i=t||n.Base64,r=d(s(e),8*e.length);switch(i){case n.Raw:return r;case n.Hex:return function(e){const t="0123456789abcdef",i=[];for(let n=0,r=4*e.length;n<r;n++)i.push(t.charAt(e[n>>2]>>n%4*8+4&15)+t.charAt(e[n>>2]>>n%4*8&15));return i.join("")}(r);case n.String:return a(r);case n.Base64:return function(e){const t=[];for(let i=0,n=4*e.length;i<n;i+=3){const n=(e[i>>2]>>i%4*8&255)<<16|(e[i+1>>2]>>(i+1)%4*8&255)<<8|e[i+2>>2]>>(i+2)%4*8&255;for(let r=0;r<4;r++)8*i+6*r>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>6*(3-r)&63))}return t.join("")}(r)}}},687:function(e,t,i){"use strict";i.d(t,"a",(function(){return f})),i.d(t,"b",(function(){return c}));var n=i(2),r=i(21),s=i(621),a=i(226),o=i(615),l=i(663);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 e.map(e=>function(e){return{value:e.value,size:Object(r.e)(e.size)}}(e))}function h(e){if("string"==typeof e||"number"==typeof e)return Object(r.e)(e);const t=e;return{type:"size",expression:t.expression,stops:u(t.stops)}}const d=e=>{const t=[],i=[],n=u(e),s=n.length;for(let o=0;o<6;o++){const e=n[Math.min(o,s-1)];t.push(e.value),i.push(null==e.size?a.x:Object(r.c)(e.size))}return{values:new Float32Array(t),sizes:new Float32Array(i)}};function f(e){const t=e&&e.length>0?{}:null,i=t?{}:null;if(!t)return{vvFields:t,vvRanges:i};for(const n of e)if(n.field&&(t[n.type]=n.field),"size"===n.type){i.size||(i.size={});const e=n;switch(Object(l.a)(e)){case o.e.SIZE_MINMAX_VALUE:i.size.minMaxValue={minDataValue:e.minDataValue,maxDataValue:e.maxDataValue,minSize:h(e.minSize),maxSize:h(e.maxSize)};break;case o.e.SIZE_SCALE_STOPS:i.size.scaleStops={stops:u(e.stops)};break;case o.e.SIZE_FIELD_STOPS:if(e.levels){const t={};for(const i in e.levels)t[i]=d(e.levels[i]);i.size.fieldStops={type:"level-dependent",levels:t}}else i.size.fieldStops={type:"static",...d(e.stops)};break;case o.e.SIZE_UNIT_VALUE:i.size.unitValue={unit:e.valueUnit,valueRepresentation:e.valueRepresentation}}}else if("color"===n.type)i.color=_(n);else if("opacity"===n.type)i.opacity=m(n);else if("rotation"===n.type){const e=n;i.rotation={type:e.rotationType}}return{vvFields:t,vvRanges:i}}function m(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 i=e.stops;for(let e=0;e<8;++e){const n=i[Math.min(e,i.length-1)];t.values[e]=n.value,t.opacities[e]=n.opacity}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const i=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]=i}}return t}function p(e,t,i){e[4*t+0]=i.r/255,e[4*t+1]=i.g/255,e[4*t+2]=i.b/255,e[4*t+3]=i.a}function _(e){if(Object(n.i)(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 i=e.stops;for(let e=0;e<8;++e){const n=i[Math.min(e,i.length-1)];t.values[e]=n.value,p(t.colors,e,n.color)}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const i=e.stops&&e.stops.length>=0&&e.stops[0].color;for(let e=0;e<8;e++)t.values[e]=1/0,p(t.colors,e,i)}}for(let i=0;i<32;i+=4)Object(s.b)(t.colors,i,!0);return t}},688:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));i(343);function n(e,t,i,n){const r=e.clone(),s=1<<r.level,a=r.col+t,o=r.row+i;return n&&a<0?(r.col=a+s,r.world-=1):a>=s?(r.col=a-s,r.world+=1):r.col=a,r.row=o,r}},689:function(e,t,i){"use strict";i.d(t,"a",(function(){return f}));var n=i(14),r=i(226);function s(e,t){return e.x===t.x&&e.y===t.y}function a(e,t){return e.x=t.y,e.y=-t.x,e}function o(e,t){return e.x=-t.y,e.y=t.x,e}function l(e,t){return e.x=t.x,e.y=t.y,e}function c(e,t){return e.x=-t.x,e.y=-t.y,e}function u(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function h(e,t){return e.x*t.x+e.y*t.y}function d(e,t,i,n){return e.x=t.x*i+t.y*n,e.y=t.x*n-t.y*i,e}class f{constructor(e,t,i){this.writeVertex=e,this.writeTriangle=t,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(e,t){(function(e){if(!e)return;const t=e.length;if(t<=1)return;let i=0;for(let n=1;n<t;n++)s(e[n],e[i])||++i===n||(e[i]=e[n]);e.length=i+1})(e),this.canUseThinTessellation&&t.halfWidth<r.O&&!t.offset?this._tessellateThin(e,t):this._tessellate(e,t)}_tessellateThin(e,t){if(e.length<2)return;const i=t.wrapDistance||65535;let n=t.initialDistance||0,r=!1,s=e[0].x,a=e[0].y;const o=e.length;for(let l=1;l<o;++l){r&&(r=!1,n=0);let t=e[l].x,o=e[l].y,c=t-s,u=o-a,h=Math.sqrt(c*c+u*u);if(c/=h,u/=h,n+h>i){r=!0;const e=(i-n)/h;h=i-n,t=(1-e)*s+e*t,o=(1-e)*a+e*o,--l}const d=this.writeVertex(s,a,0,0,c,u,u,-c,0,-1,n),f=this.writeVertex(s,a,0,0,c,u,-u,c,0,1,n);n+=h;const m=this.writeVertex(t,o,0,0,c,u,u,-c,0,-1,n),p=this.writeVertex(t,o,0,0,c,u,-u,c,0,1,n);this.writeTriangle(d,f,m),this.writeTriangle(f,m,p),s=t,a=o}}_tessellate(e,t){const i=e[0],r=e[e.length-1],f=s(i,r),m=f?3:2;if(e.length<m)return;const p=t.pixelCoordRatio,_=null!=t.capType?t.capType:n.d.BUTT,g=null!=t.joinType?t.joinType:n.o.MITER,x=null!=t.miterLimit?Math.min(t.miterLimit,4):2,y=null!=t.roundLimit?Math.min(t.roundLimit,1.05):1.05,v=null!=t.halfWidth?t.halfWidth:2,b=!!t.textured;let O,S,T=null,w=null;const j=this.prevNormal,I=this.nextNormal;let M=-1,E=-1;const C=this.joinNormal;let R,D;const P=this.textureNormalLeft,A=this.textureNormalRight,z=this.textureNormal;let L=-1,F=-1;const V=t.wrapDistance||65535;let N=t.initialDistance||0;const U=this.writeVertex,k=this.writeTriangle,B=function(e,t,i,n,r,s){const a=U(O,S,R,D,i,n,e,t,r,s,N);return L>=0&&F>=0&&a>=0&&k(L,F,a),L=F,F=a,a};f&&(T=e[e.length-2],I.x=r.x-T.x,I.y=r.y-T.y,E=u(I),I.x/=E,I.y/=E);let G=!1;for(let s=0;s<e.length;++s){if(G&&(G=!1,N=0),T&&(j.x=-I.x,j.y=-I.y,M=E,N+M>V&&(G=!0)),G){const t=(V-N)/M;M=V-N,T={x:(1-t)*T.x+t*e[s].x,y:(1-t)*T.y+t*e[s].y},--s}else T=e[s];O=T.x,S=T.y;const t=s<=0&&!G,i=s===e.length-1;if(t||(N+=M),w=i?f?e[1]:null:e[s+1],w?(I.x=w.x-O,I.y=w.y-S,E=u(I),I.x/=E,I.y/=E):(I.x=void 0,I.y=void 0),!f){if(t){o(C,I),R=C.x,D=C.y,_===n.d.SQUARE&&(B(-I.y-I.x,I.x-I.y,I.x,I.y,0,-1),B(I.y-I.x,-I.x-I.y,I.x,I.y,0,1)),_===n.d.ROUND&&(B(-I.y-I.x,I.x-I.y,I.x,I.y,-1,-1),B(I.y-I.x,-I.x-I.y,I.x,I.y,-1,1)),_!==n.d.ROUND&&_!==n.d.BUTT||(B(-I.y,I.x,I.x,I.y,0,-1),B(I.y,-I.x,I.x,I.y,0,1));continue}if(i){a(C,j),R=C.x,D=C.y,_!==n.d.ROUND&&_!==n.d.BUTT||(B(j.y,-j.x,-j.x,-j.y,0,-1),B(-j.y,j.x,-j.x,-j.y,0,1)),_===n.d.SQUARE&&(B(j.y-j.x,-j.x-j.y,-j.x,-j.y,0,-1),B(-j.y-j.x,j.x-j.y,-j.x,-j.y,0,1)),_===n.d.ROUND&&(B(j.y-j.x,-j.x-j.y,-j.x,-j.y,1,-1),B(-j.y-j.x,j.x-j.y,-j.x,-j.y,1,1));continue}}let r,m,U=(H=I,-((W=j).x*H.y-W.y*H.x));if(Math.abs(U)<.01)h(j,I)>0?(C.x=j.x,C.y=j.y,U=1,r=Number.MAX_VALUE,m=!0):(o(C,I),U=1,r=1,m=!1);else{C.x=(j.x+I.x)/U,C.y=(j.y+I.y)/U,r=u(C);const e=(r-1)*v*p;m=r>4||e>M&&e>E}R=C.x,D=C.y;let k=g;switch(g){case n.o.BEVEL:r<1.05&&(k=n.o.MITER);break;case n.o.ROUND:r<y&&(k=n.o.MITER);break;case n.o.MITER:r>x&&(k=n.o.BEVEL)}switch(k){case n.o.MITER:if(B(C.x,C.y,-j.x,-j.y,0,-1),B(-C.x,-C.y,-j.x,-j.y,0,1),i)break;if(b){const e=G?0:N;L=this.writeVertex(O,S,R,D,I.x,I.y,C.x,C.y,0,-1,e),F=this.writeVertex(O,S,R,D,I.x,I.y,-C.x,-C.y,0,1,e)}break;case n.o.BEVEL:{const e=U<0;let t,n,r,s;if(e){const e=L;L=F,F=e,t=P,n=A}else t=A,n=P;if(m)r=e?o(this.innerPrev,j):a(this.innerPrev,j),s=e?a(this.innerNext,I):o(this.innerNext,I);else{const t=e?c(this.inner,C):l(this.inner,C);r=t,s=t}const u=e?a(this.bevelStart,j):o(this.bevelStart,j);B(r.x,r.y,-j.x,-j.y,t.x,t.y);const h=B(u.x,u.y,-j.x,-j.y,n.x,n.y);if(i)break;const f=e?o(this.bevelEnd,I):a(this.bevelEnd,I);if(m){const e=this.writeVertex(O,S,R,D,-j.x,-j.y,0,0,0,0,N);L=this.writeVertex(O,S,R,D,I.x,I.y,s.x,s.y,t.x,t.y,N),F=this.writeVertex(O,S,R,D,I.x,I.y,f.x,f.y,n.x,n.y,N),this.writeTriangle(h,e,F)}else{if(b){const e=this.bevelMiddle;e.x=(u.x+f.x)/2,e.y=(u.y+f.y)/2,d(z,e,-j.x,-j.y),B(e.x,e.y,-j.x,-j.y,z.x,z.y),d(z,e,I.x,I.y),L=this.writeVertex(O,S,R,D,I.x,I.y,e.x,e.y,z.x,z.y,N),F=this.writeVertex(O,S,R,D,I.x,I.y,s.x,s.y,t.x,t.y,N)}else{const e=L;L=F,F=e}B(f.x,f.y,I.x,I.y,n.x,n.y)}if(e){const e=L;L=F,F=e}break}case n.o.ROUND:{const e=U<0;let t,n;if(e){const e=L;L=F,F=e,t=P,n=A}else t=A,n=P;const s=e?c(this.inner,C):l(this.inner,C);let u,f;m?(u=e?o(this.innerPrev,j):a(this.innerPrev,j),f=e?a(this.innerNext,I):o(this.innerNext,I)):(u=s,f=s);const p=e?a(this.roundStart,j):o(this.roundStart,j),_=e?o(this.roundEnd,I):a(this.roundEnd,I),g=B(u.x,u.y,-j.x,-j.y,t.x,t.y),x=B(p.x,p.y,-j.x,-j.y,n.x,n.y);if(i)break;const y=this.writeVertex(O,S,R,D,-j.x,-j.y,0,0,0,0,N);m||this.writeTriangle(L,F,y);const v=c(this.outer,s),T=this.writeVertex(O,S,R,D,I.x,I.y,_.x,_.y,n.x,n.y,N);let w,M;const E=r>2;if(E){let t;r!==Number.MAX_VALUE?(v.x/=r,v.y/=r,t=h(j,v),t=(r*(t*t-1)+1)/t):t=-1,w=e?a(this.startBreak,j):o(this.startBreak,j),w.x+=j.x*t,w.y+=j.y*t,M=e?o(this.endBreak,I):a(this.endBreak,I),M.x+=I.x*t,M.y+=I.y*t}d(z,v,-j.x,-j.y);const V=this.writeVertex(O,S,R,D,-j.x,-j.y,v.x,v.y,z.x,z.y,N);d(z,v,I.x,I.y);const k=b?this.writeVertex(O,S,R,D,I.x,I.y,v.x,v.y,z.x,z.y,N):V,G=y,W=b?this.writeVertex(O,S,R,D,I.x,I.y,0,0,0,0,N):y;let H=-1,q=-1;if(E&&(d(z,w,-j.x,-j.y),H=this.writeVertex(O,S,R,D,-j.x,-j.y,w.x,w.y,z.x,z.y,N),d(z,M,I.x,I.y),q=this.writeVertex(O,S,R,D,I.x,I.y,M.x,M.y,z.x,z.y,N)),b?E?(this.writeTriangle(G,x,H),this.writeTriangle(G,H,V),this.writeTriangle(W,k,q),this.writeTriangle(W,q,T)):(this.writeTriangle(G,x,V),this.writeTriangle(W,k,T)):E?(this.writeTriangle(y,x,H),this.writeTriangle(y,H,q),this.writeTriangle(y,q,T)):(this.writeTriangle(y,x,V),this.writeTriangle(y,k,T)),m?(L=this.writeVertex(O,S,R,D,I.x,I.y,f.x,f.y,t.x,t.y,N),F=T):(L=b?this.writeVertex(O,S,R,D,I.x,I.y,f.x,f.y,t.x,t.y,N):g,this.writeTriangle(L,W,T),F=T),e){const e=L;L=F,F=e}break}}}var W,H}}},690:function(e,t,i){"use strict";i.d(t,"a",(function(){return u})),i.d(t,"b",(function(){return c}));var n,r,s=i(226),a=i(652),o=i(632);class l{constructor(e,t,i){this.ratio=e,this.x=t,this.y=i}}class c{constructor(e,t,i,n=8,r=8){this.lines=[],this.starts=[],this.validateTessellation=!0,this.pixelRatio=n,this.pixelMargin=r,this.tileSize=s.P*n,this.dz=e,this.yPos=t,this.xPos=i}setPixelMargin(e){e!==this.pixelMargin&&(this.pixelMargin=e,this.setExtent(this._extent))}setExtent(e){this._extent=e,this.finalRatio=this.tileSize/e*(1<<this.dz);let t=this.pixelRatio*this.pixelMargin;t/=this.finalRatio;const i=e>>this.dz;t>i&&(t=i),this.margin=t,this.xmin=i*this.xPos-t,this.ymin=i*this.yPos-t,this.xmax=this.xmin+i+2*t,this.ymax=this.ymin+i+2*t}reset(e){this.type=e,this.lines=[],this.starts=[],this.line=null,this.start=0}moveTo(e,t){this._pushLine(),this._prevIsIn=this._isIn(e,t),this._moveTo(e,t,this._prevIsIn),this._prevPt=new a.b(e,t),this._firstPt=new a.b(e,t),this._dist=0}lineTo(e,t){const i=this._isIn(e,t),n=new a.b(e,t),r=a.b.distance(this._prevPt,n);let s,o,c,u,h,d,f,m;if(i)this._prevIsIn?this._lineTo(e,t,!0):(s=this._prevPt,o=n,c=this._intersect(o,s),this.start=this._dist+r*(1-this._r),this._lineTo(c.x,c.y,!0),this._lineTo(o.x,o.y,!0));else if(this._prevIsIn)o=this._prevPt,s=n,c=this._intersect(o,s),this._lineTo(c.x,c.y,!0),this._lineTo(s.x,s.y,!1);else{const e=this._prevPt,t=n;if(e.x<=this.xmin&&t.x<=this.xmin||e.x>=this.xmax&&t.x>=this.xmax||e.y<=this.ymin&&t.y<=this.ymin||e.y>=this.ymax&&t.y>=this.ymax)this._lineTo(t.x,t.y,!1);else{const i=[];if((e.x<this.xmin&&t.x>this.xmin||e.x>this.xmin&&t.x<this.xmin)&&(u=(this.xmin-e.x)/(t.x-e.x),m=e.y+u*(t.y-e.y),m<=this.ymin?d=!1:m>=this.ymax?d=!0:i.push(new l(u,this.xmin,m))),(e.x<this.xmax&&t.x>this.xmax||e.x>this.xmax&&t.x<this.xmax)&&(u=(this.xmax-e.x)/(t.x-e.x),m=e.y+u*(t.y-e.y),m<=this.ymin?d=!1:m>=this.ymax?d=!0:i.push(new l(u,this.xmax,m))),(e.y<this.ymin&&t.y>this.ymin||e.y>this.ymin&&t.y<this.ymin)&&(u=(this.ymin-e.y)/(t.y-e.y),f=e.x+u*(t.x-e.x),f<=this.xmin?h=!1:f>=this.xmax?h=!0:i.push(new l(u,f,this.ymin))),(e.y<this.ymax&&t.y>this.ymax||e.y>this.ymax&&t.y<this.ymax)&&(u=(this.ymax-e.y)/(t.y-e.y),f=e.x+u*(t.x-e.x),f<=this.xmin?h=!1:f>=this.xmax?h=!0:i.push(new l(u,f,this.ymax))),0===i.length)h?d?this._lineTo(this.xmax,this.ymax,!0):this._lineTo(this.xmax,this.ymin,!0):d?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+r*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+r*i[0].ratio;for(let e=0;e<i.length;e++)this._lineTo(i[e].x,i[e].y,!0)}this._lineTo(t.x,t.y,!1)}}this._dist+=r,this._prevIsIn=i,this._prevPt=n}close(){if(this.line.length>2){const e=this._firstPt,t=this._prevPt;e.x===t.x&&e.y===t.y||this.lineTo(e.x,e.y);const i=this.line;let n=i.length;for(;n>=4&&(i[0].x===i[1].x&&i[0].x===i[n-2].x||i[0].y===i[1].y&&i[0].y===i[n-2].y);)i.pop(),i[0].x=i[n-2].x,i[0].y=i[n-2].y,--n}}result(e=!0){return this._pushLine(),0===this.lines.length?null:(this.type===a.a.Polygon&&e&&h.simplify(this.tileSize,this.margin*this.finalRatio,this.lines),this.lines)}resultWithStarts(){if(this.type!==a.a.LineString)throw new Error("Only valid for lines");this._pushLine();const e=this.lines,t=e.length;if(0===t)return null;const i=[];for(let n=0;n<t;n++)i.push({line:e[n],start:this.starts[n]||0});return i}_isIn(e,t){return e>=this.xmin&&e<=this.xmax&&t>=this.ymin&&t<=this.ymax}_intersect(e,t){let i,n,r;if(t.x>=this.xmin&&t.x<=this.xmax)n=t.y<=this.ymin?this.ymin:this.ymax,r=(n-e.y)/(t.y-e.y),i=e.x+r*(t.x-e.x);else if(t.y>=this.ymin&&t.y<=this.ymax)i=t.x<=this.xmin?this.xmin:this.xmax,r=(i-e.x)/(t.x-e.x),n=e.y+r*(t.y-e.y);else{n=t.y<=this.ymin?this.ymin:this.ymax,i=t.x<=this.xmin?this.xmin:this.xmax;const s=(i-e.x)/(t.x-e.x),a=(n-e.y)/(t.y-e.y);s<a?(r=s,n=e.y+s*(t.y-e.y)):(r=a,i=e.x+a*(t.x-e.x))}return this._r=r,new a.b(i,n)}_pushLine(){this.line&&(this.type===a.a.Point?this.line.length>0&&(this.lines.push(this.line),this.starts.push(this.start)):this.type===a.a.LineString?this.line.length>1&&(this.lines.push(this.line),this.starts.push(this.start)):this.type===a.a.Polygon&&this.line.length>3&&(this.lines.push(this.line),this.starts.push(this.start))),this.line=[],this.start=0}_moveTo(e,t,i){this.type!==a.a.Polygon?i&&(e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),this.line.push(new a.b(e,t))):(i||(e<this.xmin&&(e=this.xmin),e>this.xmax&&(e=this.xmax),t<this.ymin&&(t=this.ymin),t>this.ymax&&(t=this.ymax)),e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),this.line.push(new a.b(e,t)),this._is_h=!1,this._is_v=!1)}_lineTo(e,t,i){let n,r;if(this.type!==a.a.Polygon)if(i){if(e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),this.line.length>0&&(n=this.line[this.line.length-1],n.equals(e,t)))return;this.line.push(new a.b(e,t))}else this.line&&this.line.length>0&&this._pushLine();else if(i||(e<this.xmin&&(e=this.xmin),e>this.xmax&&(e=this.xmax),t<this.ymin&&(t=this.ymin),t>this.ymax&&(t=this.ymax)),e=Math.round((e-(this.xmin+this.margin))*this.finalRatio),t=Math.round((t-(this.ymin+this.margin))*this.finalRatio),this.line&&this.line.length>0){n=this.line[this.line.length-1];const i=n.x===e,s=n.y===t;if(i&&s)return;this._is_h&&i||this._is_v&&s?(n.x=e,n.y=t,r=this.line[this.line.length-2],r.x===e&&r.y===t?(this.line.pop(),this.line.length<=1?(this._is_h=!1,this._is_v=!1):(r=this.line[this.line.length-2],this._is_h=r.x===e,this._is_v=r.y===t)):(this._is_h=r.x===e,this._is_v=r.y===t)):(this.line.push(new a.b(e,t)),this._is_h=i,this._is_v=s)}else this.line.push(new a.b(e,t))}}class u{setExtent(e){this._ratio=4096===e?1:4096/e}get validateTessellation(){return this._ratio<1}reset(e){this.lines=[],this.line=null}moveTo(e,t){this.line&&this.lines.push(this.line),this.line=[];const i=this._ratio;this.line.push(new a.b(e*i,t*i))}lineTo(e,t){const i=this._ratio;this.line.push(new a.b(e*i,t*i))}close(){const e=this.line;e&&!e[0].isEqual(e[e.length-1])&&e.push(e[0])}result(){return this.line&&this.lines.push(this.line),0===this.lines.length?null:this.lines}}(r=n||(n={}))[r.sideLeft=0]="sideLeft",r[r.sideRight=1]="sideRight",r[r.sideTop=2]="sideTop",r[r.sideBottom=3]="sideBottom";class h{static simplify(e,t,i){if(!i)return;const r=-t,s=e+t,a=-t,o=e+t,l=[],c=[],u=i.length;for(let h=0;h<u;++h){const e=i[h];if(!e||e.length<2)continue;let t,u=e[0];const d=e.length;for(let i=1;i<d;++i)t=e[i],u.x===t.x&&(u.x<=r&&(u.y>t.y?(l.push(h),l.push(i),l.push(n.sideLeft),l.push(-1)):(c.push(h),c.push(i),c.push(n.sideLeft),c.push(-1))),u.x>=s&&(u.y<t.y?(l.push(h),l.push(i),l.push(n.sideRight),l.push(-1)):(c.push(h),c.push(i),c.push(n.sideRight),c.push(-1)))),u.y===t.y&&(u.y<=a&&(u.x<t.x?(l.push(h),l.push(i),l.push(n.sideTop),l.push(-1)):(c.push(h),c.push(i),c.push(n.sideTop),c.push(-1))),u.y>=o&&(u.x>t.x?(l.push(h),l.push(i),l.push(n.sideBottom),l.push(-1)):(c.push(h),c.push(i),c.push(n.sideBottom),c.push(-1)))),u=t}if(0===l.length||0===c.length)return;h.fillParent(i,c,l),h.fillParent(i,l,c);const d=[];h.calcDeltas(d,c,l),h.calcDeltas(d,l,c),h.addDeltas(d,i)}static fillParent(e,t,i){const r=i.length,s=t.length;for(let a=0;a<s;a+=4){const s=t[a],l=t[a+1],c=t[a+2],u=e[s][l-1],h=e[s][l];let d=8092,f=-1;for(let t=0;t<r;t+=4){if(i[t+2]!==c)continue;const r=i[t],s=i[t+1],a=e[r][s-1],l=e[r][s];switch(c){case n.sideLeft:case n.sideRight:if(Object(o.a)(u.y,a.y,l.y)&&Object(o.a)(h.y,a.y,l.y)){const e=Math.abs(l.y-a.y);e<d&&(d=e,f=t)}break;case n.sideTop:case n.sideBottom:if(Object(o.a)(u.x,a.x,l.x)&&Object(o.a)(h.x,a.x,l.x)){const e=Math.abs(l.x-a.x);e<d&&(d=e,f=t)}}}t[a+3]=f}}static calcDeltas(e,t,i){const n=t.length;for(let r=0;r<n;r+=4){const n=[],s=h.calcDelta(r,t,i,n);e.push(t[r]),e.push(t[r+1]),e.push(t[r+2]),e.push(s)}}static calcDelta(e,t,i,n){const r=t[e+3];if(-1===r)return 0;const s=n.length;return s>1&&n[s-2]===r?0:(n.push(r),h.calcDelta(r,i,t,n)+1)}static addDeltas(e,t){const i=e.length;let r=0;for(let n=0;n<i;n+=4){const t=e[n+3];t>r&&(r=t)}for(let s=0;s<i;s+=4){const i=t[e[s]],a=e[s+1],o=r-e[s+3];switch(e[s+2]){case n.sideLeft:i[a-1].x-=o,i[a].x-=o,1===a&&(i[i.length-1].x-=o),a===i.length-1&&(i[0].x-=o);break;case n.sideRight:i[a-1].x+=o,i[a].x+=o,1===a&&(i[i.length-1].x+=o),a===i.length-1&&(i[0].x+=o);break;case n.sideTop:i[a-1].y-=o,i[a].y-=o,1===a&&(i[i.length-1].y-=o),a===i.length-1&&(i[0].y-=o);break;case n.sideBottom:i[a-1].y+=o,i[a].y+=o,1===a&&(i[i.length-1].y+=o),a===i.length-1&&(i[0].y+=o)}}}}},691:function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return o}));var n=i(11),r=i(21);const s=n.a.getLogger("esri.renderers.visualVariables.support.utils"),a=e=>{if(!("visualVariables"in e)||!e.visualVariables||!e.visualVariables.length)return e;const t=e.clone(),i=t.visualVariables.map(e=>l(e)?c(e):e);return t.visualVariables=i,t};function o(e){return e.map(e=>l(e)?c(e.clone()):e)}function l(e){return("size"===e.type||"color"===e.type||"opacity"===e.type)&&null!=e.stops}function c(e){return e.stops=function(e,t){return t.length<=8?t:(s.warn(`Found ${t.length} Visual Variable stops, but MapView only supports 8. Displayed stops will be simplified.`),t.length>16?function(e,t){const[i,...n]=t,s=n.pop(),a=n[0].value,o=n[n.length-1].value,l=(o-a)/6,c=[];for(let h=a;h<o;h+=l){let i=0;for(;h>=n[i].value;)i++;const s=n[i],a=t[i-1],o=h-a.value,l=s.value===a.value?1:o/(s.value-a.value);if("color"===e){const e=n[i],r=t[i-1],s=e.color.clone();s.r=u(r.color.r,s.r,l),s.g=u(r.color.g,s.g,l),s.b=u(r.color.b,s.b,l),s.a=u(r.color.a,s.a,l),c.push({value:h,color:s,label:e.label})}else if("size"===e){const e=n[i],s=t[i-1],a=Object(r.e)(e.size),o=u(Object(r.e)(s.size),a,l);c.push({value:h,size:o,label:e.label})}else{const e=n[i],r=u(t[i-1].opacity,e.opacity,l);c.push({value:h,opacity:r,label:e.label})}}return[i,...c,s]}(e,t):function(e){const[t,...i]=e,n=i.pop();for(;i.length>6;){let e=0,t=0;for(let n=1;n<i.length;n++){const r=i[n-1],s=i[n],a=Math.abs(s.value-r.value);a>t&&(t=a,e=n)}i.splice(e,1)}return[t,...i,n]}(t))}(e.type,e.stops),e}function u(e,t,i){return(1-i)*e+i*t}},693:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i(2);class r{constructor(e,t,i){this.pixelBlock=e,this.extent=t,this.originalPixelBlock=i}get width(){return Object(n.j)(this.pixelBlock)?this.pixelBlock.width:0}get height(){return Object(n.j)(this.pixelBlock)?this.pixelBlock.height:0}render(e){const t=this.pixelBlock;if(Object(n.i)(t))return;const i=this.filter({pixelBlock:t});if(Object(n.i)(i.pixelBlock))return;const r=i.pixelBlock.getAsRGBA(),s=e.createImageData(i.pixelBlock.width,i.pixelBlock.height);s.data.set(r),e.putImageData(s,0,0)}getRenderedRasterPixels(){const e=this.filter({pixelBlock:this.pixelBlock});return Object(n.i)(e.pixelBlock)?null:{width:e.pixelBlock.width,height:e.pixelBlock.height,renderedRasterPixels:new Uint8Array(e.pixelBlock.getAsRGBA().buffer)}}}},694:function(e,t,i){"use strict";i.d(t,"a",(function(){return S})),i.d(t,"b",(function(){return v})),i.d(t,"c",(function(){return b})),i.d(t,"d",(function(){return T}));var n,r=i(8),s=i(5),a=i(11),o=i(2),l=i(686),c=i(285),u=i(390),h=i(0),d=i(6),f=i(1),m=(i(4),i(3)),p=i(18),_=i(63);let g=n=class extends c.a{writeLevels(e,t,i){for(const n in e){const e=this.levels[n];return void(t.stops=e)}}clone(){return new n({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:Object(_.e)(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:Object(_.e)(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops&&this.stops.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:Object(d.a)(this.levels)})}};Object(h.a)([Object(f.b)()],g.prototype,"levels",void 0),Object(h.a)([Object(p.a)("levels")],g.prototype,"writeLevels",null),g=n=Object(h.a)([Object(m.a)("esri.views.2d.engine.LevelDependentSizeVariable")],g);const x=a.a.getLogger("esri.views.2d.layers.support.clusterUtils");s.a.add("esri-cluster-arcade-enabled",!0);const y=Object(s.a)("esri-cluster-arcade-enabled"),v=(e,t,i,n)=>{const r=t.clone();if(!T(r))return r;if(i.fields)for(const s of i.fields)w(e,s);if("visualVariables"in r){const t=(r.visualVariables||[]).filter(e=>"$view.scale"!==e.valueExpression),s=b(t);t.forEach(t=>{"rotation"===t.type?t.field?t.field=I(e,t.field,"avg_angle"):t.valueExpression&&(t.field=j(e,t.valueExpression,"avg_angle"),t.valueExpression=null):t.normalizationField?(t.field=I(e,t.field,"norm",t.normalizationField),t.normalizationField=null):t.field?t.field=I(e,t.field,"avg"):(t.field=j(e,t.valueExpression,"avg"),t.valueExpression=null)}),Object(o.i)(s)&&!O(t)&&(t.push(S(i,n)),r.dynamicClusterSize=!0),r.visualVariables=t}switch(r.type){case"simple":break;case"unique-value":r.field?r.field=I(e,r.field,"mode"):r.valueExpression&&(r.field=j(e,r.valueExpression,"mode"),r.valueExpression=null);break;case"class-breaks":r.normalizationField?(r.field=I(e,r.field,"norm",r.normalizationField),r.normalizationField=null):r.field?r.field=I(e,r.field,"avg"):(r.field=j(e,r.valueExpression,"avg"),r.valueExpression=null)}return r},b=e=>{for(const t of e)if("size"===t.type)return t;return null},O=e=>{for(const t of e)if("cluster_count"===t.field)return!0;return!1},S=(e,t)=>{const i=[new u.a({value:0,size:0}),new u.a({value:1})];if(Object(o.i)(t))return new c.a({field:"cluster_count",stops:[...i,new u.a({value:2,size:0})]});const n=Object.keys(t).reduce((n,r)=>({...n,[r]:[...i,new u.a({value:Math.max(2,t[r].minValue),size:e.clusterMinSize}),new u.a({value:Math.max(3,t[r].maxValue),size:e.clusterMaxSize})]}),{});return new g({field:"cluster_count",levels:n})},T=e=>{const t=t=>x.error(new r.a("Unsupported-renderer",t,{renderer:e}));if("unique-value"===e.type){if(e.field2||e.field3)return t("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1}else if("class-breaks"===e.type){if(e.normalizationField){const i=e.normalizationType;if("field"!==i)return t("FeatureReductionCluster does not support a normalizationType of "+i),!1}}else if("simple"!==e.type)return t("FeatureReductionCluster does not support renderers of type "+e.type),!1;if(!y){if("valueExpression"in e&&e.valueExpression)return t("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in e&&e.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return t("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function w(e,t){const{name:i,outStatistic:n}=t,{onStatisticField:s,onStatisticValueExpression:a,statisticType:o}=n;if(a){const t=Object(l.a)(a.toLowerCase());e.push({name:i,outStatistic:{onStatisticField:t,onStatisticValueExpression:a,statisticType:o}})}else s?e.push({name:i,outStatistic:{onStatisticField:s,statisticType:o}}):x.error(new r.a("mapview-unsupported-field","Unable to handle field",{field:t}))}function j(e,t,i){const n=Object(l.a)(t),r="mode"===i?"cluster_type_"+n:"cluster_avg_"+n;return e.some(e=>e.name===r)||e.push({name:r,outStatistic:{onStatisticField:n,onStatisticValueExpression:t,statisticType:i}}),r}function I(e,t,i,n){if("cluster_count"===t||e.some(e=>e.name===t))return t;const r=function(e,t,i){switch(e){case"avg":case"avg_angle":return"cluster_avg_"+t;case"mode":return"cluster_type_"+t;case"norm":{const e=i,n="field",r=t.toLowerCase()+",norm:"+n+","+e.toLowerCase();return"cluster_avg_"+Object(l.a)(r)}}}(i,t,n);return e.some(e=>e.name===r)||("norm"===i?e.push({name:r,outStatistic:{onStatisticField:t,onStatisticNormalizationField:n,statisticType:i}}):e.push({name:r,outStatistic:{onStatisticField:t,statisticType:i}})),r}},696:function(e,t,i){"use strict";i.d(t,"a",(function(){return O}));var n=i(8),r=i(5),s=i(11),a=i(49),o=i(2),l=i(12),c=i(381),u=i(376),h=i(226),d=i(629),f=i(616),m=i(668),p=i(687),_=i(614);const g=s.a.getLogger("esri.views.layers.2d.features.support.AttributeStore"),x=Object(m.b)(m.a,g),y={sharedArrayBuffer:Object(r.a)("esri-shared-array-buffer"),atomics:Object(r.a)("esri-atomics")};function v(e,t){return i=>t(e(i))}class b{constructor(e,t,i,n){this.size=0,this.texelSize=4;const{pixelType:r,layout:s,textureOnly:a}=n;this.textureOnly=a||!1,this.pixelType=r,this._ctype=t,this.layout=s,this._resetRange(),this._shared=e,this.size=i,a||(this.data=this._initData(r,i,e,t))}get buffer(){return Object(o.b)(this.data,e=>e.buffer)}unsetComponentAllTexels(e,t){const i=Object(o.q)(this.data);for(let n=0;n<this.size*this.size;n++)i[n*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){const i=Object(o.q)(this.data);for(let n=0;n<this.size*this.size;n++)i[n*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,i){const n=Object(o.q)(this.data);for(const r of i)n[r*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(e,t,i){Object(o.q)(this.data)[i*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(e,t,i){Object(o.q)(this.data)[i*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(e,t){const i=Object(d.f)(e);return Object(o.q)(this.data)[i*this.texelSize+t]}setData(e,t,i){const n=Object(d.f)(e),r=1<<t;0!=(this.layout&r)?(this.data[n*this.texelSize+t]=i,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n)):g.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===_.q.UNSIGNED_BYTE&&this._shared&&y.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===_.q.UNSIGNED_BYTE&&this._shared&&y.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(e){if(this.size=e,!this.textureOnly){const t=this._initData(this.pixelType,e,this._shared,this._ctype),i=Object(o.q)(this.data);t.set(i),this.data=t}}toMessage(){const e=this.dirtyStart,t=this.dirtyEnd,i=this.texelSize;if(e>t)return null;this._resetRange();const n=!(this._shared||"local"===this._ctype),r=this.pixelType,s=this.layout,a=Object(o.q)(this.data);return{start:e,end:t,data:n&&a.slice(e*i,(t+1)*i)||null,pixelType:r,layout:s}}_initData(e,t,i,n){const r=i&&"local"!==n?SharedArrayBuffer:ArrayBuffer,s=Object(f.l)(e),a=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let o=0;o<a.length;o+=4)a[o+1]=255;return a}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class O{constructor(e,t){this._client=e,this.config=t,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(h.v),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const i=t.supportsTextureFloat?_.q.FLOAT:_.q.UNSIGNED_BYTE;x(`Creating AttributeStore ${y.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:_.q.UNSIGNED_BYTE,layout:1},{pixelType:_.q.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:_.q.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}update(e,t){this.config=t;const i=t.schema.processors[0].storage,n=Object(c.a)(this._schema,i);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),n&&(Object(r.a)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",n),e.storage.data=!0,this._schema=i,this._attributeComputeMap.clear(),!Object(o.i)(i))){switch(i.target){case"feature":this._targetType=d.c;break;case"aggregate":this._targetType=d.b}if("subtype"===i.type)for(const e in i.mapping){const t=i.mapping[e];if(Object(o.j)(t))for(const e of t.mapping)this._bindAttribute(e)}else for(const e of i.mapping)this._bindAttribute(e)}}onTileData(e,t){if(Object(o.i)(t.addOrUpdate))return;const i=t.addOrUpdate.getCursor();for(;i.next();){const e=i.getDisplayId();this.setAttributeData(e,i)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(e,t){const i=this._getBlock(0),n=t.map(e=>Object(d.f)(e));i.lock(),i.unsetComponentAllTexels(0,1),i.setComponent(0,1,n),i.unlock(),this._idsToHighlight.clear();for(const r of e)this._idsToHighlight.add(r);await this.sendUpdates()}async updateFilters(e,t){const{config:i,service:n,spatialReference:s}=t,{filters:a}=i,o=a.map((e,t)=>this._updateFilter(e,t,n,s));(await Promise.all(o)).some(e=>e)&&(e.storage.filters=!0,Object(r.a)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,t,i,n){const r=Object(d.f)(e);this._ensureSizeForTexel(r),this._getBlock(t).setData(e,i,n)}getData(e,t,i){return this._getBlock(t).getData(e,i)}getHighlightFlag(e){return this._idsToHighlight.has(e)?h.s:0}unsetAttributeData(e){const t=Object(d.f)(e);this._getBlock(0).setData(t,0,0)}setAttributeData(e,t){const i=Object(d.f)(e);if(this._ensureSizeForTexel(i),this._getBlock(0).setData(i,0,this.getFilterFlags(t)),this._targetType!==Object(d.g)(e))return;const n=this._attributeComputeMap,r=this.config.supportsTextureFloat?1:2;n.size&&n.forEach((e,n)=>{const s=n*r%4,o=Math.floor(n*r/4),l=this._getBlock(o+h.e),c=e(t);if(this.config.supportsTextureFloat)l.setData(i,s,c);else if(c===h.x)l.setData(i,s,255),l.setData(i,s+1,255);else{const e=Object(a.d)(Math.round(c),-32767,32766)+32768,t=255&e,n=(65280&e)>>8;l.setData(i,s,t),l.setData(i,s+1,n)}})}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=Object(l.f)(),this._nextUpdate.promise;const e={blocks:this._blocks.map(e=>Object(o.j)(e)?e.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const e=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>e.resolve())}},i=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),i}).catch(e=>Object(l.l)(e)?(this._createResourcesPromise=null,this._createResources()):(g.error(new n.a("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve())),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e){let t;if(null!=e.fieldIndex)e.normalizationField&&g.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),t=t=>t.getComputedNumericAtIndex(e.fieldIndex);else{if(!e.field)return;t=e.normalizationField?t=>{const i=t.readAttribute(e.normalizationField);return i?t.readAttribute(e.field)/i:null}:t=>t.readAttribute(e.field)}e.valueRepresentation&&(t=v(t,t=>Object(p.b)(t,e.valueRepresentation)));this._attributeComputeMap.set(e.binding,v(t,e=>null===e||isNaN(e)||e===1/0?h.x:e))}_createResources(){if(Object(o.j)(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(h.a),this._getBlock(h.d),x("Initializing AttributeStore");const e={shared:y.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:Object(o.l)(this._blocks,e=>({textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}))},t=this._client.initialize(e,this._signal).catch(e=>{Object(l.l)(e)?this._createResourcesPromise=null:g.error(new n.a("mapview-attribute-store","Encountered an error during client initialization",e))});return this._createResourcesPromise=t,t.then(()=>Object(o.i)(this._createResourcesPromise)?this._createResources():void 0),t}_getBlock(e){const t=this._blocks[e];if(Object(o.j)(t))return t;x("Initializing AttributeBlock at index "+e);const i=y.sharedArrayBuffer,n=this._client.type,r=new b(i,n,this._size,this._blockDescriptors[e]);return this._blocks[e]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const e=this._size<<=1;return x("Expanding block size to",e,this._blocks),Object(o.g)(this._blocks,t=>t.expand(e)),this._createResourcesPromise=null,this._size=e,0}return g.error(new n.a("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,t,i,n){const r=this._filters[t],s=Object(o.j)(r)&&r.hash;if(!r&&!e)return!1;if(s===JSON.stringify(e))return!1;if(Object(o.i)(e)){if(!r)return!1;const e=1<<t+1,i=this._getBlock(0);return this._filters[t]=null,i.setComponentAllTexels(0,e),this.sendUpdates(),!0}const a=await this._getFilter(t,i);return await a.update(e,n),!0}async _getFilter(e,t){const n=this._filters[e];if(Object(o.j)(n))return n;const{default:r}=await i.e(142).then(i.bind(null,743)),s=new r({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:new u.a(t.fields)});return this._filters[e]=s,s}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let t=0;const i=Object(d.e)(e.getDisplayId());for(let r=0;r<this._filters.length;r++){const n=!!(i&1<<r),s=this._filters[r];t|=(!n||Object(o.i)(s)||s.check(e)?1:0)<<r}let n=0;if(this._idsToHighlight.size){const t=e.getObjectId();n=this.getHighlightFlag(t)}return t<<1|n}}},698:function(e,t,i){"use strict";i.d(t,"a",(function(){return u}));var n=i(62),r=i(208),s=i(281),a=i(32),o=i(175),l=i(226),c=i(665);class u extends c.a{constructor(e,t,i){super(e,t,i,l.P,l.P)}destroy(){super.destroy(),this._transforms&&u.TransformCache.release(this.key.hash)}setTransform(e,t){const i=t/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[l,c]=e.toScreenNoRotation([0,0],[this.x,this.y]),u=this.width/this.rangeX*i,h=this.height/this.rangeY*i;Object(r.l)(s,u,0,0,0,h,0,l,c,1),Object(r.i)(this.transforms.dvs,e.displayViewMat3,s);const d=this.transforms.labelMat2d,f=e.getScreenTransform(d,t),m=Object(o.a)();Object(a.n)(m,[this.x,this.y],f),Object(n.a)(d,m),Object(n.f)(d,e.viewMat2d,d)}_createTransforms(){return u.TransformCache.acquire(this.key.hash)}}u.TransformCache=new class{acquire(e){return{refCount:1,version:-1,labelMat2d:Object(s.b)(),tileMat3:Object(s.b)(),dvs:Object(s.b)()}}release(e){}}},699:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i(2),r=i(226);const s=2147483647;class a{constructor(e){this._head=e,this._cursor=e}static from(e,t=0,i=e.byteLength/o.BYTES_PER_RECORD-t){const n=new o(new Int32Array(e,t*o.BYTES_PER_RECORD,i*o.ELEMENTS_PER_RECORD));return new a(n)}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 i=t._head,n=t._head._link;for(;n;)i._link=n.copy(),i=n,n=i._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,i=null;for(;t;){if(t.delete(e))return t.isEmpty()&&(Object(n.j)(i)&&(i._link=t._link),t===this._head&&(this._head=t._link),t===this._cursor&&(this._cursor=t._link)),!0;i=t,t=t._link}return!1}}a.ELEMENTS_PER_RECORD=r.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,i=e.byteLength/this.BYTES_PER_RECORD-t){return new o(new Int32Array(e,t*this.BYTES_PER_RECORD,i*this.ELEMENTS_PER_RECORD))}delete(e){const t=this._index,i=this.lookup(e);if(i)for(this.id=s,++this._deletedCount;this.next()&&this.id===e;)this.id=s,++this._deletedCount;return this._index=t,i}isEmpty(){return this._deletedCount===this.size()}link(e){this._link?this._link.link(e):this._link=e}lookup(e){if(Object(n.i)(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!==s||(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===s;);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=r.n,o.BYTES_PER_RECORD=o.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT},700:function(e,t,i){"use strict";i.d(t,"a",(function(){return u}));var n=i(8),r=i(11),s=i(383),a=i(78),o=i(262),l=i(644);const c=r.a.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function u(e,t,i,n){switch(e.type){case"simple":return h.fromBasicRenderer(e,t,i,n);case"map":return m.fromUVRenderer(e,t,i,n);case"interval":return f.fromCBRenderer(e,t,i,n);case"dictionary":return g.fromDictionaryRenderer(e,t,i,n);case"subtype":return d.fromSubtypes(e,t,i,n)}}class h{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(e,t,i,n){const r=new h;if(e.symbol){const s=await Object(l.b)(e.symbol,i,n),a=t.createTemplateGroup(s,null);r.setDefault(a)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}match(e,t,i,n,r){return this.getDefault()}async analyze(e,t,i,n,r,s){return null}}class d extends h{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t,i,n){const r=new Map,s=[];for(const a in e.renderers){const o=parseInt(a,10),l=u(e.renderers[a],t,i,n).then(e=>r.set(o,e));s.push(l)}return await Promise.all(s),new d(r,e.subtypeField)}match(e,t,i,n,r){const s=t.readAttribute(this._subtypeField),a=this._subMatchers.get(s);return a?a.match(e,t,i,n,r):null}}class f extends h{constructor(e,t,i,n){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=t,this._fieldIndex=n,this._field=e,this._normalizationInfo=i}static async fromCBRenderer(e,t,i,n){const{isMaxInclusive:r,normalizationField:s,normalizationTotal:a,normalizationType:o}=e,c=e.field,u=new f(c,r,{normalizationField:s,normalizationTotal:a,normalizationType:o},e.fieldIndex),h=await Object(l.b)(e.backgroundFillSymbol,i,n);await Promise.all(e.intervals.map(async e=>{const r=await Object(l.b)(e.symbol,i,n),s=await t.createTemplateGroup(r,h),a={min:e.min,max:e.max};u.add(a,s)}));const d=await Object(l.b)(e.defaultSymbol,i,n);if(d){const e=await t.createTemplateGroup(d,h);u.setDefault(e)}return u}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((e,t)=>e.interval.min-t.interval.min)}size(){return super.size()+this._intervals.length}match(e,t,i,n,r){if(null==this._fieldIndex&&!this._field)return this.getDefault();const s=null!=this._fieldIndex?t.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(t);if(!s&&(null==s||isNaN(s)))return this.getDefault();for(let a=0;a<this._intervals.length;a++){const{interval:e,result:t}=this._intervals[a],i=s>=e.min,n=this._isMaxInclusive?s<=e.max:s<e.max;if(i&&n)return t}return this.getDefault()}_needsNormalization(){const e=this._normalizationInfo;return e&&(e.normalizationField||e.normalizationTotal||e.normalizationType)}_getValueFromField(e){const t=e.readAttribute(this._field);if(!this._needsNormalization()||null==t)return t;const{normalizationField:i,normalizationTotal:n,normalizationType:r}=this._normalizationInfo,s=!!i&&e.readAttribute(i);if(r)switch(r){case"esriNormalizeByField":return s?t/s:void 0;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return t/n*100;default:return void c.error("Found unknown normalization type: "+r)}else c.error("Normalization is required, but no type was set!")}}class m extends h{constructor(e,t,i){super(),this.type="map",this._nullResult=null,this._resultsMap=new Map,this._fieldsIndex=i,this._fields=e,this._seperator=t||""}static async fromUVRenderer(e,t,i,n){const r=e.fieldDelimiter,s=[e.field];e.field2&&s.push(e.field2),e.field3&&s.push(e.field3);const a=await Object(l.b)(e.backgroundFillSymbol,i,n),o=new m(s,r,e.fieldIndex);await Promise.all(e.map.map(async e=>{const r=await Object(l.b)(e.symbol,i,n),s=await t.createTemplateGroup(r,a);"<Null>"===e.value?o.setNullResult(s):o.add(e.value,s)}));const c=await Object(l.b)(e.defaultSymbol,i,n);if(c){const e=await t.createTemplateGroup(c,a);o.setDefault(e)}return o}setNullResult(e){this._nullResult=e}add(e,t){this._resultsMap.set(e.toString(),t)}size(){return super.size()+this._resultsMap.size}match(e,t,i,n,r){if(null==this._fieldsIndex&&!this._fields)return this.getDefault();const s=null!=this._fieldsIndex?t.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(t);if(null!==this._nullResult&&(null==s||""===s||"<Null>"===s))return this._nullResult;if(!s&&null==s)return this.getDefault();const a=s.toString();return this._resultsMap.has(a)?this._resultsMap.get(a):this.getDefault()}_getValueFromFields(e){const t=[];for(const i of this._fields){const n=e.readAttribute(i);null==n||""===n?t.push("<Null>"):t.push(n)}return t.join(this._seperator)}}let p;async function _(){return p||(p=i.e(268).then(i.bind(null,636))),p}class g extends h{constructor(e,t,i,n,r,a){super(),this.type="dictionary",this._groupIdCache=new s.a(100),this._loader=e,this._fieldMap=e.fieldMap,this._symbolFields=e.getSymbolFields(),this._templates=t,this._info=i,this._scaleFn=n,this._schemaUtilsModule=r,this._symbolOptions=a}static async fromDictionaryRenderer(e,t,n,r){const[{DictionaryLoader:s},l]=await Promise.all([Promise.resolve().then(i.bind(null,346)),_()]),c=new s(e.url,e.config,e.fieldMap);await c.fetchResources({spatialReference:n.spatialReference,fields:n.fields});const u=await async function(e,t){const i=e||1;if("number"==typeof i)return(e,t,n)=>i;const n=await Object(a.d)(i,t.spatialReference,t.fields);return(e,i,r)=>Object(o.a)(n,e,{$view:r},t.geometryType,i)||1}(e.scaleExpression,n);return new g(c,t,n,u,l,e.symbolOptions)}async _analyzeFeature(e,t,i,r,s){const a=e.readLegacyFeature(),o=this._scaleFn(a,i,r),u=this._attributeHash(a)+"-"+o,h=this._groupIdCache.get(u);if(h)return h;const d={...r,spatialReference:this._info.spatialReference,abortOptions:s,fields:this._info.fields},f=await this._loader.getSymbolAsync(a,d),m=this._schemaUtilsModule.createSymbolSchema(f,this._symbolOptions),p=Object(l.b)(m,this._info,t,s).then(e=>{if("expanded-cim"!==e.type)return c.error(new n.a("mapview-bad-type",`Found unexpected type ${e.type} in dictionary response`)),null;e.hash+="-"+o;for(const t of e.layers)t.scaleFactor=o,t.templateHash+="-"+o;return this._templates.createTemplateGroup(e,null)});return this._groupIdCache.put(u,p,1),p}async analyze(e,t,i,n,r,s){const a=t.getCursor(),o=[];for(;a.next();)o.push(this._analyzeFeature(a,i,n,r,s));return Promise.all(o)}match(e,t,i,n,r){return null}_attributeHash(e){let t="";for(const i of this._symbolFields){const n=this._fieldMap[i];n&&(t+=e.attributes[n]+"-")}return t}}},701:function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));var n=i(2),r=i(208),s=i(281),a=i(175),o=i(628),l=i(693),c=i(614),u=i(623);function h(e,t,i){const n={target:c.A.TEXTURE_2D,pixelFormat:c.p.RGBA,internalFormat:c.p.RGBA,dataType:c.q.UNSIGNED_BYTE,wrapMode:c.B.CLAMP_TO_EDGE};return t&&i&&(n.width=t,n.height=i),new u.a(e,n)}class d extends o.a{constructor(e=null,t,i=!0){super(),this.requestRenderOnSourceChangedEnabled=i,this._textureInvalidated=!0,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.blendFunction=t,this.source=e,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null)}get isSourceScaled(){return this.width!==this.sourceWidth||this.height!==this.sourceHeight}get height(){return void 0!==this._height?this._height:this.sourceHeight}set height(e){this._height=e}get source(){return this._source}set source(e){this._source=e,this.invalidateTexture()}get sourceHeight(){return this._source instanceof HTMLImageElement?this._source.naturalHeight:this._source.height}get sourceWidth(){return this._source instanceof HTMLImageElement?this._source.naturalWidth:this._source.width}get width(){return void 0!==this._width?this._width:this.sourceWidth}set width(e){this._width=e}beforeRender(e){super.beforeRender(e),this.updateTexture(e.context)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}_createTransforms(){return{dvs:Object(s.b)()}}setTransform(e){const t=Object(r.b)(this.transforms.dvs),[i,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,l=s*this.height,c=Math.PI*this.rotation/180;Object(r.c)(t,t,Object(a.b)(i,n)),Object(r.c)(t,t,Object(a.b)(o/2,l/2)),Object(r.k)(t,t,-c),Object(r.c)(t,t,Object(a.b)(-o/2,-l/2)),Object(r.g)(t,t,Object(a.b)(o,l)),Object(r.i)(this.transforms.dvs,e.displayViewMat3,t)}setSamplingProfile(e){this._texture&&(e.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(e.samplingMode))}bind(e,t){this._texture&&e.bindTexture(this._texture,t)}updateTexture(e){var t;if(!this.stage)return null==(t=this._texture)||t.dispose(),void(this._texture=null);if(!this._textureInvalidated)return;this._textureInvalidated=!1,this._texture||(this.source?this._texture=h(e,this.sourceWidth,this.sourceHeight):this._texture=h(e));const i=this.source;if(i){if(this._texture.resize(this.sourceWidth,this.sourceHeight),(r=i)&&"render"in r)if(i instanceof l.a){const e=i.getRenderedRasterPixels();this._texture.setData(Object(n.j)(e)?e.renderedRasterPixels:null)}else this._texture.setData(function(e){const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,e.render(t.getContext("2d")),t}(i));else(function(e){return e&&!("render"in e)})(i)&&this._texture.setData(i);this.ready()}else this._texture.setData(null);var r}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}}},702:function(e,t,i){"use strict";i.d(t,"a",(function(){return m}));i(471),i(380);var n=i(138),r=(i(465),i(467),i(226)),s=i(629),a=i(615),o=i(616);const l=new Map;l.set(a.d.MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),l.set(a.d.LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),l.set(a.d.FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),l.set(a.d.TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),l.set(a.d.LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});var c=i(657);class u{constructor(e,t,i){this._start={index:0,vertex:0};const n=function(e,t,i){const{indicesPerRecord:n,multiplier:s,verticesPerRecord:a}=l.get(e);return{recordBytes:i*r.n*Uint32Array.BYTES_PER_ELEMENT,indexBytes:s*n*i*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:s*a*i*t}}(e,t,i),s=t/4;this.geometryType=e,this._records=new c.a(Int32Array,n.recordBytes),this._indices=new c.a(Uint32Array,n.indexBytes),this._vertices=new c.a(Uint32Array,n.vertexBytes),this._metrics=new c.a(Float32Array,0),this._strideInt=s}serialize(e){const t=this._records.buffer(),i=this._indices.buffer(),n=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null,s=4*this._strideInt;return e.push(t,i,n),{stride:s,records:t,indices:i,vertices:n,metrics:r}}get strideInt(){return this._strideInt}get recordCount(){return this._records.length/r.n}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(e){this._vertices.ensureSize(e)}indexEnsureSize(e){this._indices.ensureSize(e)}recordStart(){this._start.index=this._indices.length,this._start.vertex=this._vertices.length}recordEnd(e,t,i,n,r,s,a,o){this._records.push(e),this._records.push(t),this._records.push(i),this._records.push(n),this._records.push(r),this._records.push(s),this._records.push(a),this._records.writeF32(o)}writeIndex(e){this._indices.push(e)}writeVertex(e){this._vertices.push(e)}writeVertexF32(e){this._vertices.writeF32(e)}copyLastFrom(e,t,i){const n=e._records.length-r.n,s=e._records.getValue(n),a=e._records.getValue(n+1),o=e._records.getValue(n+2),l=e._records.getValue(n+4),c=e._records.getValue(n+6),u=e._records.getValue(n+7),h=this._vertices.length,d=(e._start.vertex-this._vertices.length)/this._strideInt,f=this._indices.length,m=this.vertexCount;for(let r=e._start.index;r!==e._indices.length;r++){const t=e._indices.getValue(r);this._indices.push(t-d)}for(let r=e._start.vertex;r!==e._vertices.length;r++){const t=e._vertices.getValue(r);this._vertices.push(t)}for(let r=h;r<=this._vertices.length;r+=this._strideInt)this._vertices.i1616Add(r,t,i);this._records.push(s),this._records.push(a),this._records.push(o),this._records.push(f),this._records.push(l),this._records.push(m),this._records.push(c),this._records.push(u)}}var h=i(688);function d(e){switch(e){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function f(e){switch(e){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class m{constructor(e,t,i,n,r){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=t,this.tileKey=e,this._hasAggregate=n,this._pixelBufferEnabled=r,this._strideOptions=i}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(e){const t=[];return t.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach((i,r)=>{const s=1<<r,a=d(s),o=f(s),l=Object(h.a)(new n.a(this.tileKey),a,o,e),c=this._serializeTileVertexData(this.tileKey,l.id,i.vertexData);c.message.bufferIds=i.displayIds,t.push(c)}),t}_serializeTileVertexData(e,t,i){var n,r,s,o,l;const c=new Array;return{message:{tileKeyOrigin:e,tileKey:t,data:{[a.d.MARKER]:null==(n=i.get(a.d.MARKER))?void 0:n.serialize(c),[a.d.FILL]:null==(r=i.get(a.d.FILL))?void 0:r.serialize(c),[a.d.LINE]:null==(s=i.get(a.d.LINE))?void 0:s.serialize(c),[a.d.TEXT]:null==(o=i.get(a.d.TEXT))?void 0:o.serialize(c),[a.d.LABEL]:null==(l=i.get(a.d.LABEL))?void 0:l.serialize(c)}},transferList:c}}featureStart(e,t){this._current.insertAfter=e,this._current.sortKey=t}featureEnd(){}recordStart(e,t,i,n){this._current.writer=this._getVertexWriter(i),this._current.overlaps=0,this._current.indexStart=this._current.writer.indexCount,this._current.vertStart=this._current.writer.vertexCount,this._current.bufferingEnabled=n,this._current.id=e,this._current.materialKey=t,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(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexBounds(e,t,i,n){this._current.bufferingEnabled&&this._addOverlap(e,t,i,n)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}vertexEnd(){}vertexWriter(){return this._current.writer.vertexWriter}indexWrite(e){this._current.writer.writeIndex(e)}indexWriter(){return this._current.writer.indexWriter}metricWriter(){return this._current.writer.metricWriter}metricStart(e,t,i,n,r,o,l,c){this._current.writer=this._getVertexWriter(a.d.LABEL);const u=this._current.writer.metricWriter;u.push(Object(s.f)(e)),u.push(t),u.push(i),u.push(n),u.push(r),u.push(o),u.push(l),u.push(c),u.push(255),this._current.metricBoxLenPointer=u.push(0)}metricEnd(){const e=this._current.writer.metricWriter;0===e.getValue(this._current.metricBoxLenPointer)&&e.seek(e.length-10)}metricBoxWrite(e,t,i,n){const r=this._current.writer.metricWriter;r.incr(this._current.metricBoxLenPointer),r.push(0),r.push(0),r.push(e),r.push(t),r.push(i),r.push(n)}recordEnd(){const e=this._current.vertStart,t=this._current.writer.vertexCount-e;if(!t)return!1;this.hasRecords=!0;const i=this._current.indexStart,n=this._current.writer.indexCount-i;if(this._current.writer.recordEnd(this._current.id,this._current.materialKey,this._current.insertAfter,i,n,e,t,this._current.sortKey),!this._pixelBufferEnabled||this._hasAggregate||0===this._current.overlaps||this._current.geometryType===a.d.LABEL)return!0;const s=this._current.writer;for(let a=0;a<8;a++){const e=1<<a;if(this._current.overlaps&e){this._data.neighbors[a]||(this._data.neighbors[a]={vertexData:new Map,displayIds:new Set});const t=this._data.neighbors[a],i=this._current.geometryType;if(!t.vertexData.has(i)){const e=Object(o.n)(i,this._strideOptions).geometry,n=new u(i,e,r.y);t.vertexData.set(i,n)}const n=t.vertexData.get(this._current.geometryType),l=8,c=512*-d(e)*l,h=512*-f(e)*l;n.copyLastFrom(s,c,h),t.displayIds.add(this._current.id)}}return!0}_addOverlap(e,t,i,n){const s=255^((e<0+i?148:e>=r.P-i?41:189)|(t<0+n?224:t>=r.P-n?7:231));this._current.overlaps|=s}_getVertexWriter(e){if(!this._data.self.has(e)){const t=this._data.self,i=Object(o.n)(e,this._strideOptions).geometry;t.set(e,new u(e,i,this.hint.records))}return this._data.self.get(e)}}},703:function(e,t,i){"use strict";i.d(t,"a",(function(){return A}));i(5);var n=i(2),r=i(12),s=i(664),a=i(629),o=i(8),l=i(11),c=i(49),u=i(21),h=i(14),d=i(154),f=i(621),m=i(226),p=i(615),_=i(174),g=i(618),x=i(624);function y(e){return e.length-1}function v(e){let t=0;for(let i=0;i<y(e);i++)t+=b(e,i);return t}function b(e,t,i=1){const[n,r]=function(e,t){return e[t+1]}(e,t);return Math.sqrt(n*n+r*r)*i}class O{constructor(e,t,i,n,r){this._segments=e,this._index=t,this._distance=i,this._xStart=n,this._yStart=r,this._done=!1}static create(e){return new O(e,0,0,e[0][0],e[0][1])}clone(){return new O(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(0===this._distance||1===e._distance)||e._index===this._index+1&&(1===this._distance||0===e._distance)}leq(e){return this._index<e._index||this._index===e._index&&this._distance<=e._distance}geq(e){return this._index>e._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let i=Math.acos(t);return e>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:e,dy:t}=this;return Math.sqrt(e*e+t*t)}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<y(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(e,t){const i=this.backwardLength;if(e<=i)return this._distance=(i-e)/this.length,this;let n=this.backwardLength;for(;this.prev();){if(n+this.length>e)return this._seekBackwards(e-n);n+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>e)return this.seek(e-i,t);i+=this.length}return this._distance=1,t?this:null}}function S(e,t,i,n=!0){const r=v(e),s=O.create(e),a=r/2;if(!n)return s.seek(a),void i(s.clone(),0,a+0*t,r);const o=Math.max((r-t)/2,0),l=Math.floor(o/t),c=a-l*t;s.seek(c);for(let u=-l;u<=l;u++)s.x<512&&s.x>=0&&s.y<512&&s.y>=0&&i(s.clone(),u,a+u*t,r),s.seek(t)}function T(e,t){const i=1e-6;if(t<=0)return;const n=e.length;if(n<3)return;const r=[];let s=0;r.push(0);for(let h=1;h<n;h++)s+=Object(x.c)(e[h],e[h-1]),r.push(s);t=Math.min(t,.2*s);const a=[];a.push(e[0][0]),a.push(e[0][1]);const o=e[n-1][0],l=e[n-1][1],c=Object(x.h)([0,0],e[0],e[1]);Object(x.g)(c),e[0][0]+=t*c[0],e[0][1]+=t*c[1],Object(x.h)(c,e[n-1],e[n-2]),Object(x.g)(c),e[n-1][0]+=t*c[0],e[n-1][1]+=t*c[1];for(let h=1;h<n;h++)r[h]+=t;r[n-1]+=t;const u=.5*t;for(let h=1;h<n-1;h++){let s=0,o=0,l=0;for(let n=h-1;n>=0&&!(r[n+1]<r[h]-u);n--){const a=u+r[n+1]-r[h],c=r[n+1]-r[n],d=r[h]-r[n]<u?1:a/c;if(Math.abs(d)<i)break;const f=d*d,m=d*a-.5*f*c,p=d*c/t,_=e[n+1],g=e[n][0]-_[0],x=e[n][1]-_[1];s+=p/m*(_[0]*d*a+.5*f*(a*g-c*_[0])-f*d*c*g/3),o+=p/m*(_[1]*d*a+.5*f*(a*x-c*_[1])-f*d*c*x/3),l+=p}for(let a=h+1;a<n&&!(r[a-1]>r[h]+u);a++){const n=u-r[a-1]+r[h],c=r[a]-r[a-1],d=r[a]-r[h]<u?1:n/c;if(Math.abs(d)<i)break;const f=d*d,m=d*n-.5*f*c,p=d*c/t,_=e[a-1],g=e[a][0]-_[0],x=e[a][1]-_[1];s+=p/m*(_[0]*d*n+.5*f*(n*g-c*_[0])-f*d*c*g/3),o+=p/m*(_[1]*d*n+.5*f*(n*x-c*_[1])-f*d*c*x/3),l+=p}a.push(s/l),a.push(o/l)}a.push(o),a.push(l);for(let h=0,d=0;h<n;h++)e[h][0]=a[d++],e[h][1]=a[d++]}var w=i(671);const j=l.a.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate");const I=function(e){const t=new Map;return i=>(t.has(i)||t.set(i,e(i)),t.get(i))}(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t}),M=e=>Math.floor(127*e+127),E=e=>Math.floor(10*e),C=e=>Math.round(e*(254/360));class R extends w.a{constructor(e,t,i,n){var r,s,a;super(e,i.font.size,i.haloSize||0,i.font.size,i.color&&Object(f.d)(i.color)||0,i.haloColor&&Object(f.d)(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,Object(d.i)(t.labelPlacement)?h.a.MAP:h.a.SCREEN,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=p.d.LABEL,this._allowOverrun=null!=(r=t.allowOverrun)&&r,this._repeatLabel=null==(s=t.repeatLabel)||s,this._labelPosition=null!=(a=t.labelPosition)?a:"curved";const o=function(e,t){const i=!!e.minScale&&t.scaleToZoom(e.minScale)||0;return Object(c.d)(i,0,25.5)}(t,n),l=function(e,t){const i=!!e.maxScale&&t.scaleToZoom(e.maxScale)||255;return Object(c.d)(i,0,25.5)}(t,n),_=t.labelPlacement,[x,y]=Object(d.c)(_);this._xAlignD=x,this._yAlignD=y,this._minZoom=o,this._maxZoom=l,this._refPlacementPadding=Object(u.c)(i.haloSize)+m.N,this._repeatLabelDistance=t.repeatLabelDistance?Object(u.c)(t.repeatLabelDistance):128;const v=g.b.load(e);v.sdf=!0,this._materialKey=v.data}static fromLabelClass(e,t){if("esriServerLinePlacementCenterAlong"===e.labelPlacement){const t=e.symbol;t.xoffset=0,t.yoffset=0,t.angle=0,t.font.decoration="none"}return new R(e.materialKey,e,e.symbol,t)}get _shapedBox(){return Object(n.q)(this._shapingInfo).bounds}setZoomLevel(e){this._zoomLevel=e}bindReferenceTemplate(e){let t=Object(d.f)(this._xAlignD),i=Object(d.h)(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,Object(n.i)(e))return void(this._refSymbolAndPlacementOffset=Object(_.b)(0,0,M(t),M(i)));if("circle"===e.boundsType&&(t||i)){const e=Math.sqrt(t*t+i*i);t/=e,i/=e}const r=Math.max(e.height,e.width),s=4*this._refPlacementPadding;this._refSymbolAndPlacementOffset=Object(_.b)(s,r,M(t),M(i)),this._referenceSize=r,this._refPlacementDirX=t,this._refPlacementDirY=i,this._refOffsetX=e.xOffset,this._refOffsetY=e.yOffset}_write(e,t){if(Object(n.i)(this._shapingInfo))return;const i=this._shapingInfo,r=t.getDisplayId(),s="esriGeometryPolygon"===t.geometryType?t.readLegacyCentroid():t.readLegacyGeometry();if(s)switch(this.current={out:e,inId:r,inShaping:i,zoomLevel:this._zoomLevel},t.geometryType){case"esriGeometryPolyline":this._placeLineLabels(s);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(s);break;default:((e,t="mapview-labeling")=>{j.error(new o.a(t,e))})("mapview-labeling",`Geometry of type ${t.geometryType} is not supported`)}}_isVisible(e,t){const i=E(this.current.zoomLevel);return E(e)<=i&&i<=E(t)}_placePointLabels(e){const{out:t,inId:i,inShaping:n}=this.current;this._writeGlyphs(t,i,e,n)}_placeLineLabels(e){const t=function(e,t){const i=t;for(let n=0;n<e.length;n++){let t=e[n];const r=[];r.push(t[0]);for(let e=1;e<t.length;e++){let[i,n]=r[e-1];i+=t[e][0],n+=t[e][1],r.push([i,n])}T(r,i);const s=[];s.push(r[0]);for(let e=1;e<r.length;e++){const[t,i]=r[e-1],[n,a]=r[e],o=Math.round(n-t),l=Math.round(a-i);s.push([o,l])}e[n]=s,t=s}return e}(e.paths,this.current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),n=(this._shapedBox.width+this._repeatLabelDistance)/2;for(const r of t)S(r,n,i,this._repeatLabel)}_placeSubdivGlyphs(e,t,i,n){const r=I(t),s=this._shapedBox.width/2,a=Math.sqrt(this._repeatLabelDistance)/2,o=Math.min(i,n-i),l=Math.log2(o/(a+s/2)),c=0===t?l:Math.min(r,l),u=Math.max(this._minZoom,this.current.zoomLevel+1-c),h=this.current.zoomLevel-u,d=this._shapedBox.width/2*2**h;this.current.inShaping.isMultiline?0===t&&this._placeStraight(e,u):this._allowOverrun&&h<0?this._placeStraightAlong(e,this._minZoom):"parallel"===this._labelPosition?this._placeStraightAlong(e,u):"curved"===this._labelPosition&&this._placeCurved(e,u,d)}_placeStraight(e,t){const{out:i,inId:n,inShaping:r}=this.current;this._writeGlyphs(i,n,e,r,t)}_placeCurved(e,t,i){const{out:n,inId:r}=this.current;n.metricStart(r,t,e.x,e.y,0,0,0,0);const s=e.clone(),a=e.angle*(180/Math.PI)%360,o=(e.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=C(a),this._placeFirst(s,t,1),this._placeBack(e,s,t,i,1),this._placeForward(e,s,t,i,1),this._outLineLabelAngle=C(o),this._placeFirst(s,t,0),this._placeBack(e,s,t,i,0),this._placeForward(e,s,t,i,0),n.metricEnd()}_placeStraightAlong(e,t){const{out:i,inId:n}=this.current;i.metricStart(n,t,e.x,e.y,0,0,0,0);const r=e.clone(),s=e.angle*(180/Math.PI)%360,a=(e.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=C(s),this._placeFirst(r,t,1,!0),this._outLineLabelAngle=C(a),this._placeFirst(r,t,0,!0),i.metricEnd()}_placeBack(e,t,i,n,r){const s=e.clone();let a=e.backwardLength+0;for(;s.prev()&&!(a>=n);)this._placeOnSegment(s,t,a,i,-1,r),a+=s.length+0}_placeForward(e,t,i,n,r){const s=e.clone();let a=e.remainingLength+0;for(;s.next()&&!(a>=n);)this._placeOnSegment(s,t,a,i,1,r),a+=s.length+0}_placeFirst(e,t,i,n=!1){const r=e,s=this.current.inShaping,a=s.glyphs,o=this.current.zoomLevel,{out:l,inId:c}=this.current;for(const u of a){const a=u.x>s.bounds.x?i:1-i,h=a*e.remainingLength+(1-a)*e.backwardLength,d=Math.abs(u.x+u.width/2-s.bounds.x),f=Math.max(0,o+Math.log2(d/(h+0))),m=Math.max(t,n?0:f);if(u.maxZoom=25,u.angle=e.angle+(1-i)*Math.PI,u.minZoom=m,this._writeGlyph(l,c,r.x,r.y,u),i&&this._isVisible(u.minZoom,u.maxZoom)){const e=u.bounds;l.metricBoxWrite(e.center[0],e.center[1],e.width,e.height)}}}_placeOnSegment(e,t,i,n,r,s){const a=this.current.inShaping.glyphs,{out:o,inId:l}=this.current,c=this.current.inShaping,u=this.current.zoomLevel,h=e.dx/e.length,d=e.dy/e.length,f={x:e.x+i*-r*h,y:e.y+i*-r*d};for(const m of a){const a=m.x>c.bounds.x?s:1-s;if(!(a&&1===r||!a&&-1===r))continue;const h=Math.abs(m.x+m.width/2-c.bounds.x),d=Math.max(0,u+Math.log2(h/i)-.1),p=Math.max(n,u+Math.log2(h/(i+e.length+0)));if(0!==d&&(m.angle=e.angle+(1-s)*Math.PI,m.minZoom=p,m.maxZoom=d,this._writeGlyph(o,l,f.x,f.y,m),s&&this._isVisible(m.minZoom,m.maxZoom))){const i=m.bounds,n=e.x-t.x,r=e.y-t.y;o.metricBoxWrite(i.center[0]+n,i.center[1]+r,i.width,i.height)}}}_writeGlyphs(e,t,i,n,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const s=i.x+this._refOffsetX,a=i.y-this._refOffsetY;for(const u of n.glyphs)u.minZoom=r,u.maxZoom=this._maxZoom,this._writeGlyph(e,t,s,a,u);const o=this._refPlacementDirX,l=this._refPlacementDirY,c=n.boundsT;e.metricStart(t,r,s,a,o,l,this._referenceSize,this._materialKey),e.metricBoxWrite(c.center[0],c.center[1],c.width,c.height),e.metricEnd()}_writeVertexCommon(e,t,i,n){const r=this._color,s=this._haloColor,a=Object(_.b)(0,0,this._size,this._haloSize),o=Math.max(n.minZoom,this._minZoom),l=Math.min(n.maxZoom,this._maxZoom),c=Object(_.b)(E(o),E(l),this._outLineLabelAngle,0);e.vertexWrite(i),e.vertexWrite(t),e.vertexWrite(r),e.vertexWrite(s),e.vertexWrite(a),e.vertexWrite(this._refSymbolAndPlacementOffset),e.vertexWrite(c)}}var D=i(674),P=i(676);class A{constructor(e,t,i){this._loadPromise=Object(s.a)(),this._geometryType=e,this._idField=t,this._templateStore=i}update(e,t){Object(n.j)(e.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(e.mesh.labels,t)),this._schema=e}_createLabelTemplates(e,t){const i=new Map;if("simple"===e.type){for(const n of e.classes){const e=R.fromLabelClass(n,t);i.set(n.index,e)}return i}for(const n in e.classes){const r=e.classes[n];for(const e of r){const n=R.fromLabelClass(e,t);i.set(e.index,n)}}return i}get templates(){return this._templateStore}async analyze(e,t,i,s,o,l,c){if(Object(r.m)(c))return;let u;"dictionary"===i.type&&(u=await i.analyze(this._idField,e.copy(),t,o,l,c));let h=0;for(;e.next();){let t;if(t=u?u[h++]:Object(n.j)(s)&&Object(a.h)(e.getDisplayId())&&1!==e.readAttribute("cluster_count")?s.match(this._idField,e,this._geometryType,o,l):i.match(this._idField,e,this._geometryType,o,l),e.setGroupId(t),Object(P.b)(t)){const i=this._templateStore.getDynamicTemplateGroup(t);for(const t of i)t&&t.analyze&&t.analyze(this._templateStore,e,o,l)}}return await this._loadPromise,this._templateStore.finalize(c)}async analyzeGraphics(e,t,i,n,s,a){if(Object(r.m)(a))return;const o=e.getCursor();for(i&&await i.analyze(this._idField,o.copy(),t,n,s,a);o.next();){let e=o.getGroupId();if(null!=e&&-1!==e||(e=i.match(this._idField,o,o.geometryType,n,s),o.setGroupId(e)),Object(P.b)(e)){const t=this._templateStore.getDynamicTemplateGroup(e);for(const e of t)e&&e.analyze&&e.analyze(this._templateStore,o,n,s)}o.setGroupId(e)}return await this._loadPromise,this._templateStore.finalize(a)}writeGraphic(e,t,i,n){const r=t.getGroupId(),s=t.getDisplayId(),a=this._templateStore.getTemplateGroup(r);if(e.featureStart(t.insertAfter,0),null!=s){if(Object(P.b)(r))for(const e of a)e&&e.bindFeature(t,null,null);if(a){for(const r of a)r&&r.write(e,t,i,n);e.featureEnd()}}}writeCursor(e,t,i,r,s,a,o){const l=t.getGroupId(),c=t.getDisplayId(),u=this._templateStore.getTemplateGroup(l),h=this._schema.mesh.sortKey;let d=0;if(Object(n.j)(h)&&(d=null!=h.fieldIndex?t.getComputedNumericAtIndex(h.fieldIndex):null!=h.field?t.readAttribute(h.field):t.readAttribute(this._idField),d*="asc"===h.order?1:-1),e.featureStart(0,null==d||isNaN(d)?0:d),null!=c&&u){if(Object(P.b)(l))for(const e of u)e.bindFeature(t,i,r);for(const i of u)i.write(e,t,s,o);if(Object(n.j)(a)&&e.hasRecords){const i=a&&this._findLabelRef(u);this._writeLabels(e,t,a,i,s,o)}e.featureEnd()}}_findLabelRef(e){for(const t of e)if(t instanceof D.a)return t;return null}_writeLabels(e,t,i,r,s,a){for(const o of i)if(Object(n.j)(o)&&o){const{glyphs:i,rtl:n,index:l}=o,c=this._labelTemplates.get(l);c.setZoomLevel(s),c.bindReferenceTemplate(r),c.bindTextInfo(i,n),c.write(e,t,null,a)}}}},704:function(e,t,i){"use strict";i.d(t,"a",(function(){return A})),i.d(t,"b",(function(){return w})),i.d(t,"c",(function(){return S}));var n=i(8),r=i(5),s=i(6),a=i(11),o=i(2),l=i(21),c=i(616),u=i(615),h=i(663);var d=i(636),f=(i(61),i(209)),m=i(226);i(647),i(644);function p(e){if(!("visualVariables"in e))return 0;if(!e.hasVisualVariables("size"))return 0;const t=e.getVisualVariablesForType("size");if(!t[0])return 0;const i=t[0];if("outline"===i.target)return 0;if("stops"===i.transformationType)return i.stops.map(e=>e.size).reduce(_,0);if("clamped-linear"===i.transformationType){let e=-1/0,t=-1/0;return e="number"==typeof i.maxSize?i.maxSize:i.maxSize.stops.map(e=>e.size).reduce(_,0),t="number"==typeof i.minSize?i.minSize:i.minSize.stops.map(e=>e.size).reduce(_,0),Math.max(e,t)}return"real-world-size"===i.transformationType?30:void 0}m.f.metrics,new f.a(0,0,24,24);function _(e,t){return Math.max(e,t)}var g=i(691),x=i(694),y=i(683);const v=a.a.getLogger("esri.views.2d.layers.features.schemaUtils"),b="ValidationError",O={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function S(e){let t=0,i=0,n=!1,r=!0,s=!0;if(Object(o.j)(e)){if(i=p(e),"visualVariables"in e&&(t=function(e){if(!e)return u.e.NONE;let t=0;for(const i of e)if("size"===i.type){const e=Object(h.a)(i);t|=e,"outline"===i.target&&(t|=e<<4)}else"color"===i.type?t|=u.e.COLOR:"opacity"===i.type?t|=u.e.OPACITY:"rotation"===i.type&&(t|=u.e.ROTATION);return t}(e.visualVariables||[]),n="dot-density"===e.type),"dictionary"===e.type)return{maxVVSize:i,supportsOutlineFills:!1,vvFlags:t,stride:{fill:"default"}};if(!n){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);for(const e of t)if("cim"===e.type&&(r=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline;t&&"none"!==t.style&&"solid"!==t.style&&(s=!1);const i=t&&"none"!==t.style&&"solid"!==t.style,n="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style;("picture-fill"===e.type||n||i)&&(r=!1)}}}return n&&(s=!1),{vvFlags:t,maxVVSize:i,supportsOutlineFills:s,stride:{fill:n?"dot-density":r?"simple":"default"}}}function T(e,t){const i=Object(s.a)(e);return i.some(e=>function(e,t){const i=e.labelPlacement,r=O[t];if(!e.symbol)return v.warn("No ILabelClass symbol specified."),!0;if(!r)return v.error(new n.a("mapview-labeling:unsupported-geometry-type",`Unable to create labels for Feature Layer, ${t} is not supported`)),!0;if(!r.some(e=>e===i)){const n=r[0];i&&v.warn(`Found invalid label placement type ${i} for ${t}. Defaulting to ${n}`),e.labelPlacement=n}return!1}(e,t))?[]:i}function w(e){return Object(r.a)("esri-2d-update-debug")&&console.debug("Created new schema",j(e,!0)),j(e)}function j(e,t=!1){try{var i,r;const s=function(e,t=!1){const i=new Array;return i.push(function(e,t,i=!1){const r={indexCount:0,fields:{}},s="featureReduction"in e&&e.featureReduction,a=s?"aggregate":"feature";if("sublayers"in e){const t={type:"subtype",subtypeField:e.subtypeField,renderers:{},stride:{fill:"default"}},s={type:"subtype",mapping:{},target:"feature"},l={type:"subtype",classes:{}},c={type:"symbol",target:"feature",aggregateFields:[],attributes:r,storage:s,mesh:{matcher:t,aggregateMatcher:null,labels:l,sortKey:null}},u=new Set;let h=0;for(const{renderer:d,subtypeCode:f,labelingInfo:m,labelsVisible:p}of e.sublayers){const e=A(r,a,d,i),c=P(r,a,d),_=p&&m;if("visualVariables"in d&&d.visualVariables&&d.visualVariables.length)throw new n.a(b,"Visual variables are currently not supported for subtype layers");if("dictionary"===e.type)throw new n.a(b,"Dictionary renderer is not supported in subtype layers");if("subtype"===e.type)throw new n.a(b,"Nested subtype renderers is not supported");if(Object(o.j)(c)&&"subtype"===c.type)throw new n.a(b,"Nested subtype storage is not supported");if(Object(o.j)(c)&&"dot-density"===c.type)throw new n.a(b,"Dot density attributes are not supported in subtype layers");if(u.has(f))throw new n.a(b,"Subtype codes for sublayers must be unique");u.add(f),t.renderers[f]=e,s.mapping[f]=c,_&&(l.classes[f]=_.map(e=>D(d,r,e,"feature",h++,i)))}return c}if("heatmap"===e.renderer.type){const{blurRadius:t,fieldOffset:i,field:n}=e.renderer;return{type:"heatmap",aggregateFields:[],attributes:r,target:a,storage:null,mesh:{blurRadius:t,fieldOffset:i,field:C(r,{target:a,field:n,resultType:"numeric"}).field}}}{const t=[],l="aggregate"===a?Object(x.b)(t,e.renderer,s,null):e.renderer;!function(e,t){const i={mesh:!0,storage:!0};for(const n of t){const{name:t,outStatistic:r}=n,{statisticType:s,onStatisticField:a}=r;let o=null,l=null,c=null;const u="numeric",h="feature";"onStatisticValueExpression"in r?l=R(e,{type:"expression",target:h,valueExpression:r.onStatisticValueExpression,resultType:u}).fieldIndex:"onStatisticNormalizationField"in r?(o=R(e,{type:"field",target:h,field:a,resultType:u}).field,c=r.onStatisticNormalizationField):o=R(e,{type:"field",target:h,field:a,resultType:u}).field,R(e,{type:"statistic",target:"aggregate",name:t,context:i,inField:o,inNormalizationField:c,inFieldIndex:l,statisticType:s})}}(r,t);const c=A(r,a,l,i);let u=null;const h=P(r,a,l),f=Object(y.b)(e.geometryType);let m=e.labelsVisible&&e.labelingInfo||[],p=[];if(s){if("selection"===s.type)throw new n.a(b,"Mapview does not support `selection` reduction type",s);if(s.symbol){const e=S(l);u={type:"simple",symbol:Object(d.createSymbolSchema)(s.symbol,e,i),stride:e.stride}}p=s&&s.labelsVisible&&s.labelingInfo||[]}m=T(m,f),p=T(p,f);let _=0;const g=[...m.map(e=>D(l,r,e,"feature",_++,i)),...p.map(e=>D(l,r,e,"aggregate",_++,i))],O=function(e,t){if(Object(o.i)(t)||!t.length)return null;t.length>1&&v.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${t.length}. All but the first will be discarded`);const i=t[0],r="ascending"===i.order?"asc":"desc";if(i.field)return{field:i.field,order:r};if(i.valueExpression)return{fieldIndex:R(e,{type:"expression",target:"feature",valueExpression:i.valueExpression,resultType:"numeric"}).fieldIndex,order:r};return v.error(new n.a(b,"Expected to find a field or valueExpression for OrderByInfo",i)),null}(r,e.orderBy);return{type:"symbol",target:a,attributes:r,aggregateFields:t,storage:h,mesh:{matcher:c,labels:{type:"simple",classes:g},aggregateMatcher:u,sortKey:O}}}}(e,t)),i}(e,t),a={};return s.map(t=>function(e,t,i){switch(i.target){case"feature":return void E(e,M(t),i);case"aggregate":{if(!("featureReduction"in t))return;const r=t.featureReduction;if("selection"===r.type)throw new n.a(b,"Mapview does not support `selection` reduction type",r);return E(e,M(t),i),void function(e,t,i){e.aggregate||(e.aggregate={name:"aggregate",input:"feature",filters:null,attributes:{},params:{clusterRadius:Object(l.c)(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(Object(l.c)(t.clusterMaxSize)/64),fields:i.aggregateFields}}),I(e.aggregate,i.attributes.fields)}(e,r,i)}}}(a,e,t)),{source:{definitionExpression:e.definitionExpression,fields:e.fields.map(e=>e.toJSON()),gdbVersion:e.gdbVersion,historicMoment:null==(i=e.historicMoment)?void 0:i.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:null==(r=e.timeExtent)?void 0:r.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:s,targets:a}}catch(s){if(s.fieldName===b)return v.error(s),null;throw s}}function I(e,t){for(const i in t){const n=t[i];if(n.target!==e.name)continue;const r=e.attributes[i];r?(r.context.mesh=r.context.mesh||n.context.mesh,r.context.storage=r.context.storage||n.context.storage):e.attributes[i]=n}return e}function M(e){var t,i,n,r,s;return[null!=(t=null==(i=Object(o.q)(e.filter))?void 0:i.toJSON())?t:null,null!=(n=null==(r=Object(o.q)(null==(s=Object(o.q)(e.featureEffect))?void 0:s.filter))?void 0:r.toJSON())?n:null]}function E(e,t,i){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),I(e.feature,i.attributes.fields),e}function C(e,t){return t.field?R(e,{...t,type:"field",field:t.field}):t.valueExpression?R(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:null,fieldIndex:null}}function R(e,t){switch(t.type){case"expression":{const i=t.valueExpression;if(!e.fields[i]){const n=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:n}}return{fieldIndex:e.fields[i].fieldIndex}}case"label-expression":{const i=JSON.stringify(t.label);if(!e.fields[i]){const n=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:n}}return{fieldIndex:e.fields[i].fieldIndex}}case"field":{const i=t.field;return"aggregate"===t.target&&e.fields[i]||(e.fields[i]={...t,name:i}),{field:i}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function D(e,t,i,n,r,s=!1){const a=R(t,{type:"label-expression",target:n,context:{mesh:!0},resultType:"string",label:{labelExpression:i.labelExpression,labelExpressionInfo:i.labelExpressionInfo?{expression:i.labelExpressionInfo.expression}:null,symbol:!!i.symbol,where:i.where}}),{fieldIndex:o}=a,l=S(e);return{...Object(d.createSymbolSchema)(i,l,s),fieldIndex:o,target:n,index:r}}function P(e,t,i){switch(i.type){case"dot-density":return function(e,t,i){return i&&i.length?{type:"dot-density",mapping:i.map((i,n)=>{const{field:r,fieldIndex:s}=C(e,{valueExpression:i.valueExpression,field:i.field,resultType:"numeric",target:t});return{binding:n,field:r,fieldIndex:s}}),target:t}:{type:"dot-density",mapping:[],target:t}}(e,t,i.attributes);case"simple":case"class-breaks":case"unique-value":case"dictionary":return function(e,t,i){if(!i||!i.length)return{type:"visual-variable",mapping:[],target:t};const n={storage:!0},r="numeric";return{type:"visual-variable",mapping:Object(g.b)(i).map(i=>{var s;const a=Object(c.p)(i.type),{field:o,fieldIndex:l}=C(e,{target:t,valueExpression:i.valueExpression,field:i.field,context:n,resultType:r});switch(i.type){case"size":return"$view.scale"===i.valueExpression?null:{type:"size",binding:a,field:o,fieldIndex:l,normalizationField:C(e,{target:t,field:i.normalizationField,context:n,resultType:r}).field,valueRepresentation:null!=(s=i.valueRepresentation)?s:null};case"color":return{type:"color",binding:a,field:o,fieldIndex:l,normalizationField:C(e,{target:t,field:i.normalizationField,context:n,resultType:r}).field};case"opacity":return{type:"opacity",binding:a,field:o,fieldIndex:l,normalizationField:C(e,{target:t,field:i.normalizationField,context:n,resultType:r}).field};case"rotation":return{type:"rotation",binding:a,field:o,fieldIndex:l}}}).filter(e=>e),target:t}}(e,t,i.visualVariables);case"heatmap":return null}}function A(e,t,i,r=!1){const s=Object(o.r)(e,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return function(e,t,i=!1){const n=t.getSymbols(),r=n.length?n[0]:null,s=S(t);return{type:"simple",symbol:Object(d.createSymbolSchema)(r,s,i),stride:s.stride}}(0,i,r);case"class-breaks":return function(e,t,i,n=!1){const r=i.backgroundFillSymbol,{field:s,fieldIndex:a}=C(e,{target:t,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:{mesh:!0,use:"renderer.field"}}),o=i.normalizationType,l="log"===o?"esriNormalizeByLog":"percent-of-total"===o?"esriNormalizeByPercentOfTotal":"field"===o?"esriNormalizeByField":null,c=S(i),u=i.classBreakInfos.map(e=>({symbol:Object(d.createSymbolSchema)(e.symbol,c,n),min:e.minValue,max:e.maxValue})).sort((e,t)=>e.min-t.min);return{type:"interval",attributes:e.fields,field:s,fieldIndex:a,backgroundFillSymbol:Object(d.createSymbolSchema)(r,c,n),defaultSymbol:Object(d.createSymbolSchema)(i.defaultSymbol,c,n),intervals:u,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:l,isMaxInclusive:i.isMaxInclusive,stride:c.stride}}(s,t,i,r);case"unique-value":return function(e,t,i,r=!1){const s=[],a=i.backgroundFillSymbol,o={target:t,context:{mesh:!0},resultType:"string"};if(i.field&&"string"!=typeof i.field)throw new n.a(b,"Expected renderer.field to be a string",i);const{field:l,fieldIndex:c}=C(e,{...o,field:i.field,valueExpression:i.valueExpression}),u=S(i);for(const n of i.uniqueValueInfos)s.push({value:""+n.value,symbol:Object(d.createSymbolSchema)(n.symbol,u,r)});return{type:"map",attributes:e.fields,field:l,fieldIndex:c,field2:C(e,{...o,field:i.field2}).field,field3:C(e,{...o,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:Object(d.createSymbolSchema)(a,u),defaultSymbol:Object(d.createSymbolSchema)(i.defaultSymbol,u),map:s,stride:u.stride}}(s,t,i,r);case"dictionary":return function(e,t,i=!1){const n=S(t);return{type:"dictionary",config:t.config,fieldMap:t.fieldMap,scaleExpression:t.scaleExpression,url:t.url,symbolOptions:n,stride:n.stride}}(0,i,r)}}},705:function(e,t,i){"use strict";i.d(t,"a",(function(){return E}));var n=i(12),r=i(261),s=i(8),a=i(5),o=i(11),l=i(2),c=i(226),u=i(629),h=i(616),d=i(668),f=i(614),m=i(633),p=i(623);const _=o.a.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),g=Object(d.b)(d.a,_);class x{constructor(e,t,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:n,pixelType:r,textureOnly:s}=e,a=Object(h.l)(r);this.shared=i,this.pixelType=r,this.size=t,this.textureOnly=s,s||(this.data=new a(Object(l.q)(n))),this._resetRange()}destroy(){Object(l.b)(this._texture,e=>e.dispose());for(const e in this._fbos)Object(l.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,i){const n=Object(u.f)(e),r=Object(l.q)(this.data),s=n*this.texelSize+t;!r||s>=r.length||(r[s]=i,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n))}getData(e,t){if(Object(l.i)(this.data))return null;const i=Object(u.f)(e)*this.texelSize+t;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(e){return Object(l.r)(this._texture,()=>this._initTexture(e))}getFBO(e,t=0){if(Object(l.i)(this._fbos[t])){const i={colorTarget:f.y.TEXTURE,depthStencilTarget:f.m.NONE},n=0===t?this.getTexture(e):this._textureDesc;this._fbos[t]=new m.a(e,i,n)}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,i=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const n=Object(l.q)(this.data).buffer,r=this.getTexture(e),a=4,o=(t-t%this.size)/this.size,c=(i-i%this.size)/this.size,u=o,d=this.size,f=c,m=o*this.size*a,p=(d+f*this.size)*a-m,g=Object(h.l)(this.pixelType),x=new g(n,m*g.BYTES_PER_ELEMENT,p),y=this.size,v=f-u+1;if(v>this.size)return void _.error(new s.a("mapview-webgl","Out-of-bounds index when updating AttributeData"));r.updateData(0,0,u,y,v,x)}catch(i){}t()}}update(e){const{data:t,start:i,end:n}=e;if(Object(l.j)(t)){const n=this.data,r=i*this.texelSize;for(let i=0;i<t.length;i++){const s=1<<i%this.texelSize;e.layout&s&&(n[r+i]=t[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,n)}resize(e,t){const i=this.size;if(this.size=t,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const n=Object(h.l)(this.pixelType);this.destroy(),this.data=new n(Object(l.q)(e.buffer))}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(e){const t=new p.a(e,this._textureDesc,Object(l.r)(this.data,void 0));if(Object(l.j)(this._lastTexture)&&this._fbos[0]){const i=this._lastTexture.descriptor.width,n=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,s=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(e),o=Object(h.m)(r),l=new(Object(h.l)(r))(new ArrayBuffer(i*n*o*this.texelSize)),c=e.getBoundFramebufferObject(),{x:u,y:d,width:f,height:m}=e.getViewport();e.bindFramebuffer(a),a.readPixels(0,0,i,n,s,r,l),t.updateData(0,0,0,2*i,n/2,l),e.setViewport(u,d,f,m),e.bindFramebuffer(c)}return this.destroy(),this._texture=t,this._texture}}class y{constructor(e){this._onUpdate=e,this._initialized=!1,this._forceNextUpload=!1,this._locked=!1}initialize(e){const{blocks:t,shared:i,size:n}=e;if(this.shared=i,this.size=n,g("Initializing AttributeStoreView",e),Object(l.i)(this._data))this._data=Object(l.l)(t,e=>new x(e,n,i));else for(let r=0;r<this._data.length;r++){const e=this._data[r],s=t[r];Object(l.j)(s)&&(Object(l.i)(e)?this._data[r]=new x(s,n,i):e.resize(s,n))}this._initialized=!0}destroy(){Object(l.b)(this._data,e=>Object(l.l)(e,e=>e.destroy())),Object(l.b)(this._defaultTexture,e=>e.dispose())}isEmpty(){const e=this._data;return Object(l.i)(e)}isUpdating(){const e=Object(l.j)(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(l.i)(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,i,n){if(!this._data)return 0;const r=Object(l.q)(this._data)[t];if(Object(l.i)(r))return 0;const s=r.getData(e,i);return Object(l.j)(s)?s:n}setData(e,t,i,n){const r=Object(l.q)(this._data)[t];Object(l.q)(r).setData(e,i,n)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(e){if(this._pendingAttributeUpdate)return void _.error(new s.a("mapview-webgl","Tried to update attribute data with a pending update"));const t=Object(n.f)();return g("AttributeStoreView Update Requested",e),this._pendingAttributeUpdate={data:e,resolver:t},t.promise}update(){if(this._initialized&&Object(l.j)(this._pendingAttributeUpdate)){const{data:e,resolver:t}=this._pendingAttributeUpdate,i=Object(l.q)(this._data);for(let n=0;n<e.blocks.length;n++){const t=e.blocks[n],r=i[n];Object(l.b)(r,e=>Object(l.b)(t,t=>{g("Updating block "+n,t),e.update(t)}))}this._pendingAttributeUpdate=null,t(),this._onUpdate()}}bindTextures(e,t=!0){this.update();const i=this._getDefaultTexture(e);if(!this._initialized)return e.bindTexture(i,c.B),void(t&&(e.bindTexture(i,c.C),e.bindTexture(i,c.D),e.bindTexture(i,c.E),e.bindTexture(i,c.H)));const n=Object(l.q)(this._data);this._locked&&!this._forceNextUpload||(Object(l.g)(n,t=>t.updateTexture(e,()=>this._onUpdate())),this._forceNextUpload=!1),e.bindTexture(Object(l.m)(n[c.c],i,t=>t.getTexture(e)),c.B),t&&(e.bindTexture(Object(l.m)(n[c.d],i,t=>t.getTexture(e)),c.H),e.bindTexture(Object(l.m)(n[c.a],i,t=>t.getTexture(e)),c.C),e.bindTexture(Object(l.m)(n[c.e],i,t=>t.getTexture(e)),c.D),e.bindTexture(Object(l.m)(n[c.b],i,t=>t.getTexture(e)),c.E))}_getDefaultTexture(e){if(Object(l.i)(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 v=i(670),b=i(25),O=i(21),S=i(37),T=i(229),w=i(341);function j(e,t){const i=t.length;if(e<t[0].value||1===i)return t[0].size;for(let n=1;n<i;n++)if(e<t[n].value){const i=(e-t[n-1].value)/(t[n].value-t[n-1].value);return t[n-1].size+i*(t[n].size-t[n-1].size)}return t[i-1].size}function I(e,t,i=0){if(Object(l.i)(t))return e[i+0]=0,e[i+1]=0,e[i+2]=0,void(e[i+3]=0);const{r:n,g:r,b:s,a:a}=t;e[i+0]=n*a/255,e[i+1]=r*a/255,e[i+2]=s*a/255,e[i+3]=a}class M{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(l.r)(t.levels[e],()=>{let i=1/0,n=0;for(const o in t.levels){const t=parseFloat(o),r=Math.abs(e-t);r<i&&(i=r,n=t)}if(i===1/0)return{sizes:new Float32Array([0,0,0,0,0,0]),values:new Float32Array([0,0,0,0,0,0])};const r=2**((e-n)/2),s=Object(l.q)(t.levels[n]),a=new Float32Array(s.values);return a[2]*=r,a[3]*=r,{sizes:Object(l.q)(s.sizes),values:a}})}}get vvMaterialParameters(){return this._vvMaterialParameters}update(e){Object(l.j)(this._vvInfo)&&this._updateVisualVariables(this._vvInfo.vvRanges,e)}setInfo(e,t,i){this._updateEffects(i),this._vvInfo=t,"dot-density"===e.type&&this._updateDotDensityInfo(e)}getVariation(){return{ddDotBlending:this.ddDotBlending,outsideLabelsVisible:this.outsideLabelsVisible,oesTextureFloat:Object(w.a)().supportsTextureFloat}}getVariationHash(){return(this.ddDotBlending?1:0)|(this.outsideLabelsVisible?1:0)<<1}_updateEffects(e){Object(l.j)(e)?this.outsideLabelsVisible=e.excludedLabelsVisible:this.outsideLabelsVisible=!1}_updateVisualVariables(e,t){const i=this._vvMaterialParameters;if(i.vvOpacityEnabled=!1,i.vvSizeEnabled=!1,i.vvColorEnabled=!1,i.vvRotationEnabled=!1,!e)return;const n=e.size;if(n){if(i.vvSizeEnabled=!0,n.minMaxValue){const e=n.minMaxValue;let i,r;if(Object(h.r)(e.minSize)&&Object(h.r)(e.maxSize))if(Object(h.u)(e.minSize)&&Object(h.u)(e.maxSize))i=Object(O.c)(e.minSize),r=Object(O.c)(e.maxSize);else{const n=t.scale;i=Object(O.c)(j(n,e.minSize.stops)),r=Object(O.c)(j(n,e.maxSize.stops))}this.vvSizeMinMaxValue.set([e.minDataValue,e.maxDataValue,i,r])}if(n.scaleStops&&(this.vvSizeScaleStopsValue=Object(O.c)(j(t.scale,n.scaleStops.stops))),n.unitValue){const e=Object(S.d)(t.spatialReference)/T.a[n.unitValue.unit];this.vvSizeUnitValueToPixelsRatio=e/t.resolution}n.fieldStops&&(this._vvSizeFieldStops=n.fieldStops)}const r=e.color;r&&(i.vvColorEnabled=!0,this.vvColorValues.set(r.values),this.vvColors.set(r.colors));const s=e.opacity;s&&(i.vvOpacityEnabled=!0,this.vvOpacityValues.set(s.values),this.vvOpacities.set(s.opacities));const a=e.rotation;a&&(i.vvRotationEnabled=!0,i.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 i=0;i<c.o;i++){const e=i>=t.length?new b.a([0,0,0,0]):t[i].color;I(this.ddColors,e,4*i)}for(let i=0;i<8;i++)this.ddActiveDots[i]=i<e.attributes.length?1:0;I(this.ddBackgroundColor,e.backgroundColor)}}class E extends v.a{constructor(e){super(e),this._rendererInfo=new M,this._materialItemsRequestQueue=new r.a,this.attributeView=new y(()=>this.onAttributeStoreUpdate())}destroy(){this.removeAllChildren(),this.children.forEach(e=>e.destroy()),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(e,t,i){this._rendererInfo.setInfo(e,t,i),this.requestRender()}async getMaterialItems(e,t){if(!e||0===e.length)return null;const i=Object(n.f)();return this._materialItemsRequestQueue.push({items:e,abortOptions:t,resolver:i}),this.requestRender(),i.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:i,resolver:n}){const{painter:r,pixelRatio:s}=e,a=t.map(e=>r.textureManager.rasterizeItem(e.symbol,s,e.glyphIds,i));Promise.all(a).then(e=>{if(!this.stage)return void n.reject();const i=e.map((e,i)=>({id:t[i].id,mosaicItem:e}));n.resolve(i)},n.reject)}}},706:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(629);class r{constructor(){this._freeIds=[],this._idCounter=1}createId(e=!1){return Object(n.d)(this._getFreeId(),e)}releaseId(e){this._freeIds.push(e)}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}var s=i(667);function a(e,t,i){if(!(e.length>t))for(;e.length<=t;)e.push(i)}class o{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new r,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(s.a.create(this._allocatedSize,n.a)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),a(this._numerics[e],t,0)}_ensureInstanceId(e){a(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),a(this._strings[e],t,null)}createDisplayId(e=!1){const t=this._idGenerator.createId();return t>this._allocatedSize&&this._expand(),Object(n.d)(t,e)}releaseDisplayId(e){for(const t of this._bitsets)t.unset(e);return this._idGenerator.releaseId(e&n.a)}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&n.a,0)}setComputedNumeric(e,t,i){return this.setComputedNumericAtIndex(e&n.a,i,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&n.a,0)}setComputedString(e,t,i){return this.setComputedStringAtIndex(e&n.a,0,i)}getComputedNumericAtIndex(e,t){const i=e&n.a;return this._ensureNumeric(t,i),this._numerics[t][i]}setComputedNumericAtIndex(e,t,i){const r=e&n.a;this._ensureNumeric(t,r),this._numerics[t][r]=i}getInstanceId(e){const t=e&n.a;return this._ensureInstanceId(t),this._instanceIds[t]}setInstanceId(e,t){const i=e&n.a;this._ensureInstanceId(i),this._instanceIds[i]=t}getComputedStringAtIndex(e,t){const i=e&n.a;return this._ensureString(t,i),this._strings[t][i]}setComputedStringAtIndex(e,t,i){const r=e&n.a;this._ensureString(t,r),this._strings[t][r]=i}getXMin(e){return this._bounds[4*(e&n.a)]}getYMin(e){return this._bounds[4*(e&n.a)+1]}getXMax(e){return this._bounds[4*(e&n.a)+2]}getYMax(e){return this._bounds[4*(e&n.a)+3]}setBounds(e,t){const i=t.readHydratedGeometry();if(!i||!i.coords.length)return!1;let r=1/0,s=1/0,o=-1/0,l=-1/0;i.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),o=Math.max(o,e),l=Math.max(l,t)});const c=e&n.a;return a(this._bounds,4*c+4,0),this._bounds[4*c]=r,this._bounds[4*c+1]=s,this._bounds[4*c+2]=o,this._bounds[4*c+3]=l,!0}}},710:function(e,t,i){"use strict";i.d(t,"a",(function(){return $e}));var n=i(0),r=i(20),s=i(256),a=i(85),o=i(5),l=i(2),c=i(12),u=i(1),h=(i(9),i(4),i(3)),d=i(30),f=i(60),m=i(177),p=i(15),_=i(111),g=i(282),x=i(94),y=i(27);function v(e){if(!e)return null;let t=null;const i=e.spatialReference,n=Object(y.e)(i);if(!n)return"toJSON"in e?e.toJSON():e;const r=Object(y.p)(i)?102100:4326,s=x.a[r].maxX,a=x.a[r].minX,o=x.a[r].plus180Line,l=x.a[r].minus180Line;let c;const u="toJSON"in e?e.toJSON():e;if(Object(p.f)(u))c=b(u,s,a);else if(Object(p.e)(u))u.points=u.points.map(e=>b(e,s,a)),c=u;else if(Object(p.d)(u))c=function(e,t){if(!t)return e;const i=function(e,t){const i=[],{ymin:n,ymax:r}=e,s=e.xmax-e.xmin,a=e.xmin,o=e.xmax;let l;const[c,u]=t.valid;l=O(e.xmin,t);const h=l.x,d=l.frameId;l=O(e.xmax,t);const f=l.x,m=l.frameId,p=h===f&&s>0;if(s>2*u){const e={xmin:a<o?h:f,ymin:n,xmax:u,ymax:r},t={xmin:c,ymin:n,xmax:a<o?f:h,ymax:r},s={xmin:0,ymin:n,xmax:u,ymax:r},l={xmin:c,ymin:n,xmax:0,ymax:r},p=[],_=[];S(e,s)&&p.push(d),S(e,l)&&_.push(d),S(t,s)&&p.push(m),S(t,l)&&_.push(m);for(let i=d+1;i<m;i++)p.push(i),_.push(i);i.push({extent:e,frameIds:[d]},{extent:t,frameIds:[m]},{extent:s,frameIds:p},{extent:l,frameIds:_})}else h>f||p?i.push({extent:{xmin:h,ymin:n,xmax:u,ymax:r},frameIds:[d]},{extent:{xmin:c,ymin:n,xmax:f,ymax:r},frameIds:[m]}):i.push({extent:{xmin:h,ymin:n,xmax:f,ymax:r},frameIds:[d]});return i}(e,t).map(e=>e.extent);return i.length<2?i[0]||e:i.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:i.map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}}(u,n);else if(Object(p.g)(u)||Object(p.h)(u)){const e=j;Object(_.a)(e,u);const i={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]},n=Object(x.d)(i.xmin,a)*(2*s),r=0===n?u:function(e,t){const i=Object(x.b)(e);for(const n of i)for(const e of n)e[0]+=t;return e}(u,n);i.xmin+=n,i.xmax+=n,Object(g.b)(i,o)&&i.xmax!==s||Object(g.b)(i,l)&&i.xmin!==a?t=r:c=r}else c=u;return null!==t?(new w).cut(t,s):c}function b(e,t,i){if(Array.isArray(e)){const n=e[0];if(n>t){const i=Object(x.d)(n,t);e[0]=n+i*(-2*t)}else if(n<i){const t=Object(x.d)(n,i);e[0]=n+t*(-2*i)}}else{const n=e.x;if(n>t){const i=Object(x.d)(n,t);e.x+=i*(-2*t)}else if(n<i){const t=Object(x.d)(n,i);e.x+=t*(-2*i)}}return e}function O(e,t){const[i,n]=t.valid,r=2*n;let s,a=0;return e>n?(s=Math.ceil(Math.abs(e-n)/r),e-=s*r,a=s):e<i&&(s=Math.ceil(Math.abs(e-i)/r),e+=s*r,a=-s),{x:e,frameId:a}}function S(e,t){const{xmin:i,ymin:n,xmax:r,ymax:s}=t;return T(e,i,n)&&T(e,i,s)&&T(e,r,s)&&T(e,r,n)}function T(e,t,i){return t>=e.xmin&&t<=e.xmax&&i>=e.ymin&&i<=e.ymax}class w{cut(e,t){let i;if(e.rings)this.closed=!0,i=e.rings,this.minPts=4;else{if(!e.paths)return null;this.closed=!1,i=e.paths,this.minPts=2}const n=i.length,r=-2*t;for(let s=0;s<n;s++){const e=i[s];if(e&&e.length>=this.minPts){const t=[];for(const i of e)t.push([i[0]+r,i[1]]);i.push(t)}}return this.closed?e.rings=i:e.paths=i,e}}const j=Object(f.g)();var I=i(666),M=i(61),E=i(394),C=i(226);class R{constructor(){this._dirties=[{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1}]}hasDirty(){return this._dirties.some(e=>-1!==e.indexCount||e.allDirty)}markAllClean(){for(const e of this._dirties)e.indexFrom=-1,e.indexCount=-1,e.vertexFrom=-1,e.vertexCount=-1,e.allDirty=!1}markAllDirty(){for(const e of this._dirties)e.allDirty=!0}forEach(e){for(let t=0;t<this._dirties.length;++t){const{indexCount:i,indexFrom:n,vertexCount:r,vertexFrom:s,allDirty:a}=this._dirties[t],o={};let l,c=!1;(a||-1!==s&&r>0)&&(o.geometry={count:r,from:s,allDirty:a},c=!0),(a||-1!==n&&i>0)&&(l={count:i,from:n,allDirty:a},c=!0),c&&e({indices:l,vertices:o},t)}}markDirtyIndices(e,t,i){const n=this._dirties[e],r=t,s=i;if(!n.allDirty)if(-1!==n.indexCount){const e=Math.min(n.indexFrom,r),t=Math.max(n.indexFrom+n.indexCount,r+s)-e;n.indexFrom=e,n.indexCount=t}else n.indexFrom=r,n.indexCount=s}markDirtyVertices(e,t,i,n){const r=this._dirties[e],s=i,a=n;if(!r.allDirty)if(-1!==r.vertexCount){const e=Math.min(r.vertexFrom,s),t=Math.max(r.vertexFrom+r.vertexCount,s+a)-e;r.vertexFrom=e,r.vertexCount=t}else r.vertexFrom=s,r.vertexCount=a}}class D{constructor(e){this._largestRange=null,this._parent=e,this._updateLargestRange()}get largestRange(){return this._largestRange}rangeCreated(e){(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)}rangeResized(e,t){e===this._largestRange?e.count<t&&this._updateLargestRange():(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)}findBestRange(e){let t=this._parent._freeHead,i=null;for(;null!==t;)t.count>=e&&(!i||t.count-e<i.count-e)&&(i=t),t=t.next;return i}findAdjacentRanges(e,t){let i=!0,n=!1,r=null,s=this._parent._freeHead;for(;i&&!n;){const a=null!==r?r.from+r.count:0,o=null!==s?s.from:this._parent._size;e>=a&&e+t<=o?(i=!1,n=!0):null!==s?(r=s,s=s.next):i=!1}return[r,s]}_updateLargestRange(){let e=null,t=this._parent._freeHead;for(;null!==t;)(!e||t.count>e.count)&&(e=t),t=t.next;this._largestRange=e}}class P{constructor(e,t){this._allocated=0,this._size=e,this._freeHead=e>0?{from:0,count:e,prev:null,next:null}:null,this._bookKeeper=t||new D(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}allocate(e){const t=this._bookKeeper.findBestRange(e);if(null===t)return-1;const i=t.from,n=t.count;if(t.from+=e,t.count-=e,this._bookKeeper.rangeResized(t,i,n),this._allocated+=e,0===t.count){const e=null!==t.prev?this._freeHead:t.next;P._removeRange(t),this._freeHead=e}return i}free(e,t){const[i,n]=this._bookKeeper.findAdjacentRanges(e,t),r={from:e,count:t,prev:i,next:n};if(null!==i&&(i.next=r),null!==n&&(n.prev=r),this._bookKeeper.rangeCreated(r),this._allocated-=t,null!==n&&r.from+r.count===n.from){const e=r.from,t=r.count;P._fuse(r,n),P._removeRange(n),this._bookKeeper.rangeResized(r,e,t),this._bookKeeper.rangeResized(n,void 0,0)}if(null!==i&&i.from+i.count===r.from){const e=i.from,t=i.count;P._fuse(i,r),P._removeRange(r),this._bookKeeper.rangeResized(i,e,t),this._bookKeeper.rangeResized(r,void 0,0)}this._freeHead=null!==r.prev?this._freeHead:r}get fragmentation(){const e=this._size-this._allocated;return 0===e?0:1-this._bookKeeper.largestRange.count/e}static _removeRange(e){null!==e.prev?null!==e.next?(e.prev.next=e.next,e.next.prev=e.prev):e.prev.next=null:null!==e.next&&(e.next.prev=null)}static _fuse(e,t){e.count+=t.count,e.next=t.next,t.from+=t.count,t.count=0,null!==t.next&&(t.next.prev=e)}}var A=i(616);const z=["FILL","LINE","MARKER","TEXT","LABEL"];class L{constructor(e,t,i,n){this._strides=e,this._displayList=t,this._freeListsAndStorage={},this._dirtyMap=null,this._dirtyMap=i;for(const r in e){this._freeListsAndStorage[r]={vtxFreeList:n?new P(n):null,idxFreeList:n?new P(n):null,vertexBuffers:{},indexBuffer:n?new Uint32Array(n):null};for(const t in e[r])this._freeListsAndStorage[r].vertexBuffers[t]={data:n?Object(A.b)(n,e[r][t]):null,stride:e[r][t]}}}static fromTileData(e,t){const i=function(e){const t=e.getStrides(),i={};for(let n=0;n<t.length;n++)i[z[n]]=t[n];return i}(e),n=[0,0,0,0,0],r=[0,0,0,0,0],s=e.tileDisplayData.displayObjects;for(const o of s)for(const e of o.displayRecords)n[e.geometryType]=Math.max(n[e.geometryType],e.vertexFrom+e.vertexCount),r[e.geometryType]=Math.max(r[e.geometryType],e.indexFrom+e.indexCount);const a=new L(i,e.tileDisplayData.displayList,t,null);for(let o=0;o<e.tileBufferData.geometries.length;++o){const t=n[o],i=r[o],s=e.tileBufferData.geometries[o],l=z[o],c=a._storageFor(l),u=e.tileBufferData.geometries[o].indexBuffer;let h;c.indexBuffer=u,c.idxFreeList=new P(u.length),c.idxFreeList.allocate(i);for(const n in s.vertexBuffer){const t=e.tileBufferData.geometries[o].vertexBuffer[n];c.vertexBuffers[n].data=t.data,c.vertexBuffers[n].stride=t.stride;const i=Object(A.A)(t.stride),r=t.data.length*i/t.stride;h||(h=r)}c.vtxFreeList=new P(h),c.vtxFreeList.allocate(t)}return a}delete(e){const t=z[e.geometryType];this._freeVertices(t,e.vertexFrom,e.vertexCount),this._freeIndices(t,e.indexFrom,e.indexCount),this._displayList.removeFromList(e),e.vertexFrom=void 0,e.indexFrom=void 0}setMeshData(e,t,i,n,r){const s=z[e.geometryType];let a,o;e.meshData=null,void 0===e.vertexFrom?(o=t.vertexCount,a=this._allocateVertices(s,o)):t.vertexCount>e.vertexCount?(this._freeVertices(s,e.vertexFrom,e.vertexCount),o=t.vertexCount,a=this._allocateVertices(s,o)):t.vertexCount===e.vertexCount?(a=e.vertexFrom,o=e.vertexCount):(this._freeVertices(s,e.vertexFrom+t.vertexCount,e.vertexCount-t.vertexCount),a=e.vertexFrom,o=t.vertexCount);let l,c,u,h=!0;if(void 0===e.indexFrom?(l=r,u=t.indexCount,c=this._allocateIndices(s,u)):t.indexCount>e.indexCount?(l=this._displayList.removeFromList(e),this._freeIndices(s,e.indexFrom,e.indexCount),u=t.indexCount,c=this._allocateIndices(s,u)):t.indexCount===e.indexCount?(h=!1,c=e.indexFrom,u=e.indexCount):(l=this._displayList.removeFromList(e),this._freeIndices(s,e.indexFrom+t.indexCount,e.indexCount-t.indexCount),c=e.indexFrom,u=t.indexCount),-1!==a&&-1!==c){const r=this._storageFor(s);if(Object(A.e)(a,c,r.vertexBuffers,r.indexBuffer,t,i,n),e.vertexFrom=a,e.indexFrom=c,e.vertexCount=t.vertexCount,e.indexCount=t.indexCount,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const t in i)this._dirtyMap.markDirtyVertices(e.geometryType,t,e.vertexFrom,e.vertexCount)}return h&&this._displayList.addToList(e,l),!0}return-1!==a&&this._freeVertices(s,a,o),-1!==c&&this._freeIndices(s,c,u),e.setMeshDataFromBuffers(t,i,n),e.vertexFrom=void 0,e.vertexCount=0,e.indexFrom=void 0,e.indexCount=0,!1}tryAddMeshData(e,t){const i=t.vertexBuffer,n=t.indexBuffer,r=z[e.geometryType],s=this._allocateVertices(r,e.vertexCount);if(-1===s)return this._freeVertices(r,s,e.vertexCount),!1;const a=this._allocateIndices(r,e.indexCount);if(-1===a)return this._freeVertices(r,s,e.vertexCount),this._freeIndices(r,a,e.indexCount),!1;const o=this._storageFor(r);if(Object(A.e)(s,a,o.vertexBuffers,o.indexBuffer,e,i,n),e.vertexFrom=s,e.indexFrom=a,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const t in i)this._dirtyMap.markDirtyVertices(e.geometryType,t,s,e.vertexCount)}return this._displayList.addToList(e),!0}_allocateVertices(e,t){const i=this._storageFor(e),n=i.vtxFreeList.allocate(t);return-1===n||i.vtxFreeList.fragmentation>.5?-1:n}_freeVertices(e,t,i){this._storageFor(e).vtxFreeList.free(t,i)}_freeIndices(e,t,i){this._storageFor(e).idxFreeList.free(t,i)}_allocateIndices(e,t){const i=this._storageFor(e),n=i.idxFreeList.allocate(t);return-1===n||i.idxFreeList.fragmentation>.5?-1:n}_storageFor(e){return this._freeListsAndStorage[e]}_stridesFor(e,t){return this._strides[e][t]}}var F=i(619),V=i(614),N=i(620);class U{constructor(e){this.geometryMap=Object(A.f)(()=>({indexBuffer:F.a.createIndex(e,V.D.STATIC_DRAW),vao:null}),(t,i)=>({vertexBuffer:F.a.createVertex(e,A.a[i])}))}dispose(){for(let e=0;e<5;e++){const t=this.geometryMap[e];if(t){t.data.vao&&t.data.vao.dispose(!1),t.data.indexBuffer&&t.data.indexBuffer.dispose();for(const e in t.buffers)t.buffers[e]&&t.buffers[e].data.vertexBuffer.dispose()}}}get(e){const t=this.geometryMap[e];return{getVAO(e,i,n){if(!t.data.vao){const r={};for(const e in t.buffers)r[e]=t.buffers[e].data.vertexBuffer;t.data.vao=new N.a(e,n,i,r,t.data.indexBuffer)}return t.data.vao}}}has(e){return null!=this.geometryMap[e]}upload(e,t){t.forEach((t,i)=>{this._upload(t,i,e)})}_upload(e,t,i){if(e.indices&&(e.indices.allDirty?this._uploadIndices(i,t):null!=e.indices.from&&null!=e.indices.count&&this._uploadIndices(i,t,e.indices.from,e.indices.count)),e.vertices){const n=e.vertices;for(const e in n){const r=n[e];r.allDirty?this._uploadVertices(i,t,e):null!=r.from&&null!=r.count&&this._uploadVertices(i,t,e,r.from,r.count)}}}_uploadVertices(e,t,i,n,r){const s=this.geometryMap[t];if(!s)return;const a=e.geometries[t].vertexBuffer[i];if(!a)return;const o=a.stride,l=a.data.buffer;s.buffers[i]&&l.byteLength>0&&(null!=n&&null!=r?s.buffers[i].data.vertexBuffer.setSubData(l,n*o,n*o,(n+r)*o):s.buffers[i].data.vertexBuffer.setData(l))}_uploadIndices(e,t,i,n){const r=this.geometryMap[t];if(!r)return;const s=e.geometries[t].indexBuffer.buffer;r.data.indexBuffer&&s.byteLength>0&&(null!=i&&null!=n?r.data.indexBuffer.setSubData(s,4*i,4*i,4*(i+n)):r.data.indexBuffer.setData(s))}}var k=i(698);class B extends k.a{constructor(){super(...arguments),this._data=null,this._displayList=null,this._lastCommitTime=0,this._hasData=!1,this._invalidated=!1,this._wglBuffers=null,this._dirtyMap=new R}destroy(){super.destroy(),this.clear()}get hasData(){return!!this._hasData}get displayObjects(){var e;return null!=(e=this._displayObjects)?e:[]}getGeometry(e){return this._wglBuffers&&this._wglBuffers.has(e)?this._wglBuffers.get(e):null}getDisplayList(){return this._displayList}patch(e){if(!0===e.clear)return this.clear(),void(this._hasData=!1);const t=e.addOrUpdate,i=e.remove;!this._data&&t&&t.tileDisplayData.displayObjects.length?(t.tileDisplayData.computeDisplayList(),this._dirtyMap=new R,this._dispRecStore=L.fromTileData(t,this._dirtyMap),this._data=t,this._dirtyMap.markAllDirty(),this._hasData=!0,e.end&&this.ready()):this._data&&(t&&t.tileDisplayData.displayObjects.length||i.length)?this._doPatchData(e):e.end&&this.ready(),e.end&&!this._data&&this.clear(),this.requestRender(),this.emit("change")}commit(e){e.time&&e.time===this._lastCommitTime||(this._lastCommitTime=e.time,this.visible&&this._data&&(this._wglBuffers||(this._wglBuffers=new U(e.context)),(this._dirtyMap.hasDirty()||this._invalidated)&&(this._invalidated=!1,this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._displayList=this._data.tileDisplayData.displayList.clone(),this._displayObjects=this._data.tileDisplayData.displayObjects.slice(),this._dirtyMap.markAllClean())))}clear(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null)}_doPatchData(e){this._invalidated=!0,this._patchData(e)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=L.fromTileData(this._data,this._dirtyMap)),this.requestRender()}_patchData(e){let t=!0;const i=e.addOrUpdate&&e.addOrUpdate.tileDisplayData&&e.addOrUpdate.tileDisplayData.displayObjects||[],n=(e.remove||[]).slice();for(const r of i)null!=r.insertAfter&&n.push(r.id);for(const r of n){const e=this._data.tileDisplayData.displayObjectRegistry.get(r);if(e){this._data.tileDisplayData.displayList.removeFromList(e.displayRecords);for(const i of e.displayRecords)this._dispRecStore.delete(i);this._data.tileDisplayData.displayObjectRegistry.delete(r);const t=this._data.tileDisplayData.displayObjects.indexOf(e);this._data.tileDisplayData.displayObjects.splice(t,1)}}for(const r of i){let i,n=this._data.tileDisplayData.displayObjectRegistry.get(r.id);if(n){const e=n.displayRecords;n.set(r),n.displayRecords=e;const t=n.displayRecords.length;for(let i=0;i<t;++i){const e=n.displayRecords[i],t=r.displayRecords[i];(i>=r.displayRecords.length||e.geometryType!==t.geometryType||e.symbolLevel!==t.symbolLevel||e.zOrder!==t.zOrder||e.materialKey!==t.materialKey)&&(this._dispRecStore.delete(n.displayRecords[i]),i<r.displayRecords.length&&(n.displayRecords[i]=void 0))}n.displayRecords.length=r.displayRecords.length}else{let e;n=r.copy(),n.displayRecords=[],this._data.tileDisplayData.displayObjectRegistry.set(r.id,n);const t=this._data.tileDisplayData.displayObjects;if(null!=n.insertAfter)if(i={},n.insertAfter>=0){const i=this._data.tileDisplayData.displayObjectRegistry.get(n.insertAfter);i?(e=t.indexOf(i)+1,e<t.length?t.splice(e,0,n):(t.push(n),e=t.length)):(t.push(n),e=t.length)}else t.unshift(n),e=0;else t.push(n),e=t.length;if(i){const n=r.displayRecords.length>0?1:0;let s=0;for(let r=e-1;r>=0&&s<n;--r)for(let e=t[r].displayRecords.length-1;e>=0&&s<n;--e){const n=t[r].displayRecords[e],a=this._data.tileDisplayData.displayList.getDPInfoType();i[a]||(i[a]=n,++s)}}}const s=r.displayRecords.length;for(let a=0;a<s;++a){const s=r.displayRecords[a];let o=n.displayRecords[a];o?(o.meshData=s.meshData,o.materialKey=s.materialKey):(o=s.copy(),o.vertexFrom=void 0,o.indexFrom=void 0,n.displayRecords[a]=o);const l=s.geometryType,c=this._data.tileDisplayData.displayList.getDPInfoType(),u=e.addOrUpdate.tileBufferData.geometries[l],h=u.vertexBuffer,d=u.indexBuffer;let f;i&&(f=i[c]?this._data.tileDisplayData.displayList.splitAfter(i[c]):-1),t=this._dispRecStore.setMeshData(o,s,h,d,f)&&t,i&&null!=o.indexFrom&&null!=o.indexFrom&&(i[c]=o)}}return t}}class G{constructor(){this._byGeometryType=null}get satisfied(){return!this._byGeometryType}reset(){this._byGeometryType=null}verticesFor(e){return this._byGeometryType?this._byGeometryType[e].vertices:0}indicesFor(e){return this._byGeometryType?this._byGeometryType[e].indices:0}needMore(e,t,i){if(!t&&!i)return;this._byGeometryType||(this._byGeometryType=[{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0}]);const n=this._byGeometryType[e];n.vertices+=t,n.indices+=i}}class W{constructor(){this.geometries=[{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}}]}clone(){const e=new W;for(let t=0;t<this.geometries.length;t++){const i=this.geometries[t],n=e.geometries[t];n.indexBuffer=i.indexBuffer.slice(),n.vertexBuffer={};for(const e in i.vertexBuffer){const{data:t,stride:r}=i.vertexBuffer[e];n.vertexBuffer[e]={data:t.slice(),stride:r}}}return e}static deserialize(e){const t=new W;for(let i=0;i<5;++i){t.geometries[i].indexBuffer=new Uint32Array(e.geometries[i].indexBuffer),t.geometries[i].vertexBuffer={};for(const n in e.geometries[i].vertexBuffer)t.geometries[i].vertexBuffer[n]={data:Object(A.c)(e.geometries[i].vertexBuffer[n].data,e.geometries[i].vertexBuffer[n].stride),stride:e.geometries[i].vertexBuffer[n].stride}}return t}serialize(){const e={geometries:[{indexBuffer:this.geometries[0].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[1].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[2].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[3].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[4].indexBuffer.buffer,vertexBuffer:{}}]};for(let t=0;t<5;++t)for(const i in this.geometries[t].vertexBuffer)e.geometries[t].vertexBuffer[i]={data:this.geometries[t].vertexBuffer[i].data.buffer,stride:this.geometries[t].vertexBuffer[i].stride};return e}getBuffers(){const e=[];for(let t=0;t<5;++t){e.push(this.geometries[t].indexBuffer.buffer);for(const i in this.geometries[t].vertexBuffer)e.push(this.geometries[t].vertexBuffer[i].data.buffer)}return e}}var H=i(615);function q(e,t,i,...n){t<e.length?e.splice(t,i,...n):e.push(...n)}const Z=new Map;Z.set(H.c.MAP,[H.d.FILL,H.d.LINE,H.d.MARKER,H.d.TEXT]),Z.set(H.c.LABEL,[H.d.LABEL]),Z.set(H.c.LABEL_ALPHA,[H.d.LABEL]);class Y{constructor(){this.symbolLevels=[]}replay(e,t,i){for(const n of this.symbolLevels)for(const r of n.zLevels){const n=r.geometryDPInfo.unified;if(n)for(const r of n){const n=e.painter.getGeometryBrush(r.geometryType),s=t.getGeometry(r.geometryType),a={geometryType:r.geometryType,materialKey:r.materialKey,indexFrom:r.indexFrom,indexCount:r.indexCount,target:s};n.prepareState(e,t),n.drawGeometry(e,t,a,i)}}}get empty(){return!this.symbolLevels||0===this.symbolLevels.length}clear(){this.symbolLevels.length=0}addToList(e,t){if(Array.isArray(e))for(const i of e)this._addToList(i,t);else this._addToList(e,t)}removeFromList(e){Array.isArray(e)||(e=[e]);let t=null;for(const i of e)t=this._removeFromList(i);return t}clone(){const e=new Y;for(const t of this.symbolLevels)e.symbolLevels.push(t.clone());return e}splitAfter(e){const t=this._getDisplayList(e.symbolLevel,e.zOrder),i=t.length,n=e.indexFrom+e.indexCount;for(let r=0;r<i;++r){const i=t[r];if(i.geometryType===e.geometryType&&n>i.indexFrom&&n<=i.indexFrom+i.indexCount){if(n<i.indexFrom+i.indexCount){const e=new K;e.geometryType=i.geometryType,e.materialKey=i.materialKey,e.indexFrom=n,e.indexCount=i.indexFrom+i.indexCount-n,t.splice(r+1,0,e),i.indexCount=n-i.indexFrom}return r}}}_addToList(e,t){const i=e.symbolLevel,n=e.zOrder,r=this._getDisplayList(i,n),s=null!=t?t:r.length-1,a=s>=0&&s<r.length?r[s]:null;if(null!==a&&a.materialKey===e.materialKey&&a.indexFrom+a.indexCount===e.indexFrom&&a.geometryType===e.geometryType)a.indexCount+=e.indexCount;else{const t=new K;t.indexFrom=e.indexFrom,t.indexCount=e.indexCount,t.materialKey=e.materialKey,t.geometryType=e.geometryType,q(r,s+1,0,t)}}_removeFromList(e){const t=e.symbolLevel,i=e.zOrder,n=this._getDisplayList(t,i),r=n.length;let s;for(let a=0;a<r;++a){const t=n[a];if(e.indexFrom+e.indexCount>t.indexFrom&&e.indexFrom<t.indexFrom+t.indexCount&&t.geometryType===e.geometryType){s=a;break}}if(void 0!==s){const t=n[s];if(e.indexFrom===t.indexFrom)return t.indexCount-=e.indexCount,t.indexFrom+=e.indexCount,0===t.indexCount&&q(n,s,1),s-1;if(e.indexFrom+e.indexCount===t.indexFrom+t.indexCount)return t.indexCount-=e.indexCount,0===t.indexCount?(q(n,s,1),s-1):s;{const i=t.indexFrom,r=e.indexFrom-t.indexFrom,a=e.indexCount,o=t.indexFrom+t.indexCount-(e.indexFrom+e.indexCount);t.indexCount=r;const l=new K;return l.geometryType=t.geometryType,l.materialKey=t.materialKey,l.indexFrom=i+r+a,l.indexCount=o,q(n,s+1,0,l),s}}return null}_getDisplayList(e,t){let i;const n=this.symbolLevels.length;for(let a=0;a<n;a++)if(this.symbolLevels[a].symbolLevel===e){i=this.symbolLevels[a];break}let r;i||(i=new $,i.symbolLevel=e,this.symbolLevels.push(i));const s=i.zLevels.length;for(let a=0;a<s;a++)if(i.zLevels[a].zLevel===t){r=i.zLevels[a];break}return r||(r=new J,r.geometryDPInfo=new X,r.zLevel=t,i.zLevels.push(r)),r.geometryDPInfo.unified||(r.geometryDPInfo.unified=[]),r.geometryDPInfo.unified}getDPInfoType(){return"unified"}}class K{constructor(){this.materialKey=null,this.indexFrom=0,this.indexCount=0}clone(){const e=new K;return e.geometryType=this.geometryType,e.materialKey=this.materialKey,e.indexFrom=this.indexFrom,e.indexCount=this.indexCount,e}}class X{constructor(){this.fill=null,this.line=null,this.marker=null,this.text=null,this.label=null,this.unified=null}clone(){const e=new X;return e.fill=this.fill&&this.fill.map(e=>e.clone()),e.line=this.line&&this.line.map(e=>e.clone()),e.marker=this.marker&&this.marker.map(e=>e.clone()),e.text=this.text&&this.text.map(e=>e.clone()),e.label=this.label&&this.label.map(e=>e.clone()),e.unified=this.unified&&this.unified.map(e=>e.clone()),e}}class J{constructor(){this.geometryDPInfo=new X}clone(){const e=new J;return e.zLevel=this.zLevel,e.geometryDPInfo=this.geometryDPInfo.clone(),e}}class ${constructor(){this.zLevels=[]}clone(){const e=new $;e.symbolLevel=this.symbolLevel;for(const t of this.zLevels)e.zLevels.push(t.clone());return e}}class Q{constructor(){this.vertexData=new Map,this.vertexCount=0,this.indexData=[]}clear(){this.vertexData.clear(),this.vertexCount=0,this.indexData=[]}update(e,t,i){for(const n in e)this.vertexData.set(n,e[n]);for(const n in this.vertexData)null===e[n]&&this.vertexData.delete(n);this.vertexCount=t,this.indexData=i}}class ee{constructor(e,t,i,n=0,r=0){this.id=e,this.geometryType=t,this.materialKey=i,this.minZoom=n,this.maxZoom=r,this.meshData=null,this.symbolLevel=0,this.zOrder=0,this.vertexFrom=0,this.vertexCount=0,this.indexFrom=0,this.indexCount=0}get sortKey(){return void 0===this._sortKey&&this._computeSortKey(),this._sortKey}clone(){return this.copy()}copy(){const e=new ee(this.id,this.geometryType,this.materialKey);return e.vertexFrom=this.vertexFrom,e.vertexCount=this.vertexCount,e.indexFrom=this.indexFrom,e.indexCount=this.indexCount,e.zOrder=this.zOrder,e.symbolLevel=this.symbolLevel,e.meshData=this.meshData,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e}setMeshDataFromBuffers(e,t,i){const n=new Q;for(const r in t){const i=t[r].stride,s=t[r].data,a=[],o=Object(A.A)(i);for(let t=0;t<i*e.vertexCount/o;++t)a[t]=s[t+i*e.vertexFrom/o];n.vertexData.set(r,a)}n.indexData.length=0;for(let r=0;r<e.indexCount;++r)n.indexData[r]=i[r+e.indexFrom]-e.vertexFrom;n.vertexCount=e.vertexCount,this.meshData=n}readMeshDataFromBuffers(e,t){this.meshData?this.meshData.clear():this.meshData=new Q;for(const i in e){const t=e[i].stride,n=e[i].data,r=[],s=Object(A.A)(t);for(let e=0;e<t*this.vertexCount/s;++e)r[e]=n[e+t*this.vertexFrom/s];this.meshData.vertexData.set(i,r)}this.meshData.indexData.length=0;for(let i=0;i<this.indexCount;++i)this.meshData.indexData[i]=t[i+this.indexFrom]-this.vertexFrom;this.meshData.vertexCount=this.vertexCount}writeMeshDataToBuffers(e,t,i,n){for(const r in t){const i=t[r].stride,n=this.meshData.vertexData.get(r),s=t[r].data,a=Object(A.A)(i);for(let t=0;t<i*this.meshData.vertexCount/a;++t)s[t+i*e/a]=n[t]}for(let r=0;r<this.meshData.indexData.length;++r)n[r+i]=this.meshData.indexData[r]+e;this.vertexFrom=e,this.vertexCount=this.meshData.vertexCount,this.indexFrom=i,this.indexCount=this.meshData.indexData.length}static writeAllMeshDataToBuffers(e,t,i){let n=0,r=0;for(const s of e)s.writeMeshDataToBuffers(n,t,r,i),n+=s.vertexCount,r+=s.indexCount}_computeSortKey(){this._sortKey=(31&this.symbolLevel)<<12|(127&this.zOrder)<<4|7&this.geometryType}serialize(e){return e.push(this.geometryType),e.push(this.materialKey),e.push(this.vertexFrom),e.push(this.vertexCount),e.push(this.indexFrom),e.push(this.indexCount),e.push(this.minZoom),e.push(this.maxZoom),e}static deserialize(e,t){const i=e.readInt32(),n=e.readInt32(),r=new ee(t.id,i,n);return r.vertexFrom=e.readInt32(),r.vertexCount=e.readInt32(),r.indexFrom=e.readInt32(),r.indexCount=e.readInt32(),r.minZoom=e.readInt32(),r.maxZoom=e.readInt32(),r}}function te(e,t){if(null!==t){e.push(t.length);for(const i of t)i.serialize(e);return e}e.push(0)}class ie{constructor(e){this.insertAfter=null,this.id=e,this.displayRecords=[]}copy(){const e=new ie(this.id);return e.set(this),e}clone(){const e=new ie(this.id);return e.displayRecords=this.displayRecords.map(e=>e.clone()),e.insertAfter=this.insertAfter,e}set(e){this.id=e.id,this.displayRecords=e.displayRecords,this.insertAfter=e.insertAfter}serialize(e){return e.push(this.id),te(e,this.displayRecords),e}static deserialize(e){const t=e.readInt32(),i=new ie(t),n={id:t};return i.displayRecords=function(e,t,i){const n=e.readInt32(),r=new Array(n);for(let s=0;s<r.length;s++)r[s]=t.deserialize(e,i);return r}(e,ee,n),i}}class ne{constructor(){}get displayObjectRegistry(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(const e of this.displayObjects)this._displayObjectRegistry.set(e.id,e)}return this._displayObjectRegistry}get displayList(){return this._displayList}computeDisplayList(){this._displayList=new Y;for(const e of this.displayObjects)for(const t of e.displayRecords)this._displayList.addToList(t)}clone(){const e=new ne;return this.displayObjects&&(e.displayObjects=this.displayObjects.map(e=>e.clone())),e}serialize(e){return te(e,this.displayObjects),e}_deserializeObjects(e){const t=e.readInt32(),i=new Array(t),n=new Map;for(let r=0;r<i.length;++r){const t=ie.deserialize(e);i[r]=t,n.set(t.id,t)}this.displayObjects=i,this._displayList=null,this._displayObjectRegistry=n}static deserialize(e){const t=new ne;return t._deserializeObjects(e),t}}var re=i(699);class se{constructor(e,t){this.data=e,this.stride=t}static decode(e){const t=Object(A.c)(e.data,e.stride),i=e.stride;return new se(t,i)}static fromVertexVector(e){const t=Object(A.c)(e.data.buffer(),e.stride),i=e.stride;return new se(t,i)}}class ae{constructor(e,t,i){this.geometryType=e,this.indexBuffer=new Uint32Array(t),this.namedBuffers=i}static decode(e){const t=e.geometryType,i=e.indexBuffer,n={};for(const r in e.namedBuffers)n[r]=se.decode(e.namedBuffers[r]);return new ae(t,i,n)}static fromVertexData(e,t){const i=e.indices,n=Object(A.c)(e.vertices,e.stride),r=e.stride,s={geometry:new se(n,r)};return new ae(t,i,s)}static fromVertexVectors(e){const t=e.geometryType,i=e.indexVector.buffer(),n={};for(const r in e.namedVectors)n[r]=se.fromVertexVector(e.namedVectors[r]);return new ae(t,i,n)}}var oe=i(657);class le{constructor(e,t){this.data=e,this.stride=t}get vertexCount(){const e=this.stride/4,t=this.data.length/e;return t!==(0|t)&&console.debug("Corrupted stride"),t}transfer(e,t){const i=this.data.buffer();e.vertexCount=this.vertexCount,e.data=i,e.stride=this.stride,t.push(i)}}class ce{constructor(e,t,i){this.geometryType=e,this.indexVector=new oe.a(Uint32Array,6*t),this.namedVectors={};const n=Object(A.n)(e,i);for(const r in n){const e=n[r];let i;switch(e%4){case 0:case 2:i=new oe.a(Uint32Array,e*t);break;case 1:case 3:i=new oe.a(Uint8Array,e*t)}this.namedVectors[r]=new le(i,e)}}get(e){return this.namedVectors[e].data}getVector(e){return this.namedVectors[e]}transfer(e,t){const i=this.indexVector.buffer(),n={};t.push(i);for(const r in this.namedVectors){const e=this.namedVectors[r];n[r]={},e.transfer(n[r],t)}e.geometryType=this.geometryType,e.indexBuffer=i,e.namedBuffers=n,this.destroy()}intoBuffers(){const e=ae.fromVertexVectors(this);return this.destroy(),e}destroy(){this.indexVector=null,this.namedVectors=null}}const ue=new G,he=new G;function de(e,t){const i={};for(const n in e){const r={data:Object(A.b)(t,e[n]),stride:e[n]};i[n]=r}return i}class fe{constructor(){this.tileDisplayData=null,this.tileBufferData=null}reshuffle(){ue.reset();const e=function(e){const t=[[],[],[],[],[]],i=e;for(const n of i)for(const e of n.displayRecords)t[e.geometryType].push(e);return t}(this.tileDisplayData.displayObjects);for(const n of e)for(const e of n)e&&ue.needMore(e.geometryType,e.meshData?e.meshData.vertexCount:e.vertexCount,e.meshData?e.meshData.indexData.length:e.indexCount);const t=e.length,i=new W;for(let n=0;n<t;++n){i.geometries[n].indexBuffer=new Uint32Array(Math.round(1.5*ue.indicesFor(n)));const e=[];for(const i in this.tileBufferData.geometries[n].vertexBuffer)e.push(this.tileBufferData.geometries[n].vertexBuffer[i].stride);const t=fe._computeVertexAlignment(e),r=Math.round(1.5*ue.verticesFor(n)),s=fe._align(r,t);for(const a in this.tileBufferData.geometries[n].vertexBuffer){const e=this.tileBufferData.geometries[n].vertexBuffer[a].stride;i.geometries[n].vertexBuffer[a]={stride:e,data:Object(A.b)(s,e)}}}he.reset(),this.tileDisplayData.displayList.clear();for(let n=0;n<t;++n){const t=e[n];for(const e of t){if(e.meshData)e.writeMeshDataToBuffers(he.verticesFor(n),i.geometries[n].vertexBuffer,he.indicesFor(n),i.geometries[n].indexBuffer),e.meshData=null;else{const t=this.tileBufferData.geometries[n].vertexBuffer,r=this.tileBufferData.geometries[n].indexBuffer,s=i.geometries[n].vertexBuffer,a=i.geometries[n].indexBuffer,o=he.verticesFor(n),l=he.indicesFor(n);Object(A.e)(o,l,s,a,e,t,r),e.vertexFrom=o,e.indexFrom=l}he.needMore(n,e.vertexCount,e.indexCount)}}for(const n of this.tileDisplayData.displayObjects)this.tileDisplayData.displayList.addToList(n.displayRecords);this.tileBufferData=i}getStrides(){const e=[];for(let t=0;t<this.tileBufferData.geometries.length;++t){const i=this.tileBufferData.geometries[t];e[t]={};for(const n in i.vertexBuffer)e[t][n]=i.vertexBuffer[n].stride}return e}clone(){const e=new fe;return e.tileBufferData=this.tileBufferData.clone(),e.tileDisplayData=this.tileDisplayData.clone(),e}_guessSize(){const{displayObjects:e}=this.tileDisplayData,t=Math.min(e.length,4);let i=0;for(let n=0;n<t;n++)i=Math.max(i,e[n].displayRecords.length);return 2*(12*e.length+e.length*i*40)}serialize(){const e=this.tileBufferData.serialize(),t=this.tileBufferData.getBuffers(),i=this.tileDisplayData.serialize(new oe.a(Int32Array,this._guessSize())).buffer();return t.push(i),{result:{displayData:i,bufferData:e},transferList:t}}static fromVertexData(e,t){const i={},n=new Map;for(const r of t)n.set(r.id,r);return Object(A.h)(t=>{const r=e.data[t];if(Object(l.j)(r)){const e=re.a.from(r.records).getCursor();for(;e.next();){const i=e.id,r=e.materialKey,s=e.indexFrom,a=e.indexCount,o=e.vertexFrom,l=e.vertexCount,c=n.get(i),u=new ee(i,t,r);u.indexFrom=s,u.indexCount=a,u.vertexFrom=o,u.vertexCount=l,c.displayRecords.push(u)}i[t]=ae.fromVertexData(r,t)}else i[t]=new ce(t,0,{fill:"default"}).intoBuffers()}),fe.fromMeshData({displayObjects:t,vertexBuffersMap:i})}static fromMeshData(e){const t=new fe,i=new ne,n=new W;i.displayObjects=e.displayObjects;for(const r in e.vertexBuffersMap){const t=e.vertexBuffersMap[r];n.geometries[r].indexBuffer=t.indexBuffer,n.geometries[r].vertexBuffer=t.namedBuffers}return t.tileDisplayData=i,t.tileBufferData=n,t}static bind(e,t){const i=new fe;return i.tileDisplayData=e,i.tileBufferData=t,i}static create(e,t){const i=new fe;i.tileDisplayData=new ne,i.tileDisplayData.displayObjects=e;const n=[0,0,0,0,0],r=[0,0,0,0,0],s=[[],[],[],[],[]];for(const l of e)for(const e of l.displayRecords)s[e.geometryType].push(e),n[e.geometryType]+=e.meshData.vertexCount,r[e.geometryType]+=e.meshData.indexData.length;const a=new W,o=function(e){return[e.fill||{},e.line||{},e.icon||{},e.text||{},e.label||{}]}(t);for(let l=0;l<5;l++){const e=new Uint32Array(r[l]),t=de(o[l],n[l]);ee.writeAllMeshDataToBuffers(s[l],t,e),a.geometries[l]={indexBuffer:e,vertexBuffer:t}}return i.tileBufferData=a,i}static _align(e,t){const i=e%t;return 0===i?e:e+(t-i)}static _computeVertexAlignment(e){let t=!1,i=!1;for(const n of e)n%4==2?t=!0:n%4!=0&&(i=!0);return i?4:t?2:1}}var me=i(702),pe=i(703),_e=i(676),ge=i(700),xe=i(704),ye=i(696),ve=i(706),be=i(340),Oe=i(662),Se=i(682);class Te extends Se.a{constructor(e,t){super(e,t,null)}static from(e){const t=Oe.a.createInstance(),i=[],n=e.filter(e=>!!e.geometry);for(const r of n){const e=Object(p.c)(r.geometry);Object(be.e)(i,[r],e,!1,!1,"uid")}return new Te(t,i)}get geometryType(){const e=this._current;return e?e.geometryType:null}get insertAfter(){return this._current.insertAfter}readGraphic(){return this._current}getCursor(){return this.copy()}copy(){const e=new Te(this.instance,this._features);return this.copyInto(e),e}}var we=i(21),je=i(387),Ie=i(283),Me=i(211),Ee=i(389),Ce=i(259),Re=i(109),De=i(647);const Pe=new Re.a,Ae=new Re.a,ze="esriGeometryPolyline";function Le(e){e.coords.length=0,e.lengths.length=0}class Fe{constructor(){this.bounds=Object(f.g)(),this.graphic=null}static acquire(e=null,t,i,n,r){let s;return 0===Fe._pool.length?s=new Fe:(s=Fe._pool.pop(),this._set.delete(s)),s.acquire(e,t,i,n,r),s}static release(e){e&&!this._set.has(e)&&(e.release(),this._pool.push(e),this._set.add(e))}static getCentroidQuantized(e,t){if(Object(p.g)(e.geometry)){const i=e.symbol;if(Object(l.i)(i))return null;if(Object(De.f)(i.type)||Object(De.g)(i.type)){const i=Object(Ee.b)(e.geometry);return Object(Ce.b)(t,{},{x:i[0],y:i[1]},!1,!1)}}return null}acquire(e=null,t,i,n,r){e&&this.set(e,t,i,n,r)}release(){this.graphic=null,this.symbolResource=null,this.geometry=null}get symbol(){return this.symbolResource.symbol}set(e,t,i,n,r){this.graphic=e,this.geometry=i,this.symbolResource=t,this.bounds=n,r&&(this.size=r)}getGeometryQuantized(e,t,i,n){const r=this.geometry;if(Object(p.g)(r)){const t=r.rings;if(1===t.length&&2===t[0].length)return Object(Ce.a)(e,{paths:[[t[0][0],t[0][1]]]})}else{if(Object(p.h)(r))return Le(Pe),Le(Ae),Object(be.h)(Pe,r),Object(be.q)(Ae,Pe,r.hasZ,r.hasM,ze,e.scale[0]),Object(be.u)(Pe,Ae,r.hasZ,r.hasM,ze,e),Object(be.o)(Pe,r.hasZ,r.hasM);if(Object(p.e)(r)){const s=.5*n*Math.max(Math.abs(this.size[0])+this.size[2]-this.size[0],Math.abs(this.size[1])+this.size[3]-this.size[1]),[a,o]=Object(x.c)(i),l=o-a,c=r.points.filter(e=>{if(e[0]+s>o||e[0]-s<a){const i=[...e];return e[0]+s>o?i[0]-=l:i[0]+=l,Object(f.e)(t,e,s)||Object(f.e)(t,i,s)}return Object(f.e)(t,e,s)});return 0===c.length?{points:c}:Object(Ce.a)(e,{points:c})}}return Object(Ce.a)(e,this.geometry)}}Fe._pool=[],Fe._set=new Set;const Ve={minX:0,minY:0,maxX:0,maxY:0},Ne=Object(f.g)();function Ue(e,t,i,n,r){return Ve.minX=t,Ve.minY=i,Ve.maxX=n,Ve.maxY=r,e.search(Ve)}function ke(e){return{minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}}class Be{constructor(e,t,i,n,r,s,a){this._graphics=n,this._onAdd=r,this._onRemove=s,this._hashToCIM=a,this._index=Object(je.a)(9,ke),this._itemByGraphic=new Map,this._inflatedSizeHelper=new M.a,this._tileInfoView=e,this._uidFieldName=i;const o=e.getClosestInfoForScale(t);o&&(this._resolution=this._tileInfoView.getTileResolution(o.level))}setResourceManager(e){this._cimResourceManager=e,this._hittestDrawHelper=new Me.c(e)}hitTest(e,t,i,n,r){e=Object(Ie.b)(e,this._tileInfoView.spatialReference);const s=.5*n*window.devicePixelRatio*i;Ne[0]=e-s,Ne[1]=t-s,Ne[2]=e+s,Ne[3]=t+s;const a=.5*n*(i+De.a),o=Ue(this._index,e-a,t-a,e+a,t+a);if(!o||0===o.length)return[];const l=[],c=Object(f.g)(),u=Object(f.g)();for(const m of o){const{geometry:e,symbolResource:t}=m;this._getSymbolBounds(c,t,e,u,r),u[3]=u[2]=u[1]=u[0]=0,Object(f.o)(c,Ne)&&m.graphic.visible&&l.push(m)}if(0===l.length)return[];const h=this._hittestDrawHelper,d=[];for(const f of l){const{geometry:e,symbolResource:t}=f,{hash:i,textInfo:s}=t,a=this._hashToCIM.get(i);a&&h.hitTest(Ne,a.symbol,e,s,r,n)&&d.push(f)}return d.sort(Ge),d.map(e=>e.graphic)}getGraphicsData(e,t,i){const n=this._searchForItems(t);if(0===n.length||0===i.length)return[];n.sort((e,t)=>e.zorder-t.zorder),n[0].insertAfter=-1;for(let u=1;u<n.length;u++)n[u].insertAfter=n[u-1].graphic.uid;n.sort((e,t)=>e.graphic.uid-t.graphic.uid),i.sort((e,t)=>e.uid-t.uid);let r,s=0,a=0;const o=t.resolution,l=[],c={originPosition:"upperLeft",scale:[o,o],translate:[t.bounds[0],t.bounds[3]]};for(const u of i){for(a=-2;s<n.length;)if(r=n[s],s++,u.uid===r.graphic.uid){a=r.insertAfter;break}if(!r.geometry||-2===a)continue;const i=r.getGeometryQuantized(c,t.bounds,this._tileInfoView.spatialReference,o),h={...r.graphic.attributes};h[this._uidFieldName]=u.uid,null==r.groupId&&(r.groupId=e.createTemplateGroup(r.symbol,null)),l.push({centroid:Fe.getCentroidQuantized(r,c),geometry:i,attributes:h,symbol:r.symbol,groupId:r.groupId,insertAfter:a,zorder:r.zorder})}return l.sort((e,t)=>e.zorder-t.zorder),l}queryTileData(e,t){if(0===this._graphics.length)return[];const{bounds:i,resolution:n}=t,r=this._searchForItems(t),s=[];return 0===r.length||this._createTileGraphics(s,e,r,{originPosition:"upperLeft",scale:[n,n],translate:[i[0],i[3]]},t),s}has(e){return this._itemByGraphic.has(e)}getBounds(e){const t=this._itemByGraphic.get(e);return t?t.bounds:null}getAllBounds(){return Array.from(this._itemByGraphic.values()).filter(e=>e.graphic.visible).map(e=>e.bounds)}addOrModify(e,t,i){if(!e||Object(l.i)(t))return;this.has(e)&&this.remove(e),this._onAdd(e);const n=[0,0,0,0],r=this._getSymbolBounds(null,t,i,n,0),s=Fe.acquire(e,t,i,Object(l.j)(r)?r:null,n);return this._itemByGraphic.set(e,s),i&&this._index.insert(s),s.bounds}remove(e){if(!this._itemByGraphic.has(e))return;this._onRemove(e);const t=this._itemByGraphic.get(e);t.bounds&&this._index.remove(t),this._itemByGraphic.delete(e)}updateZ(){const e=this._graphics.items;let t,i;for(let n=0;n<e.length;n++)i=e[n],t=this._itemByGraphic.get(i),t&&(t.zorder=n)}update(e,t,i){const n=this._itemByGraphic.get(e);n.groupId=null;const r=Object(f.c)(n.bounds);this._index.remove(n);const s=this._getSymbolBounds(n.bounds,t,i,n.size,0);return Object(l.j)(s)&&n.set(e,t,i,s,n.size),i&&this._index.insert(n),{oldBounds:r,newBounds:n.bounds}}updateLevel(e){if(this._resolution===e)return;this._resolution=e,this._index.clear();const t=this._itemByGraphic,i=[];for(const[n,r]of t){const e=this._getSymbolBounds(r.bounds,r.symbolResource,r.geometry,r.size,0);r.geometry&&Object(l.j)(e)&&(r.bounds=e,i.push(r))}this._index.load(i)}clear(){this._itemByGraphic.clear(),this._index.clear()}_createTileGraphics(e,t,i,n,r){const s=this._uidFieldName,a=this._tileInfoView.spatialReference,{bounds:o,resolution:l}=r;let c,u,h,d;i.sort((e,t)=>e.zorder-t.zorder);for(let f=0;f<i.length;f++){h=i[f],c=h.graphic,u=h.getGeometryQuantized(n,o,a,l),d=0===f?-1:i[f-1].graphic.uid;const r={...h.graphic.attributes};r[s]=c.uid,null==h.groupId&&(h.groupId=t.createTemplateGroup(h.symbol,null)),e.push({centroid:Fe.getCentroidQuantized(h,n),geometry:u,attributes:r,symbol:h.symbol,groupId:h.groupId,insertAfter:d,zorder:h.zorder})}}_searchForItems(e){const t=this._tileInfoView.spatialReference,i=e.bounds;if(t.isWrappable){const[n,r]=Object(x.c)(t),s=Math.abs(i[2]-r)<1e-5,a=Math.abs(i[0]-n)<1e-5;if((!s||!a)&&(s||a)){const t=e.resolution;let a;a=Object(f.g)(s?[n,i[1],n+t*De.a,i[3]]:[r-t*De.a,i[1],r,i[3]]);const o=Ue(this._index,i[0],i[1],i[2],i[3]),l=Ue(this._index,a[0],a[1],a[2],a[3]);return[...new Set([...o,...l])]}}return Ue(this._index,i[0],i[1],i[2],i[3])}_getSymbolBounds(e,t,i,n,r){if(!t||!t.symbol||!i)return null;if(e||(e=Object(f.g)()),Object(_.a)(e,i),!n||0===n[0]&&0===n[1]&&0===n[2]&&0===n[3]){const{hash:e,textInfo:i}=t,s=this._hashToCIM.get(e);if(!s)return null;n||(n=[0,0,0,0]);const a=this._inflatedSizeHelper.getSymbolInflateSize(n,s.symbol,this._cimResourceManager,r,i);n[0]=Object(we.c)(a[0]),n[1]=Object(we.c)(a[1]),n[2]=Object(we.c)(a[2]),n[3]=Object(we.c)(a[3])}const s=this._resolution,a=M.a.safeSize(n);return e[0]-=a*s,e[1]-=a*s,e[2]+=a*s,e[3]+=a*s,e}}const Ge=(e,t)=>{const i=Object(De.d)(e.graphic),n=Object(De.d)(t.graphic);return i===n?t.zorder-e.zorder:i-n};var We=i(644),He=i(284);const qe=e=>{let t=class extends(Object(He.a)(e)){constructor(){super(...arguments),this.graphics=null,this.renderer=null}};return Object(n.a)([Object(u.b)()],t.prototype,"graphics",void 0),Object(n.a)([Object(u.b)()],t.prototype,"renderer",void 0),Object(n.a)([Object(u.b)()],t.prototype,"updating",void 0),Object(n.a)([Object(u.b)()],t.prototype,"view",void 0),t=Object(n.a)([Object(h.a)("esri.views.layers.GraphicsView")],t),t};var Ze=i(341),Ye=i(636);const Ke=Object(o.a)("esri-2d-graphic-debug");function Xe(e,t,i){if(i.has(e))return i.get(e);const n={tile:t,addedOrModified:[],removed:[]};return i.set(e,n),n}let Je=class extends(qe(Object(a.b)(r.a))){constructor(e){super(e),this._storage=new ve.a,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(e,t,i){if(e){const n=Object(xe.a)({indexCount:0,fields:{}},"feature",e);this._matcher=Object(ge.a)(n,t,null,i)}}_createDisplayId(e){return this._displayIds.has(e)||this._displayIds.set(e,this._storage.createDisplayId()),this._displayIds.get(e)}initialize(){this._attributeStore=new ye.a({type:"local",initialize:e=>Promise.resolve(this.container.attributeView.initialize(e)),update:e=>this.container.attributeView.requestUpdate(e),render:()=>this.container.requestRender()},Object(Ze.a)()),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const e=new _e.a(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new Be(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,e=>{this._createDisplayId(e.uid),this._setFilterState(e.uid,e.visible)},e=>{const t=this._displayIds.get(e.uid);this._displayIds.delete(e.uid),this._storage.releaseDisplayId(t)},this._hashToCIM),this._meshFactory=new pe.a(null,this.uid,e),this._templateStore=e,this.handles.add([this.watch("renderer",t=>{this._createMatcher(t,e,this.container.stage.resourceManager);for(const e of this.graphics)this._pendingUpdate.updated.add(e);this.requestUpdate()}),this.view.graphicsTileStore.on("update",e=>this._onTileUpdate(e)),this.container.on("attach",()=>{Ke&&this.container.enableRenderingBounds(()=>this._graphicStore.getAllBounds()),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",e=>this._graphicsChangeHandler(e)),"graphics");const t=this.container.stage.resourceManager;this._createMatcher(this.renderer,e,t),this._graphicStore.setResourceManager(t),this._attached=!0,this.notifyChange("updating")})]);const t=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:t,removed:[]})}get updating(){return!this._attached||null!==this._updatingGraphicsTimer||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0}hitTest(e){if(!this.view||!this.view.position)return null;const{resolution:t,rotation:i}=this.view.state;return this._graphicStore.hitTest(e.x,e.y,2,t,i)}update(e){Object(c.t)(this._controller.signal);const t=e.state,{resolution:i}=t;if(this._graphicStore.updateLevel(i),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}graphicUpdateHandler(e){const{graphic:t,property:i,newValue:n}=e;switch(i){case"attributes":case"geometry":case"symbol":this._pendingUpdate.updated.add(t),this.requestUpdate();break;case"visible":this._setFilterState(t.uid,n),this._attributeStore.sendUpdates()}}setHighlight(e){const t=e.map(e=>this._displayIds.get(e));this._attributeStore.setHighlight(e,t)}_getIntersectingTiles(e){const t=this._graphicStore.getBounds(e);if(!t||0===Object(f.q)(t)||0===Object(f.n)(t))return[];const i=Object(De.e)(t,this.view.spatialReference);return Object(l.j)(i)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(i[0]),...this.view.graphicsTileStore.boundsIntersections(i[1])])]:this.view.graphicsTileStore.boundsIntersections(t)}async _updateTile(e){Object(c.t)(this._controller.signal);const t=e.tile,i=this._getGraphicsData(this._templateStore,t,e.addedOrModified),n=await this._processGraphics(t,i);return Object(c.t)(this._controller.signal),this._patchTile(t.key,{type:"update",addOrUpdate:n,remove:e.removed,end:!0,clear:!1,sort:!1}),n}_patchTile(e,t){if(!this._tiles.has(e))return;const i=this._tiles.get(e);this.container.onTileData(i,t),this.container.requestRender()}_graphicsChangeHandler(e){const t=this._pendingUpdate;for(const i of e.added)t.added.add(i);for(const i of e.moved)t.updated.add(i);for(const i of e.removed)this._pendingUpdate.added.has(i)?t.added.delete(i):t.removed.add(i);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const e={added:[],removed:[],updated:[]};if(!this.graphics)return e;const t=this._pendingUpdate;for(const i of this.graphics.items)t.added.has(i)?e.added.push(i):t.updated.has(i)&&e.updated.push(i);for(const i of t.removed)this._graphicStore.has(i)&&e.removed.push(i);return t.added.clear(),t.removed.clear(),t.updated.clear(),e}async _updateGraphics(){this._processing=!0;const{added:e,removed:t,updated:i}=this._getGraphicsToUpdate(),n=this._tilesToUpdate;let r;try{if(!this._graphicStoreUpdate){const e=this.view.state,{resolution:t}=e;this._graphicStore.updateLevel(t)}const s=[],a=new Array(e.length+t.length);for(let e=0;e<i.length;e++){const t=i[e],o=this._getIntersectingTiles(t);for(const e of o)r=e.id,Xe(r,e,n).removed.push(this._displayIds.get(t.uid));s.push(this._updateGraphic(t,null)),a[e]=t}const o=i.length;for(let t=0;t<e.length;t++){const i=e[t];a[o+t]=i,this._graphicsSet.add(i),s.push(this._addGraphic(i))}for(const e of t){this._abortProcessingGraphic(e.uid);const t=this._getIntersectingTiles(e);for(const i of t)r=i.id,Xe(r,i,n).removed.push(this._displayIds.get(e.uid));this._graphicsSet.delete(e),this._graphicStore.remove(e)}let l;this._flipUpdatingGraphics(),await Promise.all(s);for(let e=0;e<a.length;e++){l=a[e];const t=this._getIntersectingTiles(l);for(const e of t)r=e.id,Xe(r,e,n).addedOrModified.push(l)}this._graphicStore.updateZ();const c=[];for(const[e,t]of n)c.push(this._updateTile(t));await Promise.all(c)}catch(s){Object(c.l)(s)}for(const a of t)try{const e=await this._getSymbolForGraphic(a,{});if(e){const t=e.hash();this._hashToExpandedSymbol.delete(t)}}catch(s){Object(c.l)(s)}n.clear(),this.notifyChange("updating"),this._processing=!1,this._needsProcessing&&(this._needsProcessing=!1,this._updateGraphics())}_getArcadeInfo(e){const t=(e.attributes?Object.keys(e.attributes):[]).map(t=>({name:t,alias:t,type:"string"==typeof e.attributes[t]?"esriFieldTypeString":"esriFieldTypeDouble"}));return Object(l.i)(e.geometry)?null:{geometryType:Object(p.c)(e.geometry),spatialReference:d.a.fromJSON(e.geometry.spatialReference),fields:t}}_getSymbolForGraphic(e,t){return Object(c.t)(this._controller.signal),Object(l.j)(e.symbol)?Promise.resolve(e.symbol):Object(l.j)(this.renderer)?this.renderer.getSymbolAsync(e,{scale:this.view.scale,abortOptions:t}):Promise.resolve(this._getNullSymbol(e))}_getCIMSymbol(e,t,i){let n=this._hashToCIM.get(t);if(n)return Promise.resolve(n);const r=Object(M.f)(e);if(Object(l.j)(r)){if("CIMSymbolReference"===r.type)return n=r,this._hashToCIM.set(t,n),Promise.resolve(n);let e=this._hashToCIMSymbolPromise.get(t);return e||(e=r.fetchCIMSymbol(i).then(e=>(this._hashToCIM.set(t,e.data),this._hashToCIMSymbolPromise.delete(t),e)).catch(e=>(this._hashToCIMSymbolPromise.delete(t),Object(c.s)(e),null)),this._hashToCIMSymbolPromise.set(t,e),e)}return Promise.resolve(null)}_expandCIMSymbol(e,t,i,n){const r=this._hashToExpandedSymbol.get(i);if(r)return Promise.resolve(r);let s=this._hashToExpandedSymbolPromise.get(i);if(s)return s;const a=this.container.stage,o=this._getArcadeInfo(t),l=Object(xe.c)(null),c=Object(Ye.createSymbolSchema)(e,l);return s=Object(We.b)(c,o,a.resourceManager,n),this._hashToExpandedSymbolPromise.set(i,s),s.then(e=>(this._hashToExpandedSymbol.set(i,e),this._hashToExpandedSymbolPromise.delete(i),e)),s}async _getSymbolResources(e,t){return Object(c.t)(this._controller.signal),this.container.stage?this._getSymbolForGraphic(e,t).then(i=>{const n=i.hash();return this._getCIMSymbol(i,n,t).then(i=>Object(l.i)(i)?null:this._expandCIMSymbol(i,e,n,t).then(e=>{const t=e.layers.filter(e=>"text"===e.type&&"string"==typeof e.text);if(t&&t.length>0){const i=new Array(t.length);for(let e=0;e<t.length;e++){const n=t[e],r=[],[a]=Object(s.a)(n.text);for(let e=0;e<a.length;e++)r.push(a.charCodeAt(e));i[e]={symbol:n,id:e,glyphIds:r}}const r=new Map;return this.container.getMaterialItems(i).then(i=>{for(let e=0;e<t.length;e++){const n=t[e];r.set(n.cim,{text:n.text,mosaicItem:i[e].mosaicItem})}return{symbol:e,textInfo:r,hash:n}})}return{symbol:e,hash:n}}))}).catch(e=>(Object(c.s)(e),null)):null}async _projectAndNormalizeGeometry(e,t){if(Object(c.t)(this._controller.signal),Object(l.i)(e.geometry)||"mesh"===e.geometry.type)return null;let i=e.geometry;if(Object(p.g)(i)){const e=i.rings;i.rings=e}else if(Object(p.h)(i)){const e=i.paths;i.paths=e}else if(Object(p.d)(i)){const n=await this._getSymbolForGraphic(e,t);Object(c.t)(this._controller.signal),i=Object(De.f)(n.type)||Object(De.g)(n.type)?i.center:Object(De.h)(i)}await Object(I.a)(i.spatialReference,this.view.spatialReference);const n=v(i),r=Object(I.b)(n,i.spatialReference,this.view.spatialReference);return Object(m.a)(r),r}_onTileUpdate(e){const t=Object(y.e)(this.view.spatialReference);if(e.added&&e.added.length>0)for(const i of e.added)this._addNewTile(i,t);if(e.removed&&e.removed.length>0)for(const i of e.removed)this._removeTile(i.key)}async _addGraphic(e){this._abortProcessingGraphic(e.uid),Object(c.t)(this._controller.signal);const t=new AbortController;this._graphicIdToAbortController.set(e.uid,t);const i={signal:t.signal};try{await this._addOrUpdateGraphic(e,i),Object(c.t)(this._controller.signal),this._graphicIdToAbortController.delete(e.uid)}catch(n){if(this._graphicIdToAbortController.delete(e.uid),!Object(c.l)(n))throw n}}_updateGraphic(e,t){Object(c.t)(this._controller.signal);const i=this._projectAndNormalizeGeometry(e,t),n=this._getSymbolResources(e,t);return Promise.all([i,n]).then(([t,i])=>{Object(c.t)(this._controller.signal),this._graphicStore.addOrModify(e,i,t)})}_addOrUpdateGraphic(e,t){Object(c.t)(this._controller.signal);const i=this._projectAndNormalizeGeometry(e,t),n=this._getSymbolResources(e,t);return Promise.all([i,n]).then(([t,i])=>{Object(c.t)(this._controller.signal),this._graphicsSet.has(e)&&this._graphicStore.addOrModify(e,i,t)})}_addTile(e){const t=this.view.featuresTilingScheme.getTileBounds(Object(f.g)(),e),i=new B(e,t[0],t[3]);return this._tiles.set(e,i),this.container.addChild(i),i}async _addNewTile(e,t){const i=this._addTile(e.key),n=this._graphicStore.queryTileData(this._templateStore,e);if(0===n.length)return;if(t){const i=Math.round((t.valid[1]-t.valid[0])/e.resolution);for(const e of n)e.geometry&&(Object(p.f)(e.geometry)||Object(p.e)(e.geometry))&&this._wrapPoints(e,i)}const r=e.key;this._tileUpdateSet.add(e.key),this.notifyChange("updating");try{const t={type:"update",clear:!1,addOrUpdate:await this._processGraphics(e,n),remove:[],end:!0,sort:!1};i.patch(t),this._tileUpdateSet.delete(r),this.notifyChange("updating")}catch(s){if(this._tileUpdateSet.delete(r),this.notifyChange("updating"),!Object(c.l)(s))throw s}}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_setFilterState(e,t){const i=this._displayIds.get(e),n=this._attributeStore.getHighlightFlag(e);this._attributeStore.setData(i,0,0,n|(t?C.q:0))}_getGraphicsData(e,t,i){const n=this.view,r=Object(y.e)(n.spatialReference),s=this._graphicStore.getGraphicsData(e,t,i);if(r){const e=Math.round((r.valid[1]-r.valid[0])/t.resolution);for(const t of s)t.geometry&&(Object(p.f)(t.geometry)||Object(p.e)(t.geometry))&&this._wrapPoints(t,e)}return s}_wrapPoints(e,t){const i=e.geometry;Object(p.e)(i)?this._wrapMultipoint(i,t):this._wrapPoint(e,t)}_wrapMultipoint(e,t){const i=e.points,n=[];let r=0,s=0;for(const[a,o]of i){if(n.push([a+r,o]),r=0,t===De.b){const e=5*De.a;a+s<e?(n.push([t,0]),r=-t):a+s>De.b-e&&(n.push([-t,0]),r=t)}else a+s<-De.a?(n.push([t,0]),r=-t):a+s>De.b+De.a&&(n.push([-t,0]),r=t);s+=a}e.points=n}_wrapPoint(e,t){const i=e.geometry;if(t===De.b){const n=5*De.a;i.x<n?e.geometry={points:[[i.x,i.y],[t,0]]}:i.x>De.b-n&&(e.geometry={points:[[i.x,i.y],[-t,0]]})}else i.x<-De.a?e.geometry={points:[[i.x,i.y],[t,0]]}:i.x>De.b+De.a&&(e.geometry={points:[[i.x,i.y],[-t,0]]})}_processGraphics(e,t,i){if(!t||!t.length||!this._meshFactory)return null;const n=Te.from(t),r=this._meshFactory;return this._matcher.then(t=>r.analyzeGraphics(n,this.container.stage.resourceManager,t,null,null,i).then(()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(e,n))))}_processAnalyzedGraphics(e,t){const i=this._meshFactory,n=t.getSize(),r=t.getCursor(),s={features:n,records:n,metrics:0},a=new me.a(e.key.id,s,{fill:"default"},!1,!1),o=[];for(;r.next();){const t=r.readGraphic();t.insertAfter=-1===t.insertAfter?-1:this._displayIds.get(t.insertAfter),t.displayId=this._displayIds.get(t.attributes[this.uid]);const n=new ie(t.displayId);n.insertAfter=t.insertAfter,o.push(n),i.writeGraphic(a,r,e.level,this.container.stage.resourceManager)}const l=e.tileInfoView.tileInfo.isWrappable,c=a.serialize(l);if(1!==c.length)return new fe;const u=c[0].message;return fe.fromVertexData(u,o)}_abortProcessingGraphic(e){this._graphicIdToAbortController.has(e)&&this._graphicIdToAbortController.get(e).abort()}_getNullSymbol(e){const t=e.geometry;return Object(p.h)(t)?E.d:Object(p.g)(t)||Object(p.d)(t)?E.c:E.b}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};Object(n.a)([Object(u.b)({constructOnly:!0})],Je.prototype,"requestUpdateCallback",void 0),Object(n.a)([Object(u.b)()],Je.prototype,"container",void 0),Object(n.a)([Object(u.b)({constructOnly:!0})],Je.prototype,"graphics",void 0),Object(n.a)([Object(u.b)()],Je.prototype,"updating",null),Object(n.a)([Object(u.b)()],Je.prototype,"view",void 0),Object(n.a)([Object(u.b)()],Je.prototype,"updateRequested",void 0),Je=Object(n.a)([Object(h.a)("esri.views.2d.layers.support.GraphicsView2D")],Je);const $e=Je},713:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var n=i(0),r=i(11),s=i(12),a=i(31),o=i(1),l=(i(9),i(5),i(4),i(3));const c=e=>{let t=class extends e{initialize(){this.handles.add(Object(a.b)(()=>this.layer,"refresh",e=>{this.doRefresh(e.dataChanged).catch(e=>{Object(s.l)(e)||r.a.getLogger(this.declaredClass).error(e)})}),"RefreshableLayerView")}};return Object(n.a)([Object(o.b)()],t.prototype,"layer",void 0),t=Object(n.a)([Object(l.a)("esri.layers.mixins.RefreshableLayerView")],t),t}},714:function(e,t,i){"use strict";i.d(t,"a",(function(){return g}));var n=i(705),r=i(208),s=i(281),a=i(175),o=i(684),l=i(283),c=i(628),u=i(616),h=i(619),d=i(614),f=i(620);const m=Math.PI/180;class p extends c.a{constructor(e){super(),this._dvsMat3=Object(s.b)(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program&&(this._program.dispose(),this._program=null)}doRender(e){const{context:t}=e,i=this._getBounds();if(i.length<1)return;this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(t,i),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(d.b.ONE,d.b.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const n=this._program;t.bindVAO(this._vao),t.useProgram(n),n.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(d.r.LINES,8*i.length,d.k.UNSIGNED_INT,0),t.bindVAO()}_createTransforms(){return{dvs:Object(s.b)()}}_createShaderProgram(e){if(this._program)return;this._program=e.programCache.acquire("precision highp float;\n        uniform mat3 u_dvsMat3;\n\n        attribute vec2 a_position;\n\n        void main() {\n          mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n          gl_Position = vec4(pos.xy, 0.0, 1.0);\n        }","precision mediump float;\n      void main() {\n        gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n      }",_().attributes)}_updateMatricesAndLocalOrigin(e){const{state:t}=e,{displayMat3:i,size:n,resolution:s,pixelRatio:c,rotation:u,viewpoint:h}=t,d=m*u,{x:f,y:p}=h.targetGeometry,_=Object(l.b)(f,t.spatialReference);this._localOrigin.x=_,this._localOrigin.y=p;const g=c*n[0],x=c*n[1],y=s*g,v=s*x,b=Object(r.b)(this._dvsMat3);Object(r.i)(b,b,i),Object(r.c)(b,b,Object(a.b)(g/2,x/2)),Object(r.d)(b,b,Object(o.b)(n[0]/y,-x/v,1)),Object(r.k)(b,b,-d)}_updateBufferData(e,t){const{x:i,y:n}=this._localOrigin,r=8*t.length,s=new Float32Array(r),a=new Uint32Array(8*t.length);let o=0,l=0;for(const c of t)c&&(s[2*o+0]=c[0]-i,s[2*o+1]=c[1]-n,s[2*o+2]=c[0]-i,s[2*o+3]=c[3]-n,s[2*o+4]=c[2]-i,s[2*o+5]=c[3]-n,s[2*o+6]=c[2]-i,s[2*o+7]=c[1]-n,a[l+0]=o+0,a[l+1]=o+3,a[l+2]=o+3,a[l+3]=o+2,a[l+4]=o+2,a[l+5]=o+1,a[l+6]=o+1,a[l+7]=o+0,o+=4,l+=8);if(this._vertexBuffer?this._vertexBuffer.setData(s.buffer):this._vertexBuffer=h.a.createVertex(e,d.D.DYNAMIC_DRAW,s.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=h.a.createIndex(e,d.D.DYNAMIC_DRAW,a),!this._vao){const t=_();this._vao=new f.a(e,t.attributes,t.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}}const _=()=>Object(u.g)("bounds",{geometry:[{location:0,name:"a_position",count:2,type:d.k.FLOAT}]});class g extends n.a{constructor(e){super(e),this.hasHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer&&(this._boundsRenderer.destroy(),this._boundsRenderer=null)}enableRenderingBounds(e){this._boundsRenderer=new p(e),this.requestRender()}get hasLabels(){return!1}onTileData(e,t){e.patch(t),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){e.clear(),this.contains(e)||this.addChild(e)}_renderChildren(e,t){for(const i of this.children)i.isReady&&i.hasData&&(i.commit(e),e.context.setStencilFunction(d.h.EQUAL,i.stencilRef,255),i._displayList.replay(e,i,t))}}},722:function(e,t,i){"use strict";i.d(t,"a",(function(){return m})),i.d(t,"b",(function(){return p})),i.d(t,"c",(function(){return _})),i.d(t,"d",(function(){return M})),i.d(t,"e",(function(){return I})),i.d(t,"f",(function(){return u})),i.d(t,"g",(function(){return E})),i.d(t,"h",(function(){return g})),i.d(t,"i",(function(){return c})),i.d(t,"j",(function(){return d}));var n=i(23),r=i(2),s=i(721),a=i(659);const o=new Map;o.set("meter-per-second",1),o.set("kilometer-per-hour",.277778),o.set("knots",.514444),o.set("feet-per-second",.3048),o.set("mile-per-hour",.44704);const l=180/Math.PI,c=new n.a({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function u(e,t){return o.get(e)/o.get(t)||1}function h(e){return(450-e)%360}function d(e,t="geographic"){const[i,n]=e,r=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i)*l;return s=(360+s)%360,"geographic"===t&&(s=h(s)),[r,s]}function f(e,t="geographic"){let i=e[1];"geographic"===t&&(i=h(i)),i%=360;const n=e[0];return[n*Math.cos(i/l),n*Math.sin(i/l)]}function m(e,t,i,n="geographic"){if(!Object(a.j)(e)||Object(r.i)(i))return e;const s="vector-magdir"===t?e.clone():Object(r.q)(p(e,t)),o=s.pixels[1];for(let r=0;r<o.length;r++)o[r]="geographic"===n?(o[r]+i[r]+270)%360:(o[r]+360-i[r])%360;return"vector-magdir"===t?s:p(s,"vector-magdir")}function p(e,t,i="geographic",n=1){if(!Object(a.j)(e))return e;const{pixels:r,width:o,height:l}=e,c=o*l,u=r[0],h=r[1],m=e.pixelType.startsWith("f")?e.pixelType:"f32",p=s.a.createEmptyBand(m,c),_=s.a.createEmptyBand(m,c);let g=0;for(let s=0;s<l;s++)for(let e=0;e<o;e++)"vector-uv"===t?([p[g],_[g]]=d([u[g],h[g]],i),p[g]*=n):([p[g],_[g]]=f([u[g],h[g]],i),p[g]*=n,_[g]*=n),g++;const x=new s.a({pixelType:m,width:e.width,height:e.height,mask:e.mask,validPixelCount:e.validPixelCount,maskIsAlpha:e.maskIsAlpha,pixels:[p,_]});return x.updateStatistics(),x}function _(e,t,i=1){if(1===i||!Object(a.j)(e))return e;const n=e.clone(),{pixels:r,width:s,height:o}=n,l=r[0],c=r[1];let u=0;for(let a=0;a<o;a++)for(let e=0;e<s;e++)"vector-uv"===t?(l[u]*=i,c[u]*=i):l[u]*=i,u++;return n.updateStatistics(),n}function g(e,t,i,n,s){if(!Object(r.j)(s)||!s.spatialReference.equals(e.spatialReference))return{extent:e,width:Math.round(t/n),height:Math.round(i/n),resolution:e.width/t};const a=s.xmin,o=s.ymax,l=(e.xmax-e.xmin)/t*n,c=(e.ymax-e.ymin)/i*n,u=(l+c)/2;return e.xmin=a+Math.floor((e.xmin-a)/l)*l,e.xmax=a+Math.ceil((e.xmax-a)/l)*l,e.ymin=o+Math.floor((e.ymin-o)/c)*c,e.ymax=o+Math.ceil((e.ymax-o)/c)*c,{extent:e,width:Math.round(e.width/l),height:Math.round(e.height/c),resolution:u}}const x=function(e=0,t=0,i=Math.PI,n=!0){n&&(i=(2*Math.PI-i)%(2*Math.PI));const r=n?-1:1,s=13*r,a=-7*r,o=-2*r,l=-16*r,c=21.75,[u,h]=v(0,t+s,i,c),[d,f]=v(e-5.5,t+a,i,c),[m,p]=v(e+5.5,t+a,i,c),[_,g]=v(e-1.5,t+o,i,c),[x,y]=v(e+1.5,t+o,i,c),[b,O]=v(e-1.5,t+l,i,c),[S,T]=v(e+1.5,t+l,i,c);return[u,h,d,f,_,g,x,y,m,p,b,O,S,T]}(0,0,0);function y(e=0,t=Math.PI,i=!0){i&&(t=(2*Math.PI-t)%(2*Math.PI));const n=i?-1:1,r=5*n,s=20*n,a=25*n,o=45,l=2*n;let[c,u]=[5,0-s],[h,d]=[c+2,u],[f,m]=[h-0,d+l],[p,_]=[-5,0-a],[g,x]=[p+0,_-l],y=Math.ceil(e/5),b=Math.floor(y/10);y-=8*b;const O=[],S=[];for(let D=0;D<y/2;D++,b--){b<=0&&y%2==1&&D===(y-1)/2&&(p=0,g=p+0,_=(_+u)/2,x=_-l);const[e,i]=v(p,_,t,o);if(b>0){const[n,r]=v(h,_,t,o),[s,a]=v(c,u,t,o);O.push(n),O.push(r),O.push(e),O.push(i),O.push(s),O.push(a)}else{const[n,r]=v(h,d,t,o),[s,a]=v(f,m,t,o),[l,c]=v(g,x,t,o);S.push(e),S.push(i),S.push(l),S.push(c),S.push(s),S.push(a),S.push(n),S.push(r)}_+=r,u+=r,d+=r,m+=r,x+=r}const[T,w]=v(5,0+s,t,o),[j,I]=v(7,0+s,t,o),[M,E]=v(5,0-a,t,o),[C,R]=v(7,0-a,t,o);return{pennants:O,barbs:S,shaft:[T,w,j,I,M,E,C,R]}}function v(e,t,i,n=1){const r=Math.sqrt(e*e+t*t)/n,s=(2*Math.PI+Math.atan2(t,e))%(2*Math.PI);return[r,(2*Math.PI+s-i)%(2*Math.PI)]}const b=[0,1,3,6,10,16,21,27,33,40,47,55,63],O=[0,.5,1,1.5,2],S=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function T(e,t,i,n){const r=u(n||"knots",i);let s;for(s=1;s<t.length;s++)if(s===t.length-1){if(e<t[s]*r)break}else if(e<=t[s]*r)break;return Math.min(s-1,t.length-2)}function w(e,t,i,n,r){let s=0;switch(t){case"beaufort_kn":s=T(e,b,"knots",i);break;case"beaufort_km":s=T(e,b,"kilometer-per-hour",i);break;case"beaufort_ft":s=T(e,b,"feet-per-second",i);break;case"beaufort_m":s=T(e,b,"meter-per-second",i);break;case"classified_arrow":s=T(e,r,n,i);break;case"ocean_current_m":s=T(e,O,"meter-per-second",i);break;case"ocean_current_kn":s=T(e,S,"knots",i)}return s}const j=[];function I(e,t){let i=0,n=0;const{width:r,height:s,mask:a}=e,o=e.pixels[0],l=[],h=[],d=u(c.fromJSON(t.inputUnit),"knots"),f="wind_speed"===t.style?5:Number.MAX_VALUE;for(let c=0;c<s;c++)for(let e=0;e<r;e++){const t=o[c*r+e]*d;if((!a||a[c*r+e])&&t<f){for(let n=0;n<4;n++)l[i++]=(e+.5)/r,l[i++]=(c+.5)/s,l[i++]=n<2?-.5:.5,l[i++]=n%2==0?-.5:.5,l[i++]=0,l[i++]=t;const a=4*(i/24-1);h[n++]=a,h[n++]=a+1,h[n++]=a+2,h[n++]=a+1,h[n++]=a+2,h[n++]=a+3}}return{vertexData:new Float32Array(l),indexData:new Uint32Array(h)}}function M(e,t){return"simple_scalar"===t.style?I(e,t):"wind_speed"===t.style?function(e,t){if(0===j.length)for(let c=0;c<30;c++)j.push(y(5*c,0));const i=u(c.fromJSON(t.inputUnit),"knots"),{width:n,height:r,mask:s}=e,a=e.pixels[0],o=e.pixels[1],l=[],h=[];let d=0,f=0;for(let c=0;c<r;c++)for(let e=0;e<n;e++){const t=c*n+e,u=a[t]*i;if((!s||s[c*n+e])&&u>=5){var m;const i=null!=(m=(o[t]+360)%360/180*Math.PI)?m:2*Math.PI*Math.random(),{pennants:s,barbs:a,shaft:p}=j[Math.min(Math.floor(u/5),29)];if(s.length+a.length===0)continue;let _=l.length/6;const g=(e+.5)/n,x=(c+.5)/r;for(let e=0;e<s.length;e+=2)l[d++]=g,l[d++]=x,l[d++]=s[e],l[d++]=s[e+1]+i,l[d++]=0,l[d++]=u;for(let e=0;e<a.length;e+=2)l[d++]=g,l[d++]=x,l[d++]=a[e],l[d++]=a[e+1]+i,l[d++]=0,l[d++]=u;for(let e=0;e<p.length;e+=2)l[d++]=g,l[d++]=x,l[d++]=p[e],l[d++]=p[e+1]+i,l[d++]=0,l[d++]=u;for(let e=0;e<s.length/6;e++)h[f++]=_,h[f++]=_+1,h[f++]=_+2,_+=3;for(let e=0;e<a.length/8;e++)h[f++]=_,h[f++]=_+1,h[f++]=_+2,h[f++]=_+1,h[f++]=_+2,h[f++]=_+3,_+=4;h[f++]=_+0,h[f++]=_+1,h[f++]=_+2,h[f++]=_+1,h[f++]=_+3,h[f++]=_+2,_+=4}}return{vertexData:new Float32Array(l),indexData:new Uint32Array(h)}}(e,t):function(e,t){const{style:i,inputUnit:n,outputUnit:r,breakValues:s}=t,a=c.fromJSON(n),o=c.fromJSON(r);let l=0,u=0;const{width:h,height:d,mask:f}=e,m=e.pixels[0],p=e.pixels[1],_=f?f.filter(e=>e>0).length:h*d,g=new Float32Array(42*_),y=new Uint32Array(15*_);for(let c=0;c<d;c++)for(let e=0;e<h;e++){const t=c*h+e;if(!f||f[c*h+e]){var v;const n=null!=(v=(p[t]+360)%360/180*Math.PI)?v:2*Math.PI*Math.random(),r=w(m[t],i,a,o,s);for(let i=0;i<x.length;i+=2)g[l++]=(e+.5)/h,g[l++]=(c+.5)/d,g[l++]=x[i],g[l++]=x[i+1]+n,g[l++]=r,g[l++]=m[t];const f=7*(l/42-1);y[u++]=f,y[u++]=f+1,y[u++]=f+2,y[u++]=f+0,y[u++]=f+4,y[u++]=f+3,y[u++]=f+0,y[u++]=f+2,y[u++]=f+3,y[u++]=f+2,y[u++]=f+5,y[u++]=f+3,y[u++]=f+5,y[u++]=f+6,y[u++]=f+3}}return{vertexData:g,indexData:y}}(e,t)}function E(e,t,i,n=[0,0],r=.5){const{width:a,height:o,mask:l}=e,[c,u]=e.pixels,[h,m]=n,p=Math.round((a-h)/i),_=Math.round((o-m)/i),g=p*_,x=new Float32Array(g),y=new Float32Array(g),v=new Uint8Array(g),b="vector-uv"===t;for(let s=0;s<_;s++)for(let e=0;e<p;e++){let t=0;const n=s*p+e,_=Math.max(0,s*i+m),g=Math.max(0,e*i+h),O=Math.min(o,_+i),S=Math.min(a,g+i);for(let e=_;e<O;e++)for(let i=g;i<S;i++){const r=e*a+i;if(!l||l[r]){t++;const e=b?[c[r],u[r]]:[c[r],(360+u[r])%360],[i,s]=b?e:f(e);x[n]+=i,y[n]+=s}}if(t>=(O-_)*(S-g)*(1-r)){v[n]=1;const[e,i]=d([x[n]/t,y[n]/t]);x[n]=e,y[n]=i}else v[n]=0,x[n]=0,y[n]=0}const O=new s.a({width:p,height:_,pixels:[x,y],mask:v});return O.updateStatistics(),O}},724:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i(646),r=i(615),s=i(648);class a extends s.a{get requiresDedicatedFBO(){return this.children.some(e=>"additive"===e.blendFunction)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap",brushes:[n.a.bitmap],target:()=>this.children,drawPhase:r.c.MAP});return[...super.prepareRenderPasses(e),t]}}},735:function(e,t,i){"use strict";i.d(t,"a",(function(){return U})),i.d(t,"b",(function(){return x})),i.d(t,"c",(function(){return z})),i.d(t,"d",(function(){return A})),i.d(t,"e",(function(){return C})),i.d(t,"f",(function(){return P})),i.d(t,"g",(function(){return g})),i.d(t,"h",(function(){return M})),i.d(t,"i",(function(){return b})),i.d(t,"j",(function(){return y})),i.d(t,"k",(function(){return h})),i.d(t,"l",(function(){return V})),i.d(t,"m",(function(){return N}));i(64);var n=i(8),r=i(2),s=i(37),a=i(299),o=i(77),l=i(35),c=i(28),u=i(30);function h(e,t,i){return!Object(o.a)(e,t,i)}function d(e,t,i){const r=h(e,t,i);if(r&&!Object(o.e)())throw new n.a("rasterprojectionhelper-project","projection engine is not loaded");return r}const f=function(e,t,i,n=0){if(1===i[0])return[0,0];let r=1,s=-1,a=1,o=-1;for(let _=0;_<e.length;_+=2)isNaN(e[_])||(r=r>e[_]?e[_]:r,s=s>e[_]?s:e[_],a=a>e[_+1]?e[_+1]:a,o=o>e[_+1]?o:e[_+1]);const{cols:l,rows:c}=t,u=(s-r)/l/i[0],h=(o-a)/c/i[1],d=2*n;let f=0,m=!1,p=[0,0];for(let _=0;_<l-3;_++){for(let t=0;t<c-3;t++){const i=_*c*2+2*t,n=(e[i]+e[i+4]+e[i+4*c]+e[i+4*c+4])/4,r=(e[i+1]+e[i+5]+e[i+4*c+1]+e[i+4*c+5])/4,s=Math.abs((n-e[i+2*c+2])/u),a=Math.abs((r-e[i+2*c+3])/h);if(s+a>f&&(f=s+a,p=[s,a]),d&&f>d){m=!0;break}}if(m)break}return p},m={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},p=new Map,_=new Map;async function g(){if(Object(o.e)())return null;await Object(o.f)()}function x(e,t,i){return d(e.spatialReference,t)?i?Object(o.c)(t,e.spatialReference,e):Object(o.c)(e.spatialReference,t,e):null}function y(e,t,i,n=null){const a=e.spatialReference;if(a.equals(t))return e;d(a,t,n);const c=i.center,u=new l.a({xmin:c.x-e.x/2,xmax:c.x+e.x/2,ymin:c.y-e.y/2,ymax:c.y+e.y/2,spatialReference:a}),h=Object(o.g)(u,t,n);if(Object(r.i)(h))return null;const f={x:h.xmax-h.xmin,y:h.ymax-h.ymin},m=C(t);if(Object(r.j)(m)&&f.x>=m){const i=Object(s.d)(a)/Object(s.d)(t);f.x=e.x*i,f.y=e.y*i}return f}function v(e,t=.01){return Object(s.d)(e)?t/Object(s.d)(e):0}function b(e,t,i=null,n=!0){const s=e.spatialReference;if(s.equals(t))return e;d(s,t,i);const a=Object(o.g)(e,t,i);if(!n||!a)return a;const l=R(s,!0),c=R(t,!0),u=v(s);return u&&Object(r.j)(l)&&Object(r.j)(c)&&(a.x>0&&Math.abs(e.x-l[0])<u?a.x-=c[1]-c[0]:a.x<0&&Math.abs(e.x-l[1])<u&&(a.x+=c[1]-c[0])),a}function O(e){const{inSR:t,outSR:i,datumTransformation:n,preferPE:s}=e;if(t.equals(i)){const{points:t}=j(e,null);return t}if(t.isWebMercator&&i.isWGS84||t.isWGS84&&i.isWebMercator)return function(e){const{cols:t,rows:i,xres:n,yres:r,usePixelCenter:s,inSR:a,outSR:l}=e;let{xmin:u,ymax:h}=e;s&&(u+=n/2,h-=r/2);const d=[],f=[],m=Math.max(t,i);for(let _=0;_<m;_++){const e=u+n*Math.min(t,_),s=h-r*Math.min(i,_),m=Object(o.g)(new c.a({x:e,y:s,spatialReference:a}),l);_<=t&&d.push(m.x),_<=i&&f.push(m.y)}const p=[];for(let o=0;o<t;o++)for(let e=0;e<i;e++)p.push([d[o],f[e]]);return p}(e);if(d(t,i,n)&&s){if(t.isGeographic)return S(e);const i=T(t);if(Object(r.j)(i))return S(e)}return function(e){const{points:t}=j(e,null),i=t.map(t=>new c.a(t[0],t[1],e.inSR));return Object(o.g)(i,e.outSR,e.datumTransformation).map(e=>e?[e.x,e.y]:[NaN,NaN])}(e)}function S(e){const{inSR:t,outSR:i,datumTransformation:n}=e,s=T(t),{points:o,mask:l}=j(e,s);if(!t.isGeographic){const e=t.wkid?a.a.coordsys(t.wkid):a.a.fromString(t.isGeographic?a.b.PE_TYPE_GEOGCS:a.b.PE_TYPE_PROJCS,t.wkt);a.c.projToGeog(e,o.length,o)}if(Object(r.j)(n)&&n.steps.length&&n.steps.forEach(e=>{const t=e.wkid?a.a.geogtran(e.wkid):a.a.fromString(a.b.PE_TYPE_GEOGTRAN,e.wkt);a.d.geogToGeog(t,o.length,o,null,e.isInverse?a.b.PE_TRANSFORM_2_TO_1:a.b.PE_TRANSFORM_1_TO_2)}),!i.isGeographic){const e=T(i,!0),t=Object(r.j)(e)&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];!function(e,t){const[i,n]=t;for(let r=0;r<e.length;r++){const t=e[r][1];(t<i||t>n)&&(e[r]=[NaN,NaN])}}(o,t);const n=i.wkid?a.a.coordsys(i.wkid):a.a.fromString(i.isGeographic?a.b.PE_TYPE_GEOGCS:a.b.PE_TYPE_PROJCS,i.wkt);a.c.geogToProj(n,o.length,o)}let c=o;if(l&&o.length!==l.length){c=[];for(let e=0,t=0;e<l.length;e++)l[e]?c.push(o[t++]):c.push([NaN,NaN])}return c}function T(e,t=!1){let i=e.wkid||e.wkt;if(!i||e.isGeographic)return null;if(i=String(i),p.has(i)){const e=p.get(i);return t?null==e?void 0:e.gcs:null==e?void 0:e.pcs}const n=e.wkid?a.a.coordsys(e.wkid):a.a.fromString(e.isGeographic?a.b.PE_TYPE_GEOGCS:a.b.PE_TYPE_PROJCS,e.wkt),r=w(n,v(e,1e-4)),s=w(n,0,!0);return p.set(i,{pcs:r,gcs:s}),t?s:r}function w(e,t=0,i=!1){const n=a.f.generate(e),r=i?e.horizonGcsGenerate():e.horizonPcsGenerate();if(null==r||!r.length)return null;let s=!1,o=r.find(e=>1===e.getInclusive()&&1===e.getKind());if(!o){if(o=r.find(e=>1===e.getInclusive()&&0===e.getKind()),!o)return null;s=!0}const l=n.isPannableRectangle(),c=o.getCoord();if(s)return{isEnvelope:s,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-t,c[0][1]-t,c[1][0]+t,c[1][1]+t]};let u=0;const h=[];let[d,f]=c[0],[m,p]=c[0];for(let a=0,_=c.length;a<_;a++){u++,u===_&&(u=0);const[e,t]=c[a],[i,n]=c[u];if(n===t)h.push([e,i,t,n,2]);else{const r=(i-e)/(n-t||1e-4),s=e-r*t;t<n?h.push([r,s,t,n,0]):h.push([r,s,n,t,1])}d=d<e?d:e,f=f<t?f:t,m=m>e?m:e,p=p>t?p:t}return{isEnvelope:!1,isPannable:l,vertices:c,coef:h,bbox:[d,f,m,p]}}function j(e,t){const i=[],{cols:n,rows:s,xres:a,yres:o,usePixelCenter:l}=e;let{xmin:c,ymax:u}=e;if(l&&(c+=a/2,u-=o/2),!Object(r.j)(t)){for(let e=0;e<n;e++)for(let t=0;t<s;t++)i.push([c+a*e,u-o*t]);return{points:i}}const h=new Uint8Array(n*s);if(t.isEnvelope){const{bbox:[e,r,l,d]}=t;for(let f=0,m=0;f<n;f++){const n=c+a*f,p=t.isPannable||n>=e&&n<=l;for(let e=0;e<s;e++,m++){const t=u-o*e;p&&t>=r&&t<=d&&(i.push([n,t]),h[m]=1)}}return{points:i,mask:h}}const{coef:d}=t,f=[];for(let r=0;r<s;r++){const e=u-o*r,t=[],i=[];for(let r=0;r<d.length;r++){const[n,s,a,o,l]=d[r];if(e===a&&a===o)t.push(n),t.push(s),i.push(2),i.push(2);else if(e>=a&&e<=o){const r=n*e+s;t.push(r),i.push(l)}}let n=t;if(t.length>2){let e=2===i[0]?0:i[0],r=t[0];n=[];for(let s=1;s<i.length;s++)2===i[s]&&s!==i.length-1||(i[s]!==e&&(n.push(0===e?Math.min(r,t[s-1]):Math.max(r,t[s-1])),e=i[s],r=t[s]),s===i.length-1&&n.push(0===i[s]?Math.min(r,t[s]):Math.max(r,t[s])));n.sort((e,t)=>e-t)}else t[0]>t[1]&&(n=[t[1],t[0]]);f.push(n)}for(let r=0,m=0;r<n;r++){const e=c+a*r;for(let t=0;t<s;t++,m++){const n=u-o*t,r=f[t];if(2===r.length)e>=r[0]&&e<=r[1]&&(i.push([e,n]),h[m]=1);else if(r.length>2){let t=!1;for(let i=0;i<r.length;i+=2)if(e>=r[i]&&e<=r[i+1]){t=!0;break}t&&(i.push([e,n]),h[m]=1)}}}return{points:i,mask:h}}function I(e){const t=C(e[0].spatialReference);if(e.length<2||!Object(r.j)(t))return e[0];let{xmin:i,xmax:n,ymin:s,ymax:a}=e[0];for(let r=1;r<e.length;r++){const i=e[r];n=i.xmax+t*r,s=Math.min(s,i.ymin),a=Math.max(a,i.ymax)}return new l.a({xmin:i,xmax:n,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function M(e,t,i=null,n=!0){if(e.spatialReference.equals(t))return e;const s=P(e),a=C(e.spatialReference,!0),o=C(t);if(0===s||Object(r.i)(a)||Object(r.i)(o))return E(e,t,i,n);const c=e.clone().normalize();if(1===c.length&&e.xmax<a&&e.xmax-a/2>v(e.spatialReference)){const{xmin:t,xmax:i}=e;for(let n=0;n<=s;n++){const r=0===n?t:-a/2,o=n===s?i-a*n:a/2;c[n]=new l.a({xmin:r,xmax:o,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference})}}return I(c.map(e=>E(e,t,i,n)).filter(e=>!!e))}function E(e,t,i=null,n=!0,s=!0){const a=e.spatialReference;if(a.equals(t))return e;d(a,t,i);const l=Object(o.g)(e,t,i);if(s&&t.isWebMercator&&l&&(l.ymax=Math.min(20037508.342787,l.ymax),l.ymin=Math.max(-20037508.342787,l.ymin),l.ymin>=l.ymax))return null;if(!n||!l)return l;const u=R(a,!0),h=R(t,!0);if(Object(r.i)(u)||Object(r.i)(h))return l;const f=v(a,.001),m=v(a,500),p=v(t,.001);if(Math.abs(l.xmin-h[0])<p&&Math.abs(l.xmax-h[1])<p){const n=Math.abs(e.xmin-u[0]),r=Math.abs(u[1]-e.xmax);if(n<f&&r>m){l.xmin=h[0];const n=[];n.push(new c.a(e.xmax,e.ymin,a)),n.push(new c.a(e.xmax,(e.ymin+e.ymax)/2,a)),n.push(new c.a(e.xmax,e.ymax,a));const r=n.map(e=>b(e,t,i)).filter(e=>!isNaN(null==e?void 0:e.x)).map(e=>e.x);l.xmax=Math.max.apply(null,r)}if(r<f&&n>m){l.xmax=h[1];const n=[];n.push(new c.a(e.xmin,e.ymin,a)),n.push(new c.a(e.xmin,(e.ymin+e.ymax)/2,a)),n.push(new c.a(e.xmin,e.ymax,a));const r=n.map(e=>b(e,t,i)).filter(e=>!isNaN(null==e?void 0:e.x)).map(e=>e.x);l.xmin=Math.min.apply(null,r)}}else{const e=v(t,.001);Math.abs(l.xmin-h[0])<e&&(l.xmin=h[0]),Math.abs(l.xmax-h[1])<e&&(l.xmax=h[1])}return l}function C(e,t=!1){const i=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*i:e.wkid&&e.isGeographic?360:2*m[e.wkid]||null}function R(e,t=!1){if(e.isGeographic)return[-180,180];const i=C(e,t);return Object(r.j)(i)?[-i/2,i/2]:null}function D(e,t,i,n){let r=(e-t)/i;return r-Math.floor(r)!=0?r=Math.floor(r):n&&(r-=1),r}function P(e,t=!1){const i=C(e.spatialReference);if(!Object(r.j)(i))return 0;const n=t?0:-i/2,s=v(e.spatialReference),a=!t&&Math.abs(e.xmax-i/2)<s?i/2:e.xmax,o=!t&&Math.abs(e.xmin+i/2)<s?-i/2:e.xmin;return D(a,n,i,!0)-D(o,n,i,!1)}function A(e){const t=e.storageInfo.origin.x,i=C(e.spatialReference,!0);if(!Object(r.j)(i))return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const n=i/2,{nativePixelSize:s,storageInfo:a,extent:o}=e,{maximumPyramidLevel:l,blockWidth:c,pyramidScalingFactor:u}=a;let h=s.x;const d=[],f=Object(r.j)(e.transform)&&"gcs-shift"===e.transform.type,m=t+(f?0:n),p=f?i-t:n-t;for(let r=0;r<=l;r++){const e=(o.xmax-t)/h/c,i=e-Math.floor(e)==0?e:Math.ceil(e),n=p/h/c,r=n-Math.floor(n)==0?n:Math.ceil(n),s=Math.floor(m/h/c),a=Math.round(m/h)%c,l=(c-Math.round(p/h)%c)%c;d.push({resolutionX:h,blockWidth:c,datsetColumnCount:i,worldColumnCountFromOrigin:r,leftMargin:a,rightPadding:l,originColumnOffset:s}),h*=u}return{originX:t,halfWorldWidth:n,pyramidsInfo:d,hasGCSSShiftTransform:f}}function z(e){const t=e.isAdaptive&&null==e.spacing;let i=e.spacing||[32,32],n=L(e),s={cols:n.size[0]+1,rows:n.size[1]+1};const o=n.outofBoundPointCount>0&&n.outofBoundPointCount<n.offsets.length/2;let l=n.outofBoundPointCount===n.offsets.length/2||t&&o?[0,0]:f(n.offsets,s,i,4);const c=(l[0]+l[1])/2,d=e.projectedExtent.spatialReference,m=e.srcBufferExtent.spatialReference;if(t&&(o||c>4)&&(h(d,m,e.datumTransformation)&&(d.isGeographic||Object(r.j)(T(d))),i=[4,4],n=L({...e,spacing:i}),s={cols:n.size[0]+1,rows:n.size[1]+1},l=f(n.offsets,s,i,4)),n.error=l,i[0]>1&&(n.coefficients=F(n.offsets,s,o)),e.includeGCSGrid&&!d.isGeographic&&!d.isWebMercator)if(m.isGeographic)n.gcsGrid={offsets:n.offsets,coefficients:n.coefficients,spacing:i};else{const t=T(d);if(Object(r.j)(t)&&!t.isEnvelope){const t=function(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt);let i;return _.has(t)?i=_.get(t):(i=(e.wkid?a.a.coordsys(e.wkid):a.a.fromString(a.b.PE_TYPE_PROJCS,e.wkt)).getGeogcs().getCode(),_.set(t,i)),new u.a({wkid:i})}(d),r=M(e.projectedExtent,t),{offsets:l}=L({...e,srcBufferExtent:r,spacing:i}),c=F(l,s,o);n.gcsGrid={offsets:l,coefficients:c,spacing:i}}}return n}function L(e){const{projectedExtent:t,srcBufferExtent:i,pixelSize:n,datumTransformation:s,rasterTransform:a}=e,o=t.spatialReference,l=i.spatialReference;d(o,l);const{xmin:u,ymin:h,xmax:f,ymax:m}=t,p=C(l),_=Object(r.j)(p)&&(e.hasWrapAround||"gcs-shift"===(null==a?void 0:a.type)),g=e.spacing||[32,32],x=g[0]*n.x,y=g[1]*n.y,b=1===g[0],S=Math.ceil((f-u)/x-.1/g[0])+(b?0:1),T=Math.ceil((m-h)/y-.1/g[1])+(b?0:1),w=O({cols:S,rows:T,xmin:u,ymax:m,xres:x,yres:y,inSR:o,outSR:l,datumTransformation:s,preferPE:g[0]<=4,usePixelCenter:b}),j=[];let I,M=0;const E=b?-1:NaN,{xmin:R,xmax:D,ymax:P,width:A,height:z}=i,L=v(l,500);for(let r=0;r<S;r++){const e=[];for(let t=0;t<T;t++){let i=w[r*T+t];if(_&&i[0]>D&&i[0]>p/2-L&&(i[0]-=p),!i||isNaN(i[0])||isNaN(i[1]))j.push(E),j.push(E),e.push(null),M++;else{if(a){const e=a.inverseTransform(new c.a({x:i[0],y:i[1],spatialReference:l}));i=[e.x,e.y]}e.push(i),r>0&&_&&I[t]&&i[0]<I[t][0]&&(i[0]+=p),j.push((i[0]-R)/A),j.push((P-i[1])/z)}}I=e}return{offsets:j,error:null,coefficients:null,outofBoundPointCount:M,spacing:g,size:b?[S,T]:[S-1,T-1]}}function F(e,t,i){const{cols:n,rows:r}=t,s=new Float32Array((n-1)*(r-1)*2*6),a=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),o=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<n-1;l++){for(let t=0;t<r-1;t++){let i=l*r*2+2*t;const c=e[i],u=e[i+1],h=e[i+2],d=e[i+3];i+=2*r;const f=e[i],m=e[i+1],p=e[i+2],_=e[i+3];let g=0,x=12*(t*(n-1)+l);for(let e=0;e<3;e++)s[x++]=a[g++]*c+a[g++]*h+a[g++]*p;g=0;for(let e=0;e<3;e++)s[x++]=a[g++]*u+a[g++]*d+a[g++]*_;g=0;for(let e=0;e<3;e++)s[x++]=o[g++]*c+o[g++]*f+o[g++]*p;g=0;for(let e=0;e<3;e++)s[x++]=o[g++]*u+o[g++]*m+o[g++]*_}if(i)for(let e=0;e<s.length;e++)isNaN(s[e])&&(s[e]=-1)}return s}function V(e){const t=e.clone().normalize();return 1===t.length?t[0]:I(t)}function N(e,t,i){const{storageInfo:n,pixelSize:s}=t;let a,o=!1;const{pyramidResolutions:l}=n;if(Object(r.j)(l)&&l.length){const n=(e.x+e.y)/2,r=l[l.length-1],u=(r.x+r.y)/2,h=(s.x+s.y)/2;if(n<=h)a=0;else if(n>=u)a=l.length,o=n/u>8;else{let e,t=h;for(let r=1;r<=l.length;r++){if(e=(l[r-1].x+l[r-1].y)/2,n<=e){n===e?a=r:"down"===i?(a=r-1,o=n/t>8):a="up"===i||n-t>e-n||n/t>2?r:r-1;break}t=e}}const d=0===a?s:l[a-1];return{pyramidLevel:a,pyramidResolution:new c.a({x:d.x,y:d.y,spatialReference:t.spatialReference}),excessiveReading:o}}const u=Math.log(e.x/s.x)/Math.LN2,h=Math.log(e.y/s.y)/Math.LN2,d=t.storageInfo.maximumPyramidLevel||0;a="down"===i?Math.floor(Math.min(u,h)):"up"===i?Math.ceil(Math.max(u,h)):Math.round((u+h)/2),a<0?a=0:a>d&&(o=a>d+3,a=d);const f=2**a;return{pyramidLevel:a,pyramidResolution:new c.a({x:f*t.nativePixelSize.x,y:f*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:o}}function U(e,t,i=512,n=!0){const{extent:r,spatialReference:a,pixelSize:o}=e,l=y(new c.a({x:o.x,y:o.y,spatialReference:a}),t,r);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const u=(l.x+l.y)/2,h=Object(s.d)(t),d=u*h*96*39.37,f=t.isGeographic?256/i*295828763.7958547:256/i*591657527.591555;let m="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=M(r,t);m||n&&(t.isGeographic||t.isWebMercator)&&(m=p.xmin*p.xmax<0);let _,g=d;const x=1.001;if(m){g=f;const e=t.isGeographic?1341104507446289e-21:.29858214164761665,i=e*(96*h*39.37),n=t.isGeographic?4326:3857;_=y(new c.a({x:e,y:e,spatialReference:{wkid:n}}),a,p),_.x*=g/i,_.y*=g/i}else{_={x:o.x,y:o.y};const t=Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2);let i=0;for(;g<f*(x/2)&&i<t;)i++,g*=2,_.x*=2,_.y*=2;Math.max(g,f)/Math.min(g,f)<=x&&(g=f)}const v=[g],b=[{x:_.x,y:_.y}],O=Math.min(70.5310735,d)/x;for(;g>=O;)g/=2,_.x/=2,_.y/=2,v.push(g),b.push({x:_.x,y:_.y});return{projectedPixelSize:l,scales:v,srcResolutions:b,isCustomTilingScheme:!m}}},764:function(e,t,i){"use strict";i.d(t,"a",(function(){return h})),i.d(t,"b",(function(){return g}));i(64);var n=i(11),r=i(49),s=i(2),a=i(12),o=i(379),l=i(27),c=i(35);const u=n.a.getLogger("esri.views.2d.engine.flow.dataUtils");async function h(e,t,i){const n=performance.now(),r=d(e,t),s=performance.now(),l=m(e,r,t.width,t.height),c=performance.now(),h=function(e,t){const i=new o.a,n=e.reduce((e,t)=>e+t.length,0),r=new Float32Array(4*n),s=new Array(e.length);let a=0,l=0;for(const o of e){const e=a;for(const t of o)r[4*a+0]=t.x,r[4*a+1]=t.y,r[4*a+2]=t.t,r[4*a+3]=t.speed,a++;s[l++]={startVertex:e,numberOfVertices:o.length,totalTime:o[o.length-1].t,timeSeed:t?i.getFloat():0}}return{lineVertices:r,lineDescriptors:s}}(l,!0),f=performance.now(),_=p(h),g=performance.now();if(e.profile){const e={"_createFlowFieldFromData()":Math.round(s-n),"_getStreamlines()":Math.round(c-s),"createAnimatedLinesData()":Math.round(f-c),"createLinesMesh()":Math.round(g-f),"Total elapsed time":Math.round(g-n)};u.info("createStreamlinesMesh profile",e)}return await Promise.resolve(),Object(a.t)(i),_}function d(e,t){const i=function(e,t,i,n){if(0===n)return e;const r=Math.round(3*n),s=new Array(2*r+1);let a=0;for(let c=-r;c<=r;c++){const e=Math.exp(-c*c/(n*n));s[c+r]=e,a+=e}for(let c=-r;c<=r;c++)s[c+r]/=a;const o=new Float32Array(e.length);for(let c=0;c<i;c++)for(let i=0;i<t;i++){let n=0,a=0;for(let o=-r;o<=r;o++){if(i+o<0||i+o>=t)continue;const l=s[o+r];n+=l*e[2*(c*t+(i+o))+0],a+=l*e[2*(c*t+(i+o))+1]}o[2*(c*t+i)+0]=n,o[2*(c*t+i)+1]=a}const l=new Float32Array(e.length);for(let c=0;c<t;c++)for(let e=0;e<i;e++){let n=0,a=0;for(let l=-r;l<=r;l++){if(e+l<0||e+l>=i)continue;const u=s[l+r];n+=u*o[2*((e+l)*t+c)+0],a+=u*o[2*((e+l)*t+c)+1]}l[2*(e*t+c)+0]=n,l[2*(e*t+c)+1]=a}return l}(t.data,t.width,t.height,e.smoothing);return e.interpolate?(e,n)=>{const r=Math.floor(e),s=Math.floor(n);if(r<0||r>=t.width)return[0,0];if(s<0||s>=t.height)return[0,0];const a=e-r,o=n-s,l=r,c=s,u=r<t.width-1?r+1:r,h=s<t.height-1?s+1:s,d=i[2*(c*t.width+l)],f=i[2*(c*t.width+u)],m=i[2*(h*t.width+l)],p=i[2*(h*t.width+u)],_=i[2*(c*t.width+l)+1],g=i[2*(c*t.width+u)+1];return[(d*(1-o)+m*o)*(1-a)+(f*(1-o)+p*o)*a,(_*(1-o)+i[2*(h*t.width+l)+1]*o)*(1-a)+(g*(1-o)+i[2*(h*t.width+u)+1]*o)*a]}:(e,n)=>{const r=Math.round(e),s=Math.round(n);return r<0||r>=t.width||s<0||s>=t.height?[0,0]:[i[2*(s*t.width+r)+0],i[2*(s*t.width+r)+1]]}}function f(e,t,i,n,r,s,a,o,l){const c=[];let u=i,h=n,d=0,[f,m]=t(u,h);f*=e.velocityScale,m*=e.velocityScale;const p=Math.sqrt(f*f+m*m);let _,g;c.push({x:u,y:h,t:d,speed:p});for(let x=0;x<e.verticesPerLine;x++){let[i,n]=t(u,h);i*=e.velocityScale,n*=e.velocityScale;const f=Math.sqrt(i*i+n*n);if(f<e.minSpeedThreshold)return c;const m=i/f,p=n/f;if(u+=m*e.segmentLength,h+=p*e.segmentLength,d+=e.segmentLength/f,Math.acos(m*_+p*g)>e.maxTurnAngle)return c;if(e.mergeLines){const e=Math.round(u*l),t=Math.round(h*l);if(e<0||e>a-1||t<0||t>o-1)return c;const i=s[t*a+e];if(-1!==i&&i!==r)return c;s[t*a+e]=r}c.push({x:u,y:h,t:d,speed:f}),_=m,g=p}return c}function m(e,t,i,n){const r=[],s=new o.a,a=1/Math.max(e.lineCollisionWidth,1),l=Math.round(i*a),c=Math.round(n*a),u=new Int32Array(l*c);for(let o=0;o<u.length;o++)u[o]=-1;const h=[];for(let o=0;o<n;o+=e.lineSpacing)for(let t=0;t<i;t+=e.lineSpacing)h.push({x:t,y:o,sort:s.getFloat()});h.sort((e,t)=>e.sort-t.sort);for(const{x:o,y:d}of h)if(s.getFloat()<e.density){const i=f(e,t,o,d,r.length,u,l,c,a);if(i.length<2)continue;r.push(i)}return r}function p(e,t=10){const{lineVertices:i,lineDescriptors:n}=e;let r=0,s=0;for(const d of n)r+=2*d.numberOfVertices,s+=6*(d.numberOfVertices-1);const a=new Float32Array(9*r),o=new Uint32Array(s);let l=0,c=0;function u(){o[c++]=l-2,o[c++]=l,o[c++]=l-1,o[c++]=l,o[c++]=l+1,o[c++]=l-1}function h(e,t,i,n,r,s,o,c){const u=9*l;let h=0;a[u+h++]=e,a[u+h++]=t,a[u+h++]=1,a[u+h++]=i,a[u+h++]=s,a[u+h++]=o,a[u+h++]=n/2,a[u+h++]=r/2,a[u+h++]=c,l++,a[u+h++]=e,a[u+h++]=t,a[u+h++]=-1,a[u+h++]=i,a[u+h++]=s,a[u+h++]=o,a[u+h++]=-n/2,a[u+h++]=-r/2,a[u+h++]=c,l++}for(const d of n){const{totalTime:e,timeSeed:n}=d;let r=null,s=null,a=null,o=null,l=null,c=null;for(let f=0;f<d.numberOfVertices;f++){const m=i[4*(d.startVertex+f)+0],p=i[4*(d.startVertex+f)+1],_=i[4*(d.startVertex+f)+2],g=i[4*(d.startVertex+f)+3];let x=null,y=null,v=null,b=null;if(f>0){x=m-r,y=p-s;const i=Math.sqrt(x*x+y*y);if(x/=i,y/=i,f>1){let e=x+l,i=y+c;const n=Math.sqrt(e*e+i*i);e/=n,i/=n;const r=Math.min(1/(e*x+i*y),t);e*=r,i*=r,v=-i,b=e}else v=-y,b=x;null!==v&&null!==b&&(h(r,s,a,v,b,e,n,g),u())}r=m,s=p,a=_,l=x,c=y,o=g}h(r,s,a,-c,l,e,n,o)}return{vertexData:a,indexData:o}}function _(e,t){const i=t.pixels,{width:n,height:s}=t,a=new Float32Array(n*s*2);if("vector-uv"===e)for(let r=0;r<n*s;r++)a[2*r+0]=i[0][r],a[2*r+1]=-i[1][r];else if("vector-magdir"===e)for(let o=0;o<n*s;o++){const e=i[0][o],t=Object(r.f)(i[1][o]),n=Math.cos(t-Math.PI/2),s=Math.sin(t-Math.PI/2);a[2*o+0]=n*e,a[2*o+1]=s*e}return{data:a,width:n,height:s}}async function g(e,t,i,n,r,s){const a=Object(l.e)(t.spatialReference);if(!a)return x(e,t,i,n,r,s);const[o,u]=a.valid,h=u-o,d=Math.ceil(t.width/h),f=t.width/d,m=Math.round(i/d);let p=t.xmin;const _=[];for(let l=0;l<d;l++){const i=new c.a({xmin:p,xmax:p+f,ymin:t.ymin,ymax:t.ymax,spatialReference:t.spatialReference});_.push(x(e,i,m,n,r,s)),p+=f}const g=await Promise.all(_),y={data:new Float32Array(i*n*2),width:i,height:n};let v=0;for(const l of g){for(let e=0;e<l.height;e++)for(let t=0;t<l.width;t++)v+t>=i||(y.data[2*(e*i+v+t)+0]=l.data[2*(e*l.width+t)+0],y.data[2*(e*i+v+t)+1]=l.data[2*(e*l.width+t)+1]);v+=l.width}return y}async function x(e,t,i,n,r,a){const o={requestProjectedLocalDirections:!0,signal:a};if(Object(s.j)(r)&&(o.timeExtent=r),"imagery"===e.type){await e.load({signal:a});const r=e.rasterInfo.dataType,l=await e.fetchImage(t,i,n,o);return!l||Object(s.i)(l.pixelData)||Object(s.i)(l.pixelData.pixelBlock)?{data:new Float32Array(i*n*2),width:i,height:n}:_(r,l.pixelData.pixelBlock)}await e.load({signal:a});const l=e.rasterInfo.dataType,c=await e.fetchPixels(t,i,n,o);return!c||Object(s.i)(c.pixelBlock)?{data:new Float32Array(i*n*2),width:i,height:n}:_(l,c.pixelBlock)}},765:function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return s}));var n=i(2),r=i(43);async function s(e,t=e.popupTemplate){if(!Object(n.j)(t))return[];const i=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:s}=t,{objectIdField:a,typeIdField:o,globalIdField:l,relationships:c}=e;if(i.includes("*"))return["*"];const u=s?await Object(r.n)(e):[],h=Object(r.j)(e.fieldsIndex,[...i,...u]);return o&&h.push(o),h&&a&&e.fieldsIndex.has(a)&&-1===h.indexOf(a)&&h.push(a),h&&l&&e.fieldsIndex.has(l)&&-1===h.indexOf(l)&&h.push(l),c&&c.forEach(t=>{const{keyField:i}=t;h&&i&&e.fieldsIndex.has(i)&&-1===h.indexOf(i)&&h.push(i)}),h}function a(e,t){return e.popupTemplate?e.popupTemplate:Object(n.j)(t)&&t.defaultPopupTemplateEnabled&&Object(n.j)(e.defaultPopupTemplate)?e.defaultPopupTemplate:null}},767:function(e,t,i){"use strict";i.d(t,"a",(function(){return j}));var n=i(0),r=i(20),s=i(12),a=i(1),o=(i(9),i(5),i(4),i(3)),l=i(35),c=i(60),u=i(27),h=i(372);const d=Math.PI/180;function f(e,t){const i=t.rotation*d,n=Math.abs(Math.cos(i)),r=Math.abs(Math.sin(i)),[s,a]=t.size;return e[0]=Math.round(a*r+s*n),e[1]=Math.round(a*n+s*r),e}var m=i(701),p=i(380),_=i(138);const g=Object(c.g)(),x=[0,0],y=new _.a(0,0,0,0),v=2048,b=2048,O=!1,S=!1,T=!1;let w=class extends r.a{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=T,this.imageMaxWidth=v,this.imageMaxHeight=b,this.imageRotationSupported=O,this.imageNormalizationSupported=S,this.update=Object(s.h)(async(e,t)=>{if(!e.stationary||this.destroyed)return null;const i=e.state,n=Object(u.e)(i.spatialReference),r=this.hidpi?e.pixelRatio:1,s=this.imageNormalizationSupported&&i.worldScreenWidth&&i.worldScreenWidth<i.size[0];s?(x[0]=i.worldScreenWidth,x[1]=i.size[1]):this.imageRotationSupported?(x[0]=i.size[0],x[1]=i.size[1]):f(x,i);const a=Math.floor(x[0]*r)>this.imageMaxWidth||Math.floor(x[1]*r)>this.imageMaxHeight,o=n&&(i.extent.xmin<n.valid[0]||i.extent.xmax>n.valid[1]),l=!this.imageNormalizationSupported&&o,c=!a&&!l,h=this.imageRotationSupported?i.rotation:0;if(c){const e=s?i.paddedViewState.center:i.center;this._imagePromise=this._singleExport(i,x,e,i.resolution,h,r,t)}else{let e=Math.min(this.imageMaxWidth,this.imageMaxHeight);l&&(e=Math.min(i.worldScreenWidth,e)),this._imagePromise=this._tiledExport(i,e,h,r,t)}return this._imagePromise.then(async e=>{if(this._imagePromise=null,!this.destroyed){this.bitmaps=null!=e?e:[];for(const t of this.container.children)e.includes(t)||t.fadeOut().then(()=>{t.remove()});for(const t of e)this.container.addChild(t),t.fadeIn()}}).catch(e=>{throw this._imagePromise=null,e})},5e3)}destroy(){this.bitmaps=[]}get updating(){return!this.destroyed&&null!==this._imagePromise}updateExports(e){for(const t of this.container.children){if(!t.visible||!t.stage)return;e(t),t.invalidateTexture(),t.requestRender()}}async _export(e,t,i,n,r,s){const a=await this.fetchSource(e,Math.floor(t*r),Math.floor(i*r),{rotation:n,pixelRatio:r,signal:s}),o=new m.a(a,"additive");return o.x=e.xmin,o.y=e.ymax,o.resolution=e.width/t,o.rotation=n,o.pixelRatio=r,o}async _singleExport(e,t,i,n,r,s,a){!function(e,t,i,n){const[r,s]=t,[a,o]=n,l=.5*i;e[0]=r-l*a,e[1]=s-l*o,e[2]=r+l*a,e[3]=s+l*o}(g,i,n,t);const o=new l.a(g[0],g[1],g[2],g[3],e.spatialReference);return[await this._export(o,t[0],t[1],r,s,a)]}_tiledExport(e,t,i,n,r){const s=h.a.create({size:t,spatialReference:e.spatialReference,scales:[e.scale]}),a=new p.a(s),o=a.getTileCoverage(e);if(!o)return null;const c=[];return o.forEach((s,o,u,h)=>{y.set(s,o,u,h),a.getTileBounds(g,y);const d=new l.a(g[0],g[1],g[2],g[3],e.spatialReference);c.push(this._export(d,t,t,i,n,r))}),Promise.all(c)}};Object(n.a)([Object(a.b)()],w.prototype,"_imagePromise",void 0),Object(n.a)([Object(a.b)()],w.prototype,"bitmaps",void 0),Object(n.a)([Object(a.b)()],w.prototype,"container",void 0),Object(n.a)([Object(a.b)()],w.prototype,"fetchSource",void 0),Object(n.a)([Object(a.b)()],w.prototype,"hidpi",void 0),Object(n.a)([Object(a.b)()],w.prototype,"imageMaxWidth",void 0),Object(n.a)([Object(a.b)()],w.prototype,"imageMaxHeight",void 0),Object(n.a)([Object(a.b)()],w.prototype,"imageRotationSupported",void 0),Object(n.a)([Object(a.b)()],w.prototype,"imageNormalizationSupported",void 0),Object(n.a)([Object(a.b)()],w.prototype,"requestUpdate",void 0),Object(n.a)([Object(a.b)()],w.prototype,"updating",null),w=Object(n.a)([Object(o.a)("esri.views.2d.layers.support.ExportStrategy")],w);const j=w},905:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var n=i(0),r=(i(11),i(4),i(9),i(5),i(119),i(3)),s=i(615),a=i(714),o=i(614);let l=class extends a.a{renderChildren(e){if(e.drawPhase!==s.c.HIGHLIGHT)return;if(this.attributeView.bindTextures(e.context),!this.children.some(e=>e.hasData))return;super.renderChildren(e);const{painter:t}=e,i=t.effects.highlight;i.bind(e),e.context.setColorMask(!0,!0,!0,!0),e.context.clear(o.e.COLOR_BUFFER_BIT),this._renderChildren(e,i.defines.concat(["highlightAll"])),i.draw(e),i.unbind()}};l=Object(n.a)([Object(r.a)("esri.views.2d.layers.support.HighlightGraphicContainer")],l);const c=l},906:function(e,t,i){"use strict";i.d(t,"a",(function(){return f}));i(5);var n=i(2),r=i(208),s=i(281),a=i(175),o=i(722),l=i(628),c=i(616),u=i(619),h=i(614),d=i(620);class f extends l.a{constructor(e=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.width=null,this.source=e}destroy(){var e,t;Object(n.j)(this.vaoData)&&(null==(e=this.vaoData.magdir)||e.vao.dispose(),null==(t=this.vaoData.scalar)||t.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(e){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(e)&&(this._symbolizerParameters=e,this.invalidateVAO())}get source(){return this._source}set source(e){this._source=e,this.invalidateVAO()}invalidateVAO(){var e,t;!this._vaoInvalidated&&Object(n.j)(this.vaoData)&&(null==(e=this.vaoData.magdir)||e.vao.dispose(),null==(t=this.vaoData.scalar)||t.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(e){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,Object(n.j)(this.source)&&!Object(n.j)(this.vaoData)){const{style:t}=this.symbolizerParameters;switch(t){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const t=Object(o.d)(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(e.context,t);this.vaoData={magdir:i}}break;case"simple_scalar":{const t=Object(o.e)(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(e.context,t);this.vaoData={scalar:i}}break;case"wind_speed":{const t=Object(o.d)(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(e.context,t),n=Object(o.e)(this.source,this.symbolizerParameters),r=this._createVectorFieldVAO(e.context,n);this.vaoData={magdir:i,scalar:r}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:Object(s.b)()}}setTransform(e){const t=Object(r.b)(this.transforms.dvs),[i,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,l=s*this.height,c=Math.PI*this.rotation/180;Object(r.c)(t,t,Object(a.b)(i,n)),Object(r.c)(t,t,Object(a.b)(o/2,l/2)),Object(r.k)(t,t,-c),Object(r.c)(t,t,Object(a.b)(-o/2,-l/2)),Object(r.g)(t,t,Object(a.b)(o,l)),Object(r.i)(this.transforms.dvs,e.displayViewMat3,t)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(e,t){const{vertexData:i,indexData:n}=t,r=u.a.createVertex(e,h.D.STATIC_DRAW,new Float32Array(i)),s=u.a.createIndex(e,h.D.STATIC_DRAW,new Uint32Array(n)),a=Object(c.g)("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:h.k.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:h.k.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:h.k.FLOAT,normalized:!1}]});return{vao:new d.a(e,a.attributes,a.bufferLayouts,{geometry:r},s),elementCount:n.length}}}},925:function(e,t,i){"use strict";i.d(t,"a",(function(){return B}));var n=i(0),r=i(73),s=i(85),a=i(31),o=i(1),l=(i(9),i(5),i(4),i(3)),c=i(764),u=i(655),h=i(615),d=i(648);class f extends d.a{constructor(){super(...arguments),this.flowStyle=null}get requiresDedicatedFBO(){return!1}doRender(e){super.doRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"flow",brushes:[u.a],target:()=>this.children,drawPhase:h.c.MAP});return[...super.prepareRenderPasses(e),t]}}i(64);var m=i(20),p=i(11),_=i(49),g=i(2),x=i(12),y=i(28);const v=p.a.getLogger("esri.views.2d.engine.flow.FlowDisplayData");class b{constructor(e,t,i,n){this.state={name:"created"},this.flowStyle=e,this.extent=t,this.size=i,this.pixelRatio=n}async load(){const e=new AbortController;this.state={name:"loading",abortController:e};const t=await this.flowStyle.loadResources({extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},e.signal);this.state={name:"loaded",resources:t}}prepareForRendering(e){if("loaded"!==this.state.name)return void v.error("Only loaded resources can be attached.");const t=this.state.resources;t.prepareForRendering(e),this.state={name:"attached",resources:t}}destroy(){if("loading"===this.state.name)return this.state.abortController.abort(),void(this.state={name:"detached"});"attached"===this.state.name&&(this.state.resources.detach(),this.state={name:"detached"})}update(e){return!!this.flowStyle.areResourcesCompatible(e.flowStyle)&&(!(!this.extent.equals(e.extent)||this.size[0]!==e.size[0]||this.size[1]!==e.size[1]||this.pixelRatio!==e.pixelRatio)&&(this.flowStyle=e.flowStyle,!0))}}var O=i(208),S=i(281),T=i(628);class w extends T.a{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(e){this._displayData=e,this.requestRender()}clear(){Object(g.j)(this._displayData)&&(this._displayData.destroy(),this._displayData=null,this.requestRender())}setTransform(e){const{displayData:t}=this;if(Object(g.i)(t))return;const i=t.extent.xmin,n=t.extent.ymax,r=[0,0];e.toScreen(r,[i,n]);const s=(t.extent.xmax-t.extent.xmin)/t.size[0]/e.resolution,a=Object(_.f)(e.rotation),{dvs:o}=this.transforms;Object(O.h)(o,[-1,1,0]),Object(O.d)(o,o,[2/(e.size[0]*e.pixelRatio),-2/(e.size[1]*e.pixelRatio),1]),Object(O.c)(o,o,[r[0],r[1],0]),Object(O.k)(o,o,a),Object(O.d)(o,o,[s*e.pixelRatio,s*e.pixelRatio,1])}_createTransforms(){return{dvs:Object(S.b)()}}}var j=i(35);const I=p.a.getLogger("esri.views.2d.engine.flow.FlowStrategy");let M=class extends m.a{constructor(e){super(e),this._flowDisplayObject=new w,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return null!=this._loading}update(e){const{flowStyle:t}=this.flowContainer;if(Object(g.i)(t))return void this._clear();const{extent:i,rotation:n,resolution:r,pixelRatio:s}=e.state,a=function(e,t){const i=new y.a({x:(e.xmax+e.xmin)/2,y:(e.ymax+e.ymin)/2,spatialReference:e.spatialReference}),n=e.xmax-e.xmin,r=e.ymax-e.ymin,s=Math.abs(Math.cos(Object(_.f)(t))),a=Math.abs(Math.sin(Object(_.f)(t))),o=s*n+a*r,l=a*n+s*r,c=new j.a({xmin:i.x-o/2,ymin:i.y-l/2,xmax:i.x+o/2,ymax:i.y+l/2,spatialReference:e.spatialReference});return c.centerAt(i),c}(i,n);a.expand(1.15);const o=[Math.round((a.xmax-a.xmin)/r),Math.round((a.ymax-a.ymin)/r)],l=new b(t,a,o,s);if(Object(g.j)(this._loading)){if(this._loading.update(l))return;this._loading.destroy(),this._loading=null}!Object(g.i)(this._flowDisplayObject.displayData)&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},e=>{Object(x.l)(e)||(I.error("A resource failed to load.",e),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),Object(g.j)(this._loading)&&(this._loading.destroy(),this._loading=null)}};Object(n.a)([Object(o.b)()],M.prototype,"_loading",void 0),Object(n.a)([Object(o.b)()],M.prototype,"flowContainer",void 0),Object(n.a)([Object(o.b)()],M.prototype,"updating",null),M=Object(n.a)([Object(l.a)("esri.views.2d.engine.flow.FlowStrategy")],M);const E=M;var C=i(619),R=i(614),D=i(620),P=i(631);const A=new Map;A.set("a_positionAndSide",0),A.set("a_timeInfo",1),A.set("a_extrude",2),A.set("a_speed",3);const z={geometry:[new P.a("a_positionAndSide",3,R.k.FLOAT,0,36),new P.a("a_timeInfo",3,R.k.FLOAT,12,36),new P.a("a_extrude",2,R.k.FLOAT,24,36),new P.a("a_speed",1,R.k.FLOAT,32,36)]};class L{constructor(e,t,i){this.values=i,this._vertexData=e,this._indexData=t}prepareForRendering(e){const t=C.a.createVertex(e,R.D.STATIC_DRAW,this._vertexData),i=C.a.createIndex(e,R.D.STATIC_DRAW,this._indexData),n=new D.a(e,A,z,{geometry:t},i);this.vertexBuffer=t,this.indexBuffer=i,this.vertexArray=n,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose(),this.vertexBuffer.dispose(),this.indexBuffer.dispose()}get locations(){return A}}var F=i(21);function V(e){const t=function(e){if(!e.hasVisualVariables("size"))return{kind:"constant",value:[Object(F.c)(e.trailWidth)]};const t=e.getVisualVariablesForType("size")[0],i=[],n=[];let r;if(t.stops){for(const e of t.stops)i.push(e.value),n.push(e.size);r=t.stops.length}else i.push(t.minDataValue,t.maxDataValue),n.push(t.minSize,t.maxSize),r=2;return{kind:"ramp",stops:i,values:n,count:r}}(e),i="constant"===(h=t).kind?h.value[0]:h.values[h.values.length-1],n=2*i,r=Math.round(Object(F.c)(e.maxPathLength)/n)+1,s=i,a=function(e){if(!e.hasVisualVariables("color"))return{kind:"constant",value:N(e.color)};const t=e.getVisualVariablesForType("color")[0],i=[],n=[];for(const r of t.stops)i.push(r.value),Array.prototype.push.apply(n,N(r.color));return{kind:"ramp",stops:i,values:n,count:t.stops.length}}(e),o=function(e){if(!e.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=e.getVisualVariablesForType("opacity")[0],i=[],n=[];for(const r of t.stops)i.push(r.value),n.push(r.opacity);return{kind:"ramp",stops:i,values:n,count:t.stops.length}}(e),{flowSpeed:l,trailLength:c,density:u}=e;var h;return{lineRenderWidth:t,segmentLength:n,verticesPerLine:r,lineCollisionWidth:s,lineSpacing:10,lineColor:a,lineOpacity:o,lineSpeed:l,fadeDuration:c,density:u,smoothing:Object(F.c)(e.smoothing),velocityScale:"flow-from"===e.flowRepresentation?1:-1,minWeightThreshold:.001,minSpeedThreshold:.001,maxTurnAngle:1,mergeLines:!0,interpolate:!0,profile:!1}}function N(e){const t=e.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}class U{constructor(e,t,i,n){this._loadImagery=e,this._createStreamlinesMesh=t,this._timeExtent=n,this._rendererSettings=V(i)}get animated(){return this._rendererSettings.lineSpeed>0}get renderSettings(){return this._rendererSettings}areResourcesCompatible(e){let t=!0;return t=t&&e._loadImagery===this._loadImagery,t=t&&e._createStreamlinesMesh===this._createStreamlinesMesh,t=t&&e._rendererSettings.verticesPerLine===this._rendererSettings.verticesPerLine,t=t&&e._rendererSettings.segmentLength===this._rendererSettings.segmentLength,t=t&&e._rendererSettings.lineSpacing===this._rendererSettings.lineSpacing,t=t&&e._rendererSettings.density===this._rendererSettings.density,t=t&&e._rendererSettings.smoothing===this._rendererSettings.smoothing,t=t&&e._rendererSettings.velocityScale===this._rendererSettings.velocityScale,t=t&&e._rendererSettings.minWeightThreshold===this._rendererSettings.minWeightThreshold,t=t&&e._rendererSettings.minSpeedThreshold===this._rendererSettings.minSpeedThreshold,t=t&&e._rendererSettings.mergeLines===this._rendererSettings.mergeLines,t=t&&e._rendererSettings.velocityScale===this._rendererSettings.velocityScale,t=t&&e._rendererSettings.interpolate===this._rendererSettings.interpolate,t=t&&e._rendererSettings.lineColor.kind===this._rendererSettings.lineColor.kind,t=t&&e._rendererSettings.lineOpacity.kind===this._rendererSettings.lineOpacity.kind,t=t&&e._rendererSettings.lineRenderWidth.kind===this._rendererSettings.lineRenderWidth.kind,t&&this._rendererSettings.mergeLines&&(t=e._rendererSettings.lineCollisionWidth===this._rendererSettings.lineCollisionWidth),t&&e._timeExtent!==this._timeExtent&&(t=!(!Object(g.j)(e._timeExtent)||!Object(g.j)(this._timeExtent))&&e._timeExtent.equals(this._timeExtent)),t}async loadResources(e,t){const{extent:i,size:n}=e;Object(x.t)(t);const r=await this._loadImagery(i,n[0],n[1],this._timeExtent,t),{vertexData:s,indexData:a}=await this._createStreamlinesMesh(this._rendererSettings,r,t);return new L(s,a,{lineColor:this._rendererSettings.lineColor,lineOpacity:this._rendererSettings.lineOpacity,lineRenderWidth:this._rendererSettings.lineRenderWidth})}}let k=class extends s.a{constructor(){super(...arguments),this._loadImagery=(e,t,i,n,r)=>Object(c.b)(this.layer,e,t,i,n,r),this._createStreamlinesMesh=(e,t,i)=>this.layer.createStreamlinesMesh({flowData:t,rendererSettings:e},{signal:i}),this.attached=!1,this.container=null,this.layer=null,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this._strategy||this._strategy.updating}attach(){const{layer:e}=this,t=()=>{this._loadImagery=(t,i,n,r,s)=>Object(c.b)(e,t,i,n,r,s),this._updateVisualization()};"multidimensionalDefinition"in e?this.handles.add(Object(a.e)(()=>e.multidimensionalDefinition,t)):this.handles.add([Object(a.e)(()=>e.mosaicRule,t),Object(a.e)(()=>e.renderingRule,t),Object(a.e)(()=>e.definitionExpression,t)]),this.container=new f,this._strategy=new E({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container.removeAllChildren(),this.container=null,this.handles.removeAll()}update(e){e.stationary?this._strategy.update(e):this.layerView.requestUpdate()}hitTest(e){return new r.a({attributes:{},geometry:e.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){if("flow"!==this.layer.renderer.type)return;const e=new U(this._loadImagery,this._createStreamlinesMesh,this.layer.renderer,this.timeExtent);this.container.flowStyle=e,this.layerView.requestUpdate()}};Object(n.a)([Object(o.b)()],k.prototype,"_strategy",void 0),Object(n.a)([Object(o.b)()],k.prototype,"attached",void 0),Object(n.a)([Object(o.b)()],k.prototype,"container",void 0),Object(n.a)([Object(o.b)()],k.prototype,"layer",void 0),Object(n.a)([Object(o.b)()],k.prototype,"layerView",void 0),Object(n.a)([Object(o.b)()],k.prototype,"type",void 0),Object(n.a)([Object(o.b)()],k.prototype,"updating",null),Object(n.a)([Object(o.b)()],k.prototype,"timeExtent",void 0),k=Object(n.a)([Object(l.a)("esri.views.2d.engine.flow.FlowView2D")],k);const B=k}}]);
  //# sourceMappingURL=122.9bf48be8.chunk.js.map