@arcgis/core 4.23.0-next.20220124 → 4.23.0-next.20220126

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 (217) hide show
  1. package/Graphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/00c5bb5eecb0e89266df.js +1 -0
  4. package/assets/esri/core/workers/chunks/021a37e2b191298e80b7.js +1 -0
  5. package/assets/esri/core/workers/chunks/1370c92c40fd6271553c.js +1 -0
  6. package/assets/esri/core/workers/chunks/1fbcc8424452d0256bd6.js +1 -0
  7. package/assets/esri/core/workers/chunks/{fe864d01e72aa24574b6.js → 23b15e7c2f96d260e16c.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
  9. package/assets/esri/core/workers/chunks/2792ca40f1e92849247c.js +1 -0
  10. package/assets/esri/core/workers/chunks/2a96f1bba9ce6883e5e0.js +1 -0
  11. package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
  12. package/assets/esri/core/workers/chunks/3231ee3e090bb4cac3fc.js +1 -0
  13. package/assets/esri/core/workers/chunks/{0c3e3a5baf54bd5e210c.js → 36e250278b5622ccf068.js} +1 -1
  14. package/assets/esri/core/workers/chunks/395ba088d4864588ff66.js +1 -0
  15. package/assets/esri/core/workers/chunks/3cc77692b2eee27b9c9e.js +1 -0
  16. package/assets/esri/core/workers/chunks/3f343f792fd9f44d6f25.js +1 -0
  17. package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
  18. package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 434b16731c6a81f868ef.js} +1 -1
  19. package/assets/esri/core/workers/chunks/4385a268c2a64281d1c1.js +1 -0
  20. package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 438f0b5ae5c53ae4f06a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 46b4bb66a54bbd8e2e57.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4c76146014dc15143ba3.js +1 -0
  23. package/assets/esri/core/workers/chunks/5d991b74d958005c26c4.js +1 -0
  24. package/assets/esri/core/workers/chunks/5dfe1f8d520025e2118b.js +1 -0
  25. package/assets/esri/core/workers/chunks/601e697dc7414bda128a.js +1 -0
  26. package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → 6f50a9647f026a8d4729.js} +1 -1
  28. package/assets/esri/core/workers/chunks/7d661129a0d8c466eeec.js +1 -0
  29. package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
  30. package/assets/esri/core/workers/chunks/8070972c0efb78523b68.js +1 -0
  31. package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
  32. package/assets/esri/core/workers/chunks/97a28641b3b2fd31bea2.js +1 -0
  33. package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 97ec9eef0048760fa260.js} +1 -1
  34. package/assets/esri/core/workers/chunks/98986e6601b0366376b4.js +1 -0
  35. package/assets/esri/core/workers/chunks/9cdcf9309d6feda70185.js +1 -0
  36. package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
  37. package/assets/esri/core/workers/chunks/aace7e1fef256bb961c9.js +1 -0
  38. package/assets/esri/core/workers/chunks/{c080114a69fa95b88d22.js → af5694b4d278cf1db2d9.js} +1 -1
  39. package/assets/esri/core/workers/chunks/afbb4f802ca5774f0326.js +1 -0
  40. package/assets/esri/core/workers/chunks/b2c5f92e3d7606297ca9.js +1 -0
  41. package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
  42. package/assets/esri/core/workers/chunks/b2ebe4f6d100e15b512d.js +1 -0
  43. package/assets/esri/core/workers/chunks/b8316c6469a543029bc6.js +1 -0
  44. package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → ba5eb394f098968c22d2.js} +1 -1
  45. package/assets/esri/core/workers/chunks/bf0a65b4be31959f921d.js +1 -0
  46. package/assets/esri/core/workers/chunks/c890c7fca27170e3341f.js +1 -0
  47. package/assets/esri/core/workers/chunks/c976785f2391c77d8a30.js +1 -0
  48. package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/e4b84ca8ddfd48dd79b1.js +1 -0
  50. package/assets/esri/core/workers/chunks/e4e2036373166c1d5cf5.js +1 -0
  51. package/assets/esri/core/workers/chunks/e4f93c55eaefab4192b5.js +1 -0
  52. package/assets/esri/core/workers/chunks/e6165e17fbb07bfc40a1.js +1 -0
  53. package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
  54. package/assets/esri/core/workers/chunks/{f678293de9a6d8f5b5db.js → ec89466f76d0ba22525e.js} +1 -1
  55. package/assets/esri/core/workers/chunks/ee45618c45806ab654cb.js +1 -0
  56. package/assets/esri/core/workers/chunks/f4baa5ea2e42b1317941.js +1 -0
  57. package/assets/esri/core/workers/chunks/f760a3e030b0f358a92a.js +1 -0
  58. package/assets/esri/core/workers/chunks/face43cf5abcd2f5bd9d.js +1 -0
  59. package/assets/esri/themes/base/_mixins.scss +4 -1
  60. package/assets/esri/themes/base/icons/style.scss +11 -2
  61. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
  62. package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
  63. package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
  64. package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
  65. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
  66. package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
  67. package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
  68. package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
  69. package/assets/esri/themes/base/widgets/_Print.scss +24 -11
  70. package/assets/esri/themes/base/widgets/_Search.scss +4 -2
  71. package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
  72. package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
  73. package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
  74. package/assets/esri/themes/dark/main.css +1 -1
  75. package/assets/esri/themes/dark-blue/main.css +1 -1
  76. package/assets/esri/themes/dark-green/main.css +1 -1
  77. package/assets/esri/themes/dark-purple/main.css +1 -1
  78. package/assets/esri/themes/dark-red/main.css +1 -1
  79. package/assets/esri/themes/light/main.css +1 -1
  80. package/assets/esri/themes/light/view.css +1 -1
  81. package/assets/esri/themes/light-blue/main.css +1 -1
  82. package/assets/esri/themes/light-green/main.css +1 -1
  83. package/assets/esri/themes/light-purple/main.css +1 -1
  84. package/assets/esri/themes/light-red/main.css +1 -1
  85. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  86. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  87. package/chunks/ComponentShader.glsl.js +19 -19
  88. package/chunks/Terrain.glsl.js +11 -11
  89. package/chunks/WaterSurface.glsl.js +21 -21
  90. package/chunks/pe.js +1 -1
  91. package/chunks/vec3.js +1 -1
  92. package/core/accessorSupport/read.js +1 -1
  93. package/core/accessorSupport/write.js +1 -1
  94. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  95. package/geometry/pe.js +1 -1
  96. package/geometry/support/axisAngleDegrees.js +1 -1
  97. package/interfaces.d.ts +36 -2
  98. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  99. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  100. package/package.json +2 -2
  101. package/popup/content/AttachmentsContent.js +1 -1
  102. package/popup/content/support/mediaInfoTypes.js +1 -1
  103. package/support/revision.js +1 -1
  104. package/symbols/LabelSymbol3D.js +1 -1
  105. package/symbols/PointSymbol3D.js +1 -1
  106. package/symbols/cim/CIMSymbolHelper.js +1 -1
  107. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  108. package/symbols/cim/cimAnalyzer.js +1 -1
  109. package/symbols/support/Symbol3DVerticalOffset.js +1 -1
  110. package/symbols/support/previewCIMSymbol.js +1 -1
  111. package/symbols/support/previewSymbol2D.js +1 -1
  112. package/symbols/support/previewSymbol3D.js +1 -1
  113. package/symbols/support/previewWebStyleSymbol.js +1 -1
  114. package/symbols/support/svgUtils.js +1 -1
  115. package/symbols.js +1 -1
  116. package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
  117. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  118. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  119. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  120. package/views/3d/environment/CloudsComposition.js +1 -1
  121. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  122. package/views/3d/environment/Fog.js +1 -1
  123. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  124. package/views/3d/environment/weather.js +1 -1
  125. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  126. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  127. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  128. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  129. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  132. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  133. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  134. package/views/3d/terrain/OverlayRenderer.js +1 -1
  135. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +21 -13
  136. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  137. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  138. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  139. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  140. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  141. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  142. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  143. package/views/interactive/dragEventPipeline.js +1 -1
  144. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  145. package/views/webgl/Program.js +1 -1
  146. package/views/webgl/rasterUtils.js +1 -1
  147. package/widgets/Attachments.js +1 -1
  148. package/widgets/FeatureForm/InputField.js +1 -1
  149. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  150. package/widgets/Popup/PopupViewModel.js +1 -1
  151. package/widgets/Popup/actionUtils.js +1 -1
  152. package/widgets/Slice/SliceViewModel.js +1 -1
  153. package/widgets/Slider/SliderViewModel.js +1 -1
  154. package/widgets/Slider.js +1 -1
  155. package/widgets/Weather/WeatherViewModel.js +1 -1
  156. package/widgets/Weather/css.js +1 -1
  157. package/widgets/Weather.js +1 -1
  158. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  159. package/widgets/support/InteractiveToolViewModel.js +1 -1
  160. package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
  161. package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
  162. package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
  163. package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
  164. package/assets/components/assets/calcite-icon/squareF16.json +0 -1
  165. package/assets/components/assets/calcite-icon/squareF24.json +0 -1
  166. package/assets/components/assets/calcite-icon/squareF32.json +0 -1
  167. package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
  168. package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
  169. package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
  170. package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
  171. package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
  172. package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
  173. package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
  174. package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
  175. package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
  176. package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
  177. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
  178. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
  179. package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
  180. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
  181. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
  182. package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
  183. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
  184. package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
  185. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
  186. package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
  187. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
  188. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
  189. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
  190. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
  191. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
  192. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
  193. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
  194. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
  195. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
  196. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
  197. package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
  198. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
  199. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
  200. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
  201. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
  202. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
  203. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
  204. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
  205. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
  206. package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
  207. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
  208. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
  209. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
  210. package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
  211. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
  212. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
  213. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
  214. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
  215. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
  216. package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
  217. package/views/3d/layers/graphics/IGraphics3DFeatureProcessor.js +0 -4
