@arcgis/core 4.23.0-next.20220119 → 4.23.0-next.20220123

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 (168) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +1 -0
  3. package/assets/esri/core/workers/chunks/199670a3a564ebe3bd79.js +1 -0
  4. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +1 -0
  5. package/assets/esri/core/workers/chunks/{99f0d896c17dd09cd285.js → 2629adf79e7fd9f25f07.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8a250ec51097f16feb66.js → 40a1e713f63ec77110c0.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{4b69129c0557852d9b3d.js → 4c9084a04948b6924749.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{1b28042fdf3f4dbc8ea5.js → 5383a8f3e4ec1a8a4fcd.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{9d9dffc8884d66a258e4.js → 5538639a49c7cc2eca63.js} +1 -1
  10. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +1 -0
  11. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +1 -0
  12. package/assets/esri/core/workers/chunks/68a59ce98177d8513337.js +1 -0
  13. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +1 -0
  14. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +1 -0
  15. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +1 -0
  16. package/assets/esri/core/workers/chunks/{47395d225229d237f0ac.js → 7bc5cc5dbf1b7b70ddac.js} +1 -1
  17. package/assets/esri/core/workers/chunks/8fa0a14165d43ffe87a5.js +1 -0
  18. package/assets/esri/core/workers/chunks/94b8dbf859df71858d1c.js +1 -0
  19. package/assets/esri/core/workers/chunks/{e2d68bcd2f99a65387bf.js → 9cb2ae42a8e328b1d98d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +1 -0
  21. package/assets/esri/core/workers/chunks/a78757b9c7e8cbea08fa.js +1 -0
  22. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +1 -0
  23. package/assets/esri/core/workers/chunks/{b10fcbe1393c812fc219.js → aa861b8eae6c85f3dad4.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{a960074644c3722be71e.js → afa6912454f2a5ffadce.js} +1 -1
  25. package/assets/esri/core/workers/chunks/b0b036ad3ad3cd956747.js +1 -0
  26. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +1 -0
  27. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +1 -0
  28. package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +1 -0
  29. package/assets/esri/core/workers/chunks/{ed0297fc61014e848c18.js → c080114a69fa95b88d22.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{573dc3064e84ca86844d.js → c959e0d1cf7dce0421b9.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{1fd48459afb58a6cf14f.js → ca2f5faa01d99c21ec14.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{7aa543a97f055cddea99.js → cc146c57bbdac8029fd8.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{631c5b514bb73782c570.js → cd7d83d127e085d52584.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{7e596478507466953e65.js → cef4af64860ebbfc1c47.js} +1 -1
  35. package/assets/esri/core/workers/chunks/d72488db62fcf39447b6.js +1 -0
  36. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +981 -0
  37. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +1 -0
  38. package/assets/esri/core/workers/chunks/{f7fc4c993536e62f7f3e.js → e97e986120aaadad7d4c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +1 -0
  40. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  41. package/chunks/CloudsComposition.glsl.js +4 -4
  42. package/chunks/vxlLayer.js +1 -1
  43. package/core/has.js +1 -1
  44. package/core/workers/workerFactory.js +1 -1
  45. package/geometry/support/heightModelInfoUtils.js +1 -1
  46. package/interfaces.d.ts +279 -76
  47. package/layers/RouteLayer.js +1 -1
  48. package/layers/VoxelLayer.js +1 -1
  49. package/layers/VoxelWasmPerScene.js +1 -1
  50. package/layers/support/RasterWorker.js +1 -1
  51. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  52. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  53. package/libs/vxl/enums.js +1 -1
  54. package/package.json +1 -1
  55. package/portal/schemas/buildingSceneLayerItem.js +1 -1
  56. package/portal/schemas/definitions.js +1 -1
  57. package/portal/schemas/integratedMeshLayerItem.js +1 -1
  58. package/portal/schemas/pointCloudLayerItem.js +1 -1
  59. package/portal/schemas/sceneLayerItem.js +1 -1
  60. package/portal/schemas/webScene.js +1 -1
  61. package/rest/find.js +1 -1
  62. package/rest/geometryService/generalize.js +1 -1
  63. package/rest/geometryService/lengths.js +1 -1
  64. package/rest/geometryService/offset.js +1 -1
  65. package/rest/geometryService/relation.js +1 -1
  66. package/rest/geometryService/trimExtend.js +1 -1
  67. package/rest/identify.js +1 -1
  68. package/{tasks → rest}/operations/find.js +0 -0
  69. package/{tasks → rest}/operations/generalize.js +0 -0
  70. package/rest/operations/identify.js +5 -0
  71. package/{tasks → rest}/operations/lengths.js +0 -0
  72. package/{tasks → rest}/operations/offset.js +0 -0
  73. package/{tasks → rest}/operations/relation.js +0 -0
  74. package/{tasks → rest}/operations/trimExtend.js +0 -0
  75. package/{tasks → rest}/operations/urlUtils.js +0 -0
  76. package/rest/print.js +1 -1
  77. package/rest/query/operations/query.js +1 -1
  78. package/rest/query/operations/queryAttachments.js +1 -1
  79. package/rest/query/operations/queryRelatedRecords.js +1 -1
  80. package/rest/query/operations/queryTopFeatures.js +1 -1
  81. package/rest/route/utils.js +1 -1
  82. package/rest/support/NetworkServiceDescription.js +1 -1
  83. package/rest/support/RouteInfo.js +1 -1
  84. package/rest/support/RouteParameters.js +1 -1
  85. package/rest/support/RouteSettings.js +5 -0
  86. package/rest/support/Stop.js +1 -1
  87. package/rest/support/networkEnums.js +1 -1
  88. package/support/revision.js +1 -1
  89. package/symbols/Font.js +1 -1
  90. package/symbols/TextSymbol.js +1 -1
  91. package/symbols/TextSymbol3DLayer.js +1 -1
  92. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  93. package/symbols/support/cimSymbolUtils.js +1 -1
  94. package/symbols/support/textUtils.js +5 -0
  95. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  96. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  97. package/views/2d/support/engineHelpers.js +1 -1
  98. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  99. package/views/3d/environment/CloudsComposition.js +1 -1
  100. package/views/3d/environment/CloudsGenerator.js +1 -1
  101. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  102. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  103. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  104. package/views/3d/layers/GraphicsView3D.js +1 -1
  105. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  106. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  108. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  109. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  110. package/views/3d/layers/graphics/{Graphics3DFeatureLikeLayerView.js → Graphics3DFeatureProcessor.js} +1 -1
  111. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  112. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  113. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  114. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  115. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  116. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  117. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  118. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  119. package/views/3d/layers/graphics/{Graphics3DGraphicLikeLayerView.js → GraphicsProcessor.js} +1 -1
  120. package/views/3d/layers/graphics/IGraphics3DFeatureProcessor.js +4 -0
  121. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  122. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +12 -14
  123. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  124. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  125. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  126. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  127. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  128. package/views/SceneView.js +1 -1
  129. package/views/webgl/ContextState.js +1 -1
  130. package/views/webgl/FramebufferObject.js +1 -1
  131. package/views/webgl/Program.js +1 -1
  132. package/views/webgl/Renderbuffer.js +1 -1
  133. package/views/webgl/RenderingContext.js +1 -1
  134. package/views/webgl/Texture.js +1 -1
  135. package/views/webgl/Util.js +1 -1
  136. package/views/webgl/enums.js +1 -1
  137. package/views/webgl/rasterUtils.js +1 -1
  138. package/views/webgl/testFloatBufferBlend.js +1 -1
  139. package/widgets/Feature/FeatureExpression.js +1 -1
  140. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  141. package/widgets/Feature/FeatureMedia.js +1 -1
  142. package/widgets/Feature/FeatureViewModel.js +1 -1
  143. package/widgets/LayerList/LayerListViewModel.js +1 -1
  144. package/widgets/support/geolocationUtils.js +1 -1
  145. package/assets/esri/core/workers/chunks/01ef8de7f76a8c61b464.js +0 -1
  146. package/assets/esri/core/workers/chunks/05db312a0ca6bd3f014a.js +0 -1
  147. package/assets/esri/core/workers/chunks/0f254c3e91e8fee55f28.js +0 -1
  148. package/assets/esri/core/workers/chunks/21a77eed1a4ef5b0ff08.js +0 -1
  149. package/assets/esri/core/workers/chunks/3564e14010953def6df9.js +0 -1
  150. package/assets/esri/core/workers/chunks/403c7d64f12f00330d88.js +0 -1
  151. package/assets/esri/core/workers/chunks/4409d77c9734de4e82a7.js +0 -1
  152. package/assets/esri/core/workers/chunks/615aa2d3ecafe30c80c0.js +0 -1
  153. package/assets/esri/core/workers/chunks/618076e6de605873e433.js +0 -1
  154. package/assets/esri/core/workers/chunks/6c1e92ff4c732dfda756.js +0 -1
  155. package/assets/esri/core/workers/chunks/722a10c65456844d72b9.js +0 -1
  156. package/assets/esri/core/workers/chunks/75d53b28afe732c459b2.js +0 -1
  157. package/assets/esri/core/workers/chunks/8fdd5bca3716816d359b.js +0 -1
  158. package/assets/esri/core/workers/chunks/a28b53c61bddefb6616e.js +0 -1
  159. package/assets/esri/core/workers/chunks/b9de831ac379cf1d2969.js +0 -1
  160. package/assets/esri/core/workers/chunks/c3eca92d02958732e141.js +0 -1
  161. package/assets/esri/core/workers/chunks/c8f976e53e232e8da9cc.js +0 -981
  162. package/assets/esri/core/workers/chunks/cb68db7169b9dfd1c3ff.js +0 -1
  163. package/assets/esri/core/workers/chunks/cc96608b2802fbfe7a08.js +0 -1
  164. package/assets/esri/core/workers/chunks/cd02fe27eb07681cb366.js +0 -1
  165. package/assets/esri/core/workers/chunks/dd433c160f7a0c120b82.js +0 -1
  166. package/assets/esri/core/workers/chunks/ef8b75b92cf549e0507e.js +0 -1
  167. package/symbols/support/constants.js +0 -5
  168. package/tasks/operations/identify.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{applySome as r,destroyMaybe as i,isSome as s,get as n,isNone as o}from"../../../core/maybe.js";import{initial as a,whenOnce as l}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as d}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as u}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{getRenderingInfo as c,getRenderingInfoAsync as g}from"../../../renderers/support/renderingInfoUtils.js";import y from"../../../rest/support/Query.js";import{DrapeSourceType as m}from"./interfaces.js";import f from"./graphics/Graphics3DFeatureLikeLayerView.js";import b from"./graphics/QueryEngine.js";import{toViewIfLocal as E}from"./support/projectExtentUtils.js";import{UpdatePolicy as C}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as v}from"../../support/Scheduler.js";const x=x=>{let w=class extends x{constructor(){super(...arguments),this.controller=null,this.updatePolicy=C.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.drapeSourceType=m.Features,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.clippingExtent=null,this.supportsHeightUnitConversion=!0,this.pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType());const i=new f({owner:this,layer:e,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,suspendResumeExtentMode:this.suspendResumeExtentMode,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("graphics3d",i),this.updatingHandles.add((()=>({updatePolicy:this.updatePolicy,graphics3d:this.graphics3d})),(({updatePolicy:e,graphics3d:t})=>r(t,(t=>t.graphicsCore.preferredUpdatePolicy=e))),a),this.updatingHandles.add((()=>({suspendResumeExtentMode:this.suspendResumeExtentMode,graphics3d:this.graphics3d})),(({suspendResumeExtentMode:e,graphics3d:t})=>r(t,(t=>t.suspendResumeExtentMode=e))),a),this.addResolvingPromise((async()=>{await i.setup(),this.queryEngine=new b({layerView:this,priority:v.FEATURE_QUERY_ENGINE})})()),this.addResolvingPromise((async()=>{const e=await E(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=i(this.controller),this._set("graphics3d",i(this.graphics3d)),this.queryEngine=i(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this.pendingController&&(this.pendingController.destroy(),this.pendingController=null)}get legendEnabled(){var e,t;return this.canResume()&&!(null!=(e=this.graphics3d)&&null!=(t=e.frustumVisibility)&&t.suspended)}notifyGraphicGeometryChanged(e){this.graphics3d.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphics3d.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,r){const i=c(e,{renderer:t,arcade:r});if(s(i)&&i.color){const e=i.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return i}async getRenderingInfoAsync(e,t,r,i){return g(e,{renderer:t,arcade:r,...i})}getGraphicFromGraphicUid(e){var t;let r=null;return null==(t=this.loadedGraphics)||t.forEach((t=>{t.uid===e&&(r=d(t,this.layer))})),r}get graphics3DGraphics(){return this.graphics3d?this.graphics3d.graphicsCore.graphics3DGraphics:null}get graphics3DGraphicsByObjectID(){return this.graphics3d?this.graphics3d.graphicsCore.graphics3DGraphicsByObjectID:null}get symbolUpdateType(){return this.graphics3d?this.graphics3d.graphicsCore.symbolUpdateType:null}whenGraphicBounds(e,t){return this.graphics3d?this.graphics3d.graphicsCore.whenGraphicBounds(e,t):null}computeAttachmentOrigin(e,t){return this.graphics3d?this.graphics3d.graphicsCore.computeAttachmentOrigin(e,t):null}getSymbolLayerSize(e,t){return this.graphics3d?this.graphics3d.graphicsCore.getSymbolLayerSize(e,t):null}queryFeatures(e,t){return this.queryEngine.executeQuery(this._ensureQuery(e),n(t,"signal"))}queryObjectIds(e,t){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),n(t,"signal"))}queryFeatureCount(e,t){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),n(t,"signal"))}queryExtent(e,t){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),n(t,"signal"))}_ensureQuery(e){return o(e)?this.createQuery():y.from(e)}highlight(e){return this.graphics3d.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.graphics3d.maskOccludee(e)}canResume(){return super.canResume()&&(!this.graphics3d||!this.graphics3d.suspended)}getSuspendInfo(){const e=super.getSuspendInfo();return this.graphics3d?{...e,...this.graphics3d.suspendInfo}:e}isUpdating(){var e,t,r;return!(!this.graphics3d||this.graphics3d.destroyed)&&!(this._controllerCreated&&(null==(e=this.controller)||!e.updating)&&null!=(t=this.view)&&null!=(r=t.basemapTerrain)&&r.ready&&!this.graphics3d.updating)}async _initializeController(){const e=this.createController();this.pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(t){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await l((()=>{var e,t;return null==(e=this.view)||null==(t=e.basemapTerrain)?void 0:t.ready})),this.beforeSetController(e),this.pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":return Promise.reject(new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType}))}}_getResourceInfo(){const e=this.controller&&this.controller instanceof u?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:e?e.maximumNumberOfFeatures:-1,totalNumberOfFeatures:e?e.serviceDataCount:-1,nodes:0,core:this.graphics3d.graphicsCore.performanceInfo,elevationUpdating:this.graphics3d.elevationAlignment.updating,visibilityFrustum:!this.graphics3d.frustumVisibility.suspended,visibilityScale:!this.graphics3d.scaleVisibility.suspended}}get performanceInfo(){return this._getResourceInfo()}};return e([p()],w.prototype,"loadedGraphics",void 0),e([p()],w.prototype,"suspended",void 0),e([p({readOnly:!0})],w.prototype,"legendEnabled",null),e([p()],w.prototype,"updating",void 0),e([p()],w.prototype,"controller",void 0),e([p()],w.prototype,"graphics3d",void 0),e([p({readOnly:!0})],w.prototype,"updatePolicy",void 0),e([p({readOnly:!0})],w.prototype,"suspendResumeExtentMode",void 0),e([p({type:Boolean})],w.prototype,"slicePlaneEnabled",void 0),e([p({readOnly:!0})],w.prototype,"suspendInfo",void 0),w=e([h("esri.views.3d.layers.FeatureLikeLayerView3D")],w),w};export{x as FeatureLikeLayerView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{applySome as t,destroyMaybe as s,isSome as i,get as o,isNone as n}from"../../../core/maybe.js";import{initial as l,whenOnce as a}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as c}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as h}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{getRenderingInfo as d,getRenderingInfoAsync as y}from"../../../renderers/support/renderingInfoUtils.js";import g from"../../../rest/support/Query.js";import{DrapeSourceType as m}from"./interfaces.js";import f from"./graphics/Graphics3DFeatureProcessor.js";import b from"./graphics/QueryEngine.js";import{toViewIfLocal as E}from"./support/projectExtentUtils.js";import{UpdatePolicy as C}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as v}from"../../support/Scheduler.js";const x=x=>{let w=class extends x{constructor(){super(...arguments),this.controller=null,this.updatePolicy=C.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.drapeSourceType=m.Features,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.clippingExtent=null,this.supportsHeightUnitConversion=!0,this.pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType());const s=new f({owner:this,layer:e,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,suspendResumeExtentMode:this.suspendResumeExtentMode,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",s),this.updatingHandles.add((()=>({updatePolicy:this.updatePolicy,processor:this.processor})),(({updatePolicy:e,processor:r})=>t(r,(r=>r.graphicsCore.preferredUpdatePolicy=e))),l),this.updatingHandles.add((()=>({suspendResumeExtentMode:this.suspendResumeExtentMode,processor:this.processor})),(({suspendResumeExtentMode:e,processor:r})=>t(r,(r=>r.suspendResumeExtentMode=e))),l),this.addResolvingPromise((async()=>{await s.setup(),this.queryEngine=new b({layerView:this,priority:v.FEATURE_QUERY_ENGINE})})()),this.addResolvingPromise((async()=>{const e=await E(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=s(this.controller),this._set("processor",s(this.processor)),this.queryEngine=s(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this.pendingController&&(this.pendingController.destroy(),this.pendingController=null)}get legendEnabled(){var e,r;return this.canResume()&&!(null!=(e=this.processor)&&null!=(r=e.frustumVisibility)&&r.suspended)}notifyGraphicGeometryChanged(e){this.processor.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.processor.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,r,t){const s=d(e,{renderer:r,arcade:t});if(i(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}async getRenderingInfoAsync(e,r,t,s){return y(e,{renderer:r,arcade:t,...s})}getGraphicFromGraphicUid(e){var r;let t=null;return null==(r=this.loadedGraphics)||r.forEach((r=>{r.uid===e&&(t=c(r,this.layer))})),t}get graphics3DGraphics(){return this.processor?this.processor.graphicsCore.graphics3DGraphics:null}get graphics3DGraphicsByObjectID(){return this.processor?this.processor.graphicsCore.graphics3DGraphicsByObjectID:null}get symbolUpdateType(){return this.processor?this.processor.graphicsCore.symbolUpdateType:null}whenGraphicBounds(e,r){return this.processor?this.processor.graphicsCore.whenGraphicBounds(e,r):null}computeAttachmentOrigin(e,r){return this.processor?this.processor.graphicsCore.computeAttachmentOrigin(e,r):null}getSymbolLayerSize(e,r){return this.processor?this.processor.graphicsCore.getSymbolLayerSize(e,r):null}queryFeatures(e,r){return this.queryEngine.executeQuery(this._ensureQuery(e),o(r,"signal"))}queryObjectIds(e,r){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),o(r,"signal"))}queryFeatureCount(e,r){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),o(r,"signal"))}queryExtent(e,r){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),o(r,"signal"))}_ensureQuery(e){return n(e)?this.createQuery():g.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){return super.canResume()&&(!this.processor||!this.processor.suspended)}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){var e,r,t;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&(null==(e=this.controller)||!e.updating)&&null!=(r=this.view)&&null!=(t=r.basemapTerrain)&&t.ready&&!this.processor.updating)}async _initializeController(){const e=this.createController();this.pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(r){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await a((()=>{var e,r;return null==(e=this.view)||null==(r=e.basemapTerrain)?void 0:r.ready})),this.beforeSetController(e),this.pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":return Promise.reject(new r("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType}))}}_getResourceInfo(){const e=this.controller&&this.controller instanceof h?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:e?e.maximumNumberOfFeatures:-1,totalNumberOfFeatures:e?e.serviceDataCount:-1,nodes:0,core:this.processor.graphicsCore.performanceInfo,elevationUpdating:this.processor.elevationAlignment.updating,visibilityFrustum:!this.processor.frustumVisibility.suspended,visibilityScale:!this.processor.scaleVisibility.suspended}}get performanceInfo(){return this._getResourceInfo()}};return e([p()],w.prototype,"loadedGraphics",void 0),e([p()],w.prototype,"suspended",void 0),e([p({readOnly:!0})],w.prototype,"legendEnabled",null),e([p()],w.prototype,"updating",void 0),e([p()],w.prototype,"controller",void 0),e([p()],w.prototype,"processor",void 0),e([p({readOnly:!0})],w.prototype,"updatePolicy",void 0),e([p({readOnly:!0})],w.prototype,"suspendResumeExtentMode",void 0),e([p({type:Boolean})],w.prototype,"slicePlaneEnabled",void 0),e([p({readOnly:!0})],w.prototype,"suspendInfo",void 0),w=e([u("esri.views.3d.layers.FeatureLikeLayerView3D")],w),w};export{x as FeatureLikeLayerView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/maybe.js";import{whenTrueOnce as s,init as t,watch as r}from"../../../core/watchUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as h}from"./interfaces.js";import{LayerView3D as n}from"./LayerView3D.js";import c from"./graphics/Graphics3DFrustumVisibility.js";import o from"./graphics/Graphics3DGraphicLikeLayerView.js";import{enlargeExtent as d}from"./graphics/graphicUtils.js";import{toViewIfLocal as u}from"./support/projectExtentUtils.js";import{UpdatePolicy as l}from"../webgl-engine/lib/basicInterfaces.js";import g from"../../layers/LayerView.js";const y=1.2;let m=class extends(n(g)){constructor(){super(...arguments),this.type="graphics-3d",this.frustumVisibility=new c,this.slicePlaneEnabled=!1,this.drapeSourceType=h.Features,this.suspendResumeExtent=null,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("graphics3d",new o({owner:this,layer:this.layer,scaleVisibilityEnabled:!0})),this.graphics3d.setup(),this.frustumVisibility.setup(this),this._setupSuspendResumeExtent(),this.updatingHandles.add((()=>this.fullOpacity),(()=>this.graphics3d.graphicsCore.opacityChange())),this.handles.add(this.layer.on("graphic-update",(i=>this.graphics3d.graphicsCore.graphicUpdateHandler(i)))),this.addResolvingPromise(u(this).then((i=>this.fullExtentInLocalViewSpatialReference=i))),this.layer.internal?this.notifyChange("updating"):this.handles.add(s(this.view,"basemapTerrain.ready",(()=>this.notifyChange("updating"))))}destroy(){this.frustumVisibility&&(this.frustumVisibility.destroy(),this._set("frustumVisibility",null)),this.graphics3d&&(this.graphics3d.destroy(),this._set("graphics3d",null))}get legendEnabled(){return this.canResume()&&!this.frustumVisibility.suspended}getSuspendInfo(){var i;const s=super.getSuspendInfo();return e(this.graphics3d.scaleVisibility)&&this.graphics3d.scaleVisibility.suspended&&(s.outsideScaleRange=!0),s.outsideOfView=!(null==(i=this.frustumVisibility)||!i.suspended),s}async fetchPopupFeatures(i,s){return e(s)?s.clientGraphics:null}notifyGraphicGeometryChanged(i){this.graphics3d.graphicsCore.notifyGraphicGeometryChanged(i)}notifyGraphicVisibilityChanged(i){this.graphics3d.graphicsCore.notifyGraphicVisibilityChanged(i)}get graphics3DGraphics(){return this.graphics3d.graphicsCore.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphics3d?this.graphics3d.graphicsCore.graphics3DGraphicsByObjectID:null}get symbolUpdateType(){return this.graphics3d.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(i){return this.graphics3d.getGraphicFromGraphicUid(i)}whenGraphicBounds(i,e){return this.graphics3d.whenGraphicBounds(i,e)}computeAttachmentOrigin(i,e){return this.graphics3d?this.graphics3d.graphicsCore.computeAttachmentOrigin(i,e):null}getSymbolLayerSize(i,e){return this.graphics3d.getSymbolLayerSize(i,e)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(i){return this.graphics3d.maskOccludee(i)}highlight(i){return this.graphics3d.highlight(i)}get updatePolicy(){var i;return(null==(i=this.graphics3d)?void 0:i.graphicsCore.effectiveUpdatePolicy)||l.SYNC}canResume(){var i;return super.canResume()&&!(null!=(i=this.graphics3d)&&i.suspended)}isUpdating(){var i,e;return!(!(this.graphics3d&&this.graphics3d.updating||this.frustumVisibility&&this.frustumVisibility.updating)&&(this.layer.internal||null!=(i=this.view)&&null!=(e=i.basemapTerrain)&&e.ready))}_setupSuspendResumeExtent(){const i=()=>{this.suspendResumeExtent=d(this.graphics3d.graphicsCore.computedExtent,this.suspendResumeExtent,y,this.graphics3d.graphicsCore.extentPadding),this.frustumVisibility.setExtent(this.suspendResumeExtent)};t(this.graphics3d.graphicsCore,"computedExtent",(()=>i()),!0),r(this.graphics3d.graphicsCore,"extentPadding",(()=>i()),!0)}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.graphics3d.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended}}};i([a({aliasOf:"layer.graphics"})],m.prototype,"loadedGraphics",void 0),i([a({readOnly:!0})],m.prototype,"suspended",void 0),i([a({readOnly:!0})],m.prototype,"legendEnabled",null),i([a({readOnly:!0})],m.prototype,"updating",void 0),i([a()],m.prototype,"layer",void 0),i([a({readOnly:!0})],m.prototype,"frustumVisibility",void 0),i([a({readOnly:!0})],m.prototype,"graphics3d",void 0),i([a({type:Boolean})],m.prototype,"slicePlaneEnabled",void 0),m=i([p("esri.views.3d.layers.GraphicsLayerView3D")],m);const f=m;export{f as default};
5
+ import{_ as s}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/maybe.js";import{whenTrueOnce as r,init as i,watch as t}from"../../../core/watchUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as a}from"./interfaces.js";import{LayerView3D as n}from"./LayerView3D.js";import c from"./graphics/Graphics3DFrustumVisibility.js";import h from"./graphics/GraphicsProcessor.js";import{enlargeExtent as u}from"./graphics/graphicUtils.js";import{toViewIfLocal as l}from"./support/projectExtentUtils.js";import{UpdatePolicy as d}from"../webgl-engine/lib/basicInterfaces.js";import m from"../../layers/LayerView.js";const y=1.2;let g=class extends(n(m)){constructor(){super(...arguments),this.type="graphics-3d",this.frustumVisibility=new c,this.slicePlaneEnabled=!1,this.drapeSourceType=a.Features,this.suspendResumeExtent=null,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new h({owner:this,layer:this.layer,scaleVisibilityEnabled:!0})),this.processor.setup(),this.frustumVisibility.setup(this),this._setupSuspendResumeExtent(),this.updatingHandles.add((()=>this.fullOpacity),(()=>this.processor.graphicsCore.opacityChange())),this.handles.add(this.layer.on("graphic-update",(s=>this.processor.graphicsCore.graphicUpdateHandler(s)))),this.addResolvingPromise(l(this).then((s=>this.fullExtentInLocalViewSpatialReference=s))),this.layer.internal?this.notifyChange("updating"):this.handles.add(r(this.view,"basemapTerrain.ready",(()=>this.notifyChange("updating"))))}destroy(){this.frustumVisibility&&(this.frustumVisibility.destroy(),this._set("frustumVisibility",null)),this.processor&&(this.processor.destroy(),this._set("processor",null))}get legendEnabled(){return this.canResume()&&!this.frustumVisibility.suspended}getSuspendInfo(){var s;const r=super.getSuspendInfo();return e(this.processor.scaleVisibility)&&this.processor.scaleVisibility.suspended&&(r.outsideScaleRange=!0),r.outsideOfView=!(null==(s=this.frustumVisibility)||!s.suspended),r}async fetchPopupFeatures(s,r){return e(r)?r.clientGraphics:null}notifyGraphicGeometryChanged(s){this.processor.graphicsCore.notifyGraphicGeometryChanged(s)}notifyGraphicVisibilityChanged(s){this.processor.graphicsCore.notifyGraphicVisibilityChanged(s)}get graphics3DGraphics(){return this.processor.graphicsCore.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.processor?this.processor.graphicsCore.graphics3DGraphicsByObjectID:null}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(s){return this.processor.getGraphicFromGraphicUid(s)}whenGraphicBounds(s,e){return this.processor.whenGraphicBounds(s,e)}computeAttachmentOrigin(s,e){return this.processor?this.processor.graphicsCore.computeAttachmentOrigin(s,e):null}getSymbolLayerSize(s,e){return this.processor.getSymbolLayerSize(s,e)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(s){return this.processor.maskOccludee(s)}highlight(s){return this.processor.highlight(s)}get updatePolicy(){var s;return(null==(s=this.processor)?void 0:s.graphicsCore.effectiveUpdatePolicy)||d.SYNC}canResume(){var s;return super.canResume()&&!(null!=(s=this.processor)&&s.suspended)}isUpdating(){var s,e;return!(!(this.processor&&this.processor.updating||this.frustumVisibility&&this.frustumVisibility.updating)&&(this.layer.internal||null!=(s=this.view)&&null!=(e=s.basemapTerrain)&&e.ready))}_setupSuspendResumeExtent(){const s=()=>{this.suspendResumeExtent=u(this.processor.graphicsCore.computedExtent,this.suspendResumeExtent,y,this.processor.graphicsCore.extentPadding),this.frustumVisibility.setExtent(this.suspendResumeExtent)};i(this.processor.graphicsCore,"computedExtent",(()=>s()),!0),t(this.processor.graphicsCore,"extentPadding",(()=>s()),!0)}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended}}};s([o({aliasOf:"layer.graphics"})],g.prototype,"loadedGraphics",void 0),s([o({readOnly:!0})],g.prototype,"suspended",void 0),s([o({readOnly:!0})],g.prototype,"legendEnabled",null),s([o({readOnly:!0})],g.prototype,"updating",void 0),s([o()],g.prototype,"layer",void 0),s([o({readOnly:!0})],g.prototype,"frustumVisibility",void 0),s([o({readOnly:!0})],g.prototype,"processor",void 0),s([o({type:Boolean})],g.prototype,"slicePlaneEnabled",void 0),g=s([p("esri.views.3d.layers.GraphicsLayerView3D")],g);const f=g;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import{isSome as e}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as a}from"./interfaces.js";import p from"./graphics/Graphics3DGraphicLikeLayerView.js";import{GraphicsView as c}from"../../layers/GraphicsView.js";let h=class extends(c(i)){constructor(r){super(r),this.graphics3d=null,this.slicePlaneEnabled=!1,this.drapeSourceType=a.Features}initialize(){const r="__sceneView.graphics-"+Date.now().toString(16),i={id:r,uid:r,type:"graphics-view-3d-proxy"};this._set("graphics3d",new p({owner:this,layer:i})),this.graphics3d.setup()}destroy(){this.graphics3d&&(this.graphics3d.destroy(),this._set("graphics3d",null))}get updating(){var r;return!(null==(r=this.graphics3d)||!r.updating)}notifyGraphicGeometryChanged(r){this.graphics3d.graphicsCore.notifyGraphicGeometryChanged(r)}notifyGraphicVisibilityChanged(r){this.graphics3d.graphicsCore.notifyGraphicVisibilityChanged(r)}get graphics3DGraphics(){return this.graphics3d.graphicsCore.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphics3d.graphicsCore.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.graphics3d.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(r){return this.graphics3d.getGraphicFromGraphicUid(r)}whenGraphicBounds(r,i){return this.graphics3d.whenGraphicBounds(r,i)}graphicChanged(r){this.graphics3d.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.graphics3d.graphicsCore.effectiveUpdatePolicy}queryGraphics(){return Promise.resolve(this.loadedGraphics)}async fetchPopupFeatures(r,i){return e(i)?i.clientGraphics:null}highlight(r){return this.graphics3d.highlight(r)}maskOccludee(r){return this.graphics3d.maskOccludee(r)}};r([s({readOnly:!0,aliasOf:"view.graphics"})],h.prototype,"graphics",void 0),r([s({aliasOf:"graphics"})],h.prototype,"loadedGraphics",void 0),r([s({readOnly:!0})],h.prototype,"updating",null),r([s({constructOnly:!0})],h.prototype,"view",void 0),r([s()],h.prototype,"graphics3d",void 0),r([s({type:Boolean})],h.prototype,"slicePlaneEnabled",void 0),h=r([t("esri.views.3d.layers.GraphicsView3D")],h);const o=h;export{o as default};
5
+ import{_ as r}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{isSome as e}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as t}from"./interfaces.js";import p from"./graphics/GraphicsProcessor.js";import{GraphicsView as c}from"../../layers/GraphicsView.js";let a=class extends(c(s)){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.drapeSourceType=t.Features}initialize(){const r="__sceneView.graphics-"+Date.now().toString(16),s={id:r,uid:r,type:"graphics-view-3d-proxy"};this._set("processor",new p({owner:this,layer:s})),this.processor.setup()}destroy(){this.processor&&(this.processor.destroy(),this._set("processor",null))}get updating(){var r;return!(null==(r=this.processor)||!r.updating)}notifyGraphicGeometryChanged(r){this.processor.graphicsCore.notifyGraphicGeometryChanged(r)}notifyGraphicVisibilityChanged(r){this.processor.graphicsCore.notifyGraphicVisibilityChanged(r)}get graphics3DGraphics(){return this.processor.graphicsCore.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.processor.graphicsCore.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(r){return this.processor.getGraphicFromGraphicUid(r)}whenGraphicBounds(r,s){return this.processor.whenGraphicBounds(r,s)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}queryGraphics(){return Promise.resolve(this.loadedGraphics)}async fetchPopupFeatures(r,s){return e(s)?s.clientGraphics:null}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};r([o({readOnly:!0,aliasOf:"view.graphics"})],a.prototype,"graphics",void 0),r([o({aliasOf:"graphics"})],a.prototype,"loadedGraphics",void 0),r([o({readOnly:!0})],a.prototype,"updating",null),r([o({constructOnly:!0})],a.prototype,"view",void 0),r([o()],a.prototype,"processor",void 0),r([o({type:Boolean})],a.prototype,"slicePlaneEnabled",void 0),a=r([i("esri.views.3d.layers.GraphicsView3D")],a);const h=a;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Logger.js";import{destroyMaybe as i,isSome as s,isNone as o,unwrap as a}from"../../../core/maybe.js";import{initial as n}from"../../../core/reactiveUtils.js";import{init as d}from"../../../core/watchUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{b as u}from"../../../chunks/vec3.js";import{f as c,c as p}from"../../../chunks/vec3f64.js";import{projectBuffer as g,projectVectorToVector as m,projectBoundingRect as f}from"../../../geometry/projection.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{extentContainsCoords3D as _}from"../../../geometry/support/contains.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{makeDehydratedPoint as v,estimateSize as E}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import I from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import{getRenderingInfo as S,getRenderingInfoAsync as C}from"../../../renderers/support/renderingInfoUtils.js";import D from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as F}from"./I3SPointsWorkerHandle.js";import{DrapeSourceType as A}from"./interfaces.js";import{LayerView3D as O}from"./LayerView3D.js";import j from"./graphics/Graphics3DFeatureLikeLayerView.js";import N from"./graphics/QueryEngine.js";import{createInteractiveEditSession as T,processAttributeEdits as G}from"./i3s/attributeEditing.js";import{I3SAttributeOverrides as V}from"./i3s/I3SAttributeOverrides.js";import{checkSpatialReferences as M,containsDraco as R,whenGraphicAttributes as P,getCachedAttributeValue as L}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as U}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import{PopupSceneLayerView as q}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as Q}from"./support/SceneLayerViewRequiredFields.js";import k from"../support/debugFlags.js";import{GraphicsMap as B}from"../support/GraphicsMap.js";import{compute as z}from"../support/orientedBoundingBox.js";import{updatingProgress as W}from"../support/updatingProperties.js";import{UpdatePolicy as K}from"../webgl-engine/lib/basicInterfaces.js";import Z from"../../layers/SceneLayerView.js";import{TaskPriority as Y}from"../../support/Scheduler.js";const J=r.getLogger("esri.views.3d.layers.SceneLayerGraphicsView3D"),$=H();let X=class extends(U(q(O(Z)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this.drapeSourceType=A.Features,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new B,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){var e,t;const r=this.layer;this.addResolvingPromise(r.indexInfo),this._attributeOverrides=new V(this.layer,null==(e=this.view.resourceController)?void 0:e.memoryController),M(r,this.view.spatialReference,this.view.viewingMode),this.fieldsHelper=new Q({layerView:this}),this.updatingHandles.add((()=>r.rangeInfos),(e=>this._rangeInfosChanged(e)),n),this.updatingHandles.add((()=>r.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>this.parsedDefinitionExpression),(()=>this._filterChange())),this.updatingHandles.add((()=>this.view.floors),(()=>this.graphics3d.filterVisibility.filterChanged())),this.handles.add(d(k,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&k.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||k.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}))),this._set("graphics3d",new j({owner:this,layer:r,preferredUpdatePolicy:K.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,suspendResumeExtentMode:"data",dataExtent:r.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),null==(t=this.graphics3d.elevationAlignment)||t.events.on("invalidate-elevation",(e=>this._invalidateElevation(e))),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",r.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.graphics3d.setup()),this._memCache=this.view.resourceController.memoryController.newCache(r.uid),this._controller=new I({layerView:this,scaleVisibilityEnabled:!1}),R(this.layer.geometryDefinitions)&&(this._worker=new F((e=>this.view.resourceController.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{this._queryEngine=new N({layerView:this,priority:Y.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),n),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._attributeOverrides=i(this._attributeOverrides),this._set("graphics3d",i(this.graphics3d)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this.fieldsHelper=i(this.fieldsHelper)}get requiredFields(){var e,t;return null!=(e=null==(t=this.fieldsHelper)?void 0:t.requiredFields)?e:[]}get maximumNumberOfFeatures(){const e=this.graphics3d&&this.graphics3d.graphicsCore&&this.graphics3d.graphicsCore.displayFeatureLimit;return e?e.maximumNumberOfFeatures:0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller&&!this._controller.leavesReached)}get hasM(){return!1}get hasZ(){return!0}notifyGraphicGeometryChanged(e){this.graphics3d.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphics3d.graphicsCore.notifyGraphicVisibilityChanged(e)}async whenGraphicAttributes(e,t){return P(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getGraphicFromGraphicUid(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,t):null}whenGraphicBounds(e,t){return this.graphics3d.graphicsCore.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphics3d.graphicsCore.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){var e,t,r;return!!(null!=(e=this._controller)&&e.updating||null!=(t=this.graphics3d)&&t.updating||null!=(r=this.fieldsHelper)&&r.updating)}getRenderingInfo(e,t,r){const i=S(e,{renderer:t,arcade:r});if(s(i)&&i.color){const e=i.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return i}async getRenderingInfoAsync(e,t,r,i){return C(e,{renderer:t,arcade:r,...i})}get symbolUpdateType(){return this.graphics3d.graphicsCore.symbolUpdateType}highlight(e){return this.graphics3d.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.graphics3d.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return T(this.attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return o(this._worker)&&(this._worker=new F((e=>this.view.resourceController.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(s(e)){return{positionData:e.positions,featureIds:e.featureIds}}throw new Error("Failed to decompress Draco point data")}))}_checkExtent(e,t){e&&!_(e,t)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&J.error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&J.error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!re(t)&&!te(t))return Promise.reject();if(this._nodesAddedToStage.has(e.index))return void J.error("I3S node "+e.id+" already added");const i=s(this.layer.fullExtent)?se(this.layer.fullExtent.clone(),.5):null,o=this._controller.crsVertex,a=[],n={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(re(t)?await this._addNodeBinaryPointData(e,n,t,i,a,r):te(t)&&this._addNodeLegacyPointData(e,n,t,i,a),await this._attributeOverrides.apply(n.featureIds,t.attributeDataInfo,r),e.numFeatures=n.graphics.length,this._updateNodeMemory(e),ie(n),a.length>0&&(this._computeObb(e,a,o),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return this._cacheNodeData(n),Promise.resolve();if(s(this._verticalScale))for(const s of n.graphics)this._verticalScale(s.geometry);return this._nodesAddedToStage.set(e.index,n),this.loadedGraphics.addMany(n.graphics),this._filterNode(n),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;g(t,r,0,t,s,0,t.length/3);const o={data:t,size:3};e.serviceObb=z(o),i.isGeographic&&m(e.serviceObb.center,s,e.serviceObb.center,i)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _addNodeBinaryPointData(e,r,i,o,n,d){const l=await this._extractBinaryPointData(i,d);if(null==l)return Promise.reject();const h=this._getObjectIdField(),p=this._controller.crsVertex,m=this.view.spatialReference,f=this.graphics3d.graphicsCore,{positionData:y,featureIds:_}=l,b=3,E=y.length/b,x=new Array;for(let I=0;I<E;I++){const r=s(e.serviceObb)?e.serviceObb.center:[0,0,0],i=I*b,d=c(y[i+0],y[i+1],y[i+2]);u(d,d,r),e.serviceObb||n.push(d[0],d[1],d[2]),s(o)&&this._checkExtent(o,d);const l=_[I],E={};null!=l&&(E[h]=l);const w=null==l?t.generateUID():l;g(d,p,0,ae,m,0,1);const S=v(ae[0],ae[1],ae[2],m),C=this.loadedGraphics.get(w);if(s(C))C.level<e.level&&(ne.property="geometry",ne.graphic=C,ne.oldValue=a(C.geometry),ne.newValue=S,C.geometry=S,f.graphicUpdateHandler(ne)),x.push(C);else{const r=t.generateUID();x.push({objectId:w,uid:r,geometry:S,attributes:E,visible:!0,level:e.level})}}r.graphics=x,r.featureIds=_}_addNodeLegacyPointData(e,r,i,o,a){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,h=[0,0,0],u=new Array,c=new Array;for(const p of i.pointData){const r=p.featureDataPosition,i=r.length,m=p.geometries&&p.geometries[0]||oe[i],f=p.featureIds[0];if("points"!==m.params.type)continue;s(o)&&this._checkExtent(o,r);const y={};null!=f&&(y[n]=f);const _=null==f?t.generateUID():f;let b;"Embedded"===m.type&&(b=m.params.vertexAttributes.position);for(let o=0;o<b.length;o+=i){for(let e=0;e<i;e++)h[e]=r[e]+b[o+e];const n=3===i;e.serviceObb||a.push(h[0],h[1],n?h[2]:0),g(h,d,0,ae,l,0,1);const u=v(ae[0],ae[1],n?ae[2]:void 0,l),p=this.loadedGraphics.get(_);s(p)?c.push(p):c.push({objectId:_,uid:t.generateUID(),geometry:u,attributes:y,visible:!0})}u.push(f)}r.graphics=c,r.featureIds=u}_updateNodeMemory(e){e.memory=4096+(s(e.numFeatures)?e.numFeatures*this.graphics3d.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>E(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach((e=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){if(!this._nodesAddedToStage.has(e.index))return this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve();J.error("I3S node "+e.id+" already added")}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&s(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&s(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!o(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this._nodesAddedToStage.get(e);i&&(await this._attributeOverrides.apply(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){if(ie(e),this._filterNode(e),this.graphics3d.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.graphics3d.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||"OBJECTID"}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&J.warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression;for(const r of e.graphics){const e=r.visible;r.visible=!t||this._evaluateClause(t,r),e!==r.visible&&(ne.graphic=r,ne.property="visible",ne.oldValue=e,ne.newValue=r.visible,this.graphics3d.graphicsCore.graphicUpdateHandler(ne))}}_invalidateElevation(e){const t=this._controller.crsIndex;f(e.extent,e.spatialReference,de,t),this._controller.updateElevationChanged(de,t)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return s(this.filter)?this.filter.createQuery(e):new D(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),null==t?void 0:t.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),null==t?void 0:t.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),null==t?void 0:t.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),null==t?void 0:t.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():D.from(e))}getUsedMemory(){const e=this.graphics3d&&this.graphics3d.graphicsCore;return e?e.usedMemory:0}getUnloadedMemory(){const e=this.graphics3d&&this.graphics3d.graphicsCore;return.8*((this._controller?this._controller.unloadedMemoryEstimate:0)+(e?e.unprocessedMemoryEstimate:0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){G(this.attributeEditingContext,e)}get attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,attributeOverrides:this._attributeOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const o=this._nodesAddedToStage.get(t);if(s(i)){const t=this.loadedGraphics.get(i.attributes[e]);s(t)&&this.graphics3d.graphicsCore.recreateGraphics([t])}else s(o)&&this.graphics3d.graphicsCore.recreateGraphics(o.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.graphics3d.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,numFeatures:this.loadedGraphics.length}}};e([l()],X.prototype,"graphics3d",void 0),e([l({type:w})],X.prototype,"filter",void 0),e([l()],X.prototype,"loadedGraphics",void 0),e([l({aliasOf:"layer"})],X.prototype,"i3slayer",void 0),e([l()],X.prototype,"_controller",void 0),e([l()],X.prototype,"updating",void 0),e([l()],X.prototype,"suspended",void 0),e([l()],X.prototype,"holeFilling",void 0),e([l(W)],X.prototype,"updatingProgress",void 0),e([l({aliasOf:"_controller.updatingProgress"})],X.prototype,"updatingProgressValue",void 0),e([l($.requiredFields)],X.prototype,"requiredFields",null),e([l($.availableFields)],X.prototype,"availableFields",void 0),e([l()],X.prototype,"fieldsHelper",void 0),e([l({type:Number})],X.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],X.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0,aliasOf:"view.qualitySettings.sceneService.point.lodFactor"})],X.prototype,"lodFactor",void 0),e([l({readOnly:!0})],X.prototype,"hasM",null),e([l({readOnly:!0})],X.prototype,"hasZ",null),X=e([h("esri.views.3d.layers.SceneLayerGraphicsView3D")],X);const ee=X;function te(e){return"pointData"in e}function re(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function ie(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const i=e.graphics[r];if(i.attributes||(i.attributes={}),s(t)&&s(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(i.attributes[e]=L(t.attributeData[e],r))}}function se(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const oe={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},ae=p(),ne={graphic:null,property:null,oldValue:null,newValue:null},de=y();export{ee as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Logger.js";import{destroyMaybe as i,isSome as s,isNone as o,unwrap as a}from"../../../core/maybe.js";import{initial as n}from"../../../core/reactiveUtils.js";import{init as d}from"../../../core/watchUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{b as u}from"../../../chunks/vec3.js";import{f as c,c as p}from"../../../chunks/vec3f64.js";import{projectBuffer as g,projectVectorToVector as m,projectBoundingRect as f}from"../../../geometry/projection.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{extentContainsCoords3D as _}from"../../../geometry/support/contains.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{makeDehydratedPoint as v,estimateSize as E}from"../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import I from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import{getRenderingInfo as S,getRenderingInfoAsync as C}from"../../../renderers/support/renderingInfoUtils.js";import D from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as F}from"./I3SPointsWorkerHandle.js";import{DrapeSourceType as A}from"./interfaces.js";import{LayerView3D as O}from"./LayerView3D.js";import j from"./graphics/Graphics3DFeatureProcessor.js";import N from"./graphics/QueryEngine.js";import{createInteractiveEditSession as T,processAttributeEdits as G}from"./i3s/attributeEditing.js";import{I3SAttributeOverrides as V}from"./i3s/I3SAttributeOverrides.js";import{checkSpatialReferences as M,containsDraco as R,whenGraphicAttributes as P,getCachedAttributeValue as U}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as L}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import{PopupSceneLayerView as q}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as Q}from"./support/SceneLayerViewRequiredFields.js";import k from"../support/debugFlags.js";import{GraphicsMap as B}from"../support/GraphicsMap.js";import{compute as z}from"../support/orientedBoundingBox.js";import{updatingProgress as W}from"../support/updatingProperties.js";import{UpdatePolicy as K}from"../webgl-engine/lib/basicInterfaces.js";import Z from"../../layers/SceneLayerView.js";import{TaskPriority as Y}from"../../support/Scheduler.js";const J=r.getLogger("esri.views.3d.layers.SceneLayerGraphicsView3D"),$=H();let X=class extends(L(q(O(Z)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this.drapeSourceType=A.Features,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new B,this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}initialize(){var e,t;const r=this.layer;this.addResolvingPromise(r.indexInfo),this._attributeOverrides=new V(this.layer,null==(e=this.view.resourceController)?void 0:e.memoryController),M(r,this.view.spatialReference,this.view.viewingMode),this.fieldsHelper=new Q({layerView:this}),this.updatingHandles.add((()=>r.rangeInfos),(e=>this._rangeInfosChanged(e)),n),this.updatingHandles.add((()=>r.renderer),((e,t)=>this._rendererChange(e,t))),this.updatingHandles.add((()=>this.parsedDefinitionExpression),(()=>this._filterChange())),this.updatingHandles.add((()=>this.view.floors),(()=>this.processor.filterVisibility.filterChanged())),this.handles.add(d(k,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&k.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||k.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}))),this._set("processor",new j({owner:this,layer:r,preferredUpdatePolicy:K.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,suspendResumeExtentMode:"data",dataExtent:r.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),null==(t=this.processor.elevationAlignment)||t.events.on("invalidate-elevation",(e=>this._invalidateElevation(e))),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",r.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.setup()),this._memCache=this.view.resourceController.memoryController.newCache(r.uid),this._controller=new I({layerView:this,scaleVisibilityEnabled:!1}),R(this.layer.geometryDefinitions)&&(this._worker=new F((e=>this.view.resourceController.schedule(e)))),this.handles.add(this.layer.on("apply-edits",(e=>this.updatingHandles.addPromise(e.result)))),this.handles.add(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{this._queryEngine=new N({layerView:this,priority:Y.FEATURE_QUERY_ENGINE}),this.updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),n),this.updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._attributeOverrides=i(this._attributeOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this._nodesAddedToStage.clear(),this.fieldsHelper=i(this.fieldsHelper)}get requiredFields(){var e,t;return null!=(e=null==(t=this.fieldsHelper)?void 0:t.requiredFields)?e:[]}get maximumNumberOfFeatures(){const e=this.processor&&this.processor.graphicsCore&&this.processor.graphicsCore.displayFeatureLimit;return e?e.maximumNumberOfFeatures:0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller&&!this._controller.leavesReached)}get hasM(){return!1}get hasZ(){return!0}notifyGraphicGeometryChanged(e){this.processor.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.processor.graphicsCore.notifyGraphicVisibilityChanged(e)}async whenGraphicAttributes(e,t){return P(this.layer,e,this._getObjectIdField(),t,(()=>[...this._nodesAddedToStage.values()]))}getGraphicFromGraphicUid(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,t):null}whenGraphicBounds(e,t){return this.processor.graphicsCore.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.graphicsCore.computeAttachmentOrigin(e,t)}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}isUpdating(){var e,t,r;return!!(null!=(e=this._controller)&&e.updating||null!=(t=this.processor)&&t.updating||null!=(r=this.fieldsHelper)&&r.updating)}getRenderingInfo(e,t,r){const i=S(e,{renderer:t,arcade:r});if(s(i)&&i.color){const e=i.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return i}async getRenderingInfoAsync(e,t,r,i){return C(e,{renderer:t,arcade:r,...i})}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return T(this.attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return o(this._worker)&&(this._worker=new F((e=>this.view.resourceController.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(s(e)){return{positionData:e.positions,featureIds:e.featureIds}}throw new Error("Failed to decompress Draco point data")}))}_checkExtent(e,t){e&&!_(e,t)&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&J.error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&J.error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!re(t)&&!te(t))return Promise.reject();if(this._nodesAddedToStage.has(e.index))return void J.error("I3S node "+e.id+" already added");const i=s(this.layer.fullExtent)?se(this.layer.fullExtent.clone(),.5):null,o=this._controller.crsVertex,a=[],n={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(re(t)?await this._addNodeBinaryPointData(e,n,t,i,a,r):te(t)&&this._addNodeLegacyPointData(e,n,t,i,a),await this._attributeOverrides.apply(n.featureIds,t.attributeDataInfo,r),e.numFeatures=n.graphics.length,this._updateNodeMemory(e),ie(n),a.length>0&&(this._computeObb(e,a,o),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return this._cacheNodeData(n),Promise.resolve();if(s(this._verticalScale))for(const s of n.graphics)this._verticalScale(s.geometry);return this._nodesAddedToStage.set(e.index,n),this.loadedGraphics.addMany(n.graphics),this._filterNode(n),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;g(t,r,0,t,s,0,t.length/3);const o={data:t,size:3};e.serviceObb=z(o),i.isGeographic&&m(e.serviceObb.center,s,e.serviceObb.center,i)}isNodeLoaded(e){return this._nodesAddedToStage.has(e)}isNodeReloading(){return!1}updateNodeState(){}async _addNodeBinaryPointData(e,r,i,o,n,d){const l=await this._extractBinaryPointData(i,d);if(null==l)return Promise.reject();const h=this._getObjectIdField(),p=this._controller.crsVertex,m=this.view.spatialReference,f=this.processor.graphicsCore,{positionData:y,featureIds:_}=l,b=3,E=y.length/b,x=new Array;for(let I=0;I<E;I++){const r=s(e.serviceObb)?e.serviceObb.center:[0,0,0],i=I*b,d=c(y[i+0],y[i+1],y[i+2]);u(d,d,r),e.serviceObb||n.push(d[0],d[1],d[2]),s(o)&&this._checkExtent(o,d);const l=_[I],E={};null!=l&&(E[h]=l);const w=null==l?t.generateUID():l;g(d,p,0,ae,m,0,1);const S=v(ae[0],ae[1],ae[2],m),C=this.loadedGraphics.get(w);if(s(C))C.level<e.level&&(ne.property="geometry",ne.graphic=C,ne.oldValue=a(C.geometry),ne.newValue=S,C.geometry=S,f.graphicUpdateHandler(ne)),x.push(C);else{const r=t.generateUID();x.push({objectId:w,uid:r,geometry:S,attributes:E,visible:!0,level:e.level})}}r.graphics=x,r.featureIds=_}_addNodeLegacyPointData(e,r,i,o,a){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,h=[0,0,0],u=new Array,c=new Array;for(const p of i.pointData){const r=p.featureDataPosition,i=r.length,m=p.geometries&&p.geometries[0]||oe[i],f=p.featureIds[0];if("points"!==m.params.type)continue;s(o)&&this._checkExtent(o,r);const y={};null!=f&&(y[n]=f);const _=null==f?t.generateUID():f;let b;"Embedded"===m.type&&(b=m.params.vertexAttributes.position);for(let o=0;o<b.length;o+=i){for(let e=0;e<i;e++)h[e]=r[e]+b[o+e];const n=3===i;e.serviceObb||a.push(h[0],h[1],n?h[2]:0),g(h,d,0,ae,l,0,1);const u=v(ae[0],ae[1],n?ae[2]:void 0,l),p=this.loadedGraphics.get(_);s(p)?c.push(p):c.push({objectId:_,uid:t.generateUID(),geometry:u,attributes:y,visible:!0})}u.push(f)}r.graphics=c,r.featureIds=u}_updateNodeMemory(e){e.memory=4096+(s(e.numFeatures)?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>E(t)+e),512+8*e.featureIds.length+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this._nodesAddedToStage.forEach((e=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}})),this._nodesAddedToStage.clear(),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this._nodesAddedToStage.get(e);return t?(this.loadedGraphics.removeMany(t.graphics),this._nodesAddedToStage.delete(e),this._treeDebugger&&this._treeDebugger.update(),t):null}async loadCachedNodeData(e){return this._memCache.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,i){if(!this._nodesAddedToStage.has(e.index))return this.loadedGraphics.addMany(t.graphics),this._nodesAddedToStage.set(e.index,t),this._updateNodeMemory(e),await this.updateAttributes(e.index,r,i),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update(),Promise.resolve();J.error("I3S node "+e.id+" already added")}getLoadedNodeIds(){const e=[];return this._nodesAddedToStage.forEach((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this._nodesAddedToStage.forEach((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this._nodesAddedToStage.forEach(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this._nodesAddedToStage.get(e);if(t&&s(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&s(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!o(r.attributeInfo)&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this._nodesAddedToStage.get(e);i&&(await this._attributeOverrides.apply(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){if(ie(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||"OBJECTID"}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&J.warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this._nodesAddedToStage.forEach((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression;for(const r of e.graphics){const e=r.visible;r.visible=!t||this._evaluateClause(t,r),e!==r.visible&&(ne.graphic=r,ne.property="visible",ne.oldValue=e,ne.newValue=r.visible,this.processor.graphicsCore.graphicUpdateHandler(ne))}}_invalidateElevation(e){const t=this._controller.crsIndex;f(e.extent,e.spatialReference,de,t),this._controller.updateElevationChanged(de,t)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return s(this.filter)?this.filter.createQuery(e):new D(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),null==t?void 0:t.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),null==t?void 0:t.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),null==t?void 0:t.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),null==t?void 0:t.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():D.from(e))}getUsedMemory(){const e=this.processor&&this.processor.graphicsCore;return e?e.usedMemory:0}getUnloadedMemory(){const e=this.processor&&this.processor.graphicsCore;return.8*((this._controller?this._controller.unloadedMemoryEstimate:0)+(e?e.unprocessedMemoryEstimate:0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){G(this.attributeEditingContext,e)}get attributeEditingContext(){const e=this._getObjectIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,forEachNode:e=>this._nodesAddedToStage.forEach((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo,attributeOverrides:this._attributeOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const o=this._nodesAddedToStage.get(t);if(s(i)){const t=this.loadedGraphics.get(i.attributes[e]);s(t)&&this.processor.graphicsCore.recreateGraphics([t])}else s(o)&&this.processor.graphicsCore.recreateGraphics(o.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this._nodesAddedToStage.size,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this._nodesAddedToStage.size,numFeatures:this.loadedGraphics.length}}};e([l()],X.prototype,"processor",void 0),e([l({type:w})],X.prototype,"filter",void 0),e([l()],X.prototype,"loadedGraphics",void 0),e([l({aliasOf:"layer"})],X.prototype,"i3slayer",void 0),e([l()],X.prototype,"_controller",void 0),e([l()],X.prototype,"updating",void 0),e([l()],X.prototype,"suspended",void 0),e([l()],X.prototype,"holeFilling",void 0),e([l(W)],X.prototype,"updatingProgress",void 0),e([l({aliasOf:"_controller.updatingProgress"})],X.prototype,"updatingProgressValue",void 0),e([l($.requiredFields)],X.prototype,"requiredFields",null),e([l($.availableFields)],X.prototype,"availableFields",void 0),e([l()],X.prototype,"fieldsHelper",void 0),e([l({type:Number})],X.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],X.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0,aliasOf:"view.qualitySettings.sceneService.point.lodFactor"})],X.prototype,"lodFactor",void 0),e([l({readOnly:!0})],X.prototype,"hasM",null),e([l({readOnly:!0})],X.prototype,"hasZ",null),X=e([h("esri.views.3d.layers.SceneLayerGraphicsView3D")],X);const ee=X;function te(e){return"pointData"in e}function re(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function ie(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const i=e.graphics[r];if(i.attributes||(i.attributes={}),s(t)&&s(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(i.attributes[e]=U(t.attributeData[e],r))}}function se(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.hasZ&&(e.zmin-=t,e.zmax+=t),e.hasM&&(e.mmin-=t,e.mmax+=t),e}const oe={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},ae=p(),ne={graphic:null,property:null,oldValue:null,newValue:null},de=y();export{ee as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../core/Error.js";import{init as r}from"../../../core/watchUtils.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import a from"../../../layers/VoxelWasmManager.js";import{LayerView3D as n}from"./LayerView3D.js";import l from"../../layers/LayerView.js";import{ContextType as p}from"../../webgl/context-util.js";let d=class extends(n(l)){constructor(){super(...arguments),this.type="voxel-3d",this._wasmLayerId=-1}initialize(){if("local"!==this.view.viewingMode)throw new s("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(this.view._stage.renderView.renderingContext.type!==p.WEBGL2)throw new s("voxel:unsupported-context","Voxel layers are supported in WebGL2 rendering contexts only.",{});const e=this.layer.spatialReference;if(!o(e,this.view.spatialReference))throw new s("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});const t=a.getInstance(),i=t.addLayer(this.view,this).then((e=>{this._wasmLayerId=e,this._suspendedHandle=r(this,"suspended",(e=>{a.getInstance().setLayerEnabled(this.view,this,!e)}))})).catch((e=>{if(t.removeLayer(this.view,this),this._wasmLayerId=-1,-1===e)throw new s("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===e)throw new s("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})}));this.addResolvingPromise(i)}destroy(){a.getInstance().removeLayer(this.view,this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){return!(this._wasmLayerId<0)&&a.getInstance().isUpdating(this.view,this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}};e([t()],d.prototype,"layer",void 0),e([t({readOnly:!0,aliasOf:"layer.parsedUrl.path"})],d.prototype,"baseUrl",void 0),d=e([i("esri.views.3d.layers.VoxelLayerView3D")],d);const h=d;export{h as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{isSome as s}from"../../../core/maybe.js";import{init as t}from"../../../core/watchUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import n from"../../../layers/VoxelWasmManager.js";import{LayerView3D as l}from"./LayerView3D.js";import d from"../../layers/LayerView.js";import{ContextType as m}from"../../webgl/context-util.js";let p=class extends(l(d)){constructor(){super(...arguments),this._usedMemory=0,this._futureMemory=0,this.type="voxel-3d",this._wasmLayerId=-1}initialize(){if("local"!==this.view.viewingMode)throw new r("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(this.view._stage.renderView.renderingContext.type!==m.WEBGL2)throw new r("voxel:unsupported-context","Voxel layers are supported in WebGL2 rendering contexts only.",{});const e=this.layer.spatialReference;if(!a(e,this.view.spatialReference))throw new r("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});const i=this.layer.style.currentVariableId,o=this.layer.getVolume(i),l=this.layer.getVariable(i);if(s(o)&&s(l)){const e=o.dimensions[0],r=o.dimensions[1],s=o.getZDimension();if(s>1){const t=o.dimensions[s],i=e.size*r.size*t.size;let a=1;switch(l.renderingFormat.type){case"Int16":case"UInt16":a=2;break;case"Int32":case"UInt32":case"Float32":a=4}this._futureMemory=a*i}}const d=n.getInstance(),p=d.addLayer(this.view,this).then((e=>{this._wasmLayerId=e,this._suspendedHandle=t(this,"suspended",(e=>{n.getInstance().setLayerEnabled(this.view,this,!e)}))})).catch((e=>{if(d.removeLayer(this.view,this),this._wasmLayerId=-1,-1===e)throw new r("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===e)throw new r("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})}));this.addResolvingPromise(p)}destroy(){n.getInstance().removeLayer(this.view,this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){return!(this._wasmLayerId<0)&&n.getInstance().isUpdating(this.view,this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}getUsedMemory(){return this._usedMemory}getUnloadedMemory(){return this._futureMemory}ignoresMemoryFactor(){return!0}get performanceInfo(){return{nodes:0,displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null}}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}};e([i()],p.prototype,"layer",void 0),e([i({readOnly:!0,aliasOf:"layer.parsedUrl.path"})],p.prototype,"baseUrl",void 0),p=e([o("esri.views.3d.layers.VoxelLayerView3D")],p);const c=p;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import"../../../../renderers/ClassBreaksRenderer.js";import"../../../../renderers/DictionaryRenderer.js";import"../../../../renderers/DotDensityRenderer.js";import"../../../../renderers/HeatmapRenderer.js";import"../../../../renderers/Renderer.js";import"../../../../renderers/SimpleRenderer.js";import t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import"../../../../symbols.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Handles.js";import a from"../../../../core/Logger.js";import{someMap as n,findInMap as o}from"../../../../core/MapUtils.js";import{isSome as l,unwrapOr as h,isNone as d,removeMaybe as c,destroyMaybe as p,get as y,unwrap as m}from"../../../../core/maybe.js";import g from"../../../../core/PooledArray.js";import{throwIfAborted as u,eachAlways as b,createDeferred as f,isAbortError as v}from"../../../../core/promiseUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{when as S,whenFalse as _,init as w,whenOnce as G,on as x}from"../../../../core/watchUtils.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as R}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as D,isEmpty as E}from"../../../../core/accessorSupport/diffUtils.js";import{s as I,b as U,a as O}from"../../../../chunks/vec3.js";import{c as A}from"../../../../chunks/vec3f64.js";import{projectVectorToVector as L,projectXYZToVector as j,canProjectWithoutEngine as V,projectBuffer as F}from"../../../../geometry/projection.js";import{create as T,center as k,fromRect as W,equals as M}from"../../../../geometry/support/aaBoundingBox.js";import{create as N}from"../../../../geometry/support/aaBoundingRect.js";import z from"../../../../layers/Layer.js";import{getObjectId as B,computeAABB as q,hasGeometry as H}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as Y}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as $,validateTo3D as Z}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as J}from"../../../../support/arcadeOnDemand.js";import{getDefaultSymbol3D as Q}from"../../../../symbols/support/defaults3D.js";import{to3D as K}from"../../../../symbols/support/symbolConversion.js";import{ViewElevationProvider as X}from"./ElevationQuery.js";import{VisibilityFlag as ee,VisibilityGroup as te}from"./enums.js";import{extractExpressionInfo as ie,createContext as re}from"./featureExpressionInfoUtils.js";import se from"./Graphics3DFeatureStore.js";import ae from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ne}from"./Graphics3DSymbolCreationContext.js";import{make as oe}from"./Graphics3DSymbolFactory.js";import le from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as he}from"./GraphicStateTracking.js";import{computeCentroid as de}from"./graphicUtils.js";import{ApplyRendererDiffResult as ce}from"./interfaces.js";import{LoadStatus as pe}from"./Loadable.js";import{SpatialIndex2D as ye}from"./SpatialIndex2D.js";import{averageSymbolComplexities as me,defaultSymbolComplexity as ge}from"./symbolComplexity.js";import{StageLayerElevationProvider as ue}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as be}from"../../support/extentUtils.js";import{PropertiesPool as fe}from"../../support/PropertiesPool.js";import{UpdatePolicy as ve}from"../../webgl-engine/lib/basicInterfaces.js";import{GridLocalOriginFactory as Ce}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{WebGLLayer as Se}from"../../webgl-engine/lib/WebGLLayer.js";import{ImmediateTask as _e,noBudget as we,TaskPriority as Ge}from"../../../support/Scheduler.js";import xe from"../../../../geometry/Extent.js";import Pe from"../../../../geometry/Point.js";import Re from"../../../../symbols/LabelSymbol3D.js";import De from"../../../../symbols/TextSymbol.js";import Ee from"../../../../symbols/WebStyleSymbol.js";var Ie;const Ue=A(),Oe=T(),Ae=a.getLogger("esri.views.3d.layers.graphics.Graphics3DCore");let Le=Ie=class extends i{constructor(e){super(e),this.propertiesPool=new fe({computedExtent:xe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this.graphicStateTracking=null,this.symbolCreationContext=new ne(((e,t)=>this._frameTask.schedule(e,t))),this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this.graphicsDrapedUids=new Set,this.graphicsBySymbol=new Map,this.symbolConversionCache=new Map,this.symbols=new Map,this.graphicsWithoutSymbol=new Map,this.graphicsWaitingForSymbol=new Map,this.graphicsUpdateId=0,this._handles=new s,this._frameTask=_e,this.suspendSymbolCleanup=!1,this._spatialReference=null,this.arcadeOnDemand=null,this.rendererChangeAbortController=null,this.elevationInfoChangeAbortController=null,this.setupAbortController=null,this.elevationAlignment=null,this.scaleVisibility=null,this.filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this.featureStore=null,this.deconflictor=null,this.labeler=null,this.objectStates=null,this.viewElevationProvider=null,this.stageLayerElevationProvider=null,this.sharedSymbolResourcesOwnerHandle=null,this.whenGraphics3DGraphicRequests={},this.pendingUpdates=new Map,this.numberOfGraphics=0,this.numberOfGraphicsProvidingElevation=0,this.pendingAdds=0,this.pendingRemoves=0,this.pendingUpdatesPool=new g({allocator:e=>e||new Ve,deallocator:e=>(e.clear(),e)}),this.symbolWarningLogged=!1,this.geometryWarningLogged=!1,this.objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new g,this.preferredUpdatePolicy=ve.SYNC,this.forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=void 0,this._startCreateGraphics=!1}get spatialIndex(){var e;this._spatialIndex||(this._spatialIndex=new ye({objectIdField:null==(e=this.owner.layer)?void 0:e.objectIdField,spatialReference:this._spatialReference,hasZ:this.hasZ,hasM:this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values())));return this._spatialIndex.update(),this._spatialIndex}get effectiveUpdatePolicy(){return l(this.currentRenderer)&&"dictionary"===this.currentRenderer.type?ve.ASYNC:h(this.forcedUpdatePolicy,this.preferredUpdatePolicy)}get updating(){var e,t;return!!(this.graphicsWaitingForSymbol.size>0||this.running||null!=(e=this.elevationAlignment)&&e.updating||l(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(t=this.filterVisibility)&&t.updating||this.rendererChangeAbortController||this.elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating)}get running(){var e;return this.pendingUpdates.size>0||!(null==(e=this._spatialIndex)||!e.updating)}get suspendedOrOutsideOfView(){var e;return this.owner.suspended||(null==(e=this.owner.suspendInfo)?void 0:e.outsideOfView)}get updatingRemaining(){var e,t;return this.updating?this.pendingUpdates.size+.1*((null==(e=this._spatialIndex)?void 0:e.updatingRemaining)||0)+.1*((null==(t=this.elevationAlignment)?void 0:t.updatingRemaining)||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?e.graphics3D.minTotalNumberOfFeatures:0,i=e?e.graphics3D.maxTotalNumberOfFeatures:0,r=e?e.graphics3D.maxTotalNumberOfPrimitives:0,s=this.averageSymbolComplexity,a=Math.max(1,l(s)?s.primitivesPerFeature:1),n=l(s)&&s.drawCallsPerFeature>0?i/s.drawCallsPerFeature*.3:i,o=Math.ceil(r/a),h=Math.max(t,Math.min(i,o,n)),d=this._get("displayFeatureLimit");return d&&d.minimumTotalNumberOfFeatures===t&&d.maximumTotalNumberOfFeatures===i&&d.maximumTotalNumberOfPrimitives===r&&d.averageSymbolComplexity===s&&d.maximumNumberOfFeatures===h?d:{minimumTotalNumberOfFeatures:t,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:r,averageSymbolComplexity:s,maximumNumberOfFeatures:h}}get averageSymbolComplexity(){const e=me(this.symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||l(t)&&(e.estimated&&(t.primitivesPerFeature>=e.primitivesPerFeature||t.primitivesPerCoordinate>=e.primitivesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.primitivesPerFeature===e.primitivesPerFeature&&t.primitivesPerCoordinate===e.primitivesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get spatialReference(){return this._spatialReference}get usedMemory(){const e=l(this.averageSymbolComplexity)&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this.numberOfGraphics:0;return this._usedMemory+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this.numberOfGraphics)return Math.abs(this.pendingAdds-this.pendingRemoves)/this.numberOfGraphics>30?0:this._usedMemory/this.numberOfGraphics;if(l(this.averageSymbolComplexity)){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return Math.max(0,(this.pendingAdds-this.pendingRemoves)*this.usedMemoryPerGraphic)}get symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this.symbolConversionCache.get(e.id);if(l(t))return t;const i=K(e,{retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return d(r)&&i.error&&Ae.error(i.error.message),this.symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(d(e))return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e&&e.backgroundFillSymbol;if(!(i||t&&t.length))return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);l(s)&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);l(e)&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(d(e))return null;const t=this.symbols.get(e.id);if(l(t))return t.complexity;const i=this._getConvertedSymbol(e);return l(i)?ge(i):null}_getSymbolComplexitiesUsed(){const e=[];return this.symbols.forEach((t=>{l(t)&&e.push(t.complexity)})),e}initialize(){this._spatialReference=this.owner.view.spatialReference,this._set("featureStore",new se({objectIdField:this.owner.layer&&this.owner.layer.objectIdField,hasZ:this.hasZ,hasM:this.hasM,spatialReference:this._spatialReference,getSpatialIndex:()=>this.spatialIndex,forAllGraphics:e=>this.graphics3DGraphics.forEach(e)}))}async setup(e){this.setupAbortController=new AbortController;const t=this.setupAbortController.signal;this._set("elevationAlignment",e.elevationAlignment),this._set("scaleVisibility",e.scaleVisibility),this._set("filterVisibility",e.filterVisibility),this._set("deconflictor",e.deconflictor),this._set("labeler",e.labeler),this._set("objectStates",e.objectStates);const i=this.owner.view;this.viewElevationProvider=new X(this._spatialReference,i),this._initializeStage(i,this.layer.uid),this.symbolCreationContext.sharedResources=i.sharedSymbolResources,this.sharedSymbolResourcesOwnerHandle=i.sharedSymbolResources.addGraphicsOwner(this.owner),l(this.currentRenderer)&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.sharedSymbolResources.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=i.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.layerView=this.owner,this.symbolCreationContext.localOriginFactory=new Ce(i.renderSpatialReference),this.symbolCreationContext.elevationProvider=i.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(t),this.symbolCreationContext.screenSizePerspectiveEnabled=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings.physicallyBasedRenderingEnabled;const s="layer"in this.owner?["layer.screenSizePerspectiveEnabled,view.screenSizePerspectiveEnabled"]:"view.screenSizePerspectiveEnabled";this._handles.add([this.watch("suspendedOrOutsideOfView",(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),this.owner.watch(s,(()=>{const e=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;var t;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,null==(t=this.labeler)||t.reset(),this.recreateAllGraphics())})),this.owner.watch("slicePlaneEnabled",(e=>this._slicePlaneEnabledChange(!!e))),this.owner.view.watch("pixelRatio",(()=>this._pixelRatioChange())),this.owner.view.watch("qualitySettings.physicallyBasedRenderingEnabled",(e=>this._physicalBasedRenderingChange(e))),S(i.basemapTerrain,"tilingScheme",(e=>{e.spatialReference.equals(this.symbolCreationContext.overlaySR)||(this.symbolCreationContext.overlaySR=i.basemapTerrain.spatialReference),this._handles.has("loaded-graphics")?this.recreateAllGraphics():this._handles.add([x(this.owner,"loadedGraphics","change",(e=>this._graphicsCollectionChanged(e)),(()=>this.recreateAllGraphics())),x(this.owner,"loadedGraphics","after-changes",(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()),(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()))],"loaded-graphics")})),_(this,"asyncUpdates",(()=>this.runTask(we)),!0),w(this,"effectiveUpdatePolicy",(e=>{l(this.stageLayer)&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===ve.ASYNC,e===ve.SYNC&&this.runTask(we)}),!0)]),this._frameTask=i.resourceController.scheduler.registerTask(Ge.GRAPHICS_CORE,this),this.owner.layer&&"featureReduction"in this.owner.layer&&this._handles.add(this.owner.watch("layer.featureReduction",(()=>this.deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity");try{await this.rendererChange(this.layer.renderer)}catch{}u(t),this.setupAbortController=null}_abortSetup(){this.setupAbortController&&(this.setupAbortController.abort(),this.setupAbortController=null)}destroy(){this._abortSetup(),this._abortRendererChange(),this._abortElevationInfoChange(),this.owner.view.deconflictor.removeGraphicsOwner(this),this.owner.view.labeler.removeGraphicsOwner(this),this._updatingPendingLoadedGraphicsChange=c(this._updatingPendingLoadedGraphicsChange),this.clear(),this.graphicStateTracking=p(this.graphicStateTracking),this.stage&&(this.stage.remove(this.stageLayer),this.stageLayer=null,this.stage=null),this._handles=p(this._handles),this._frameTask.remove(),this._frameTask=_e,this._spatialReference=null,this._set("owner",null);for(const e in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null,this.sharedSymbolResourcesOwnerHandle=c(this.sharedSymbolResourcesOwnerHandle),this.propertiesPool=p(this.propertiesPool),this.pendingUpdatesPool=null,this.symbolConversionCache.clear(),this.objectIdInvisibleSet.clear(),this._spatialIndex=p(this._spatialIndex),this._set("featureStore",p(this.featureStore))}clear(){var e,t;null==(e=this.objectStates)||e.allGraphicsDeleted(),l(this.graphicStateTracking)&&this.graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach((e=>e.destroy())),null==(t=this._spatialIndex)||t.clear(),this.graphics3DGraphics.clear(),this.numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this.symbols.forEach(p),this.symbols.clear(),this.graphicsBySymbol.clear(),this.graphicsWithoutSymbol.clear(),this.graphicsWaitingForSymbol.clear(),this.pendingUpdates.clear(),this.pendingUpdatesPool.clear(),this.pendingAdds=0,this.pendingRemoves=0,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this.featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new Se({isPickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t),this.stage.add(this.stageLayer);const i=this.stageLayer.events;i.on("objectTransformation",(e=>this.notifyGraphicGeometryChanged(e.metadata.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.metadata.graphicUid))),i.on("objectGeometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("objectGeometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("vertexAttrsUpdated",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)))}notifyGraphicGeometryChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this.numberOfGraphics>e*Fe,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.isPickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.isVisible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){var t;return null!=(t=this.owner.layer)&&t.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer&&this.owner.layer.objectIdField){return B(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer&&this.owner.layer.objectIdField;if(!e)return null;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);l(s)&&t.set(s,i)})),t}get labelsEnabled(){return!(!this.labeler||!this.labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this.deconflictor&&this.deconflictor.labelingInfoChange(e),i=this.labeler&&this.labeler.labelingInfoChange(e);await b([t,i])}updateVisibilityInfo(){this.deconflictor&&this.deconflictor.labelingInfoChange(),this.labeler&&this.labeler.visibilityInfoChange()}get symbolUpdateType(){if(this.pendingUpdates.size>0)return"unknown";let e=0,t=0;return n(this.symbols,((i,r)=>{if(l(i)){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this.graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining")}setObjectIdVisibility(e,t){t?this.objectIdInvisibleSet.delete(e):this.objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);l(i)&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return o(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(d(e))return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(d(i)||!this.objectIdInvisibleSet.has(i));return e.setVisibilityFlag(ee.USER_SETTING,r,te.GRAPHIC)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this.whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=f();return this.whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._spatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>F(e,r,t,e,i,t,s),n=(e,t,r)=>F(e,s,t,e,i,t,r),o=this.viewElevationProvider?{service:this.viewElevationProvider,useViewElevation:l(t)&&t.useViewElevation,minDemResolution:l(t)&&t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,d=await e.getProjectedBoundingBox(a,n,o,y(t,"signal"));if(!d)return null;const c=d.boundingBox;if(d.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){k(c,Ue);const t=h(e.getElevation(Ue[0],Ue[1],0,i,"ground"),0);c[2]=Math.min(c[2],t),c[5]=Math.max(c[5],t)}}return{boundingBox:c,screenSpaceObjects:d.screenSpaceObjects}}async whenGraphicBounds(e,t){await G(this.owner,"loadedGraphics");const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find((t=>t===e||i&&t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;I(Te,0,0,0);let s=0;if(r.render.num>0){if(!L(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,ke,t))return null;U(Te,Te,ke),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=h(this.viewElevationProvider.getElevation(e,i,"ground"),0);if(I(ke,e,i,a),!L(ke,this.viewElevationProvider.spatialReference,ke,t))return null;U(Te,Te,ke),s++}return s>1&&O(Te,Te,1/s),new Pe({x:Te[0],y:Te[1],z:Te[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this.symbols.get(e.id);if(d(i))throw new r("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=e.symbolLayers.indexOf(t);if(-1===s)throw new r("internal:missing-symbol-layer","Symbol layer is not in symbol");const a=i.getSymbolLayerSize(s);if(null==a)throw new r("internal:missing-size","Symbol layer has no valid size");return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t),r=this.graphicsWithoutSymbol.get(t);if(i||r)switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){const i=t.graphic.geometry;if(d(i))return void this._recreateGraphic(t.graphic);if(d(e)){const e=t.graphic.symbol&&t.graphic.symbol.id;if(e){const t=this.symbols.get(e);if(l(t)&&t.loadStatus===pe.LOADING)return}return void this._recreateGraphic(t.graphic)}const r=e.graphics3DSymbol;!d(t.newValue)&&r.updateGeometry(e,t.newValue)||this._recreateGraphic(e.graphic),this._expandComputedExtent(i)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=l(e)?e.graphics3DSymbol:l(t.oldValue)?this.symbols.get(t.oldValue.id):null;if(d(r)||d(t.newValue))return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(l(a)&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this.graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=D(s,a);if(d(o))return void this._updateSymbolMapping(s.id,a);const h={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(h),!E(h.diff))return void this._recreateGraphic(i);const c=this._getRenderingInfo(i);if(d(c))return void this._recreateGraphic(i);const p=r.extentPadding;for(const l of h.symbolStatePatches)l();if(p!==r.extentPadding&&this._recomputeExtentPadding(),l(e))for(const l of h.graphics3DGraphicPatches)l(e,c);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}recreateGraphics(e){this.suspendSymbolCleanup=!0,this.remove(e),this.add(e),this.suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===ve.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this.graphicsUpdateId;return this.graphicsUpdateId++,this.graphicsWaitingForSymbol.set(e.uid,t),1===this.graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this.graphicsWaitingForSymbol.delete(e.uid),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this.symbols.forEach((t=>{l(t)&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Oe,i=e.spatialReference;q(e,t);const r=this._spatialReference,s=Ie.tmpVec;if(i.equals(r)||j(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],j(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(!a||null==a.zmin||t[2]<a.zmin),h=o&&(!a||null==a.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this.propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this.propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this.elevationInfoChangeAbortController&&(this.elevationInfoChangeAbortController.abort(),this.elevationInfoChangeAbortController=null)}async elevationInfoChange(){var e,t;this._abortElevationInfoChange();const i=new AbortController;this.elevationInfoChangeAbortController=i;const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(i),this.elevationInfoChangeAbortController=null,null==(e=this.labeler)||e.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelGraphics;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),null==(t=this.elevationAlignment)||t.elevationInfoChange()}updateStageLayerElevationProvider(){this.stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this.numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this.numberOfGraphicsProvidingElevation>0&&(this.stageLayerElevationProvider=new ue({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this.stageLayerElevationProvider))}_clearSymbolsAndGraphics(){var e,t,i,r,s;this.clear(),null==(e=this.filterVisibility)||e.clear(),null==(t=this.labeler)||t.reset(),null==(i=this.deconflictor)||i.clear(),null==(r=this.elevationAlignment)||r.clear(),null==(s=this.stageLayer)||s.invalidateSpatialQueryAccelerator(),this.stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null)}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t&&t.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this.graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{var r;const s=e.usedMemory;this._conditionalRemove(e,t),null==(r=this._spatialIndex)||r.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,s),this._updateLayerVisibility(),this.featureStore.events.emit("changed")})),this.graphicsBySymbol.set(e,new Map));const r=this.symbols.get(e);p(r),this.symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this.graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){var i,r,s;this.graphicsDrapedUids.delete(t),null==(i=this.objectStates)||i.removeGraphic(e),null==(r=this.labeler)||r.removeGraphic(e),null==(s=this.deconflictor)||s.removeGraphic(e),l(this.graphicStateTracking)&&this.graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(e)===ve.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Ae.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===ve.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(l(t.geometry)&&"mesh"===t.geometry.type&&!t.geometry.loaded)return ve.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this.geometryWarningLogged=!1,this.symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Ae),ve.SYNC);this._cleanupSymbols(),this.labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this.pendingUpdates.get(e);i?i.add?i.state!==je.NEW&&i.abortController.abort():this.pendingAdds++:(i=this.pendingUpdatesPool.pushNew(),this.pendingAdds++,this.pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===ve.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this.pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this.pendingUpdates.delete(e),i.state===je.LOADING&&i.abortController.abort(),this.pendingAdds--);else{const i=this.pendingUpdatesPool.pushNew();i.remove=t,this.pendingUpdates.set(e,i),this.pendingRemoves++}}0===this.pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this.pendingUpdatesPool.clear(),this._cleanupSymbols(),(this.pendingAdds||this.pendingRemoves)&&Ae.warn("pendingAdds/Removes in inconsistent state!"),this.pendingAdds=0,this.pendingRemoves=0}_applyPendingUpdates(e){var t;if(this.geometryWarningLogged=!1,this.symbolWarningLogged=!1,0===this.pendingUpdates.size&&null!=(t=this._spatialIndex)&&t.updating)this._spatialIndex.update();else{for(const[t,i]of this.pendingUpdates){if(e.done)break;i.add&&i.state===je.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==je.READY||(this.pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=ve.SYNC),i.add)switch(i.state){case je.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this.pendingAdds--,e.madeProgress();break;case je.REJECTED:i.add=null,this.pendingAdds--;case je.LOADING:}null==i.remove&&null==i.add&&this.pendingUpdates.delete(t)}0===this.pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}}_processPendingUpdateNew(e){if(!e.add)return void(e.state=je.READY);const t=e.add.geometry;l(t)&&"mesh"===t.type&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=je.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,v(t)?e.state=je.NEW:e.state=je.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(d(this.layer.renderer)||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Ae),void(e.state=je.READY);e.state=je.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(v(i)?e.state=je.NEW:e.state=je.REJECTED)}d(t)||d(t.symbol)?(Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=je.READY}_addGraphic(e,t,i){if(this.graphicsWithoutSymbol.set(e.uid,e),d(t)||d(t.symbol)||!H(e))return;const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(d(s))return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new ae(e,t,this.layer);let o=!1;const h=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(h);const c=()=>{if(this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this.graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced;else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&l(t)&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this.featureStore.events.emit("changed"),this.labeler&&this.owner.view.labeler.setDirty()},p=t=>{this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),o||(v(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};i===ve.ASYNC?s.load((()=>this._frameTask.schedule(c)),(e=>this._frameTask.schedule((()=>p(e))))):s.load(c,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){var r;i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,s=i.isElevationSource;this._conditionalRemove(i,t),null==(r=this._spatialIndex)||r.remove(i);const a=i.graphics3DSymbol.symbol.id;this.graphicsBySymbol.get(a).delete(t),this.graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,s),i.destroy(),this.featureStore.events.emit("changed")}else this.graphicsWithoutSymbol.delete(t),this.graphicsWaitingForSymbol.delete(t),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Re||e instanceof De){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some((t=>t.symbol===e))}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof Re&&!this._hasLabelingContext(e))||(Ae.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(d(i))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!V(i.spatialReference,this._spatialReference))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||l(this.currentRenderer)))s=this.owner.getRenderingInfo(r,this.currentRenderer,m(this.arcadeOnDemand));else{s={symbol:r.symbol||Q(r.geometry)}}return d(s)||d(s.symbol)?(t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){const i=e.geometry;if(d(i))return Ae&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;return this.owner.getRenderingInfoAsync(r,m(this.currentRenderer),m(this.arcadeOnDemand),t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(l(t)&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=K(t.backgroundFillSymbol,{ignoreDrivers:!0});l(e.symbol)&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=oe(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this.symbols.get(e.id);return void 0===i&&(i=e instanceof Ee?new le(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this.symbols.set(e.id,i)),l(i)&&++i.referenced,i}trackGraphicState(e){return d(this.graphicStateTracking)&&(this.graphicStateTracking=new he(this)),this.graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this.numberOfGraphics++,e.isElevationSource&&(this.numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this.numberOfGraphics--,i&&(this.numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){var i,r,s,a;const n=t.graphic;if(this.graphicsWithoutSymbol.delete(n.uid),!this.symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;const o=e.createGraphics3DGraphic(t);if(d(o))return null;this._addGraphics3DGraphic(o);const h=e.symbol.id;this.graphicsBySymbol.has(h)||this.graphicsBySymbol.set(h,new Map),this.graphicsBySymbol.get(h).set(n.uid,o);o.isDraped&&this.graphicsDrapedUids.add(n.uid),o.centroid=null,l(n.geometry)&&"point"!==n.geometry.type&&(o.centroid=de(n.geometry,this._spatialReference)),this._updateUserVisibility(o),l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(o),null==(i=this.filterVisibility)||i.updateVisibility(o),null==(r=this.deconflictor)||r.addGraphic(o),null==(s=this.labeler)||s.addGraphic(o),null==(a=this.objectStates)||a.addGraphic(o),this.deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,o),o.initialize(this.stage,this.stageLayer,this.owner),l(this.graphicStateTracking)&&this.graphicStateTracking.addGraphic(o);const c=this.whenGraphics3DGraphicRequests[n.uid];return c&&(delete this.whenGraphics3DGraphicRequests[n.uid],c.resolve(o)),o}_abortRendererChange(){this.rendererChangeAbortController&&(this.rendererChangeAbortController.abort(),this.rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),d(e)&&this._currentRendererChange(null,!1),$(e))if(l(e)&&e.arcadeRequired){const t=new AbortController;this.rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();u(t),i.hasGeometryOperations(e)&&(await i.enableGeometryOperations(),u(t)),this.effectiveUpdatePolicy===ve.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,!0)),t.signal):this._currentRendererChange(e,!0),this.rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===ve.ASYNC){const t=new AbortController;this.rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this.rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return d(this.arcadeOnDemand)?(this.arcadeOnDemand=await J(),this.arcadeOnDemand):this.arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=m(this.arcadeOnDemand);const i=this.symbolCreationContext.renderer;if(e===i)return;if(this.symbolConversionCache.clear(),d(e))return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=D(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,d(r)||("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this.graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof z?this.layer:null,h=m(this.arcadeOnDemand);if(s===i.defaultSymbol&&i.getSymbol(Y(o,l),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this.graphicsWithoutSymbol.set(n,o);const c=this.graphics3DGraphics.get(n);this._conditionalRemove(c,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()})),this._whenSymbolRemoved.forAll((e=>e(s.id)))}(e.length||r.length)&&(this.graphicsWithoutSymbol.forEach((e=>r.push(e))),this.graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,s=e.diff.uniqueValueInfos;if(r||s){const a=s?s.added.map((e=>e.symbol)):[],n=s?s.removed.map((e=>e.symbol)):[];if(s)for(let e=0;e<s.changed.length;e++)a.push(s.changed[e].newValue.symbol),n.push(s.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&n.push(i.defaultSymbol),t.defaultSymbol&&a.push(t.defaultSymbol)):i.defaultSymbol&&a.length&&n.push(t.defaultSymbol),this._applySymbolSetDiff(a,n,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,i,r){const s=e=>l(e)?e.id:null;if(i instanceof t&&r instanceof t&&(d(e)||"partial"===e.type)){const t=e&&e.diff,a=t&&t.defaultSymbol,n=t&&t.uniqueValueInfos;let o;return o=n?n.unchanged.map((e=>({oldId:s(e.oldValue.symbol),newId:s(e.newValue.symbol)}))):r.uniqueValueInfos.map(((e,t)=>({oldId:s(e.symbol),newId:s(i.uniqueValueInfos[t].symbol)}))),!a&&r.defaultSymbol&&o.push({oldId:s(r.defaultSymbol),newId:s(i.defaultSymbol)}),o}return[]}_updateSymbolMapping(e,t){const i=l(t)&&t?"string"==typeof t?t:t.id:null,r="string"==typeof t?null:t;if(!e||e===i)return;const s=this.graphicsBySymbol.get(e);this.graphicsBySymbol.delete(e),void 0!==s&&this.graphicsBySymbol.set(i,s);const a=this.symbols.get(e);void 0!==a&&(this.symbols.delete(e),this.symbols.set(i,a),l(a)&&(l(r)?a.symbol=r:a.symbol.id=i))}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this.graphicsBySymbol){const r=this.symbols.get(t);if(l(r))switch(r.applyRendererDiff(e,i)){case ce.Recreate_Symbol:this._recreateSymbol(t);break;case ce.Recreate_Graphics:this._recreateGraphicsForSymbol(t);case ce.Fast_Update:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.isSliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this.deconflictor&&this.deconflictor.slicePlaneEnabledChange(),this.labeler&&this.labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){e!==this.symbolCreationContext.physicalBasedRenderingEnabled&&(this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=N();return be(e,r,t)?this.symbolCreationContext.clippingExtent=W(T(),r):this.symbolCreationContext.clippingExtent=null,!M(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this.symbols){if(d(i))return;e(i,this.graphicsBySymbol.get(t)||We,t)}}updateAllGraphicsVisibility(){this.filterVisibility&&(this.filterVisibility.dirty=!0),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(e);return t||i}))}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(ee.USER_SETTING,!1,te.GRAPHIC)))}_validateRenderer(e){const t=Z(e);if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Ae.warn(e,t.message)}}_volatileGraphicsUpdated(){var e;null==(e=this.labeler)||e.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this.graphicsWaitingForSymbol.size>0||this.suspendSymbolCleanup)return;let e=!1;this.symbols.forEach(((t,i)=>{if(d(t)||t.referenced>0)return;const r=this.graphicsBySymbol.get(i);r&&0!==r.size||(this.graphicsBySymbol.delete(i),this.symbols.delete(i),p(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this.symbols.keys()].sort(),graphicsBySymbol:[...this.graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this.graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this.graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this.graphicsDrapedUids].sort(),pendingUpdates:this.pendingUpdates}),symbols:this.symbols,filterVisibility:this.filterVisibility,numPending:this.pendingUpdates.size,forceUpdatePolicy:e=>{this.forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this.graphicsWithoutSymbol.size,pending:this.pendingUpdates.size}}};var je;Le.tmpVec=A(),e([P({readOnly:!0})],Le.prototype,"computedExtent",void 0),e([P()],Le.prototype,"currentRenderer",void 0),e([P()],Le.prototype,"rendererHasGeometryOperations",void 0),e([P()],Le.prototype,"_frameTask",void 0),e([P()],Le.prototype,"rendererChangeAbortController",void 0),e([P()],Le.prototype,"elevationInfoChangeAbortController",void 0),e([P()],Le.prototype,"setupAbortController",void 0),e([P({readOnly:!0})],Le.prototype,"elevationAlignment",void 0),e([P({readOnly:!0})],Le.prototype,"scaleVisibility",void 0),e([P({readOnly:!0})],Le.prototype,"filterVisibility",void 0),e([P()],Le.prototype,"_spatialIndex",void 0),e([P({readOnly:!0})],Le.prototype,"extentPadding",void 0),e([P()],Le.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([P({readOnly:!0})],Le.prototype,"featureStore",void 0),e([P({readOnly:!0})],Le.prototype,"deconflictor",void 0),e([P({readOnly:!0})],Le.prototype,"labeler",void 0),e([P({readOnly:!0})],Le.prototype,"objectStates",void 0),e([P()],Le.prototype,"preferredUpdatePolicy",void 0),e([P()],Le.prototype,"forcedUpdatePolicy",void 0),e([P({readOnly:!0})],Le.prototype,"effectiveUpdatePolicy",null),e([P({constructOnly:!0})],Le.prototype,"elevationFeatureExpressionEnabled",void 0),e([P({constructOnly:!0})],Le.prototype,"owner",void 0),e([P({constructOnly:!0})],Le.prototype,"layer",void 0),e([P({constructOnly:!0})],Le.prototype,"graphicSymbolSupported",void 0),e([P({constructOnly:!0})],Le.prototype,"getRenderingInfoWithoutRenderer",void 0),e([P({readOnly:!0})],Le.prototype,"updating",null),e([P({readOnly:!0})],Le.prototype,"running",null),e([P({readOnly:!0})],Le.prototype,"suspendedOrOutsideOfView",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"updatingRemaining",null),e([P({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],Le.prototype,"displayFeatureLimit",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"averageSymbolComplexity",null),e([P({constructOnly:!0})],Le.prototype,"hasZ",void 0),e([P({constructOnly:!0})],Le.prototype,"hasM",void 0),Le=Ie=e([R("esri.views.3d.layers.graphics.Graphics3DCore")],Le),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(je||(je={}));class Ve{constructor(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.abortController=null,this.remove=null}}const Fe=10,Te=A(),ke=A(),We=new Map;export{Le as Graphics3DCore};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import"../../../../renderers/ClassBreaksRenderer.js";import"../../../../renderers/DictionaryRenderer.js";import"../../../../renderers/DotDensityRenderer.js";import"../../../../renderers/HeatmapRenderer.js";import"../../../../renderers/Renderer.js";import"../../../../renderers/SimpleRenderer.js";import t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import"../../../../symbols.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Handles.js";import a from"../../../../core/Logger.js";import{someMap as n,findInMap as o}from"../../../../core/MapUtils.js";import{isSome as l,unwrapOr as h,isNone as d,removeMaybe as c,destroyMaybe as p,get as y,unwrap as m}from"../../../../core/maybe.js";import g from"../../../../core/PooledArray.js";import{throwIfAborted as u,eachAlways as b,createDeferred as f,isAbortError as v}from"../../../../core/promiseUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{when as S,whenFalse as _,init as w,whenOnce as G,on as x}from"../../../../core/watchUtils.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as R}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as D,isEmpty as E}from"../../../../core/accessorSupport/diffUtils.js";import{s as I,b as O,a as U}from"../../../../chunks/vec3.js";import{c as A}from"../../../../chunks/vec3f64.js";import{projectVectorToVector as L,projectXYZToVector as j,canProjectWithoutEngine as V,projectBuffer as F}from"../../../../geometry/projection.js";import{create as T,center as k,fromRect as W,equals as M}from"../../../../geometry/support/aaBoundingBox.js";import{create as N}from"../../../../geometry/support/aaBoundingRect.js";import z from"../../../../layers/Layer.js";import{getObjectId as B,computeAABB as q,hasGeometry as H}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as Y}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as $,validateTo3D as Z}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as J}from"../../../../support/arcadeOnDemand.js";import{getDefaultSymbol3D as Q}from"../../../../symbols/support/defaults3D.js";import{to3D as K}from"../../../../symbols/support/symbolConversion.js";import{ViewElevationProvider as X}from"./ElevationQuery.js";import{VisibilityFlag as ee,VisibilityGroup as te}from"./enums.js";import{extractExpressionInfo as ie,createContext as re}from"./featureExpressionInfoUtils.js";import se from"./Graphics3DFeatureStore.js";import ae from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ne}from"./Graphics3DSymbolCreationContext.js";import{make as oe}from"./Graphics3DSymbolFactory.js";import le from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as he}from"./GraphicStateTracking.js";import{computeCentroid as de}from"./graphicUtils.js";import{ApplyRendererDiffResult as ce}from"./interfaces.js";import{LoadStatus as pe}from"./Loadable.js";import{SpatialIndex2D as ye}from"./SpatialIndex2D.js";import{averageSymbolComplexities as me,defaultSymbolComplexity as ge}from"./symbolComplexity.js";import{StageLayerElevationProvider as ue}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as be}from"../../support/extentUtils.js";import{PropertiesPool as fe}from"../../support/PropertiesPool.js";import{UpdatePolicy as ve}from"../../webgl-engine/lib/basicInterfaces.js";import{GridLocalOriginFactory as Ce}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{WebGLLayer as Se}from"../../webgl-engine/lib/WebGLLayer.js";import{ImmediateTask as _e,noBudget as we,TaskPriority as Ge}from"../../../support/Scheduler.js";import xe from"../../../../geometry/Extent.js";import Pe from"../../../../geometry/Point.js";import Re from"../../../../symbols/LabelSymbol3D.js";import De from"../../../../symbols/TextSymbol.js";import Ee from"../../../../symbols/WebStyleSymbol.js";var Ie;const Oe=A(),Ue=T(),Ae=a.getLogger("esri.views.3d.layers.graphics.Graphics3DCore");let Le=Ie=class extends i{constructor(e){super(e),this.propertiesPool=new fe({computedExtent:xe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this.graphicStateTracking=null,this.symbolCreationContext=new ne(((e,t)=>this._frameTask.schedule(e,t))),this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this.graphicsDrapedUids=new Set,this.graphicsBySymbol=new Map,this.symbolConversionCache=new Map,this.symbols=new Map,this.graphicsWithoutSymbol=new Map,this.graphicsWaitingForSymbol=new Map,this.graphicsUpdateId=0,this._handles=new s,this._frameTask=_e,this.suspendSymbolCleanup=!1,this._spatialReference=null,this.arcadeOnDemand=null,this.rendererChangeAbortController=null,this.elevationInfoChangeAbortController=null,this.setupAbortController=null,this.elevationAlignment=null,this.scaleVisibility=null,this.filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this.featureStore=null,this.deconflictor=null,this.labeler=null,this.objectStates=null,this.viewElevationProvider=null,this.stageLayerElevationProvider=null,this.sharedSymbolResourcesOwnerHandle=null,this.whenGraphics3DGraphicRequests={},this.pendingUpdates=new Map,this.numberOfGraphics=0,this.numberOfGraphicsProvidingElevation=0,this.pendingAdds=0,this.pendingRemoves=0,this.pendingUpdatesPool=new g({allocator:e=>e||new Ve,deallocator:e=>(e.clear(),e)}),this.symbolWarningLogged=!1,this.geometryWarningLogged=!1,this.objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new g,this.preferredUpdatePolicy=ve.SYNC,this.forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=void 0,this._startCreateGraphics=!1}get spatialIndex(){var e;this._spatialIndex||(this._spatialIndex=new ye({objectIdField:null==(e=this.owner.layer)?void 0:e.objectIdField,spatialReference:this._spatialReference,hasZ:this.hasZ,hasM:this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values())));return this._spatialIndex.update(),this._spatialIndex}get effectiveUpdatePolicy(){return l(this.currentRenderer)&&"dictionary"===this.currentRenderer.type?ve.ASYNC:h(this.forcedUpdatePolicy,this.preferredUpdatePolicy)}get updating(){var e,t;return!!(this.graphicsWaitingForSymbol.size>0||this.running||null!=(e=this.elevationAlignment)&&e.updating||l(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(t=this.filterVisibility)&&t.updating||this.rendererChangeAbortController||this.elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating)}get running(){var e;return this.pendingUpdates.size>0||!(null==(e=this._spatialIndex)||!e.updating)}get suspendedOrOutsideOfView(){var e;return this.owner.suspended||(null==(e=this.owner.suspendInfo)?void 0:e.outsideOfView)}get updatingRemaining(){var e,t;return this.updating?this.pendingUpdates.size+.1*((null==(e=this._spatialIndex)?void 0:e.updatingRemaining)||0)+.1*((null==(t=this.elevationAlignment)?void 0:t.updatingRemaining)||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?e.graphics3D.minTotalNumberOfFeatures:0,i=e?e.graphics3D.maxTotalNumberOfFeatures:0,r=e?e.graphics3D.maxTotalNumberOfPrimitives:0,s=this.averageSymbolComplexity,a=Math.max(1,l(s)?s.primitivesPerFeature:1),n=l(s)&&s.drawCallsPerFeature>0?i/s.drawCallsPerFeature*.3:i,o=Math.ceil(r/a),h=Math.max(t,Math.min(i,o,n)),d=this._get("displayFeatureLimit");return d&&d.minimumTotalNumberOfFeatures===t&&d.maximumTotalNumberOfFeatures===i&&d.maximumTotalNumberOfPrimitives===r&&d.averageSymbolComplexity===s&&d.maximumNumberOfFeatures===h?d:{minimumTotalNumberOfFeatures:t,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:r,averageSymbolComplexity:s,maximumNumberOfFeatures:h}}get averageSymbolComplexity(){const e=me(this.symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||l(t)&&(e.estimated&&(t.primitivesPerFeature>=e.primitivesPerFeature||t.primitivesPerCoordinate>=e.primitivesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.primitivesPerFeature===e.primitivesPerFeature&&t.primitivesPerCoordinate===e.primitivesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get spatialReference(){return this._spatialReference}get usedMemory(){const e=l(this.averageSymbolComplexity)&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this.numberOfGraphics:0;return this._usedMemory+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this.numberOfGraphics)return Math.abs(this.pendingAdds-this.pendingRemoves)/this.numberOfGraphics>30?0:this._usedMemory/this.numberOfGraphics;if(l(this.averageSymbolComplexity)){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return Math.max(0,(this.pendingAdds-this.pendingRemoves)*this.usedMemoryPerGraphic)}get symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this.symbolConversionCache.get(e.id);if(l(t))return t;const i=K(e,{retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return d(r)&&i.error&&Ae.error(i.error.message),this.symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(d(e))return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e&&e.backgroundFillSymbol;if(!(i||t&&t.length))return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);l(s)&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);l(e)&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(d(e))return null;const t=this.symbols.get(e.id);if(l(t))return t.complexity;const i=this._getConvertedSymbol(e);return l(i)?ge(i):null}_getSymbolComplexitiesUsed(){const e=[];return this.symbols.forEach((t=>{l(t)&&e.push(t.complexity)})),e}initialize(){this._spatialReference=this.owner.view.spatialReference,this._set("featureStore",new se({objectIdField:this.owner.layer&&this.owner.layer.objectIdField,hasZ:this.hasZ,hasM:this.hasM,spatialReference:this._spatialReference,getSpatialIndex:()=>this.spatialIndex,forAllGraphics:e=>this.graphics3DGraphics.forEach(e)}))}async setup(e){this.setupAbortController=new AbortController;const t=this.setupAbortController.signal;this._set("elevationAlignment",e.elevationAlignment),this._set("scaleVisibility",e.scaleVisibility),this._set("filterVisibility",e.filterVisibility),this._set("deconflictor",e.deconflictor),this._set("labeler",e.labeler),this._set("objectStates",e.objectStates);const i=this.owner.view;this.viewElevationProvider=new X(this._spatialReference,i),this._initializeStage(i,this.layer.uid),this.symbolCreationContext.sharedResources=i.sharedSymbolResources,this.sharedSymbolResourcesOwnerHandle=i.sharedSymbolResources.addGraphicsOwner(this.owner),l(this.currentRenderer)&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.sharedSymbolResources.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=i.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Ce(i.renderSpatialReference),this.symbolCreationContext.elevationProvider=i.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(t),this.symbolCreationContext.screenSizePerspectiveEnabled=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings.physicallyBasedRenderingEnabled;const s="layer"in this.owner?["layer.screenSizePerspectiveEnabled,view.screenSizePerspectiveEnabled"]:"view.screenSizePerspectiveEnabled";this._handles.add([this.watch("suspendedOrOutsideOfView",(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),this.owner.watch(s,(()=>{const e=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;var t;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,null==(t=this.labeler)||t.reset(),this.recreateAllGraphics())})),this.owner.watch("slicePlaneEnabled",(e=>this._slicePlaneEnabledChange(!!e))),this.owner.view.watch("pixelRatio",(()=>this._pixelRatioChange())),this.owner.view.watch("qualitySettings.physicallyBasedRenderingEnabled",(e=>this._physicalBasedRenderingChange(e))),S(i.basemapTerrain,"tilingScheme",(e=>{e.spatialReference.equals(this.symbolCreationContext.overlaySR)||(this.symbolCreationContext.overlaySR=i.basemapTerrain.spatialReference),this._handles.has("loaded-graphics")?this.recreateAllGraphics():this._handles.add([x(this.owner,"loadedGraphics","change",(e=>this._graphicsCollectionChanged(e)),(()=>this.recreateAllGraphics())),x(this.owner,"loadedGraphics","after-changes",(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()),(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()))],"loaded-graphics")})),_(this,"asyncUpdates",(()=>this.runTask(we)),!0),w(this,"effectiveUpdatePolicy",(e=>{l(this.stageLayer)&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===ve.ASYNC,e===ve.SYNC&&this.runTask(we)}),!0)]),this._frameTask=i.resourceController.scheduler.registerTask(Ge.GRAPHICS_CORE,this),this.owner.layer&&"featureReduction"in this.owner.layer&&this._handles.add(this.owner.watch("layer.featureReduction",(()=>this.deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity");try{await this.rendererChange(this.layer.renderer)}catch{}u(t),this.setupAbortController=null}_abortSetup(){this.setupAbortController&&(this.setupAbortController.abort(),this.setupAbortController=null)}destroy(){this._abortSetup(),this._abortRendererChange(),this._abortElevationInfoChange(),this.owner.view.deconflictor.removeGraphicsOwner(this),this.owner.view.labeler.removeGraphicsOwner(this),this._updatingPendingLoadedGraphicsChange=c(this._updatingPendingLoadedGraphicsChange),this.clear(),this.graphicStateTracking=p(this.graphicStateTracking),this.stage&&(this.stage.remove(this.stageLayer),this.stageLayer=null,this.stage=null),this._handles=p(this._handles),this._frameTask.remove(),this._frameTask=_e,this._spatialReference=null,this._set("owner",null);for(const e in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null,this.sharedSymbolResourcesOwnerHandle=c(this.sharedSymbolResourcesOwnerHandle),this.propertiesPool=p(this.propertiesPool),this.pendingUpdatesPool=null,this.symbolConversionCache.clear(),this.objectIdInvisibleSet.clear(),this._spatialIndex=p(this._spatialIndex),this._set("featureStore",p(this.featureStore))}clear(){var e,t;null==(e=this.objectStates)||e.allGraphicsDeleted(),l(this.graphicStateTracking)&&this.graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach((e=>e.destroy())),null==(t=this._spatialIndex)||t.clear(),this.graphics3DGraphics.clear(),this.numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this.symbols.forEach(p),this.symbols.clear(),this.graphicsBySymbol.clear(),this.graphicsWithoutSymbol.clear(),this.graphicsWaitingForSymbol.clear(),this.pendingUpdates.clear(),this.pendingUpdatesPool.clear(),this.pendingAdds=0,this.pendingRemoves=0,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this.featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new Se({isPickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t),this.stage.add(this.stageLayer);const i=this.stageLayer.events;i.on("objectTransformation",(e=>this.notifyGraphicGeometryChanged(e.metadata.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.metadata.graphicUid))),i.on("objectGeometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("objectGeometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("vertexAttrsUpdated",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)))}notifyGraphicGeometryChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this.numberOfGraphics>e*Fe,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.isPickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.isVisible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){var t;return null!=(t=this.owner.layer)&&t.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer&&this.owner.layer.objectIdField){return B(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer&&this.owner.layer.objectIdField;if(!e)return null;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);l(s)&&t.set(s,i)})),t}get labelsEnabled(){return!(!this.labeler||!this.labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this.deconflictor&&this.deconflictor.labelingInfoChange(e),i=this.labeler&&this.labeler.labelingInfoChange(e);await b([t,i])}updateVisibilityInfo(){this.deconflictor&&this.deconflictor.labelingInfoChange(),this.labeler&&this.labeler.visibilityInfoChange()}get symbolUpdateType(){if(this.pendingUpdates.size>0)return"unknown";let e=0,t=0;return n(this.symbols,((i,r)=>{if(l(i)){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this.graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining")}setObjectIdVisibility(e,t){t?this.objectIdInvisibleSet.delete(e):this.objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);l(i)&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return o(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(d(e))return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(d(i)||!this.objectIdInvisibleSet.has(i));return e.setVisibilityFlag(ee.USER_SETTING,r,te.GRAPHIC)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this.whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=f();return this.whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._spatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>F(e,r,t,e,i,t,s),n=(e,t,r)=>F(e,s,t,e,i,t,r),o=this.viewElevationProvider?{service:this.viewElevationProvider,useViewElevation:l(t)&&t.useViewElevation,minDemResolution:l(t)&&t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,d=await e.getProjectedBoundingBox(a,n,o,y(t,"signal"));if(!d)return null;const c=d.boundingBox;if(d.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){k(c,Oe);const t=h(e.getElevation(Oe[0],Oe[1],0,i,"ground"),0);c[2]=Math.min(c[2],t),c[5]=Math.max(c[5],t)}}return{boundingBox:c,screenSpaceObjects:d.screenSpaceObjects}}async whenGraphicBounds(e,t){await G(this.owner,"loadedGraphics");const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find((t=>t===e||i&&t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;I(Te,0,0,0);let s=0;if(r.render.num>0){if(!L(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,ke,t))return null;O(Te,Te,ke),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=h(this.viewElevationProvider.getElevation(e,i,"ground"),0);if(I(ke,e,i,a),!L(ke,this.viewElevationProvider.spatialReference,ke,t))return null;O(Te,Te,ke),s++}return s>1&&U(Te,Te,1/s),new Pe({x:Te[0],y:Te[1],z:Te[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this.symbols.get(e.id);if(d(i))throw new r("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=e.symbolLayers.indexOf(t);if(-1===s)throw new r("internal:missing-symbol-layer","Symbol layer is not in symbol");const a=i.getSymbolLayerSize(s);if(null==a)throw new r("internal:missing-size","Symbol layer has no valid size");return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t),r=this.graphicsWithoutSymbol.get(t);if(i||r)switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){const i=t.graphic.geometry;if(d(i))return void this._recreateGraphic(t.graphic);if(d(e)){const e=t.graphic.symbol&&t.graphic.symbol.id;if(e){const t=this.symbols.get(e);if(l(t)&&t.loadStatus===pe.LOADING)return}return void this._recreateGraphic(t.graphic)}const r=e.graphics3DSymbol;!d(t.newValue)&&r.updateGeometry(e,t.newValue)||this._recreateGraphic(e.graphic),this._expandComputedExtent(i)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=l(e)?e.graphics3DSymbol:l(t.oldValue)?this.symbols.get(t.oldValue.id):null;if(d(r)||d(t.newValue))return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(l(a)&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this.graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=D(s,a);if(d(o))return void this._updateSymbolMapping(s.id,a);const h={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(h),!E(h.diff))return void this._recreateGraphic(i);const c=this._getRenderingInfo(i);if(d(c))return void this._recreateGraphic(i);const p=r.extentPadding;for(const l of h.symbolStatePatches)l();if(p!==r.extentPadding&&this._recomputeExtentPadding(),l(e))for(const l of h.graphics3DGraphicPatches)l(e,c);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}recreateGraphics(e){this.suspendSymbolCleanup=!0,this.remove(e),this.add(e),this.suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===ve.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this.graphicsUpdateId;return this.graphicsUpdateId++,this.graphicsWaitingForSymbol.set(e.uid,t),1===this.graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this.graphicsWaitingForSymbol.delete(e.uid),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this.symbols.forEach((t=>{l(t)&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Ue,i=e.spatialReference;q(e,t);const r=this._spatialReference,s=Ie.tmpVec;if(i.equals(r)||j(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],j(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(!a||null==a.zmin||t[2]<a.zmin),h=o&&(!a||null==a.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this.propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this.propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this.elevationInfoChangeAbortController&&(this.elevationInfoChangeAbortController.abort(),this.elevationInfoChangeAbortController=null)}async elevationInfoChange(){var e,t;this._abortElevationInfoChange();const i=new AbortController;this.elevationInfoChangeAbortController=i;const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(i),this.elevationInfoChangeAbortController=null,null==(e=this.labeler)||e.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelGraphics;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),null==(t=this.elevationAlignment)||t.elevationInfoChange()}updateStageLayerElevationProvider(){this.stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this.numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this.numberOfGraphicsProvidingElevation>0&&(this.stageLayerElevationProvider=new ue({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this.stageLayerElevationProvider))}_clearSymbolsAndGraphics(){var e,t,i,r,s;this.clear(),null==(e=this.filterVisibility)||e.clear(),null==(t=this.labeler)||t.reset(),null==(i=this.deconflictor)||i.clear(),null==(r=this.elevationAlignment)||r.clear(),null==(s=this.stageLayer)||s.invalidateSpatialQueryAccelerator(),this.stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null)}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t&&t.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this.graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{var r;const s=e.usedMemory;this._conditionalRemove(e,t),null==(r=this._spatialIndex)||r.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,s),this._updateLayerVisibility(),this.featureStore.events.emit("changed")})),this.graphicsBySymbol.set(e,new Map));const r=this.symbols.get(e);p(r),this.symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this.graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){var i,r,s;this.graphicsDrapedUids.delete(t),null==(i=this.objectStates)||i.removeGraphic(e),null==(r=this.labeler)||r.removeGraphic(e),null==(s=this.deconflictor)||s.removeGraphic(e),l(this.graphicStateTracking)&&this.graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(e)===ve.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Ae.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===ve.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(l(t.geometry)&&"mesh"===t.geometry.type&&!t.geometry.loaded)return ve.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this.geometryWarningLogged=!1,this.symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Ae),ve.SYNC);this._cleanupSymbols(),this.labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this.pendingUpdates.get(e);i?i.add?i.state!==je.NEW&&i.abortController.abort():this.pendingAdds++:(i=this.pendingUpdatesPool.pushNew(),this.pendingAdds++,this.pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===ve.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this.pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this.pendingUpdates.delete(e),i.state===je.LOADING&&i.abortController.abort(),this.pendingAdds--);else{const i=this.pendingUpdatesPool.pushNew();i.remove=t,this.pendingUpdates.set(e,i),this.pendingRemoves++}}0===this.pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this.pendingUpdatesPool.clear(),this._cleanupSymbols(),(this.pendingAdds||this.pendingRemoves)&&Ae.warn("pendingAdds/Removes in inconsistent state!"),this.pendingAdds=0,this.pendingRemoves=0}_applyPendingUpdates(e){var t;if(this.geometryWarningLogged=!1,this.symbolWarningLogged=!1,0===this.pendingUpdates.size&&null!=(t=this._spatialIndex)&&t.updating)this._spatialIndex.update();else{for(const[t,i]of this.pendingUpdates){if(e.done)break;i.add&&i.state===je.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==je.READY||(this.pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=ve.SYNC),i.add)switch(i.state){case je.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this.pendingAdds--,e.madeProgress();break;case je.REJECTED:i.add=null,this.pendingAdds--;case je.LOADING:}null==i.remove&&null==i.add&&this.pendingUpdates.delete(t)}0===this.pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}}_processPendingUpdateNew(e){if(!e.add)return void(e.state=je.READY);const t=e.add.geometry;l(t)&&"mesh"===t.type&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=je.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,v(t)?e.state=je.NEW:e.state=je.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(d(this.layer.renderer)||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Ae),void(e.state=je.READY);e.state=je.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(v(i)?e.state=je.NEW:e.state=je.REJECTED)}d(t)||d(t.symbol)?(Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=je.READY}_addGraphic(e,t,i){if(this.graphicsWithoutSymbol.set(e.uid,e),d(t)||d(t.symbol)||!H(e))return;const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(d(s))return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new ae(e,t,this.layer);let o=!1;const h=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(h);const c=()=>{if(this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this.graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced;else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&l(t)&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this.featureStore.events.emit("changed"),this.labeler&&this.owner.view.labeler.setDirty()},p=t=>{this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),o||(v(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};i===ve.ASYNC?s.load((()=>this._frameTask.schedule(c)),(e=>this._frameTask.schedule((()=>p(e))))):s.load(c,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){var r;i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,s=i.isElevationSource;this._conditionalRemove(i,t),null==(r=this._spatialIndex)||r.remove(i);const a=i.graphics3DSymbol.symbol.id;this.graphicsBySymbol.get(a).delete(t),this.graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,s),i.destroy(),this.featureStore.events.emit("changed")}else this.graphicsWithoutSymbol.delete(t),this.graphicsWaitingForSymbol.delete(t),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Re||e instanceof De){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some((t=>t.symbol===e))}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof Re&&!this._hasLabelingContext(e))||(Ae.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(d(i))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!V(i.spatialReference,this._spatialReference))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||l(this.currentRenderer)))s=this.owner.getRenderingInfo(r,this.currentRenderer,m(this.arcadeOnDemand));else{s={symbol:r.symbol||Q(r.geometry)}}return d(s)||d(s.symbol)?(t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){const i=e.geometry;if(d(i))return Ae&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;return this.owner.getRenderingInfoAsync(r,m(this.currentRenderer),m(this.arcadeOnDemand),t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(l(t)&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=K(t.backgroundFillSymbol,{ignoreDrivers:!0});l(e.symbol)&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=oe(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this.symbols.get(e.id);return void 0===i&&(i=e instanceof Ee?new le(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this.symbols.set(e.id,i)),l(i)&&++i.referenced,i}trackGraphicState(e){return d(this.graphicStateTracking)&&(this.graphicStateTracking=new he(this)),this.graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this.numberOfGraphics++,e.isElevationSource&&(this.numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this.numberOfGraphics--,i&&(this.numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){var i,r,s,a;const n=t.graphic;if(this.graphicsWithoutSymbol.delete(n.uid),!this.symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;const o=e.createGraphics3DGraphic(t);if(d(o))return null;this._addGraphics3DGraphic(o);const h=e.symbol.id;this.graphicsBySymbol.has(h)||this.graphicsBySymbol.set(h,new Map),this.graphicsBySymbol.get(h).set(n.uid,o);o.isDraped&&this.graphicsDrapedUids.add(n.uid),o.centroid=null,l(n.geometry)&&"point"!==n.geometry.type&&(o.centroid=de(n.geometry,this._spatialReference)),this._updateUserVisibility(o),l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(o),null==(i=this.filterVisibility)||i.updateVisibility(o),null==(r=this.deconflictor)||r.addGraphic(o),null==(s=this.labeler)||s.addGraphic(o),null==(a=this.objectStates)||a.addGraphic(o),this.deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,o),o.initialize(this.stage,this.stageLayer,this.owner),l(this.graphicStateTracking)&&this.graphicStateTracking.addGraphic(o);const c=this.whenGraphics3DGraphicRequests[n.uid];return c&&(delete this.whenGraphics3DGraphicRequests[n.uid],c.resolve(o)),o}_abortRendererChange(){this.rendererChangeAbortController&&(this.rendererChangeAbortController.abort(),this.rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),d(e)&&this._currentRendererChange(null,!1),$(e))if(l(e)&&e.arcadeRequired){const t=new AbortController;this.rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();u(t),i.hasGeometryOperations(e)&&(await i.enableGeometryOperations(),u(t)),this.effectiveUpdatePolicy===ve.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,!0)),t.signal):this._currentRendererChange(e,!0),this.rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===ve.ASYNC){const t=new AbortController;this.rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this.rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return d(this.arcadeOnDemand)?(this.arcadeOnDemand=await J(),this.arcadeOnDemand):this.arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=m(this.arcadeOnDemand);const i=this.symbolCreationContext.renderer;if(e===i)return;if(this.symbolConversionCache.clear(),d(e))return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=D(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,d(r)||("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this.graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof z?this.layer:null,h=m(this.arcadeOnDemand);if(s===i.defaultSymbol&&i.getSymbol(Y(o,l),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this.graphicsWithoutSymbol.set(n,o);const c=this.graphics3DGraphics.get(n);this._conditionalRemove(c,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()})),this._whenSymbolRemoved.forAll((e=>e(s.id)))}(e.length||r.length)&&(this.graphicsWithoutSymbol.forEach((e=>r.push(e))),this.graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,s=e.diff.uniqueValueInfos;if(r||s){const a=s?s.added.map((e=>e.symbol)):[],n=s?s.removed.map((e=>e.symbol)):[];if(s)for(let e=0;e<s.changed.length;e++)a.push(s.changed[e].newValue.symbol),n.push(s.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&n.push(i.defaultSymbol),t.defaultSymbol&&a.push(t.defaultSymbol)):i.defaultSymbol&&a.length&&n.push(t.defaultSymbol),this._applySymbolSetDiff(a,n,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,i,r){const s=e=>l(e)?e.id:null;if(i instanceof t&&r instanceof t&&(d(e)||"partial"===e.type)){const t=e&&e.diff,a=t&&t.defaultSymbol,n=t&&t.uniqueValueInfos;let o;return o=n?n.unchanged.map((e=>({oldId:s(e.oldValue.symbol),newId:s(e.newValue.symbol)}))):r.uniqueValueInfos.map(((e,t)=>({oldId:s(e.symbol),newId:s(i.uniqueValueInfos[t].symbol)}))),!a&&r.defaultSymbol&&o.push({oldId:s(r.defaultSymbol),newId:s(i.defaultSymbol)}),o}return[]}_updateSymbolMapping(e,t){const i=l(t)&&t?"string"==typeof t?t:t.id:null,r="string"==typeof t?null:t;if(!e||e===i)return;const s=this.graphicsBySymbol.get(e);this.graphicsBySymbol.delete(e),void 0!==s&&this.graphicsBySymbol.set(i,s);const a=this.symbols.get(e);void 0!==a&&(this.symbols.delete(e),this.symbols.set(i,a),l(a)&&(l(r)?a.symbol=r:a.symbol.id=i))}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this.graphicsBySymbol){const r=this.symbols.get(t);if(l(r))switch(r.applyRendererDiff(e,i)){case ce.Recreate_Symbol:this._recreateSymbol(t);break;case ce.Recreate_Graphics:this._recreateGraphicsForSymbol(t);case ce.Fast_Update:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.isSliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this.deconflictor&&this.deconflictor.slicePlaneEnabledChange(),this.labeler&&this.labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){e!==this.symbolCreationContext.physicalBasedRenderingEnabled&&(this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=N();return be(e,r,t)?this.symbolCreationContext.clippingExtent=W(T(),r):this.symbolCreationContext.clippingExtent=null,!M(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this.symbols){if(d(i))return;e(i,this.graphicsBySymbol.get(t)||We,t)}}updateAllGraphicsVisibility(){this.filterVisibility&&(this.filterVisibility.dirty=!0),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(e);return t||i}))}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(ee.USER_SETTING,!1,te.GRAPHIC)))}_validateRenderer(e){const t=Z(e);if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Ae.warn(e,t.message)}}_volatileGraphicsUpdated(){var e;null==(e=this.labeler)||e.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this.graphicsWaitingForSymbol.size>0||this.suspendSymbolCleanup)return;let e=!1;this.symbols.forEach(((t,i)=>{if(d(t)||t.referenced>0)return;const r=this.graphicsBySymbol.get(i);r&&0!==r.size||(this.graphicsBySymbol.delete(i),this.symbols.delete(i),p(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this.symbols.keys()].sort(),graphicsBySymbol:[...this.graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this.graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this.graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this.graphicsDrapedUids].sort(),pendingUpdates:this.pendingUpdates}),symbols:this.symbols,filterVisibility:this.filterVisibility,numPending:this.pendingUpdates.size,forceUpdatePolicy:e=>{this.forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this.graphicsWithoutSymbol.size,pending:this.pendingUpdates.size}}};var je;Le.tmpVec=A(),e([P({readOnly:!0})],Le.prototype,"computedExtent",void 0),e([P()],Le.prototype,"currentRenderer",void 0),e([P()],Le.prototype,"rendererHasGeometryOperations",void 0),e([P()],Le.prototype,"_frameTask",void 0),e([P()],Le.prototype,"rendererChangeAbortController",void 0),e([P()],Le.prototype,"elevationInfoChangeAbortController",void 0),e([P()],Le.prototype,"setupAbortController",void 0),e([P({readOnly:!0})],Le.prototype,"elevationAlignment",void 0),e([P({readOnly:!0})],Le.prototype,"scaleVisibility",void 0),e([P({readOnly:!0})],Le.prototype,"filterVisibility",void 0),e([P()],Le.prototype,"_spatialIndex",void 0),e([P({readOnly:!0})],Le.prototype,"extentPadding",void 0),e([P()],Le.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([P({readOnly:!0})],Le.prototype,"featureStore",void 0),e([P({readOnly:!0})],Le.prototype,"deconflictor",void 0),e([P({readOnly:!0})],Le.prototype,"labeler",void 0),e([P({readOnly:!0})],Le.prototype,"objectStates",void 0),e([P()],Le.prototype,"preferredUpdatePolicy",void 0),e([P()],Le.prototype,"forcedUpdatePolicy",void 0),e([P({readOnly:!0})],Le.prototype,"effectiveUpdatePolicy",null),e([P({constructOnly:!0})],Le.prototype,"elevationFeatureExpressionEnabled",void 0),e([P({constructOnly:!0})],Le.prototype,"owner",void 0),e([P({constructOnly:!0})],Le.prototype,"layer",void 0),e([P({constructOnly:!0})],Le.prototype,"graphicSymbolSupported",void 0),e([P({constructOnly:!0})],Le.prototype,"getRenderingInfoWithoutRenderer",void 0),e([P({readOnly:!0})],Le.prototype,"updating",null),e([P({readOnly:!0})],Le.prototype,"running",null),e([P({readOnly:!0})],Le.prototype,"suspendedOrOutsideOfView",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"updatingRemaining",null),e([P({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],Le.prototype,"displayFeatureLimit",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"averageSymbolComplexity",null),e([P({constructOnly:!0})],Le.prototype,"hasZ",void 0),e([P({constructOnly:!0})],Le.prototype,"hasM",void 0),Le=Ie=e([R("esri.views.3d.layers.graphics.Graphics3DCore")],Le),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(je||(je={}));class Ve{constructor(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.abortController=null,this.remove=null}}const Fe=10,Te=A(),ke=A(),We=new Map;export{Le as Graphics3DCore};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../../core/maybe.js";import{s as t}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{create as r,empty as s,expandWithRect as o,center as a,set as n,toRect as d}from"../../../../geometry/support/aaBoundingBox.js";import{create as h}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as l}from"./graphicUtils.js";import{Object3DState as c}from"../../webgl-engine/lib/basicInterfaces.js";import{ModelDirty as m}from"../../webgl-engine/lib/ModelDirtyTypes.js";class g{constructor(e,t,i){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=i,this.type="draped",this.stage=null,this._visible=!1,this._addedToStage=!1,this._layerView=null,this.isElevationSource=!1}initialize(e,t,i){this.stage=e,this._layerView=i,this._overlayRenderer=this._layerView.view.basemapTerrain.overlayManager.renderer}setVisibility(e){if(null!=this.stage&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)return this._addedToStage=!0,void this._overlayRenderer.addGeometries(this.renderGeometries,this._layerView,m.Geometry.ADD);if(e||this._addedToStage){for(const e of this.renderGeometries)e.instanceParameters.visible=this._visible;this._overlayRenderer.updateGeometries(this.renderGeometries,this._layerView,m.State.VISIBILITIES)}}}destroy(){this.stage&&this._addedToStage&&this._overlayRenderer.removeGeometries(this.renderGeometries,this._layerView,m.Geometry.REMOVE),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(e=i()){return t(e,0,0,0)}getBoundingBoxObjectSpace(e=r()){return s(e)}addObjectState(e,t){e===c.Highlight&&(this.renderGeometries.forEach((e=>{const i=e.addHighlight();t.addRenderGeometry(e,i,this)})),this._addedToStage&&this._overlayRenderer.updateHighlights(this.renderGeometries,this._layerView))}removeObjectState(e){this.renderGeometries.forEach((t=>{e.removeRenderGeometry(t)}))}removeRenderGeometryObjectState(e,t){e.removeHighlight(t),this._addedToStage&&this._overlayRenderer.updateHighlights(this.renderGeometries,this._layerView)}computeAttachmentOrigin(e){for(const t of this.renderGeometries)t.computeAttachmentOrigin(p)&&(e.draped.origin[0]+=p[0],e.draped.origin[1]+=p[1],e.draped.num++)}async getProjectedBoundingBox(t,i,r,n,d){s(d);for(let e=0;e<this.renderGeometries.length;e++){const i=this.renderGeometries[e];this._getRenderGeometryProjectedBoundingRect(i,t,u,r),o(d,u)}if(i){let t;a(d,p);const r=l(d,i);try{t=await i.service.queryElevation(p[0],p[1],n,r,"ground")}catch(h){}e(t)&&(d[2]=Math.min(d[2],t),d[5]=Math.max(d[5],t))}return d}_getRenderGeometryProjectedBoundingRect(e,t,i,r){if(this.boundingBox)n(y,this.boundingBox);else{const t=e.boundingSphere,i=t[3];y[0]=t[0]-i,y[1]=t[1]-i,y[2]=t[2]-i,y[3]=t[0]+i,y[4]=t[1]+i,y[5]=t[2]+i}return t(y,0,2),this.calculateRelativeScreenBounds&&r.push({location:a(y),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),d(y,i)}}const u=h(),y=r(),p=i();export{g as default};
5
+ import{isSome as e}from"../../../../core/maybe.js";import{s as t}from"../../../../chunks/vec3.js";import{c as r}from"../../../../chunks/vec3f64.js";import{create as i,empty as s,expandWithRect as o,center as n,set as a,toRect as d}from"../../../../geometry/support/aaBoundingBox.js";import{create as h}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as c}from"./graphicUtils.js";import{Object3DState as g}from"../../webgl-engine/lib/basicInterfaces.js";import{ModelDirty as m}from"../../webgl-engine/lib/ModelDirtyTypes.js";class l{constructor(e,t,r){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=r,this.type="draped",this.stage=null,this._visible=!1,this._addedToStage=!1,this._graphicsCoreOwner=null,this.isElevationSource=!1}initialize(e,t,r){this.stage=e,this._graphicsCoreOwner=r,this._overlayRenderer=this._graphicsCoreOwner.view.basemapTerrain.overlayManager.renderer}setVisibility(e){if(null!=this.stage&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)return this._addedToStage=!0,void this._overlayRenderer.addGeometries(this.renderGeometries,this._graphicsCoreOwner,m.Geometry.ADD);if(e||this._addedToStage){for(const e of this.renderGeometries)e.instanceParameters.visible=this._visible;this._overlayRenderer.updateGeometries(this.renderGeometries,this._graphicsCoreOwner,m.State.VISIBILITIES)}}}destroy(){this.stage&&this._addedToStage&&this._overlayRenderer.removeGeometries(this.renderGeometries,this._graphicsCoreOwner,m.Geometry.REMOVE),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(e=r()){return t(e,0,0,0)}getBoundingBoxObjectSpace(e=i()){return s(e)}addObjectState(e,t){e===g.Highlight&&(this.renderGeometries.forEach((e=>{const r=e.addHighlight();t.addRenderGeometry(e,r,this)})),this._addedToStage&&this._overlayRenderer.updateHighlights(this.renderGeometries,this._graphicsCoreOwner))}removeObjectState(e){this.renderGeometries.forEach((t=>{e.removeRenderGeometry(t)}))}removeRenderGeometryObjectState(e,t){e.removeHighlight(t),this._addedToStage&&this._overlayRenderer.updateHighlights(this.renderGeometries,this._graphicsCoreOwner)}computeAttachmentOrigin(e){for(const t of this.renderGeometries)t.computeAttachmentOrigin(_)&&(e.draped.origin[0]+=_[0],e.draped.origin[1]+=_[1],e.draped.num++)}async getProjectedBoundingBox(t,r,i,a,d){s(d);for(let e=0;e<this.renderGeometries.length;e++){const r=this.renderGeometries[e];this._getRenderGeometryProjectedBoundingRect(r,t,p,i),o(d,p)}if(r){let t;n(d,_);const i=c(d,r);try{t=await r.service.queryElevation(_[0],_[1],a,i,"ground")}catch(h){}e(t)&&(d[2]=Math.min(d[2],t),d[5]=Math.max(d[5],t))}return d}_getRenderGeometryProjectedBoundingRect(e,t,r,i){if(this.boundingBox)a(u,this.boundingBox);else{const t=e.boundingSphere,r=t[3];u[0]=t[0]-r,u[1]=t[1]-r,u[2]=t[2]-r,u[3]=t[0]+r,u[4]=t[1]+r,u[5]=t[2]+r}return t(u,0,2),this.calculateRelativeScreenBounds&&i.push({location:n(u),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),d(u,r)}}const p=h(),u=i(),_=r();export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import i from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{isSome as r}from"../../../../core/maybe.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ExtentSet as h}from"./ExtentSet.js";import{UpdatePolicy as o}from"../../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as p}from"../../../support/Scheduler.js";let l=class extends t{constructor(){super(...arguments),this.dirtyExtents=new h,this.globalDirty=!1,this.averageExtentUpdateSize=0,this.dirtyGraphicsSet=new Set,this.handles=new s,this.updateElevation=!1,this.layerView=null,this.graphicsCore=null,this.events=new i}setup(e,t,i,s){this.layerView=e,this.queryGraphicUIDsInExtent=t,this.graphicsCore=i,this.elevationProvider=s;const r=this.layerView.view.resourceController.scheduler;this.handles.add([s.on("elevation-change",(e=>this._elevationChanged(e))),this.layerView.watch("suspended",(()=>this._suspendedChange())),r.registerTask(p.ELEVATION_ALIGNMENT,this)])}destroy(){this.dirtyGraphicsSet.clear(),this.handles.destroy(),this.handles=null,this.layerView=null,this.graphicsCore=null,this.queryGraphicUIDsInExtent=null}clear(){this.dirtyGraphicsSet.clear(),this.notifyChange("updating")}_suspendedChange(){!0===this.layerView.suspended?this.updateElevation=!1:!1===this.layerView.suspended&&this.updateElevation&&(this.globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this.globalDirty=!0,this.notifyChange("updating")}get updating(){return this.running}get running(){return this.dirtyGraphicsSet.size>0||this.dirtyExtents&&!this.dirtyExtents.empty||this.globalDirty}get updatingRemaining(){return this.dirtyGraphicsSet.size+this.dirtyExtents.size*this.averageExtentUpdateSize}runTask(e){for(this.globalDirty&&(this._markAllGraphicsElevationDirty(),this.globalDirty=!1,e.madeProgress()),e.run((()=>this.dirtyExtents.merge(e)));this.running&&!e.done;)this._updateDirtyGraphics(e),this._updateDirtyExtents(e);this.layerView.view.deconflictor.setDirty(),this.notifyChange("updating")}_updateDirtyGraphics(e){const t=this.layerView.view.renderCoordsHelper,i=this.graphicsCore.effectiveUpdatePolicy===o.ASYNC;for(const s of this.dirtyGraphicsSet.keys()){const a=this.graphicsCore.getGraphics3DGraphicById(s);if(this.dirtyGraphicsSet.delete(s),r(a)&&(a.alignWithElevation(this.elevationProvider,t,i),e.madeProgress()),e.done)return}}_updateDirtyExtents(e){for(;!this.dirtyExtents.empty&&!e.done;){const t=this.dirtyExtents.pop(),i=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:t,spatialReference:i});const s=this.dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(t,i,(e=>{const t=this.graphicsCore.getGraphics3DGraphicById(e);r(t)&&t.needsElevationUpdates()&&this.dirtyGraphicsSet.add(e)})),this.averageExtentUpdateSize=.1*(this.dirtyGraphicsSet.size-s)+.9*this.averageExtentUpdateSize,e.madeProgress()}}_markAllGraphicsElevationDirty(){this.dirtyExtents.clear(),this.dirtyGraphicsSet.clear(),this.graphicsCore.graphics3DGraphics.forEach(((e,t)=>this.dirtyGraphicsSet.add(t)))}_elevationChanged(e){if("scene"===e.context&&(!this.graphicsCore.layer.elevationInfo||"relative-to-scene"!==this.graphicsCore.layer.elevationInfo.mode))return;const{extent:t,spatialReference:i}=e;if(this.layerView.suspended){if(!this.updateElevation){const e=this.graphicsCore.computedExtent;e&&t[2]>e.xmin&&t[0]<e.xmax&&t[3]>e.ymin&&t[1]<e.ymax&&(this.updateElevation=!0)}this.events.emit("invalidate-elevation",{extent:t,spatialReference:i})}else t[0]===-1/0?this.globalDirty=!0:this.dirtyExtents.add(t),this.notifyChange("updating")}};e([a({readOnly:!0})],l.prototype,"updating",null),e([a({readOnly:!0})],l.prototype,"updatingRemaining",null),l=e([n("esri.views.3d.layers.graphics.Graphics3DElevationAlignment")],l);const d=l;export{d as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import i from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{isSome as r}from"../../../../core/maybe.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ExtentSet as h}from"./ExtentSet.js";import{UpdatePolicy as o}from"../../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as p}from"../../../support/Scheduler.js";let c=class extends t{constructor(){super(...arguments),this.dirtyExtents=new h,this.globalDirty=!1,this.averageExtentUpdateSize=0,this.dirtyGraphicsSet=new Set,this.handles=new s,this.updateElevation=!1,this.graphicsCoreOwner=null,this.graphicsCore=null,this.events=new i}setup(e,t,i,s){this.graphicsCoreOwner=e,this.queryGraphicUIDsInExtent=t,this.graphicsCore=i,this.elevationProvider=s;const r=this.graphicsCoreOwner.view.resourceController.scheduler;this.handles.add([s.on("elevation-change",(e=>this._elevationChanged(e))),this.graphicsCoreOwner.watch("suspended",(()=>this._suspendedChange())),r.registerTask(p.ELEVATION_ALIGNMENT,this)])}destroy(){this.dirtyGraphicsSet.clear(),this.handles.destroy(),this.handles=null,this.graphicsCoreOwner=null,this.graphicsCore=null,this.queryGraphicUIDsInExtent=null}clear(){this.dirtyGraphicsSet.clear(),this.notifyChange("updating")}_suspendedChange(){!0===this.graphicsCoreOwner.suspended?this.updateElevation=!1:!1===this.graphicsCoreOwner.suspended&&this.updateElevation&&(this.globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this.globalDirty=!0,this.notifyChange("updating")}get updating(){return this.running}get running(){return this.dirtyGraphicsSet.size>0||this.dirtyExtents&&!this.dirtyExtents.empty||this.globalDirty}get updatingRemaining(){return this.dirtyGraphicsSet.size+this.dirtyExtents.size*this.averageExtentUpdateSize}runTask(e){for(this.globalDirty&&(this._markAllGraphicsElevationDirty(),this.globalDirty=!1,e.madeProgress()),e.run((()=>this.dirtyExtents.merge(e)));this.running&&!e.done;)this._updateDirtyGraphics(e),this._updateDirtyExtents(e);this.graphicsCoreOwner.view.deconflictor.setDirty(),this.notifyChange("updating")}_updateDirtyGraphics(e){const t=this.graphicsCoreOwner.view.renderCoordsHelper,i=this.graphicsCore.effectiveUpdatePolicy===o.ASYNC;for(const s of this.dirtyGraphicsSet.keys()){const a=this.graphicsCore.getGraphics3DGraphicById(s);if(this.dirtyGraphicsSet.delete(s),r(a)&&(a.alignWithElevation(this.elevationProvider,t,i),e.madeProgress()),e.done)return}}_updateDirtyExtents(e){for(;!this.dirtyExtents.empty&&!e.done;){const t=this.dirtyExtents.pop(),i=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:t,spatialReference:i});const s=this.dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(t,i,(e=>{const t=this.graphicsCore.getGraphics3DGraphicById(e);r(t)&&t.needsElevationUpdates()&&this.dirtyGraphicsSet.add(e)})),this.averageExtentUpdateSize=.1*(this.dirtyGraphicsSet.size-s)+.9*this.averageExtentUpdateSize,e.madeProgress()}}_markAllGraphicsElevationDirty(){this.dirtyExtents.clear(),this.dirtyGraphicsSet.clear(),this.graphicsCore.graphics3DGraphics.forEach(((e,t)=>this.dirtyGraphicsSet.add(t)))}_elevationChanged(e){if("scene"===e.context&&(!this.graphicsCore.layer.elevationInfo||"relative-to-scene"!==this.graphicsCore.layer.elevationInfo.mode))return;const{extent:t,spatialReference:i}=e;if(this.graphicsCoreOwner.suspended){if(!this.updateElevation){const e=this.graphicsCore.computedExtent;e&&t[2]>e.xmin&&t[0]<e.xmax&&t[3]>e.ymin&&t[1]<e.ymax&&(this.updateElevation=!0)}this.events.emit("invalidate-elevation",{extent:t,spatialReference:i})}else t[0]===-1/0?this.globalDirty=!0:this.dirtyExtents.add(t),this.notifyChange("updating")}};e([a({readOnly:!0})],c.prototype,"updating",null),e([a({readOnly:!0})],c.prototype,"updatingRemaining",null),c=e([n("esri.views.3d.layers.graphics.Graphics3DElevationAlignment")],c);const d=c;export{d as default};