@arcgis/core 4.28.0-next.20230713 → 4.28.0-next.20230715
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Basemap.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0b28b5eec6dc67be8ce9.js → 0121bfc81b794745e024.js} +1 -1
- package/assets/esri/core/workers/chunks/067d3d45caeaaba18d81.js +1 -0
- package/assets/esri/core/workers/chunks/080a13dc08a8db498ffa.js +1 -0
- package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
- package/assets/esri/core/workers/chunks/{c912466351e37db68b6c.js → 14ab33573bb02d6c6b1a.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4b066760e9aa85b7607.js → 1b948f8429d8f9b1bbfb.js} +1 -1
- package/assets/esri/core/workers/chunks/204ed2ebd2d3da659791.js +1 -0
- package/assets/esri/core/workers/chunks/{5d5d4a4fdf5ca8d7837f.js → 239d4176ff2d5142b7f1.js} +1 -1
- package/assets/esri/core/workers/chunks/23bb98aaa20b180ee680.js +1 -0
- package/assets/esri/core/workers/chunks/27cf3ef9566d5226b0df.js +1 -0
- package/assets/esri/core/workers/chunks/{1c86f80d73dee1a4d9b7.js → 2f1695e4807a534e1743.js} +1 -1
- package/assets/esri/core/workers/chunks/{60b422009f58d7bbb8c4.js → 3164b862a6b3f654fade.js} +1 -1
- package/assets/esri/core/workers/chunks/35f60625ada14eb801fd.js +1 -0
- package/assets/esri/core/workers/chunks/{4e4e62462deec25e82ce.js → 3a04bf1cdce263fe2191.js} +1 -1
- package/assets/esri/core/workers/chunks/41011207b6cc5eb6232f.js +1 -0
- package/assets/esri/core/workers/chunks/{8d50449c029c73136204.js → 432e3558db53574d21b4.js} +1 -1
- package/assets/esri/core/workers/chunks/4767f69b81d36dde9550.js +1 -0
- package/assets/esri/core/workers/chunks/{08ee2bd914867fd2cbd5.js → 490629c6f9fee501c9cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{044b15794b6403792f04.js → 4f079d0e69189c1d8bd9.js} +1 -1
- package/assets/esri/core/workers/chunks/4f1f4cc82fea0d1f79ec.js +1 -0
- package/assets/esri/core/workers/chunks/503a393327df755d8843.js +1 -0
- package/assets/esri/core/workers/chunks/50e05f479c7d414fc06b.js +1 -0
- package/assets/esri/core/workers/chunks/{3835a76c017431f19422.js → 51da3c5c50b153ce6bc7.js} +1 -1
- package/assets/esri/core/workers/chunks/54b97ca5f2164b941f5b.js +1 -0
- package/assets/esri/core/workers/chunks/5a3fb63dab89cf3418f7.js +1 -0
- package/assets/esri/core/workers/chunks/5ceaf1f05b219034a10c.js +1 -0
- package/assets/esri/core/workers/chunks/70aabffaaa0a1da8e609.js +1 -0
- package/assets/esri/core/workers/chunks/78cb95d1594a0cb0dd7a.js +1 -0
- package/assets/esri/core/workers/chunks/7f391ae5e0ea7812baca.js +1 -0
- package/assets/esri/core/workers/chunks/{1d2b8b937bbda91a6549.js → 82dfbc175b52c7a10475.js} +1 -1
- package/assets/esri/core/workers/chunks/{036cd65514eab1749363.js → 8467d05626a3a72462c9.js} +1 -1
- package/assets/esri/core/workers/chunks/9038b1317f1252e31f09.js +1 -0
- package/assets/esri/core/workers/chunks/929ddc4d9975ed893767.js +1 -0
- package/assets/esri/core/workers/chunks/{e86dcc239c6a57000afc.js → 94633cc9cfb089ef010e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f5f398374ff77fb17f0.js → 975eef6d20c17a0ed07b.js} +1 -1
- package/assets/esri/core/workers/chunks/{8913bddc76b82cb24664.js → 98cf4e744e8f2c3fc536.js} +1 -1
- package/assets/esri/core/workers/chunks/a00414550fa21c5662f3.js +1 -0
- package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
- package/assets/esri/core/workers/chunks/{4e2029c8cc8a5afe5759.js → a5348f117dacdcae99ee.js} +1 -1
- package/assets/esri/core/workers/chunks/b0f0a3178d88fa600a11.js +1 -0
- package/assets/esri/core/workers/chunks/b4446ce010bc4a5aa917.js +1 -0
- package/assets/esri/core/workers/chunks/b8a45b28a915a423d09d.js +1 -0
- package/assets/esri/core/workers/chunks/{fb97d39b25b0b009d2f0.js → bd9e6f38c9ec4195322a.js} +1 -1
- package/assets/esri/core/workers/chunks/{30deb5a8e9a82186991d.js → c15c4bd52d4472ed50bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{55109f141c9f120833f6.js → c3d773c93efb41088c54.js} +1 -1
- package/assets/esri/core/workers/chunks/c518410b1214ffc58017.js +1 -0
- package/assets/esri/core/workers/chunks/d55faafe2ac914a3ebd1.js +1 -0
- package/assets/esri/core/workers/chunks/d5fd4780d57173f3e303.js +1 -0
- package/assets/esri/core/workers/chunks/da01e520a1ae0048e73e.js +1 -0
- package/assets/esri/core/workers/chunks/dd7603c9e5fd178c88f7.js +1 -0
- package/assets/esri/core/workers/chunks/ddcf58937924ab5a3d76.js +1 -0
- package/assets/esri/core/workers/chunks/e03a0f52d438f53a3057.js +1 -0
- package/assets/esri/core/workers/chunks/e433440fecd0114cb23d.js +1 -0
- package/assets/esri/core/workers/chunks/ea1560129e426980a4e2.js +1 -0
- package/assets/esri/core/workers/chunks/f73e2143f8d053aef092.js +1 -0
- package/assets/esri/core/workers/chunks/{0a0af540f4fe64c3d292.js → fa14238f1c308a74f843.js} +1 -1
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +3 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/RibbonLine.glsl.js +57 -72
- package/chunks/ar.js +1 -1
- package/chunks/ar2.js +1 -1
- package/chunks/bg_BG.js +1 -1
- package/chunks/bg_BG2.js +1 -1
- package/chunks/bs_BA.js +1 -1
- package/chunks/bs_BA2.js +1 -1
- package/chunks/ca_ES.js +1 -1
- package/chunks/ca_ES2.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/cs_CZ.js +1 -1
- package/chunks/cs_CZ2.js +1 -1
- package/chunks/da_DK.js +1 -1
- package/chunks/da_DK2.js +1 -1
- package/chunks/de_CH.js +1 -1
- package/chunks/de_CH2.js +1 -1
- package/chunks/de_DE.js +1 -1
- package/chunks/de_DE2.js +1 -1
- package/chunks/el_GR.js +1 -1
- package/chunks/el_GR2.js +1 -1
- package/chunks/en_CA.js +1 -1
- package/chunks/en_CA2.js +1 -1
- package/chunks/en_US.js +1 -1
- package/chunks/en_US2.js +1 -1
- package/chunks/es_ES.js +1 -1
- package/chunks/es_ES2.js +1 -1
- package/chunks/et_EE.js +1 -1
- package/chunks/et_EE2.js +1 -1
- package/chunks/fi_FI.js +1 -1
- package/chunks/fi_FI2.js +1 -1
- package/chunks/fr_FR.js +1 -1
- package/chunks/fr_FR2.js +1 -1
- package/chunks/he_IL.js +1 -1
- package/chunks/he_IL2.js +1 -1
- package/chunks/hr_HR.js +1 -1
- package/chunks/hr_HR2.js +1 -1
- package/chunks/hu_HU.js +1 -1
- package/chunks/hu_HU2.js +1 -1
- package/chunks/id_ID.js +1 -1
- package/chunks/id_ID2.js +1 -1
- package/chunks/it_IT.js +1 -1
- package/chunks/it_IT2.js +1 -1
- package/chunks/ja_JP.js +1 -1
- package/chunks/ja_JP2.js +1 -1
- package/chunks/ko_KR.js +1 -1
- package/chunks/ko_KR2.js +1 -1
- package/chunks/lt_LT.js +1 -1
- package/chunks/lt_LT2.js +1 -1
- package/chunks/lv_LV.js +1 -1
- package/chunks/lv_LV2.js +1 -1
- package/chunks/nb_NO.js +1 -1
- package/chunks/nb_NO2.js +1 -1
- package/chunks/nl_NL.js +1 -1
- package/chunks/nl_NL2.js +1 -1
- package/chunks/pl_PL.js +1 -1
- package/chunks/pl_PL2.js +1 -1
- package/chunks/pt_BR.js +1 -1
- package/chunks/pt_BR2.js +1 -1
- package/chunks/pt_PT.js +1 -1
- package/chunks/pt_PT2.js +1 -1
- package/chunks/ro_RO.js +1 -1
- package/chunks/ro_RO2.js +1 -1
- package/chunks/ru_RU.js +1 -1
- package/chunks/ru_RU2.js +1 -1
- package/chunks/sk_SK.js +1 -1
- package/chunks/sk_SK2.js +1 -1
- package/chunks/sl_SL.js +1 -1
- package/chunks/sl_SL2.js +1 -1
- package/chunks/sr_RS.js +1 -1
- package/chunks/sr_RS2.js +1 -1
- package/chunks/sv_SE.js +1 -1
- package/chunks/sv_SE2.js +1 -1
- package/chunks/th_TH.js +1 -1
- package/chunks/th_TH2.js +1 -1
- package/chunks/tr_TR.js +1 -1
- package/chunks/tr_TR2.js +1 -1
- package/chunks/uk_UA.js +1 -1
- package/chunks/uk_UA2.js +1 -1
- package/chunks/vi_VN.js +1 -1
- package/chunks/vi_VN2.js +1 -1
- package/chunks/zh_Hans.js +1 -1
- package/chunks/zh_Hans2.js +1 -1
- package/chunks/zh_Hant.js +1 -1
- package/chunks/zh_Hant2.js +1 -1
- package/config.js +1 -1
- package/core/colorUtils.js +1 -1
- package/core/image/apng.js +1 -1
- package/core/image/gif.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/staticWorkerMessages.js +5 -0
- package/geometry/projection.js +1 -1
- package/interfaces.d.ts +42 -2
- package/kernel.js +1 -1
- package/layers/support/ImageElement.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +1 -1
- package/portal/Portal.js +1 -1
- package/support/BasemapStyle.js +5 -0
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/views/2d/GoToManager.js +5 -0
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/support/engineHelpers.js +1 -1
- package/views/2d/support/screenshotUtils.js +5 -0
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/settings.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightToolConfiguration.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
- package/views/3d/analysis/Slice/settings.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/lineGraphicVisualElementUtils.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +12 -13
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/MapView.js +1 -1
- package/views/Theme.js +5 -0
- package/views/View.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/support/colorUtils.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/support/chartUtils.js +1 -1
- package/widgets/support/chartUtilsAm5.js +1 -1
- package/assets/esri/core/workers/chunks/05f3374114bce72d3560.js +0 -1
- package/assets/esri/core/workers/chunks/10028df973ef7f9531c8.js +0 -1
- package/assets/esri/core/workers/chunks/1cbb03eec9dc23ef043b.js +0 -1
- package/assets/esri/core/workers/chunks/289061552a2a64bebd76.js +0 -1
- package/assets/esri/core/workers/chunks/308eeeaec591b4eea1de.js +0 -1
- package/assets/esri/core/workers/chunks/3155c750fc5a4e04a785.js +0 -1
- package/assets/esri/core/workers/chunks/346f67995b327bca8ee0.js +0 -1
- package/assets/esri/core/workers/chunks/3736e17dd6461f74cfaf.js +0 -1
- package/assets/esri/core/workers/chunks/37e60f9ca86f9d4bf4ea.js +0 -1
- package/assets/esri/core/workers/chunks/3a0b45ecc48e23a3a5d5.js +0 -1
- package/assets/esri/core/workers/chunks/417377c8e76944f428a7.js +0 -1
- package/assets/esri/core/workers/chunks/498dca81073e1fb477b9.js +0 -1
- package/assets/esri/core/workers/chunks/536962375ce4f1394481.js +0 -1
- package/assets/esri/core/workers/chunks/64bb4093c019a02d5309.js +0 -1
- package/assets/esri/core/workers/chunks/69de4733173ee2dee6e1.js +0 -1
- package/assets/esri/core/workers/chunks/6dcffe6683a798a42c78.js +0 -1
- package/assets/esri/core/workers/chunks/7a898d167029ee11a680.js +0 -1
- package/assets/esri/core/workers/chunks/7a973d70e6bc42d804ee.js +0 -1
- package/assets/esri/core/workers/chunks/7d9d2629af373c84624f.js +0 -1
- package/assets/esri/core/workers/chunks/885cb0da78e6853b23a4.js +0 -1
- package/assets/esri/core/workers/chunks/8e28862296972e9e6f82.js +0 -1
- package/assets/esri/core/workers/chunks/928431e1c449c6054547.js +0 -1
- package/assets/esri/core/workers/chunks/afdf30439d71a7cc19ae.js +0 -1
- package/assets/esri/core/workers/chunks/b1fa1571fd98d3b8dffe.js +0 -1
- package/assets/esri/core/workers/chunks/b20167d9163d0ee74b65.js +0 -1
- package/assets/esri/core/workers/chunks/b2a0e3e1dfccda7ed12e.js +0 -1
- package/assets/esri/core/workers/chunks/c09db831248054600e16.js +0 -1
- package/assets/esri/core/workers/chunks/dcccc9760998271254b5.js +0 -1
- package/assets/esri/core/workers/chunks/ddea45acae89759e57fa.js +0 -1
- package/assets/esri/core/workers/chunks/e039108eb3a592f6d8e3.js +0 -1
- package/assets/esri/core/workers/chunks/e70314ac10cc1f8f9f86.js +0 -1
- package/assets/esri/core/workers/chunks/f2d399b394a1a9156214.js +0 -1
- package/assets/esri/core/workers/chunks/f74d4e1eecec06f84ee2.js +0 -1
- package/assets/esri/core/workers/chunks/fb7eff7f76386f81d57b.js +0 -1
- package/assets/esri/core/workers/chunks/fe277d33b5b8a11c76df.js +0 -1
- package/core/analysisThemeUtils.js +0 -5
- package/views/support/createScreenshotPlan.js +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3656],{46851:(t,n,e)=>{e.d(n,{R:()=>i,a:()=>s,g:()=>o,t:()=>u});let r=1e-6;function o(){return r}const i=Math.random,a=Math.PI/180,c=180/Math.PI;function u(t){return t*a}function s(t){return t*c}Object.freeze(Object.defineProperty({__proto__:null,RANDOM:i,equals:function(t,n){return Math.abs(t-n)<=r*Math.max(1,Math.abs(t),Math.abs(n))},getEpsilon:o,setEpsilon:function(t){r=t},toDegree:s,toRadian:u},Symbol.toStringTag,{value:"Module"}))},97323:(t,n,e)=>{function r(){return[0,0]}function o(t,n){return[t,n]}function i(t,n){return new Float64Array(t,n,2)}function a(){return o(1,1)}function c(){return o(1,0)}function u(){return o(0,1)}e.d(n,{a:()=>r,c:()=>i,f:()=>o});const s=a(),f=c(),l=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:s,UNIT_X:f,UNIT_Y:l,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:r,createView:i,fromArray:function(t,n=[0,0]){const e=Math.min(2,t.length);for(let r=0;r<e;++r)n[r]=t[r];return n},fromValues:o,ones:a,unitX:c,unitY:u,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},17896:(t,n,e)=>{e.d(n,{A:()=>P,B:()=>V,C:()=>f,E:()=>l,a:()=>u,b:()=>s,c:()=>a,d:()=>m,e:()=>E,f:()=>S,g:()=>g,h:()=>p,i:()=>N,j:()=>F,k:()=>w,l:()=>i,m:()=>b,n:()=>I,p:()=>O,q:()=>A,r:()=>M,s:()=>c,t:()=>R,u:()=>h,v:()=>d,w:()=>T,x:()=>U,y:()=>v});var r=e(65617),o=e(46851);function i(t){const n=t[0],e=t[1],r=t[2];return Math.sqrt(n*n+e*e+r*r)}function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function c(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function u(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function s(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function f(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function l(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function h(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t}function M(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t}function d(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t}function T(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t}function g(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function A(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}function N(t,n){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.sqrt(e*e+r*r+o*o)}function m(t,n){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function O(t){const n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function I(t,n){const e=n[0],r=n[1],o=n[2];let i=e*e+r*r+o*o;return i>0&&(i=1/Math.sqrt(i),t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i),t}function E(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function S(t,n,e){const r=n[0],o=n[1],i=n[2],a=e[0],c=e[1],u=e[2];return t[0]=o*u-i*c,t[1]=i*a-r*u,t[2]=r*c-o*a,t}function p(t,n,e,r){const o=n[0],i=n[1],a=n[2];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t[2]=a+r*(e[2]-a),t}function b(t,n,e){const r=n[0],o=n[1],i=n[2];return t[0]=e[0]*r+e[4]*o+e[8]*i+e[12],t[1]=e[1]*r+e[5]*o+e[9]*i+e[13],t[2]=e[2]*r+e[6]*o+e[10]*i+e[14],t}function R(t,n,e){const r=n[0],o=n[1],i=n[2];return t[0]=r*e[0]+o*e[3]+i*e[6],t[1]=r*e[1]+o*e[4]+i*e[7],t[2]=r*e[2]+o*e[5]+i*e[8],t}function v(t,n,e){const r=e[0],o=e[1],i=e[2],a=e[3],c=n[0],u=n[1],s=n[2];let f=o*s-i*u,l=i*c-r*s,h=r*u-o*c,M=o*h-i*l,d=i*f-r*h,T=r*l-o*f;const g=2*a;return f*=g,l*=g,h*=g,M*=2,d*=2,T*=2,t[0]=c+f+M,t[1]=u+l+d,t[2]=s+h+T,t}const y=(0,r.c)(),L=(0,r.c)();function w(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function U(t,n,e){const r=e[0]-n[0],o=e[1]-n[1],i=e[2]-n[2];let a=r*r+o*o+i*i;return a>0?(a=1/Math.sqrt(a),t[0]=r*a,t[1]=o*a,t[2]=i*a,t):(t[0]=0,t[1]=0,t[2]=0,t)}const P=s,D=f,_=l,F=N,C=m,V=i,x=O;Object.freeze(Object.defineProperty({__proto__:null,abs:h,add:u,angle:function(t,n){a(y,t),a(L,n),I(y,y),I(L,L);const e=E(y,L);return e>1?0:e<-1?Math.PI:Math.acos(e)},bezier:function(t,n,e,r,o,i){const a=1-i,c=a*a,u=i*i,s=c*a,f=3*i*c,l=3*u*a,h=u*i;return t[0]=n[0]*s+e[0]*f+r[0]*l+o[0]*h,t[1]=n[1]*s+e[1]*f+r[1]*l+o[1]*h,t[2]=n[2]*s+e[2]*f+r[2]*l+o[2]*h,t},ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t},copy:a,cross:S,direction:U,dist:F,distance:N,div:_,divide:l,dot:E,equals:function(t,n){if(t===n)return!0;const e=t[0],r=t[1],i=t[2],a=n[0],c=n[1],u=n[2],s=(0,o.g)();return Math.abs(e-a)<=s*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-c)<=s*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-u)<=s*Math.max(1,Math.abs(i),Math.abs(u))},exactEquals:w,floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t},hermite:function(t,n,e,r,o,i){const a=i*i,c=a*(2*i-3)+1,u=a*(i-2)+i,s=a*(i-1),f=a*(3-2*i);return t[0]=n[0]*c+e[0]*u+r[0]*s+o[0]*f,t[1]=n[1]*c+e[1]*u+r[1]*s+o[1]*f,t[2]=n[2]*c+e[2]*u+r[2]*s+o[2]*f,t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t},len:V,length:i,lerp:p,max:T,min:d,mul:D,multiply:f,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t},normalize:I,random:function(t,n){n=n||1;const e=o.R,r=2*e()*Math.PI,i=2*e()-1,a=Math.sqrt(1-i*i)*n;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*n,t},rotateX:function(t,n,e,r){const o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[0],i[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),i[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t},rotateY:function(t,n,e,r){const o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),i[1]=o[1],i[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t},rotateZ:function(t,n,e,r){const o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),i[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),i[2]=o[2],t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t},scale:g,scaleAndAdd:A,set:c,sign:M,sqrDist:C,sqrLen:x,squaredDistance:m,squaredLength:O,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:P,subtract:s,transformMat3:R,transformMat4:b,transformQuat:v},Symbol.toStringTag,{value:"Module"}))},65617:(t,n,e)=>{function r(){return[0,0,0]}function o(t){return[t[0],t[1],t[2]]}function i(t,n,e){return[t,n,e]}function a(t,n=[0,0,0]){const e=Math.min(3,t.length);for(let r=0;r<e;++r)n[r]=t[r];return n}function c(t,n){return new Float64Array(t,n,3)}function u(){return i(1,1,1)}function s(){return i(1,0,0)}function f(){return i(0,1,0)}function l(){return i(0,0,1)}e.d(n,{O:()=>M,U:()=>g,Z:()=>h,a:()=>o,b:()=>c,c:()=>r,d:()=>d,e:()=>T,f:()=>i,g:()=>a});const h=[0,0,0],M=u(),d=s(),T=f(),g=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:M,UNIT_X:d,UNIT_Y:T,UNIT_Z:g,ZEROS:h,clone:o,create:r,createView:c,fromArray:a,fromValues:i,ones:u,unitX:s,unitY:f,unitZ:l,zeros:function(){return[0,0,0]}},Symbol.toStringTag,{value:"Module"}))},98766:(t,n,e)=>{e.d(n,{a:()=>a,b:()=>f,c:()=>o,d:()=>g,e:()=>M,f:()=>d,g:()=>N,h:()=>m,l:()=>A,n:()=>T,s:()=>i});var r=e(46851);function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function i(t,n,e,r,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t}function a(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t}function c(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}function u(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t[3]=n[3]*e[3],t}function s(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t[3]=n[3]/e[3],t}function f(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t}function l(t,n){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],i=n[3]-t[3];return Math.sqrt(e*e+r*r+o*o+i*i)}function h(t,n){const e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],i=n[3]-t[3];return e*e+r*r+o*o+i*i}function M(t){const n=t[0],e=t[1],r=t[2],o=t[3];return Math.sqrt(n*n+e*e+r*r+o*o)}function d(t){const n=t[0],e=t[1],r=t[2],o=t[3];return n*n+e*e+r*r+o*o}function T(t,n){const e=n[0],r=n[1],o=n[2],i=n[3];let a=e*e+r*r+o*o+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e*a,t[1]=r*a,t[2]=o*a,t[3]=i*a),t}function g(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function A(t,n,e,r){const o=n[0],i=n[1],a=n[2],c=n[3];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t[2]=a+r*(e[2]-a),t[3]=c+r*(e[3]-c),t}function N(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function m(t,n){const e=t[0],o=t[1],i=t[2],a=t[3],c=n[0],u=n[1],s=n[2],f=n[3],l=(0,r.g)();return Math.abs(e-c)<=l*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(o-u)<=l*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(i-s)<=l*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-f)<=l*Math.max(1,Math.abs(a),Math.abs(f))}const O=c,I=u,E=s,S=l,p=h,b=M,R=d;Object.freeze(Object.defineProperty({__proto__:null,add:a,ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t},copy:o,dist:S,distance:l,div:E,divide:s,dot:g,equals:m,exactEquals:N,floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t},len:b,length:M,lerp:A,max:function(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t[3]=Math.max(n[3],e[3]),t},min:function(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t[3]=Math.min(n[3],e[3]),t},mul:I,multiply:u,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t},normalize:T,random:function(t,n){const e=r.R;let o,i,a,c,u,s;n=n||1;do{o=2*e()-1,i=2*e()-1,u=o*o+i*i}while(u>=1);do{a=2*e()-1,c=2*e()-1,s=a*a+c*c}while(s>=1);const f=Math.sqrt((1-u)/s);return t[0]=n*o,t[1]=n*i,t[2]=n*a*f,t[3]=n*c*f,t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t},scale:f,scaleAndAdd:function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t},set:i,sqrDist:p,sqrLen:R,squaredDistance:h,squaredLength:d,str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},sub:O,subtract:c,transformMat4:function(t,n,e){const r=n[0],o=n[1],i=n[2],a=n[3];return t[0]=e[0]*r+e[4]*o+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*o+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*o+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*o+e[11]*i+e[15]*a,t},transformQuat:function(t,n,e){const r=n[0],o=n[1],i=n[2],a=e[0],c=e[1],u=e[2],s=e[3],f=s*r+c*i-u*o,l=s*o+u*r-a*i,h=s*i+a*o-c*r,M=-a*r-c*o-u*i;return t[0]=f*s+M*-a+l*-u-h*-c,t[1]=l*s+M*-c+h*-a-f*-u,t[2]=h*s+M*-u+f*-c-l*-a,t[3]=n[3],t}},Symbol.toStringTag,{value:"Module"}))},88669:(t,n,e)=>{function r(){return[0,0,0,0]}function o(t,n,e,r){return[t,n,e,r]}function i(t,n){return new Float64Array(t,n,4)}function a(){return o(1,1,1,1)}function c(){return o(1,0,0,0)}function u(){return o(0,1,0,0)}function s(){return o(0,0,1,0)}function f(){return o(0,0,0,1)}e.d(n,{a:()=>i,c:()=>r,f:()=>o});const l=a(),h=c(),M=u(),d=s(),T=f();Object.freeze(Object.defineProperty({__proto__:null,ONES:l,UNIT_W:T,UNIT_X:h,UNIT_Y:M,UNIT_Z:d,ZEROS:[0,0,0,0],clone:function(t){return[t[0],t[1],t[2],t[3]]},create:r,createView:i,fromArray:function(t,n=[0,0,0,0]){const e=Math.min(4,t.length);for(let r=0;r<e;++r)n[r]=t[r];return n},fromValues:o,ones:a,unitW:f,unitX:c,unitY:u,unitZ:s,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))},22021:(t,n,e)=>{e.d(n,{BV:()=>f,Kt:()=>h,Sf:()=>i,Vl:()=>s,ZF:()=>l,_3:()=>O,jE:()=>N,oK:()=>g,oc:()=>m,t7:()=>u,uZ:()=>a,wt:()=>c});var r=e(17896);e(98766);const o=new Float32Array(1);function i(t){--t;for(let n=1;n<32;n<<=1)t|=t>>n;return t+1}function a(t,n,e){return Math.min(Math.max(t,n),e)}function c(t){return 0==(t&t-1)}function u(t,n,e){return t+(n-t)*e}function s(t){return t*Math.PI/180}function f(t){return 180*t/Math.PI}function l(t){return Math.acos(a(t,-1,1))}function h(t){return Math.asin(a(t,-1,1))}function M(t,n,e=1e-6){return t===n||!(!Number.isFinite(t)||!Number.isFinite(n))&&(t>n?t-n:n-t)<=e}const d=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));const T=BigInt("1000000");function g(t){return A(Math.max(-O,Math.min(t,O)))}function A(t){return o[0]=t,o[0]}function N(t,n){const e=(0,r.l)(t),o=h(t[2]/e),i=Math.atan2(t[1]/e,t[0]/e);return(0,r.s)(n,e,o,i),n}function m(t){const n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],r=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(M(n,1)&&M(e,1)&&M(r,1))}!function(t){const n=function(t){return d.setFloat64(0,t),d.getBigInt64(0)}(t=Math.abs(t)),e=function(t){return d.setBigInt64(0,t),d.getFloat64(0)}(n<=T?T:n-T);Math.abs(t-e)}(1);const O=A(34028234663852886e22)},47545:(t,n,e)=>{e.d(n,{d:()=>i});var r=e(22021),o=e(24882);function i(t,n,e){const i=Array.isArray(t),f=i?t.length/n:t.byteLength/(4*n),l=i?t:new Uint32Array(t,0,f*n),h=e?.minReduction??0,M=e?.originalIndices||null,d=M?M.length:0,T=e?.componentOffsets||null;let g=0;if(T)for(let t=0;t<T.length-1;t++){const n=T[t+1]-T[t];n>g&&(g=n)}else g=f;const A=Math.floor(1.1*g)+1;(null==s||s.length<2*A)&&(s=new Uint32Array((0,r.Sf)(2*A)));for(let t=0;t<2*A;t++)s[t]=0;let N=0;const m=!!T&&!!M,O=m?d:f;let I=(0,o.$z)(f);const E=new Uint32Array(d),S=1.96;let p=0!==h?Math.ceil(4*S*S/(h*h)*h*(1-h)):O,b=1,R=T?T[1]:O;for(let t=0;t<O;t++){if(t===p){const n=1-N/t;if(n+S*Math.sqrt(n*(1-n)/t)<h)return null;p*=2}if(t===R){for(let t=0;t<2*A;t++)s[t]=0;if(M)for(let t=T[b-1];t<T[b];t++)E[t]=I[M[t]];R=T[++b]}const e=m?M[t]:t,r=e*n,o=u(l,r,n);let i=o%A,c=N;for(;0!==s[2*i+1];){if(s[2*i]===o){const t=s[2*i+1]-1;if(a(l,r,t*n,n)){c=I[t];break}}i++,i>=A&&(i-=A)}c===N&&(s[2*i]=o,s[2*i+1]=e+1,N++),I[e]=c}if(0!==h&&1-N/f<h)return null;if(m){for(let t=T[b-1];t<E.length;t++)E[t]=I[M[t]];I=(0,o.mi)(E)}const v=i?new Array(N):new Uint32Array(N*n);N=0;for(let t=0;t<O;t++)I[t]===N&&(c(l,(m?M[t]:t)*n,v,N*n,n),N++);if(M&&!m){const t=new Uint32Array(d);for(let n=0;n<t.length;n++)t[n]=I[M[n]];I=(0,o.mi)(t)}return{buffer:Array.isArray(v)?v:v.buffer,indices:I,uniqueCount:N}}function a(t,n,e,r){for(let o=0;o<r;o++)if(t[n+o]!==t[e+o])return!1;return!0}function c(t,n,e,r,o){for(let i=0;i<o;i++)e[r+i]=t[n+i]}function u(t,n,e){let r=0;for(let o=0;o<e;o++)r=t[n+o]+r|0,r=r+(r<<11)+(r>>>2)|0;return r>>>0}let s=null},5329:(t,n,e)=>{e.d(n,{K:()=>i});var r=e(35371),o=e(21968);function i(t,n=0){const e=t.stride;return Array.from(t.fields.keys()).filter((n=>{const e=t.fields.get(n)?.optional;return!(e&&e.glPadding)})).map((r=>{const i=t.fields.get(r),c=i.constructor.ElementCount,u=a(i.constructor.ElementType),s=i.offset,f=!(!i.optional||!i.optional.glNormalized);return new o.G(r,c,u,s,e,f,n)}))}function a(t){const n=c[t];if(n)return n;throw new Error("BufferType not supported in WebGL")}const c={u8:r.g.UNSIGNED_BYTE,u16:r.g.UNSIGNED_SHORT,u32:r.g.UNSIGNED_INT,i8:r.g.BYTE,i16:r.g.SHORT,i32:r.g.INT,f32:r.g.FLOAT}},35065:(t,n,e)=>{var r;e.d(n,{T:()=>r}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.AUXPOS1="auxpos1",t.AUXPOS2="auxpos2",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMALA="normalA",t.NORMALB="normalB",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.U8PADDING="u8padding",t.U16PADDING="u16padding",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(r||(r={}))},17288:(t,n,e)=>{e.d(n,{Hr:()=>f,dG:()=>s,tf:()=>a});var r=e(5329),o=e(65576),i=e(35065);const a=(0,o.U$)().vec3f(i.T.POSITION).u16(i.T.COMPONENTINDEX).u16(i.T.U16PADDING),c=(0,o.U$)().vec2u8(i.T.SIDENESS),u=((0,r.K)(c),(0,o.U$)().vec3f(i.T.POSITION0).vec3f(i.T.POSITION1).u16(i.T.COMPONENTINDEX).u8(i.T.VARIANTOFFSET,{glNormalized:!0}).u8(i.T.VARIANTSTROKE).u8(i.T.VARIANTEXTENSION,{glNormalized:!0}).u8(i.T.U8PADDING,{glPadding:!0}).u16(i.T.U16PADDING,{glPadding:!0})),s=u.clone().vec3f(i.T.NORMAL),f=u.clone().vec3f(i.T.NORMALA).vec3f(i.T.NORMALB);new Map([[i.T.POSITION0,0],[i.T.POSITION1,1],[i.T.COMPONENTINDEX,2],[i.T.VARIANTOFFSET,3],[i.T.VARIANTSTROKE,4],[i.T.VARIANTEXTENSION,5],[i.T.NORMAL,6],[i.T.NORMALA,6],[i.T.NORMALB,7],[i.T.SIDENESS,8]])},97411:(t,n,e)=>{e.d(n,{n:()=>f});var r=e(67676),o=e(22021),i=e(17896),a=e(65617);const c=-1;var u,s;function f(t,n,e,a=A){const u=t.vertices.position,s=t.vertices.componentIndex,f=(0,o.Vl)(a.anglePlanar),g=(0,o.Vl)(a.angleSignificantEdge),N=Math.cos(g),m=Math.cos(f),O=T.edge,I=O.position0,E=O.position1,S=O.faceNormal0,p=O.faceNormal1,b=d(t),R=function(t){const n=t.faces.length/3,e=t.faces,r=t.neighbors;let o=0;for(let t=0;t<n;t++){const n=r[3*t],i=r[3*t+1],a=r[3*t+2],u=e[3*t],s=e[3*t+1],f=e[3*t+2];o+=n===c||u<s?1:0,o+=i===c||s<f?1:0,o+=a===c||f<u?1:0}const i=new Int32Array(4*o);let a=0;for(let t=0;t<n;t++){const n=r[3*t],o=r[3*t+1],u=r[3*t+2],s=e[3*t],f=e[3*t+1],l=e[3*t+2];(n===c||s<f)&&(i[a++]=s,i[a++]=f,i[a++]=t,i[a++]=n),(o===c||f<l)&&(i[a++]=f,i[a++]=l,i[a++]=t,i[a++]=o),(u===c||l<s)&&(i[a++]=l,i[a++]=s,i[a++]=t,i[a++]=u)}return i}(t),v=R.length/4,y=n.allocate(v);let L=0;const w=v,U=e.allocate(w);let P=0,D=0,_=0;const F=(0,r.w6)(0,v),C=new Float32Array(v);C.forEach(((t,n,e)=>{u.getVec(R[4*n],I),u.getVec(R[4*n+1],E),e[n]=(0,i.i)(I,E)})),F.sort(((t,n)=>C[n]-C[t]));const V=new Array,x=new Array;for(let t=0;t<v;t++){const r=F[t],o=C[r],a=R[4*r],d=R[4*r+1],T=R[4*r+2],g=R[4*r+3],A=g===c;if(u.getVec(a,I),u.getVec(d,E),A)(0,i.s)(S,b[3*T],b[3*T+1],b[3*T+2]),(0,i.c)(p,S),O.componentIndex=s.get(a),O.cosAngle=(0,i.e)(S,p);else{if((0,i.s)(S,b[3*T],b[3*T+1],b[3*T+2]),(0,i.s)(p,b[3*g],b[3*g+1],b[3*g+2]),O.componentIndex=s.get(a),O.cosAngle=(0,i.e)(S,p),h(O,m))continue;O.cosAngle<-.9999&&(0,i.c)(p,S)}D+=o,_++,A||l(O,N)?(n.write(y,L++,O),V.push(o)):M(O,f)&&(e.write(U,P++,O),x.push(o))}const B=new Float32Array(V.reverse()),q=new Float32Array(x.reverse());return{regular:{instancesData:n.trim(y,L),lodInfo:{lengths:B}},silhouette:{instancesData:e.trim(U,P),lodInfo:{lengths:q}},averageEdgeLength:D/_}}function l(t,n){return t.cosAngle<n}function h(t,n){return t.cosAngle>n}function M(t,n){const e=(0,o.ZF)(t.cosAngle),r=T.fwd,a=T.ortho;return(0,i.x)(r,t.position1,t.position0),e*((0,i.e)((0,i.f)(a,t.faceNormal0,t.faceNormal1),r)>0?-1:1)>n}function d(t){const n=t.faces.length/3,e=t.vertices.position,r=t.faces,o=g.v0,a=g.v1,c=g.v2,u=new Float32Array(3*n);for(let t=0;t<n;t++){const n=r[3*t],s=r[3*t+1],f=r[3*t+2];e.getVec(n,o),e.getVec(s,a),e.getVec(f,c),(0,i.b)(a,a,o),(0,i.b)(c,c,o),(0,i.f)(o,a,c),(0,i.n)(o,o),u[3*t]=o[0],u[3*t+1]=o[1],u[3*t+2]=o[2]}return u}(s=u||(u={}))[s.SOLID=0]="SOLID",s[s.SKETCH=1]="SKETCH";const T={edge:{position0:(0,a.c)(),position1:(0,a.c)(),faceNormal0:(0,a.c)(),faceNormal1:(0,a.c)(),componentIndex:0,cosAngle:0},ortho:(0,a.c)(),fwd:(0,a.c)()},g={v0:(0,a.c)(),v1:(0,a.c)(),v2:(0,a.c)()},A={anglePlanar:4,angleSignificantEdge:35}},212:(t,n,e)=>{e.d(n,{Kl:()=>b,n_:()=>U,kY:()=>R,Yr:()=>w});var r=e(47545);function o(t,n,e){const r=n/3,o=new Uint32Array(e+1),i=new Uint32Array(e+1),a=(t,n)=>{t<n?o[t+1]++:i[n+1]++};for(let n=0;n<r;n++){const e=t[3*n],r=t[3*n+1],o=t[3*n+2];a(e,r),a(r,o),a(o,e)}let c=0,u=0;for(let t=0;t<e;t++){const n=o[t+1],e=i[t+1];o[t+1]=c,i[t+1]=u,c+=n,u+=e}const s=new Uint32Array(6*r),f=o[e],l=(t,n,e)=>{if(t<n){const r=o[t+1]++;s[2*r]=n,s[2*r+1]=e}else{const r=i[n+1]++;s[2*f+2*r]=t,s[2*f+2*r+1]=e}};for(let n=0;n<r;n++){const e=t[3*n],r=t[3*n+1],o=t[3*n+2];l(e,r,n),l(r,o,n),l(o,e,n)}const h=(t,n)=>{const e=2*t,r=n-t;for(let t=1;t<r;t++){const n=s[e+2*t],r=s[e+2*t+1];let o=t-1;for(;o>=0&&s[e+2*o]>n;o--)s[e+2*o+2]=s[e+2*o],s[e+2*o+3]=s[e+2*o+1];s[e+2*o+2]=n,s[e+2*o+3]=r}};for(let t=0;t<e;t++)h(o[t],o[t+1]),h(f+i[t],f+i[t+1]);const M=new Int32Array(3*r),d=(n,e)=>n===t[3*e]?0:n===t[3*e+1]?1:n===t[3*e+2]?2:-1,T=(t,n)=>{const e=d(t,n);M[3*n+e]=-1},g=(t,n,e,r)=>{const o=d(t,n);M[3*n+o]=r;const i=d(e,r);M[3*r+i]=n};for(let t=0;t<e;t++){let n=o[t];const e=o[t+1];let r=i[t];const a=i[t+1];for(;n<e&&r<a;){const e=s[2*n],o=s[2*f+2*r];e===o?(g(t,s[2*n+1],o,s[2*f+2*r+1]),n++,r++):e<o?(T(t,s[2*n+1]),n++):(T(o,s[2*f+2*r+1]),r++)}for(;n<e;)T(t,s[2*n+1]),n++;for(;r<a;)T(s[2*f+2*r],s[2*f+2*r+1]),r++}return M}var i=e(65576),a=e(35065),c=e(17288),u=e(77734),s=e(17896),f=e(65617),l=e(5329);class h{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?A:g}write(t,n,e){const r=this._edgeHashFunction(e);S.seed=r;const o=S.getIntRange(0,255),i=S.getIntRange(0,this.settings.variants-1),a=S.getFloat(),c=255*(.5*function(t,n){const e=t<0?-1:1;return Math.abs(t)**1.2*e}(-(1-Math.min(a/.7,1))+Math.max(0,a-.7)/(1-.7))+.5);t.position0.setVec(n,e.position0),t.position1.setVec(n,e.position1),t.componentIndex.set(n,e.componentIndex),t.variantOffset.set(n,o),t.variantStroke.set(n,i),t.variantExtension.set(n,c)}trim(t,n){return t.slice(0,n)}}const M=new Float32Array(6),d=new Uint32Array(M.buffer),T=new Uint32Array(1);function g(t){const n=M;n[0]=t.position0[0],n[1]=t.position0[1],n[2]=t.position0[2],n[3]=t.position1[0],n[4]=t.position1[1],n[5]=t.position1[2],T[0]=5381;for(let t=0;t<d.length;t++)T[0]=31*T[0]+d[t];return T[0]}function A(t){const n=M;n[0]=m(t.position0[0]),n[1]=m(t.position0[1]),n[2]=m(t.position0[2]),n[3]=m(t.position1[0]),n[4]=m(t.position1[1]),n[5]=m(t.position1[2]),T[0]=5381;for(let t=0;t<d.length;t++)T[0]=31*T[0]+d[t];return T[0]}const N=1e4;function m(t){return Math.round(t*N)/N}class O{constructor(){this._commonWriter=new h}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.dG.createBuffer(t)}write(t,n,e){this._commonWriter.write(t,n,e),(0,s.a)(E,e.faceNormal0,e.faceNormal1),(0,s.n)(E,E),t.normal.setVec(n,E)}trim(t,n){return this._commonWriter.trim(t,n)}}O.Layout=c.dG,O.glLayout=(0,l.K)(c.dG,1);class I{constructor(){this._commonWriter=new h}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.Hr.createBuffer(t)}write(t,n,e){this._commonWriter.write(t,n,e),t.normalA.setVec(n,e.faceNormal0),t.normalB.setVec(n,e.faceNormal1)}trim(t,n){return this._commonWriter.trim(t,n)}}I.Layout=c.Hr,I.glLayout=(0,l.K)(c.Hr,1);const E=(0,f.c)(),S=new u.Z;var p=e(97411);function b(t){const n=R(t.data,t.skipDeduplicate,t.indices,t.indicesLength);return y.updateSettings(t.writerSettings),L.updateSettings(t.writerSettings),(0,p.n)(n,y,L)}function R(t,n,e,i){if(n){const n=o(e,i,t.count);return new v(e,i,n,t)}const a=(0,r.d)(t.buffer,t.stride/4,{originalIndices:e,originalIndicesLength:i}),u=o(a.indices,i,a.uniqueCount);return{faces:a.indices,facesLength:a.indices.length,neighbors:u,vertices:c.tf.createView(a.buffer)}}class v{constructor(t,n,e,r){this.faces=t,this.facesLength=n,this.neighbors=e,this.vertices=r}}const y=new O,L=new I,w=(0,i.U$)().vec3f(a.T.POSITION0).vec3f(a.T.POSITION1),U=(0,i.U$)().vec3f(a.T.POSITION0).vec3f(a.T.POSITION1).u16(a.T.COMPONENTINDEX).u16(a.T.U16PADDING,{glPadding:!0})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7937],{48853:(e,t,s)=>{s.d(t,{Qn:()=>h,iG:()=>u});var r,i=s(27535),n=s(17126);class a{}a.instance=new n.vF("Etc/UTC"),(r||(r={})).TimeZoneNotRecognised="TimeZoneNotRecognised";const o={[r.TimeZoneNotRecognised]:"Timezone identifier has not been recognised."};class l extends Error{constructor(e,t){super((0,i.Hy)(o[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,l)}}class u{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,r=0,i=0,a=0,o=0,l){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(r)||isNaN(i)||isNaN(a)||isNaN(o))return null;let d=0;const c=n.ou.local(e,t).daysInMonth;s<1&&(d=s-1,s=1),s>c&&(d=s-c,s=c);let g=0;t>12?(g=t-12,t=12):t<1&&(g=t-1,t=1);let f=0;i>59?(f=i-59,i=59):i<0&&(f=i,i=0);let p=0;a>59?(p=a-59,a=59):a<0&&(p=a,a=0);let _=0;o>999?(_=o-999,o=999):o<0&&(_=o,o=0);let m=n.ou.fromObject({day:s,year:e,month:t,hour:r,minute:i,second:a,millisecond:o},{zone:h(l)});return 0!==g&&(m=m.plus({months:g})),0!==d&&(m=m.plus({days:d})),0!==f&&(m=m.plus({minutes:f})),0!==p&&(m=m.plus({seconds:p})),0!==_&&(m=m.plus({milliseconds:_})),new u(m)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=h(t);return e.isUnknownTimeZone||s===a.instance?u.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new u(e._date.setZone(t))}static dateJSToArcadeDate(e){return new u(n.ou.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){return new u(n.ou.fromJSDate(e,{zone:t}))}static unknownEpochToArcadeDate(e){return new u(n.ou.fromMillis(e,{zone:a.instance}))}static unknownDateJSToArcadeDate(e){return new u(n.ou.fromMillis(e.getTime(),{zone:a.instance}))}static epochToArcadeDate(e,t="system"){return new u(n.ou.fromMillis(e,{zone:t}))}static dateTimeToArcadeDate(e){return new u(e)}clone(){return new u(this._date)}changeTimeZone(e){const t=h(e);return u.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=h(t);return e.zone===a.instance||s===a.instance?u.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new u(e.setZone(s))}static nowToArcadeDate(e){return new u(n.ou.fromJSDate(new Date,{zone:e}))}static nowUTCToArcadeDate(){return new u(n.ou.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===u.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===a.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"utc":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new u(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toFormat(e,t){return this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLString(){return"timestamp '"+this._date.toFormat("yyyy-LL-dd HH:mm:ss")+"'"}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new u(this._date.toUTC())}toLocal(){return new u(this._date.toLocal())}toString(){return this.toISOString(!0)}}function h(e){if(e instanceof n.ld)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"utc";if("unknown"===e.toLowerCase())return a.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const t=n.Qf.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}const t=n.vF.create(e);if(!t.isValid)throw new l(r.TimeZoneNotRecognised);return t}},85839:(e,t,s)=>{s.d(t,{nu:()=>n}),s(48853);var r=s(99514),i=(s(80216),s(42799));s(17126);class n{constructor(){this.dateTimeReferenceMetaData=null,this._fieldTimeZoneIndex={},this._fieldIndex=null,this._ianaPreferred=null,this._ianaTimeInfo=null,this._ianaEditFields=null,this._ianaLayerDateFields=null}static create(e,t){const s=new n;return s.dateTimeReferenceMetaData=t,s._fieldIndex=e instanceof r.Z?e:new r.Z(e),s}static createFromLayer(e){if(!e)return null;if(!e.fieldsIndex)return!e.declaredClass&&e.fields?n.create(e.fields,e):null;const t=new n;return t._fieldIndex=e.fieldsIndex,t.dateTimeReferenceMetaData={timeInfo:e?.timeInfo?.toJSON()??null,editFieldsInfo:e?.editFieldsInfo?.toJSON()??null,dateFieldsTimeReference:e?.dateFieldsTimeReference?.toJSON()??null,preferredTimeReference:e?.preferredTimeReference?.toJSON()??null,datesInUnknownTimezone:!0===e?.datesInUnknownTimezone},t}fieldTimeZone(e){const t=this._fieldIndex?.get(e);if(!t)return null;if("date"!==t.type&&"esriFieldTypeDate"!==t.type)return null;const s=this._fieldTimeZoneIndex[t.name];if(void 0!==s)return s;const r=[{field:this.dateTimeReferenceMetaData?.editFieldsInfo?.creationDateField,timeReference:this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference,isunknown:!0===this.dateTimeReferenceMetaData?.datesInUnknownTimezone},{field:this.dateTimeReferenceMetaData?.editFieldsInfo?.editDateField,timeReference:this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference,isunknown:!0===this.dateTimeReferenceMetaData?.datesInUnknownTimezone},{field:this.dateTimeReferenceMetaData?.timeInfo?.startTimeField,timeReference:this.dateTimeReferenceMetaData?.timeInfo?.timeReference,isunknown:!0===this.dateTimeReferenceMetaData?.datesInUnknownTimezone},{field:this.dateTimeReferenceMetaData?.timeInfo?.endTimeField,timeReference:this.dateTimeReferenceMetaData?.timeInfo?.timeReference,isunknown:!0===this.dateTimeReferenceMetaData?.datesInUnknownTimezone}];for(const e of r)if(e.field===t.name){const s=this.convertToIANA(e.timeReference,e.isunknown);return this._fieldTimeZoneIndex[t.name]=s,s}const i=this.convertToIANA(this.dateTimeReferenceMetaData?.dateFieldsTimeReference,this.dateTimeReferenceMetaData?.datesInUnknownTimezone);return this._fieldTimeZoneIndex[t.name]=i,i}convertToIANA(e,t){return t?"unknown":function(e){return e?.timeZoneIANA?e?.timeZoneIANA:e?.timeZone?(0,i.G)(e,""):""}(e)}get layerPreferredTimeZone(){if(null!==this._ianaPreferred)return this._ianaPreferred;this._ianaPreferred="";const e=this.dateTimeReferenceMetaData?.preferredTimeReference;return this._ianaPreferred=this.convertToIANA(e,!0===this.dateTimeReferenceMetaData?.datesInUnknownTimezone),this._ianaPreferred}get layerTimeInfoTimeZone(){if(null!==this._ianaTimeInfo)return this._ianaTimeInfo;this._ianaTimeInfo="";const e=this.dateTimeReferenceMetaData?.timeInfo?.timeReference;return this._ianaTimeInfo=this.convertToIANA(e,!1),this._ianaTimeInfo}get layerEditFieldsTimeZone(){if(null!==this._ianaEditFields)return this._ianaEditFields;this._ianaEditFields="";const e=this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference;return this._ianaEditFields=this.convertToIANA(e,this.dateTimeReferenceMetaData?.datesInUnknownTimezone),this._ianaEditFields}get layerDateFieldsTimeZone(){if(null!==this._ianaLayerDateFields)return this._ianaLayerDateFields;this._ianaLayerDateFields="";const e=this.dateTimeReferenceMetaData?.dateFieldsTimeReference;return this._ianaLayerDateFields=this.convertToIANA(e,!0===this.dateTimeReferenceMetaData?.datesInUnknownTimezone),this._ianaLayerDateFields}}},96794:(e,t,s)=>{s.d(t,{r:()=>i});var r=s(88764);function i(e,t){if(!(this instanceof i))return new i(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this.toBBox=t:this._initFormat(t)),this.clear()}function n(e,t,s){if(!s)return t.indexOf(e);for(var r=0;r<t.length;r++)if(s(e,t[r]))return r;return-1}function a(e,t){o(e,0,e.children.length,t,e)}function o(e,t,s,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var n,a=t;a<s;a++)n=e.children[a],l(i,e.leaf?r(n):n);return i}function l(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function u(e,t){return e.minX-t.minX}function h(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function c(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function f(e,t){var s=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,i-s)*Math.max(0,n-r)}function p(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,s,i,n){for(var a,o=[t,s];o.length;)(s=o.pop())-(t=o.pop())<=i||(a=t+Math.ceil((s-t)/i/2)*i,(0,r.q)(e,a,t,s,n),o.push(t,a,a,s))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,s=[],r=this.toBBox;if(!_(e,t))return s;for(var i,n,a,o,l=[];t;){for(i=0,n=t.children.length;i<n;i++)a=t.children[i],_(e,o=t.leaf?r(a):a)&&(t.leaf?s.push(a):p(e,o)?this._all(a,s):l.push(a));t=l.pop()}return s},collides:function(e){var t=this.data,s=this.toBBox;if(!_(e,t))return!1;for(var r,i,n,a,o=[];t;){for(r=0,i=t.children.length;r<i;r++)if(n=t.children[r],_(e,a=t.leaf?s(n):n)){if(t.leaf||p(e,a))return!0;o.push(n)}t=o.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(e,t){if(!e)return this;for(var s,r,i,a,o=this.data,l=this.toBBox(e),u=[],h=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],s=h.pop(),a=!0),o.leaf&&-1!==(i=n(e,o.children,t)))return o.children.splice(i,1),u.push(o),this._condense(u),this;a||o.leaf||!p(o,l)?r?(s++,o=r.children[s],a=!1):o=null:(u.push(o),h.push(s),s=0,r=o,o=o.children[0])}return this},toBBox:function(e){return e},compareMinX:u,compareMinY:h,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var s=[];e;)e.leaf?t.push.apply(t,e.children):s.push.apply(s,e.children),e=s.pop();return t},_build:function(e,t,s,r){var i,n=s-t+1,o=this._maxEntries;if(n<=o)return a(i=m(e.slice(t,s+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(n)/Math.log(o)),o=Math.ceil(n/Math.pow(o,r-1))),(i=m([])).leaf=!1,i.height=r;var l,u,h,d,c=Math.ceil(n/o),g=c*Math.ceil(Math.sqrt(o));for(y(e,t,s,g,this.compareMinX),l=t;l<=s;l+=g)for(y(e,l,h=Math.min(l+g-1,s),c,this.compareMinY),u=l;u<=h;u+=c)d=Math.min(u+c-1,h),i.children.push(this._build(e,u,d,r-1));return a(i,this.toBBox),i},_chooseSubtree:function(e,t,s,r){for(var i,n,a,o,l,u,h,c;r.push(t),!t.leaf&&r.length-1!==s;){for(h=c=1/0,i=0,n=t.children.length;i<n;i++)l=d(a=t.children[i]),(u=g(e,a)-l)<c?(c=u,h=l<h?l:h,o=a):u===c&&l<h&&(h=l,o=a);t=o||t.children[0]}return t},_insert:function(e,t,s){var r=this.toBBox,i=s?e:r(e),n=[],a=this._chooseSubtree(i,this.data,t,n);for(a.children.push(e),l(a,i);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(i,n,t)},_split:function(e,t){var s=e[t],r=s.children.length,i=this._minEntries;this._chooseSplitAxis(s,i,r);var n=this._chooseSplitIndex(s,i,r),o=m(s.children.splice(n,s.children.length-n));o.height=s.height,o.leaf=s.leaf,a(s,this.toBBox),a(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(s,o)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,s){var r,i,n,a,l,u,h,c;for(u=h=1/0,r=t;r<=s-t;r++)a=f(i=o(e,0,r,this.toBBox),n=o(e,r,s,this.toBBox)),l=d(i)+d(n),a<u?(u=a,c=r,h=l<h?l:h):a===u&&l<h&&(h=l,c=r);return c},_chooseSplitAxis:function(e,t,s){var r=e.leaf?this.compareMinX:u,i=e.leaf?this.compareMinY:h;this._allDistMargin(e,t,s,r)<this._allDistMargin(e,t,s,i)&&e.children.sort(r)},_allDistMargin:function(e,t,s,r){e.children.sort(r);var i,n,a=this.toBBox,u=o(e,0,t,a),h=o(e,s-t,s,a),d=c(u)+c(h);for(i=t;i<s-t;i++)n=e.children[i],l(u,e.leaf?a(n):n),d+=c(u);for(i=s-t-1;i>=t;i--)n=e.children[i],l(h,e.leaf?a(n):n),d+=c(h);return d},_adjustParentBBoxes:function(e,t,s){for(var r=s;r>=0;r--)l(t[r],e)},_condense:function(e){for(var t,s=e.length-1;s>=0;s--)0===e[s].children.length?s>0?(t=e[s-1].children).splice(t.indexOf(e[s]),1):this.clear():a(e[s],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},8557:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(0===this.size)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return 0===this.size?null:this._buffer[this._start]}find(e){if(0===this.size)return null;for(const t of this._buffer)if(null!=t&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;null!=t;)e&&e(t),t=this.dequeue()}}},64830:(e,t,s)=>{s.d(t,{Z:()=>n});var r=s(58971),i=s(10661);class n{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._observable=new i.s,this._items=new Set}get length(){return(0,r.it)(this._observable),this._items.size}clear(){0!==this.length&&(this._items.clear(),this._observable.notify())}last(){if(0===this.length)return;let e;for(e of this._items);return e}peek(){if(0!==this.length)return this._peeker(this._items)}push(e){this.contains(e)||(this._items.add(e),this._observable.notify())}contains(e){return(0,r.it)(this._observable),this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete(e),this._observable.notify(),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete(e),this._observable.notify(),e}remove(e){this.contains(e)&&(this._items.delete(e),this._observable.notify())}filter(e){const t=this.length;return this._items.forEach((t=>{e(t)||this._items.delete(t)})),t!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){(0,r.it)(this._observable),yield*this._items}}},22862:(e,t,s)=>{s.d(t,{Hg:()=>f,V7:()=>g,uD:()=>c});var r=s(92036),i=s(46791),n=s(1153);const a=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function o(e){return e instanceof r.Z}function l(e){return e instanceof i.Z?Object.keys(e.items):o(e)?(0,n.vw)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof i.Z?e.items[t]:e[t]}function h(e){return e?e.declaredClass:null}function d(e,t){const s=e.diff;if(s&&"function"==typeof s)return s(e,t);const r=l(e),i=l(t);if(0===r.length&&0===i.length)return;if(!r.length||!i.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const n=i.filter((e=>!r.includes(e))),c=r.filter((e=>!i.includes(e))),g=r.filter((s=>i.includes(s)&&u(e,s)!==u(t,s))).concat(n,c).sort(),f=h(e);if(f&&a.includes(f)&&g.length)return{type:"complete",oldValue:e,newValue:t};let p;const _=o(e)&&o(t);for(const r of g){const i=u(e,r),n=u(t,r);let a;if((_||"function"!=typeof i&&"function"!=typeof n)&&i!==n&&(null!=i||null!=n)){if(s&&s[r]&&"function"==typeof s[r])a=s[r]?.(i,n);else if(i instanceof Date&&n instanceof Date){if(i.getTime()===n.getTime())continue;a={type:"complete",oldValue:i,newValue:n}}else a="object"==typeof i&&"object"==typeof n&&h(i)===h(n)?d(i,n):{type:"complete",oldValue:i,newValue:n};null!=a&&(null!=p?p.diff[r]=a:p={type:"partial",diff:{[r]:a}})}}return p}function c(e,t){if(null==e)return!1;const s=t.split(".");let r=e;for(const e of s){if("complete"===r.type)return!0;if("partial"!==r.type)return!1;{const t=r.diff[e];if(!t)return!1;r=t}}return!0}function g(e,t){for(const s of t)if(c(e,s))return!0;return!1}function f(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&h(e)!==h(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},80903:(e,t,s)=>{s.d(t,{Z:()=>l});var r=s(50758),i=s(92604),n=s(95330),a=s(64830),o=s(728);class l{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new a.Z}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((s,r)=>{let i=!0;const a=e=>{(0,n.k_)(t.signal),i&&(i=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let i=0;i<e.length;++i){const l=e[i];(0,n.y8)(l)?this._clientPromises[i]=l.then((e=>(this._clients[i]=new o.default(e,t,(()=>this._ongoingJobsQueue.pop()??null)),a(s),this._clients[i])),(()=>(a(r),null))):(this._clients[i]=new o.default(l,t,(()=>this._ongoingJobsQueue.pop()??null)),this._clientPromises[i]=Promise.resolve(this._clients[i]),a(s))}}))}broadcast(e,t,s){const r=new Array(this._clientPromises.length);for(let i=0;i<this._clientPromises.length;++i){const n=this._clientPromises[i];r[i]=n.then((r=>r?.invoke(e,t,s)))}return r}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject((0,n.zE)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0}invoke(e,t,s){let r;Array.isArray(s)?(i.Z.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:s}):r=s;const a=(0,n.hh)();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:r,resolver:a});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then((e=>e?.jobAdded()))}return a.promise}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,r.AL)(this._clients.map((s=>s.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let r=0;r<this._clientPromises.length;++r)this._clientPromises[r].then((i=>{i&&(t[r]=i.openPort()),0==--s&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},84864:(e,t,s)=>{s.d(t,{bU:()=>h,fC:()=>g,tp:()=>c,v7:()=>d});const r=new Float64Array(2),i=new Float64Array(2),n="0123456789bcdefghjkmnpqrstuvwxyz";function a(e){return n[e]}function o(e){return(e[0]+e[1])/2}function l(e,t,s){return e[0]=t,e[1]=s,e}function u(e,t){const s=t>o(e);return function(e,t){const s=o(e),r=t,i=!t;e[0]=i*e[0]+r*s,e[1]=i*s+r*e[1]}(e,s),s}function h(e,t){let s=-90,r=90,i=-180,n=180;for(let a=0;a<t;a++){const t=Math.ceil((a+1)/2),o=Math.floor((a+1)/2),l=1-a%2,u=30-(3*t+2*o),h=30-(2*t+3*o),d=3*l+2*(1-l),c=2*l+3*(1-l),g=3*l+7*(1-l)<<h,f=(7*l+3*(1-l)<<u&e.geohashX)>>u,p=(g&e.geohashY)>>h;for(let e=d-1;e>=0;e--){const t=(i+n)/2,s=f&1<<e?1:0;i=(1-s)*i+s*t,n=(1-s)*t+s*n}for(let e=c-1;e>=0;e--){const t=(s+r)/2,i=p&1<<e?1:0;s=(1-i)*s+i*t,r=(1-i)*t+i*r}}return[i,s,n,r]}function d(e,t,s,r){r%2&&(r+=1);let i=0,n=0,a=-90,o=90,l=-180,u=180;for(let e=0;e<r/2;e++){for(let t=0;t<5;t++){const r=(l+u)/2,n=s>r?1:0;i|=n<<29-(t+5*e),l=(1-n)*l+n*r,u=(1-n)*r+n*u}for(let s=0;s<5;s++){const r=(a+o)/2,i=t>r?1:0;n|=i<<29-(s+5*e),a=(1-i)*a+i*r,o=(1-i)*r+i*o}}e.geohashX=i,e.geohashY=n}function c(e,t,s,r,i){i%2&&(i+=1);let n=0,a=0,o=-90,l=90,u=-180,h=180;for(let e=0;e<i/2;e++){for(let t=0;t<5;t++){const s=(u+h)/2,i=r>s?1:0;n|=i<<29-(t+5*e),u=(1-i)*u+i*s,h=(1-i)*s+i*h}for(let t=0;t<5;t++){const r=(o+l)/2,i=s>r?1:0;a|=i<<29-(t+5*e),o=(1-i)*o+i*r,l=(1-i)*r+i*l}}e[2*t]=n,e[2*t+1]=a}function g(e,t,s){let n="";const o=l(r,-90,90),h=l(i,-180,180);for(let r=0;r<s;r++){let s=0;r%2?(s|=u(o,e)<<4,s|=u(h,t)<<3,s|=u(o,e)<<2,s|=u(h,t)<<1,s|=u(o,e)<<0):(s|=u(h,t)<<4,s|=u(o,e)<<3,s|=u(h,t)<<2,s|=u(o,e)<<1,s|=u(h,t)<<0),n+=a(s)}return n}},95047:(e,t,s)=>{s.r(t),s.d(t,{createConnection:()=>A});var r=s(43697),i=(s(66577),s(3172)),n=s(20102),a=s(92604),o=s(95330),l=s(17452),u=(s(75215),s(67676),s(80442),s(52011)),h=s(5600),d=s(69285),c=s(32448);let g=class extends c.Z.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new n.Z("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,r._)([(0,h.Cb)({readOnly:!0})],g.prototype,"connectionError",null),g=(0,r._)([(0,u.j)("esri.layers.support.StreamConnection")],g);const f=g;var p,_;(_=p||(p={}))[_.CONNECTING=0]="CONNECTING",_[_.OPEN=1]="OPEN",_[_.CLOSING=2]="CLOSING",_[_.CLOSED=3]="CLOSED";let m=class extends f{constructor(e){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,d.k)(t,r,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case p.CONNECTING:case p.OPEN:return"connected";case p.CLOSING:case p.CLOSED:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,l.fl)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){const i=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(a.Z.getLogger(this).error(new n.Z("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.Z.getLogger(this).error(new n.Z("websocket-connection",`Failed to connect. Attempting to reconnect in ${i}s`,r)),await(0,o.e4)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void a.Z.getLogger(this).error(new n.Z("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise(((t,s)=>{const r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(r),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,s(e)}}))}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const s=(0,o.hh)(),r=t.onmessage,{filter:i,outFields:l,spatialReference:u}=this._config;return s.timeout(e),t.onmessage=e=>{let o=null;try{o=JSON.parse(e.data)}catch(e){}o&&"object"==typeof o||(a.Z.getLogger(this).error(new n.Z("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),s.reject(),this.destroy()),o.spatialReference?.wkid!==u?.wkid&&(a.Z.getLogger(this).error(new n.Z("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,e.data)),s.reject(),this.destroy()),"json"!==o.format&&(a.Z.getLogger(this).error(new n.Z("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),s.reject(),this.destroy()),i&&o.filter!==i&&a.Z.getLogger(this).error(new n.Z("websocket-connection","Tried to set filter, but server doesn't support it")),l&&o.outFields!==l&&a.Z.getLogger(this).error(new n.Z("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],s.resolve()},t.send(JSON.stringify({filter:i,outFields:l,format:"json",spatialReference:{wkid:u.wkid}})),s.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.Z.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&a.Z.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,r._)([(0,h.Cb)()],m.prototype,"connectionStatus",null),(0,r._)([(0,h.Cb)()],m.prototype,"errorString",void 0),m=(0,r._)([(0,u.j)("esri.layers.graphics.sources.connections.WebSocketConnection")],m);var y=s(34599),I=s(14165),b=s(33955),S=s(82971);const T={maxQueryDepth:5,maxRecordCountFactor:3};let x=class extends m{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.Z.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:r}=this._config;this.destroyed||this._setFilter(s,r)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void a.Z.getLogger(this).error(new n.Z("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,i.default)(e.path,{query:t,responseType:"json"}),r=(await s).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const s=e[0],{urls:r,token:i}=s,n=this._inferWebSocketBaseUrl(r);return(0,l.fl)(`${n}/subscribe`,{outSR:""+t.wkid,token:i})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return a.Z.getLogger(this).error(new n.Z("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if(null==s||null==e&&null==t)return;const r=JSON.stringify({filter:this._serializeFilter(e,t)});let i=!1;const l=(0,o.hh)();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(a.Z.getLogger(this).error(new n.Z("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),l.reject(t.error)),this._setWebSocketJSONParseHandler(s),i=!0,l.resolve())},s.send(r),setTimeout((()=>{i||(this.destroyed||this._websocket!==s||a.Z.getLogger(this).error(new n.Z("geoevent-connection","Server timed out when setting filter")),l.reject())}),1e4),l.promise}_serializeFilter(e,t){const s={};if(null==e&&null==t)return s;if(null!=e&&e.geometry)try{const t=(0,b.im)(e.geometry);if("extent"!==t.type)throw new n.Z(`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){a.Z.getLogger(this).error(new n.Z("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return null!=e&&e.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(s.where=e.where),null!=t&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t],r=this._relatedFeatures.get(s);if(!r)return a.Z.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:i,geometry:o}=r;for(const t in i)e.attributes[t]=i[t];return o&&(e.geometry=o),e.geometry||e.centroid||a.Z.getLogger(this).error(new n.Z("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),r=this._queryArchive(t);await s;const i=await r;if(!i)return;for(const e of i.features)this.onFeature(this._enrich(e))}catch(e){a.Z.getLogger(this).error(new n.Z("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(163),s.e(4609),s.e(9790),s.e(1773),s.e(7153),s.e(6569),s.e(1423),s.e(3887),s.e(7215),s.e(4788),s.e(9238),s.e(5235),s.e(8522),s.e(7446)]).then(s.bind(s,19238))).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,n=r.query.supportsPagination,a=r.query.supportsCentroid,o=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,u=i?l*o:l,h=new I.Z;if(h.outFields=this._config.outFields??["*"],h.where=this._config.filter?.where??"1=1",h.returnGeometry=!0,h.returnExceededLimitFeatures=!0,h.outSpatialReference=S.Z.fromJSON(this._config.spatialReference),a&&(h.returnCentroid=!0),i&&(h.maxRecordCountFactor=o),n)return h.num=u,t.destroy(),this._queryPages(e,h);const d=await(0,y.JT)(e,h,this._config.sourceSpatialReference);return t.destroy(),d.data}async _queryPages(e,t,s=[],r=0){t.start=null!=t.num?r*t.num:null;const{data:i}=await(0,y.JT)(e,t,this._config.sourceSpatialReference);return i.exceededTransferLimit&&r<(this._config.maxQueryDepth??0)?(i.features.forEach((e=>s.push(e))),this._queryPages(e,t,s,r+1)):(s.forEach((e=>i.features.push(e))),i)}_addRelatedFeatures(e){const t=new Map,s=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[r];t.set(s,e)}this._relatedFeatures=t}};x=(0,r._)([(0,u.j)("esri.layers.graphics.sources.connections.GeoEventConnection")],x);const v=x;let w=class extends f{constructor(e){super(),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._featureZScaler=(0,d.k)(t,r,s)}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function A(e,t,s,r,i,n,a,o){const l={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:r,filter:i,maxReconnectionAttempts:n,maxReconnectionInterval:a,customParameters:o};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new m(l):new v(l):new w(l)}(0,r._)([(0,h.Cb)()],w.prototype,"connectionStatus",void 0),(0,r._)([(0,h.Cb)()],w.prototype,"errorString",void 0),w=(0,r._)([(0,u.j)("esri.layers.support.ClientSideConnection")],w)},92722:(e,t,s)=>{s.d(t,{O3:()=>S,lG:()=>x,my:()=>T,q9:()=>l});var r=s(20102),i=s(70272),n=s(5428),a=s(35671);const o={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return o[e]}function*u(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*h(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function c(e){let t=0;for(let s=0;s<e.length;s++){const r=e[s],i=e[(s+1)%e.length];t+=r[0]*i[1]-i[0]*r[1]}return t<=0}function g(e){const t=e[0],s=e[e.length-1];return t[0]===s[0]&&t[1]===s[1]&&t[2]===s[2]||e.push(t),e}function f(e,t,s){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,s){return m(e,t.coordinates,s),e}(e,t,s);case"MultiLineString":return function(e,t,s){for(const r of t.coordinates)m(e,r,s);return e}(e,t,s);case"MultiPolygon":return function(e,t,s){for(const r of t.coordinates){p(e,r[0],s);for(let t=1;t<r.length;t++)_(e,r[t],s)}return e}(e,t,s);case"Point":return function(e,t,s){return I(e,t.coordinates,s),e}(e,t,s);case"Polygon":return function(e,t,s){const r=t.coordinates;p(e,r[0],s);for(let t=1;t<r.length;t++)_(e,r[t],s);return e}(e,t,s)}}function p(e,t,s){const r=g(t);!function(e){return!c(e)}(r)?m(e,r,s):y(e,r,s)}function _(e,t,s){const r=g(t);!function(e){return c(e)}(r)?m(e,r,s):y(e,r,s)}function m(e,t,s){for(const r of t)I(e,r,s);e.lengths.push(t.length)}function y(e,t,s){for(let r=t.length-1;r>=0;r--)I(e,t[r],s);e.lengths.push(t.length)}function I(e,t,s){const[r,i,n]=t;e.coords.push(r,i),s.hasZ&&e.coords.push(n||0)}function b(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function S(e){if(!e)throw new r.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new r.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:t}=e;if(!t)return;const s="string"==typeof t?t:"name"===t.type?t.properties.name:"EPSG"===t.type?t.properties.code:null,i=new RegExp(".*(CRS84H?|4326)$","i");if(!s||!i.test(s))throw new r.Z("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function T(e,t={}){const s=[],r=new Set,i=new Set;let n,o=!1,c=null,g=!1,{geometryType:f=null}=t,p=!1;for(const t of u(e)){const{geometry:e,properties:u,id:_}=t;if((!e||(f||(f=l(e.type)),l(e.type)===f))&&(o||(o=d(h(e))),g||(g=null!=_,g&&(n=typeof _,u&&(c=Object.keys(u).filter((e=>u[e]===_))))),u&&c&&g&&null!=_&&(c.length>1?c=c.filter((e=>u[e]===_)):1===c.length&&(c=u[c[0]]===_?c:[])),!p&&u)){let e=!0;for(const t in u){if(r.has(t))continue;const n=u[t];if(null==n){e=!1,i.add(t);continue}const o=b(n);if("unknown"===o){i.add(t);continue}i.delete(t),r.add(t);const l=(0,a.q6)(t);l&&s.push({name:l,alias:t,type:o})}p=e}}const _=(0,a.q6)(1===c?.length&&c[0]||null)??void 0;if(_)for(const e of s)if(e.name===_&&(0,a.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:s,geometryType:f,hasZ:o,objectIdFieldName:_,objectIdFieldType:n,unknownFields:Array.from(i)}}function x(e,t){return Array.from(function*(e,t={}){const{geometryType:s,objectIdField:r}=t;for(const a of e){const{geometry:e,properties:o,id:u}=a;if(e&&l(e.type)!==s)continue;const h=o||{};let d;r&&(d=h[r],null==u||d||(h[r]=d=u));const c=new i.u_(e?f(new n.Z,e,t):null,h,null,d??void 0);yield c}}(u(e),t))}},25278:(e,t,s)=>{s.d(t,{Dm:()=>h,Hq:()=>d,MS:()=>c,bU:()=>o});var r=s(80442),i=s(22974),n=s(61159),a=s(58333);function o(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?a.I4:"esriGeometryPolyline"===e?a.ET:a.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function h(e,t){if((0,r.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let s=`this.${t} = null;`;for(const t in e)s+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const r=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${s};\n }\n }\n `)();return()=>new r}catch(s){return()=>({[t]:null,...e})}}function d(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.d9)(e)}}]}function c(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:n.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}},16467:(e,t,s)=>{s.d(t,{$9:()=>m,G4:()=>b,Lu:()=>_,WW:()=>w,d:()=>x,eS:()=>T,gp:()=>S,j:()=>I,w9:()=>y,yN:()=>v}),s(66577);var r=s(3172),i=s(20102),n=s(92604),a=s(8744),o=s(40488),l=s(98732),u=s(44876),h=s(92722),d=s(25278),c=s(99514),g=s(86719),f=s(82971);const p=n.Z.getLogger("esri.layers.graphics.sources.ogcfeature"),_="http://www.opengis.net/def/crs/",m=`${_}OGC/1.3/CRS84`;async function y(e,t,s={},n=5){const{links:a}=e,o=k(a,"items","application/geo+json")||k(a,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==o)throw new i.Z("ogc-feature-layer:missing-items-page","Missing items url");const{data:l}=await(0,r.default)(o.href,{signal:s.signal,query:{limit:n,...s.customParameters,token:s.apiKey},headers:{accept:"application/geo+json"}});await(0,h.O3)(l);const u=(0,h.my)(l,{geometryType:t.geometryType}),f=t.fields||u.fields||[],_=null!=t.hasZ?t.hasZ:u.hasZ,m=u.geometryType,y=t.objectIdField||u.objectIdFieldName||"OBJECTID";let I=t.timeInfo;const b=f.find((({name:e})=>e===y));if(b)b.editable=!1,b.nullable=!1;else{if(!u.objectIdFieldType)throw new i.Z("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");f.unshift({name:y,alias:y,type:"number"===u.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(y!==u.objectIdFieldName){const e=f.find((({name:e})=>e===u.objectIdFieldName));e&&(e.type="esriFieldTypeInteger")}f===u.fields&&u.unknownFields.length>0&&p.warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:u.unknownFields}});for(const e of f){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable),!e.name)throw new i.Z("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!g.v.jsonValues.includes(e.type))throw new i.Z("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(I){const e=new c.Z(f);if(I.startTimeField){const t=e.get(I.startTimeField);t?(I.startTimeField=t.name,t.type="esriFieldTypeDate"):I.startTimeField=null}if(I.endTimeField){const t=e.get(I.endTimeField);t?(I.endTimeField=t.name,t.type="esriFieldTypeDate"):I.endTimeField=null}if(I.trackIdField){const t=e.get(I.trackIdField);t?I.trackIdField=t.name:(I.trackIdField=null,p.warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:I}}))}I.startTimeField||I.endTimeField||(p.warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:I}}),I=null)}return{drawingInfo:m?(0,d.bU)(m):null,extent:M(e),geometryType:m,fields:f,hasZ:!!_,objectIdField:y,timeInfo:I}}async function I(e,t={}){const{links:s}=e,n=k(s,"data","application/json")||k(s,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(null==n)throw new i.Z("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:a,customParameters:o,signal:l}=t,{data:u}=await(0,r.default)(n.href,{signal:l,headers:{accept:"application/json"},query:{...o,token:a}});return u}async function b(e,t={}){const{links:s}=e,n=k(s,"conformance","application/json")||k(s,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(null==n)throw new i.Z("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:a,customParameters:o,signal:l}=t,{data:u}=await(0,r.default)(n.href,{signal:l,headers:{accept:"application/json"},query:{...o,token:a}});return u}async function S(e,t={}){const{apiKey:s,customParameters:i,signal:n}=t,{data:a}=await(0,r.default)(e,{signal:n,headers:{accept:"application/json"},query:{...i,token:s}});return a}async function T(e,t={}){const s="application/vnd.oai.openapi+json;version=3.0",i=k(e.links,"service-desc",s);if(null==i)return p.warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:n,customParameters:a,signal:o}=t,{data:l}=await(0,r.default)(i.href,{signal:o,headers:{accept:s},query:{...a,token:n}});return l}function x(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),s=t?.groups;if(!s)return null;const{authority:r,code:i}=s;switch(r.toLowerCase()){case"ogc":switch(i.toLowerCase()){case"crs27":return f.Z.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return f.Z.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(i,10);return Number.isNaN(e)?null:e}default:return null}}async function v(e,t,s){const r=await w(e,t,s);return(0,l.cn)(r)}async function w(e,t,s){const{collection:n,layerDefinition:d,maxRecordCount:c,queryParameters:{apiKey:g,customParameters:p},spatialReference:_,supportedCrs:m}=e,{links:y}=n,I=k(y,"items","application/geo+json")||k(y,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==I)throw new i.Z("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:b,num:S,start:T,timeExtent:x,where:v}=t;if(t.objectIds)throw new i.Z("ogc-feature-layer:query-by-objectids-not-supported","Queries with objectids are not supported");const w=f.Z.fromJSON(_),F=t.outSpatialReference??w,M=F.isWGS84?null:A(F,m),E=C(b,m),R=function(e){if(null==e)return null;const{start:t,end:s}=e;return`${null!=t?t.toISOString():".."}/${null!=s?s.toISOString():".."}`}(x),L=null!=(D=v)&&D&&"1=1"!==D?D:null,Z=S??(null!=T&&void 0!==T?10:c),{data:U}=await(0,r.default)(I.href,{...s,query:{...p,...E,crs:M,datetime:R,query:L,limit:Z,startindex:T,token:g},headers:{accept:"application/geo+json"}});var D;let O=!1;U.links&&(O=!!U.links.find((e=>"next"===e.rel))),!O&&Number.isInteger(U.numberMatched)&&Number.isInteger(U.numberReturned)&&(O=U.numberReturned<U.numberMatched);const{fields:P,geometryType:N,hasZ:B,objectIdField:z}=d,q=(0,h.lG)(U,{geometryType:N,hasZ:B,objectIdField:z});if(!M&&F.isWebMercator)for(const e of q)if(null!=e.geometry&&null!=N){const t=(0,l.di)(e.geometry,N,B,!1);t.spatialReference=f.Z.WGS84,e.geometry=(0,l.GH)((0,o.iV)(t,F))}for(const e of q)e.objectId=e.attributes[z];const G=M||!M&&F.isWebMercator?F.toJSON():a.Zn,j=new u.Z;return j.exceededTransferLimit=O,j.features=q,j.fields=P,j.geometryType=N,j.hasZ=B,j.objectIdFieldName=z,j.spatialReference=G,j}function A(e,t){const{isWebMercator:s,wkid:r}=e;if(!r)return null;const i=s?t[3857]??t[102100]??t[102113]??t[900913]:t[e.wkid];return i?`${_}${i}`:null}function F(e){if(null==e)return"";const{xmin:t,ymin:s,xmax:r,ymax:i}=e;return`${t},${s},${r},${i}`}function C(e,t){if(!function(e){return null!=e&&"extent"===e.type}(e))return null;const{spatialReference:s}=e;if(!s||s.isWGS84)return{bbox:F(e)};const r=A(s,t);return null!=r?{bbox:F(e),"bbox-crs":r}:s.isWebMercator?{bbox:F((0,o.iV)(e,f.Z.WGS84))}:null}function M(e){const t=e.extent?.spatial;if(!t)return null;const s=t.bbox[0],r=4===s.length,i=s[0],n=s[1],a=r?void 0:s[2];return{xmin:i,ymin:n,xmax:r?s[2]:s[3],ymax:r?s[3]:s[4],zmin:a,zmax:r?void 0:s[5],spatialReference:f.Z.WGS84.toJSON()}}function k(e,t,s){return e.find((e=>e.rel===t&&e.type===s))||e.find((e=>e.rel===t&&!e.type))}},58333:(e,t,s)=>{s.d(t,{ET:()=>n,I4:()=>i,eG:()=>l,lF:()=>a,lj:()=>h,qP:()=>o,wW:()=>u});const r=[252,146,31,255],i={type:"esriSMS",style:"esriSMSCircle",size:6,color:r,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},n={type:"esriSLS",style:"esriSLSSolid",width:.75,color:r},a={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},o={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},h={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}},80216:(e,t,s)=>{s.d(t,{Z:()=>c});var r=s(43697),i=s(2368),n=s(96674),a=s(5600),o=(s(75215),s(67676),s(80442),s(71715)),l=s(52011),u=s(30556),h=s(42799);let d=class extends((0,i.J)(n.wq)){constructor(e){super(e),this.legacy=null,this.timeZone="system"}readLegacy(e,t){const{timeZone:s,respectsDaylightSaving:r}=t;return{timeZone:s,respectsDaylightSaving:r}}readTimeZone(e,t){return"timeZoneIANA"in t?t.timeZoneIANA:(0,h.G)(t)}writeTimeZone(e,t){t.timeZoneIANA=e}equals(e){return null!=e&&null!=this.timeZone&&null!=e.timeZone&&this.timeZone===e.timeZone}};(0,r._)([(0,a.Cb)()],d.prototype,"legacy",void 0),(0,r._)([(0,o.r)("legacy",["timeZone"])],d.prototype,"readLegacy",null),(0,r._)([(0,a.Cb)({type:String,nonNullable:!0})],d.prototype,"timeZone",void 0),(0,r._)([(0,o.r)("timeZone",["timeZone","timeZoneIANA","respectsDaylightSaving"])],d.prototype,"readTimeZone",null),(0,r._)([(0,u.c)("timeZone")],d.prototype,"writeTimeZone",null),d=(0,r._)([(0,l.j)("esri.time.TimeReference")],d);const c=d},42799:(e,t,s)=>{s.d(t,{G:()=>n});const r=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Almaty"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);var i=s(17126);function n(e,t="system"){if(!e||!r.has(e.timeZone))return t;const s=r.get(e.timeZone);return e.timeZone.startsWith("UTC")||e.respectsDaylightSaving?s:function(e){const t=i.ou.local().setZone(e),s=Math.min(t.set({month:1,day:1}).offset,t.set({month:5}).offset);return 0===s?"Etc/UTC":`Etc/GMT${i.Qf.instance(-s).formatOffset(0,"narrow")}`}(s)}},61027:(e,t,s)=>{s.d(t,{KS:()=>u,PX:()=>n,QS:()=>d,_I:()=>r,jL:()=>l,nE:()=>h,vs:()=>o,xp:()=>a});const r=8388607,i=8388608,n=0,a=1,o=e=>(e&i)>>>23,l=e=>e&r,u=e=>o(e)===a?254:255;function h(e){return o(e)===a}function d(e,t){return((t?i:0)|e)>>>0}},26899:(e,t,s)=>{s.d(t,{$_:()=>A,UK:()=>M,ws:()=>F,xV:()=>C});var r=s(20102),i=s(92604),n=s(95648),a=s(66039),o=s(35371);const l=i.Z.getLogger("esri.views.2d.engine.webgl.Utils"),u="geometry",h=[{name:u,strideInBytes:12}],d=[{name:u,strideInBytes:36}],c=[{name:u,strideInBytes:24}],g=[{name:u,strideInBytes:12}],f=[{name:u,strideInBytes:40}],p=[{name:u,strideInBytes:36}],_=[{name:u,strideInBytes:36}];function m(e){const t={};for(const s of e)t[s.name]=s.strideInBytes;return t}const y=m([{name:u,strideInBytes:36}]),I=m(h),b=m(d),S=m(c),T=m(g),x=m(f),v=m(p),w=m(_);function A(e,t){switch(e){case a.LW.MARKER:return t===a.mD.HEATMAP?I:y;case a.LW.FILL:switch(t){case a.mD.DOT_DENSITY:return T;case a.mD.SIMPLE:case a.mD.OUTLINE_FILL_SIMPLE:return S;default:return b}case a.LW.LINE:return x;case a.LW.TEXT:return v;case a.LW.LABEL:return w}}function F(e){switch(e){case"butt":return n.RL.BUTT;case"round":return n.RL.ROUND;case"square":return n.RL.SQUARE;default:return l.error(new r.Z("mapview-invalid-type",`Cap type ${e} is not a valid option. Defaulting to round`)),n.RL.ROUND}}function C(e){switch(e){case"miter":return n.AH.MITER;case"bevel":return n.AH.BEVEL;case"round":return n.AH.ROUND;default:return l.error(new r.Z("mapview-invalid-type",`Join type ${e} is not a valid option. Defaulting to round`)),n.AH.ROUND}}function M(e){switch(e){case o.Br.UNSIGNED_BYTE:return Uint8Array;case o.Br.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case o.Br.FLOAT:return Float32Array;default:return void l.error(new r.Z("webgl-utils",`Unable to handle type ${e}`))}}o.l1.STATIC_DRAW,new Map},37720:(e,t,s)=>{s.d(t,{aH:()=>n,t2:()=>i});var r=s(12142);function i(e){if(!e)return 0;const{r:t,g:s,b:i,a:n}=e;return(0,r.Jz)(t*n,s*n,i*n,255*n)}function n(e){if(!e)return 0;const[t,s,i,n]=e;return(0,r.Jz)(t*(n/255),s*(n/255),i*(n/255),n)}},66039:(e,t,s)=>{var r,i,n,a,o,l,u;s.d(t,{LW:()=>r,X:()=>a,mD:()=>u,mf:()=>o}),function(e){e[e.FILL=0]="FILL",e[e.LINE=1]="LINE",e[e.MARKER=2]="MARKER",e[e.TEXT=3]="TEXT",e[e.LABEL=4]="LABEL"}(r||(r={})),function(e){e[e.NONE=0]="NONE",e[e.MAP=1]="MAP",e[e.LABEL=2]="LABEL",e[e.LABEL_ALPHA=4]="LABEL_ALPHA",e[e.HITTEST=8]="HITTEST",e[e.HIGHLIGHT=16]="HIGHLIGHT",e[e.CLIP=32]="CLIP",e[e.DEBUG=64]="DEBUG",e[e.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(i||(i={})),function(e){e[e.SIZE=0]="SIZE",e[e.COLOR=1]="COLOR",e[e.OPACITY=2]="OPACITY",e[e.ROTATION=3]="ROTATION"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.OPACITY=1]="OPACITY",e[e.COLOR=2]="COLOR",e[e.ROTATION=4]="ROTATION",e[e.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",e[e.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",e[e.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",e[e.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(a||(a={})),function(e){e[e.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",e[e.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",e[e.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",e[e.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(o||(o={})),function(e){e[e.SPRITE=0]="SPRITE",e[e.GLYPH=1]="GLYPH"}(l||(l={})),function(e){e[e.DEFAULT=0]="DEFAULT",e[e.SIMPLE=1]="SIMPLE",e[e.DOT_DENSITY=2]="DOT_DENSITY",e[e.OUTLINE_FILL=3]="OUTLINE_FILL",e[e.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",e[e.HEATMAP=5]="HEATMAP",e[e.PIE_CHART=6]="PIE_CHART"}(u||(u={}))},12142:(e,t,s)=>{s.d(t,{Jz:()=>n,UJ:()=>i});const r=new Float32Array(1);function i(e,t){return 65535&e|t<<16}function n(e,t,s,r){return 255&e|(255&t)<<8|(255&s)<<16|r<<24}new Uint32Array(r.buffer)},74259:(e,t,s)=>{s.d(t,{k:()=>g,p:()=>f});var r=s(8557),i=s(32448),n=(s(80442),s(96794)),a=s(60437),o=s(59999),l=s(61800);const u=(0,a.Ue)();function h(e,t){return e<<16|t}function d(e){return(4294901760&e)>>>16}function c(e){return 65535&e}const g={getObjectId:e=>e.getObjectId(),getAttributes:e=>e.readAttributes(),getAttribute:(e,t)=>e.readAttribute(t),cloneWithGeometry:(e,t)=>e,getGeometry:e=>e.readHydratedGeometry(),getCentroid:(e,t)=>e.readCentroid()};class f extends o.J{constructor(e,t,s){super(e,t),this.featureAdapter=g,this.events=new i.Z,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new r.Z(50),this._index=(0,n.r)(9,(e=>({minX:this._storage.getXMin(e),minY:this._storage.getYMin(e),maxX:this._storage.getXMax(e),maxY:this._storage.getYMax(e)}))),this.mode=s}get storeStatistics(){let e=0,t=0,s=0;return this.forEach((r=>{const i=r.readGeometry();i&&(t+=i.isPoint?1:i.lengths.reduce(((e,t)=>e+t),0),s+=i.isPoint?1:i.lengths.length,e+=1)})),{featureCount:e,vertexCount:t,ringCount:s}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t){if(null==t.addOrUpdate)return t;if(t.addOrUpdate.attachStorage(this._storage),"snapshot"===this.mode){const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this.setComputedAttributes(this._storage,s,t,e.scale)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const s=t.addOrUpdate.getCursor();for(;s.next();)this._insertFeature(s,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,s=this._indexSearchCache.find((e=>e.tileId===t));if(null!=s)return s.readers;const r=new Map,i=this._searchIndex(e.bounds),n=[];for(const e of i){const t=this._storage.getInstanceId(e),s=d(t),i=c(t);r.has(s)||r.set(s,[]),r.get(s).push(i)}return r.forEach(((e,t)=>{const s=this._featureSetsByInstance.get(t);n.push(l.t.from(s,e))})),this._indexSearchCache.enqueue({tileId:t,readers:n}),n}insert(e){const t=e.getCursor(),s=this._storage;for(;t.next();){const e=h(t.instance,t.getIndex()),r=t.getObjectId(),i=this._objectIdToDisplayId.get(r)??this._storage.createDisplayId();t.setDisplayId(i),s.setInstanceId(i,e),this._objectIdToDisplayId.set(r,i)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const s=this._storage.getInstanceId(t),r=c(s),i=d(s),n=this._featureSetsByInstance.get(i);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),n.removeAtIndex(r),n.isEmpty&&this._featureSetsByInstance.delete(i),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=this._lookupFeature(s);e(r)}))}forEachUnsafe(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=d(s),i=c(s),n=this._getFeatureSet(r);n.setIndex(i),e(n)}))}forEachInBounds(e,t){const s=this._searchIndex(e);for(const e of s)t(this.lookupFeatureByDisplayId(e,this._storage))}forEachBounds(e,t){this._rebuildIndex();for(const s of e){if(!s.readGeometry())continue;const e=s.getDisplayId();(0,a.bZ)(u,this._storage.getXMin(e),this._storage.getYMin(e),this._storage.getXMax(e),this._storage.getYMax(e)),t(u)}}sweepFeatures(e,t,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach(((r,i)=>{e.has(r)||(t.releaseDisplayId(r),s&&s.unsetAttributeData(r),this._objectIdToDisplayId.delete(i))})),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach(((t,s)=>{e.has(s)||this._featureSetsByInstance.delete(s)}))}lookupObjectId(e,t){const s=this.lookupFeatureByDisplayId(e,t);return null==s?null:s.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const s=t.getInstanceId(e);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),s=d(t),r=c(t),i=this._getFeatureSet(s);return i?(i.setIndex(r),i):null}_insertFeature(e,t){const s=this._storage,r=e.getObjectId(),i=h(e.instance,e.getIndex());s.getInstanceId(e.getDisplayId());let n=this._objectIdToDisplayId.get(r);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(r,n),this._spatialIndexInvalid=!0),e.setDisplayId(n),s.setInstanceId(n,i),this.setComputedAttributes(s,e,n,t)}_searchIndex(e){this._rebuildIndex();const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];"snapshot"===this.mode?this._featureSetsByInstance.forEach((t=>{const s=t.getCursor();for(;s.next();){const t=s.getDisplayId();this._storage.setBounds(t,s)&&e.push(t)}})):this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(s))&&e.push(t)})),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=d(e),s=this._getFeatureSet(t);if(!s)return;const r=s.getCursor(),i=c(e);return r.setIndex(i),r}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}}},27937:(e,t,s)=>{s.r(t),s.d(t,{default:()=>mt});var r=s(43697),i=s(92036),n=s(80442),a=s(17445),o=s(5600),l=(s(75215),s(67676)),u=s(52011),h=s(8744),d=s(11145),c=s(95330),g=s(19402),f=s(98732),p=s(64106),_=s(99514),m=s(74259),y=s(66677),I=s(3172),b=s(20102),S=s(92604),T=s(80903),x=s(82397),v=s(16467),w=s(34599),A=s(70272),F=s(87554);class C extends F.s{static fromFeatures(e,t){const{objectIdField:s,geometryType:r}=t,i=(0,f.Yn)([],e,r,!1,!1,s);for(let t=0;t<i.length;t++)i[t].displayId=e[t].displayId;return C.fromOptimizedFeatures(i,t)}static fromFeatureSet(e,t){const s=(0,f.h_)(e,t.objectIdField);return C.fromOptimizedFeatureSet(s,t)}static fromOptimizedFeatureSet(e,t){const{features:s}=e,r=C.fromOptimizedFeatures(s,t);return r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform,r._fieldsIndex=new _.Z(t.fields),r}static fromOptimizedFeatures(e,t,s){const r=F.s.createInstance(),i=new C(r,e,t);return i._fieldsIndex=new _.Z(t.fields),i._transform=s,i}constructor(e,t,s){super(e,s),this._exceededTransferLimit=!1,this._featureIndex=-1,this._fieldsIndex=null,this._geometryType=s?.geometryType,this._features=t}get fields(){return this._fieldsIndex}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=>!(null!=e.objectId&&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 C(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(0,f.EI)(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.readUnquantizedGeometry();return(0,f.di)(e,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return null==e?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return(0,A.S6)(this._current)?(0,f.lz)(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 s=0;for(const r of t){for(let t=1;t<r;t++)e[2*(s+t)]+=e[2*(s+t)-2],e[2*(s+t)+1]+=e[2*(s+t)-1];s+=r}}(t),t}readHydratedGeometry(){const e=this._current.geometry;if(null==e)return null;const t=e.clone();return null!=this._transform&&(0,f.$g)(t,t,this.hasZ,this.hasM,this._transform),t}getXHydrated(){if(!(0,A.S6)(this._current))return 0;const e=this._current.geometry.coords[0],t=this.getQuantizationTransform();return null==t?e:e*t.scale[0]+t.translate[0]}getYHydrated(){if(!(0,A.S6)(this._current))return 0;const e=this._current.geometry.coords[1],t=this.getQuantizationTransform();return null==t?e:t.translate[1]-e*t.scale[1]}getX(){return(0,A.S6)(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return(0,A.S6)(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!(0,A.S6)(this._current)){if(null!=this._current.centroid){const[e,t]=this._current.centroid.coords;return this.createQuantizedExtrudedQuad(e,t)}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 s 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+=s;return e}readCentroid(){return(0,A.S6)(this._current)?this._computeCentroid():this._current.centroid}_readAttribute(e,t){const s=this._fieldsIndex.get(e);if(!s)return;let r=this._current.attributes[s.name];return null==r?r:("esriFieldTypeTimestampOffset"===this.fields.get(e)?.type&&(r=this.parseTimestampOffset(r)),t&&this.fields.isDateField(e)?new Date(r):r)}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._fieldsIndex=this._fieldsIndex}_readAttributes(){return this._current.attributes}}var M=s(70586),k=s(45091),E=s(5428),R=s(77863);const L=268435455;class Z{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}}const U=268435455,D=128e3,O={small:{delta:new Int32Array(128),decoded:new Int32Array(128)},large:{delta:new Int32Array(D),decoded:new Int32Array(D)}};function P(e){return e<=O.small.delta.length?O.small:(e<=O.large.delta.length||(O.large.delta=new Int32Array(Math.round(1.25*e)),O.large.decoded=new Int32Array(Math.round(1.25*e))),O.large)}function N(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function B(e,t,s,r,i,n){return.5*Math.abs(e*r+s*n+i*t-e*n-s*t-i*r)}function z(e,t,s,r){return 0==e*r-s*t&&e*s+t*r>0}class q extends F.s{static fromBuffer(e,t,s=!1){const r=t.geometryType,i=function(e){try{const t=2,s=new k.Z(new Uint8Array(e),new DataView(e));for(;s.next();){if(s.tag()===t)return N(s.getMessage());s.skip()}}catch(e){const t=new b.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e});S.Z.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(t)}return null}(e),n=function(e,t,s=!1){const r=e.asUnsafe(),i=r.pos(),n=new Z;let a=0,o=0,l=null,u=null,h=null,d=!1;const c=[];for(;r.next();)switch(r.tag()){case 1:l=r.getString();break;case 3:u=r.getString();break;case 12:h=r.processMessage(R.G$);break;case 9:if(n.exceededTransferLimit=r.getBool(),n.exceededTransferLimit){n.offsets.geometry=s?new Float64Array(8e3):new Int32Array(8e3),n.centroid=s?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<n.centroid.length;e++)n.centroid[e]=L}break;case 13:{const e=r.processMessage(R.wn);e.index=a++,c.push(e);break}case 15:{const e=r.getLength(),i=r.pos()+e;if(!n.exceededTransferLimit){const e=n.offsets.geometry,t=n.centroid;e.push(0),t.push(L),t.push(L)}!d&&n.exceededTransferLimit&&(d=!0,n.offsets.attributes=s?new Float64Array(8e3*a):new Uint32Array(8e3*a));let l=o*a;for(;r.pos()<i&&r.next();)switch(r.tag()){case 1:{d?n.offsets.attributes[l++]=r.pos():n.offsets.attributes.push(r.pos());const e=r.getLength();r.skipLen(e);break}case 2:if(t){const e=r.getLength(),t=r.pos()+e;for(;r.pos()<t&&r.next();)switch(r.tag()){case 3:{r.getUInt32();const e=r.getSInt64(),t=r.getSInt64();n.centroid[2*o]=e,n.centroid[2*o+1]=t;break}default:r.skip()}}else{n.offsets.geometry[o]=r.pos();const e=r.getLength();n.vertexCount+=e,r.skipLen(e)}break;case 4:{const e=r.getLength(),t=r.pos()+e;for(;r.pos()<t&&r.next();)switch(r.tag()){case 3:{r.getUInt32();const e=r.getSInt64(),t=r.getSInt64();n.centroid[2*o]=e,n.centroid[2*o+1]=t;break}default:r.skip()}break}default:r.skip()}o++,n.hasFeatures=!0;break}default:r.skip()}const g=l||u;if(!g)throw new b.Z("FeatureSet has no objectId or globalId field name");return n.fields=new _.Z(c),n.featureCount=o,n.fieldCount=a,n.objectIdFieldIndex=n.fields.get(g)?.index,n.transform=h,n.displayIds=new Uint32Array(n.featureCount),n.groupIds=new Uint16Array(n.featureCount),r.move(i),n}(i,"esriGeometryPoint"===r,s),a=F.s.createInstance();return new q(a,i,n,t)}constructor(e,t,s,r){super(e,r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._geometryType=r.geometryType,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get _size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getQuantizationTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(void 0===this._cache.legacyFeature){const e=this.readCentroid(),t={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null};return this._cache.legacyFeature=t,t}return this._cache.legacyFeature}readOptimizedFeature(){if(void 0===this._cache.optFeature){const e=new A.u_(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],t=this.getQuantizationTransform();return null==t?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return null==t?e:t.translate[1]-e*t.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const t=this.readUnquantizedGeometry(e);return(0,f.di)(t,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[t,s]=e.coords;return{x:t,y:s}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(void 0===this._cache.unquantGeometry){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;const s=P(t.coords.length).decoded,r=t.clone(s),i=r.coords;let n=0;for(const e of r.lengths){for(let t=1;t<e;t++){const e=2*(n+t),s=2*(n+t-1);i[e]+=i[s],i[e+1]+=i[s+1]}n+=e}return this._cache.unquantGeometry=r,r}return this._cache.unquantGeometry}readHydratedGeometry(){if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===U)return null;const e=this.getXHydrated(),t=this.getYHydrated();return new E.Z([],[e,t])}const e=this.readGeometry();if(!e)return null;const t=e.clone(),s=this.getQuantizationTransform();return null!=s&&(0,f.$g)(t,t,this.hasZ,this.hasM,s),t}readGeometry(e=!1){if(void 0===this._cache.geometry){let t=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===U)return null;const e=this.getX(),s=this.getY();t=new E.Z([],[e,s])}else{const s=this._header.offsets.geometry[this._featureIndex],r=this._reader;if(0===s){const e=this._readServerCentroid();if(!e)return null;const[t,s]=e.coords;return this.createQuantizedExtrudedQuad(t,s)}r.move(s);try{if(t=e?this._parseGeometryForDisplay(r):this._parseGeometry(r),null===t){const e=this._readServerCentroid();if(!e)return null;const[t,s]=e.coords;return this.createQuantizedExtrudedQuad(t,s)}}catch(e){return console.error("Failed to parse geometry!",e),null}}return this._cache.geometry=t,t}return this._cache.geometry}readCentroid(){if(void 0===this._cache.centroid){let e;return e=this._computeCentroid(),e||(e=this._readServerCentroid()),this._cache.centroid=e??void 0,e??null}return this._cache.centroid}copy(){const e=this._reader.clone(),t=new q(this.instance,e,this._header,this.fullSchema());return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}_readAttribute(e,t){const s=this._header.fields.get(e);if(null==s)return;let r=this._readAttributeAtIndex(s.index);"esriFieldTypeTimestampOffset"===this.fields.get(e)?.type&&(r=this.parseTimestampOffset(r));const i=this._header.fields.isDateField(s.name);return t?null==r?r:i?new Date(r):r:r}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext}_readAttributeAtIndex(e){const t=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;return s.move(t),function(e){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}(s)}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex]+this._tx,t=this._header.centroid[2*this._featureIndex+1]+this._ty;return e===U?null:new E.Z([],[e,t])}_parseGeometry(e){const t=e.asUnsafe(),s=t.getLength(),r=t.pos()+s,i=[],n=[];for(;t.pos()<r&&t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),s=t.pos()+e;for(;t.pos()<s;)n.push(t.getUInt32());break}case 3:{const e=t.getUInt32(),s=t.pos()+e;for(i.push(t.getSInt32()+this._tx),i.push(t.getSInt32()+this._ty),this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32();t.pos()<s;)i.push(t.getSInt32()),i.push(t.getSInt32()),this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32();break}default:t.skip()}return new E.Z(n,i)}_parseGeometryForDisplay(e){const t=e.asUnsafe(),s=t.getLength(),r=t.pos()+s,i=[],n=[];let a=0,o=0,l=null,u=0;const h="esriGeometryPolygon"===this.geometryType;for(;t.pos()<r&&t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),s=t.pos()+e;for(;t.pos()<s;){const e=t.getUInt32();i.push(e),a+=e}l=P(2*a).delta;break}case 3:{t.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);(0,M.O3)(l);for(const s of i)if(o+e*s>l.length)for(let e=0;e<s;e++)t.getSInt32(),t.getSInt32(),this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32();else if(h){const e=this.getAreaSimplificationThreshold(s,this._header.vertexCount);let r=2,i=1;const a=!1;let h=t.getSInt32(),d=t.getSInt32();l[o++]=h,l[o++]=d,this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32();let c=t.getSInt32(),g=t.getSInt32();for(this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32();r<s;){let s=t.getSInt32(),n=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32();const a=h+c,f=d+g;B(h,d,a,f,a+s,f+n)>=e?(u+=-.5*(a-h)*(f+d),i>1&&z(l[o-2],l[o-1],c,g)?(l[o-2]+=c,l[o-1]+=g):(l[o++]=c,l[o++]=g,i++),h=a,d=f):(s+=c,n+=g),c=s,g=n,r++}i<3||a?o-=2*i:(u+=-.5*(h+c-h)*(d+g+d),z(l[o-2],l[o-1],c,g)?(l[o-2]+=c,l[o-1]+=g,n.push(i)):(l[o++]=c,l[o++]=g,n.push(++i)))}else{let e=0,r=t.getSInt32(),i=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),l[o++]=r,l[o++]=i,e+=1;for(let n=1;n<s;n++){const s=t.getSInt32(),a=t.getSInt32(),h=r+s,d=i+a;u+=-.5*(h-r)*(d+i),this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),n>2&&z(l[o-2],l[o-1],s,a)?(l[o-2]+=s,l[o-1]+=a):(l[o++]=s,l[o++]=a,e+=1),r=h,i=d}n.push(e)}break}default:t.skip()}if(this._cache.area=u,!n.length)return null;if(this._tx||this._ty){let e=0;(0,M.O3)(l);for(const t of n)l[2*e]+=this._tx,l[2*e+1]+=this._ty,e+=t}return new E.Z(n,l)}}class G{constructor(e){this.service=e}destroy(){}}class j extends G{constructor(e){super(e),this._portsOpen=async function(e){const t=new T.Z;return await t.open(e,{}),t}(e.source).then((e=>this.client=e))}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return C.fromFeatureSet(s,this.service)}}class Q extends G{async executeQuery(e,t){const{data:s}=await(0,w.n7)(this.service.source,e,t),r=!e.quantizationParameters;return q.fromBuffer(s,this.service,r)}}class Y extends G{async executeQuery(e,t){const{source:s,capabilities:r,spatialReference:i,objectIdField:n,geometryType:a}=this.service;if(null!=e.quantizationParameters&&!r.query.supportsQuantization){const r=e.clone(),a=(0,x.vY)(r.quantizationParameters);r.quantizationParameters=null;const{data:o}=await(0,w.JT)(s,r,i,t),l=(0,f.h_)(o,n);return(0,f.RZ)(a,l),C.fromOptimizedFeatureSet(l,this.service)}const{data:o}=await(0,w.JT)(s,e,this.service.spatialReference,t);return"esriGeometryPoint"===a&&(o.features=o.features?.filter((e=>{if(null!=e.geometry){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0}))),C.fromFeatureSet(o,this.service)}}class H extends G{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const s=e.clone(),r=(0,x.vY)(s.quantizationParameters);s.quantizationParameters=null;const i=await(0,v.WW)(this.service.source,e,t);return(0,f.RZ)(r,i),C.fromOptimizedFeatureSet(i,this.service)}const r=await(0,v.WW)(this.service.source,e,t);return C.fromOptimizedFeatureSet(r,this.service)}}var X=s(92835),V=s(32448),W=s(22862),J=s(14165),$=s(8557);class K{constructor(){this.version=0,this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const t=new K;let s;for(s in e){const r=e[s];if("object"==typeof r)for(const e in r){const i=e,n=r[i];t[s][i]=n}t[s]=r}return t}static empty(){return K.create({})}static all(){return K.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){this.version=e.version,e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,t="";if(this.mesh){e+=20,t+="-> (20) Mesh needs update\n";for(const e of this.why.mesh)t+=` + ${e}\n`}if(this.source){e+=10,t+="-> (10) The source needs update\n";for(const e of this.why.source)t+=` + ${e}\n`}this.targets.feature&&(e+=5,t+="-> (5) Feature target parameters changed\n"),this.storage.filters&&(e+=5,t+="-> (5) Feature filter parameters changed\n"),this.targets.aggregate&&(e+=4,t+="-> (4) Aggregate target parameters changed\n"),this.storage.data&&(e+=1,t+="-> (1) Texture storage parameters changed");const s=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${s} update of cost ${e}/45 `),console.debug(t)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}}class ee{constructor(e,t){this.requests={done:new Array,stream:new $.Z(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._resolver=(0,c.hh)(),this._isDone=!1,this.didSend=!1,this.tile=e,this._version=t}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length&&null==this.edits}get edits(){return this._edits}get done(){return this._resolver.promise}get isDone(){return this._isDone}resolve(){this._isDone=!0,this._resolver.resolve()}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach((t=>t.message.status.unset(e))),this._version=e.version,null!=this._edits&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??K.empty(),e.message.status.version=this._version,(0,n.Z)("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&(this.requests.done.forEach((e=>{null!=e.message&&e.message.end&&(e.message.end=!1)})),this._resolver.resolve(),this._isDone=!0),this.requests.done.push(e)}edit(e,t){const s=e.getQuantizationTransform(),r=e.fullSchema(),i=Array.from(e.features()).filter(l.pC),n=[...t,...i.map((e=>e.objectId))];this.removeIds(n),this._invalidate(),null!=this._edits?(this.requests.done.forEach((e=>e.message.end=!1)),this._edits.addOrUpdate.append(e.features())):this._edits={type:"append",addOrUpdate:C.fromOptimizedFeatures(i,r,s),id:this.tile.id,status:K.empty(),end:!0}}*readers(){for(const{message:e}of this.requests.done)null!=e.addOrUpdate&&(yield e.addOrUpdate);null!=this._edits&&null!=this._edits.addOrUpdate&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=K.empty();null!=this._edits&&(this._edits.status=K.empty())}removeIds(e){this._invalidate();for(const{message:t}of this.requests.done){const s=t.addOrUpdate;null!=s&&(s.removeIds(e),s.isEmpty&&((0,n.Z)("esri-2d-update-debug")&&console.debug("Removing FeatureSetReader"),t.addOrUpdate=null))}null!=this._edits&&null!=this._edits.addOrUpdate&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter((e=>e.message.addOrUpdate||e.message.end))}abort(){this._abortController.abort(),this._resolver.reject()}}class te{constructor(e){this.updatingHandles=new g.R,this.events=new V.Z,this._resolver=(0,c.hh)(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){for(const e of this._subscriptions.values())e.abort();this.updatingHandles.destroy()}get subscriptions(){return this._subscriptions.values()}async _onMessage(e){const t=this._subscriptions.get(e.id);if(!t)return;const s={...e,remove:e.remove??[],status:e.status??K.empty()};return(0,c.R8)(this._onTileUpdateMessage(s,t.options))}update(e,t){const s=t.fields.length;t.outFields=function(e,t){const s=new Set;return e&&e.forEach((e=>s.add(e))),t&&t.forEach((e=>s.add(e))),s.has("*")?["*"]:Array.from(s)}(this._schema?.outFields,t.outFields),t.outFields=t.outFields.length>=.75*s?["*"]:t.outFields,t.outFields.sort();const r=(0,W.Hg)(this._schema,t);if(!r)return;(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Source:",r);const i="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",a={returnCentroid:"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[i],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:t.timeExtent?X.Z.fromJSON(t.timeExtent):null},o=this._schema&&(0,W.uD)(r,"outFields");this._schema&&(0,W.V7)(r,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),o&&(e.why.source.push("Layer required fields changed"),e.source=!0),(0,W.Hg)(a,this._queryInfo)&&(this._queryInfo=a),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach((t=>t.applyUpdate(e))),await this.resend()}refresh(e,t){for(const t of this._tiles())this.unsubscribe(t),this.subscribe(t,e)}subscribe(e,t){const s=new ee(e,t);this._subscriptions.set(e.id,s),this.updatingHandles.addPromise(s.done)}unsubscribe(e){const t=this.getSubscription(e.id);null!=t&&t.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const t=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new J.Z({...this._queryInfo,historicMoment:t,...e})}getSubscription(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e,t){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const t of e)yield t.tile}async edit(e,t){const s=Array.from(this._subscriptions.values()),r=s.map((({tile:e})=>e));for(const e of s)e.removeIds(t);if(e.length){const s=r.map((t=>{const s=this.createTileQuery(t);return s.objectIds=e,{tile:t,query:s}})).map((async({tile:e,query:t})=>({tile:e,result:await this.query(t,{query:{tile:(0,n.Z)("esri-tiles-debug")?e.id.replaceAll("/","."):void 0}}),query:t}))),i=(await(0,c.WW)(s)).map((async({tile:s,result:r})=>{if(!r.hasFeatures&&!t.length&&!e.length)return;const i=this._subscriptions.get(s.key.id);i&&i.edit(r,e)}));await Promise.allSettled(i)}this._didEdit=!0}}var se=s(79384);class re extends te{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=function(e){const{capabilities:t}=e;return function(e){return"ogc-source"===e?.type}(e.source)?new H(e):function(e){return Array.isArray(e.source)}(e)?new j(e):t.query.supportsFormatPBF&&(0,n.Z)("featurelayer-pbf")?new Q(e):new Y(e)}(e.serviceInfo),this._queue=new se.e({concurrency:8,process:async e=>{if((0,c.k_)(e),null!=e.tile){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replaceAll("/","."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema?.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema?.customParameters})}}),this._patchQueue=new se.e({concurrency:8,process:async e=>{if((0,c.k_)(e),null!=e.tile){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replaceAll("/","."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema?.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema?.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}enqueueQuery(e,t){return this.updatingHandles.addPromise(this._queue.push(e,t))}enqueuePatchQuery(e,t){return this.updatingHandles.addPromise(this._patchQueue.push(e,t))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?4:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*(this.maxRecordCountFactor??1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e,t){super.subscribe(e,t),this._fetchDataTile(e).catch((t=>{(0,c.D_)(t)||S.Z.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource").error(new b.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:t}))}))}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e,t={}){const s=t.query??{};return this._adapter.executeQuery(e,{...t,query:{...s,...this._schema?.customParameters}})}async queryLastEditDate(){const e=this._serviceInfo.source,t={...e.query,f:"json"};return(await(0,I.default)(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){const s=this._serviceInfo.geometryType,r=this.createQuery(t);r.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?"esriGeometryPolyline"===s&&(r.maxAllowableOffset=e.resolution*(0,n.Z)("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==s&&"esriGeometryPolygon"!==s||(r.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===s&&(r.maxAllowableOffset*=(0,n.Z)("feature-polyline-generalization-factor")));const i=this._serviceInfo.capabilities.query;return r.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference,r.compactGeometryEnabled=i.supportsCompactGeometry,r}async _executePatchQuery(e,t,s,r){const i=t.clone();i.outFields=[this._serviceInfo.objectIdField,...s],i.returnCentroid=!1,i.returnGeometry=!1;const n=null!=i.start?i.start/8e3:0,a=r.signal;return await this.enqueuePatchQuery({tile:e,query:i,signal:a,depth:n})}async _resend(e,t){const{query:s,message:r}=e,i=null!=s.outFields?s.outFields:[],n=this._queryInfo.outFields,a=n.filter((e=>!i.includes(e)));if(null!=r.addOrUpdate)if(a.length)try{const e=this._subscriptions.get(r.id).tile,i=await this._executePatchQuery(e,s,a,t);(0,c.k_)(t),s.outFields=n,r.addOrUpdate.joinAttributes(i),this._onMessage({...r,end:r.end,type:"append"})}catch(e){}else this._onMessage({...r,type:"append"});else this._onMessage({...r,type:"append"})}async _resendSubscription(e){if((0,n.Z)("esri-2d-update-debug")&&console.debug(e.tile.id,"Resend Subscription"),e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const s of e.requests.done)await this._resend(s,{signal:t});return null!=e.edits?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map((e=>this._resendSubscription(e))))}}const ie=(0,n.Z)("esri-mobile"),ne={maxDrillLevel:ie?1:4,maxRecordCountFactor:ie?1:3};class ae extends re{constructor(e){super(e)}async _fetchDataTile(e){const t=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,s=this._subscriptions.get(e.key.id),r=s.signal,i=e.getQuantizationParameters();let n=0;const a=async(o,l)=>{const u=this._queryInfo,h=this.createTileQuery(o,{maxRecordCountFactor:t?ne.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:i});n++;try{const t=await this.enqueueQuery({tile:e,query:h,signal:r,depth:l});if(n--,(0,c.k_)(r),!t)return;if(u!==this._queryInfo)return void a(o,l);if(t.exceededTransferLimit&&l<ne.maxDrillLevel){for(const e of o.createChildTiles())a(e,l+1);return}const i={id:e.id,addOrUpdate:t,end:0===n,type:"append"};s.add({query:h,message:i}),this._onMessage(i)}catch(t){if(!(0,c.D_)(t)){const t={id:e.id,addOrUpdate:null,end:!0,type:"append"};s.add({query:h,message:t}),this._onMessage(t)}}};a(e,0)}}class oe extends re{constructor(e){super(e)}async _fetchDataTile(e){const t=this._subscriptions.get(e.key.id);let s=!1,r=0,i=0;const n=(r,n)=>{i--,(0,c.k_)(t);const a=e.id,o=r.reader,l=r.query;if(!o.exceededTransferLimit){if(s=!0,0!==n&&!o.hasFeatures){const e={id:a,addOrUpdate:o,end:0===i,type:"append"};return t.add({message:e,query:l}),void this._onMessage(e)}const e={id:a,addOrUpdate:o,end:0===i,type:"append"};return t.add({message:e,query:l}),void this._onMessage(e)}const u={id:a,addOrUpdate:o,end:s&&0===i,type:"append"};t.add({message:u,query:l}),this._onMessage(u)};let a=0,o=0;for(;!s&&o++<20;){let o;for(let l=0;l<a+1;l++){const a=r++;i++,o=this._fetchDataTilePage(e,a,t).then((e=>e&&n(e,a))).catch((i=>{if(s=!0,!(0,c.D_)(i)){S.Z.getLogger("esri.views.2d.layers.features.sources.PagedFeatureSource").error(new b.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:i}));const n={id:e.id,addOrUpdate:null,end:s,type:"append"},a={start:this.pageSize*r,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};null!=this.maxRecordCountFactor&&(a.maxRecordCountFactor=this.maxRecordCountFactor);const o=this.createTileQuery(e,a);t.add({message:n,query:o}),this._onMessage(n)}}))}await o,(0,c.k_)(t),a=Math.min(a+2,6)}}async _fetchDataTilePage(e,t,s){(0,c.k_)(s);const r=this._queryInfo,i={start:this.pageSize*t,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};null!=this.maxRecordCountFactor&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createTileQuery(e,i);try{const i=s.signal,a=await this.enqueueQuery({tile:e,query:n,signal:i,depth:t});return(0,c.k_)(s),a?r!==this._queryInfo?this._fetchDataTilePage(e,t,s):{reader:a,query:n}:null}catch(e){return(0,c.H9)(e),null}}}var le=s(77734),ue=s(61800);function he(e,t,s){const r=e.getXHydrated(),i=e.getYHydrated(),n=t.getColumnForX(r),a=Math.floor(t.normalizeCol(n));return`${s}/${Math.floor(t.getRowForY(i))}/${a}`}function de(e,t){if(null==e)return null;const s=t.transform,r=e.getQuantizationTransform();if(null==r){const[t,r]=s.scale,[i,n]=s.translate,a=-i/t,o=1/t,l=n/r,u=1/-r;return e.transform(a,l,o,u)}const[i,n]=r.scale,[a,o]=r.translate,[l,u]=s.scale,[h,d]=s.translate,c=i/l,g=(a-h)/l,f=n/u,p=(-o+d)/u;return e.transform(g,p,c,f)}let ce=class extends re{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new le.Z(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,t){super.update(e,t),this._featureCount??=t.initialFeatureCount,null!=t.changedFeatureCount&&(this._featureCount=t.changedFeatureCount),this._hasAggregates=!!e.targets?.aggregate}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const e=this._featureCount;return(0,M.O3)(e,"Expected featureCount to be defined"),this._invalidated=!1,this._subscriptions.forEach((e=>e.clear())),this._downloadPromise=this._download(e),void await this._downloadPromise}const t=this._queries.map((({query:e,reader:t})=>this._sendPatchQuery(e,t)));await Promise.all(t),this._subscriptions.forEach((e=>{e.requests.done.forEach((e=>this._onMessage(e.message)))}))}async refresh(e,t){t&&(this._featureCount=t.featureCount),await this.resend(!0)}async _sendPatchQuery(e,t){const s=null!=e.outFields?e.outFields:[],r=this._queryInfo.outFields,i=r.filter((e=>!s.includes(e)));if(!i.length)return;const n=e.clone(),a=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=i,e.outFields=r;const o=await this.enqueueQuery({query:n,depth:0,signal:a});(0,c.k_)({signal:a}),t.joinAttributes(o)}async _fetchDataTile(e){this._downloadPromise??=this._download(this._featureCount);const t=this._store.search(e),s=this._subscriptions.get(e.key.id),r=t.length-1;for(let i=0;i<r;i++){const r=de(t[i],e),n={type:"append",id:e.id,addOrUpdate:r,end:!1,status:K.empty()};s.add({query:null,message:n}),this._hasAggregates||await(0,c.e4)(1),this._onMessage(n)}const i=de(r>=0?t[r]:null,e),n=this._didSendEnd,a={type:"append",id:e.id,addOrUpdate:i,end:n,status:K.empty()};s.add({query:null,message:a}),this._onMessage(a)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),i=Array.from({length:r},((e,t)=>t)).sort(((e,t)=>this._random.getInt()-this._random.getInt())).map((e=>this._downloadPage(e,t,s)));await Promise.all(i),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(e){S.Z.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource").error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",e)}this._sendEnd(),this._loading=!1}async _downloadPage(e,t,s){const r=this.pageSize,i={start:e*r,num:r,cacheHint:!0};null!=this.maxRecordCountFactor&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(i),a=this._signal,o=await this.enqueueQuery({query:n,depth:e,signal:a});(0,c.k_)({signal:a}),this._queries.push({query:n,reader:o}),this._store.insert(o),s.add(o.instance);const l=o.getCursor();for(;l.next();)t.set(l.getDisplayId());this._send(o)}_send(e){if(!this._subscriptions.size)return;let t=null;const s=new Map,r=new Set,i=new Map;this._subscriptions.forEach((e=>{const n=e.tile;s.set(n.key.id,null),t=n.tileInfoView,r.add(n.level);const{row:a,col:o}=n.key,l=`${n.level}/${a}/${o}`,u=i.get(l)??[];u.push(e),i.set(l,u)}));for(const n of r){const r=t.getLODInfoAt(n),a=e.getCursor();for(;a.next();){const e=he(a,r,n),t=a.getIndex();if(i.has(e))for(const r of i.get(e)){const e=r.tile.id;let i=s.get(e);null==i&&(i=[],s.set(e,i)),i.push(t)}}}s.forEach(((t,s)=>{if(null!=t){const r=this._subscriptions.get(s),i={type:"append",id:s,addOrUpdate:de(ue.t.from(e,t),r.tile),end:!1,status:K.empty()};r.add({query:null,message:i}),this._onMessage(i)}}))}_sendEnd(){this._subscriptions.forEach((e=>{const t={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:K.empty()};e.add({query:null,message:t}),this._onMessage(t)})),this._didSendEnd=!0}};ce=(0,r._)([(0,u.j)("esri.view.2d.layers.features.sources.SnapshotFeatureSource")],ce);var ge=s(50758),fe=s(96794),pe=s(22021);const _e="__esri_timestamp__";class me{constructor(e,t,s,r,i=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=e,this.objectIdField=t,this.purgeInterval=i,this._useGeneratedIds="__esri_stream_id__"===this.objectIdField}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const e of t.entries)this._removed.push(e)}add(e){if(this._useGeneratedIds){const t=this._nextId();e.attributes[this.objectIdField]=t,e.objectId=t}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return null==this._trackIdLessObservations&&(this._trackIdLessObservations=new $.Z(1e5)),void this._trackIdLessObservations.enqueue(t);const s=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const e=null!=this._purgeOptions&&null!=this._purgeOptions.maxObservations?this._purgeOptions.maxObservations:1e3,t=(0,pe.uZ)(e,0,1e3);this._trackIdToObservations.set(s,new $.Z(t))}const r=this._trackIdToObservations.get(s),i=r?.enqueue(t);null!=i&&(this._addOrUpdated.has(i)?this._addOrUpdated.delete(i):this._removed.push(i))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const r=[];if(null!=t)for(const e of t){const t=this.store.removeById(e);null!=t&&r.push(t)}const i=[];if(null!=e){const r=new Set(t??[]);for(const t of e)r.has(t.objectId)||(t.attributes[_e]=s,this.store.add(t),i.push(t))}(i.length||r?.length)&&this.store.update(i,r)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach((s=>e[t++]=s)),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;null!=t&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField)for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const e=s.dequeue();this._removed.push(e),t--}if(null!=this._trackIdLessObservations){let s=t-e.displayCount;for(;s-- >0;){const e=this._trackIdLessObservations.dequeue();null!=e&&this._removed.push(e)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const s=60*e.age*1e3,r=this._maxAge-s;this.store.forEach((e=>{e.attributes[t]<r&&this._removed.push(e.objectId)}))}_purgeByAgeReceived(e,t){if(!t.ageReceived)return;const s=e-60*t.ageReceived*1e3;this.store.forEach((e=>{e.attributes[_e]<s&&this._removed.push(e.objectId)}))}_purgeTracks(){this._trackIdToObservations.forEach(((e,t)=>{0===e.size&&this._trackIdToObservations.delete(t)}))}}var ye=s(95047);let Ie=class extends i.Z{constructor(e){super(e)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};function be(e,t){const s=e.weakClone();if(null!=e.geometry){const r=(0,f.Jd)(t,e.geometry.coords[0]),i=(0,f.IN)(t,e.geometry.coords[1]);s.geometry=new E.Z([],[r,i])}return s}(0,r._)([(0,o.Cb)()],Ie.prototype,"connection",void 0),(0,r._)([(0,o.Cb)()],Ie.prototype,"connectionStatus",null),(0,r._)([(0,o.Cb)()],Ie.prototype,"errorString",null),Ie=(0,r._)([(0,u.j)("esri.views.2d.layers.features.sources.StreamConnectionState")],Ie);class Se{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map,this._index=null}get _features(){const e=[];return this._objectIdToFeature.forEach((t=>e.push(t))),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=function(e,t){const s=(0,fe.r)(9,function(e){return"esriGeometryPoint"===e?e=>null!=e.geometry?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let t=1/0,s=1/0,r=-1/0,i=-1/0;return null!=e.geometry&&e.geometry.forEachVertex(((e,n)=>{t=Math.min(t,e),s=Math.min(s,n),r=Math.max(r,e),i=Math.max(i,n)})),{minX:t,minY:s,maxX:r,maxY:i}}}(t));return s.load(e),s}(this._features,this._geometryType)),function(e,t){return e.search({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]})}(this._index,e)}clear(){this._index=null,this._objectIdToFeature.clear()}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}class Te extends te{constructor(e){super(e),this.type="stream",this._updateIntervalId=0,this._level=0,this._isPaused=!1,this._updateInfo={websocket:0,client:0},this._inUpdate=!1;const{outSR:t}=e,{geometryType:s,objectIdField:r,timeInfo:i,purgeOptions:n,source:a,spatialReference:o,serviceFilter:l,maxReconnectionAttempts:u,maxReconnectionInterval:h,updateInterval:d,customParameters:c,enabledEventTypes:g}=e.serviceInfo,p=new Se(this._onUpdate.bind(this),s),_=new me(p,r,i,n),m=(0,ye.createConnection)(a,o,t,s,l,u,h,c??{});var y;this._connectionState=new Ie({connection:m}),this._store=p,this._manager=_,this._connection=m,this._quantize="esriGeometryPoint"===(y=s)?be:(e,t)=>{const s=e.weakClone(),r=new E.Z,i=(0,f.Nh)(r,e.geometry,!1,!1,y,t,!1,!1);return s.geometry=i,s},this._enabledEventTypes=new Set(g),this._handlesGroup=(0,ge.AL)([this._connection.on("data-received",(e=>this._onFeature(e))),this._connection.on("message-received",(e=>this._onWebSocketMessage(e)))]),this._initUpdateInterval=()=>{let t=performance.now();this._updateIntervalId=setInterval((()=>{const s=performance.now(),r=s-t;if(r>2500){t=s;const e=Math.round(this._updateInfo.client/(r/1e3)),i=Math.round(this._updateInfo.websocket/(r/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:e,websocket:i})}e.canAcceptRequest()&&!this._inUpdate&&this._manager.checkForUpdates()}),d)},this._isPaused=e.serviceInfo.isPaused,this._isPaused||this._initUpdateInterval()}destroy(){super.destroy(),this._clearUpdateInterval(),this._connection.destroy(),this._handlesGroup?.remove()}_fetchDataTile(){}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState.errorString}updateCustomParameters(e){this._connection.updateCustomParameters(e)}pauseStream(){this._isPaused||(this._isPaused=!0,this._clearUpdateInterval())}resumeStream(){this._isPaused&&(this._isPaused=!1,this._initUpdateInterval())}sendMessageToSocket(e){this._connection.sendMessageToSocket(e)}sendMessageToClient(e){this._isPaused&&"type"in e&&"clear"===e.type?(this._store.clear(),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,clear:!0,end:!0})}))):this._connection.sendMessageToClient(e)}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}subscribe(e,t){super.subscribe(e,t);const s=this._subscriptions.get(e.id);s.resolve(),this._level=e.level;const r=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:r,end:!0}),s.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(e){const t=this._subscriptions.get(e),{tile:s}=t;yield this._getTileFeatures(s)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach((e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)}))}_getTileFeatures(e){const t=this._store.search(e).map((t=>this._quantize(t,e.transform)));return C.fromOptimizedFeatures(t,this._serviceInfo,e.transform)}_onWebSocketMessage(e){if(this._enabledEventTypes.has("message-received")&&this.events.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this._store.forEach((e=>this._manager.removeById(e.objectId)))}}_onFeature(e){this._updateInfo.websocket++;try{this._enabledEventTypes.has("data-received")&&this.events.emit("data-received",e);const t=(0,f.XA)(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch(e){}}_clearUpdateInterval(){clearInterval(this._updateIntervalId),this._updateIntervalId=0}async _onUpdate(e,t){this._inUpdate=!0;try{null!=e&&(this._updateInfo.client+=e.length),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,clear:!0,end:!1})}));const t=[];this._subscriptions.forEach(((e,s)=>{if(!e.didSend||e.tile.level!==this._level)return;const r=e.tile,i={type:"append",id:s,addOrUpdate:this._getTileFeatures(r),remove:[],end:!1,status:K.empty()};e.requests.stream.enqueue(i),t.push(this._onMessage(i))})),await Promise.all(t),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,end:!0})}))}catch{}this._inUpdate=!1}}var xe=s(16534),ve=s(61027),we=s(26899);s(37720),s(66039);var Ae=s(35371);const Fe=S.Z.getLogger("esri.views.layers.2d.features.support.AttributeStore"),Ce=()=>null,Me={sharedArrayBuffer:(0,n.Z)("esri-shared-array-buffer"),atomics:(0,n.Z)("esri-atomics")};function ke(e,t){return s=>t(e(s))}class Ee{constructor(e,t,s,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:i,layout:n,textureOnly:a}=r;this.textureOnly=a||!1,this.pixelType=i,this._ctype=t,this.layout=n,this._resetRange(),this._shared=e,this.size=s,a||(this.data=this._initData(i,s,e,t))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const s=this.data;for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){const s=this.data;for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,s){const r=this.data;for(const i of s)r[i*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}setComponentTexel(e,t,s){this.data[s*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}unsetComponentTexel(e,t,s){this.data[s*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}getData(e,t){const s=(0,ve.jL)(e);return this.data[s*this.texelSize+t]}setData(e,t,s){const r=(0,ve.jL)(e),i=1<<t;0!=(this.layout&i)?null!=this.data&&(this.data[r*this.texelSize+t]=s,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)):Fe.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===Ae.Br.UNSIGNED_BYTE&&this._shared&&Me.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===Ae.Br.UNSIGNED_BYTE&&this._shared&&Me.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),s=this.data;t.set(s),this.data=t}}toMessage(){const e=this.dirtyStart,t=this.dirtyEnd,s=this.texelSize;if(e>t)return null;this._resetRange();const r=!(this._shared||"local"===this._ctype),i=this.pixelType,n=this.layout,a=this.data;return{start:e,end:t,data:r&&a.slice(e*s,(t+1)*s)||null,pixelType:i,layout:n}}_initData(e,t,s,r){const i=s&&"local"!==r?SharedArrayBuffer:ArrayBuffer,n=(0,we.UK)(e),a=new n(new i(t*t*4*n.BYTES_PER_ELEMENT));for(let e=0;e<a.length;e+=4)a[e+1]=255;return a}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class Re{constructor(e,t){this._client=e,this.config=t,this.updatingHandles=new g.R,this._blocks=new Array,this._filters=new Array(xe.m4),this._attributeComputeInfo=null,this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._nextUpdate=null,this._currUpdate=null,this._idsToHighlight=new Set;const s=t.supportsTextureFloat?Ae.Br.FLOAT:Ae.Br.UNSIGNED_BYTE;Ce(`Creating AttributeStore ${Me.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:Ae.Br.UNSIGNED_BYTE,layout:1},{pixelType:Ae.Br.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:Ae.Br.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:s,layout:15},{pixelType:s,layout:15},{pixelType:s,layout:15},{pixelType:s,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort(),this.updatingHandles.destroy()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){const e=this.updatingHandles.updating||!!this._nextUpdate;return(0,n.Z)("esri-2d-log-updating")&&console.log(`Updating AttributeStore: ${e}\n -> updatingHandles ${this.updatingHandles.updating} (currUpdate: ${!!this._currUpdate})\n -> nextUpdate: ${!!this._nextUpdate}\n`),e}update(e,t){this.config=t;const s=t.schema.processors[0].storage,r=(0,W.Hg)(this._schema,s);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),r&&((0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),e.storage.data=!0,this._schema=s,this._attributeComputeInfo=null,null!=s)){switch(s.target){case"feature":this._targetType=ve.PX;break;case"aggregate":this._targetType=ve.xp}if("subtype"===s.type){this._attributeComputeInfo={isSubtype:!0,subtypeField:s.subtypeField,map:new Map};for(const e in s.mapping){const t=s.mapping[e];if(null!=t&&null!=t.vvMapping)for(const s of t.vvMapping)this._bindAttribute(s,parseInt(e,10))}}else{if(this._attributeComputeInfo={isSubtype:!1,map:new Map},null!=s.vvMapping)for(const e of s.vvMapping)this._bindAttribute(e);if(null!=s.attributeMapping)for(const e of s.attributeMapping)this._bindAttribute(e)}}}onTileData(e,t){if(null==t.addOrUpdate)return;const s=t.addOrUpdate.getCursor();for(;s.next();){const e=s.getDisplayId();this.setAttributeData(e,s)}}async setHighlight(e,t){const s=this._getBlock(0),r=t.map((e=>(0,ve.jL)(e)));s.lock(),s.unsetComponentAllTexels(0,1),s.setComponent(0,1,r),s.unlock(),this._idsToHighlight.clear();for(const t of e)this._idsToHighlight.add(t);await this.sendUpdates()}async updateFilters(e,t,s){(0,n.Z)("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters");const{service:r,spatialReference:i}=s,{filters:a}=t,o=a.map(((e,t)=>this._updateFilter(e,t,r,i))),l=(await Promise.all(o)).some((e=>e));(0,n.Z)("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters - finsihed"),l&&(e.storage.filters=!0,(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,t,s,r){const i=(0,ve.jL)(e);this._ensureSizeForTexel(i),this._getBlock(t).setData(e,s,r)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlag(e){return this._idsToHighlight.has(e)?xe.uG:0}unsetAttributeData(e){const t=(0,ve.jL)(e);this._getBlock(0).setData(t,0,0)}setAttributeData(e,t){const s=(0,ve.jL)(e);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(t)),this._targetType!==(0,ve.vs)(e))return;const r=this._attributeComputeInfo,i=this.config.supportsTextureFloat?1:2;let n=null;r&&(n=r.isSubtype?r.map.get(t.readAttribute(r.subtypeField)):r.map,n&&n.size&&n.forEach(((e,r)=>{const n=r*i%4,a=Math.floor(r*i/4),o=this._getBlock(a+xe.aK),l=e(t);if(this.config.supportsTextureFloat)o.setData(s,n,l);else if(l===xe.AI)o.setData(s,n,255),o.setData(s,n+1,255);else{const e=(0,pe.uZ)(Math.round(l),-32767,32766)+32768,t=255&e,r=(65280&e)>>8;o.setData(s,n,t),o.setData(s,n+1,r)}})))}sendUpdates(){if((0,n.Z)("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=(0,c.hh)(),this.updatingHandles.addPromise(this._nextUpdate.promise),this._nextUpdate.promise;const e={blocks:this._blocks.map((e=>null!=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()))}else(0,n.Z)("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued")};(0,n.Z)("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const s=this.updatingHandles.addPromise(this._client.update(e,this._signal).then(t).catch(t));return this._client.render(this._signal),s})).catch((e=>{if((0,c.D_)(e))return this._createResourcesPromise=null,this._createResources();Fe.error(new b.Z("mapview-attribute-store","Encountered an error during client update",e))})),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e,t){let s;if(null!=e.fieldIndex)e.normalizationField&&Fe.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),s=t=>t.getComputedNumericAtIndex(e.fieldIndex);else{if(!e.field)return;s=function(){const{normalizationField:t}=e;return t?s=>{const r=s.readAttribute(t);return r?s.readAttribute(e.field)/r:null}:t=>t.readAttribute(e.field)}()}const{valueRepresentation:r}=e;r&&(s=ke(s,(e=>function(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}(e,r))));const i=e=>null===e||isNaN(e)||e===1/0||e===-1/0?xe.AI:e,n=this._attributeComputeInfo;if(n.isSubtype){const r=n.map.get(t)??new Map;r.set(e.binding,ke(s,i)),n.map.set(t,r)}else n.map.set(e.binding,ke(s,i))}_createResources(){if(null!=this._createResourcesPromise)return this._createResourcesPromise;this._getBlock(xe.xl),this._getBlock(xe.pU),Ce("Initializing AttributeStore");const e={shared:Me.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:this._blocks.map((e=>null!=e?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null))},t=this._client.initialize(e,this._signal).catch((e=>{(0,c.D_)(e)?this._createResourcesPromise=null:Fe.error(new b.Z("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=t,t.then((()=>null==this._createResourcesPromise?this._createResources():void 0)),t}_getBlock(e){const t=this._blocks[e];if(null!=t)return t;Ce(`Initializing AttributeBlock at index ${e}`);const s=Me.sharedArrayBuffer,r=this._client.type,i=new Ee(s,r,this._size,this._blockDescriptors[e]);return this._blocks[e]=i,this._createResourcesPromise=null,i}_expand(){if(this._size<this.config.maxTextureSize){const e=this._size<<=1;Ce("Expanding block size to",e,this._blocks);for(const t of this._blocks)t?.expand(e);return this._createResourcesPromise=null,this._size=e,0}return Fe.error(new b.Z("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,t,s,r){const i=this._filters[t],n=null!=i&&i.hash;if(!i&&!e)return!1;if(n===JSON.stringify(e))return!1;if(null==e){if(!i)return!1;const e=1<<t+1,s=this._getBlock(0);return this._filters[t]=null,s.setComponentAllTexels(0,e),this.sendUpdates(),!0}const a=await this._getFilter(t,s);return await a.update(e,r),!0}async _getFilter(e,t){const r=this._filters[e];if(null!=r)return r;const{default:i}=await s.e(9169).then(s.bind(s,29169)),n=new i({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:new _.Z(t.fields)});return this._filters[e]=n,n}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let t=0;const s=(0,ve.KS)(e.getDisplayId());for(let r=0;r<this._filters.length;r++){const i=!!(s&1<<r),n=this._filters[r];t|=(!i||null==n||n.check(e)?1:0)<<r}let r=0;if(this._idsToHighlight.size){const t=e.getObjectId();r=this.getHighlightFlag(t)}return t<<1|r}}s(66577);var Le=s(84864),Ze=s(82971),Ue=s(37427);class De{constructor(e=[],t,s=8096){this.onRelease=e=>{},this._nodes=0,this._root=new Oe(this,0,0,0),this._statisticFields=e,this._pool=s?new $.Z(8096):null,this._serviceInfo=t}destroy(){this.clear()}_acquire(e,t,s){this._nodes++;let r=null;return null!=this._pool&&(r=this._pool.dequeue()),null!=r?r.realloc(e,t,s):r=new Oe(this,e,t,s),r}_release(e){this.onRelease(e),this._nodes--,null!=this._pool&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){return this._pool?.size??0}get depth(){let e=0;return this.forEach((t=>e=Math.max(e,t.depth))),e}dropLevels(e){this.forEach((t=>{if(t.depth>=e)for(let e=0;e<t.children.length;e++){const s=t.children[e];s&&this._release(s)}})),this.forEach((t=>{if(t.depth>=e)for(let e=0;e<t.children.length;e++)t.children[e]=null}))}clear(){this.forEach((e=>this._release(e))),this._root=new Oe(this,0,0,0)}insert(e,t,s=0){const r=C.fromOptimizedFeatures([e],this._serviceInfo).getCursor();r.next();const i=r.readGeometry();if(!i)return;const[n,a]=i.coords,o=e.geohashX,l=e.geohashY;this.insertCursor(r,e.displayId,n,a,o,l,t,s)}insertCursor(e,t,s,r,i,n,a,o=0){let l=this._root,u=0,h=0,d=0;for(;null!==l;){if(l.depth>=o&&(l.count+=1,l.xTotal+=s,l.yTotal+=r,l.xGeohashTotal+=i,l.yGeohashTotal+=n,l.referenceId=t,this._updateStatisticsCursor(e,l,1)),u>=a)return void l.add(t);const c=Math.ceil((u+1)/2),g=Math.floor((u+1)/2),f=1-u%2,p=30-(3*c+2*g),_=30-(2*c+3*g),m=(i&7*f+3*(1-f)<<p)>>p,y=(n&3*f+7*(1-f)<<_)>>_,I=m+y*(8*f+4*(1-f));h=h<<3*f+2*(1-f)|m,d=d<<2*f+3*(1-f)|y,null==l.children[I]&&(l.children[I]=this._acquire(h,d,u+1)),u+=1,l=l.children[I]}}remove(e,t){const s=C.fromOptimizedFeatures([e],this._serviceInfo).getCursor();s.next();const r=s.readGeometry();if(!r)return;const[i,n]=r.coords,a=e.geohashX,o=e.geohashY;this.removeCursor(s,i,n,a,o,t)}removeCursor(e,t,s,r,i,n){let a=this._root,o=0;for(;null!==a;){if(a.count-=1,a.xTotal-=t,a.yTotal-=s,a.xGeohashTotal-=r,a.yGeohashTotal-=i,this._updateStatisticsCursor(e,a,-1),o>=n)return void a.remove(e.getDisplayId());const l=Math.ceil((o+1)/2),u=Math.floor((o+1)/2),h=1-o%2,d=30-(3*l+2*u),c=30-(2*l+3*u),g=((r&7*h+3*(1-h)<<d)>>d)+((i&3*h+7*(1-h)<<c)>>c)*(8*h+4*(1-h)),f=a.children[g];1===f?.count&&(this._release(f),a.children[g]=null),o+=1,a=f}}forEach(e){let t=this._root;for(;null!==t;){const s=this._linkChildren(t)||t.next;e(t),t=s}}find(e,t,s){return this._root.find(e,t,s,0,0,0)}findIf(e){let t=null;return this.forEach((s=>{e(s)&&(t=s)})),t}findAllIf(e){const t=[];return this.forEach((s=>{e(s)&&t.push(s)})),t}findSingleOccupancyNode(e,t,s,r,i){let n=this._root;for(;null!==n;){const a=n.depth,o=n.xNode,l=n.yNode,u=1-a%2,h=n.xGeohashTotal/n.count,d=n.yGeohashTotal/n.count;if(1===n.count&&e<h&&h<=s&&t<d&&d<=r)return n;if(a>=i){n=n.next;continue}const c=Math.ceil((a+1)/2),g=Math.floor((a+1)/2),f=30-(3*c+2*g),p=30-(2*c+3*g),_=~((1<<f)-1),m=~((1<<p)-1),y=(e&_)>>f,I=(t&m)>>p,b=(s&_)>>f,S=(r&m)>>p,T=o<<3*u+2*(1-u),x=l<<2*u+3*(1-u),v=T+8*u+4*(1-u),w=x+4*u+8*(1-u),A=Math.max(T,y),F=Math.max(x,I),C=Math.min(v,b),M=Math.min(w,S);let k=null,E=null;for(let e=F;e<=M;e++)for(let t=A;t<=C;t++){const s=t-T+(e-x)*(8*u+4*(1-u)),r=n.children[s];r&&(k||(k=r,k.next=n.next),E&&(E.next=r),E=r,r.next=n.next)}n=k||n.next}return null}getRegionDisplayIds(e){let t=this._root;const{bounds:s,geohashBounds:r,level:i}=e,[n,a,o,l]=s,u=[];for(;null!==t;){const e=t.depth,s=t.xNode,h=t.yNode;if(e>=i){const e=t.xTotal/t.count,s=t.yTotal/t.count;e>=n&&e<=o&&s>=a&&s<=l&&t.displayIds.forEach((e=>u.push(e))),t=t.next;continue}const d=Math.ceil((e+1)/2),c=Math.floor((e+1)/2),g=1-e%2,f=30-(3*d+2*c),p=30-(2*d+3*c),_=~((1<<f)-1),m=~((1<<p)-1),y=(r.xLL&_)>>f,I=(r.yLL&m)>>p,b=(r.xTR&_)>>f,S=(r.yTR&m)>>p,T=s<<3*g+2*(1-g),x=h<<2*g+3*(1-g),v=T+8*g+4*(1-g),w=x+4*g+8*(1-g),A=Math.max(T,y),F=Math.max(x,I),C=Math.min(v,b),M=Math.min(w,S);let k=null,E=null;for(let e=F;e<=M;e++)for(let s=A;s<=C;s++){const r=s-T+(e-x)*(8*g+4*(1-g)),i=t.children[r];i&&(k||(k=i,k.next=t.next),E&&(E.next=i),E=i,i.next=t.next)}t=k||t.next}return u}getRegionStatistics(e){let t=this._root,s=0,r=0,i=0;const n={},{bounds:a,geohashBounds:o,level:l}=e,[u,h,d,c]=a;let g=0;for(;null!==t;){const e=t.depth,a=t.xNode,f=t.yNode;if(e>=l){const e=t.xTotal/t.count,a=t.yTotal/t.count;e>u&&e<=d&&a>h&&a<=c&&(s+=t.count,r+=t.xTotal,i+=t.yTotal,1===t.count&&(g=t.referenceId),this._aggregateStatistics(n,t.statistics)),t=t.next;continue}const p=Math.ceil((e+1)/2),_=Math.floor((e+1)/2),m=1-e%2,y=30-(3*p+2*_),I=30-(2*p+3*_),b=~((1<<y)-1),S=~((1<<I)-1),T=(o.xLL&b)>>y,x=(o.yLL&S)>>I,v=(o.xTR&b)>>y,w=(o.yTR&S)>>I,A=a<<3*m+2*(1-m),F=f<<2*m+3*(1-m),C=A+8*m+4*(1-m),M=F+4*m+8*(1-m),k=Math.max(A,T),E=Math.max(F,x),R=Math.min(C,v),L=Math.min(M,w);let Z=null,U=null;for(let e=E;e<=L;e++)for(let a=k;a<=R;a++){const o=a-A+(e-F)*(8*m+4*(1-m)),l=t.children[o];if(l){if(e!==E&&e!==L&&a!==k&&a!==R){const e=l.xTotal/l.count,t=l.yTotal/l.count;e>u&&e<=d&&t>h&&t<=c&&(s+=l.count,r+=l.xTotal,i+=l.yTotal,1===l.count&&(g=l.referenceId),this._aggregateStatistics(n,l.statistics));continue}Z||(Z=l,Z.next=t.next),U&&(U.next=l),U=l,l.next=t.next}}t=Z||t.next}return{count:s,attributes:this.normalizeStatistics(n,s),xTotal:r,yTotal:i,referenceId:g}}getBins(e){const t=[],{geohashBounds:s,level:r}=e;let i=this._root;for(;null!==i;){const e=i.depth,n=i.xNode,a=i.yNode;if(e>=r){t.push(i),i=i.next;continue}const o=Math.ceil((e+1)/2),l=Math.floor((e+1)/2),u=1-e%2,h=30-(3*o+2*l),d=30-(2*o+3*l),c=~((1<<h)-1),g=~((1<<d)-1),f=(s.xLL&c)>>h,p=(s.yLL&g)>>d,_=(s.xTR&c)>>h,m=(s.yTR&g)>>d,y=n<<3*u+2*(1-u),I=a<<2*u+3*(1-u),b=y+8*u+4*(1-u),S=I+4*u+8*(1-u),T=Math.max(y,f),x=Math.max(I,p),v=Math.min(b,_),w=Math.min(S,m);let A=null,F=null;for(let e=x;e<=w;e++)for(let t=T;t<=v;t++){const s=t-y+(e-I)*(8*u+4*(1-u)),r=i.children[s];r&&(A||(A=r,A.next=i.next),F&&(F.next=r),F=r,r.next=i.next)}i=A||i.next}return t}_linkChildren(e){let t=null,s=null;for(let r=0;r<=e.children.length;r++){const i=e.children[r];i&&(t||(t=i,t.next=e.next),s&&(s.next=i),s=i,i.next=e.next)}return t}_updateStatisticsCursor(e,t,s){for(const r of this._statisticFields){const i=r.name,n=r.inField?e.readAttribute(r.inField):e.getComputedNumericAtIndex(r.inFieldIndex);switch(r.statisticType){case"min":{if(isNaN(n))break;if(!t.statistics[i]){t.statistics[i]={value:n};break}const e=t.statistics[i].value;t.statistics[i].value=Math.min(e,n);break}case"max":{if(isNaN(n))break;if(!t.statistics[i]){t.statistics[i]={value:n};break}const e=t.statistics[i].value;t.statistics[i].value=Math.max(e,n);break}case"count":break;case"sum":case"avg":{t.statistics[i]||(t.statistics[i]={value:0,nanCount:0});const e=t.statistics[i].value,r=t.statistics[i].nanCount??0;null==n||isNaN(n)?t.statistics[i].nanCount=r+s:t.statistics[i].value=e+s*n;break}case"avg_angle":{t.statistics[i]||(t.statistics[i]={x:0,y:0,nanCount:0});const e=t.statistics[i].x,r=t.statistics[i].y,a=t.statistics[i].nanCount??0,o=Math.PI/180;null==n||isNaN(n)?t.statistics[i].nanCount=a+s:(t.statistics[i].x=e+s*Math.cos(n*o),t.statistics[i].y=r+s*Math.sin(n*o));break}case"mode":{t.statistics[i]||(t.statistics[i]={});const e=t.statistics[i][n]||0;t.statistics[i][n]=e+s;break}}}}_aggregateStatistics(e,t){for(const s of this._statisticFields){const r=s.name;switch(s.statisticType){case"min":{if(!e[r]){e[r]={value:t[r].value};break}const s=e[r].value;e[r].value=Math.min(s,t[r].value);break}case"max":{if(!e[r]){e[r]={value:t[r].value};break}const s=e[r].value;e[r].value=Math.max(s,t[r].value);break}case"count":break;case"sum":case"avg":case"avg_angle":case"mode":e[r]||(e[r]={});for(const s in t[r]){const i=e[r][s]||0;e[r][s]=i+t[r][s]}}}}normalizeStatistics(e,t){const s={};for(const r of this._statisticFields){const i=r.name;switch(r.statisticType){case"min":case"max":{const r=e[i];if(!t||!r)break;s[i]=r.value;break}case"count":if(!t)break;s[i]=t;break;case"sum":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r;break}case"avg":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r/(t-n);break}case"avg_angle":{if(!t)break;const{x:r,y:n,nanCount:a}=e[i];if(!(t-a))break;const o=r/(t-a),l=n/(t-a),u=180/Math.PI,h=Math.atan2(l,o)*u;s[i]=h;break}case"mode":{const t=e[i];let r=0,n=0,a=null;for(const e in t){const s=t[e];s===r?n+=1:s>r&&(r=s,n=1,a=e)}s[i]="null"===a||n>1?null:a;break}}}return s}}class Oe{constructor(e,t,s,r){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.referenceId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this._tree=e,this.children=new Array(32);for(let e=0;e<this.children.length;e++)this.children[e]=null;this.xNode=t,this.yNode=s,this.depth=r}realloc(e,t,s){for(let e=0;e<this.children.length;e++)this.children[e]=null;return this.xNode=e,this.yNode=t,this.depth=s,this.next=null,this.xGeohashTotal=0,this.yGeohashTotal=0,this.displayId=0,this.referenceId=0,this.xTotal=0,this.yTotal=0,this.count=0,this.statistics={},this.displayIds.clear(),this}get id(){return`${this.xNode}.${this.yNode}`}add(e){this.displayIds.add(e)}remove(e){this.displayIds.delete(e)}getAttributes(){const e=this._tree.normalizeStatistics(this.statistics,this.count);return e.referenceId=null,e.aggregateId=this.id,e.aggregateCount=this.count,e}getGeometry(e,t){const s=this.getLngLatBounds(),[r,i,n,a]=s,o=(0,Ue.iV)({rings:[[[r,i],[r,a],[n,a],[n,i],[r,i]]]},Ze.Z.WGS84,e),l=(0,f.Uy)(new E.Z,o,!1,!1);return null!=t?(0,f.Nh)(new E.Z,l,!1,!1,"esriGeometryPolygon",t,!1,!1):l}getGeometryCentroid(e,t){const s=this.getLngLatBounds(),[r,i,n,a]=s,o=(0,Ue.iV)({x:(r+n)/2,y:(i+a)/2},Ze.Z.WGS84,e),l=(0,f.dd)(new E.Z,o);return null!=t?(0,f.Nh)(new E.Z,l,!1,!1,"esriGeometryPoint",t,!1,!1):l}getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),s=Math.floor(e/2),r=30-(3*t+2*s),i=30-(2*t+3*s),n=this.xNode<<r,a=this.yNode<<i;return(0,Le.bU)({geohashX:n,geohashY:a},this.depth)}find(e,t,s,r,i,n){if(r>=s)return this;const a=1-r%2,o=3*a+2*(1-a),l=2*a+3*(1-a),u=30-i-o,h=30-n-l,d=((e&7*a+3*(1-a)<<u)>>u)+((t&3*a+7*(1-a)<<h)>>h)*(8*a+4*(1-a)),c=this.children[d];return null==c?null:c.find(e,t,s,r+1,i+o,n+l)}}var Pe=s(60437),Ne=s(68441),Be=s(59999),ze=s(38913),qe=s(6570);const Ge=S.Z.getLogger("esri.view.2d.layers.features.support.BinStore"),je=(0,Pe.Ue)();function Qe(e){return 57.29577951308232*e}class Ye extends Be.J{constructor(e,t,s,r){super(e,s),this.type="bin",this.events=new V.Z,this.objectIdField="aggregateId",this.featureAdapter=m.k,this._geohashLevel=5,this._geohashBuf=[],this._serviceInfo=r,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=(0,Ue._W)(t,Ze.Z.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}destroy(){this._tree&&this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch(e){}this._fields=this._schema.params.fields;const r=(0,W.Hg)(s,t);t&&(null!=r||e.source||e.storage.filters)?(((0,W.uD)(r,"params.fields")||(0,W.uD)(r,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new De(this._statisticFields,this._serviceInfo),this._tree.onRelease=e=>e.displayId&&this._storage.releaseDisplayId(e.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),(0,n.Z)("esri-2d-update-debug")&&Ge.info("Aggregate mesh needs update due to tree changing")),(0,n.Z)("esri-2d-update-debug")&&Ge.info("Aggregate mesh needs update due to tree changing"),e.targets[t.name]=!0,e.mesh=!1):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepAggregates(e,t,s){}onTileData(e,t,s,r,i=!0){if(!this._schema||null==t.addOrUpdate)return t;this.events.emit("changed");const n=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,r)}if(t.status.mesh||!i)return t;const a=new Array;this._getBinsForTile(a,e,n,s),t.addOrUpdate=C.fromOptimizedFeatures(a,{fields:this.fields,geometryType:"esriGeometryPolygon",objectIdField:this.objectIdField}),t.addOrUpdate.attachStorage(s),t.end=!0,t.isRepush||(t.clear=!0);{const r=t.addOrUpdate.getCursor();for(;r.next();){const t=r.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(s,r,t,e.scale)}}return t}forEachBin(e){this._tree.forEach(e)}forEach(e){this._tree.forEach((t=>{if(t.depth!==this._geohashLevel)return;const s=this._toFeatureJSON(t),r=C.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();r.next(),e(r)}))}forEachInBounds(e,t){}forEachBounds(e,t){const{hasM:s,hasZ:r}=this.geometryInfo;for(const i of e){const e=(0,f.$)(je,i.readGeometry(),r,s);null!=e&&t(e)}}onTileUpdate(e){}getAggregate(e){const t=(0,ve.QS)(e,!0),s=this._tree.findIf((e=>e.displayId===t));return s?this._toFeatureJSON(s):null}getAggregates(){return this._tree.findAllIf((e=>e.depth===this._geohashLevel)).map(this._toFeatureJSON.bind(this))}getDisplayId(e){return this._tree.findIf((t=>t.id===e))?.displayId}getFeatureDisplayIdsForAggregate(e){const t=this._tree.findIf((t=>t.id===e));return null!=t?Array.from(t.displayIds):[]}getDisplayIdForReferenceId(e){return this._tree.findIf((t=>1===t.displayIds.size&&t.displayIds.has(e)))?.displayId}_toFeatureJSON(e){const t=this._spatialReference;return{displayId:e.displayId,attributes:e.getAttributes(),geometry:(0,f.di)(e.getGeometry(t),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const n=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(s,n,a))return;const o=this._geohashBuf[2*s],l=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,a,o,l,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=Qe(t/Ne.sv.radius),n=i-360*Math.floor((i+180)/360),a=Qe(Math.PI/2-2*Math.atan(Math.exp(-s/Ne.sv.radius)));(0,Le.tp)(r,e,a,n,12)}else{const i=(0,Ue.iV)({x:t,y:s},this._spatialReference,Ze.Z.WGS84);if(!i)return!1;(0,Le.tp)(r,e,i.y,i.x,12)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,t,s,r){try{const i=this._getGeohashBounds(t),n=this._tree.getBins(i);for(const t of n){t.displayId||(t.displayId=r.createDisplayId(!0));let i=null;const n=t.getGeometry(this._spatialReference,s.tile);n||(i=t.getGeometryCentroid(this._spatialReference,s.tile));const a=new A.u_(n,t.getAttributes(),i);a.objectId=t.id,a.displayId=t.displayId,e.push(a)}}catch(e){return void Ge.error("Unable to get bins for tile",t.key.id)}}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return(0,Le.v7)(r,t,e,s),r}_getGeohashBounds(e){const t=this._getGeohashLevel(e.key.level),s=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],r=ze.Z.fromExtent(qe.Z.fromBounds(s,this._spatialReference)),i=(0,Ue.iV)(r,this._spatialReference,Ze.Z.WGS84,{densificationStep:64*e.resolution}),n=(0,f.Uy)(new E.Z,i,!1,!1),a=n.coords.filter(((e,t)=>!(t%2))),o=n.coords.filter(((e,t)=>t%2)),l=Math.min(...a),u=Math.min(...o),h=Math.max(...a),d=Math.max(...o),c=this._getGeohash(l,u,t),g=this._getGeohash(h,d,t);return{bounds:s,geohashBounds:{xLL:c.geohashX,yLL:c.geohashY,xTR:g.geohashX,yTR:g.geohashY},level:t}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=(0,h.C5)(t);if(!r)return{tile:s,left:null,right:null};const[i,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[i-n+e.bounds[0],e.bounds[3]]}}}}const He=(0,Pe.Ue)();class Xe extends A.nd{constructor(e,t,s,r,i){super(new E.Z([],[t,s]),r,null,e),this.geohashBoundsInfo=i}get count(){return this.attributes.cluster_count}static create(e,t,s,r,i,n,a,o){const l=new Xe(t,s,r,n,a);return l.displayId=e.createDisplayId(!0),l.referenceId=o,l.tileLevel=i,l}update(e,t,s,r,i,n){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=i,this.referenceId=null,this.referenceId=n,this}toJSON(){return{attributes:{...this.attributes,aggregateId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function Ve(e){return 57.29577951308232*e}class We extends Be.J{constructor(e,t,s,r){super(e,s),this.type="cluster",this.events=new V.Z,this.objectIdField="aggregateId",this.featureAdapter=m.k,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this._serviceInfo=r,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=(0,Ue._W)(t,Ze.Z.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}destroy(){this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch(e){}this._fields=[...this._schema.params.fields,{name:"referenceId",alias:"referenceId",type:"esriFieldTypeInteger"}],this._fields.some((e=>"cluster_count"===e.name))||this._fields.push({name:"cluster_count",alias:"cluster_count",type:"esriFieldTypeInteger"});const r=(0,W.Hg)(s,t);t&&(null!=r||e.source||e.storage.filters)?(((0,W.uD)(r,"params.fields")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new De(this._statisticFields,this._serviceInfo),this._rebuildTree(),(0,n.Z)("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",r),e.targets[t.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepAggregates(e,t,s){this._clusters.forEach(((r,i)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(i))}))}onTileData(e,t,s,r,i=!0){if(!this._schema||null==t.addOrUpdate)return t;this.events.emit("changed");const n=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,r)}if(t.status.mesh||!i)return t;const a=new Array,o=this._schema.params.clusterRadius;this._getClustersForTile(a,e,o,s,n),t.addOrUpdate=C.fromOptimizedFeatures(a,{fields:this.fields,geometryType:"esriGeometryPoint",objectIdField:this.objectIdField}),t.addOrUpdate.attachStorage(s),t.clear=!0,t.end=!0;{const r=t.addOrUpdate.getCursor();for(;r.next();){const t=r.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(s,r,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if((t?.displayId&ve._I)==(e&ve._I))return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())t?.tileLevel===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);return t?this._tree.getRegionDisplayIds(t.geohashBoundsInfo):[]}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if(t?.referenceId===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){this._clusters.forEach((t=>{if(!t)return;const s=t.toJSON(),r=C.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();r.next(),e(r)}))}forEachInBounds(e,t){}forEachBounds(e,t){const{hasM:s,hasZ:r}=this.geometryInfo;for(const i of e){const e=(0,f.$)(He,i.readGeometry(),r,s);null!=e&&t(e)}}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const n=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(s,n,a))return;const o=this._geohashBuf[2*s],l=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,a,o,l,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=Ve(t/Ne.sv.radius),n=i-360*Math.floor((i+180)/360),a=Ve(Math.PI/2-2*Math.atan(Math.exp(-s/Ne.sv.radius)));(0,Le.tp)(r,e,a,n,12)}else{const i=(0,Ue.iV)({x:t,y:s},this._spatialReference,Ze.Z.WGS84);if(!i)return!1;(0,Le.tp)(r,e,i.y,i.x,12)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,s,r,i,n=!0){const a=this._schema.params.clusterPixelBuffer,o=2*s,l=Math.ceil(2**t.key.level*xe.I_/o)+1,u=Math.ceil(a/o)+0,h=Math.ceil(xe.I_/o),{row:d,col:c}=t.key,g=c*xe.I_,p=d*xe.I_,_=Math.floor(g/o)-u,m=Math.floor(p/o)-u,y=_+h+2*u,I=m+h+2*u,b=t.tileInfoView.getLODInfoAt(t.key.level);for(let s=_;s<=y;s++)for(let a=m;a<=I;a++){let o=s;b.wrap&&(o=s<0?s+l:s%l);const u=b.wrap&&s<0,h=b.wrap&&s%l!==s,d=this._lookupCluster(r,b,t.key.level,o,a,t);if(null!=d){let t=null;if(i&&(t=u?i.left:h?i.right:i.tile),n&&null==t)continue;if(!d.count)continue;if(null!=t&&n){const s=d.geometry.clone();let r=d.attributes;s.coords[0]=(0,f.Jd)(t,s.coords[0]),s.coords[1]=(0,f.IN)(t,s.coords[1]),1===d.count&&null!=d.referenceId&&(r={...d.attributes,referenceId:d.referenceId});const i=new A.u_(s,r);i.displayId=d.displayId,e.push(i)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),12)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=1*(Math.floor(t/1)+1)-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=(0,h.C5)(t);if(!r)return{tile:s,left:null,right:null};const[i,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[i-n+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,i=2*r;let n=s%2?t*i:t*i-r;const a=s*i;let o=n+i;const l=a-i,u=2**e.level*xe.I_;e.wrap&&n<0&&(n=0),e.wrap&&o>u&&(o=u);const h=n/xe.I_,d=a/xe.I_,c=o/xe.I_,g=l/xe.I_;return[e.getXForColumn(h),e.getYForRow(d),e.getXForColumn(c),e.getYForRow(g)]}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return(0,Le.v7)(r,t,e,s),r}_getGeohashBounds(e,t){const s=this._getGeohashLevel(e.key.level);if(this._spatialReference.isWebMercator){const[e,r,i,n]=t,a={x:e,y:r},o={x:i,y:n};let l=0,u=0,h=0,d=0;{const e=Ve(a.x/Ne.sv.radius);l=e-360*Math.floor((e+180)/360),u=Ve(Math.PI/2-2*Math.atan(Math.exp(-a.y/Ne.sv.radius)))}{const e=Ve(o.x/Ne.sv.radius);h=e-360*Math.floor((e+180)/360),d=Ve(Math.PI/2-2*Math.atan(Math.exp(-o.y/Ne.sv.radius)))}const c={geohashX:0,geohashY:0},g={geohashX:0,geohashY:0};return(0,Le.v7)(c,u,l,s),(0,Le.v7)(g,d,h,s),{bounds:[e,r,i,n],geohashBounds:{xLL:c.geohashX,yLL:c.geohashY,xTR:g.geohashX,yTR:g.geohashY},level:s}}const r=ze.Z.fromExtent(qe.Z.fromBounds(t,this._spatialReference)),i=(0,Ue.iV)(r,this._spatialReference,Ze.Z.WGS84,{densificationStep:64*e.resolution});if(!i)return null;const n=(0,f.Uy)(new E.Z,i,!1,!1),a=n.coords.filter(((e,t)=>!(t%2))),o=n.coords.filter(((e,t)=>t%2)),l=Math.min(...a),u=Math.min(...o),h=Math.max(...a),d=Math.max(...o),c=this._getGeohash(l,u,s),g=this._getGeohash(h,d,s);return{bounds:t,geohashBounds:{xLL:c.geohashX,yLL:c.geohashY,xTR:g.geohashX,yTR:g.geohashY},level:s}}_lookupCluster(e,t,s,r,i,n){const a=this._getClusterId(s,r,i),o=this._clusters.get(a),l=this._getClusterBounds(t,r,i),u=this._getGeohashBounds(n,l);if(null==u)return null;const h=this._tree.getRegionStatistics(u),{count:d,xTotal:c,yTotal:g,referenceId:f}=h,p=d?c/d:0,_=d?g/d:0;if(0===d)return this._clusters.set(a,null),null;const m={cluster_count:d,...h.attributes},y=null!=o?o.update(p,_,s,m,u,f):Xe.create(e,a,p,_,s,m,u,f);if(0===d){const[e,t,s,r]=l;y.geometry.coords[0]=(e+s)/2,y.geometry.coords[1]=(t+r)/2}return this._clusters.set(a,y),this._updateAggregateValueRangeForCluster(y,y.tileLevel),y}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,i=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(i,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&i===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(xe.I_/s),{row:i,col:n}=e.key,a=n*xe.I_,o=i*xe.I_,l=Math.floor(a/s),u=Math.floor(o/s);for(let t=l;t<l+r;t++)for(let s=u;s<u+r;s++)this._markForDeletion(e.key.level,t,s)}}class Je{constructor(){this._freeIds=[],this._idCounter=1}createId(e=!1){return(0,ve.QS)(this._getFreeId(),e)}releaseId(e){this._freeIds.push(e)}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}var $e=s(93054);function Ke(e,t,s){if(!(e.length>t))for(;e.length<=t;)e.push(s)}class et{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new Je,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push($e.p.create(this._allocatedSize,ve._I)),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]=[]),Ke(this._numerics[e],t,0)}_ensureInstanceId(e){Ke(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),Ke(this._strings[e],t,null)}createDisplayId(e=!1){const t=this._idGenerator.createId();return t>this._allocatedSize&&this._expand(),(0,ve.QS)(t,e)}releaseDisplayId(e){for(const t of this._bitsets)t.unset(e);return this._idGenerator.releaseId(e&ve._I)}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&ve._I,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&ve._I,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&ve._I,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&ve._I,0,s)}getComputedNumericAtIndex(e,t){const s=e&ve._I;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const r=e&ve._I;this._ensureNumeric(t,r),this._numerics[t][r]=s}getInstanceId(e){const t=e&ve._I;return this._ensureInstanceId(t),this._instanceIds[t]}setInstanceId(e,t){const s=e&ve._I;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&ve._I;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const r=e&ve._I;this._ensureString(t,r),this._strings[t][r]=s}getXMin(e){return this._bounds[4*(e&ve._I)]}getYMin(e){return this._bounds[4*(e&ve._I)+1]}getXMax(e){return this._bounds[4*(e&ve._I)+2]}getYMax(e){return this._bounds[4*(e&ve._I)+3]}setBounds(e,t){const s=t.readHydratedGeometry();if(!s||!s.coords.length)return!1;let r=1/0,i=1/0,n=-1/0,a=-1/0;s.forEachVertex(((e,t)=>{r=Math.min(r,e),i=Math.min(i,t),n=Math.max(n,e),a=Math.max(a,t)}));const o=e&ve._I;return Ke(this._bounds,4*o+4,0),this._bounds[4*o]=r,this._bounds[4*o+1]=i,this._bounds[4*o+2]=n,this._bounds[4*o+3]=a,!0}}function tt(e){if(!(0,c.D_)(e)&&!function(e){return"worker:port-closed"===e.name}(e))throw e}function st(e){return"feature"===e.type&&"snapshot"===e.mode}let rt=class extends i.Z{constructor(){super(...arguments),this._storage=new et,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this._updatingHandles=new g.R,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new se.e({concurrency:"stream"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this)),(0,a.gx)((()=>!this.updating),(()=>this.onIdle()))])}_initSource(){const e=this.tileStore.tileScheme;this._source=function(e,t,s,r,i,n){const a=function(e,t,s,r,i,n){switch(e.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:e.featureCount??0,serviceInfo:e,onMessage:r,outSR:t,tileInfoView:s,canAcceptRequest:i,store:n};case"stream":return{type:"stream",serviceInfo:e,onMessage:r,outSR:t,canAcceptRequest:i};case"memory":case"on-demand":return{type:"feature",serviceInfo:e,onMessage:r,outSR:t,origin:function(e){return Array.isArray(e)?"local":"path"in e&&(0,y.M8)(e.path)?"hosted":"unknown"}(e.source),tileInfoView:s,canAcceptRequest:i}}}(e,t,s,r,i,n);switch(a.type){case"feature":switch(a.origin){case"hosted":case"local":return new oe(a);case"snapshot":return new ce(a);default:return new ae(a)}case"stream":return new Te(a)}}(this.service,this.spatialReference,e,((e,t)=>(this._invalidated=!0,this._patchTile(e,t))),(()=>this._updateQueue&&this._updateQueue.length<50),this.featureStore),this._proxyEvents()}_setStreamClientProperty(e,t){this.remoteClient.invoke("setProperty",{propertyName:e,value:t}).catch(tt)}_proxyEvents(){if("stream"===this._source.type){const e=this._source.events,t=this._source;this.addHandles([(0,a.YP)((()=>t.connectionStatus),(e=>this._setStreamClientProperty("pipelineConnectionStatus",e)),{initial:!0}),(0,a.YP)((()=>t.errorString),(e=>this._setStreamClientProperty("pipelineErrorString",e)),{initial:!0}),e.on("data-received",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(tt))),e.on("message-received",(e=>this.remoteClient.invoke("emitEvent",{name:"message-received",event:e}).catch(tt))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(tt)))])}}_initAttributeStore(e){this.attributeStore||(this.attributeStore=new Re({type:"remote",initialize:(e,t)=>(0,c.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.initialize",e,{signal:t}).catch(tt)),update:(e,t)=>(0,c.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.requestUpdate",e,{signal:t}).catch(tt)),render:e=>(0,c.R8)(this.remoteClient.invoke("tileRenderer.featuresView.requestRender",void 0,{signal:e}).catch(tt))},e))}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new m.p(t,this._storage,e)}_initQueryEngine(e){const t=this;this.featureQueryEngine?.destroy(),this.featureQueryEngine=new p.q({definitionExpression:e.schema.source.definitionExpression??void 0,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds:e=>null==t.aggregateStore?[]:t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(e,t){if(this.aggregateQueryEngine?.destroy(),null==e)return;const s=t.targets.aggregate.params.fields.slice();this.aggregateQueryEngine=new p.q({definitionExpression:void 0,fields:s,geometryType:e.geometryInfo.geometryType,objectIdField:e.objectIdField,hasM:e.geometryInfo.hasM,hasZ:e.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:e,aggregateAdapter:{getFeatureObjectIds:e=>[]}})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.featureQueryEngine?.destroy(),this.aggregateQueryEngine?.destroy(),this.attributeStore?.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating),this._updatingHandles.destroy()}get fieldsIndex(){return new _.Z(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const e=this._source.updatingHandles.updating,t=!this.attributeStore||this.attributeStore.updatingHandles.updating,s=e||t||this._updatingHandles.updating;if((0,n.Z)("esri-2d-log-updating")){let r=`Updating FeatureController2D: ${s}\n`;r+=` -> updatingSource ${e}\n`;for(const e of this._source.subscriptions)r+=` ${e.tile.id} ${e.isDone}\n`;r+=` -> updatingAttributeStore ${t}\n`,r+=` -> updatingHandles ${this._updatingHandles.updating} (queue: ${this._updateQueue.length})\n`,console.log(r)}return s}updateCustomParameters(e){"stream"===this._source.type&&this._source.updateCustomParameters(e)}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){"stream"===this._source.type&&this._source.pauseStream()}resumeStream(){"stream"===this._source.type&&this._source.resumeStream()}sendMessageToSocket(e){"stream"===this._source.type&&this._source.sendMessageToSocket(e)}sendMessageToClient(e){"stream"===this._source.type&&this._source.sendMessageToClient(e)}_initAggregateStore(e){const t=e.schema.targets?.aggregate?.type??null;if((this.config?.schema.targets?.aggregate?.type??null)!==t&&(null!=this.aggregateStore&&(this.removeHandles("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),t)){switch(t){case"cluster":{const e={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new We(e,this.spatialReference,this._storage,this.service),this.addHandles(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(tt)})),"valueRangesChanged");break}case"bin":{const e={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new Ye(e,this.spatialReference,this._storage,this.service);break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(e,t){this._updateVersion++,(0,n.Z)("esri-2d-update-debug")&&console.debug(`FeatureController2D::update: Token version ${this._updateVersion}`),this._initQueryEngine(t),this._initAttributeStore(t),this.pause(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,t,this)]),this._initAggregateStore(t),null!=this.aggregateStore&&await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),this._initAggregateQueryEngine(this.aggregateStore,t.schema),(0,n.Z)("esri-2d-update-debug")&&e.describe(),this._set("config",t)}async applyUpdate(e){e.version=this._updateVersion,(0,n.Z)("esri-2d-update-debug")&&console.debug(`FeatureController2D::applyUpdate: Token version ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),(0,n.Z)("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for source update to finish"),this.notifyChange("updating"),await(0,a.N1)((()=>!this.updating)),(0,n.Z)("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Source update finsihed"),null!=this.aggregateStore&&(await(0,c.e4)(10),(0,n.Z)("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for aggregate idle call"),await(0,a.N1)((()=>!this.updating)),(0,n.Z)("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Aggregate idle called")),(0,n.Z)("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Update finished")}async onEdits({edits:e}){(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),s=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(s,t),this.clearTiles(),this.notifyChange("updating"),null!=this.aggregateStore&&this.aggregateStore.clear(),await this._source.resend(),await(0,a.N1)((()=>!this.updating))}catch(e){}}async refresh(e){if(!e.dataChanged){const e=K.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion,e),this._cleanupNeeded=!0,this.notifyChange("updating"),await(0,a.N1)((()=>!this.updating))}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e,!1)}onTileUpdate(e){null!=this.aggregateStore&&this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t,this._updateVersion),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,null==this.aggregateStore&&"heatmap"!==this.processor.type||await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.featureQueryEngine.executeQueryForSummaryStatistics(e,t)}async queryAggregateSummaryStatistics({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForSummaryStatistics(this._normalizeAggregateQuery(e),t)}async queryUniqueValues({query:e,params:t}){return this.featureQueryEngine.executeQueryForUniqueValues(e,t)}async queryAggregateUniqueValues({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForUniqueValues(this._normalizeAggregateQuery(e),t)}async queryClassBreaks({query:e,params:t}){return this.featureQueryEngine.executeQueryForClassBreaks(e,t)}async queryAggregateClassBreaks({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForClassBreaks(this._normalizeAggregateQuery(e),t)}async queryHistogram({query:e,params:t}){return this.featureQueryEngine.executeQueryForHistogram(e,t)}async queryAggregateHistogram({query:e,params:t}){return this.aggregateQueryEngine.executeQueryForHistogram(this._normalizeAggregateQuery(e),t)}queryExtent(e){return this.featureQueryEngine.executeQueryForExtent(e)}queryAggregates(e){return this.aggregateQueryEngine.executeQuery(this._normalizeAggregateQuery(e))}queryAggregateCount(e){return this.aggregateQueryEngine.executeQueryForCount(this._normalizeAggregateQuery(e))}queryAggregateIds(e){return this.aggregateQueryEngine.executeQueryForIds(this._normalizeAggregateQuery(e))}queryFeatures(e){return this.featureQueryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.featureQueryEngine.executeQuery(e),s=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[s],r=this.getDisplayId(t);return null!=r&&this.attributeStore.isVisible(r)})),t}queryFeatureCount(e){return this.featureQueryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.featureQueryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.featureQueryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(null!=this.aggregateStore){const t=this.aggregateStore.getDisplayId(e);if(null==t){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],s=[];for(const r of e){const e=null!=this.aggregateStore?this.getAggregate(r):null;if(null!=e)if(null!=e.attributes.referenceId){const s=this.getFeature(e.attributes.referenceId);null!=s&&t.push(s)}else s.push(e);else{const e=this.getFeature(r);null!=e&&t.push(e)}}return{features:t,aggregates:s}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(null==t)return null;const s=t.readHydratedGeometry(),r=(0,f.di)(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:r}}getAggregate(e){return null==this.aggregateStore?null:this.aggregateStore.getAggregate(e)}getAggregates(){return null==this.aggregateStore?[]:this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e))).filter(l.pC);return this.attributeStore.setHighlight(e,t)}_normalizeAggregateQuery(e){const t=e.objectIds??[];for(const s of e.aggregateIds??[])t.push(s);return e.objectIds=t,e.aggregateIds=[],e}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level));e.map((async e=>this._patchTile({type:"append",id:e.key.id,clear:!0,addOrUpdate:null,end:!1})));const t=e.map((async e=>this._patchTile({type:"append",id:e.key.id,addOrUpdate:C.fromOptimizedFeatures([],this.service),remove:[],end:!0,isRepush:!0,status:K.empty()})));await Promise.all(t)}_maybeForceCleanup(){performance.now()-this._lastCleanup>5e3&&this._markAndSweep()}_patchTile(e,t){const s=this._updateQueue.push(e,t).catch((e=>{}));return this._updatingHandles.addPromise(s)}async _onTileMessage(e,t){if((0,c.k_)(t),(0,n.Z)("esri-2d-update-debug")){const t=e.addOrUpdate?.hasFeatures;console.debug(e.id,`FeatureController:onTileMessage: [clear:${e.clear}, end:${e.end}, features: ${t}]`)}const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s,e.end);const r=e.status;this._cleanupNeeded=!0;const i=[];for(const t of e.remove??[]){const e=this.featureStore.lookupDisplayId(t);e&&i.push(e)}e.remove=i;try{if(null==e.addOrUpdate)return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},null!=this.aggregateStore,t).catch(c.H9);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&r.targets.feature||(r.targets.feature=!0,this.featureStore.onTileData(s,e)),r.storage.data&&r.storage.filters||(r.storage.data=!0,r.storage.filters=!0,this.attributeStore.onTileData(s,e),"stream"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),(0,c.k_)(t)):this.attributeStore.sendUpdates()),null!=this.aggregateStore&&!r.targets.aggregate){r.targets.aggregate=!0;const t=st(this._source)&&this._source.loading,i=!st(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,i),!i)return;r.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates())}if(!r.mesh){r.mesh=!0;const i=null!=this.aggregateStore&&"cluster"===this.aggregateStore.type;await this.processor.onTileMessage(s,e,i,t),(0,c.k_)(t)}this._maybeForceCleanup()}catch(e){(0,c.H9)(e)}}_mark(e,t,s){const r=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(r),s.set(e))}_markAndSweep(){if(this._lastCleanup=performance.now(),"feature"===this._source.type&&"snapshot"===this._source.mode||"stream"!==this._source.type&&!this._cleanupNeeded)return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const s of this.tileStore.tiles)for(const r of this._source.readers(s.id)){const s=r.getCursor();for(;s.next();){let r=s.getDisplayId();if(!r){const e=s.getObjectId();r=this.featureStore.lookupDisplayId(e)}this._mark(r,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((s=>{this._mark(s,t,e)})),this._updateQueue.forEach((s=>{for(const r of s.remove??[]){const s=this.featureStore.lookupDisplayId(r);this._mark(s,t,e)}})),null!=this.aggregateStore&&(this.aggregateStore.sweepFeatures(e,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};(0,r._)([(0,o.Cb)({constructOnly:!0})],rt.prototype,"tileStore",void 0),(0,r._)([(0,o.Cb)()],rt.prototype,"config",void 0),(0,r._)([(0,o.Cb)({readOnly:!0})],rt.prototype,"fieldsIndex",null),(0,r._)([(0,o.Cb)()],rt.prototype,"processor",void 0),(0,r._)([(0,o.Cb)({constructOnly:!0})],rt.prototype,"remoteClient",void 0),(0,r._)([(0,o.Cb)({constructOnly:!0})],rt.prototype,"service",void 0),(0,r._)([(0,o.Cb)()],rt.prototype,"spatialReference",null),(0,r._)([(0,o.Cb)()],rt.prototype,"updating",null),rt=(0,r._)([(0,u.j)("esri.views.2d.layers.features.controllers.FeatureController2D")],rt);const it=rt;var nt=s(3894),at=s(24470),ot=s(6388),lt=s(55415);class ut{constructor(e,t){this.key=new lt.Z(0,0,0,0),this.bounds=(0,at.Ue)(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get id(){return this.key.id}get extent(){return qe.Z.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),t=nt.Z.acquire();for(let s=0;s<e.length;s++)t[s]=new ut(this.tileInfoView,e[s]);return t}getQuantizationParameters(){return ot.Z.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}var ht=s(67524);const dt={added:[],removed:[]},ct=new Set,gt=new lt.Z(0,0,0,0);class ft extends V.Z{constructor(e){super(),this._tiles=new Map,this._index=(0,fe.r)(9,(0,n.Z)("esri-csp-restrictions")?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const e=new ut(this.tileScheme,s);this._tiles.set(s,e),this._index.insert(e),t.added.push(e)}for(const s of e.removed)if(this.has(s)){const e=this.get(s);this._tiles.delete(s),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach((e=>this.tiles.push(e))),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:r}=t,{level:i}=r;if(s.length>0)for(const{row:e,colFrom:t,colTo:n}of s)for(let s=t;s<=n;s++){const t=gt.set(i,e,r.normalizeCol(s),r.getWorldForColumn(s)).id;if(ct.add(t),!this.has(t)){const e=new ut(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),dt.added.push(e)}}for(let e=this.tiles.length-1;e>=0;e--){const t=this.tiles[e];ct.has(t.id)||(this._tiles.delete(t.id),this.tiles.splice(e,1),this._index.remove(t),dt.removed.push(t))}(dt.added.length||dt.removed.length)&&this.emit("update",dt),ht.Z.pool.release(t),ct.clear(),dt.added.length=0,dt.removed.length=0}}var pt=s(83068);let _t=class extends i.Z{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.addHandles((0,a.YP)((()=>this.updating),(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){this.stop(),this.controller?.destroy(),this.processor?.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:e,config:t,tileInfo:s,tiles:r}){if(this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach((e=>e.close())),this.service.source.length=0),this.service=e,!this.tileStore||!(0,h.fS)(this.tileStore.tileScheme.spatialReference,s.spatialReference)){const e=new pt.Z(d.Z.fromJSON(s));r.added.length=r.removed.length=0,this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map((e=>e.id))}),this.tileStore?.destroy(),this.tileStore=new ft(e),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(t),await this.update({config:t}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(r),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore?.updateTiles(e)}async update({config:e}){const t=K.empty();return await Promise.all([this.processor.update(t,e),this.controller.update(t,e)]),t.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(K.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){return this._createController(this.service,e)}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,t){this.controller&&this.controller.destroy();const{tileStore:s,remoteClient:r}=this,i=new it({service:e,tileStore:s,remoteClient:r});return this.controller=i,i}async _createProcessor(e,t){const r=t.schema.processors[0].type,i=(await function(e){return"heatmap"===e?s.e(9904).then(s.bind(s,49904)):Promise.all([s.e(9790),s.e(8522),s.e(4982),s.e(5428)]).then(s.bind(s,80338))}(r)).default,{remoteClient:n,tileStore:a}=this,o=new i({service:e,config:t,tileStore:a,remoteClient:n});return this.processor&&this.processor.destroy(),this.processor=o,o}};(0,r._)([(0,o.Cb)()],_t.prototype,"controller",void 0),(0,r._)([(0,o.Cb)()],_t.prototype,"processor",void 0),(0,r._)([(0,o.Cb)()],_t.prototype,"updating",null),(0,r._)([(0,o.Cb)()],_t.prototype,"viewState",void 0),_t=(0,r._)([(0,u.j)("esri.views.2d.layers.features.Pipeline")],_t);const mt=_t},59999:(e,t,s)=>{s.d(t,{J:()=>o});var r=s(80442),i=s(22862),n=s(59266),a=s(92604);class o{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._storage=t,this._bitsets={computed:t.getBitset(t.createBitset())}}get storage(){return this._storage}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const s=(0,i.Hg)(this._schema,t);if(this._schema=t,!t||null==s||!(0,i.uD)(s,"attributes"))return;(0,r.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Store:",s),this._bitsets.computed.clear(),e.targets[t.name]=!0;const n=t.attributes,a=[],o=[];for(const e in n){const t=n[e];switch(t.type){case"field":break;case"expression":a.push(this._createArcadeComputedField(t));break;case"label-expression":a.push(this._createLabelArcadeComputedField(t));break;case"statistic":o.push(t)}}this._computedFields=await Promise.all(a),this._canCacheExpressionValue=!this._computedFields.some((e=>"expression"===e.type&&null!=e.expression&&e.expression.referencesScale())),this._statisticFields=o}setComputedAttributes(e,t,s,r){const i=this._bitsets.computed;if(!this._canCacheExpressionValue||!i.has(s)){i.set(s);for(const i of this._computedFields){const n=this._evaluateField(t,i,r);switch(i.resultType){case"numeric":e.setComputedNumericAtIndex(s,i.fieldIndex,n);break;case"string":e.setComputedStringAtIndex(s,i.fieldIndex,n)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex;return{...e,expression:await(0,n.Yi)(e.valueExpression,t,s)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex,{createLabelFunction:i}=await s.e(4695).then(s.bind(s,14695)),n=await i(e.label,r,t);return{...e,builder:n}}_evaluateField(e,t,s){switch(t.type){case"label-expression":{const s=e.readArcadeFeature();return t.builder.evaluate(s)||""}case"expression":{const{expression:r}=t;return function(e,t,s){if(null==e)return null;const r=t.readArcadeFeature();try{return e.evaluate({...s,$feature:r},e.services)}catch(e){return a.Z.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",e),null}}(r,e,{$view:{scale:s}})}}}}},87554:(e,t,s)=>{s.d(t,{s:()=>v}),s(66577);var r=s(48853),i=s(85839),n=s(80442),a=s(70586),o=s(29730),l=s(98732),u=s(5428),h=s(93054),d=s(33955);let c=0;const g=(0,n.Z)("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],f=g[0],p=g[1],_=g[2],m=g[3],y=(0,n.Z)("featurelayer-simplify-payload-size-factors")??[1,2,4],I=y[0],b=y[1],S=y[2],T=(0,n.Z)("featurelayer-simplify-mobile-factor")??2,x=(0,n.Z)("esri-mobile");class v{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._datetimeMetadata=null,this.contextTimeReference=null,this.instance=e,this._layerSchema=t}static createInstance(){return c++,c=c>65535?0:c,c}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let s=1;const r=x?T:1;t>4e6?s=S*r:t>1e6?s=b*r:t>5e5?s=I*r:t>1e5&&(s=r);let i=0;e>4e3?i=m*s:e>2e3?i=_*s:e>100?i=p:e>15&&(i=f);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}createQuantizedExtrudedQuad(e,t){return new u.Z([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}parseTimestampOffset(e){return e}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,s,r){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=s,i._sy*=r,i}readAttribute(e,t=!1){const s=this._readAttribute(e,t);if(void 0!==s)return s;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const s=t._readAttributes();for(const t of Object.keys(s))e[t]=s[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readHydratedGeometry(),t=(0,l.di)(e,this.geometryType,this.hasZ,this.hasM),s=(0,d.im)(t);return s&&(s.spatialReference=this._arcadeSpatialReference),s}get dateTimeReferenceFieldIndex(){return this._datetimeMetadata||(this._datetimeMetadata=i.nu.create(this._layerSchema.fields,this._layerSchema)),this._datetimeMetadata}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?r.iG.unknownDateJSToArcadeDate(t):r.iG.dateJSAndZoneToArcadeDate(t,this.contextTimeReference?.timeZone??"system"):t}isUnknownDateTimeField(e){return"unknown"===this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)}fieldSourceTimeZone(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)??""}get layerPreferredTimeZone(){return this.dateTimeReferenceFieldIndex?.layerPreferredTimeZone??""}field(e){if(this.hasField(e))return this.autocastArcadeDate(e,this.readAttribute(e,!0));for(const t of this._joined)if(t.setIndex(this.getIndex()),t.hasField(e)){const s=t._readAttribute(e,!0);return this.autocastArcadeDate(e,s)}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.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const t=this.readLegacyFeature();if(!t)return JSON.stringify(null);const s={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const e in s.attributes){const t=s.attributes[e];t instanceof Date&&(s.attributes[e]=t.getTime())}return JSON.stringify(s)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,t=this.getCursor();for(;t.next();){const s=t.getObjectId();(0,a.O3)(s),e.set(s,t.getIndex())}this._objectIdToIndex=e}const t=this._objectIdToIndex;for(const s of e)t.has(s)&&this.removeAtIndex(t.get(s))}removeAtIndex(e){null==this._deleted&&(this._deleted=h.p.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 null==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=this.getQuantizationTransform()??null;return(0,o.Y)(new u.Z,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}}},61800:(e,t,s)=>{s.d(t,{t:()=>i});var r=s(87554);class i extends r.s{static from(e,t){return new i(e.copy(),t)}constructor(e,t){super(r.s.createInstance(),e.fullSchema()),this._currentIndex=-1,this._reader=e,this._indices=t}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new i(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this._reader.setComputedNumericAtIndex(t,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,t){return this._reader.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,t){this._reader.setComputedNumericAtIndex(e,t)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,t){return this._reader.setComputedStringAtIndex(e,t)}transform(e,t,s,r){const i=this.copy();return i._reader=this._reader.transform(e,t,s,r),i}readAttribute(e,t=!1){return this._reader.readAttribute(e,t)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,t){return this._reader.setField(e,t)}keys(){return this._reader.keys()}castToText(e=!1){return this._reader.castToText(e)}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,t){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}},93054:(e,t,s)=>{s.d(t,{p:()=>r});class r{static fromBuffer(e,t){return new r(e,t)}static create(e,t=4294967295){const s=new Uint32Array(Math.ceil(e/32));return new r(s,t)}constructor(e,t){this._mask=0,this._buf=e,this._mask=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 s=e,r=t;for(;s%32&&s!==r;){if(this.has(s))return!0;s++}for(;r%32&&s!==r;){if(this.has(s))return!0;r--}if(s===r)return!1;for(let e=s/32;e!==r/32;e++)if(this._buf[e])return!0;return!1}set(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]|=r}setRange(e,t){let s=e,r=t;for(;s%32&&s!==r;)this.set(s++);for(;r%32&&s!==r;)this.set(r--);if(s!==r)for(let e=s/32;e!==r/32;e++)this._buf[e]=4294967295}unset(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]&=4294967295^r}resize(e){const t=this._buf,s=new Uint32Array(Math.ceil(e/32));s.set(t),this._buf=s}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 r(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 s=this._buf[t],r=32*t;if(s)for(;s;)1&s&&e(r),s>>>=1,r++}}countSet(){let e=0;return this.forEachSet((t=>{e++})),e}}},67524:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,t){const{spans:s,lodInfo:r}=this,{level:i}=r;if(0!==s.length)for(const{row:n,colFrom:a,colTo:o}of s)for(let s=a;s<=o;s++)e.call(t,i,n,r.normalizeCol(s),r.getWorldForColumn(s))}}i.pool=new r.Z(i)},83068:(e,t,s)=>{s.d(t,{Z:()=>f});var r=s(8744),i=s(55415);function n(e,t){return[e,t]}function a(e,t,s){return e[0]=t,e[1]=s,e}const o=new i.Z("0/0/0/0");class l{static create(e,t,s=null){const i=(0,r.C5)(e.spatialReference),o=t.origin||n(e.origin.x,e.origin.y),u=n(e.size[0]*t.resolution,e.size[1]*t.resolution),h=n(-1/0,-1/0),d=n(1/0,1/0),c=n(1/0,1/0);null!=s&&(a(h,Math.max(0,Math.floor((s.xmin-o[0])/u[0])),Math.max(0,Math.floor((o[1]-s.ymax)/u[1]))),a(d,Math.max(0,Math.floor((s.xmax-o[0])/u[0])),Math.max(0,Math.floor((o[1]-s.ymin)/u[1]))),a(c,d[0]-h[0]+1,d[1]-h[1]+1));const{cols:g,rows:f}=t;let p,_,m,y;return!s&&g&&f&&(a(h,g[0],f[0]),a(d,g[1],f[1]),a(c,g[1]-g[0]+1,f[1]-f[0]+1)),e.isWrappable?(p=n(Math.ceil(Math.round((i.valid[1]-i.valid[0])/t.resolution)/e.size[0]),c[1]),_=n(Math.floor((i.origin[0]-o[0])/u[0]),h[1]),m=n(p[0]+_[0]-1,d[1]),y=!0):(_=h,m=d,p=c,y=!1),new l(t.level,t.resolution,t.scale,o,h,d,c,u,_,m,p,y)}constructor(e,t,s,r,i,n,a,o,l,u,h,d){this.level=e,this.resolution=t,this.scale=s,this.origin=r,this.first=i,this.last=n,this.size=a,this.norm=o,this.worldStart=l,this.worldEnd=u,this.worldSize=h,this.wrap=d}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,s=!1){o.set(t);const r=s?o.col:this.denormalizeCol(o.col,o.world),i=o.row;return function(e,t,s,r,i){e[0]=t,e[1]=s,e[2]=r,e[3]=i}(e,this.getXForColumn(r),this.getYForRow(i+1),this.getXForColumn(r+1),this.getYForRow(i)),e}getTileCoords(e,t,s=!1){o.set(t);const r=s?o.col:this.denormalizeCol(o.col,o.world);return Array.isArray(e)?a(e,this.getXForColumn(r),this.getYForRow(o.row)):(e.x=this.getXForColumn(r),e.y=this.getYForRow(o.row)),e}}var u=s(67524);class h{constructor(e,t,s){this.row=e,this.colFrom=t,this.colTo=s}}const d=new i.Z("0/0/0/0");class c{static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[s,r]=e,[i,n]=t,a=i-s,o=n-r,l=0!==o?a/o:0,u=(Math.ceil(r)-r)*l,h=(Math.floor(r)-r)*l;return new c(s,Math.floor(r),Math.ceil(n),l,a<0?u:h,a<0?h:u,a<0?i:s,a<0?s:i)}constructor(e,t,s,r,i,n,a,o){this.x=e,this.ymin=t,this.ymax=s,this.invM=r,this.leftAdjust=i,this.rightAdjust=n,this.leftBound=a,this.rightBound=o}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const g=[[0,0],[0,0],[0,0],[0,0]];class f{constructor(e,t=null,s=e.lods[0].level,r=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._infoByScale={},this._infoByLevel={};const i=e.lods.filter((e=>e.level>=s&&e.level<=r));this.minScale=i[0].scale,this.maxScale=i[i.length-1].scale;const n=this._lodInfos=i.map((s=>l.create(e,s,t)));i.forEach(((e,t)=>{this._infoByLevel[e.level]=n[t],this._infoByScale[e.scale]=n[t],this.scales[t]=e.scale}),this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileBounds(e,d,s):e}getTileCoords(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileCoords(e,d,s):e}getTileCoverage(e,t=192,s=!0,r="closest"){if(!s&&(e.scale>this.minScale||e.scale<this.maxScale))return null;const i="closest"===r?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),n=u.Z.pool.acquire(i),a=this._wrap;let o,l,d,f=1/0,p=-1/0;const _=n.spans;g[0][0]=g[0][1]=g[1][1]=g[3][0]=-t,g[1][0]=g[2][0]=e.size[0]+t,g[2][1]=g[3][1]=e.size[1]+t;for(const t of g)e.toMap(t,t),t[0]=i.getColumnForX(t[0]),t[1]=i.getRowForY(t[1]);const m=[];let y=3;for(let e=0;e<4;e++){if(g[e][1]===g[y][1]){y=e;continue}const t=c.create(g[e],g[y]);f=Math.min(t.ymin,f),p=Math.max(t.ymax,p),void 0===m[t.ymin]&&(m[t.ymin]=[]),m[t.ymin].push(t),y=e}if(null==f||null==p||p-f>100)return null;let I=[];for(o=f;o<p;){null!=m[o]&&(I=I.concat(m[o])),l=1/0,d=-1/0;for(let e=I.length-1;e>=0;e--){const t=I[e];l=Math.min(l,t.getLeftCol()),d=Math.max(d,t.getRightCol())}if(l=Math.floor(l),d=Math.floor(d),o>=i.first[1]&&o<=i.last[1])if(a)if(i.size[0]<i.worldSize[0]){const e=Math.floor(d/i.worldSize[0]);for(let t=Math.floor(l/i.worldSize[0]);t<=e;t++)_.push(new h(o,Math.max(i.getFirstColumnForWorld(t),l),Math.min(i.getLastColumnForWorld(t),d)))}else _.push(new h(o,l,d));else l>i.last[0]||d<i.first[0]||(l=Math.max(l,i.first[0]),d=Math.min(d,i.last[0]),_.push(new h(o,l,d)));o+=1;for(let e=I.length-1;e>=0;e--){const t=I[e];t.ymax>=o?t.incrRow():I.splice(e,1)}}return n}getTileParentId(e){d.set(e);const t=this._infoByLevel[d.level],s=this._lodInfos.indexOf(t)-1;return s<0?null:(this._getTileIdAtLOD(d,this._lodInfos[s],d),d.id)}getTileResolution(e){const t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){d.set(t);const s=this._infoByLevel[d.level],r=e.lodInfo;if(r.resolution>s.resolution){this._getTileIdAtLOD(d,r,d);const t=r.denormalizeCol(d.col,d.world);for(const s of e.spans)if(s.row===d.row&&s.colFrom<=t&&s.colTo>=t)return!0}if(r.resolution<s.resolution){const[t,i,n,a]=e.spans.reduce(((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e)),[1/0,-1/0,1/0,-1/0]),o=s.denormalizeCol(d.col,d.world),l=r.getColumnForX(s.getXForColumn(o)),u=r.getRowForY(s.getYForRow(d.row)),h=r.getColumnForX(s.getXForColumn(o+1))-1,c=r.getRowForY(s.getYForRow(d.row+1))-1;return!(l>a||h<n||u>i||c<t)}const i=r.denormalizeCol(d.col,d.world);return e.spans.some((e=>e.row===d.row&&e.colFrom<=i&&e.colTo>=i))}normalizeBounds(e,t,s){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const t=(0,r.C5)(this.tileInfo.spatialReference),i=-s*(t.valid[1]-t.valid[0]);e[0]+=i,e[2]+=i}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let s=1;s<t.length-1;s++)if(e>t[s]+1e-6)return this._infoByScale[t[s-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce(((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t),t[0])),this._infoByScale[e]}scaleToLevel(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let s=t.length-1;s>=0;s--)if(e<t[s])return s===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[s]].level+(t[s]-e)/(t[s]-t[s+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}_getTileIdAtLOD(e,t,s){const r=this._infoByLevel[s.level];return e.set(s),t.resolution<r.resolution?null:(t.resolution===r.resolution||(e.level=t.level,e.col=Math.floor(s.col*r.resolution/t.resolution+.01),e.row=Math.floor(s.row*r.resolution/t.resolution+.01)),e)}}},55415:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{static getId(e,t,s,r){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${s}/${r}`}constructor(e,t,s,r){this.set(e,t,s,r)}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,s=63&this.level;return(3&this.world)<<30|t<<22|e<<8|s}acquire(e,t,s,r){this.set(e,t,s,r)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new i(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,s,r){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,s,r,i]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(s),this.col=parseFloat(r),this.world=parseFloat(i)}else this.level=+e,this.row=+t,this.col=+s,this.world=+r||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new i(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,t=this.row<<1,s=this.col<<1,r=this.world;return[new i(e,t,s,r),new i(e,t,s+1,r),new i(e,t+1,s,r),new i(e,t+1,s+1,r)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}i.pool=new r.Z(i,null,null,25,50)},79384:(e,t,s)=>{s.d(t,{e:()=>c});var r=s(70586),i=s(95330),n=s(64830),a=s(58971),o=s(10661);class l{constructor(){this._map=new Map,this._observable=new o.s}get size(){return(0,a.it)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,a.it)(this._observable),this._map.entries()}forEach(e,t){(0,a.it)(this._observable),this._map.forEach(((s,r)=>e.call(t,s,r,this)),t)}get(e){return(0,a.it)(this._observable),this._map.get(e)}has(e){return(0,a.it)(this._observable),this._map.has(e)}keys(){return(0,a.it)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,a.it)(this._observable),this._map.values()}[Symbol.iterator](){return(0,a.it)(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}var u=s(1654),h=s(95528);class d{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class c{constructor(e){this._schedule=null,this._task=null,this._deferreds=new l,this._controllers=new l,this._processingItems=new l,this._pausedSignal=(0,h.t)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new n.Z(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&t&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=(0,r.hw)(this._schedule),this._task=(0,r.hw)(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,s)=>e(s)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const s=this.get(e);if(s)return s;const r=new AbortController;let n=null;t&&(n=(0,i.fu)(t,(()=>r.abort())));const a=()=>{o.remove(),null!=n&&n.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},o=(0,i.$F)(r.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),l.reject((0,i.zE)())})),l=(0,i.hh)();return this._deferreds.set(e,l),this._controllers.set(e,r),l.promise.then(a,a),this._queue.push(e),this._scheduleNext(),l.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach((t=>e.push(t))),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_scheduleNext(){this._task||this._pausedSignal.value||this._schedule||(this._schedule=(0,u.Os)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const s=new AbortController,r=new d(e,s);this._processingItems.set(e,r);try{t=this.process(e,s.signal)}catch(e){this._processError(r,e)}(0,i.y8)(t)?(r.promise=t,t.then((e=>this._processResult(r,e)),(e=>this._processError(r,e)))):this._processResult(r,t)}get test(){return{update:e=>this.runTask(e)}}}}}]);
|