@@ -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"../../../Color.js";import r from"../../../core/Evented.js";import s from"../../../core/Handles.js";import{destroyMaybe as i,isSome as n,isNone as o,mapOr as a}from"../../../core/maybe.js";import{after as c}from"../../../core/promiseUtils.js";import{init as h}from"../../../core/watchUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{s as p,a as _,g as m,e as u}from"../../../chunks/vec3.js";import{c as f,f as P}from"../../../chunks/vec3f64.js";import{d as g,f as v}from"../../../chunks/vec4f64.js";import{canProjectToWGS84ComparableLonLat as b,projectPointToWGS84ComparableLonLat as w}from"../../../geometry/projection.js";import{isEarth as C}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as U}from"../../ViewingMode.js";import{EnvironmentRenderer as y}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as R}from"../support/earthUtils.js";import{computeColorAndIntensity as T,ColorAndIntensity as S,computeShadowsEnabled as M}from"../support/sunUtils.js";import{MainLight as H,AmbientLight as W,FillLight as G}from"../webgl-engine/lighting/Lightsources.js";import j from"../../../webscene/background/ColorBackground.js";let E=class extends r.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandles=new s,this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new H,this._ambientLight=new W,this._moonLight=new G,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView(),this._viewHandles.destroy()}get _view(){var e;return null==(e=this._renderer)?void 0:e.view}get updating(){var e;return!!(!this.disableQueries&&(this._referencePosUpdateQuery||this._referencePosMapCoordsRequested)||null!=(e=this._renderer)&&e.updating)}get weatherEnabled(){var e,t,r;return(null==(e=this._view)?void 0:e.environment.atmosphereEnabled)&&!this._disableWeather&&(null==(t=this._view)||null==(r=t.state)?void 0:r.viewingMode)===U.Global&&C(this._view.spatialReference)}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){this._renderer||(this._renderer=new y({view:e}),this._viewHandles.add([e.watch("environment.lighting.date",(e=>this._lightingDateHandler(e)),!0),e.watch("stationary",(()=>this._interactingStationaryHandler())),e.watch(["environment.lighting.directShadowsEnabled","environment.lighting.ambientOcclusionEnabled","environment.lighting.waterReflectionEnabled","environment.background.color"],(()=>this._updateRenderParamsHandler()),!0),e.watch("spatialReference",(()=>this._resetReferencePosition(!0)),!0),e.watch("environment.weather.type",(()=>this._updateLightParams()),!0),this.watch("weatherEnabled",(()=>this._updateLightParams()),!0),h(e,"viewingMode",(()=>this._resetReferencePosition(!0)),!0),h(e,"environment.lighting.cameraTrackingEnabled",(e=>this._updateCameraTracking(e)),!0),h(e,"state.camera",(()=>this._cameraHandler()),!0),this.watch("disableQueries",(()=>this._cameraHandler()))]),this._updateRenderParamsHandler(),this._updateLightParams(),this._cameraHandler(),this.notifyChange("updating"))}disconnectView(){this._viewHandles.removeAll(),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;e&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!e)return;const t=this._view.environment.lighting;if(!t.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const r=this._view.spatialReference;if(!b(r)){const e=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(e))return void this._requestReferencePositionUpdate(e)}if(this._preupdateTracking(e),n(this._referencePosWGS84Comparable)){const e=R(this._referencePosWGS84Comparable,D);n(e)&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}}this._updateLightParams(e)}_preupdateTracking(e){!this._trackingEnabled&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const r=t.stateManager.camera;r&&(this._cameraHandlerClientSide(r,e)||this._cameraHandlerServerSide(r))}_cameraHandlerClientSide(e,t){const r=C(this._view.spatialReference);if(r&&!b(this._view.spatialReference))return!1;const s=e.position;return o(this._referencePosWGS84Comparable)&&(this._referencePosWGS84Comparable=f()),r?w(s,this._referencePosWGS84Comparable):p(this._referencePosWGS84Comparable,s.longitude,s.latitude,s.z),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,t)||this._updateLightParams(t),!0}_cameraHandlerServerSide(e){const t=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(t))&&this._requestReferencePositionUpdate(t,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=t.z*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLightParams(e){const t=this._view,r=t.environment.lighting,s=e||r.date,i=t._stage,o=this._referencePosWGS84Comparable,a=n(o)?k:Q;if(n(o)){const e=this.weatherEnabled?t.environment.weather.type:"disabled";T(s,o,t.state.viewingMode,k,e)}const c=this._mainLight,h=a.direct;_(c.intensity,h.color,h.intensity*Math.PI),m(c.direction,h.directionToLightSource);const d=this._ambientLight;_(d.intensity,a.ambient.color,a.ambient.intensity);const l=this._moonLight;u(l.intensity,q,A,a.globalFactor);const p=(1-.5*a.globalFactor)*(1-.4*a.noonFactor*(1-a.globalFactor));_(l.intensity,l.intensity,p),m(l.direction,h.directionToLightSource),i.renderView.updateLightSources([c,d,l],1-a.noonFactor,a.globalFactor),this._updateRenderParamsHandler()}_autoUpdateTimezone(e,t=null){if(!this._view.environment.lighting.cameraTrackingEnabled||o(e))return!1;const r=L;r.setTime((t||this._view.environment.lighting.date).getTime());const s=R(e,D);if(o(s))return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(i.autoUpdated){if(i.hours===s.hours&&i.minutes===s.minutes&&i.seconds===s.seconds)return!1}else i=s;const n=r.getUTCHours()-(s.hours-i.hours),a=r.getUTCMinutes()-(s.minutes-i.minutes),c=r.getUTCSeconds()-(s.seconds-i.seconds);return r.setUTCHours(n),r.setUTCMinutes(a),r.setUTCSeconds(c),!t&&this._view.environment.lighting.autoUpdate(r,s)}_updateRenderParamsHandler(){const e=this._view._stage;if(!e)return;const r=a(this._referencePosWGS84Comparable,!0,(e=>M(e[2],this._view.state.viewingMode))),s=this._view.environment.background,i=s instanceof j?{type:"color",color:g(t.toUnitRGBA(s.color))}:{type:"color",color:v(0,0,0,1)};e.renderView.setRenderParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&r,ssao:this._view.environment.lighting.ambientOcclusionEnabled,waterReflectionEnabled:this._view.environment.lighting.waterReflectionEnabled,background:i})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,t=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!t,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const e=this._referencePosUpdateQuery=c(this._referencePointUpdateDelay).then((()=>{if(this._referencePosUpdateQuery===e){const t=()=>this._referencePosUpdateQuery!==e;return this._doReferencePositionUpdateQuery(t)}})).catch((e=>{"mapcoordshelper:missing-geometry-service"===e.name&&(this.disableQueries=!0)})).then((()=>{this._referencePosUpdateQuery===e&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))})),t=this._referencePosUpdateTimer=c(this._referencePointUpdateInterval).then((()=>{this._referencePosUpdateTimer===t&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())}));this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const t=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(t[0])&&!isNaN(t[1])){const e=this._referencePosMapCoords.z*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=t[0],this._referencePosWGS84Comparable[1]=t[1],this._referencePosWGS84Comparable[2]=e):this._referencePosWGS84Comparable=[t[0],t[1],e],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLightParams():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLightParams(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let t=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(t*=this._view.mapCoordsHelper.unitInMeters),t>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(t){e._referencePointUpdateInterval=t},set referencePointUpdateDistThreshold(t){e._referencePointUpdateDistThreshold=t},set referencePosUpdateTimer(t){e._referencePosUpdateTimer=t},set referencePointUpdateDelay(t){e._referencePointUpdateDelay=t},set disableWeather(t){e._disableWeather=t}}}};e([d({type:Boolean,readOnly:!0})],E.prototype,"updating",null),e([d()],E.prototype,"disableQueries",void 0),e([d()],E.prototype,"_disableWeather",void 0),e([d()],E.prototype,"weatherEnabled",null),e([d()],E.prototype,"referencePositionWGS84Comparable",null),e([d()],E.prototype,"_renderer",void 0),e([d()],E.prototype,"_referencePosWGS84Comparable",void 0),E=e([l("esri.views.3d.environment.SceneViewEnvironmentManager")],E);const k=new S,Q=new S,L=new Date,D={hours:0,minutes:0,seconds:0},q=P(.22,.22,.33),A=P(.22,.22,.22);export{E as SceneViewEnvironmentManager};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../core/Evented.js";import i from"../../../core/Handles.js";import{destroyMaybe as s,isSome as n,isNone as o,mapOr as a}from"../../../core/maybe.js";import{after as h}from"../../../core/promiseUtils.js";import{init as c}from"../../../core/watchUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{s as p,a as _,g as m,e as u}from"../../../chunks/vec3.js";import{c as f,f as P}from"../../../chunks/vec3f64.js";import{d as g,f as v}from"../../../chunks/vec4f64.js";import{canProjectToWGS84ComparableLonLat as b,projectPointToWGS84ComparableLonLat as w}from"../../../geometry/projection.js";import{isEarth as C}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as U}from"../../ViewingMode.js";import{EnvironmentRenderer as y}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as R}from"../support/earthUtils.js";import{computeColorAndIntensity as T,ColorAndIntensity as S,computeShadowsEnabled as M}from"../support/sunUtils.js";import{MainLight as H,AmbientLight as W,FillLight as G}from"../webgl-engine/lighting/Lightsources.js";import j from"../../../webscene/background/ColorBackground.js";let E=class extends r.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandles=new i,this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new H,this._ambientLight=new W,this._moonLight=new G,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView(),this._viewHandles.destroy()}get _view(){var e;return null==(e=this._renderer)?void 0:e.view}get updating(){var e;return!!(!this.disableQueries&&(this._referencePosUpdateQuery||this._referencePosMapCoordsRequested)||null!=(e=this._renderer)&&e.updating)}get weatherEnabled(){var e,t,r;return(null==(e=this._view)?void 0:e.environment.atmosphereEnabled)&&!this._disableWeather&&(null==(t=this._view)||null==(r=t.state)?void 0:r.viewingMode)===U.Global&&C(this._view.spatialReference)}get weatherVisible(){var e;return this.weatherEnabled&&(null==(e=this._renderer)?void 0:e.weatherVisible)}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){this._renderer||(this._renderer=new y({view:e}),this._viewHandles.add([e.watch("environment.lighting.date",(e=>this._lightingDateHandler(e)),!0),e.watch("stationary",(()=>this._interactingStationaryHandler())),e.watch(["environment.lighting.directShadowsEnabled","environment.lighting.ambientOcclusionEnabled","environment.lighting.waterReflectionEnabled","environment.background.color"],(()=>this._updateRenderParamsHandler()),!0),e.watch("spatialReference",(()=>this._resetReferencePosition(!0)),!0),e.watch("environment.weather.type",(()=>this._updateLightParams()),!0),this.watch("weatherEnabled",(()=>this._updateLightParams()),!0),c(e,"viewingMode",(()=>this._resetReferencePosition(!0)),!0),c(e,"environment.lighting.cameraTrackingEnabled",(e=>this._updateCameraTracking(e)),!0),c(e,"state.camera",(()=>this._cameraHandler()),!0),this.watch("disableQueries",(()=>this._cameraHandler()))]),this._updateRenderParamsHandler(),this._updateLightParams(),this._cameraHandler(),this.notifyChange("updating"))}disconnectView(){this._viewHandles.removeAll(),this._resetReferencePosition(),this._renderer=s(this._renderer)}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;e&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!e)return;const t=this._view.environment.lighting;if(!t.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const r=this._view.spatialReference;if(!b(r)){const e=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(e))return void this._requestReferencePositionUpdate(e)}if(this._preupdateTracking(e),n(this._referencePosWGS84Comparable)){const e=R(this._referencePosWGS84Comparable,D);n(e)&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}}this._updateLightParams(e)}_preupdateTracking(e){!this._trackingEnabled&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const r=t.stateManager.camera;r&&(this._cameraHandlerClientSide(r,e)||this._cameraHandlerServerSide(r))}_cameraHandlerClientSide(e,t){const r=C(this._view.spatialReference);if(r&&!b(this._view.spatialReference))return!1;const i=e.position;return o(this._referencePosWGS84Comparable)&&(this._referencePosWGS84Comparable=f()),r?w(i,this._referencePosWGS84Comparable):p(this._referencePosWGS84Comparable,i.longitude,i.latitude,i.z),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,t)||this._updateLightParams(t),!0}_cameraHandlerServerSide(e){const t=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(t))&&this._requestReferencePositionUpdate(t,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=t.z*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLightParams(e){const t=this._view,r=t.environment.lighting,i=e||r.date,s=t._stage,o=this._referencePosWGS84Comparable,a=n(o)?k:Q;if(n(o)){const e=this.weatherEnabled?t.environment.weather.type:"disabled";T(i,o,t.state.viewingMode,k,e)}const h=this._mainLight,c=a.direct;_(h.intensity,c.color,c.intensity*Math.PI),m(h.direction,c.directionToLightSource);const d=this._ambientLight;_(d.intensity,a.ambient.color,a.ambient.intensity);const l=this._moonLight;u(l.intensity,q,A,a.globalFactor);const p=(1-.5*a.globalFactor)*(1-.4*a.noonFactor*(1-a.globalFactor));_(l.intensity,l.intensity,p),m(l.direction,c.directionToLightSource),s.renderView.updateLightSources([h,d,l],1-a.noonFactor,a.globalFactor),this._updateRenderParamsHandler()}_autoUpdateTimezone(e,t=null){if(!this._view.environment.lighting.cameraTrackingEnabled||o(e))return!1;const r=L;r.setTime((t||this._view.environment.lighting.date).getTime());const i=R(e,D);if(o(i))return!1;let s=this._view.environment.lighting.positionTimezoneInfo;if(s.autoUpdated){if(s.hours===i.hours&&s.minutes===i.minutes&&s.seconds===i.seconds)return!1}else s=i;const n=r.getUTCHours()-(i.hours-s.hours),a=r.getUTCMinutes()-(i.minutes-s.minutes),h=r.getUTCSeconds()-(i.seconds-s.seconds);return r.setUTCHours(n),r.setUTCMinutes(a),r.setUTCSeconds(h),!t&&this._view.environment.lighting.autoUpdate(r,i)}_updateRenderParamsHandler(){const e=this._view._stage;if(!e)return;const r=a(this._referencePosWGS84Comparable,!0,(e=>M(e[2],this._view.state.viewingMode))),i=this._view.environment.background,s=i instanceof j?{type:"color",color:g(t.toUnitRGBA(i.color))}:{type:"color",color:v(0,0,0,1)};e.renderView.setRenderParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&r,ssao:this._view.environment.lighting.ambientOcclusionEnabled,waterReflectionEnabled:this._view.environment.lighting.waterReflectionEnabled,background:s})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,t=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!t,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const e=this._referencePosUpdateQuery=h(this._referencePointUpdateDelay).then((()=>{if(this._referencePosUpdateQuery===e){const t=()=>this._referencePosUpdateQuery!==e;return this._doReferencePositionUpdateQuery(t)}})).catch((e=>{"mapcoordshelper:missing-geometry-service"===e.name&&(this.disableQueries=!0)})).then((()=>{this._referencePosUpdateQuery===e&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))})),t=this._referencePosUpdateTimer=h(this._referencePointUpdateInterval).then((()=>{this._referencePosUpdateTimer===t&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())}));this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const t=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(t[0])&&!isNaN(t[1])){const e=this._referencePosMapCoords.z*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=t[0],this._referencePosWGS84Comparable[1]=t[1],this._referencePosWGS84Comparable[2]=e):this._referencePosWGS84Comparable=[t[0],t[1],e],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLightParams():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLightParams(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let t=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(t*=this._view.mapCoordsHelper.unitInMeters),t>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(t){e._referencePointUpdateInterval=t},set referencePointUpdateDistThreshold(t){e._referencePointUpdateDistThreshold=t},set referencePosUpdateTimer(t){e._referencePosUpdateTimer=t},set referencePointUpdateDelay(t){e._referencePointUpdateDelay=t},set disableWeather(t){e._disableWeather=t}}}};e([d({type:Boolean,readOnly:!0})],E.prototype,"updating",null),e([d()],E.prototype,"disableQueries",void 0),e([d()],E.prototype,"_disableWeather",void 0),e([d()],E.prototype,"weatherEnabled",null),e([d()],E.prototype,"weatherVisible",null),e([d()],E.prototype,"referencePositionWGS84Comparable",null),e([d()],E.prototype,"_renderer",void 0),e([d()],E.prototype,"_referencePosWGS84Comparable",void 0),E=e([l("esri.views.3d.environment.SceneViewEnvironmentManager")],E);const k=new S,Q=new S,L=new Date,D={hours:0,minutes:0,seconds:0},q=P(.22,.22,.33),A=P(.22,.22,.22);export{E as SceneViewEnvironmentManager};
@@ -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 e from"./CloudyWeather.js";import r from"./FoggyWeather.js";import t from"./RainyWeather.js";import o from"./SunnyWeather.js";const n={key:"type",base:null,typeMap:{sunny:o,cloudy:e,rainy:t,foggy:r}};function y(e,r){if(e.type!==r.type)return!1;switch(e.type){case"sunny":case"rainy":case"cloudy":return e.cloudCover===r.cloudCover;case"foggy":return e.fogStrength===r.fogStrength}}export{y as weatherEquals,n as weatherTypes};
5
+ import e from"./CloudyWeather.js";import r from"./FoggyWeather.js";import t from"./RainyWeather.js";import o from"./SunnyWeather.js";const n={key:"type",base:null,typeMap:{sunny:o,cloudy:e,rainy:t,foggy:r}},y=1e4;function a(e,r){if(e.type!==r.type)return!1;switch(e.type){case"sunny":case"rainy":case"cloudy":return e.cloudCover===r.cloudCover;case"foggy":return e.fogStrength===r.fogStrength}}export{a as weatherEquals,y as weatherHeightLimit,n as weatherTypes};
@@ -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{HandleOwner as t}from"../../../../../core/HandleOwner.js";import{deg2rad as s,rad2deg as i}from"../../../../../core/mathUtils.js";import{isSome as o}from"../../../../../core/maybe.js";import{watch as r,sync as a}from"../../../../../core/reactiveUtils.js";import{property as c}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{axis as p,angle as h}from"../../../../../geometry/support/axisAngleDegrees.js";import{ViewingMode as l}from"../../../../ViewingMode.js";import{createGraphicGeometryUndoRecord as g}from"./undoRecords.js";let m=class extends t{constructor(e){super(e),this.angle=0,this.scale=1,this.initialAngle=0,this.previousAngle=0,this.previousScale=1}initialize(){this.restart()}restart(){this.handles.remove(d);const e=this.geometry.transform;if(this.scale=1,o(e)){const t=p(e.rotation)[2];Math.abs(t)>.999999&&(this.angle=s(h(e.rotation))*Math.sign(t))}this.initialAngle=this.angle,this.previousAngle=this.angle,this.previousScale=this.scale,this.handles.add(r((()=>({angle:this.angle,scale:this.scale})),(e=>this._update(e)),a),d)}cancel(){this.scale=1,this.angle=this.initialAngle}createUndoRecord(){return g(this.graphic)}_update({scale:e,angle:t}){const s=this.geometry.anchor,o=this.viewingMode===l.Global;e!==this.previousScale&&(this.geometry.scale(e/this.previousScale,{origin:s,geographic:o}),this.previousScale=e,this.graphic.notifyGeometryChanged()),t!==this.previousAngle&&(this.geometry.rotate(0,0,i(t-this.previousAngle),{origin:s,geographic:o}),this.previousAngle=t,this.graphic.notifyGeometryChanged())}};e([c({constructOnly:!0})],m.prototype,"graphic",void 0),e([c({constructOnly:!0})],m.prototype,"geometry",void 0),e([c({constructOnly:!0})],m.prototype,"viewingMode",void 0),e([c()],m.prototype,"angle",void 0),e([c()],m.prototype,"scale",void 0),m=e([n("esri.views.3d.interactive.editingTools.transformGraphic.ScaleRotateMeshAdapter")],m);const d="scale-heading-update-key";export{m as ScaleRotateMeshAdapter};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import{deg2rad as s,rad2deg as r}from"../../../../../core/mathUtils.js";import{isSome as i}from"../../../../../core/maybe.js";import{watch as o,sync as a}from"../../../../../core/reactiveUtils.js";import{property as n}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{axis as h,angle as p}from"../../../../../geometry/support/axisAngleDegrees.js";import{ViewingMode as l}from"../../../../ViewingMode.js";import{createGraphicGeometryUndoRecord as g}from"./undoRecords.js";let m=class extends t{constructor(e){super(e),this.angle=0,this.scale=1,this.initialAngle=0,this.previousAngle=0,this.previousScale=1}initialize(){this.restart()}restart(){this.handles.remove(d);const e=this.geometry.transform;if(this.scale=1,i(e)){const t=h(e.rotation)[2];Math.abs(t)>.999999&&(this.angle=s(p(e.rotation))*Math.sign(t))}this.initialAngle=this.angle,this.previousAngle=this.angle,this.previousScale=this.scale,this.handles.add(o((()=>({angle:this.angle,scale:this.scale})),(e=>this._update(e)),a),d)}cancel(){this.scale=1,this.angle=this.initialAngle}createUndoRecord(){return g(this.graphic)}_update({scale:e,angle:t}){const s=this.geometry.anchor,o=this.viewingMode===l.Global;e!==this.previousScale&&(this.geometry.scale(e/this.previousScale,{origin:s,geographic:o}),this.previousScale=e,i(this.geometry.transform)&&this.graphic.notifyMeshTransformChanged(),this.graphic.notifyGeometryChanged()),t!==this.previousAngle&&(this.geometry.rotate(0,0,r(t-this.previousAngle),{origin:s,geographic:o}),this.previousAngle=t,i(this.geometry.transform)&&this.graphic.notifyMeshTransformChanged(),this.graphic.notifyGeometryChanged())}};e([n({constructOnly:!0})],m.prototype,"graphic",void 0),e([n({constructOnly:!0})],m.prototype,"geometry",void 0),e([n({constructOnly:!0})],m.prototype,"viewingMode",void 0),e([n()],m.prototype,"angle",void 0),e([n()],m.prototype,"scale",void 0),m=e([c("esri.views.3d.interactive.editingTools.transformGraphic.ScaleRotateMeshAdapter")],m);const d="scale-heading-update-key";export{m as ScaleRotateMeshAdapter};
@@ -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 r from"../../../core/Error.js";import{isSome as t}from"../../../core/maybe.js";import{initial as s,watch as o,when as i,syncAndInitial as a}from"../../../core/reactiveUtils.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 n}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as u}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as c}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLikeLayerView3D as p}from"./FeatureLikeLayerView3D.js";import{LayerView3D as m}from"./LayerView3D.js";import{FeatureTileFetcher3DLayerViewContext as h}from"./support/FeatureTileFetcher3DLayerViewContext.js";import{EventedSet as d}from"../support/EventedSet.js";import{updatingProgress as y}from"../support/updatingProperties.js";import{UpdatePolicy as f}from"../webgl-engine/lib/basicInterfaces.js";import{FeatureLayerView as g}from"../../layers/FeatureLayerView.js";import F from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";let x=class extends(b(p(g(m(F))))){constructor(e){super(e),this._controllerTotal=0,this._graphicsCoreTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.updatingHandles.add((()=>this.view.floors),(()=>this.processor.filterVisibility.filterChanged()))}destroy(){this.fetcherContext&&(this.fetcherContext.destroy(),this.fetcherContext=null)}get maximumNumberOfFeatures(){var e,r;return null!=(e=null==(r=this.controller)?void 0:r.maximumNumberOfFeatures)?e:this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){var e,r,t;let s=0;if(null!=(e=this.controller)&&e.updating){const e=this.controller.updatingRemaining,r=Math.max(this.controller.updatingTotal,this._controllerTotal);r>0&&(s=(r-e)/r,this._controllerTotal=r)}let o=0;if(null!=(r=this.processor)&&null!=(t=r.graphicsCore)&&t.updating){const e=this.processor.graphicsCore.updatingRemaining,r=Math.max(e,this._graphicsCoreTotal);r>0&&(o=(r-e)/r,this._graphicsCoreTotal=r)}return.5*(s+o)}get updatePolicy(){if(!this.controller)return f.ASYNC;switch(this.controller.mode){case"snapshot":{const e=C[this.layer.geometryType];return null==e||this.controller.serviceDataCount>e?f.ASYNC:f.SYNC}case"tiles":return f.ASYNC}}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.processor&&this.processor.graphicsCore.setObjectIdVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this.fetcherContext=new h({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const e=new c({layerView:this,context:this.fetcherContext,graphics:new d,extent:this.clippingExtent});return this.updatingHandles.add((()=>e.serviceDataExtent),(e=>{this.processor&&(this.processor.dataExtent=e)}),s),this.handles.add(o((()=>this.suspended),(r=>{r?e.suspend():e.resume()}),a)),this.updatingHandles.add((()=>{var e,r;return null==(e=this.processor)||null==(r=e.graphicsCore)?void 0:r.displayFeatureLimit}),(()=>this._updateDisplayFeatureLimit(e)),s),this.handles.add([this.view.resourceController.memoryController.events.on("quality-changed",(()=>this._updateDisplayFeatureLimit())),i((()=>!this.updating),(()=>{this._controllerTotal=0,this._graphicsCoreTotal=0,this.notifyChange("updatingProgressValue")}))]),e}async doRefresh(e){e&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.filterVisibility.dirty=!0}getUsedMemory(){const e=this.processor&&this.processor.graphicsCore;return(e?e.usedMemory:0)+(this.controller?this.controller.memoryForUnusedFeatures:0)}getUnloadedMemory(){const e=this.processor&&this.processor.graphicsCore;return(e?e.unprocessedMemoryEstimate:0)+(this.controller?this.controller.expectedFeatureDiff*e.usedMemoryPerGraphic:0)}ignoresMemoryFactor(){return this.controller&&this.controller.hasMaximumNumberOfFeaturesOverride}_updateDisplayFeatureLimit(e=this.controller){if(!e||!this.processor||!this.processor.graphicsCore)return;const r=this.processor.graphicsCore.displayFeatureLimit,t=this.view.resourceController.memoryController.memoryFactor;if(1===t)e.displayFeatureLimit=r;else{const s=Math.ceil(r.maximumNumberOfFeatures*t),o=Math.ceil(r.maximumTotalNumberOfFeatures*t),i=Math.ceil(r.minimumTotalNumberOfFeatures*t);e.displayFeatureLimit={...r,maximumNumberOfFeatures:s,maximumTotalNumberOfFeatures:o,minimumTotalNumberOfFeatures:i}}}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r();if(e&&e.outStatistics)return t;const s=this.layer.objectIdField,o=this.processor.graphicsCore.graphics3DGraphicsByObjectID,i=[];for(const a of t.features)if(a.geometry){const e=o.get(a.attributes[s]);e&&(a.geometry=u(e.graphic.geometry),i.push(a))}else i.push(a);return t.features=i,t}async _validateQueryFeaturesMesh(e){if(!e)return;const s=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},o=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of o)null!=e[r]&&s(r);"returnM"in e&&e.returnM&&s("returnM"),"returnCentroid"in e&&e.returnCentroid&&s("returnCentroid"),t(e.outSpatialReference)&&!e.outSpatialReference.equals(this.view.spatialReference)&&s("outSpatialReference")}get performanceInfo(){const e=this.controller&&this.controller.displayFeatureLimit,r=t(e)&&e.averageSymbolComplexity,s=t(r)?`f:${r.primitivesPerFeature},v:${r.primitivesPerCoordinate}`:"n/a",o={...this._getResourceInfo(),storedFeatures:0,totalVertices:0,partial:this.maximumNumberOfFeaturesExceeded,mode:this.controller?this.controller.mode:"n/a",symbolComplexity:s,nodes:this.controller?this.controller.tileDescriptors.length:0};if(this.controller&&o.displayedNumberOfFeatures){const e=this.controller.debug;o.storedFeatures=e.storedFeatures,o.totalVertices=e.totalVertices}return o}get test(){return{updatePolicy:this.updatePolicy,controller:this.controller}}};e([l()],x.prototype,"layer",void 0),e([l()],x.prototype,"controller",void 0),e([l()],x.prototype,"maximumNumberOfFeatures",null),e([l()],x.prototype,"maximumNumberOfFeaturesExceeded",null),e([l(y)],x.prototype,"updatingProgress",void 0),e([l({readOnly:!0,dependsOn:["controller.updatingRemaining","controller.updatingTotal","processor.graphicsCore.updatingRemaining"]})],x.prototype,"updatingProgressValue",null),e([l({readOnly:!0})],x.prototype,"updatePolicy",null),e([l({readOnly:!0})],x.prototype,"hasZ",null),e([l({readOnly:!0})],x.prototype,"hasM",null),e([l()],x.prototype,"suspendResumeExtentMode",void 0),x=e([n("esri.views.3d.layers.FeatureLayerViewBase3D")],x);const C={point:5e3,polygon:500,polyline:1e3},M=x;export{M as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,isSome as s}from"../../../core/maybe.js";import{initial as o,watch as i,when as a,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{property as u}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{hydrateGeometry as p}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as c}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLikeLayerView3D as m}from"./FeatureLikeLayerView3D.js";import{LayerView3D as h}from"./LayerView3D.js";import{FeatureTileFetcher3DLayerViewContext as d}from"./support/FeatureTileFetcher3DLayerViewContext.js";import{EventedSet as y}from"../support/EventedSet.js";import{updatingProgress as f}from"../support/updatingProperties.js";import{UpdatePolicy as g}from"../webgl-engine/lib/basicInterfaces.js";import{FeatureLayerView as F}from"../../layers/FeatureLayerView.js";import b from"../../layers/LayerView.js";import{RefreshableLayerView as v}from"../../layers/RefreshableLayerView.js";let x=class extends(v(m(F(h(b))))){constructor(e){super(e),this._controllerTotal=0,this._graphicsCoreTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.updatingHandles.add((()=>this.view.floors),(()=>this.processor.filterVisibility.filterChanged()))}destroy(){this.fetcherContext=t(this.fetcherContext)}get maximumNumberOfFeatures(){var e,r;return null!=(e=null==(r=this.controller)?void 0:r.maximumNumberOfFeatures)?e:this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){var e,r,t;let s=0;if(null!=(e=this.controller)&&e.updating){const e=this.controller.updatingRemaining,r=Math.max(this.controller.updatingTotal,this._controllerTotal);r>0&&(s=(r-e)/r,this._controllerTotal=r)}let o=0;if(null!=(r=this.processor)&&null!=(t=r.graphicsCore)&&t.updating){const e=this.processor.graphicsCore.updatingRemaining,r=Math.max(e,this._graphicsCoreTotal);r>0&&(o=(r-e)/r,this._graphicsCoreTotal=r)}return.5*(s+o)}get updatePolicy(){if(!this.controller)return g.ASYNC;switch(this.controller.mode){case"snapshot":{const e=C[this.layer.geometryType];return null==e||this.controller.serviceDataCount>e?g.ASYNC:g.SYNC}case"tiles":return g.ASYNC}}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){var t;null==(t=this.processor)||t.graphicsCore.setObjectIdVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this.fetcherContext=new d({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const e=new c({layerView:this,context:this.fetcherContext,graphics:new y,extent:this.clippingExtent});return this.updatingHandles.add((()=>e.serviceDataExtent),(e=>{this.processor&&(this.processor.dataExtent=e)}),o),this.handles.add(i((()=>this.suspended),(r=>{r?e.suspend():e.resume()}),l)),this.updatingHandles.add((()=>{var e,r;return null==(e=this.processor)||null==(r=e.graphicsCore)?void 0:r.displayFeatureLimit}),(()=>this._updateDisplayFeatureLimit(e)),o),this.handles.add([this.view.resourceController.memoryController.events.on("quality-changed",(()=>this._updateDisplayFeatureLimit())),a((()=>!this.updating),(()=>{this._controllerTotal=0,this._graphicsCoreTotal=0,this.notifyChange("updatingProgressValue")}))]),e}async doRefresh(e){e&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.filterVisibility.dirty=!0}getUsedMemory(){var e,r,t,s;const o=null==(e=this.processor)?void 0:e.graphicsCore;return(null!=(r=null==o?void 0:o.usedMemory)?r:0)+(null!=(t=null==(s=this.controller)?void 0:s.memoryForUnusedFeatures)?t:0)}getUnloadedMemory(){var e,r,t,s;const o=null==(e=this.processor)?void 0:e.graphicsCore;return(null!=(r=null==o?void 0:o.unprocessedMemoryEstimate)?r:0)+(null!=(t=(null==(s=this.controller)?void 0:s.expectedFeatureDiff)*(null==o?void 0:o.usedMemoryPerGraphic))?t:0)}ignoresMemoryFactor(){var e;return null==(e=this.controller)?void 0:e.hasMaximumNumberOfFeaturesOverride}_updateDisplayFeatureLimit(e=this.controller){var r;if(!e||null==(r=this.processor)||!r.graphicsCore)return;const t=this.processor.graphicsCore.displayFeatureLimit,s=this.view.resourceController.memoryController.memoryFactor;if(1===s)e.displayFeatureLimit=t;else{const r=Math.ceil(t.maximumNumberOfFeatures*s),o=Math.ceil(t.maximumTotalNumberOfFeatures*s),i=Math.ceil(t.minimumTotalNumberOfFeatures*s);e.displayFeatureLimit={...t,maximumNumberOfFeatures:r,maximumTotalNumberOfFeatures:o,minimumTotalNumberOfFeatures:i}}}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r();if(e&&e.outStatistics)return t;const s=this.layer.objectIdField,o=this.processor.graphicsCore.graphics3DGraphicsByObjectID,i=[];for(const a of t.features)if(a.geometry){const e=o.get(a.attributes[s]);e&&(a.geometry=p(e.graphic.geometry),i.push(a))}else i.push(a);return t.features=i,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},o=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of o)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),s(e.outSpatialReference)&&!e.outSpatialReference.equals(this.view.spatialReference)&&t("outSpatialReference")}get performanceInfo(){var e,r,t,o,i;const a=null==(e=this.controller)?void 0:e.displayFeatureLimit,l=s(a)&&a.averageSymbolComplexity,u=s(l)?`f:${l.primitivesPerFeature},v:${l.primitivesPerCoordinate}`:"n/a",n={...this._getResourceInfo(),storedFeatures:0,totalVertices:0,partial:this.maximumNumberOfFeaturesExceeded,mode:null!=(r=null==(t=this.controller)?void 0:t.mode)?r:"n/a",symbolComplexity:u,nodes:null!=(o=null==(i=this.controller)?void 0:i.tileDescriptors.length)?o:0};if(this.controller&&n.displayedNumberOfFeatures){const e=this.controller.debug;n.storedFeatures=e.storedFeatures,n.totalVertices=e.totalVertices}return n}get test(){return{updatePolicy:this.updatePolicy,controller:this.controller}}};e([u()],x.prototype,"layer",void 0),e([u()],x.prototype,"controller",void 0),e([u()],x.prototype,"maximumNumberOfFeatures",null),e([u()],x.prototype,"maximumNumberOfFeaturesExceeded",null),e([u(f)],x.prototype,"updatingProgress",void 0),e([u({readOnly:!0,dependsOn:["controller.updatingRemaining","controller.updatingTotal","processor.graphicsCore.updatingRemaining"]})],x.prototype,"updatingProgressValue",null),e([u({readOnly:!0})],x.prototype,"updatePolicy",null),e([u({readOnly:!0})],x.prototype,"hasZ",null),e([u({readOnly:!0})],x.prototype,"hasM",null),e([u()],x.prototype,"suspendResumeExtentMode",void 0),x=e([n("esri.views.3d.layers.FeatureLayerViewBase3D")],x);const C={point:5e3,polygon:500,polyline:1e3},M=x;export{M 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 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};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r,get as s,isNone as i}from"../../../core/maybe.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as u}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import p from"../../../rest/support/Query.js";import{DrapeSourceType as c}from"./interfaces.js";import d from"./graphics/Graphics3DFeatureProcessor.js";import h from"./graphics/QueryEngine.js";import{toViewIfLocal as y}from"./support/projectExtentUtils.js";import{UpdatePolicy as m}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as g}from"../../support/Scheduler.js";const f=f=>{let E=class extends f{constructor(){super(...arguments),this.controller=null,this.updatePolicy=m.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.drapeSourceType=c.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 r=new d({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",r),this.addResolvingPromise((async()=>{await r.setup(),this.queryEngine=new h({layerView:this,priority:g.FEATURE_QUERY_ENGINE})})()),this.addResolvingPromise((async()=>{const e=await y(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e)),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=r(this.controller),this._set("processor",r(this.processor)),this.queryEngine=r(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this.pendingController=r(this.pendingController)}get legendEnabled(){var e,t;return this.canResume()&&!(null!=(e=this.processor)&&null!=(t=e.frustumVisibility)&&t.suspended)}getGraphicFromGraphicUid(e){var t;let r=null;return null==(t=this.loadedGraphics)||t.forEach((t=>{t.uid===e&&(r=a(t,this.layer))})),r}whenGraphicBounds(e,t){var r;return null==(r=this.processor)?void 0:r.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var r;return null==(r=this.processor)?void 0:r.computeAttachmentOrigin(e,t)}queryFeatures(e,t){return this.queryEngine.executeQuery(this._ensureQuery(e),s(t,"signal"))}queryObjectIds(e,t){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),s(t,"signal"))}queryFeatureCount(e,t){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),s(t,"signal"))}queryExtent(e,t){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),s(t,"signal"))}_ensureQuery(e){return i(e)?this.createQuery():p.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.suspended)}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){var e,t,r;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&(null==(e=this.controller)||!e.updating)&&null!=(t=this.view)&&null!=(r=t.basemapTerrain)&&r.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(t){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await o((()=>{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(){var e,t;const r=this.controller instanceof u?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:null!=(e=null==r?void 0:r.maximumNumberOfFeatures)?e:-1,totalNumberOfFeatures:null!=(t=null==r?void 0:r.serviceDataCount)?t:-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return e([n()],E.prototype,"loadedGraphics",void 0),e([n()],E.prototype,"suspended",void 0),e([n({readOnly:!0})],E.prototype,"legendEnabled",null),e([n()],E.prototype,"updating",void 0),e([n()],E.prototype,"controller",void 0),e([n()],E.prototype,"processor",void 0),e([n({readOnly:!0})],E.prototype,"updatePolicy",void 0),e([n({readOnly:!0})],E.prototype,"suspendResumeExtentMode",void 0),e([n({type:Boolean})],E.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],E.prototype,"suspendInfo",void 0),E=e([l("esri.views.3d.layers.FeatureLikeLayerView3D")],E),E};export{f 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 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};
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 a}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as p}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=p.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(){var s;return null==(s=this.processor)?void 0:s.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var s;return null==(s=this.processor)?void 0:s.graphics3DGraphicsByObjectID}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([a("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 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};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Logger.js";import{destroyMaybe as i,isNone as s,isSome 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 u}from"../../../core/accessorSupport/decorators/subclass.js";import{b as h}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 S from"../../../rest/support/Query.js";import{I3SPointsWorkerHandle as D}from"./I3SPointsWorkerHandle.js";import{DrapeSourceType as F}from"./interfaces.js";import{LayerView3D as C}from"./LayerView3D.js";import A from"./graphics/Graphics3DFeatureProcessor.js";import O from"./graphics/QueryEngine.js";import{createInteractiveEditSession as j,processAttributeEdits as N}from"./i3s/attributeEditing.js";import{I3SAttributeOverrides as T}from"./i3s/I3SAttributeOverrides.js";import{checkSpatialReferences as V,containsDraco as G,whenGraphicAttributes as M,getCachedAttributeValue as P}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as R}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import{PopupSceneLayerView as H}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as U}from"./support/SceneLayerViewRequiredFields.js";import q from"../support/debugFlags.js";import{GraphicsMap as Q}from"../support/GraphicsMap.js";import{compute as k}from"../support/orientedBoundingBox.js";import{updatingProgress as B}from"../support/updatingProperties.js";import{UpdatePolicy as z}from"../webgl-engine/lib/basicInterfaces.js";import W from"../../layers/SceneLayerView.js";import{TaskPriority as K}from"../../support/Scheduler.js";const Z=r.getLogger("esri.views.3d.layers.SceneLayerGraphicsView3D"),Y=L();let J=class extends(R(H(C(W)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._nodesAddedToStage=new Map,this.drapeSourceType=F.Features,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new Q,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 T(this.layer,null==(e=this.view.resourceController)?void 0:e.memoryController),V(r,this.view.spatialReference,this.view.viewingMode),this.fieldsHelper=new U({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(q,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&q.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||q.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}))),this._set("processor",new A({owner:this,preferredUpdatePolicy:z.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,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}),G(this.layer.geometryDefinitions)&&(this._worker=new D((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 O({layerView:this,priority:K.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(){var e,t,r;const i=null==(e=this.processor)||null==(t=e.graphicsCore)?void 0:t.displayFeatureLimit;return null!=(r=null==i?void 0:i.maximumNumberOfFeatures)?r: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}async whenGraphicAttributes(e,t){return M(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.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.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)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return j(this.attributeEditingContext,e)}async _extractBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};return s(this._worker)&&(this._worker=new D((e=>this.view.resourceController.schedule(e)))),this._worker.invoke(r,t).then((e=>{if(o(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&&Z.error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&Z.error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++)}async addNode(e,t,r){if(!ee(t)&&!X(t))return Promise.reject();if(this._nodesAddedToStage.has(e.index))return void Z.error("I3S node "+e.id+" already added");const i=o(this.layer.fullExtent)?re(this.layer.fullExtent.clone(),.5):null,s=this._controller.crsVertex,a=[],n={graphics:null,featureIds:null,attributeInfo:t.attributeDataInfo,node:e};if(ee(t)?await this._addNodeBinaryPointData(e,n,t,i,a,r):X(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),te(n),a.length>0&&(this._computeObb(e,a,s),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return this._cacheNodeData(n),Promise.resolve();if(o(this._verticalScale))for(const o of n.graphics)this._verticalScale(o.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=k(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,s,n,d){const l=await this._extractBinaryPointData(i,d);if(null==l)return Promise.reject();const u=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=o(e.serviceObb)?e.serviceObb.center:[0,0,0],i=I*b,d=c(y[i+0],y[i+1],y[i+2]);h(d,d,r),e.serviceObb||n.push(d[0],d[1],d[2]),o(s)&&this._checkExtent(s,d);const l=_[I],E={};null!=l&&(E[u]=l);const w=null==l?t.generateUID():l;g(d,p,0,se,m,0,1);const S=v(se[0],se[1],se[2],m),D=this.loadedGraphics.get(w);if(o(D))D.level<e.level&&(oe.property="geometry",oe.graphic=D,oe.oldValue=a(D.geometry),oe.newValue=S,D.geometry=S,f.graphicUpdateHandler(oe)),x.push(D);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,s,a){const n=this._getObjectIdField(),d=this._controller.crsVertex,l=this.view.spatialReference,u=[0,0,0],h=new Array,c=new Array;for(const p of i.pointData){const r=p.featureDataPosition,i=r.length,m=p.geometries&&p.geometries[0]||ie[i],f=p.featureIds[0];if("points"!==m.params.type)continue;o(s)&&this._checkExtent(s,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 s=0;s<b.length;s+=i){for(let e=0;e<i;e++)u[e]=r[e]+b[s+e];const n=3===i;e.serviceObb||a.push(u[0],u[1],n?u[2]:0),g(u,d,0,se,l,0,1);const h=v(se[0],se[1],n?se[2]:void 0,l),p=this.loadedGraphics.get(_);o(p)?c.push(p):c.push({objectId:_,uid:t.generateUID(),geometry:h,attributes:y,visible:!0})}h.push(f)}r.graphics=c,r.featureIds=h}_updateNodeMemory(e){e.memory=4096+(o(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();Z.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&&o(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodesAddedToStage.get(e);if(t&&o(t.attributeInfo))return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this._nodesAddedToStage.get(e);r&&!s(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(te(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&&Z.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&&(oe.graphic=r,oe.property="visible",oe.oldValue=e,oe.newValue=r.visible,this.processor.graphicsCore.graphicUpdateHandler(oe))}}_invalidateElevation(e){const t=this._controller.crsIndex;f(e.extent,e.spatialReference,ae,t),this._controller.updateElevationChanged(ae,t)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return o(this.filter)?this.filter.createQuery(e):new S(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(s(e)?this.createQuery():S.from(e))}getUsedMemory(){var e,t,r;return null!=(e=null==(t=this.processor)||null==(r=t.graphicsCore)?void 0:r.usedMemory)?e:0}getUnloadedMemory(){var e,t,r,i,s;return.8*((null!=(e=null==(t=this._controller)?void 0:t.unloadedMemoryEstimate)?e:0)+(null!=(r=null==(i=this.processor)||null==(s=i.graphicsCore)?void 0:s.unprocessedMemoryEstimate)?r:0))}ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){N(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 s=this._nodesAddedToStage.get(t);if(o(i)){const t=this.loadedGraphics.get(i.attributes[e]);o(t)&&this.processor.graphicsCore.recreateGraphics([t])}else o(s)&&this.processor.graphicsCore.recreateGraphics(s.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()],J.prototype,"processor",void 0),e([l({type:w})],J.prototype,"filter",void 0),e([l()],J.prototype,"loadedGraphics",void 0),e([l({aliasOf:"layer"})],J.prototype,"i3slayer",void 0),e([l()],J.prototype,"_controller",void 0),e([l()],J.prototype,"updating",void 0),e([l()],J.prototype,"suspended",void 0),e([l()],J.prototype,"holeFilling",void 0),e([l(B)],J.prototype,"updatingProgress",void 0),e([l({aliasOf:"_controller.updatingProgress"})],J.prototype,"updatingProgressValue",void 0),e([l(Y.requiredFields)],J.prototype,"requiredFields",null),e([l(Y.availableFields)],J.prototype,"availableFields",void 0),e([l()],J.prototype,"fieldsHelper",void 0),e([l({type:Number})],J.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],J.prototype,"maximumNumberOfFeaturesExceeded",null),e([l({readOnly:!0,aliasOf:"view.qualitySettings.sceneService.point.lodFactor"})],J.prototype,"lodFactor",void 0),e([l({readOnly:!0})],J.prototype,"hasM",null),e([l({readOnly:!0})],J.prototype,"hasZ",null),J=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],J);const $=J;function X(e){return"pointData"in e}function ee(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function te(e){const t=e.attributeInfo;for(let r=0;r<e.graphics.length;r++){const i=e.graphics[r];if(i.attributes||(i.attributes={}),o(t)&&o(t.loadedAttributes))for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(i.attributes[e]=P(t.attributeData[e],r))}}function re(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 ie={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},se=p(),oe={graphic:null,property:null,oldValue:null,newValue:null},ae=y();export{$ as default};