@arcgis/core 4.34.0-next.34 → 4.34.0-next.35

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.
Files changed (178) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/ArcadeDate.js +1 -1
  3. package/arcade/ArcadeModuleResolver.js +1 -1
  4. package/arcade/featureset/actions/GroupBy.js +1 -1
  5. package/arcade/functions/date.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{28e04ef3575f164f611a.js → 00870a35b254295bc408.js} +1 -1
  8. package/assets/esri/core/workers/chunks/017adbbb77c9c9b4d49f.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b4b30a7f1b673461dc55.js → 0997e09fe5b0aba1f804.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{9bc6d974b0fce9db64ef.js → 15a5a89cd228a9364332.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{847455bf4fc33d6e6efc.js → 1dc410bc070cabb7198d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{94a3474e3f45efa4a4fe.js → 2c816d3a737e39e6eb84.js} +1 -1
  13. package/assets/esri/core/workers/chunks/2de11a8e5d426c381991.js +1 -0
  14. package/assets/esri/core/workers/chunks/3a7e43675163f7bed6ac.js +1 -0
  15. package/assets/esri/core/workers/chunks/40b0c5368b8322498189.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4778acd0cfaf0cebeec7.js → 439128f23fa091633d2d.js} +1 -1
  17. package/assets/esri/core/workers/chunks/6000a302369799ea42a6.js +1 -0
  18. package/assets/esri/core/workers/chunks/{5d0c92aaa5891e6cb8f0.js → 641ca71d7c1a07bde66a.js} +1 -1
  19. package/assets/esri/core/workers/chunks/646227b500b92999f2c8.js +1 -0
  20. package/assets/esri/core/workers/chunks/{98f6d4ea026ed96fd3f3.js → 773feb0e0fad26df57ef.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7b1d14a921d30c95d68b.js +1 -0
  22. package/assets/esri/core/workers/chunks/{b78d00c4e493086741e1.js → 7d25f57299c642e727a6.js} +1 -1
  23. package/assets/esri/core/workers/chunks/8b7f6f2d1692b6b6dbd5.js +1 -0
  24. package/assets/esri/core/workers/chunks/91d48c32bf11ad1405c8.js +1 -0
  25. package/assets/esri/core/workers/chunks/9228f760129e48585b54.js +1 -0
  26. package/assets/esri/core/workers/chunks/a36be186ad10200c420c.js +1 -0
  27. package/assets/esri/core/workers/chunks/aa12ba96fb8c91105473.js +1 -0
  28. package/assets/esri/core/workers/chunks/{ea240d9e594bfbd8af68.js → aaf696a1026de569c82d.js} +1 -1
  29. package/assets/esri/core/workers/chunks/b331543767c35e5edcc6.js +1 -0
  30. package/assets/esri/core/workers/chunks/{7d852617e91b51121ea7.js → ba29c535128c4e8ae2d3.js} +1 -1
  31. package/assets/esri/core/workers/chunks/bf60d4da0dff1e14da8e.js +1 -0
  32. package/assets/esri/core/workers/chunks/{39bff604d4b4a1295038.js → c038472cb7f60af9426e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{ca46f78aac1133d127fa.js → c1e5e2a6e7e2d7a1d63c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{a809042fdce7ced2a415.js → cc3ca1729af33688c1e3.js} +1 -1
  35. package/assets/esri/core/workers/chunks/cde79c3644166d4798a8.js +1 -0
  36. package/assets/esri/core/workers/chunks/{181f8bbe670b4468307a.js → ce8f0ed9179c0d314df8.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{ac30cf2f9a94597f7665.js → d6b2ab614f308db50c4a.js} +2 -2
  38. package/assets/esri/core/workers/chunks/{abe2cdfc2eda46b00812.js → d9045b964f536695840b.js} +1 -1
  39. package/assets/esri/core/workers/chunks/dde6000aa2f69f6ecad0.js +1 -0
  40. package/assets/esri/core/workers/chunks/dec9656997683ef01ba6.js +1 -0
  41. package/assets/esri/core/workers/chunks/e18bb372457cedbf4f8c.js +1 -0
  42. package/assets/esri/core/workers/chunks/e892ed8b0b990d7eba28.js +1 -0
  43. package/assets/esri/core/workers/chunks/{dc5a8cf2a44a5ac201c5.js → ed05399f9a07fea66685.js} +1 -1
  44. package/config.js +1 -1
  45. package/core/BidiEngine.js +1 -1
  46. package/core/Promise.js +1 -1
  47. package/core/promiseUtils.js +1 -1
  48. package/core/sql/SqlInterval.js +1 -1
  49. package/core/sql/sqlDateParsingUtils.js +1 -1
  50. package/core/unitUtils.js +1 -1
  51. package/geometry/support/coordinateSystem.js +1 -1
  52. package/graphic/BuildingGraphicOrigin.d.ts +4 -0
  53. package/graphic/BuildingGraphicOrigin.js +5 -0
  54. package/graphic/CSVGraphicOrigin.d.ts +4 -0
  55. package/graphic/CSVGraphicOrigin.js +5 -0
  56. package/graphic/CatalogGraphicOrigin.d.ts +4 -0
  57. package/graphic/CatalogGraphicOrigin.js +5 -0
  58. package/graphic/FeatureGraphicOrigin.d.ts +4 -0
  59. package/graphic/FeatureGraphicOrigin.js +5 -0
  60. package/graphic/GeoJSONGraphicOrigin.d.ts +4 -0
  61. package/graphic/GeoJSONGraphicOrigin.js +5 -0
  62. package/graphic/GraphicOrigin.d.ts +4 -0
  63. package/graphic/GraphicOrigin.js +5 -0
  64. package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +4 -0
  65. package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +5 -0
  66. package/graphic/IntegratedMeshGraphicOrigin.d.ts +4 -0
  67. package/graphic/IntegratedMeshGraphicOrigin.js +5 -0
  68. package/graphic/OGCFeatureGraphicOrigin.d.ts +4 -0
  69. package/graphic/OGCFeatureGraphicOrigin.js +5 -0
  70. package/graphic/PointCloudGraphicOrigin.d.ts +4 -0
  71. package/graphic/PointCloudGraphicOrigin.js +5 -0
  72. package/graphic/SceneGraphicOrigin.d.ts +4 -0
  73. package/graphic/SceneGraphicOrigin.js +5 -0
  74. package/graphic/StreamGraphicOrigin.d.ts +4 -0
  75. package/graphic/StreamGraphicOrigin.js +5 -0
  76. package/graphic/VectorTileGraphicOrigin.d.ts +4 -0
  77. package/graphic/VectorTileGraphicOrigin.js +5 -0
  78. package/graphic/VoxelGraphicOrigin.d.ts +4 -0
  79. package/graphic/VoxelGraphicOrigin.js +5 -0
  80. package/graphic/WFSGraphicOrigin.d.ts +4 -0
  81. package/graphic/WFSGraphicOrigin.js +5 -0
  82. package/graphic/graphicOriginUtils.js +5 -0
  83. package/graphic/graphicOrigins.d.ts +14 -0
  84. package/graphic/graphicOrigins.js +5 -0
  85. package/graphic/isBuildingGraphicOrigin.js +5 -0
  86. package/graphic/isCSVGraphicOrigin.js +5 -0
  87. package/graphic/isCatalogGraphicOrigin.js +5 -0
  88. package/graphic/isFeatureGraphicOrigin.js +5 -0
  89. package/graphic/isGeoJSONGraphicOrigin.js +5 -0
  90. package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +5 -0
  91. package/graphic/isIntegratedMeshGraphicOrigin.js +5 -0
  92. package/graphic/isOGCFeatureGraphicOrigin.js +5 -0
  93. package/graphic/isPointCloudGraphicOrigin.js +5 -0
  94. package/graphic/isSceneGraphicOrigin.js +5 -0
  95. package/graphic/isStreamGraphicOrigin.js +5 -0
  96. package/graphic/isVectorTileGraphicOrigin.js +5 -0
  97. package/graphic/isVoxelGraphicOrigin.js +5 -0
  98. package/graphic/isWFSGraphicOrigin.js +5 -0
  99. package/interfaces.d.ts +354 -13
  100. package/kernel.js +1 -1
  101. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  102. package/layers/support/Field.js +1 -1
  103. package/layers/support/featurePopupQueryUtils.js +1 -1
  104. package/layers/voxel/NCTimeParser.js +1 -1
  105. package/package.json +1 -1
  106. package/rest/knowledgeGraphService.js +1 -1
  107. package/smartMapping/statistics/support/utils.js +1 -1
  108. package/support/arcadeExpressionUtils.js +1 -1
  109. package/support/revision.js +1 -1
  110. package/symbols/support/svgUtils.js +1 -1
  111. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  112. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  113. package/views/2d/engine/webgl/Painter.js +1 -1
  114. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  116. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  117. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  118. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  119. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementComputation.js +5 -0
  120. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +1 -1
  121. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  122. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  123. package/views/3d/layers/CSVLayerView3D.js +1 -1
  124. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  125. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  126. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  127. package/views/3d/layers/FlowSubView3D.js +1 -1
  128. package/views/3d/layers/GeoJSONLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  130. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  131. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  132. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  133. package/views/3d/layers/SceneLayerView3D.js +1 -1
  134. package/views/3d/layers/StreamLayerView3D.js +1 -1
  135. package/views/3d/layers/WFSLayerView3D.js +1 -1
  136. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  137. package/views/3d/layers/graphics/StreamController.js +1 -1
  138. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  139. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  140. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  141. package/views/3d/layers/support/FeatureTileDescriptor.js +1 -1
  142. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  143. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  144. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  145. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  146. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  147. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  148. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  149. package/views/3d/state/ConstraintsManager.js +1 -1
  150. package/views/3d/support/flow/geometryUtils.js +1 -1
  151. package/views/3d/terrain/OverlayManager.js +1 -1
  152. package/views/3d/terrain/TerrainSurface.js +1 -1
  153. package/views/3d/terrain/Tile.js +1 -1
  154. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  155. package/views/SceneView.js +1 -1
  156. package/views/interactive/Tooltip.js +1 -1
  157. package/views/layers/FeatureLayerView.js +1 -1
  158. package/views/layers/support/popupUtils.js +1 -1
  159. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  160. package/assets/esri/core/workers/chunks/07b2cc0f6b064277632f.js +0 -1
  161. package/assets/esri/core/workers/chunks/13f9e92e7e5d44d9f95c.js +0 -1
  162. package/assets/esri/core/workers/chunks/140efe4735605258ecc9.js +0 -1
  163. package/assets/esri/core/workers/chunks/2b76e716f478468b6798.js +0 -1
  164. package/assets/esri/core/workers/chunks/386ab72a45102c2d47f2.js +0 -1
  165. package/assets/esri/core/workers/chunks/3fb6146d914f9b410c2e.js +0 -1
  166. package/assets/esri/core/workers/chunks/432365fcd7becd508541.js +0 -1
  167. package/assets/esri/core/workers/chunks/439ce953a25b2776cb7f.js +0 -1
  168. package/assets/esri/core/workers/chunks/4c8d2334fcdb1354ff43.js +0 -1
  169. package/assets/esri/core/workers/chunks/5f321be63ed5447b04a1.js +0 -1
  170. package/assets/esri/core/workers/chunks/6006fbdb90c3bfc493a6.js +0 -1
  171. package/assets/esri/core/workers/chunks/700c641347853b1034d9.js +0 -1
  172. package/assets/esri/core/workers/chunks/7c35c61e3673cf94cdfd.js +0 -1
  173. package/assets/esri/core/workers/chunks/7c75876a0c6460585055.js +0 -1
  174. package/assets/esri/core/workers/chunks/949dc266ac6f3505d357.js +0 -1
  175. package/assets/esri/core/workers/chunks/a84af1b8b64b86b49bd3.js +0 -1
  176. package/assets/esri/core/workers/chunks/a9d83a442d8d7a376fc0.js +0 -1
  177. package/assets/esri/core/workers/chunks/ba1b21a90b257ac9a342.js +0 -1
  178. package/assets/esri/core/workers/chunks/f9ad37dfbe1d14c6a352.js +0 -1
@@ -326,7 +326,7 @@ if (renderTransparentlyOccludedHUD > 0.5) {
326
326
  return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0;
327
327
  }
328
328
  return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0;
329
- }`)}},52106:(e,t,r)=>{r.d(t,{A:()=>b});var n,i=r(31635),o=r(13874),s=r(69540),a=r(51447),l=r(25482),c=r(53966),d=r(36708),u=r(24326),h=r(10107),f=(r(44208),r(87811),r(40608)),m=r(12195),p=r(65864),g=r(50498),y=r(54339),_=r(33910);function v(e){if(null==e)return null;const t={};for(const r in e){const n=e[r];n&&(t[r]=n.toJSON())}return 0!==Object.keys(t).length?t:null}let b=class extends(s.A.ClonableMixin(l.A)){static{n=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,u.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(c.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new n({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const r of[t,this.sourceLayer,this.layer])if(r){if("popupTemplate"in r&&r.popupTemplate)return r.popupTemplate;if(e&&"defaultPopupTemplate"in r&&null!=r.defaultPopupTemplate)return r.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=this.sourceLayer??this.layer;return e?(0,y.r)(this,e):null}getGlobalId(){const e=this.sourceLayer??this.layer;return e&&"globalIdField"in e&&e.globalIdField?this.getAttribute(e.globalIdField):null}toJSON(){return{aggregateGeometries:v(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,m.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,n){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const i={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(i.action=n),"attributes"===e&&(i.attributeName=n),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.addHandles([(0,d.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,d.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,i.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const n=(0,p.rS)(e[r]);n&&(t[r]=n)}return 0!==Object.keys(t).length?t:null}}})],b.prototype,"aggregateGeometries",null),(0,i.Cg)([(0,h.MZ)({value:null})],b.prototype,"attributes",null),(0,i.Cg)([(0,h.MZ)({value:null,types:g.yR,json:{read:p.rS}})],b.prototype,"geometry",null),(0,i.Cg)([(0,h.MZ)({type:Boolean})],b.prototype,"isAggregate",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],b.prototype,"layer",void 0),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],b.prototype,"origin",void 0),(0,i.Cg)([(0,h.MZ)({type:o.A,value:null})],b.prototype,"popupTemplate",null),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],b.prototype,"sourceLayer",void 0),(0,i.Cg)([(0,h.MZ)({value:null,types:_.Es})],b.prototype,"symbol",null),(0,i.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],b.prototype,"_version",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,value:!0})],b.prototype,"visible",null),b=n=(0,i.Cg)([(0,f.$)("esri.Graphic")],b)},60999:(e,t,r)=>{r.d(t,{DZ:()=>m,Ke:()=>f,Tj:()=>d,UT:()=>p,jJ:()=>c});var n=r(31635),i=r(69622),o=r(97768),s=r(74887),a=r(10107),l=r(40608);function c(e,t,r){return(0,s.Lx)(e.map((e,n)=>t.apply(r,[e,n])))}async function d(e,t,r){return(await(0,s.Lx)(e.map((e,n)=>t.apply(r,[e,n])))).map(e=>e.value)}function u(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return u(await e)}catch(e){return h(e)}}async function m(e){try{return u(await e)}catch(e){return(0,s.QP)(e),h(e)}}function p(e,t){return new g(e,t)}let g=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,o.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(e=>{this._result=u(e),this._cleanup()},e=>{this._result=h(e),this._cleanup()}),this._abortHandle=(0,s.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,o.xt)(this._abortHandle),this._abortController=null}};(0,n.Cg)([(0,a.MZ)()],g.prototype,"value",null),(0,n.Cg)([(0,a.MZ)()],g.prototype,"error",null),(0,n.Cg)([(0,a.MZ)()],g.prototype,"finished",null),(0,n.Cg)([(0,a.MZ)()],g.prototype,"promise",void 0),(0,n.Cg)([(0,a.MZ)()],g.prototype,"_result",void 0),g=(0,n.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],g)},63578:(e,t,r)=>{r.d(t,{I:()=>s});var n=r(47522),i=r(96598),o=r(31821);function s(e,t){const{vertex:r,fragment:s}=e;e.include(i.Z,t),r.include(n.K),r.main.add(o.H`vec4 posProjCenter;
329
+ }`)}},52106:(e,t,r)=>{r.d(t,{A:()=>b});var n,i=r(31635),o=r(13874),s=r(69540),a=r(51447),l=r(25482),c=r(53966),d=r(36708),u=r(24326),h=r(10107),f=(r(44208),r(87811),r(40608)),m=r(12195),p=r(65864),g=r(50498),y=r(54339),_=r(33910);function v(e){if(null==e)return null;const t={};for(const r in e){const n=e[r];n&&(t[r]=n.toJSON())}return 0!==Object.keys(t).length?t:null}let b=class extends(s.A.ClonableMixin(l.A)){static{n=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,u.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(c.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new n({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const r of[t,this.sourceLayer,this.layer])if(r&&"object"==typeof r){if("popupTemplate"in r&&r.popupTemplate)return r.popupTemplate;if(e&&"defaultPopupTemplate"in r&&null!=r.defaultPopupTemplate)return r.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=this.sourceLayer??this.layer;return e?(0,y.r)(this,e):null}getGlobalId(){const e=this.sourceLayer??this.layer;return e&&"globalIdField"in e&&e.globalIdField?this.getAttribute(e.globalIdField):null}toJSON(){return{aggregateGeometries:v(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,m.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,n){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const i={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(i.action=n),"attributes"===e&&(i.attributeName=n),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.addHandles([(0,d.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,d.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,i.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const n=(0,p.rS)(e[r]);n&&(t[r]=n)}return 0!==Object.keys(t).length?t:null}}})],b.prototype,"aggregateGeometries",null),(0,i.Cg)([(0,h.MZ)({value:null})],b.prototype,"attributes",null),(0,i.Cg)([(0,h.MZ)({value:null,types:g.yR,json:{read:p.rS}})],b.prototype,"geometry",null),(0,i.Cg)([(0,h.MZ)({type:Boolean})],b.prototype,"isAggregate",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],b.prototype,"layer",void 0),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],b.prototype,"origin",void 0),(0,i.Cg)([(0,h.MZ)({type:o.A,value:null})],b.prototype,"popupTemplate",null),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],b.prototype,"sourceLayer",void 0),(0,i.Cg)([(0,h.MZ)({value:null,types:_.Es})],b.prototype,"symbol",null),(0,i.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],b.prototype,"_version",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,value:!0})],b.prototype,"visible",null),b=n=(0,i.Cg)([(0,f.$)("esri.Graphic")],b)},60999:(e,t,r)=>{r.d(t,{DZ:()=>m,Ke:()=>f,Tj:()=>d,UT:()=>p,jJ:()=>c});var n=r(31635),i=r(69622),o=r(97768),s=r(74887),a=r(10107),l=r(40608);function c(e,t,r){return(0,s.Lx)(e.map((e,n)=>t.apply(r,[e,n])))}async function d(e,t,r){return(await(0,s.Lx)(e.map((e,n)=>t.apply(r,[e,n])))).map(e=>e.value)}function u(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return u(await e)}catch(e){return h(e)}}async function m(e){try{return u(await e)}catch(e){return(0,s.QP)(e),h(e)}}function p(e,t){return new g(e,t)}let g=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,o.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(e=>{this._result=u(e),this._cleanup()},e=>{this._result=h(e),this._cleanup()}),this._abortHandle=(0,s.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,o.xt)(this._abortHandle),this._abortController=null}};(0,n.Cg)([(0,a.MZ)()],g.prototype,"value",null),(0,n.Cg)([(0,a.MZ)()],g.prototype,"error",null),(0,n.Cg)([(0,a.MZ)()],g.prototype,"finished",null),(0,n.Cg)([(0,a.MZ)()],g.prototype,"promise",void 0),(0,n.Cg)([(0,a.MZ)()],g.prototype,"_result",void 0),g=(0,n.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],g)},63578:(e,t,r)=>{r.d(t,{I:()=>s});var n=r(47522),i=r(96598),o=r(31821);function s(e,t){const{vertex:r,fragment:s}=e;e.include(i.Z,t),r.include(n.K),r.main.add(o.H`vec4 posProjCenter;
330
330
  if (dot(position, position) > 0.0) {
331
331
  ProjectHUDAux projectAux;
332
332
  vec4 posProj = projectPositionHUD(projectAux);
@@ -343,4 +343,4 @@ gl_Position = posProjCenter;
343
343
  gl_PointSize = 1.0;`),s.main.add(o.H`fragColor = vec4(1);
344
344
  if(discardByTerrainDepth()) {
345
345
  fragColor.g = 0.5;
346
- }`)}},65215:(e,t,r)=>{r.d(t,{H:()=>n,R:()=>i});class n{constructor(e){this.layerViewUid=e}}class i extends n{constructor(e,t){super(e),this.graphicUid=t}}},65494:(e,t,r)=>{r.d(t,{L:()=>l,r:()=>s});var n=r(67076),i=r(90360),o=r(41214);function s(e,t){return l(e,null,t)}const a=(0,i.C)({types:o.Hg});function l(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new n.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):a(e,t,r):null}},72385:(e,t,r)=>{function n(){return new Float32Array(3)}function i(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function o(e,t,r){const n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}function s(){return n()}function a(){return o(1,1,1)}function l(){return o(1,0,0)}function c(){return o(0,1,0)}function d(){return o(0,0,1)}r.d(t,{fA:()=>o,o8:()=>i,vt:()=>n});const u=s(),h=a(),f=l(),m=c(),p=d();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:m,UNIT_Z:p,ZEROS:u,clone:i,create:n,fromValues:o,ones:a,unitX:l,unitY:c,unitZ:d,zeros:s},Symbol.toStringTag,{value:"Module"}))},75503:(e,t,r)=>{r.d(t,{EC:()=>S,wq:()=>a});var n=r(4576),i=r(21818),o=(r(44208),r(15142)),s=r(11006);class a{constructor(e=9,t){this._compareMinX=h,this._compareMinY=f,this._toBBox=e=>e,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()}destroy(){this.clear(),x.prune(),C.prune(),w.prune(),A.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(v(e,r))for(x.clear();r;){for(let i=0,o=r.children.length;i<o;i++){const o=r.children[i],s=r.leaf?n(o):o;v(e,s)&&(r.leaf?t(o):_(e,s)?l(o,t):x.push(o))}r=x.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!v(e,t))return!1;for(x.clear();t;){for(let n=0,i=t.children.length;n<i;n++){const i=t.children[n],o=t.leaf?r(i):i;if(v(e,o)){if(t.leaf||_(e,o))return!0;x.push(i)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new P([]),this}remove(e){if(!e)return this;let t,r=this._data,o=null,s=0,a=!1;const l=this._toBBox(e);for(w.clear(),A.clear();r||w.length>0;){if(r||(r=w.pop(),o=w.data[w.length-1],s=A.pop()??0,a=!0),r.leaf&&(t=(0,n.qh)(r.children,(0,i.zI)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),w.push(r),this._condense(w),this;a||r.leaf||!_(r,l)?o?(s++,r=o.children[s],a=!1):r=null:(w.push(r),A.push(s),s=0,o=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,n){const i=r-t+1;let o=this._maxEntries;if(i<=o){const n=new P(e.slice(t,r+1));return c(n,this._toBBox),n}n||(n=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/o**(n-1)));const s=new O([]);s.height=n;const a=Math.ceil(i/o),l=a*Math.ceil(Math.sqrt(o));b(e,t,r,l,this._compareMinX);for(let i=t;i<=r;i+=l){const t=Math.min(i+l-1,r);b(e,i,t,a,this._compareMinY);for(let r=i;r<=t;r+=a){const i=Math.min(r+a-1,t);s.children.push(this._build(e,r,i,n-1))}}return c(s,this._toBBox),s}_insert(e,t,r){const n=this._toBBox,i=r?e:n(e);w.clear();const o=function(e,t,r,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==r;){let r,n=1/0,i=1/0;for(let o=0,s=t.children.length;o<s;o++){const s=t.children[o],a=m(s),l=g(e,s)-a;l<i?(i=l,n=a<n?a:n,r=s):l===i&&a<n&&(n=a,r=s)}t=r||t.children[0]}return t}(i,this._data,t,w);for(o.children.push(e),u(o,i);t>=0&&w.data[t].children.length>this._maxEntries;)this._split(w,t),t--;!function(e,t,r){for(let n=r;n>=0;n--)u(t.data[n],e)}(i,w,t)}_split(e,t){const r=e.data[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const o=this._chooseSplitIndex(r,i,n);if(!o)return;const s=r.children.splice(o,r.children.length-o),a=r.leaf?new P(s):new O(s);a.height=r.height,c(r,this._toBBox),c(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,t){this._data=new O([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,i,o;n=i=1/0;for(let s=t;s<=r-t;s++){const t=d(e,0,s,this._toBBox),a=d(e,s,r,this._toBBox),l=y(t,a),c=m(t)+m(a);l<n?(n=l,o=s,i=c<i?c:i):l===n&&c<i&&(i=c,o=s)}return o}_chooseSplitAxis(e,t,r){const n=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,n)<this._allDistMargin(e,t,r,i)&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);const i=this._toBBox,o=d(e,0,t,i),s=d(e,r-t,r,i);let a=p(o)+p(s);for(let n=t;n<r-t;n++){const t=e.children[n];u(o,e.leaf?i(t):t),a+=p(o)}for(let n=r-t-1;n>=t;n--){const t=e.children[n];u(s,e.leaf?i(t):t),a+=p(s)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const i=e.data[t-1],o=i.children;o.splice((0,n.qh)(o,r,o.length,i.indexHint),1)}else this.clear();else c(r,this._toBBox)}}_initFormat(e){const 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]+"};")}}function l(e,t){let r=e;for(C.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,i.zI)(e));else C.pushArray(r.children);r=C.pop()??null}}function c(e,t){d(e,0,e.children.length,t,e)}function d(e,t,r,n,i){i||(i=new P([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o,s=t;s<r;s++)o=e.children[s],u(i,e.leaf?n(o):o);return i}function u(e,t){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)}function h(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(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 y(e,t){const r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function b(e,t,r,n,i){const o=[t,r];for(;o.length;){const t=o.pop(),r=o.pop();if(t-r<=n)continue;const a=r+Math.ceil((t-r)/n/2)*n;(0,s.q)(e,a,r,t,i),o.push(r,a,a,t)}}const x=new o.A,C=new o.A,w=new o.A,A=new o.A({deallocator:void 0});class S{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class I extends S{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class P extends I{constructor(e){super(),this.children=e,this.leaf=!0}}class O extends I{constructor(e){super(),this.children=e,this.leaf=!1}}},77121:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Jr});var n=r(31635),i=r(65529),o=r(74887),s=r(36708),a=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),d=r(5443),u=r(98988),h=r(16930),f=r(95422),m=r(61956),p=r(65494);class g{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new g(e,e.createRenderCommandBuffer(),t)}}var y=r(68197),_=r(18574),v=r(87403),b=r(28975);function x(){return new _.A({material:new b.N({color:new y.A("red")})})}var C=r(9093),w=r(51850),A=r(91829),S=r(6847),I=r(83047),P=r(58083),O=r(87317),M=r(70328),R=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var T=r(37585),F=r(48163),D=r(34727),z=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const j=[];{const e=16;for(let t=0;t<360;t+=360/e)j.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}Object.freeze({left:0,center:.5,right:1});const B=Object.freeze({"bottom-left":(0,F.fA)(0,0),bottom:(0,F.fA)(.5,0),"bottom-right":(0,F.fA)(1,0),left:(0,F.fA)(0,.5),center:(0,F.fA)(.5,.5),right:(0,F.fA)(1,.5),"top-left":(0,F.fA)(0,1),top:(0,F.fA)(.5,1),"top-right":(0,F.fA)(1,1)});var E=r(9762),L=r(27993);function U(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function V(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function H(e,t){const r=t.viewSpatialReference,n=t.renderSpatialReference,{extent:i}=e,o=(0,R.gX)(i),s=(0,w.vt)();return(0,L.F)([o[0],o[1],0],r,s,n),s}var G=r(97146);function k(e){const t=new Map;for(const[r,n]of e)t.set(r,{...n,indices:(0,G.Dg)(n.indices)});return t}var q=r(40804);r(48833);const $=(0,A.CN)(.25,.25,.75,.75);function N(e){return"cross"===e||"x"===e}function Y(e,t=128,r=.5*t,n=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return J(e,Z(r,r,t/2))}(t,r);case"square":return function(e,t){return X(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return W(e,t,!1,r)}(t,r,n);case"x":return function(e,t,r=0){return W(e,t,!0,r)}(t,r,n);case"kite":return function(e,t){return X(e,t,!0)}(t,r);case"triangle":return function(e,t){return J(e,Q(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,n=t/2,i=e/2,o=.8*r,s=Z(i,(e-t)/2-o,Math.sqrt(o*o+n*n)),a=Q(i,r,n);return J(e,(e,t)=>Math.max(a(e,t),-s(e,t)))}(t,r)}}function X(e,t,r){return r&&(t/=Math.SQRT2),J(e,(n,i)=>{let o=n-.5*e+.25,s=.5*e-i-.75;if(r){const e=(o+s)/Math.SQRT2;s=(s-o)/Math.SQRT2,o=e}return Math.max(Math.abs(o),Math.abs(s))-.5*t})}function W(e,t,r,n=0){t-=n,r&&(t*=Math.SQRT2);const i=.5*t;return J(e,(t,o)=>{let s,a=t-.5*e,l=.5*e-o-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),s=a>l?a>i?Math.sqrt((a-i)*(a-i)+l*l):l:l>i?Math.sqrt(a*a+(l-i)*(l-i)):a,s-=n/2,s})}function Z(e,t,r){return(n,i)=>{const o=n-e,s=i-t;return Math.sqrt(o*o+s*s)-r}}function Q(e,t,r){const n=Math.sqrt(t*t+r*r);return(i,o)=>{const s=Math.abs(i-e)-r,a=o-e+t/2+.75,l=(t*s+r*a)/n,c=-a;return Math.max(l,c)}}function J(e,t){const r=new Uint8Array(4*e*e);for(let n=0;n<e;n++)for(let i=0;i<e;i++){const o=i+e*n;let s=t(i,n);s=s/e+.5,(0,q.U)(s,r,4*o)}return r}var K=r(46610);class ee{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.createTexture(()=>function(e,t=128,r=.5*t,n=0){return{data:Y(e,t,r,n),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle"));this._iconTextureID=t;const r={anchorPosition:B.center,occlusionTest:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:$,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:N("circle")};this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r;if(null==t)throw new Error("expected material not to be null");const i=await this._createGeometry(e);if(null==i)return r.createPipelineCommand();const o=H(e,r);return r.createPipelineCommand(n.addDirectRendererGeometry(e.id,i,o))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:n}=r,{featureCount:i}=e;if(0===i||null==t)return null;const o=U(e),s=V(e),a=function(e,t){const r=e.length/3,n=t.viewSpatialReference,i=t.renderSpatialReference,o=new Float64Array(3*r);if(!(0,E.projectBuffer)(e,n,0,o,i,0,r))throw new Error("Failed to project coordinates");return o}(await n.applyElevationAlignmentTo(s),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),d=new Float64Array([24,24]),u=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),m=new Uint32Array(i);for(let e=0;e<i;++e)m[e]=e;const p=new Uint32Array(i);for(let e=0;e<i;++e)p[e]=0;const g=[["position",new K.n(a,m,3,!0)],["normal",new K.n(l,p,3,!0)],["uv0",new K.n(h,p,2,!0)],["color",new K.n(c,p,4,!0)],["rotation",new K.n(f,p,1,!0)],["size",new K.n(d,p,2,!0)],["centerOffsetAndDistance",new K.n(u,p,4,!0)]],y=new Uint8Array(i);return e.getVisibilityArray(y),{attributes:k(g),objectAndLayerIdColor:void 0,transformation:(0,C.vt)(),materialId:t,objectIds:o,visibilities:y}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(n.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r,{featureCount:i,id:o}=e;if(null==t||0===i)return r.createPipelineCommand();const s=await this._createGeometry(e);if(null==s)return r.createPipelineCommand();const a=H(e,r);return r.createPipelineCommand(n.updateDirectRendererGeometry(o,s,a))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let n;return n=null!=e?await r.releaseTexture(e):g.create(r),n.appendPipelineStateCommand(()=>this._destroy()),n}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=y.A.toUnitRGB(r),n=r.a*e;return[t[0],t[1],t[2],n]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return re;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=te){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=te){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const n=(0,A.o8)(A.Un);return null!=e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],e.length>3&&(n[3]=e[3])),null!=t&&(n[3]=t),r&&(0,O.d)(n,n,r),n}(null!=e?y.A.toUnitRGB(e):w.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??S.r;var e}}const te={hasIntrinsicColor:!1},re=A.uY;class ne{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,n=[];for(const i of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(i);null!=t&&(n.push(t.load()),r.push(t))}await Promise.all(n),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const n=e.joinPipelineCommands(await Promise.all(r));return n.appendPipelineStateCommand(()=>this._destroy()),n}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(n))}}class ie{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createAddCommand(e);return n.appendPipelineStateCommand(()=>this._featureData.set(e.id,e)),n}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return n.appendPipelineStateCommand(()=>this._featureData.delete(e)),n}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const n=[];for(const t of e.values())n.push(r.createUpdateElevationCommand(t));const i=await Promise.all(n);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const n=[];for(const e of r.keys())n.push(this.createRemoveCommand(e));n.push(e.createDestroyCommand());const i=await Promise.all(n);return t.joinPipelineCommands(i)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var oe=r(48353),se=r(30809),ae=r(8887),le=r(38954),ce=r(72385),de=(r(4197),r(11868)),ue=r(27921),he=(r(71351),r(73941));function fe(e,t){const r=e[t],n=e[t+1],i=e[t+2];return Math.sqrt(r*r+n*n+i*i)}function me(e,t){const r=e[t],n=e[t+1],i=e[t+2],o=1/Math.sqrt(r*r+n*n+i*i);e[t]*=o,e[t+1]*=o,e[t+2]*=o}function pe(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r}r(37539),r(20498),r(87170),(0,F.vt)(),(0,F.vt)();var ge=r(620);const ye=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)ye[6*e+t]=e;const _e=new Array(36);for(let e=0;e<6;e++)_e[6*e]=0,_e[6*e+1]=1,_e[6*e+2]=2,_e[6*e+3]=2,_e[6*e+4]=3,_e[6*e+5]=0;const ve=(0,ce.fA)(-.5,0,-.5),be=(0,ce.fA)(.5,0,-.5),xe=(0,ce.fA)(0,0,.5),Ce=(0,ce.fA)(0,.5,0),we=(0,ce.vt)(),Ae=(0,ce.vt)(),Se=(0,ce.vt)(),Ie=(0,ce.vt)(),Pe=(0,ce.vt)();(0,le.d)(we,ve,Ce),(0,le.d)(Ae,ve,be),(0,le.h)(Se,we,Ae),(0,le.n)(Se,Se),(0,le.d)(we,be,Ce),(0,le.d)(Ae,be,xe),(0,le.h)(Ie,we,Ae),(0,le.n)(Ie,Ie),(0,le.d)(we,xe,Ce),(0,le.d)(Ae,xe,ve),(0,le.h)(Pe,we,Ae),(0,le.n)(Pe,Pe),Se[0],Se[1],Se[2],Ie[0],Ie[1],Ie[2],Pe[0],Pe[1],Pe[2],(0,w.vt)();var Oe=r(4576),Me=r(69397);r(6867),r(87582);var Re=r(57917);function Te(e,t){const r=(e,r,n=!1)=>({levels:e.map(e=>{const i=k(r(e.tesselation));return n&&function(e){const t=e,r=t.get("position").data,n=t.get("normal").data;if(n){const t=Fe(e,"normal").data;for(let e=0;e<n.length;e+=3){const r=n[e+1];t[e+1]=-n[e+2],t[e+2]=r}}if(r){const t=Fe(e,"position").data;for(let e=0;e<r.length;e+=3){const n=r[e+1];t[e+1]=-r[e+2],t[e+2]=n}}}(i),{components:[{attributes:i,objectAndLayerIdColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}})});switch(e){case"cone":return r(De,e=>function(e,t,r,n,i=!0,o=!0){let s=0;const a=t,l=e;let c=(0,ce.fA)(0,s,0),d=(0,ce.fA)(0,s+l,0),u=(0,ce.fA)(0,-1,0),h=(0,ce.fA)(0,1,0);n&&(s=l,d=(0,ce.fA)(0,0,0),c=(0,ce.fA)(0,s,0),u=(0,ce.fA)(0,1,0),h=(0,ce.fA)(0,-1,0));const f=[d,c],m=[u,h],p=r+2,g=Math.sqrt(l*l+a*a);if(n)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),n=(0,ce.fA)(Math.cos(t)*a,s,Math.sin(t)*a);f.push(n);const i=(0,ce.fA)(l*Math.cos(t)/g,-a/g,l*Math.sin(t)/g);m.push(i)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),n=(0,ce.fA)(Math.cos(t)*a,s,Math.sin(t)*a);f.push(n);const i=(0,ce.fA)(l*Math.cos(t)/g,a/g,l*Math.sin(t)/g);m.push(i)}const y=new Array,_=new Array;if(i){for(let e=3;e<f.length;e++)y.push(1),y.push(e-1),y.push(e),_.push(0),_.push(0),_.push(0);y.push(f.length-1),y.push(2),y.push(1),_.push(0),_.push(0),_.push(0)}if(o){for(let e=3;e<f.length;e++)y.push(e),y.push(e-1),y.push(0),_.push(e),_.push(e-1),_.push(1);y.push(0),y.push(2),y.push(f.length-1),_.push(1),_.push(2),_.push(m.length-1)}const v=(0,de.oe)(3*p);for(let e=0;e<p;e++)v[3*e]=f[e][0],v[3*e+1]=f[e][1],v[3*e+2]=f[e][2];const b=(0,de.oe)(3*p);for(let e=0;e<p;e++)b[3*e]=m[e][0],b[3*e+1]=m[e][1],b[3*e+2]=m[e][2];return[["position",new K.n(v,y,3,!0)],["normal",new K.n(b,_,3,!0)]]}(1,.5,e,!1),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>function(e,t,r){const n=e;let i,o;if(r)i=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],o=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=n*(1+Math.sqrt(5))/2;i=[-n,e,0,n,e,0,-n,-e,0,n,-e,0,0,-n,e,0,n,e,0,-n,-e,0,n,-e,e,0,-n,e,0,n,-e,0,-n,-e,0,n],o=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<i.length;t+=3)pe(i,t,e/fe(i,t));let s={};function a(t,r){t>r&&([t,r]=[r,t]);const n=t.toString()+"."+r.toString();if(s[n])return s[n];let o=i.length;return i.length+=3,function(e,t,r,n,i,o=t){(i=i||e)[o]=e[t]+r[n],i[o+1]=e[t+1]+r[n+1],i[o+2]=e[t+2]+r[n+2]}(i,3*t,i,3*r,i,o),pe(i,o,e/fe(i,o)),o/=3,s[n]=o,o}for(let e=0;e<t;e++){const e=o.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=o[r],n=o[r+1],i=o[r+2],s=a(e,n),l=a(n,i),c=a(i,e),d=4*r;t[d]=e,t[d+1]=s,t[d+2]=c,t[d+3]=n,t[d+4]=l,t[d+5]=s,t[d+6]=i,t[d+7]=c,t[d+8]=l,t[d+9]=s,t[d+10]=l,t[d+11]=c}o=t,s={}}const l=(0,de.Wz)(i);for(let e=0;e<l.length;e+=3)me(l,e);return[["position",new K.n((0,de.Wz)(i),o,3,!0)],["normal",new K.n(l,o,3,!0)]]}(.5,e,!0));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Fe(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Re.S)(r.data)},e.set(t,r)),r}const De=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var ze=r(88076),je=r(74810);class Be{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:je.Bt,ambient:w.Un,diffuse:w.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=A.Un,r.isInstanced=!0,this._isPrimitive){const e=new ze.fs;e.layerOpacity=t,r={...r,cullFace:Ee((0,ze.ty)(e))}}const n=await e.createMaterial({type:"default",parameters:r}),i=this._symbolLayer.resource;this._primitive=i&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(i?.primitive)?i.primitive:se.r;const o=Te(this._primitive,n);this._lodRendererId=await e.createLodRenderer(o),this._primitiveMaterialId=n,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,n=r.renderCommandContext,i=[];return null!=e&&i.push(n.destroyLodRenderer(e)),null!=t&&i.push(n.destroyMaterial(t)),new g(n,n.mergeRenderCommandBuffers(i),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:n}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:i}=e;if(0===i)return t.createPipelineCommand();const o=this._isPrimitive,s=this._primitive||se.r,a=(0,M.vt)((0,ae.Fq)(s)),l=(0,w.ci)((0,M.Ej)(a)),c=(0,w.ci)((0,ae.Bb)(l,{isPrimitive:o,width:100,depth:null,height:null})),d=new Float64Array(16*i),u=new Float64Array(16*i),h=V(e),f=await n.applyElevationAlignmentTo(h);for(let e=0;e<i;++e){const t=e,r=f[3*e+0],n=f[3*e+1],i=f[3*e+2],o=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ve),s=this._computeLocalTransform(c,l,Ue);this._writeMatrixToTypedBuffer(d,t,s),this._writeMatrixToTypedBuffer(u,t,o)}const m=U(e),p=new Uint8Array(i);e.getVisibilityArray(p);const g={featureIds:new Uint32Array(m),visibility:p,localTransforms:d,globalTransforms:u};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,g))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,n=this._primitiveMaterialId;if(null==n)return t.createPipelineCommand();const i=this._getLayerOpacity();let o={layerOpacity:i};if(this._isPrimitive){const e=new ze.fs;e.layerOpacity=i,o={...o,cullFace:Ee((0,ze.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:n,parameters:o}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:n,mainThreadDelegate:i}=t,{featureCount:o,id:s}=e;if(null==r||0===o)return t.createPipelineCommand();const a=new Float64Array(16*o),l=V(e),c=await i.applyElevationAlignmentTo(l);for(let e=0;e<o;++e){const t=e,r=c[3*e+0],n=c[3*e+1],i=c[3*e+2],o=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ve);this._writeMatrixToTypedBuffer(a,t,o)}return t.createPipelineCommand(n.updateLodInstancesData(r,s,a))}_writeMatrixToTypedBuffer(e,t,r){let n=16*t;for(let t=0;t<16;t++)e[n++]=r[t]}_computeGlobalTransform(e,t,r,n,i){return Le[0]=e,Le[1]=t,Le[2]=r,(0,oe.l)(n,Le,i,this._context.renderSpatialReference),i}_computeLocalTransform(e,t,r){return(0,P.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const n=function(e=w.Un,t,r,n=1){const i=new Array(3);if(null==t||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,o=0;for(let s=2;s>=0;s--){const a=e[s],l=null!=a,c=0===s&&!n&&!l,d=r[s];let u;"symbol-value"===a||c?u=0!==d?t[s]/d:1:l&&"proportional"!==a&&isFinite(a)&&(u=0!==d?a/d:1),null!=u&&(i[s]=u,n=u,o=Math.max(o,Math.abs(u)))}for(let e=2;e>=0;e--)null==i[e]?i[e]=n:0===i[e]&&(i[e]=.001*o)}for(let e=2;e>=0;e--)i[e]/=n;return(0,w.ci)(i)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===n[0]&&1===n[1]&&1===n[2]||(0,P.hs)(r,r,n)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function Ee(e){return e?0:2}const Le=(0,w.vt)(),Ue=(0,C.vt)(),Ve=(0,C.vt)();class He{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new ee(x(),this._context),this._symbols[1]=new Be(new v.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),n=await Promise.all(r.map(async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))})),i=t.joinPipelineCommands(n);return i.appendPipelineStateCommand(()=>this._featureDataPartitioning.set(e.id,r)),i}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const o=await Promise.all(i.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})),s=r.joinPipelineCommands(o);return s.appendPipelineStateCommand(()=>t.delete(e)),s}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e.id);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const o=await Promise.all(i.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))}));return r.joinPipelineCommands(o)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const n=this._symbols[t];null!=n&&n.loaded&&r.push(n.createUpdateLayerViewOpacityCommand(e))}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))});r.push(...e)}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const n=await Promise.all(r);return t.joinPipelineCommands(n)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=U(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,n=[[],[]];for(let e=0;e<r;++e)n[t[e]%2].push(e);return n.map((t,r)=>new Ge(r,e.subset(new Uint32Array(t)))).filter(e=>e.features.featureCount>0)}}class Ge{constructor(e,t){this.index=e,this.features=t}}class ke{constructor(e,t,r,n,i,o,s){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=n,this.renderCommandContext=i,this.layerInfo=o,this.layerViewInfo=s,this.symbolRendererFactory=new qe(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new g(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter(e=>null!=e).reduce((e,t)=>(e.append(t),e))}}class qe{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,p.L)(e??$e)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new ie(t,this.context);case"unique-value":return new He(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON($e)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new ne(e,this.context);case"picture-marker":case"simple-marker":return new ee(x(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new ee(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const $e={type:"simple"};var Ne=r(69622),Ye=r(60999),Xe=r(32587),We=r(11932),Ze=r(24326);function Qe(e=""){return`${e}${(0,Ze.c)()}`}new Float64Array(3);class Je{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=Qe(`featureDataSubset-${e.id}-`)}get tileId(){return this._parent.tileId}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Me.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let n=0;n<r.length;++n)r[n]=t[e[n]];return new Je(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let n=0;n<t;++n)this.getEnabled(n)&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class Ke{constructor(e){this._tile=e,this.id=Qe(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get tileId(){return this._tile.id}get featureCount(){return this._tile.featureCount}get usedMemory(){return Me.qK+(0,Me.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every(e=>e)}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new Je(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const n of this._allFeatureIndices())t[n]&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:n}=this;for(const i of t)e[r++]=Number(n[i]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let et=class extends Ne.A{constructor(e){super(e),this.extent=null,this._tileHandles=new Xe.A,this._wanted=new Xe.A,this._updateRequested=!1,this._synchronizationTask=null,this._requestedTiles=new Array}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updateRequested||!(this._synchronizationTask?.finished??1)}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,R.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const n of t.values())null==r.get(n.id)?.featureData&&e.push(n);return e}onTileTreeChange({tiles:e}){this._requestedTiles=e,this._scheduleTilesSync()}_scheduleTilesSync(){if(this._updateRequested)return;this._updateRequested=!0;const e=this._synchronizationTask,t=(0,Ye.UT)(async()=>{try{await(0,s.C_)(()=>e?.finished??!0),await(0,We.NO)(),this._updateRequested=!1,await this._synchronizeTiles()}finally{this._synchronizationTask===t&&(this._synchronizationTask=null)}});this._synchronizationTask=t}async _synchronizeTiles(){const e=this._requestedTiles,t=this._tileHandles,r=new Array;for(const n of e)t.has(n.id)||r.push(n);const n=new Array;for(const r of t.values()){const{id:t}=r;e.every(e=>e.id!==t)&&n.push(r.descriptor)}const i=this._tileHandles,{_boundingRect:o}=this,s=null!=o?r.filter(e=>(0,R.HY)(o,e.extent)):r,a=this._wanted,l=new Array;for(const{id:e}of n)a.delete(e);for(const e of s)a.set(e.id,e);const c=this._missingTiles;for(const e of n){const{id:t}=e;if(c.some(t=>tt(t,e)||tt(e,t)))continue;const r=i.get(t);null!=r&&l.push(this._removeTile(r))}for(const e of s)l.push(this._addTile(e));const d=await Promise.allSettled(l);for(const e of d)"rejected"===e.status&&console.error(e.reason)}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}*loadedTiles(){for(const e of this._tileHandles.values()){const t=e.featureData;null!=t&&(yield t)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;if(null!=t){const e={stack:[],error:void 0,hasError:!1};try{(0,n.mS)(e,await this.tileLocks.lock([t.tileId]),!1);const r=await this.createRemoveCommand(t.id);await(r?.execute())}catch(t){e.error=t,e.hasError=!0}finally{(0,n.hk)(e)}}}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!nt(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const n=new rt(e,(0,Ye.UT)(async t=>{const r=await this.loadTile(e,t);return(0,o.Te)(t),new Ke(r)}));this._tileHandles.set(n.id,n);try{await n.loadTask.promise}catch(e){return void(0,o.jH)(e)}(function(e){if(!nt(e))throw new Error})(n),await this._onTileLoad(n)}async _onTileLoad(e){const t={stack:[],error:void 0,hasError:!1};try{const{_wanted:r,_tileHandles:i,_missingTiles:o}=this,s=e.descriptor,a=new Array,l=new Array,c=new Array,d=new Set;for(const t of i.values()){if(t===e)continue;const{descriptor:n,id:c}=t;if(!r.has(c)&&!o.some(e=>tt(e,n)||tt(n,e))){i.delete(c),t.loadTask.abort();const{featureData:e}=t;null!=e&&a.push(e);continue}if(nt(t)){if(tt(s,n)){const e=t.featureData;for(const t of e.objectIds())d.add(t)}if(tt(n,s)){const{featureData:e}=t;l.push(e)}}}d.size>0&&(e.featureData.disableObjectIds(d),this._validateRemoval(e.featureData,d)),this._validate(),c.push(e.featureData);const u=[...c,...a,...l].map(e=>e.tileId);if((0,n.mS)(t,await this.tileLocks.lock(u),!1),0!==l.length){const t=e.featureData,r=new Set(t.objectIds());for(const e of l)e.disableObjectIds(r),this._validateRemoval(e,r)}const h=a.map(e=>this.createRemoveCommand(e.id)),f=c.map(e=>this.createAddCommand(e)),m=l.map(e=>this.createUpdateCommand(e)),p=function(e){return 0===e.length?null:e.reduce((e,t)=>(e.append(t),e))}((await Promise.all([...h,...f,...m])).filter(Oe.Ru));await(p?.execute())}catch(e){t.error=e,t.hasError=!0}finally{(0,n.hk)(t)}}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!nt(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:n}=e[t];for(let i=t+1;i<e.length;++i){const{featureData:t,objectIds:o}=e[i];for(const e of o)if(n.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function tt({lij:[e,t,r]},{lij:[n,i,o]}){const s=n-e;return s>=0&&t===i>>s&&r===o>>s}(0,n.Cg)([(0,a.MZ)()],et.prototype,"updating",null),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"loadTile",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"createAddCommand",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"createRemoveCommand",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"createUpdateCommand",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"tileLocks",void 0),(0,n.Cg)([(0,a.MZ)()],et.prototype,"extent",void 0),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_boundingRect",null),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_missingTiles",null),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_updateRequested",void 0),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_synchronizationTask",void 0),et=(0,n.Cg)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],et);class rt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function nt(e){return null!=e.featureData}var it=r(36563);class ot{constructor(){this._previousActions=new Map}async lock(e){const{_previousActions:t}=this,r=e.map(e=>t.get(e)).filter(Oe.Ru),n=Promise.allSettled(r),i=(0,o.Tw)(),s=(0,it.hA)(()=>i.resolve()),a=i.promise.finally(()=>{for(const r of e)t.get(r)===a&&t.delete(r)});for(const r of e)t.set(r,a);return await n,(0,it.Bf)(s)}}var st=r(75503),at=r(27647),lt=r(92722);class ct{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Me.qK+Me.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new dt(this._index,this._view,e)}}class dt extends ct{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,at.Q)(new lt.A,this._geometryOverride,e.hasZ,e.hasM)}}class ut{constructor(e,t){this.featureData=e,this.bounds=t}}class ht{constructor(){this._tileBounds=new Map,this.events=new i.A.EventEmitter,this.featureAdapter=ft.shared}get usedMemory(){return Me.qK+Me.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new st.wq(9,t=>e.getBounds(t)),n=new Array;for(let e=0;e<t;++e)n[e]=e;r.load(n),this._tileBounds.set(e.id,new ut(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all(r=>{t.getEnabled(r)&&e(new ct(r,t))})}forEachInBounds(e,t){mt.minX=e[0],mt.minY=e[1],mt.maxX=e[2],mt.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(mt,r=>{e.getEnabled(r)&&t(new ct(r,e))})}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:o,minY:s,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,o),r=Math.min(r,s),n=Math.min(n,a),i=Math.min(i,l)}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:e}}}class ft{static{this.shared=new ft}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const mt=new st.EC;var pt=r(80893);class gt{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const n=Me.ez+t.reduce((e,{usedMemory:t})=>e+t,0),i=3*Me.RS;this.usedMemory=Me.qK+n+i,this.featureCount=t.reduce((e,t)=>e+t.featureCount,0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttribute(n,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(n,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:n,featurePageIndex:i}=this._translateIndex(e);this._pages[n].getCoordinates(i,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getCentroid(n,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getObjectIdsArray(e,i,n);return n}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getCoordinatesArray(e,i,n);return n}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,n=new Array;for(const i of e){const{pageIndex:e,featurePageIndex:o}=this._translateIndex(i);r!==e&&(0!==n.length&&t.push({pageIndex:r,indices:n}),r=e,n=[]),n.push(o)}0!==n.length&&t.push({pageIndex:r,indices:n})}const{_pages:r}=this;for(const{pageIndex:e,indices:n}of t)yield{page:r[e],indices:n}}}var yt=r(49186),_t=r(51624),vt=r(62577),bt=r(95466),xt=r(53655);class Ct{constructor(e){this._reader=new _t.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return wt(e.getMessage());e.skip()}St()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:n}}=this,i=r.get(t)?.index;if(null==i)return;const o=n[e*r.fields.length+i],s=this._reader;return s.move(o),It(s)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,n=e*t.fields.length,i=this._reader,o={};for(const e of t.fields){const t=r[n+e.index];i.move(t),o[e.name]=It(i)}return o}getCoordinates(e,t,r=0){const n=this._reader,{transform:i,featureIndices:o}=this._index,{scale:s,translate:a}=i;n.move(o[e]),this._readCoordinates(s,a,t,r)}getOptimizedGeometry(e){const t=(0,w.vt)();return this.getCoordinates(e,t),new lt.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Pt);const[n,i,o]=Pt,s=[n,i];return t&&(s[3]=o),r&&(s[t?4:3]=0),new lt.A([],s)}getBounds(e){this.getCoordinates(e,Pt);const[t,r]=Pt,n=new st.EC;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,Pt);const[t,r,n]=Pt;return(0,M.fA)(t,r,n,t,r,n)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{objectIdFieldName:i,attributeIndices:o,fieldsIndex:s}=this._index,a=s.get(i).index,l=s.fields.length;for(const i of t){const t=o[i*l+a];n.move(t),e[r++]=It(n)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{transform:i,featureIndices:o}=this._index,{scale:s,translate:a}=i;for(const i of t){const t=o[i];n.move(t),r=this._readCoordinates(s,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:n,fieldsIndex:i}=this._index,o=i.get(r).index,s=i.fields.length;for(const r of e){const e=n[r*s+o];t.move(e),yield It(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[n,i,o],s,a){const l=this._reader,c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)3===l.tag()?(l.getUInt32(),s[a++]=n+e*l.getSInt64(),s[a++]=i+t*l.getSInt64(),s[a++]=o+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function wt(e){for(;e.next();){if(1===e.tag())return At(e.getMessage());e.skip()}St()}function At(e){let t,r,n=!1,i=!1,o=0;const s=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&St();break;case 9:n=e.getBool()??!1;break;case 12:t=(0,vt.Q1)(e.processMessage(xt.ae));break;case 13:{const t=e.processMessage(xt.cn);t.index=o++,s.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:i=e.getBool()??!1;break;default:e.skip()}const c=new bt.A(s);return null!=t&&i&&null!=r&&c.has(r)||St(),{transform:t,exceededTransferLimit:n,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function St(){const e=new yt.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function It(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&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}const Pt=(0,w.vt)();class Ot{constructor(e,t,r,n,i){this.spatialReference=e,this.url=r,this.objectIdField=n,this.capabilities=i;const{supportsMaxRecordCountFactor:o,maxRecordCount:s}=this.capabilities.query,a=o?4:1,l=(s??8e3)*a;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=a,c.num=this._pageSize,c.outFields=[n],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:n}=this,i=(0,R.w1)(e.extent,r),s=this._baseQuery.clone();s.geometry=i;const a=new Array;let l=0,c=!1,d=1;for(;!c;){const e=[];for(let r=0;r<d;++r)e.push(this._fetchPage(s,l++,t));const r=await Promise.all(e);(0,o.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&a.push(e)}d=Math.min(d+1,4)}return new gt(e,a,n)}async _fetchPage(e,t,r){const n=e.clone();n.start=t*this._pageSize;const i=(await(0,pt.kS)(this.url,n,{signal:r})).data;return(0,o.Te)(r),new Ct(i)}}var Mt=r(29920),Rt=r(77690),Tt=r(29242);var Ft=r(13030),Dt=r(78662),zt=r(1843),jt=r(49255),Bt=r(40268),Et=r(16943),Lt=r(25634),Ut=r(11725),Vt=r(77194);class Ht{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var Gt=r(59907),kt=r(43616),qt=r(13259),$t=r(97220),Nt=r(98958),Yt=r(33524),Xt=r(63907),Wt=r(90644);class Zt extends Nt.w{constructor(e,t){super(e,t,new $t.$(qt.H,()=>r.e(8241).then(r.bind(r,48241)))),this.primitiveType=t.occlusionPass?Xt.WR.POINTS:Xt.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:n,output:i,depthTestEnabled:o,occlusionPass:s}=e,a=0===t,l=o&&!n&&!(1===t)&&!s&&!(8===i);return(0,Wt.Ey)({blending:(0,jt.RN)(i)?a?Wt.RC:(0,Yt.ez)(t):null,depthTest:o&&!n?{func:515}:null,depthWrite:l?Wt.Uy:null,drawBuffers:(0,Yt.m6)(t,i),colorWrite:Wt.kn,polygonOffset:r?Qt:null})}}const Qt={factor:0,units:-4};var Jt=r(51976),Kt=r(35256);class er extends Kt.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.textureCoordinateType=0,this.emissionSource=0,this.discardInvisibleFragments=!0,this.hasVvInstancing=!1,this.snowCover=!1}}(0,n.Cg)([(0,Jt.W)()],er.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"occlusionTestEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"signedDistanceFieldEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"vvSize",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"vvColor",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasVerticalOffset",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasScreenSizePerspective",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasRotation",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"debugDrawLabelBorder",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasPolygonOffset",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"depthTestEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"pixelSnappingEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"draped",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"terrainDepthTest",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"cullAboveTerrain",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"occlusionPass",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"occludedFragmentFade",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"objectAndLayerIdColorInstanced",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"horizonCullingEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"isFocused",void 0);var tr=r(49788);class rr extends Ut.i{constructor(e,t){super(e,Ir),this.produces=new Map([[12,e=>(0,jt.Mb)(e)&&!this.parameters.drawAsLabel],[13,e=>(0,jt.Mb)(e)&&this.parameters.drawAsLabel],[11,()=>this.parameters.occlusionTest],[17,e=>this.parameters.draped&&(0,jt.Mb)(e)]]),this._visible=!0,this._configuration=new er(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=11===t.slot,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||11===t.slot,(0,jt.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!z.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,n,i,o){const{options:{selectionMode:s,hud:a,excludeLabels:l},point:c,camera:d}=r,{parameters:u}=this;if(!s||!a||l&&u.isLabel||!e.visible||!c||!d)return;const h=e.attributes.get("featureAttribute"),f=null==h?null:(0,A.ci)(h.data,br),{scaleX:m,scaleY:p}=Rr(f,u,d.pixelRatio);(0,Rt.z0)(mr,t),e.attributes.has("featureAttribute")&&function(e){const t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+n*n),u=1/Math.sqrt(i*i+o*o+s*s),h=1/Math.sqrt(a*a+l*l+c*c);e[0]=t*d,e[1]=r*d,e[2]=n*d,e[3]=i*u,e[4]=o*u,e[5]=s*u,e[6]=a*h,e[7]=l*h,e[8]=c*h}(mr);const g=e.attributes.get("position"),y=e.attributes.get("size"),_=e.attributes.get("normal"),v=e.attributes.get("rotation"),b=e.attributes.get("centerOffsetAndDistance");(0,ge.vA)(g.size>=3);const x=(0,qt.c)(u),C="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<g.data.length/g.size;e++){const n=e*g.size;(0,le.i)(ar,g.data[n],g.data[n+1],g.data[n+2]),(0,le.t)(ar,ar,t),(0,le.t)(ar,ar,d.viewMatrix);const i=e*b.size;if((0,le.i)(_r,b.data[i],b.data[i+1],b.data[i+2]),!C&&(ar[0]+=_r[0],ar[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,le.n)(_r,ar),(0,le.d)(ar,ar,(0,le.g)(_r,_r,e))}const s=e*_.size;if((0,le.i)(lr,_.data[s],_.data[s+1],_.data[s+2]),ir(lr,mr,d,xr),Tr(this.parameters,ar,xr,d,sr),d.applyProjection(ar,cr),cr[0]>-1){C&&(_r[0]||_r[1])&&(cr[0]+=_r[0]*d.pixelRatio,0!==_r[1]&&(cr[1]+=(0,Vt.m0)(_r[1],sr.factorAlignment)*d.pixelRatio),d.unapplyProjection(cr,ar)),cr[0]+=this.parameters.screenOffset[0]*d.pixelRatio,cr[1]+=this.parameters.screenOffset[1]*d.pixelRatio,cr[0]=Math.floor(cr[0]),cr[1]=Math.floor(cr[1]);const t=e*y.size;Ar[0]=y.data[t],Ar[1]=y.data[t+1],(0,Vt.MD)(Ar,sr.factor,Ar);const n=Cr*d.pixelRatio;let i=0;u.textureIsSignedDistanceField&&(i=Math.min(u.outlineSize,.5*Ar[0])*d.pixelRatio/2),Ar[0]*=m,Ar[1]*=p;const s=e*v.size,a=u.rotation+v.data[s];if(or(c,cr[0],cr[1],Ar,n,i,a,u,x)){const e=r.ray;if((0,le.t)(ur,ar,(0,P.B8)(gr,d.viewMatrix)),cr[0]=c[0],cr[1]=c[1],d.unprojectFromRenderScreen(cr,ar)){const t=(0,w.vt)();(0,le.c)(t,e.direction);const r=1/(0,le.l)(t);(0,le.g)(t,t,r),o((0,le.j)(e.origin,ar)*r,t,-1,ur)}}}}}intersectDraped(e,t,r,n,i){const o=e.attributes.get("position"),s=e.attributes.get("size"),a=e.attributes.get("rotation"),l=this.parameters,c=(0,qt.c)(l),d=e.attributes.get("featureAttribute"),u=null==d?null:(0,A.ci)(d.data,br),{scaleX:h,scaleY:f}=Rr(u,l,e.screenToWorldRatio),m=wr*e.screenToWorldRatio;for(let t=0;t<o.data.length/o.size;t++){const d=t*o.size,u=o.data[d],p=o.data[d+1],g=t*s.size;Ar[0]=s.data[g],Ar[1]=s.data[g+1];let y=0;l.textureIsSignedDistanceField&&(y=Math.min(l.outlineSize,.5*Ar[0])*e.screenToWorldRatio/2),Ar[0]*=h,Ar[1]*=f;const _=t*a.size,v=l.rotation+a.data[_];or(r,u,p,Ar,m,y,v,l,c)&&n(i.distance,i.normal,-1)}}createBufferWriter(){return new Mr}applyShaderOffsetsView(e,t,r,n,i,o,s){const a=ir(t,r,i,xr);return this._applyVerticalGroundOffsetView(e,a,i,s),Tr(this.parameters,s,a,i,o),this._applyPolygonOffsetView(s,a,n[3],i,s),this._applyCenterOffsetView(s,n,s),s}applyShaderOffsetsNDC(e,t,r,n,i){return this._applyCenterOffsetNDC(e,t,r,n),null!=i&&(0,le.c)(i,n),this._applyPolygonOffsetNDC(n,t,r,n),n}_applyPolygonOffsetView(e,t,r,n,i){const o=n.aboveGround?1:-1;let s=Math.sign(r);0===s&&(s=o);const a=o*s;if(this.parameters.shaderPolygonOffset<=0)return(0,le.c)(i,e);const l=(0,D.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/n.viewport[2];return(0,le.g)(i,e,a>0?c:1/c),i}_applyVerticalGroundOffsetView(e,t,r,n){const i=(0,le.l)(e),o=r.aboveGround?1:-1,s=r.computeRenderPixelSizeAtDist(i)*Bt.R,a=(0,le.g)(ar,t.normal,o*s);return(0,le.f)(n,e,a),n}_applyCenterOffsetView(e,t,r){const n="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,le.c)(r,e),n&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,le.n)(lr,r),(0,le.a)(r,r,(0,le.g)(lr,lr,t[2])))),r}_applyCenterOffsetNDC(e,t,r,n){const i="screen"!==this.parameters.centerOffsetUnits;return n!==e&&(0,le.c)(n,e),i||(n[0]+=t[0]/r.fullWidth*2,n[1]+=t[1]/r.fullHeight*2),n}_applyPolygonOffsetNDC(e,t,r,n){const i=this.parameters.shaderPolygonOffset;if(e!==n&&(0,le.c)(n,e),i){const e=r.aboveGround?1:-1,o=e*Math.sign(t[3]);n[2]-=(o||e)*i}return n}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,n=e[3]>=tr.Q||t>=tr.Q&&r[3]>=tr.Q;return this._visible&&n}createGLMaterial(e){return new nr(e)}calculateRelativeScreenBounds(e,t,r=(0,R.vt)()){return function(e,t,r,n){n[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,n[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class nr extends Lt.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(Zt,e)}}function ir(e,t,r,n){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,Rt.z0)(pr,t)),(0,le.o)(n.normal,e,t),(0,le.t)(n.normal,n.normal,r.viewInverseTransposeMatrix),n.cosAngle=(0,le.e)(dr,Sr),n}function or(e,t,r,n,i,o,s,a,l){let c=t-i-n[0]*l[0],d=c+n[0]+2*i,u=r-i-n[1]*l[1],h=u+n[1]+2*i;const f=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=f&&(c+=n[0]*f[0],u+=n[1]*f[1],d-=n[0]*(1-f[2]),h-=n[1]*(1-f[3]),c-=o,d+=o,u-=o,h+=o),(0,T.hZ)(fr,t,r),(0,T.e$)(hr,e,fr,(0,D.kU)(s)),hr[0]>c&&hr[0]<d&&hr[1]>u&&hr[1]<h}const sr=new class{constructor(){this.factor=new Ht,this.factorAlignment=new Ht}},ar=(0,w.vt)(),lr=(0,w.vt)(),cr=(0,A.vt)(),dr=(0,w.vt)(),ur=(0,w.vt)(),hr=(0,F.vt)(),fr=(0,F.vt)(),mr=(0,Tt.vt)(),pr=(0,Tt.vt)(),gr=(0,C.vt)(),yr=(0,A.vt)(),_r=(0,w.vt)(),vr=(0,w.vt)(),br=(0,A.vt)(),xr={normal:dr,cosAngle:0},Cr=1,wr=2,Ar=(0,F.fA)(0,0),Sr=(0,w.fA)(0,0,1);class Ir extends Lt.NV{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=(0,A.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,F.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,A.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,A.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}}const Pr=(0,zt.BP)().vec3f("position").vec3f("normal").vec2i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),Or=Pr.clone().vec4u8("objectAndLayerIdColor");class Mr{constructor(){this.vertexBufferLayout=(0,Et.E)()?Or:Pr}elementCount(e){return 6*e.get("position").indices.length}write(e,t,r,n,i,o){const{position:s,normal:a,uvi:l,color:c,size:d,rotation:u,centerOffsetAndDistance:h,featureAttribute:f}=i;(0,Gt.Hk)(r.get("position"),e,s,o,6),(0,Gt.p1)(r.get("normal"),t,a,o,6);const m=r.get("uvi")?.data;let p=0,g=0,y=-1-qt.f,_=-1-qt.f;m&&m.length>=4&&(p=m[0],g=m[1],y=-1-m[2],_=-1-m[3]);let v=r.get("position").indices.length,b=o;for(let e=0;e<v;++e)l.set(b,0,p),l.set(b,1,g),b++,l.set(b,0,y),l.set(b,1,g),b++,l.set(b,0,y),l.set(b,1,_),b++,l.set(b,0,y),l.set(b,1,_),b++,l.set(b,0,p),l.set(b,1,_),b++,l.set(b,0,p),l.set(b,1,g),b++;(0,Gt.tb)(r.get("color"),4,c,o,6);const{data:x,indices:C}=r.get("size");v=C.length,b=o;for(let e=0;e<v;++e){const t=x[2*C[e]],r=x[2*C[e]+1];for(let e=0;e<6;++e)d.set(b,0,t),d.set(b,1,r),b++}if((0,Gt.uO)(r.get("rotation"),u,o,6),r.get("centerOffsetAndDistance")?(0,Gt.Ut)(r.get("centerOffsetAndDistance"),h,o,6):(0,Gt.Pq)(h,o,6*v),r.get("featureAttribute")?(0,Gt.Ut)(r.get("featureAttribute"),f,o,6):(0,Gt.Pq)(f,o,6*v),null!=n){const e=r.get("position")?.indices;if(e){const t=e.length,r=i.getField("objectAndLayerIdColor",Ft.XP);(0,Gt.vx)(n,r,t,o,6)}}return{numVerticesPerItem:6,numItems:v}}intersect(e,t,r,n,i,o,s){const{options:{selectionMode:a,hud:l,excludeLabels:c},point:d,camera:u}=n;if(!a||!l||c&&t.isLabel||!d)return;const h=this.vertexBufferLayout.createView(e),f=h.getField("position",Ft.xs),m=h.getField("normal",Ft.xs),p=h.getField("rotation",Ft.Y$),g=h.getField("size",Ft.gH),y=h.getField("featureAttribute",Ft.Eq),_=h.getField("centerOffsetAndDistance",Ft.Eq),v="screen"===t.centerOffsetUnits,b=(0,qt.c)(t);if(null==f||null==m||null==p||null==g||null==_||null==u)return;const x=null==y?null:y.getVec(0,br),{scaleX:C,scaleY:A}=Rr(x,t,u.pixelRatio),S=f.count/6;for(let e=0;e<S;e++){const i=6*e;if(f.getVec(i,ar),null!=r&&(0,le.f)(ar,ar,r),(0,le.t)(ar,ar,u.viewMatrix),_.getVec(i,yr),(0,le.i)(_r,yr[0],yr[1],yr[2]),!v&&(ar[0]+=_r[0],ar[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,le.n)(_r,ar),(0,le.d)(ar,ar,(0,le.g)(_r,_r,e))}if(m.getVec(i,lr),ir(lr,mr,u,xr),Tr(t,ar,xr,u,sr),u.applyProjection(ar,cr),cr[0]>-1){v&&(_r[0]||_r[1])&&(cr[0]+=_r[0]*u.pixelRatio,0!==_r[1]&&(cr[1]+=(0,Vt.m0)(_r[1],sr.factorAlignment)*u.pixelRatio),u.unapplyProjection(cr,ar)),cr[0]+=t.screenOffset[0]*u.pixelRatio,cr[1]+=t.screenOffset[1]*u.pixelRatio,cr[0]=Math.floor(cr[0]),cr[1]=Math.floor(cr[1]),g.getVec(i,Ar),(0,Vt.MD)(Ar,sr.factor,Ar);const r=Cr*u.pixelRatio;let o=0;t.textureIsSignedDistanceField&&(o=Math.min(t.outlineSize,.5*Ar[0])*u.pixelRatio/2),Ar[0]*=C,Ar[1]*=A;const a=p.get(i),l=t.rotation+a;if(or(d,cr[0],cr[1],Ar,r,o,l,t,b)){const t=n.ray;if((0,le.t)(ur,ar,(0,P.B8)(gr,u.viewMatrix)),cr[0]=d[0],cr[1]=d[1],u.unprojectFromRenderScreen(cr,ar)){const r=(0,w.vt)();(0,le.c)(r,t.direction);const n=1/(0,le.l)(r);(0,le.g)(r,r,n),s((0,le.j)(t.origin,ar)*n,r,e,ur)}}}}}}function Rr(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,Dt.VC)(vr,t,e),{scaleX:vr[0]*r,scaleY:vr[1]*r})}function Tr(e,t,r,n,i){if(!e.verticalOffset?.screenLength)return e.screenSizePerspective||e.screenSizePerspectiveAlignment?Fr(e,i,(0,le.l)(t),r.cosAngle):(i.factor.scale=1,i.factorAlignment.scale=1),t;const o=(0,le.l)(t),s=e.screenSizePerspectiveAlignment??e.screenSizePerspective,a=(0,kt.kE)(n,o,e.verticalOffset,r.cosAngle,s);return Fr(e,i,o,r.cosAngle),(0,le.g)(r.normal,r.normal,a),(0,le.f)(t,t,r.normal)}function Fr(e,t,r,n){null!=e.screenSizePerspective?(0,Vt.cJ)(n,r,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?(0,Vt.cJ)(n,r,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}class Dr{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this.globalViewingMode=1===e}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async createTexture(e){const{data:t,parameters:r}=e();return await this._mainThreadDelegate.createTexture(t,r)}async releaseTexture(e){const t=this._destroyTexture(e);return new g(this,t,[])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,n=Qe("material");let i,o;switch(t){case"default":i=new ze.$U(e.parameters,{spherical:this.globalViewingMode}),o={type:t,materialId:n,parameters:e.parameters};break;case"hud":i=new rr(r,this.globalViewingMode),o={type:t,materialId:n,parameters:e.parameters}}return this._bufferWriters.set(n,i.createBufferWriter()),await this._mainThreadDelegate.createMaterial(o),n}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:o}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(n,e,i,o,r)}updateDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:o}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(n,e,i,o,r)}addDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:o,visibilities:s}=n;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,o.buffer,s.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:o,visibilities:s}=n;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,o.buffer,s.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=Qe("lod-renderer"),r=new Set,n={levels:e.levels.map(e=>({components:e.components.map(e=>{const t=e.attributes.get("position");if(!t||0===t.indices.length)throw new Error("positions attribute expected");const n=(0,G.tM)(t.indices.length/3),i=new Mt.j(n,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:o}=this.createRenderGeometryBuffer(e,null);return r.add(o.data),{materialId:e.materialId,renderGeometryBuffer:o,boundingInfo:{bbMax:i.bbMax,bbMin:i.bbMin}}}),minScreenSpaceRadius:e.minScreenSpaceRadius}))};return await this._mainThreadDelegate.createLodRenderer(t,n,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:n,objectIds:i}=e,o=this._bufferWriters.get(r);if(null==o)throw new Error("no registered bufferWriter for material found");let s=null;if(e.transformation&&t)(0,P.C)(zr,e.transformation),zr[12]-=t[0],zr[13]-=t[1],zr[14]-=t[2],s=zr;else{if(t)throw new Error("not implemented");e.transformation&&(s=e.transformation)}let a=null;s&&((0,P.B8)(jr,zr),(0,P.mg)(jr,jr),a=jr);const l=e.attributes,c=o.elementCount(l),d=o.vertexBufferLayout.stride/4;c>Math.floor(Br/d)&&console.warn("geometry with very large number of elements encountered");const u=o.vertexBufferLayout.createBuffer(c),h=o.write(s,a,l,e.objectAndLayerIdColor,u,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(n.length!==h.numItems||i.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:u.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:i,visibilities:n,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const zr=(0,C.vt)(),jr=(0,C.vt)(),Br=4194304;var Er=r(98764),Lr=r(65806);const Ur=(0,w.vt)();var Vr=r(17352),Hr=r(97937);function Gr(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const kr=2**50;function qr(e,t,r,n){return e.operations.setAltitudeAt(e.value,t,r,n)}function $r(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Nr=(0,w.vt)();(0,w.vt)();var Yr=r(44280),Xr=r(32114);function Wr(e){return"point"===e.type}class Zr{constructor(e,t,r,n){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=n,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(n),this.referenceEllipsoid=(0,he.tO)(t),this.sphericalPCPF=(0,Er.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return e=this._coordinateSystem,t=(0,R.vt)(),e.operations.getExtent(e.value,t),t;var e,t}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return qr(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){var r,n,i,o;r=this._coordinateSystem,i=e,(n=t)!==(o=t)&&(0,P.C)(o,n),(0,le.i)(Nr,o[12],o[13],o[14]),qr(r,Nr,i,Nr),o[12]=Nr[0],o[13]=Nr[1],o[14]=Nr[2]}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,2,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,n){return e.operations.axisAt(e.value,t,r,n)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,0,Xr.rq.get()),n=this.worldBasisAtPosition(e,1,Xr.rq.get()),i=this.worldBasisAtPosition(e,2,Xr.rq.get());return(0,P.hZ)(t,r[0],r[1],r[2],0,n[0],n[1],n[2],0,i[0],i[1],i[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Xr.rq.get()),n=this.worldBasisAtPosition(e,1,Xr.rq.get()),i=(0,Yr.EJ)(t,n,r);return(0,D.KJ)(i)}intersectManifoldClosestSilhouette(e,t,r){return $r(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){$r(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=Xr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,n)?(0,le.c)(r,n):null}intersectInfiniteManifold(e,t,r){if(1===this.viewingMode)return this.intersectManifold(e,t,r);$r(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,i=Xr.rq.get();return(0,ue.Ui)(n.plane,e,i)?(0,le.c)(r,i):null}toRenderCoords(e,t,r){return Wr(e)?(0,Lr.g)(e,t,this.spatialReference):(0,L.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return Wr(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,L.F)(e,t,Ur,r.spatialReference)&&(r.x=Ur[0],r.y=Ur[1],r.z=Ur[2],!0)}(e,this.spatialReference,t)?t:null):(0,L.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case 2:return new Zr(2,t,(0,I.GA)(t),Gr(Vr.b,(0,Vr.f)([0,0,0],[kr,0,0],[0,kr,0])));case 1:return new Zr(1,t,1,function(e){return Gr(Hr.s,(0,Hr.f)(0,0,0,(0,he.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,I.KX)(e)/(0,I.KX)(t)}}let Qr=class extends i.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new ht,this._tileLocks=new ot,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:n,layerViewInfo:i}){const o=h.A.fromJSON(e);this._viewSpatialReference=o;const a=h.A.fromJSON(t);this._fetcher=new Ot(this._viewSpatialReference,m.A.fromJSON(n.baseQuery),n.url,n.objectIdField,n.capabilities),this._queryEngine=new f.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:n.objectIdField},fieldsIndex:n.fieldIndex,availableFields:[n.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:n.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const n={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",n,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const l=Zr.create(r,a),c=new Dr(r,this._mainThreadDelegate);this._renderCommandContext=c;const p=new ke(o,a,this._mainThreadDelegate,l,c,n,i);this._context=p,this._renderer=p.symbolRendererFactory.createSymbolRendererFromJSON(n.renderer),this._defaultQueryJSON=new m.A({outSpatialReference:o}).toJSON();let g=null;if(null!=n.fullExtent){const e=d.A.fromJSON(n.fullExtent);await(0,u.initializeProjection)(e.spatialReference,o),g=(0,u.project)(e,o)}return this._tileManager=new et({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:g}),this.addHandles((0,s.wB)(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),s.Vh),null!=this._renderer&&await this._renderer.load(),Kr}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(Kr)}async onElevationChange(e){return Kr}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return Kr;const n=await r.createUpdateLayerViewOpacityCommand(e);return await n.execute(),Kr}async onRendererChange(e){const{_context:t}=this,r=t.symbolRendererFactory.createSymbolRendererFromJSON(e);await r.load();const i=this._renderer;this._renderer=r;const o=[...this._tileManager.loadedTiles()],s=o.map(e=>e.tileId);{const e={stack:[],error:void 0,hasError:!1};try{(0,n.mS)(e,await this._tileLocks.lock(s),!1);const a=o.flatMap(e=>[i.createRemoveCommand(e.id),r.createAddCommand(e)]),l=await Promise.all(a),c=t.joinPipelineCommands(l);await c.execute()}catch(t){e.error=t,e.hasError=!0}finally{(0,n.hk)(e)}}const a=await i.createDestroyCommand();return await a.execute(),Kr}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,n=this._renderer;let i;return i=null!=n?await n.createAddCommand(e):g.create(this._renderCommandContext),(0,o.Te)(t),i.appendPipelineStateCommand(()=>{r.addTile(e)}),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let n;return n=null!=r?await r.createRemoveCommand(e):g.create(this._renderCommandContext),n.appendPipelineStateCommand(()=>{t.removeTile(e)}),n}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let n;return n=null!=r?await r.createUpdateVisibilityCommand(e):g.create(this._renderCommandContext),(0,o.Te)(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,n.Cg)([(0,a.MZ)()],Qr.prototype,"updating",null),Qr=(0,n.Cg)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Qr);const Jr=Qr,Kr={result:void 0}},77548:(e,t,r)=>{r.d(t,{Gh:()=>p,tk:()=>u,BR:()=>d,wI:()=>c,G$:()=>f,$x:()=>h,Ov:()=>a,W_:()=>l,OP:()=>m,TU:()=>s,XX:()=>o});var n=r(70333),i=r(78888);r(7762),r(84952),r(36563),r(36708),new WeakMap;const o={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function s(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function a(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function c(e,t){const r=n.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const o=e.toLowerCase().indexOf("/rest/services");if(-1===o)return null;const s=`${e.slice(0,o)}/rest/info`,a=null!=t?t.signal:null,{data:l}=await(0,i.A)(s,{query:{f:"json"},responseType:"json",signal:a});return l?.owningSystemUrl||null}function d(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function u(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function h(e,t){return null}function f(e){return null}function m(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function p(e,t){if(!t||!m(e))return;const r=(e.url,null);r&&(e.url=r)}},81961:(e,t,r)=>{r.d(t,{V:()=>i});var n=r(74333);class i extends n.n{constructor(e,t,r){super(e,"vec4",2,(n,i,o)=>n.setUniform4fv(e,t(i,o),r))}}},87582:(e,t,r)=>{r(6867),r(65215).R},95696:(e,t,r)=>{r.d(t,{A:()=>d});var n,i=r(31635),o=r(69540),s=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),c=r(40608);let d=class extends(o.A.ClonableMixin(s.A)){static{n=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new n}};(0,i.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],d.prototype,"type",void 0),(0,i.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],d.prototype,"origin",void 0),d=n=(0,i.Cg)([(0,c.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],d)},96576:(e,t,r)=>{r.d(t,{A:()=>h});var n,i=r(31635),o=r(4718),s=r(10107),a=(r(44208),r(53966),r(93223)),l=r(40608),c=r(92438),d=r(63988),u=r(49849);let h=n=class extends((0,d.h)(c.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new n({description:this.description,label:this.label,symbol:(0,o.o8)(this.symbol),visualVariables:(0,o.o8)(this.visualVariables),authoringInfo:(0,o.o8)(this.authoringInfo)})}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],h.prototype,"description",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],h.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)(u.Wp)],h.prototype,"symbol",void 0),(0,i.Cg)([(0,a.e)({simple:"simple"})],h.prototype,"type",void 0),h=n=(0,i.Cg)([(0,l.$)("esri.renderers.SimpleRenderer")],h)}}]);
346
+ }`)}},65215:(e,t,r)=>{r.d(t,{H:()=>n,R:()=>i});class n{constructor(e){this.layerViewUid=e}}class i extends n{constructor(e,t){super(e),this.graphicUid=t}}},65494:(e,t,r)=>{r.d(t,{L:()=>l,r:()=>s});var n=r(67076),i=r(90360),o=r(41214);function s(e,t){return l(e,null,t)}const a=(0,i.C)({types:o.Hg});function l(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new n.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):a(e,t,r):null}},72385:(e,t,r)=>{function n(){return new Float32Array(3)}function i(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function o(e,t,r){const n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}function s(){return n()}function a(){return o(1,1,1)}function l(){return o(1,0,0)}function c(){return o(0,1,0)}function d(){return o(0,0,1)}r.d(t,{fA:()=>o,o8:()=>i,vt:()=>n});const u=s(),h=a(),f=l(),m=c(),p=d();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:m,UNIT_Z:p,ZEROS:u,clone:i,create:n,fromValues:o,ones:a,unitX:l,unitY:c,unitZ:d,zeros:s},Symbol.toStringTag,{value:"Module"}))},75503:(e,t,r)=>{r.d(t,{EC:()=>S,wq:()=>a});var n=r(4576),i=r(21818),o=(r(44208),r(15142)),s=r(11006);class a{constructor(e=9,t){this._compareMinX=h,this._compareMinY=f,this._toBBox=e=>e,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()}destroy(){this.clear(),x.prune(),C.prune(),w.prune(),A.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(v(e,r))for(x.clear();r;){for(let i=0,o=r.children.length;i<o;i++){const o=r.children[i],s=r.leaf?n(o):o;v(e,s)&&(r.leaf?t(o):_(e,s)?l(o,t):x.push(o))}r=x.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!v(e,t))return!1;for(x.clear();t;){for(let n=0,i=t.children.length;n<i;n++){const i=t.children[n],o=t.leaf?r(i):i;if(v(e,o)){if(t.leaf||_(e,o))return!0;x.push(i)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new P([]),this}remove(e){if(!e)return this;let t,r=this._data,o=null,s=0,a=!1;const l=this._toBBox(e);for(w.clear(),A.clear();r||w.length>0;){if(r||(r=w.pop(),o=w.data[w.length-1],s=A.pop()??0,a=!0),r.leaf&&(t=(0,n.qh)(r.children,(0,i.zI)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),w.push(r),this._condense(w),this;a||r.leaf||!_(r,l)?o?(s++,r=o.children[s],a=!1):r=null:(w.push(r),A.push(s),s=0,o=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,n){const i=r-t+1;let o=this._maxEntries;if(i<=o){const n=new P(e.slice(t,r+1));return c(n,this._toBBox),n}n||(n=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/o**(n-1)));const s=new O([]);s.height=n;const a=Math.ceil(i/o),l=a*Math.ceil(Math.sqrt(o));b(e,t,r,l,this._compareMinX);for(let i=t;i<=r;i+=l){const t=Math.min(i+l-1,r);b(e,i,t,a,this._compareMinY);for(let r=i;r<=t;r+=a){const i=Math.min(r+a-1,t);s.children.push(this._build(e,r,i,n-1))}}return c(s,this._toBBox),s}_insert(e,t,r){const n=this._toBBox,i=r?e:n(e);w.clear();const o=function(e,t,r,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==r;){let r,n=1/0,i=1/0;for(let o=0,s=t.children.length;o<s;o++){const s=t.children[o],a=m(s),l=g(e,s)-a;l<i?(i=l,n=a<n?a:n,r=s):l===i&&a<n&&(n=a,r=s)}t=r||t.children[0]}return t}(i,this._data,t,w);for(o.children.push(e),u(o,i);t>=0&&w.data[t].children.length>this._maxEntries;)this._split(w,t),t--;!function(e,t,r){for(let n=r;n>=0;n--)u(t.data[n],e)}(i,w,t)}_split(e,t){const r=e.data[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const o=this._chooseSplitIndex(r,i,n);if(!o)return;const s=r.children.splice(o,r.children.length-o),a=r.leaf?new P(s):new O(s);a.height=r.height,c(r,this._toBBox),c(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,t){this._data=new O([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,i,o;n=i=1/0;for(let s=t;s<=r-t;s++){const t=d(e,0,s,this._toBBox),a=d(e,s,r,this._toBBox),l=y(t,a),c=m(t)+m(a);l<n?(n=l,o=s,i=c<i?c:i):l===n&&c<i&&(i=c,o=s)}return o}_chooseSplitAxis(e,t,r){const n=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,n)<this._allDistMargin(e,t,r,i)&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);const i=this._toBBox,o=d(e,0,t,i),s=d(e,r-t,r,i);let a=p(o)+p(s);for(let n=t;n<r-t;n++){const t=e.children[n];u(o,e.leaf?i(t):t),a+=p(o)}for(let n=r-t-1;n>=t;n--){const t=e.children[n];u(s,e.leaf?i(t):t),a+=p(s)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const i=e.data[t-1],o=i.children;o.splice((0,n.qh)(o,r,o.length,i.indexHint),1)}else this.clear();else c(r,this._toBBox)}}_initFormat(e){const 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]+"};")}}function l(e,t){let r=e;for(C.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,i.zI)(e));else C.pushArray(r.children);r=C.pop()??null}}function c(e,t){d(e,0,e.children.length,t,e)}function d(e,t,r,n,i){i||(i=new P([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o,s=t;s<r;s++)o=e.children[s],u(i,e.leaf?n(o):o);return i}function u(e,t){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)}function h(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(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 y(e,t){const r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function b(e,t,r,n,i){const o=[t,r];for(;o.length;){const t=o.pop(),r=o.pop();if(t-r<=n)continue;const a=r+Math.ceil((t-r)/n/2)*n;(0,s.q)(e,a,r,t,i),o.push(r,a,a,t)}}const x=new o.A,C=new o.A,w=new o.A,A=new o.A({deallocator:void 0});class S{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class I extends S{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class P extends I{constructor(e){super(),this.children=e,this.leaf=!0}}class O extends I{constructor(e){super(),this.children=e,this.leaf=!1}}},77121:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Jr});var n=r(31635),i=r(65529),o=r(74887),s=r(36708),a=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),d=r(5443),u=r(98988),h=r(16930),f=r(95422),m=r(61956),p=r(65494);class g{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new g(e,e.createRenderCommandBuffer(),t)}}var y=r(68197),_=r(18574),v=r(87403),b=r(28975);function x(){return new _.A({material:new b.N({color:new y.A("red")})})}var C=r(9093),w=r(51850),A=r(91829),S=r(6847),I=r(83047),P=r(58083),O=r(87317),M=r(70328),R=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var T=r(37585),F=r(48163),D=r(34727),z=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const j=[];{const e=16;for(let t=0;t<360;t+=360/e)j.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}Object.freeze({left:0,center:.5,right:1});const B=Object.freeze({"bottom-left":(0,F.fA)(0,0),bottom:(0,F.fA)(.5,0),"bottom-right":(0,F.fA)(1,0),left:(0,F.fA)(0,.5),center:(0,F.fA)(.5,.5),right:(0,F.fA)(1,.5),"top-left":(0,F.fA)(0,1),top:(0,F.fA)(.5,1),"top-right":(0,F.fA)(1,1)});var E=r(9762),L=r(27993);function U(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function V(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function H(e,t){const r=t.viewSpatialReference,n=t.renderSpatialReference,{extent:i}=e,o=(0,R.gX)(i),s=(0,w.vt)();return(0,L.F)([o[0],o[1],0],r,s,n),s}var G=r(97146);function k(e){const t=new Map;for(const[r,n]of e)t.set(r,{...n,indices:(0,G.Dg)(n.indices)});return t}var q=r(40804);r(48833);const $=(0,A.CN)(.25,.25,.75,.75);function N(e){return"cross"===e||"x"===e}function Y(e,t=128,r=.5*t,n=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return J(e,Z(r,r,t/2))}(t,r);case"square":return function(e,t){return X(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return W(e,t,!1,r)}(t,r,n);case"x":return function(e,t,r=0){return W(e,t,!0,r)}(t,r,n);case"kite":return function(e,t){return X(e,t,!0)}(t,r);case"triangle":return function(e,t){return J(e,Q(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,n=t/2,i=e/2,o=.8*r,s=Z(i,(e-t)/2-o,Math.sqrt(o*o+n*n)),a=Q(i,r,n);return J(e,(e,t)=>Math.max(a(e,t),-s(e,t)))}(t,r)}}function X(e,t,r){return r&&(t/=Math.SQRT2),J(e,(n,i)=>{let o=n-.5*e+.25,s=.5*e-i-.75;if(r){const e=(o+s)/Math.SQRT2;s=(s-o)/Math.SQRT2,o=e}return Math.max(Math.abs(o),Math.abs(s))-.5*t})}function W(e,t,r,n=0){t-=n,r&&(t*=Math.SQRT2);const i=.5*t;return J(e,(t,o)=>{let s,a=t-.5*e,l=.5*e-o-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),s=a>l?a>i?Math.sqrt((a-i)*(a-i)+l*l):l:l>i?Math.sqrt(a*a+(l-i)*(l-i)):a,s-=n/2,s})}function Z(e,t,r){return(n,i)=>{const o=n-e,s=i-t;return Math.sqrt(o*o+s*s)-r}}function Q(e,t,r){const n=Math.sqrt(t*t+r*r);return(i,o)=>{const s=Math.abs(i-e)-r,a=o-e+t/2+.75,l=(t*s+r*a)/n,c=-a;return Math.max(l,c)}}function J(e,t){const r=new Uint8Array(4*e*e);for(let n=0;n<e;n++)for(let i=0;i<e;i++){const o=i+e*n;let s=t(i,n);s=s/e+.5,(0,q.U)(s,r,4*o)}return r}var K=r(46610);class ee{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.createTexture(()=>function(e,t=128,r=.5*t,n=0){return{data:Y(e,t,r,n),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle"));this._iconTextureID=t;const r={anchorPosition:B.center,occlusionTest:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:$,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:N("circle")};this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r;if(null==t)throw new Error("expected material not to be null");const i=await this._createGeometry(e);if(null==i)return r.createPipelineCommand();const o=H(e,r);return r.createPipelineCommand(n.addDirectRendererGeometry(e.id,i,o))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:n}=r,{featureCount:i}=e;if(0===i||null==t)return null;const o=U(e),s=V(e),a=function(e,t){const r=e.length/3,n=t.viewSpatialReference,i=t.renderSpatialReference,o=new Float64Array(3*r);if(!(0,E.projectBuffer)(e,n,0,o,i,0,r))throw new Error("Failed to project coordinates");return o}(await n.applyElevationAlignmentTo(s),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),d=new Float64Array([24,24]),u=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),m=new Uint32Array(i);for(let e=0;e<i;++e)m[e]=e;const p=new Uint32Array(i);for(let e=0;e<i;++e)p[e]=0;const g=[["position",new K.n(a,m,3,!0)],["normal",new K.n(l,p,3,!0)],["uv0",new K.n(h,p,2,!0)],["color",new K.n(c,p,4,!0)],["rotation",new K.n(f,p,1,!0)],["size",new K.n(d,p,2,!0)],["centerOffsetAndDistance",new K.n(u,p,4,!0)]],y=new Uint8Array(i);return e.getVisibilityArray(y),{attributes:k(g),objectAndLayerIdColor:void 0,transformation:(0,C.vt)(),materialId:t,objectIds:o,visibilities:y}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(n.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:n}=r,{featureCount:i,id:o}=e;if(null==t||0===i)return r.createPipelineCommand();const s=await this._createGeometry(e);if(null==s)return r.createPipelineCommand();const a=H(e,r);return r.createPipelineCommand(n.updateDirectRendererGeometry(o,s,a))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let n;return n=null!=e?await r.releaseTexture(e):g.create(r),n.appendPipelineStateCommand(()=>this._destroy()),n}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=y.A.toUnitRGB(r),n=r.a*e;return[t[0],t[1],t[2],n]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return re;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=te){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=te){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const n=(0,A.o8)(A.Un);return null!=e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],e.length>3&&(n[3]=e[3])),null!=t&&(n[3]=t),r&&(0,O.d)(n,n,r),n}(null!=e?y.A.toUnitRGB(e):w.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??S.r;var e}}const te={hasIntrinsicColor:!1},re=A.uY;class ne{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,n=[];for(const i of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(i);null!=t&&(n.push(t.load()),r.push(t))}await Promise.all(n),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const n=e.joinPipelineCommands(await Promise.all(r));return n.appendPipelineStateCommand(()=>this._destroy()),n}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(n))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,n=[];for(const t of r)n.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(n))}}class ie{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createAddCommand(e);return n.appendPipelineStateCommand(()=>this._featureData.set(e.id,e)),n}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),n=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return n.appendPipelineStateCommand(()=>this._featureData.delete(e)),n}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const n=[];for(const t of e.values())n.push(r.createUpdateElevationCommand(t));const i=await Promise.all(n);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const n=[];for(const e of r.keys())n.push(this.createRemoveCommand(e));n.push(e.createDestroyCommand());const i=await Promise.all(n);return t.joinPipelineCommands(i)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var oe=r(48353),se=r(30809),ae=r(8887),le=r(38954),ce=r(72385),de=(r(4197),r(11868)),ue=r(27921),he=(r(71351),r(73941));function fe(e,t){const r=e[t],n=e[t+1],i=e[t+2];return Math.sqrt(r*r+n*n+i*i)}function me(e,t){const r=e[t],n=e[t+1],i=e[t+2],o=1/Math.sqrt(r*r+n*n+i*i);e[t]*=o,e[t+1]*=o,e[t+2]*=o}function pe(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r}r(37539),r(20498),r(87170),(0,F.vt)(),(0,F.vt)();var ge=r(620);const ye=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)ye[6*e+t]=e;const _e=new Array(36);for(let e=0;e<6;e++)_e[6*e]=0,_e[6*e+1]=1,_e[6*e+2]=2,_e[6*e+3]=2,_e[6*e+4]=3,_e[6*e+5]=0;const ve=(0,ce.fA)(-.5,0,-.5),be=(0,ce.fA)(.5,0,-.5),xe=(0,ce.fA)(0,0,.5),Ce=(0,ce.fA)(0,.5,0),we=(0,ce.vt)(),Ae=(0,ce.vt)(),Se=(0,ce.vt)(),Ie=(0,ce.vt)(),Pe=(0,ce.vt)();(0,le.d)(we,ve,Ce),(0,le.d)(Ae,ve,be),(0,le.h)(Se,we,Ae),(0,le.n)(Se,Se),(0,le.d)(we,be,Ce),(0,le.d)(Ae,be,xe),(0,le.h)(Ie,we,Ae),(0,le.n)(Ie,Ie),(0,le.d)(we,xe,Ce),(0,le.d)(Ae,xe,ve),(0,le.h)(Pe,we,Ae),(0,le.n)(Pe,Pe),Se[0],Se[1],Se[2],Ie[0],Ie[1],Ie[2],Pe[0],Pe[1],Pe[2],(0,w.vt)();var Oe=r(4576),Me=r(69397);r(6867),r(87582);var Re=r(57917);function Te(e,t){const r=(e,r,n=!1)=>({levels:e.map(e=>{const i=k(r(e.tesselation));return n&&function(e){const t=e,r=t.get("position").data,n=t.get("normal").data;if(n){const t=Fe(e,"normal").data;for(let e=0;e<n.length;e+=3){const r=n[e+1];t[e+1]=-n[e+2],t[e+2]=r}}if(r){const t=Fe(e,"position").data;for(let e=0;e<r.length;e+=3){const n=r[e+1];t[e+1]=-r[e+2],t[e+2]=n}}}(i),{components:[{attributes:i,objectAndLayerIdColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}})});switch(e){case"cone":return r(De,e=>function(e,t,r,n,i=!0,o=!0){let s=0;const a=t,l=e;let c=(0,ce.fA)(0,s,0),d=(0,ce.fA)(0,s+l,0),u=(0,ce.fA)(0,-1,0),h=(0,ce.fA)(0,1,0);n&&(s=l,d=(0,ce.fA)(0,0,0),c=(0,ce.fA)(0,s,0),u=(0,ce.fA)(0,1,0),h=(0,ce.fA)(0,-1,0));const f=[d,c],m=[u,h],p=r+2,g=Math.sqrt(l*l+a*a);if(n)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),n=(0,ce.fA)(Math.cos(t)*a,s,Math.sin(t)*a);f.push(n);const i=(0,ce.fA)(l*Math.cos(t)/g,-a/g,l*Math.sin(t)/g);m.push(i)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),n=(0,ce.fA)(Math.cos(t)*a,s,Math.sin(t)*a);f.push(n);const i=(0,ce.fA)(l*Math.cos(t)/g,a/g,l*Math.sin(t)/g);m.push(i)}const y=new Array,_=new Array;if(i){for(let e=3;e<f.length;e++)y.push(1),y.push(e-1),y.push(e),_.push(0),_.push(0),_.push(0);y.push(f.length-1),y.push(2),y.push(1),_.push(0),_.push(0),_.push(0)}if(o){for(let e=3;e<f.length;e++)y.push(e),y.push(e-1),y.push(0),_.push(e),_.push(e-1),_.push(1);y.push(0),y.push(2),y.push(f.length-1),_.push(1),_.push(2),_.push(m.length-1)}const v=(0,de.oe)(3*p);for(let e=0;e<p;e++)v[3*e]=f[e][0],v[3*e+1]=f[e][1],v[3*e+2]=f[e][2];const b=(0,de.oe)(3*p);for(let e=0;e<p;e++)b[3*e]=m[e][0],b[3*e+1]=m[e][1],b[3*e+2]=m[e][2];return[["position",new K.n(v,y,3,!0)],["normal",new K.n(b,_,3,!0)]]}(1,.5,e,!1),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>function(e,t,r){const n=e;let i,o;if(r)i=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],o=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=n*(1+Math.sqrt(5))/2;i=[-n,e,0,n,e,0,-n,-e,0,n,-e,0,0,-n,e,0,n,e,0,-n,-e,0,n,-e,e,0,-n,e,0,n,-e,0,-n,-e,0,n],o=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<i.length;t+=3)pe(i,t,e/fe(i,t));let s={};function a(t,r){t>r&&([t,r]=[r,t]);const n=t.toString()+"."+r.toString();if(s[n])return s[n];let o=i.length;return i.length+=3,function(e,t,r,n,i,o=t){(i=i||e)[o]=e[t]+r[n],i[o+1]=e[t+1]+r[n+1],i[o+2]=e[t+2]+r[n+2]}(i,3*t,i,3*r,i,o),pe(i,o,e/fe(i,o)),o/=3,s[n]=o,o}for(let e=0;e<t;e++){const e=o.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=o[r],n=o[r+1],i=o[r+2],s=a(e,n),l=a(n,i),c=a(i,e),d=4*r;t[d]=e,t[d+1]=s,t[d+2]=c,t[d+3]=n,t[d+4]=l,t[d+5]=s,t[d+6]=i,t[d+7]=c,t[d+8]=l,t[d+9]=s,t[d+10]=l,t[d+11]=c}o=t,s={}}const l=(0,de.Wz)(i);for(let e=0;e<l.length;e+=3)me(l,e);return[["position",new K.n((0,de.Wz)(i),o,3,!0)],["normal",new K.n(l,o,3,!0)]]}(.5,e,!0));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Fe(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Re.S)(r.data)},e.set(t,r)),r}const De=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var ze=r(88076),je=r(74810);class Be{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:je.Bt,ambient:w.Un,diffuse:w.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=A.Un,r.isInstanced=!0,this._isPrimitive){const e=new ze.fs;e.layerOpacity=t,r={...r,cullFace:Ee((0,ze.ty)(e))}}const n=await e.createMaterial({type:"default",parameters:r}),i=this._symbolLayer.resource;this._primitive=i&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(i?.primitive)?i.primitive:se.r;const o=Te(this._primitive,n);this._lodRendererId=await e.createLodRenderer(o),this._primitiveMaterialId=n,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,n=r.renderCommandContext,i=[];return null!=e&&i.push(n.destroyLodRenderer(e)),null!=t&&i.push(n.destroyMaterial(t)),new g(n,n.mergeRenderCommandBuffers(i),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:n}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:i}=e;if(0===i)return t.createPipelineCommand();const o=this._isPrimitive,s=this._primitive||se.r,a=(0,M.vt)((0,ae.Fq)(s)),l=(0,w.ci)((0,M.Ej)(a)),c=(0,w.ci)((0,ae.Bb)(l,{isPrimitive:o,width:100,depth:null,height:null})),d=new Float64Array(16*i),u=new Float64Array(16*i),h=V(e),f=await n.applyElevationAlignmentTo(h);for(let e=0;e<i;++e){const t=e,r=f[3*e+0],n=f[3*e+1],i=f[3*e+2],o=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ve),s=this._computeLocalTransform(c,l,Ue);this._writeMatrixToTypedBuffer(d,t,s),this._writeMatrixToTypedBuffer(u,t,o)}const m=U(e),p=new Uint8Array(i);e.getVisibilityArray(p);const g={featureIds:new Uint32Array(m),visibility:p,localTransforms:d,globalTransforms:u};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,g))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,n=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(n.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,n=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const i=new Uint8Array(e.featureCount);return e.getVisibilityArray(i),r.createPipelineCommand(n.updateVisibility(t,e.id,i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,n=this._primitiveMaterialId;if(null==n)return t.createPipelineCommand();const i=this._getLayerOpacity();let o={layerOpacity:i};if(this._isPrimitive){const e=new ze.fs;e.layerOpacity=i,o={...o,cullFace:Ee((0,ze.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:n,parameters:o}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:n,mainThreadDelegate:i}=t,{featureCount:o,id:s}=e;if(null==r||0===o)return t.createPipelineCommand();const a=new Float64Array(16*o),l=V(e),c=await i.applyElevationAlignmentTo(l);for(let e=0;e<o;++e){const t=e,r=c[3*e+0],n=c[3*e+1],i=c[3*e+2],o=this._computeGlobalTransform(r,n,i,this._context.viewSpatialReference,Ve);this._writeMatrixToTypedBuffer(a,t,o)}return t.createPipelineCommand(n.updateLodInstancesData(r,s,a))}_writeMatrixToTypedBuffer(e,t,r){let n=16*t;for(let t=0;t<16;t++)e[n++]=r[t]}_computeGlobalTransform(e,t,r,n,i){return Le[0]=e,Le[1]=t,Le[2]=r,(0,oe.l)(n,Le,i,this._context.renderSpatialReference),i}_computeLocalTransform(e,t,r){return(0,P.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const n=function(e=w.Un,t,r,n=1){const i=new Array(3);if(null==t||null==r)i[0]=1,i[1]=1,i[2]=1;else{let n,o=0;for(let s=2;s>=0;s--){const a=e[s],l=null!=a,c=0===s&&!n&&!l,d=r[s];let u;"symbol-value"===a||c?u=0!==d?t[s]/d:1:l&&"proportional"!==a&&isFinite(a)&&(u=0!==d?a/d:1),null!=u&&(i[s]=u,n=u,o=Math.max(o,Math.abs(u)))}for(let e=2;e>=0;e--)null==i[e]?i[e]=n:0===i[e]&&(i[e]=.001*o)}for(let e=2;e>=0;e--)i[e]/=n;return(0,w.ci)(i)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===n[0]&&1===n[1]&&1===n[2]||(0,P.hs)(r,r,n)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function Ee(e){return e?0:2}const Le=(0,w.vt)(),Ue=(0,C.vt)(),Ve=(0,C.vt)();class He{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new ee(x(),this._context),this._symbols[1]=new Be(new v.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),n=await Promise.all(r.map(async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))})),i=t.joinPipelineCommands(n);return i.appendPipelineStateCommand(()=>this._featureDataPartitioning.set(e.id,r)),i}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const o=await Promise.all(i.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})),s=r.joinPipelineCommands(o);return s.appendPipelineStateCommand(()=>t.delete(e)),s}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,n=r.renderCommandContext,i=t.get(e.id);if(null==i)return new g(n,n.createRenderCommandBuffer(),[]);const o=await Promise.all(i.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))}));return r.joinPipelineCommands(o)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const n=this._symbols[t];null!=n&&n.loaded&&r.push(n.createUpdateLayerViewOpacityCommand(e))}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))});r.push(...e)}const n=await Promise.all(r);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const n=await Promise.all(r);return t.joinPipelineCommands(n)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=U(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,n=[[],[]];for(let e=0;e<r;++e)n[t[e]%2].push(e);return n.map((t,r)=>new Ge(r,e.subset(new Uint32Array(t)))).filter(e=>e.features.featureCount>0)}}class Ge{constructor(e,t){this.index=e,this.features=t}}class ke{constructor(e,t,r,n,i,o,s){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=n,this.renderCommandContext=i,this.layerInfo=o,this.layerViewInfo=s,this.symbolRendererFactory=new qe(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new g(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter(e=>null!=e).reduce((e,t)=>(e.append(t),e))}}class qe{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,p.L)(e??$e)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new ie(t,this.context);case"unique-value":return new He(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON($e)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new ne(e,this.context);case"picture-marker":case"simple-marker":return new ee(x(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new ee(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const $e={type:"simple"};var Ne=r(69622),Ye=r(60999),Xe=r(32587),We=r(11932),Ze=r(24326);function Qe(e=""){return`${e}${(0,Ze.c)()}`}new Float64Array(3);class Je{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=Qe(`featureDataSubset-${e.id}-`)}get tileId(){return this._parent.tileId}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Me.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let n=0;n<r.length;++n)r[n]=t[e[n]];return new Je(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let n=0;n<t;++n)this.getEnabled(n)&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class Ke{constructor(e){this._tile=e,this.id=Qe(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get tileId(){return this._tile.id}get featureCount(){return this._tile.featureCount}get usedMemory(){return Me.qK+(0,Me.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every(e=>e)}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new Je(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const n of this._allFeatureIndices())t[n]&&e.has(this.getObjectId(n))&&r.push(n);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:n}=this;for(const i of t)e[r++]=Number(n[i]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let et=class extends Ne.A{constructor(e){super(e),this.extent=null,this._tileHandles=new Xe.A,this._wanted=new Xe.A,this._updateRequested=!1,this._synchronizationTask=null,this._requestedTiles=new Array}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updateRequested||!(this._synchronizationTask?.finished??1)}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,R.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const n of t.values())null==r.get(n.id)?.featureData&&e.push(n);return e}onTileTreeChange({tiles:e}){this._requestedTiles=e,this._scheduleTilesSync()}_scheduleTilesSync(){if(this._updateRequested)return;this._updateRequested=!0;const e=this._synchronizationTask,t=(0,Ye.UT)(async()=>{try{await(0,s.C_)(()=>e?.finished??!0),await(0,We.NO)(),this._updateRequested=!1,await this._synchronizeTiles()}finally{this._synchronizationTask===t&&(this._synchronizationTask=null)}});this._synchronizationTask=t}async _synchronizeTiles(){const e=this._requestedTiles,t=this._tileHandles,r=new Array;for(const n of e)t.has(n.id)||r.push(n);const n=new Array;for(const r of t.values()){const{id:t}=r;e.every(e=>e.id!==t)&&n.push(r.descriptor)}const i=this._tileHandles,{_boundingRect:o}=this,s=null!=o?r.filter(e=>!e.extent||(0,R.HY)(o,e.extent)):r,a=this._wanted,l=new Array;for(const{id:e}of n)a.delete(e);for(const e of s)a.set(e.id,e);const c=this._missingTiles;for(const e of n){const{id:t}=e;if(c.some(t=>tt(t,e)||tt(e,t)))continue;const r=i.get(t);null!=r&&l.push(this._removeTile(r))}for(const e of s)l.push(this._addTile(e));const d=await Promise.allSettled(l);for(const e of d)"rejected"===e.status&&console.error(e.reason)}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}*loadedTiles(){for(const e of this._tileHandles.values()){const t=e.featureData;null!=t&&(yield t)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;if(null!=t){const e={stack:[],error:void 0,hasError:!1};try{(0,n.mS)(e,await this.tileLocks.lock([t.tileId]),!1);const r=await this.createRemoveCommand(t.id);await(r?.execute())}catch(t){e.error=t,e.hasError=!0}finally{(0,n.hk)(e)}}}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!nt(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const n=new rt(e,(0,Ye.UT)(async t=>{const r=await this.loadTile(e,t);return(0,o.Te)(t),new Ke(r)}));this._tileHandles.set(n.id,n);try{await n.loadTask.promise}catch(e){return void(0,o.jH)(e)}(function(e){if(!nt(e))throw new Error})(n),await this._onTileLoad(n)}async _onTileLoad(e){const t={stack:[],error:void 0,hasError:!1};try{const{_wanted:r,_tileHandles:i,_missingTiles:o}=this,s=e.descriptor,a=new Array,l=new Array,c=new Array,d=new Set;for(const t of i.values()){if(t===e)continue;const{descriptor:n,id:c}=t;if(!r.has(c)&&!o.some(e=>tt(e,n)||tt(n,e))){i.delete(c),t.loadTask.abort();const{featureData:e}=t;null!=e&&a.push(e);continue}if(nt(t)){if(tt(s,n)){const e=t.featureData;for(const t of e.objectIds())d.add(t)}if(tt(n,s)){const{featureData:e}=t;l.push(e)}}}d.size>0&&(e.featureData.disableObjectIds(d),this._validateRemoval(e.featureData,d)),this._validate(),c.push(e.featureData);const u=[...c,...a,...l].map(e=>e.tileId);if((0,n.mS)(t,await this.tileLocks.lock(u),!1),0!==l.length){const t=e.featureData,r=new Set(t.objectIds());for(const e of l)e.disableObjectIds(r),this._validateRemoval(e,r)}const h=a.map(e=>this.createRemoveCommand(e.id)),f=c.map(e=>this.createAddCommand(e)),m=l.map(e=>this.createUpdateCommand(e)),p=function(e){return 0===e.length?null:e.reduce((e,t)=>(e.append(t),e))}((await Promise.all([...h,...f,...m])).filter(Oe.Ru));await(p?.execute())}catch(e){t.error=e,t.hasError=!0}finally{(0,n.hk)(t)}}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!nt(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:n}=e[t];for(let i=t+1;i<e.length;++i){const{featureData:t,objectIds:o}=e[i];for(const e of o)if(n.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function tt({lij:[e,t,r]},{lij:[n,i,o]}){const s=n-e;return s>=0&&t===i>>s&&r===o>>s}(0,n.Cg)([(0,a.MZ)()],et.prototype,"updating",null),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"loadTile",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"createAddCommand",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"createRemoveCommand",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"createUpdateCommand",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],et.prototype,"tileLocks",void 0),(0,n.Cg)([(0,a.MZ)()],et.prototype,"extent",void 0),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_boundingRect",null),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_missingTiles",null),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_updateRequested",void 0),(0,n.Cg)([(0,a.MZ)()],et.prototype,"_synchronizationTask",void 0),et=(0,n.Cg)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],et);class rt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function nt(e){return null!=e.featureData}var it=r(36563);class ot{constructor(){this._previousActions=new Map}async lock(e){const{_previousActions:t}=this,r=e.map(e=>t.get(e)).filter(Oe.Ru),n=Promise.allSettled(r),i=(0,o.Tw)(),s=(0,it.hA)(()=>i.resolve()),a=i.promise.finally(()=>{for(const r of e)t.get(r)===a&&t.delete(r)});for(const r of e)t.set(r,a);return await n,(0,it.Bf)(s)}}var st=r(75503),at=r(27647),lt=r(92722);class ct{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Me.qK+Me.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new dt(this._index,this._view,e)}}class dt extends ct{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,at.Q)(new lt.A,this._geometryOverride,e.hasZ,e.hasM)}}class ut{constructor(e,t){this.featureData=e,this.bounds=t}}class ht{constructor(){this._tileBounds=new Map,this.events=new i.A.EventEmitter,this.featureAdapter=ft.shared}get usedMemory(){return Me.qK+Me.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new st.wq(9,t=>e.getBounds(t)),n=new Array;for(let e=0;e<t;++e)n[e]=e;r.load(n),this._tileBounds.set(e.id,new ut(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all(r=>{t.getEnabled(r)&&e(new ct(r,t))})}forEachInBounds(e,t){mt.minX=e[0],mt.minY=e[1],mt.maxX=e[2],mt.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(mt,r=>{e.getEnabled(r)&&t(new ct(r,e))})}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:o,minY:s,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,o),r=Math.min(r,s),n=Math.min(n,a),i=Math.min(i,l)}return{xmin:t,ymin:r,xmax:n,ymax:i,spatialReference:e}}}class ft{static{this.shared=new ft}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const mt=new st.EC;var pt=r(80893);class gt{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const n=Me.ez+t.reduce((e,{usedMemory:t})=>e+t,0),i=3*Me.RS;this.usedMemory=Me.qK+n+i,this.featureCount=t.reduce((e,t)=>e+t.featureCount,0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttribute(n,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(n,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:n,featurePageIndex:i}=this._translateIndex(e);this._pages[n].getCoordinates(i,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:n}=this._translateIndex(e);return this._pages[r].getCentroid(n,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getObjectIdsArray(e,i,n);return n}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let n=r;for(const{page:r,indices:i}of this._batchPageIndices(t))n=r.getCoordinatesArray(e,i,n);return n}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,n=new Array;for(const i of e){const{pageIndex:e,featurePageIndex:o}=this._translateIndex(i);r!==e&&(0!==n.length&&t.push({pageIndex:r,indices:n}),r=e,n=[]),n.push(o)}0!==n.length&&t.push({pageIndex:r,indices:n})}const{_pages:r}=this;for(const{pageIndex:e,indices:n}of t)yield{page:r[e],indices:n}}}var yt=r(49186),_t=r(51624),vt=r(62577),bt=r(95466),xt=r(53655);class Ct{constructor(e){this._reader=new _t.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return wt(e.getMessage());e.skip()}St()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:n}}=this,i=r.get(t)?.index;if(null==i)return;const o=n[e*r.fields.length+i],s=this._reader;return s.move(o),It(s)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,n=e*t.fields.length,i=this._reader,o={};for(const e of t.fields){const t=r[n+e.index];i.move(t),o[e.name]=It(i)}return o}getCoordinates(e,t,r=0){const n=this._reader,{transform:i,featureIndices:o}=this._index,{scale:s,translate:a}=i;n.move(o[e]),this._readCoordinates(s,a,t,r)}getOptimizedGeometry(e){const t=(0,w.vt)();return this.getCoordinates(e,t),new lt.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Pt);const[n,i,o]=Pt,s=[n,i];return t&&(s[3]=o),r&&(s[t?4:3]=0),new lt.A([],s)}getBounds(e){this.getCoordinates(e,Pt);const[t,r]=Pt,n=new st.EC;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,Pt);const[t,r,n]=Pt;return(0,M.fA)(t,r,n,t,r,n)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{objectIdFieldName:i,attributeIndices:o,fieldsIndex:s}=this._index,a=s.get(i).index,l=s.fields.length;for(const i of t){const t=o[i*l+a];n.move(t),e[r++]=It(n)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const n=this._reader,{transform:i,featureIndices:o}=this._index,{scale:s,translate:a}=i;for(const i of t){const t=o[i];n.move(t),r=this._readCoordinates(s,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:n,fieldsIndex:i}=this._index,o=i.get(r).index,s=i.fields.length;for(const r of e){const e=n[r*s+o];t.move(e),yield It(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[n,i,o],s,a){const l=this._reader,c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),d=l.pos()+c;for(;l.pos()<d&&l.next();)3===l.tag()?(l.getUInt32(),s[a++]=n+e*l.getSInt64(),s[a++]=i+t*l.getSInt64(),s[a++]=o+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function wt(e){for(;e.next();){if(1===e.tag())return At(e.getMessage());e.skip()}St()}function At(e){let t,r,n=!1,i=!1,o=0;const s=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&St();break;case 9:n=e.getBool()??!1;break;case 12:t=(0,vt.Q1)(e.processMessage(xt.ae));break;case 13:{const t=e.processMessage(xt.cn);t.index=o++,s.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:i=e.getBool()??!1;break;default:e.skip()}const c=new bt.A(s);return null!=t&&i&&null!=r&&c.has(r)||St(),{transform:t,exceededTransferLimit:n,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function St(){const e=new yt.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function It(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&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}const Pt=(0,w.vt)();class Ot{constructor(e,t,r,n,i){this.spatialReference=e,this.url=r,this.objectIdField=n,this.capabilities=i;const{supportsMaxRecordCountFactor:o,maxRecordCount:s}=this.capabilities.query,a=o?4:1,l=(s??8e3)*a;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=a,c.num=this._pageSize,c.outFields=[n],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:n}=this,i=(0,R.w1)(e.extent,r),s=this._baseQuery.clone();s.geometry=i;const a=new Array;let l=0,c=!1,d=1;for(;!c;){const e=[];for(let r=0;r<d;++r)e.push(this._fetchPage(s,l++,t));const r=await Promise.all(e);(0,o.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&a.push(e)}d=Math.min(d+1,4)}return new gt(e,a,n)}async _fetchPage(e,t,r){const n=e.clone();n.start=t*this._pageSize;const i=(await(0,pt.kS)(this.url,n,{signal:r})).data;return(0,o.Te)(r),new Ct(i)}}var Mt=r(29920),Rt=r(77690),Tt=r(29242);var Ft=r(13030),Dt=r(78662),zt=r(1843),jt=r(49255),Bt=r(40268),Et=r(16943),Lt=r(25634),Ut=r(11725),Vt=r(77194);class Ht{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var Gt=r(59907),kt=r(43616),qt=r(13259),$t=r(97220),Nt=r(98958),Yt=r(33524),Xt=r(63907),Wt=r(90644);class Zt extends Nt.w{constructor(e,t){super(e,t,new $t.$(qt.H,()=>r.e(8241).then(r.bind(r,48241)))),this.primitiveType=t.occlusionPass?Xt.WR.POINTS:Xt.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:n,output:i,depthTestEnabled:o,occlusionPass:s}=e,a=0===t,l=o&&!n&&!(1===t)&&!s&&!(8===i);return(0,Wt.Ey)({blending:(0,jt.RN)(i)?a?Wt.RC:(0,Yt.ez)(t):null,depthTest:o&&!n?{func:515}:null,depthWrite:l?Wt.Uy:null,drawBuffers:(0,Yt.m6)(t,i),colorWrite:Wt.kn,polygonOffset:r?Qt:null})}}const Qt={factor:0,units:-4};var Jt=r(51976),Kt=r(35256);class er extends Kt.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.textureCoordinateType=0,this.emissionSource=0,this.discardInvisibleFragments=!0,this.hasVvInstancing=!1,this.snowCover=!1}}(0,n.Cg)([(0,Jt.W)()],er.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"occlusionTestEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"signedDistanceFieldEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"vvSize",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"vvColor",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasVerticalOffset",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasScreenSizePerspective",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasRotation",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"debugDrawLabelBorder",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"hasPolygonOffset",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"depthTestEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"pixelSnappingEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"draped",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"terrainDepthTest",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"cullAboveTerrain",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"occlusionPass",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"occludedFragmentFade",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"objectAndLayerIdColorInstanced",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"horizonCullingEnabled",void 0),(0,n.Cg)([(0,Jt.W)()],er.prototype,"isFocused",void 0);var tr=r(49788);class rr extends Ut.i{constructor(e,t){super(e,Ir),this.produces=new Map([[12,e=>(0,jt.Mb)(e)&&!this.parameters.drawAsLabel],[13,e=>(0,jt.Mb)(e)&&this.parameters.drawAsLabel],[11,()=>this.parameters.occlusionTest],[17,e=>this.parameters.draped&&(0,jt.Mb)(e)]]),this._visible=!0,this._configuration=new er(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=11===t.slot,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||11===t.slot,(0,jt.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!z.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,n,i,o){const{options:{selectionMode:s,hud:a,excludeLabels:l},point:c,camera:d}=r,{parameters:u}=this;if(!s||!a||l&&u.isLabel||!e.visible||!c||!d)return;const h=e.attributes.get("featureAttribute"),f=null==h?null:(0,A.ci)(h.data,br),{scaleX:m,scaleY:p}=Rr(f,u,d.pixelRatio);(0,Rt.z0)(mr,t),e.attributes.has("featureAttribute")&&function(e){const t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+n*n),u=1/Math.sqrt(i*i+o*o+s*s),h=1/Math.sqrt(a*a+l*l+c*c);e[0]=t*d,e[1]=r*d,e[2]=n*d,e[3]=i*u,e[4]=o*u,e[5]=s*u,e[6]=a*h,e[7]=l*h,e[8]=c*h}(mr);const g=e.attributes.get("position"),y=e.attributes.get("size"),_=e.attributes.get("normal"),v=e.attributes.get("rotation"),b=e.attributes.get("centerOffsetAndDistance");(0,ge.vA)(g.size>=3);const x=(0,qt.c)(u),C="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<g.data.length/g.size;e++){const n=e*g.size;(0,le.i)(ar,g.data[n],g.data[n+1],g.data[n+2]),(0,le.t)(ar,ar,t),(0,le.t)(ar,ar,d.viewMatrix);const i=e*b.size;if((0,le.i)(_r,b.data[i],b.data[i+1],b.data[i+2]),!C&&(ar[0]+=_r[0],ar[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,le.n)(_r,ar),(0,le.d)(ar,ar,(0,le.g)(_r,_r,e))}const s=e*_.size;if((0,le.i)(lr,_.data[s],_.data[s+1],_.data[s+2]),ir(lr,mr,d,xr),Tr(this.parameters,ar,xr,d,sr),d.applyProjection(ar,cr),cr[0]>-1){C&&(_r[0]||_r[1])&&(cr[0]+=_r[0]*d.pixelRatio,0!==_r[1]&&(cr[1]+=(0,Vt.m0)(_r[1],sr.factorAlignment)*d.pixelRatio),d.unapplyProjection(cr,ar)),cr[0]+=this.parameters.screenOffset[0]*d.pixelRatio,cr[1]+=this.parameters.screenOffset[1]*d.pixelRatio,cr[0]=Math.floor(cr[0]),cr[1]=Math.floor(cr[1]);const t=e*y.size;Ar[0]=y.data[t],Ar[1]=y.data[t+1],(0,Vt.MD)(Ar,sr.factor,Ar);const n=Cr*d.pixelRatio;let i=0;u.textureIsSignedDistanceField&&(i=Math.min(u.outlineSize,.5*Ar[0])*d.pixelRatio/2),Ar[0]*=m,Ar[1]*=p;const s=e*v.size,a=u.rotation+v.data[s];if(or(c,cr[0],cr[1],Ar,n,i,a,u,x)){const e=r.ray;if((0,le.t)(ur,ar,(0,P.B8)(gr,d.viewMatrix)),cr[0]=c[0],cr[1]=c[1],d.unprojectFromRenderScreen(cr,ar)){const t=(0,w.vt)();(0,le.c)(t,e.direction);const r=1/(0,le.l)(t);(0,le.g)(t,t,r),o((0,le.j)(e.origin,ar)*r,t,-1,ur)}}}}}intersectDraped(e,t,r,n,i){const o=e.attributes.get("position"),s=e.attributes.get("size"),a=e.attributes.get("rotation"),l=this.parameters,c=(0,qt.c)(l),d=e.attributes.get("featureAttribute"),u=null==d?null:(0,A.ci)(d.data,br),{scaleX:h,scaleY:f}=Rr(u,l,e.screenToWorldRatio),m=wr*e.screenToWorldRatio;for(let t=0;t<o.data.length/o.size;t++){const d=t*o.size,u=o.data[d],p=o.data[d+1],g=t*s.size;Ar[0]=s.data[g],Ar[1]=s.data[g+1];let y=0;l.textureIsSignedDistanceField&&(y=Math.min(l.outlineSize,.5*Ar[0])*e.screenToWorldRatio/2),Ar[0]*=h,Ar[1]*=f;const _=t*a.size,v=l.rotation+a.data[_];or(r,u,p,Ar,m,y,v,l,c)&&n(i.distance,i.normal,-1)}}createBufferWriter(){return new Mr}applyShaderOffsetsView(e,t,r,n,i,o,s){const a=ir(t,r,i,xr);return this._applyVerticalGroundOffsetView(e,a,i,s),Tr(this.parameters,s,a,i,o),this._applyPolygonOffsetView(s,a,n[3],i,s),this._applyCenterOffsetView(s,n,s),s}applyShaderOffsetsNDC(e,t,r,n,i){return this._applyCenterOffsetNDC(e,t,r,n),null!=i&&(0,le.c)(i,n),this._applyPolygonOffsetNDC(n,t,r,n),n}_applyPolygonOffsetView(e,t,r,n,i){const o=n.aboveGround?1:-1;let s=Math.sign(r);0===s&&(s=o);const a=o*s;if(this.parameters.shaderPolygonOffset<=0)return(0,le.c)(i,e);const l=(0,D.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/n.viewport[2];return(0,le.g)(i,e,a>0?c:1/c),i}_applyVerticalGroundOffsetView(e,t,r,n){const i=(0,le.l)(e),o=r.aboveGround?1:-1,s=r.computeRenderPixelSizeAtDist(i)*Bt.R,a=(0,le.g)(ar,t.normal,o*s);return(0,le.f)(n,e,a),n}_applyCenterOffsetView(e,t,r){const n="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,le.c)(r,e),n&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,le.n)(lr,r),(0,le.a)(r,r,(0,le.g)(lr,lr,t[2])))),r}_applyCenterOffsetNDC(e,t,r,n){const i="screen"!==this.parameters.centerOffsetUnits;return n!==e&&(0,le.c)(n,e),i||(n[0]+=t[0]/r.fullWidth*2,n[1]+=t[1]/r.fullHeight*2),n}_applyPolygonOffsetNDC(e,t,r,n){const i=this.parameters.shaderPolygonOffset;if(e!==n&&(0,le.c)(n,e),i){const e=r.aboveGround?1:-1,o=e*Math.sign(t[3]);n[2]-=(o||e)*i}return n}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,n=e[3]>=tr.Q||t>=tr.Q&&r[3]>=tr.Q;return this._visible&&n}createGLMaterial(e){return new nr(e)}calculateRelativeScreenBounds(e,t,r=(0,R.vt)()){return function(e,t,r,n){n[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,n[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class nr extends Lt.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(Zt,e)}}function ir(e,t,r,n){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,Rt.z0)(pr,t)),(0,le.o)(n.normal,e,t),(0,le.t)(n.normal,n.normal,r.viewInverseTransposeMatrix),n.cosAngle=(0,le.e)(dr,Sr),n}function or(e,t,r,n,i,o,s,a,l){let c=t-i-n[0]*l[0],d=c+n[0]+2*i,u=r-i-n[1]*l[1],h=u+n[1]+2*i;const f=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=f&&(c+=n[0]*f[0],u+=n[1]*f[1],d-=n[0]*(1-f[2]),h-=n[1]*(1-f[3]),c-=o,d+=o,u-=o,h+=o),(0,T.hZ)(fr,t,r),(0,T.e$)(hr,e,fr,(0,D.kU)(s)),hr[0]>c&&hr[0]<d&&hr[1]>u&&hr[1]<h}const sr=new class{constructor(){this.factor=new Ht,this.factorAlignment=new Ht}},ar=(0,w.vt)(),lr=(0,w.vt)(),cr=(0,A.vt)(),dr=(0,w.vt)(),ur=(0,w.vt)(),hr=(0,F.vt)(),fr=(0,F.vt)(),mr=(0,Tt.vt)(),pr=(0,Tt.vt)(),gr=(0,C.vt)(),yr=(0,A.vt)(),_r=(0,w.vt)(),vr=(0,w.vt)(),br=(0,A.vt)(),xr={normal:dr,cosAngle:0},Cr=1,wr=2,Ar=(0,F.fA)(0,0),Sr=(0,w.fA)(0,0,1);class Ir extends Lt.NV{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=(0,A.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,F.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,A.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,A.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}}const Pr=(0,zt.BP)().vec3f("position").vec3f("normal").vec2i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),Or=Pr.clone().vec4u8("objectAndLayerIdColor");class Mr{constructor(){this.vertexBufferLayout=(0,Et.E)()?Or:Pr}elementCount(e){return 6*e.get("position").indices.length}write(e,t,r,n,i,o){const{position:s,normal:a,uvi:l,color:c,size:d,rotation:u,centerOffsetAndDistance:h,featureAttribute:f}=i;(0,Gt.Hk)(r.get("position"),e,s,o,6),(0,Gt.p1)(r.get("normal"),t,a,o,6);const m=r.get("uvi")?.data;let p=0,g=0,y=-1-qt.f,_=-1-qt.f;m&&m.length>=4&&(p=m[0],g=m[1],y=-1-m[2],_=-1-m[3]);let v=r.get("position").indices.length,b=o;for(let e=0;e<v;++e)l.set(b,0,p),l.set(b,1,g),b++,l.set(b,0,y),l.set(b,1,g),b++,l.set(b,0,y),l.set(b,1,_),b++,l.set(b,0,y),l.set(b,1,_),b++,l.set(b,0,p),l.set(b,1,_),b++,l.set(b,0,p),l.set(b,1,g),b++;(0,Gt.tb)(r.get("color"),4,c,o,6);const{data:x,indices:C}=r.get("size");v=C.length,b=o;for(let e=0;e<v;++e){const t=x[2*C[e]],r=x[2*C[e]+1];for(let e=0;e<6;++e)d.set(b,0,t),d.set(b,1,r),b++}if((0,Gt.uO)(r.get("rotation"),u,o,6),r.get("centerOffsetAndDistance")?(0,Gt.Ut)(r.get("centerOffsetAndDistance"),h,o,6):(0,Gt.Pq)(h,o,6*v),r.get("featureAttribute")?(0,Gt.Ut)(r.get("featureAttribute"),f,o,6):(0,Gt.Pq)(f,o,6*v),null!=n){const e=r.get("position")?.indices;if(e){const t=e.length,r=i.getField("objectAndLayerIdColor",Ft.XP);(0,Gt.vx)(n,r,t,o,6)}}return{numVerticesPerItem:6,numItems:v}}intersect(e,t,r,n,i,o,s){const{options:{selectionMode:a,hud:l,excludeLabels:c},point:d,camera:u}=n;if(!a||!l||c&&t.isLabel||!d)return;const h=this.vertexBufferLayout.createView(e),f=h.getField("position",Ft.xs),m=h.getField("normal",Ft.xs),p=h.getField("rotation",Ft.Y$),g=h.getField("size",Ft.gH),y=h.getField("featureAttribute",Ft.Eq),_=h.getField("centerOffsetAndDistance",Ft.Eq),v="screen"===t.centerOffsetUnits,b=(0,qt.c)(t);if(null==f||null==m||null==p||null==g||null==_||null==u)return;const x=null==y?null:y.getVec(0,br),{scaleX:C,scaleY:A}=Rr(x,t,u.pixelRatio),S=f.count/6;for(let e=0;e<S;e++){const i=6*e;if(f.getVec(i,ar),null!=r&&(0,le.f)(ar,ar,r),(0,le.t)(ar,ar,u.viewMatrix),_.getVec(i,yr),(0,le.i)(_r,yr[0],yr[1],yr[2]),!v&&(ar[0]+=_r[0],ar[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,le.n)(_r,ar),(0,le.d)(ar,ar,(0,le.g)(_r,_r,e))}if(m.getVec(i,lr),ir(lr,mr,u,xr),Tr(t,ar,xr,u,sr),u.applyProjection(ar,cr),cr[0]>-1){v&&(_r[0]||_r[1])&&(cr[0]+=_r[0]*u.pixelRatio,0!==_r[1]&&(cr[1]+=(0,Vt.m0)(_r[1],sr.factorAlignment)*u.pixelRatio),u.unapplyProjection(cr,ar)),cr[0]+=t.screenOffset[0]*u.pixelRatio,cr[1]+=t.screenOffset[1]*u.pixelRatio,cr[0]=Math.floor(cr[0]),cr[1]=Math.floor(cr[1]),g.getVec(i,Ar),(0,Vt.MD)(Ar,sr.factor,Ar);const r=Cr*u.pixelRatio;let o=0;t.textureIsSignedDistanceField&&(o=Math.min(t.outlineSize,.5*Ar[0])*u.pixelRatio/2),Ar[0]*=C,Ar[1]*=A;const a=p.get(i),l=t.rotation+a;if(or(d,cr[0],cr[1],Ar,r,o,l,t,b)){const t=n.ray;if((0,le.t)(ur,ar,(0,P.B8)(gr,u.viewMatrix)),cr[0]=d[0],cr[1]=d[1],u.unprojectFromRenderScreen(cr,ar)){const r=(0,w.vt)();(0,le.c)(r,t.direction);const n=1/(0,le.l)(r);(0,le.g)(r,r,n),s((0,le.j)(t.origin,ar)*n,r,e,ur)}}}}}}function Rr(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,Dt.VC)(vr,t,e),{scaleX:vr[0]*r,scaleY:vr[1]*r})}function Tr(e,t,r,n,i){if(!e.verticalOffset?.screenLength)return e.screenSizePerspective||e.screenSizePerspectiveAlignment?Fr(e,i,(0,le.l)(t),r.cosAngle):(i.factor.scale=1,i.factorAlignment.scale=1),t;const o=(0,le.l)(t),s=e.screenSizePerspectiveAlignment??e.screenSizePerspective,a=(0,kt.kE)(n,o,e.verticalOffset,r.cosAngle,s);return Fr(e,i,o,r.cosAngle),(0,le.g)(r.normal,r.normal,a),(0,le.f)(t,t,r.normal)}function Fr(e,t,r,n){null!=e.screenSizePerspective?(0,Vt.cJ)(n,r,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?(0,Vt.cJ)(n,r,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}class Dr{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this.globalViewingMode=1===e}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async createTexture(e){const{data:t,parameters:r}=e();return await this._mainThreadDelegate.createTexture(t,r)}async releaseTexture(e){const t=this._destroyTexture(e);return new g(this,t,[])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,n=Qe("material");let i,o;switch(t){case"default":i=new ze.$U(e.parameters,{spherical:this.globalViewingMode}),o={type:t,materialId:n,parameters:e.parameters};break;case"hud":i=new rr(r,this.globalViewingMode),o={type:t,materialId:n,parameters:e.parameters}}return this._bufferWriters.set(n,i.createBufferWriter()),await this._mainThreadDelegate.createMaterial(o),n}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:o}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(n,e,i,o,r)}updateDirectRendererGeometry(e,t,r){const{materialId:n}=t;if(null==this._bufferWriters.get(n))throw new Error(`no bufferwriter found for material ${n}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:o}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(n,e,i,o,r)}addDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:o,visibilities:s}=n;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,o.buffer,s.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,n,i){const{objectIds:o,visibilities:s}=n;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:n,localOrigin:i}],transferList:[r.data,o.buffer,s.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=Qe("lod-renderer"),r=new Set,n={levels:e.levels.map(e=>({components:e.components.map(e=>{const t=e.attributes.get("position");if(!t||0===t.indices.length)throw new Error("positions attribute expected");const n=(0,G.tM)(t.indices.length/3),i=new Mt.j(n,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:o}=this.createRenderGeometryBuffer(e,null);return r.add(o.data),{materialId:e.materialId,renderGeometryBuffer:o,boundingInfo:{bbMax:i.bbMax,bbMin:i.bbMin}}}),minScreenSpaceRadius:e.minScreenSpaceRadius}))};return await this._mainThreadDelegate.createLodRenderer(t,n,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:n,objectIds:i}=e,o=this._bufferWriters.get(r);if(null==o)throw new Error("no registered bufferWriter for material found");let s=null;if(e.transformation&&t)(0,P.C)(zr,e.transformation),zr[12]-=t[0],zr[13]-=t[1],zr[14]-=t[2],s=zr;else{if(t)throw new Error("not implemented");e.transformation&&(s=e.transformation)}let a=null;s&&((0,P.B8)(jr,zr),(0,P.mg)(jr,jr),a=jr);const l=e.attributes,c=o.elementCount(l),d=o.vertexBufferLayout.stride/4;c>Math.floor(Br/d)&&console.warn("geometry with very large number of elements encountered");const u=o.vertexBufferLayout.createBuffer(c),h=o.write(s,a,l,e.objectAndLayerIdColor,u,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(n.length!==h.numItems||i.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:u.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:i,visibilities:n,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const zr=(0,C.vt)(),jr=(0,C.vt)(),Br=4194304;var Er=r(98764),Lr=r(65806);const Ur=(0,w.vt)();var Vr=r(17352),Hr=r(97937);function Gr(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const kr=2**50;function qr(e,t,r,n){return e.operations.setAltitudeAt(e.value,t,r,n)}function $r(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Nr=(0,w.vt)();(0,w.vt)();var Yr=r(44280),Xr=r(32114);function Wr(e){return"point"===e.type}class Zr{constructor(e,t,r,n){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=n,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(n),this.referenceEllipsoid=(0,he.tO)(t),this.sphericalPCPF=(0,Er.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return e=this._coordinateSystem,t=(0,R.vt)(),e.operations.getExtent(e.value,t),t;var e,t}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return qr(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){var r,n,i,o;r=this._coordinateSystem,i=e,(n=t)!==(o=t)&&(0,P.C)(o,n),(0,le.i)(Nr,o[12],o[13],o[14]),qr(r,Nr,i,Nr),o[12]=Nr[0],o[13]=Nr[1],o[14]=Nr[2]}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,2,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,n){return e.operations.axisAt(e.value,t,r,n)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,0,Xr.rq.get()),n=this.worldBasisAtPosition(e,1,Xr.rq.get()),i=this.worldBasisAtPosition(e,2,Xr.rq.get());return(0,P.hZ)(t,r[0],r[1],r[2],0,n[0],n[1],n[2],0,i[0],i[1],i[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Xr.rq.get()),n=this.worldBasisAtPosition(e,1,Xr.rq.get()),i=(0,Yr.EJ)(t,n,r);return(0,D.KJ)(i)}intersectManifoldClosestSilhouette(e,t,r){return $r(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){$r(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=Xr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,n)?(0,le.c)(r,n):null}intersectInfiniteManifold(e,t,r){if(1===this.viewingMode)return this.intersectManifold(e,t,r);$r(this._coordinateSystem,t,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,i=Xr.rq.get();return(0,ue.Ui)(n.plane,e,i)?(0,le.c)(r,i):null}toRenderCoords(e,t,r){return Wr(e)?(0,Lr.g)(e,t,this.spatialReference):(0,L.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return Wr(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,L.F)(e,t,Ur,r.spatialReference)&&(r.x=Ur[0],r.y=Ur[1],r.z=Ur[2],!0)}(e,this.spatialReference,t)?t:null):(0,L.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case 2:return new Zr(2,t,(0,I.GA)(t),Gr(Vr.b,(0,Vr.f)([0,0,0],[kr,0,0],[0,kr,0])));case 1:return new Zr(1,t,1,function(e){return Gr(Hr.s,(0,Hr.f)(0,0,0,(0,he.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,I.KX)(e)/(0,I.KX)(t)}}let Qr=class extends i.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new ht,this._tileLocks=new ot,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:n,layerViewInfo:i}){const o=h.A.fromJSON(e);this._viewSpatialReference=o;const a=h.A.fromJSON(t);this._fetcher=new Ot(this._viewSpatialReference,m.A.fromJSON(n.baseQuery),n.url,n.objectIdField,n.capabilities),this._queryEngine=new f.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:n.objectIdField},fieldsIndex:n.fieldIndex,availableFields:[n.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:n.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const n={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",n,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const l=Zr.create(r,a),c=new Dr(r,this._mainThreadDelegate);this._renderCommandContext=c;const p=new ke(o,a,this._mainThreadDelegate,l,c,n,i);this._context=p,this._renderer=p.symbolRendererFactory.createSymbolRendererFromJSON(n.renderer),this._defaultQueryJSON=new m.A({outSpatialReference:o}).toJSON();let g=null;if(null!=n.fullExtent){const e=d.A.fromJSON(n.fullExtent);await(0,u.initializeProjection)(e.spatialReference,o),g=(0,u.project)(e,o)}return this._tileManager=new et({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:g}),this.addHandles((0,s.wB)(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),s.Vh),null!=this._renderer&&await this._renderer.load(),Kr}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(Kr)}async onElevationChange(e){return Kr}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return Kr;const n=await r.createUpdateLayerViewOpacityCommand(e);return await n.execute(),Kr}async onRendererChange(e){const{_context:t}=this,r=t.symbolRendererFactory.createSymbolRendererFromJSON(e);await r.load();const i=this._renderer;this._renderer=r;const o=[...this._tileManager.loadedTiles()],s=o.map(e=>e.tileId);{const e={stack:[],error:void 0,hasError:!1};try{(0,n.mS)(e,await this._tileLocks.lock(s),!1);const a=o.flatMap(e=>[i.createRemoveCommand(e.id),r.createAddCommand(e)]),l=await Promise.all(a),c=t.joinPipelineCommands(l);await c.execute()}catch(t){e.error=t,e.hasError=!0}finally{(0,n.hk)(e)}}const a=await i.createDestroyCommand();return await a.execute(),Kr}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,n=this._renderer;let i;return i=null!=n?await n.createAddCommand(e):g.create(this._renderCommandContext),(0,o.Te)(t),i.appendPipelineStateCommand(()=>{r.addTile(e)}),i}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let n;return n=null!=r?await r.createRemoveCommand(e):g.create(this._renderCommandContext),n.appendPipelineStateCommand(()=>{t.removeTile(e)}),n}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let n;return n=null!=r?await r.createUpdateVisibilityCommand(e):g.create(this._renderCommandContext),(0,o.Te)(t),n}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,n.Cg)([(0,a.MZ)()],Qr.prototype,"updating",null),Qr=(0,n.Cg)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Qr);const Jr=Qr,Kr={result:void 0}},77548:(e,t,r)=>{r.d(t,{Gh:()=>p,tk:()=>u,BR:()=>d,wI:()=>c,G$:()=>f,$x:()=>h,Ov:()=>a,W_:()=>l,OP:()=>m,TU:()=>s,XX:()=>o});var n=r(70333),i=r(78888);r(7762),r(84952),r(36563),r(36708),new WeakMap;const o={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function s(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function a(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function c(e,t){const r=n.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const o=e.toLowerCase().indexOf("/rest/services");if(-1===o)return null;const s=`${e.slice(0,o)}/rest/info`,a=null!=t?t.signal:null,{data:l}=await(0,i.A)(s,{query:{f:"json"},responseType:"json",signal:a});return l?.owningSystemUrl||null}function d(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function u(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function h(e,t){return null}function f(e){return null}function m(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function p(e,t){if(!t||!m(e))return;const r=(e.url,null);r&&(e.url=r)}},81961:(e,t,r)=>{r.d(t,{V:()=>i});var n=r(74333);class i extends n.n{constructor(e,t,r){super(e,"vec4",2,(n,i,o)=>n.setUniform4fv(e,t(i,o),r))}}},87582:(e,t,r)=>{r(6867),r(65215).R},95696:(e,t,r)=>{r.d(t,{A:()=>d});var n,i=r(31635),o=r(69540),s=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),c=r(40608);let d=class extends(o.A.ClonableMixin(s.A)){static{n=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new n}};(0,i.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],d.prototype,"type",void 0),(0,i.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],d.prototype,"origin",void 0),d=n=(0,i.Cg)([(0,c.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],d)},96576:(e,t,r)=>{r.d(t,{A:()=>h});var n,i=r(31635),o=r(4718),s=r(10107),a=(r(44208),r(53966),r(93223)),l=r(40608),c=r(92438),d=r(63988),u=r(49849);let h=n=class extends((0,d.h)(c.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new n({description:this.description,label:this.label,symbol:(0,o.o8)(this.symbol),visualVariables:(0,o.o8)(this.visualVariables),authoringInfo:(0,o.o8)(this.authoringInfo)})}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],h.prototype,"description",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],h.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)(u.Wp)],h.prototype,"symbol",void 0),(0,i.Cg)([(0,a.e)({simple:"simple"})],h.prototype,"type",void 0),h=n=(0,i.Cg)([(0,l.$)("esri.renderers.SimpleRenderer")],h)}}]);