@arcgis/core 4.31.0-next.20240919 → 4.31.0-next.20240921

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 (283) hide show
  1. package/WebDocument2D.js +1 -1
  2. package/WebLinkChart.js +1 -1
  3. package/WebMap.js +1 -1
  4. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  5. package/arcade/featureset/actions/Adapted.js +1 -1
  6. package/arcade/featureset/support/StatsField.js +1 -1
  7. package/arcade/featureset/support/errorsupport.js +1 -1
  8. package/arcade/featureset/support/sqlUtils.js +1 -1
  9. package/arcade/functions/maths.js +1 -1
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{d9d8606f0a7c82b42755.js → 093a1ee161cb6a840283.js} +1 -1
  12. package/assets/esri/core/workers/chunks/2020b99675caabf5ac87.js +1 -0
  13. package/assets/esri/core/workers/chunks/24d45530fe47b3114daf.js +1 -0
  14. package/assets/esri/core/workers/chunks/35f92652df2561845d47.js +1 -0
  15. package/assets/esri/core/workers/chunks/42b92b4c2c9fd2b15f60.js +2 -0
  16. package/assets/esri/core/workers/chunks/{ba561e03df67894e437f.js.LICENSE.txt → 42b92b4c2c9fd2b15f60.js.LICENSE.txt} +1 -1
  17. package/assets/esri/core/workers/chunks/65b1d7fa57d4c764efe8.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b99d380cce485e65c990.js → 6cda92678ffeeaea0330.js} +1 -1
  19. package/assets/esri/core/workers/chunks/736e0c5cb9010ca818d8.js +1 -0
  20. package/assets/esri/core/workers/chunks/757b83799555958e059c.js +1 -0
  21. package/assets/esri/core/workers/chunks/76d8192015ce46dbf92a.js +1 -0
  22. package/assets/esri/core/workers/chunks/7b4880b2dc6b01d70ccc.js +1 -0
  23. package/assets/esri/core/workers/chunks/884cd0bd036c65567929.js +1 -0
  24. package/assets/esri/core/workers/chunks/95ea77a7d63c9d7ed78b.js +1 -0
  25. package/assets/esri/core/workers/chunks/{da3a4eb3fbb9dd509b4b.js → 98e872da08203455a5b6.js} +1 -1
  26. package/assets/esri/core/workers/chunks/ad4fa125e09cc0047f5b.js +1 -0
  27. package/assets/esri/core/workers/chunks/bb5a18dd1e6a71905668.js +2 -0
  28. package/assets/esri/core/workers/chunks/bf406a46515d5dfebe06.js +1 -0
  29. package/assets/esri/core/workers/chunks/d9c34e07627d93d4670b.js +1 -0
  30. package/assets/esri/core/workers/chunks/e1e9a7695e48e34a69bd.js +1 -0
  31. package/assets/esri/core/workers/chunks/e4f1464ed269c301b4ee.js +1 -0
  32. package/assets/esri/core/workers/chunks/{072029d05ccb56979523.js → e611141692355a1ba2b2.js} +1 -1
  33. package/assets/esri/core/workers/chunks/f41e8d0d6f5e81289179.js +1 -0
  34. package/assets/esri/core/workers/chunks/f7c96d34c70ed36da7c2.js +1 -0
  35. package/assets/esri/core/workers/chunks/{5ca8e767cc03e1425338.js → f9e90a2fda559ca68848.js} +1 -1
  36. package/assets/esri/themes/base/_functions.scss +6 -2
  37. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +4 -0
  38. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +6 -0
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  43. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ar.json +1 -1
  44. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bg.json +1 -1
  45. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bs.json +1 -1
  46. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ca.json +1 -1
  47. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_cs.json +1 -1
  48. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_da.json +1 -1
  49. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_de.json +1 -1
  50. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_el.json +1 -1
  51. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  52. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_es.json +1 -1
  53. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_et.json +1 -1
  54. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fi.json +1 -1
  55. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fr.json +1 -1
  56. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_he.json +1 -1
  57. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hr.json +1 -1
  58. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hu.json +1 -1
  59. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_id.json +1 -1
  60. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_it.json +1 -1
  61. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ja.json +1 -1
  62. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ko.json +1 -1
  63. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lt.json +1 -1
  64. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lv.json +1 -1
  65. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nb.json +1 -1
  66. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nl.json +1 -1
  67. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pl.json +1 -1
  68. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-BR.json +1 -1
  69. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-PT.json +1 -1
  70. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ro.json +1 -1
  71. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ru.json +1 -1
  72. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sk.json +1 -1
  73. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sl.json +1 -1
  74. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sr.json +1 -1
  75. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sv.json +1 -1
  76. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_th.json +1 -1
  77. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_tr.json +1 -1
  78. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_uk.json +1 -1
  79. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_vi.json +1 -1
  80. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-CN.json +1 -1
  81. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-HK.json +1 -1
  82. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-TW.json +1 -1
  83. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  84. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  85. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  102. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  103. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  104. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nb.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  118. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  119. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  120. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  121. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  122. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  123. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  124. package/chunks/Bufferer-93RDFIRm.js +5 -0
  125. package/chunks/Centroid-DZi-eb9F.js +1 -1
  126. package/chunks/ComponentShader.glsl.js +10 -13
  127. package/chunks/Distance2DCalculator-De7WFGFq.js +5 -0
  128. package/chunks/GeodeticDistanceCalculator-CN7xMqrJ.js +5 -0
  129. package/chunks/LineSeries.js +1 -1
  130. package/chunks/{OITCompositing.glsl.js → OITBlend.glsl.js} +1 -1
  131. package/chunks/OperatorGeneralize.js +1 -1
  132. package/chunks/OperatorGeodesicBuffer.js +1 -1
  133. package/chunks/OperatorGeodeticArea.js +1 -1
  134. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  135. package/chunks/OperatorGeodeticDistance.js +1 -1
  136. package/chunks/OperatorGeodeticLength.js +1 -1
  137. package/chunks/OperatorProximity.js +1 -1
  138. package/chunks/OperatorShapePreservingLength.js +5 -0
  139. package/chunks/Polyline.js +1 -1
  140. package/chunks/Theme.js +1 -1
  141. package/chunks/Tick.js +1 -1
  142. package/chunks/tslib.es6.js +1 -1
  143. package/core/mathUtils.js +1 -1
  144. package/core/sql/AggregateFunctions.js +1 -1
  145. package/core/sql/SqlInterval.js +1 -1
  146. package/core/sql/StandardizedFunctions.js +1 -1
  147. package/core/sql/WhereClause.js +1 -1
  148. package/core/sql/WhereGrammar.js +1 -1
  149. package/core/sql/errorSupport.js +5 -0
  150. package/core/sql/sqlArithmeticUtils.js +1 -1
  151. package/core/sql/sqlCompareUtils.js +1 -1
  152. package/core/sql/sqlDateParsingUtils.js +1 -1
  153. package/geometry/operators/areaOperator.js +5 -0
  154. package/geometry/operators/containsOperator.js +1 -1
  155. package/geometry/operators/crossesOperator.js +1 -1
  156. package/geometry/operators/disjointOperator.js +1 -1
  157. package/geometry/operators/distanceOperator.js +1 -1
  158. package/geometry/operators/equalsOperator.js +1 -1
  159. package/geometry/operators/geodeticDensifyOperator.js +5 -0
  160. package/geometry/operators/graphicBufferOperator.js +5 -0
  161. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  162. package/geometry/operators/gx/operatorBuffer.js +1 -1
  163. package/geometry/operators/gx/operatorClip.js +1 -1
  164. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  165. package/geometry/operators/gx/operatorCut.js +1 -1
  166. package/geometry/operators/gx/operatorDifference.js +1 -1
  167. package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
  168. package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
  169. package/geometry/operators/gx/{operatorGeodeticDensifyByLength.js → operatorGeodeticDensify.js} +1 -1
  170. package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
  171. package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
  172. package/geometry/operators/gx/operatorGraphicBuffer.js +5 -0
  173. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  174. package/geometry/operators/gx/operatorIntersection.js +1 -1
  175. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  176. package/geometry/operators/gx/operatorOffset.js +1 -1
  177. package/geometry/operators/gx/operatorSimplify.js +1 -1
  178. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  179. package/geometry/operators/gx/operatorUnion.js +1 -1
  180. package/geometry/operators/intersectsOperator.js +1 -1
  181. package/geometry/operators/isNearOperator.js +1 -1
  182. package/geometry/operators/lengthOperator.js +5 -0
  183. package/geometry/operators/overlapsOperator.js +1 -1
  184. package/geometry/operators/proximityOperator.d.ts +4 -0
  185. package/geometry/operators/proximityOperator.js +1 -1
  186. package/geometry/operators/relateOperator.js +1 -1
  187. package/geometry/operators/reshapeOperator.js +1 -1
  188. package/geometry/operators/touchesOperator.js +1 -1
  189. package/geometry/operators/withinOperator.js +1 -1
  190. package/interfaces.d.ts +310 -28
  191. package/layers/mixins/ArcGISMapService.js +1 -1
  192. package/layers/support/ControlPointsGeoreference.js +1 -1
  193. package/layers/support/MediaElementBase.js +1 -1
  194. package/layers/support/mediaUtils.js +1 -1
  195. package/linkChart/LinkChartProperties.js +1 -1
  196. package/linkChart/utils.js +1 -1
  197. package/package.json +2 -2
  198. package/portal/schemas/definitions.js +1 -1
  199. package/support/revision.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  201. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  202. package/views/2d/layers/LayerView2D.js +1 -1
  203. package/views/2d/support/highlightGroupUtils.js +1 -1
  204. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  205. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  206. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  207. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  208. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  209. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  210. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  211. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +5 -0
  212. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +5 -0
  213. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +5 -0
  214. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  215. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  216. package/views/LinkChartView.js +1 -1
  217. package/views/MapView.js +1 -1
  218. package/views/View.js +1 -1
  219. package/views/View2D.js +1 -1
  220. package/views/draw/DrawGraphicTool.js +1 -1
  221. package/views/draw/support/Box.js +1 -1
  222. package/views/draw/support/Reshape.js +1 -1
  223. package/views/interactive/Tooltip.d.ts +4 -0
  224. package/views/interactive/Tooltip.js +5 -0
  225. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  226. package/webdoc/widgets/TimeSlider.js +1 -1
  227. package/webmap/InitialViewProperties.js +1 -1
  228. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  229. package/widgets/BasemapGallery.js +1 -1
  230. package/widgets/BasemapLayerList/css.js +1 -1
  231. package/widgets/BasemapLayerList.js +1 -1
  232. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  233. package/widgets/BatchAttributeForm/templates/BatchAttributeFormElementTemplate.js +1 -1
  234. package/widgets/BatchAttributeForm/templates/BatchAttributeFormTemplate.js +1 -1
  235. package/widgets/BatchAttributeForm/templates/BatchFieldElementTemplate.js +1 -1
  236. package/widgets/BatchAttributeForm/templates/batchAttributeFormTemplateUtils.js +1 -1
  237. package/widgets/CatalogLayerList.js +1 -1
  238. package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
  239. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  240. package/widgets/FeatureForm/FieldInput.js +1 -1
  241. package/widgets/LayerList/LayerListItem.js +1 -1
  242. package/widgets/LayerList/LayerListViewModel.js +1 -1
  243. package/widgets/LayerList.js +1 -1
  244. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  245. package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter2D.js +1 -1
  246. package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter3D.js +1 -1
  247. package/widgets/OrientedImageryViewer/constants.js +1 -1
  248. package/widgets/OrientedImageryViewer/css.js +1 -1
  249. package/widgets/OrientedImageryViewer/utils.js +1 -1
  250. package/widgets/OrientedImageryViewer.js +1 -1
  251. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  252. package/widgets/Sketch/SketchViewModel.js +1 -1
  253. package/widgets/Sketch.js +1 -1
  254. package/widgets/support/SnappingControls.js +1 -1
  255. package/assets/esri/core/workers/chunks/0cfa9665dab31e5235a8.js +0 -1
  256. package/assets/esri/core/workers/chunks/22fb5687932019304225.js +0 -1
  257. package/assets/esri/core/workers/chunks/3b3c8362359a82c66793.js +0 -1
  258. package/assets/esri/core/workers/chunks/3cb1de0b9bf9a25112e0.js +0 -1
  259. package/assets/esri/core/workers/chunks/59833b27d8413b6d9312.js +0 -1
  260. package/assets/esri/core/workers/chunks/5e43cb91bbe20f2d32e3.js +0 -1
  261. package/assets/esri/core/workers/chunks/67df47efb9a9dfeafee2.js +0 -1
  262. package/assets/esri/core/workers/chunks/6be62448e33baabe028c.js +0 -1
  263. package/assets/esri/core/workers/chunks/6d668f7696f280ec9588.js +0 -1
  264. package/assets/esri/core/workers/chunks/74edde71352e1f578a3b.js +0 -1
  265. package/assets/esri/core/workers/chunks/907e74abb4a85a76e3b5.js +0 -1
  266. package/assets/esri/core/workers/chunks/941fe04f47059074c05b.js +0 -2
  267. package/assets/esri/core/workers/chunks/a0005bc65f79e83f26ee.js +0 -1
  268. package/assets/esri/core/workers/chunks/a6560ff77be29344bc50.js +0 -1
  269. package/assets/esri/core/workers/chunks/a6c3c1827d2e8bbfcd9e.js +0 -1
  270. package/assets/esri/core/workers/chunks/ba561e03df67894e437f.js +0 -2
  271. package/assets/esri/core/workers/chunks/df9daac7ea581e9e5ca4.js +0 -1
  272. package/assets/esri/core/workers/chunks/ea51a7c32f716f4f1a34.js +0 -1
  273. package/assets/esri/core/workers/chunks/ef7dcb8758e7f21d30bc.js +0 -1
  274. package/chunks/Distance2DCalculator-BzAEa8Xe.js +0 -5
  275. package/chunks/GeodeticDistanceCalculator-BS_KY66f.js +0 -5
  276. package/chunks/OperatorShapePreservingDensify.js +0 -5
  277. package/geometry/operators/geodeticDensifyByLengthOperator.js +0 -5
  278. package/geometry/operators/gx/operatorShapePreservingDensify.js +0 -5
  279. package/geometry/operators/shapePreservingDensifyOperator.js +0 -5
  280. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +0 -5
  281. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +0 -5
  282. package/views/interactive/tooltip/Tooltip.js +0 -5
  283. /package/assets/esri/core/workers/chunks/{941fe04f47059074c05b.js.LICENSE.txt → bb5a18dd1e6a71905668.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Evented.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as n}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import p from"../../../../../geometry/Point.js";import{ViewingMode as c}from"../../../../ViewingMode.js";import{Manipulator3D as h}from"../../Manipulator3D.js";import{placeAtObject as m}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{manipulatedObjectGeometry as u}from"../manipulatedObjectUtils.js";import{canMoveZOperations as v}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as g}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as f}from"../tooltipUtils3D.js";import{createVisualElements as _}from"../visualElementUtils.js";import{alignArrowsScaleThreshold as b}from"../manipulations/config.js";import{MoveManipulation as j,ManipulationType as y}from"../manipulations/MoveManipulation.js";import{ScaleRotateMeshAdapter as S}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as M}from"./ScaleRotateObjectSymbol3DAdapter.js";import{ScaleRotateTransform as R}from"./ScaleRotateTransform.js";import{sceneSnappingAtProjectedLocation as w}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as O}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import A from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as x}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as I}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as k}from"../../../../interactive/tooltip/Tooltip.js";import{enterInputModeIfAvailable as U}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{TransformMeshTooltipInfo as E}from"../../../../interactive/tooltip/infos/TransformMeshTooltipInfo.js";import{TransformPointTooltipInfo as H}from"../../../../interactive/tooltip/infos/TransformPointTooltipInfo.js";let z=class extends T{constructor(t){super(t),this.events=new o,this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.sketchOptions=new A,this.type="transform-3d",this._updatingHandles=new l,this._scaleRotate=null}initialize(){const{events:t,object:o,view:a}=this;this.tooltip=k((()=>({view:a,options:this.sketchOptions.tooltips}))),this._moveManipulation=new j({tool:this,view:a,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&v(o.operations,o.elevationInfo),radius:j.radiusForSymbol(o.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles(e.events.on("immediate-click",(e=>{t.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))));const s=o.elevationInfo;if(this._moveManipulation.elevationInfo=s,this.addHandles(g(o)),this._moveManipulation.createManipulatedObjectDragPipeline(((t,e,i,n,r)=>{if(t===y.XY){const{snappingStep:t,cancelSnapping:e}=I({snappingContext:new x({elevationInfo:s,pointer:r,editGeometryOperations:O.fromGeometry(new p({spatialReference:o.operations?.data.spatialReference}),a.state.viewingMode),visualizer:new d,excludeFeature:o.graphic}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!1});n=n.next(e),i=i.next(w(this.view,s)).next(...t)}return{steps:i,cancel:n}}),o,(e=>{const{action:o,object:i,dxScreen:a,dyScreen:n}=e,s={object:i,dxScreen:a,dyScreen:n};switch(o){case"start":this._emitRecordUndo(),t.emit("translate-start",s);break;case"update":t.emit("translate",s);break;case"end":t.emit("translate-stop",s)}})),this._moveManipulation.angle=null!=this._scaleRotate?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.addHandles(n((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new R({tool:this,mode:t,adapter:this._scaleRotateAdapter,sketchOptions:this.sketchOptions,tooltipEnabled:"mesh"!==u(o)?.type}),this.addHandles(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.addHandles([_({view:this.view,object:o,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>i()}),o.on("committed",(()=>this._onGeometryChanged())),this._hideManipulatorsForObjectState(),n((()=>a.scale),(()=>this._updateMoveAngle()))].filter(e)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof h&&this.addHandles(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))}));const r=a?.type,{sketchOptions:l}=this;this._meshTooltipInfo=new E({viewType:r,sketchOptions:l}),this._pointTooltipInfo=new H({viewType:r,sketchOptions:l});const c={object:o,dxScreen:0,dyScreen:0},m={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),t.emit("translate-start",{...c})},onMove:()=>t.emit("translate",{...c}),onMoveStop:()=>t.emit("translate-stop",{...c}),onRotateStart:e=>{this._emitRecordUndo(),t.emit("rotate-start",{object:o,angle:e})},onRotate:e=>t.emit("rotate",{object:o,angle:e}),onRotateStop:e=>t.emit("rotate-stop",{object:o,angle:e}),onScaleStart:(e,i)=>{this._emitRecordUndo(),t.emit("scale-start",{object:o,xScale:e,yScale:i})},onScale:(e,i)=>t.emit("scale",{object:o,xScale:e,yScale:i}),onScaleStop:(e,i)=>t.emit("scale-stop",{object:o,xScale:e,yScale:i})};this.addHandles(f(this.tooltip,this.object,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this.activeTooltipInfo,callbacks:m})))),this.finishToolCreation()}destroy(){this.tooltip.destroy(),this._moveManipulation.destroy(),this._scaleRotate=a(this._scaleRotate),this._scaleRotateAdapter=a(this._scaleRotateAdapter),this._updatingHandles.destroy(),this._set("view",null),this._set("object",null)}onInputEvent(t){if(!this.destroyed&&!U(t,this.tooltip))return super.onInputEvent(t)}_updateManipulatorsInteractive(){null!=this._scaleRotate&&(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){const t=u(this.object);return"mesh"===t?.type?new S({object:this.object,geometry:t,viewingMode:this.view.state.viewingMode}):new M({graphic:this.object.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.object.graphic?.layer)),sizeAxis:this.sketchOptions?.tooltips?.visualVariables?.size?.axis??null})}_forEachManipulator(t){this._moveManipulation?.forEachManipulator(t),this._scaleRotate?.forEachManipulator(t)}_hideManipulatorsForObjectState(){return n((()=>this.object.visible),(t=>{this._forEachManipulator((e=>e.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&v(this.object.operations,this.object.elevationInfo)}))}_emitRecordUndo(){this.events.emit("record-undo",{updates:[this.object.createUndoRecord()]})}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this._updatingHandles.updating||!!this._scaleRotate?.updating}get activeTooltipInfo(){return null!=this._scaleRotate?.tooltip?.info?null:"mesh"===u(this.object)?.type?this._meshTooltipInfo:this._pointTooltipInfo}set location(t){this._moveManipulation.location=t,this._scaleRotate&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){null!=this._scaleRotate&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){const{view:t}=this,e=t.state.viewingMode===c.Local||t.scale<b;this._moveManipulation.angle=e?this._scaleRotateAdapter.angle:0}_onGeometryChanged(){m(this,this.object)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){}};t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"view",void 0),t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"object",void 0),t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"enableZ",void 0),t([s()],z.prototype,"enableRotation",void 0),t([s()],z.prototype,"enableScaling",void 0),t([s({constructOnly:!0,type:A})],z.prototype,"sketchOptions",void 0),t([s({value:!1})],z.prototype,"snapToScene",null),t([s({constructOnly:!0})],z.prototype,"snappingManager",void 0),t([s({readOnly:!0})],z.prototype,"type",void 0),t([s({readOnly:!0})],z.prototype,"updating",null),t([s()],z.prototype,"activeTooltipInfo",null),z=t([r("esri.views.3d.interactive.editingTools.transform.TransformTool3D")],z);export{z as TransformTool3D};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../../core/arrayUtils.js";import o from"../../../../../core/Evented.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as n}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import p from"../../../../../geometry/Point.js";import{ViewingMode as c}from"../../../../ViewingMode.js";import{Manipulator3D as h}from"../../Manipulator3D.js";import{placeAtObject as m}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{manipulatedObjectGeometry as u}from"../manipulatedObjectUtils.js";import{canMoveZOperations as v}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as g}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as _}from"../tooltipUtils3D.js";import{createVisualElements as f}from"../visualElementUtils.js";import{alignArrowsScaleThreshold as b}from"../manipulations/config.js";import{MoveManipulation as j,ManipulationType as y}from"../manipulations/MoveManipulation.js";import{ScaleRotateMeshAdapter as S}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as M}from"./ScaleRotateObjectSymbol3DAdapter.js";import{ScaleRotateTransform as R}from"./ScaleRotateTransform.js";import{sceneSnappingAtProjectedLocation as w}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as O}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as T}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import A from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as x}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as I}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as k,enterInputModeIfAvailable as U}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{TransformMeshTooltipInfo as E}from"../../../../interactive/tooltip/infos/TransformMeshTooltipInfo.js";import{TransformPointTooltipInfo as H}from"../../../../interactive/tooltip/infos/TransformPointTooltipInfo.js";let z=class extends O{constructor(t){super(t),this.events=new o,this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.sketchOptions=new A,this.type="transform-3d",this._updatingHandles=new l,this._scaleRotate=null}initialize(){const{events:t,object:o,view:a}=this;this.tooltip=k((()=>({view:a,options:this.sketchOptions.tooltips}))),this._moveManipulation=new j({tool:this,view:a,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&v(o.operations,o.elevationInfo),radius:j.radiusForSymbol(o.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles(e.events.on("immediate-click",(e=>{t.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))));const s=o.elevationInfo;if(this._moveManipulation.elevationInfo=s,this.addHandles(g(o)),this._moveManipulation.createManipulatedObjectDragPipeline(((t,e,i,n,r)=>{if(t===y.XY){const{snappingStep:t,cancelSnapping:e}=I({snappingContext:new x({elevationInfo:s,pointer:r,editGeometryOperations:T.fromGeometry(new p({spatialReference:o.operations?.data.spatialReference}),a.state.viewingMode),visualizer:new d,excludeFeature:o.graphic}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!1});n=n.next(e),i=i.next(w(this.view,s)).next(...t)}return{steps:i,cancel:n}}),o,(e=>{const{action:o,object:i,dxScreen:a,dyScreen:n}=e,s={object:i,dxScreen:a,dyScreen:n};switch(o){case"start":this._emitRecordUndo(),t.emit("translate-start",s);break;case"update":t.emit("translate",s);break;case"end":t.emit("translate-stop",s)}})),this._moveManipulation.angle=null!=this._scaleRotate?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.addHandles(n((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new R({tool:this,mode:t,adapter:this._scaleRotateAdapter,sketchOptions:this.sketchOptions,tooltipEnabled:"mesh"!==u(o)?.type}),this.addHandles(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.addHandles([f({view:this.view,object:o,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>i()}),o.on("committed",(()=>this._onGeometryChanged())),this._hideManipulatorsForObjectState(),n((()=>a.scale),(()=>this._updateMoveAngle()))].filter(e)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof h&&this.addHandles(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))}));const r=a?.type,{sketchOptions:l}=this;this._meshTooltipInfo=new E({viewType:r,sketchOptions:l}),this._pointTooltipInfo=new H({viewType:r,sketchOptions:l});const c={object:o,dxScreen:0,dyScreen:0},m={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),t.emit("translate-start",{...c})},onMove:()=>t.emit("translate",{...c}),onMoveStop:()=>t.emit("translate-stop",{...c}),onRotateStart:e=>{this._emitRecordUndo(),t.emit("rotate-start",{object:o,angle:e})},onRotate:e=>t.emit("rotate",{object:o,angle:e}),onRotateStop:e=>t.emit("rotate-stop",{object:o,angle:e}),onScaleStart:(e,i)=>{this._emitRecordUndo(),t.emit("scale-start",{object:o,xScale:e,yScale:i})},onScale:(e,i)=>t.emit("scale",{object:o,xScale:e,yScale:i}),onScaleStop:(e,i)=>t.emit("scale-stop",{object:o,xScale:e,yScale:i})};this.addHandles(_(this.tooltip,this.object,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this.activeTooltipInfo,callbacks:m})))),this.finishToolCreation()}destroy(){this.tooltip.destroy(),this._moveManipulation.destroy(),this._scaleRotate=a(this._scaleRotate),this._scaleRotateAdapter=a(this._scaleRotateAdapter),this._updatingHandles.destroy(),this._set("view",null),this._set("object",null)}onInputEvent(t){if(!this.destroyed&&!U(t,this.tooltip))return super.onInputEvent(t)}_updateManipulatorsInteractive(){null!=this._scaleRotate&&(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){const t=u(this.object);return"mesh"===t?.type?new S({object:this.object,geometry:t,viewingMode:this.view.state.viewingMode}):new M({graphic:this.object.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.object.graphic?.layer)),sizeAxis:this.sketchOptions?.tooltips?.visualVariables?.size?.axis??null})}_forEachManipulator(t){this._moveManipulation?.forEachManipulator(t),this._scaleRotate?.forEachManipulator(t)}_hideManipulatorsForObjectState(){return n((()=>this.object.visible),(t=>{this._forEachManipulator((e=>e.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&v(this.object.operations,this.object.elevationInfo)}))}_emitRecordUndo(){this.events.emit("record-undo",{updates:[this.object.createUndoRecord()]})}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this._updatingHandles.updating||!!this._scaleRotate?.updating}get activeTooltipInfo(){return null!=this._scaleRotate?.tooltip?.info?null:"mesh"===u(this.object)?.type?this._meshTooltipInfo:this._pointTooltipInfo}set location(t){this._moveManipulation.location=t,this._scaleRotate&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){null!=this._scaleRotate&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){const{view:t}=this,e=t.state.viewingMode===c.Local||t.scale<b;this._moveManipulation.angle=e?this._scaleRotateAdapter.angle:0}_onGeometryChanged(){m(this,this.object)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){}};t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"view",void 0),t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"object",void 0),t([s({constructOnly:!0,nonNullable:!0})],z.prototype,"enableZ",void 0),t([s()],z.prototype,"enableRotation",void 0),t([s()],z.prototype,"enableScaling",void 0),t([s({constructOnly:!0,type:A})],z.prototype,"sketchOptions",void 0),t([s({value:!1})],z.prototype,"snapToScene",null),t([s({constructOnly:!0})],z.prototype,"snappingManager",void 0),t([s({readOnly:!0})],z.prototype,"type",void 0),t([s({readOnly:!0})],z.prototype,"updating",null),t([s()],z.prototype,"activeTooltipInfo",null),z=t([r("esri.views.3d.interactive.editingTools.transform.TransformTool3D")],z);export{z as TransformTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardByOpacity.glsl.js";import{ShaderOutput as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as a}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as d}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as l}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as p}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as h}from"../../../core/shaderTechnique/BindType.js";import{parameter as n,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as u,AlphaDiscardMode as y}from"../../../lib/basicInterfaces.js";import{OITPass as m}from"../../../lib/OITPass.js";var v;!function(o){o[o.None=0]="None",o[o.NoOverlay=1]="NoOverlay",o[o.ColorOverlay=2]="ColorOverlay",o[o.ColorOverlayWithWater=3]="ColorOverlayWithWater",o[o.COUNT=4]="COUNT"}(v||(v={}));class T extends c{constructor(o,n){super(),this.spherical=o,this.doublePrecisionRequiresObfuscation=n,this.output=r.Color,this.textureCoordinateType=i.None,this.componentData=e.Uniform,this.cullFace=u.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=d.WindingOrder,this.alphaDiscardMode=y.Opaque,this.integratedMeshMode=v.None,this.oitPass=m.NONE,this.ellipsoidMode=p.Earth,this.pbrMode=l.Disabled,this.normalType=s.Attribute,this.emissionSource=a.None,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=h.Draw,this.hasSliceHighlight=!0,this.hasSliceInVertexProgram=!1,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.objectAndLayerIdColorInstanced=!1}}o([n({count:r.COUNT})],T.prototype,"output",void 0),o([n({count:i.COUNT})],T.prototype,"textureCoordinateType",void 0),o([n({count:e.COUNT})],T.prototype,"componentData",void 0),o([n({count:u.COUNT})],T.prototype,"cullFace",void 0),o([n({count:t.COUNT})],T.prototype,"vertexDiscardMode",void 0),o([n({count:d.COUNT})],T.prototype,"doubleSidedMode",void 0),o([n({count:y.COUNT})],T.prototype,"alphaDiscardMode",void 0),o([n({count:v.COUNT})],T.prototype,"integratedMeshMode",void 0),o([n({count:m.COUNT})],T.prototype,"oitPass",void 0),o([n({count:p.COUNT})],T.prototype,"ellipsoidMode",void 0),o([n({count:l.COUNT})],T.prototype,"pbrMode",void 0),o([n({count:s.COUNT})],T.prototype,"normalType",void 0),o([n({count:a.COUNT})],T.prototype,"emissionSource",void 0),o([n()],T.prototype,"hasVertexColors",void 0),o([n()],T.prototype,"hasNormals",void 0),o([n()],T.prototype,"shadeNormals",void 0),o([n()],T.prototype,"hasSlicePlane",void 0),o([n()],T.prototype,"hasColorTexture",void 0),o([n()],T.prototype,"receiveAmbientOcclusion",void 0),o([n()],T.prototype,"receiveShadows",void 0),o([n()],T.prototype,"blendingEnabled",void 0),o([n()],T.prototype,"screenSpaceReflections",void 0),o([n()],T.prototype,"hasPolygonOffset",void 0),o([n()],T.prototype,"hasMetallicRoughnessTexture",void 0),o([n()],T.prototype,"hasOcclusionTexture",void 0),o([n()],T.prototype,"hasNormalTexture",void 0),o([n()],T.prototype,"hasOccludees",void 0),o([n()],T.prototype,"multipassEnabled",void 0),o([n()],T.prototype,"cullAboveGround",void 0),o([n()],T.prototype,"hasNormalTextureTransform",void 0),o([n()],T.prototype,"cloudReflections",void 0),o([n()],T.prototype,"snowCover",void 0),o([n()],T.prototype,"objectAndLayerIdColor",void 0);export{T as ComponentTechniqueConfiguration,v as IntegratedMeshMode};
5
+ import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardByOpacity.glsl.js";import{ShaderOutput as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as a}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as d}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as l}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as h}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as p}from"../../../core/shaderTechnique/BindType.js";import{parameter as n,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as u,AlphaDiscardMode as y}from"../../../lib/basicInterfaces.js";import{OITPass as m}from"../../../lib/OITPass.js";var v;!function(o){o[o.None=0]="None",o[o.NoOverlay=1]="NoOverlay",o[o.ColorOverlay=2]="ColorOverlay",o[o.ColorOverlayWithWater=3]="ColorOverlayWithWater",o[o.COUNT=4]="COUNT"}(v||(v={}));class T extends c{constructor(o,n){super(),this.spherical=o,this.doublePrecisionRequiresObfuscation=n,this.output=r.Color,this.textureCoordinateType=i.None,this.componentData=e.Uniform,this.cullFace=u.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=d.WindingOrder,this.alphaDiscardMode=y.Opaque,this.integratedMeshMode=v.None,this.oitPass=m.NONE,this.ellipsoidMode=h.Earth,this.pbrMode=l.Disabled,this.normalType=s.Attribute,this.emissionSource=a.None,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=p.Draw,this.hasSliceHighlight=!0,this.hasSliceInVertexProgram=!1,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.objectAndLayerIdColorInstanced=!1,this.canHaveOverlay=!0}}o([n({count:r.COUNT})],T.prototype,"output",void 0),o([n({count:i.COUNT})],T.prototype,"textureCoordinateType",void 0),o([n({count:e.COUNT})],T.prototype,"componentData",void 0),o([n({count:u.COUNT})],T.prototype,"cullFace",void 0),o([n({count:t.COUNT})],T.prototype,"vertexDiscardMode",void 0),o([n({count:d.COUNT})],T.prototype,"doubleSidedMode",void 0),o([n({count:y.COUNT})],T.prototype,"alphaDiscardMode",void 0),o([n({count:v.COUNT})],T.prototype,"integratedMeshMode",void 0),o([n({count:m.COUNT})],T.prototype,"oitPass",void 0),o([n({count:h.COUNT})],T.prototype,"ellipsoidMode",void 0),o([n({count:l.COUNT})],T.prototype,"pbrMode",void 0),o([n({count:s.COUNT})],T.prototype,"normalType",void 0),o([n({count:a.COUNT})],T.prototype,"emissionSource",void 0),o([n()],T.prototype,"hasVertexColors",void 0),o([n()],T.prototype,"hasNormals",void 0),o([n()],T.prototype,"shadeNormals",void 0),o([n()],T.prototype,"hasSlicePlane",void 0),o([n()],T.prototype,"hasColorTexture",void 0),o([n()],T.prototype,"receiveAmbientOcclusion",void 0),o([n()],T.prototype,"receiveShadows",void 0),o([n()],T.prototype,"blendingEnabled",void 0),o([n()],T.prototype,"screenSpaceReflections",void 0),o([n()],T.prototype,"hasPolygonOffset",void 0),o([n()],T.prototype,"hasMetallicRoughnessTexture",void 0),o([n()],T.prototype,"hasOcclusionTexture",void 0),o([n()],T.prototype,"hasNormalTexture",void 0),o([n()],T.prototype,"hasOccludees",void 0),o([n()],T.prototype,"multipassEnabled",void 0),o([n()],T.prototype,"cullAboveGround",void 0),o([n()],T.prototype,"hasNormalTextureTransform",void 0),o([n()],T.prototype,"cloudReflections",void 0),o([n()],T.prototype,"snowCover",void 0),o([n()],T.prototype,"objectAndLayerIdColor",void 0);export{T as ComponentTechniqueConfiguration,v as IntegratedMeshMode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as t}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorFormat as n}from"../../../webgl/formats.js";import i from"../../../webgl/RenderNode.js";import{alphaCutoff as s}from"../../core/shaderLibrary/util/AlphaCutoff.js";import{If as a,glsl as c}from"../../core/shaderModules/interfaces.js";import{Default3D as l}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as u,ColorAttachment as p,BlendFactor as d,SizedPixelFormat as f,PixelFormat as h,DataType as m}from"../../../../webgl/enums.js";let T=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces="final-color",this.consumes={required:["final-color"]},this.clearColor=t,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach((e=>e.dispose())),this._program.clear(),this.destroyedCB()}render(e){const r=e.find((({name:e})=>"final-color"===e));if(!this._focusedFBO)return r;const o=this.renderingContext;o.bindFramebuffer(r.fbo),o.setClearColor(0,0,0,0),o.clear(u.COLOR);const t=this._ensureShader(o,!1,0);return o.useProgram(t),o.bindTexture(this._focusedFBO.getTexture(),0),t.setUniform1i("colorTex",0),t.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&t.setUniform2fv("nearFar",this.camera.nearFar),o.screen.draw(),r}getDownscaledFBO(e,r,o,t,i,s){o===v.ON&&(i=e.width,s=e.height);const a=this.renderingContext,c=e.depthStencilTexture,l=this._ensureShader(a,null!=c,r),h=this.fboCache.acquire(i,s,"fbo visualizer"),m=!e.colorTexture?.descriptor.hasMipmap;m&&e.colorTexture?.generateMipmap(),a.useProgram(l),a.bindFramebuffer(h.fbo);let T=0;const g=[p.COLOR_ATTACHMENT0],x=null!=c;if(a.bindTexture(e.colorTexture,T),l.setUniform1i("colorTex",T),c){T++,a.bindTexture(c,T),l.setUniform1i("depthTex",T);const e=p.COLOR_ATTACHMENT0+T;h.acquireColor(e,n.RGBA,"depth to color"),g.push(e)}for(let u=0;u<r;u++){T++;const r=p.COLOR_ATTACHMENT0+T,o=x?1:0;a.bindTexture(e.getColorTexture(r-o),T),l.setUniform1i("colorTex"+(T-o-1),T),h.acquireColor(r,n.RGBA),g.push(r)}a.gl.drawBuffers(g);const F=a.getViewport();a.setViewport(0,0,i,s),a.setClearColor(0,0,0,0),a.clear(u.COLOR),a.setBlendingEnabled(!0),a.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA);const C="linear-depth"===t||t.includes("shadow"),b=e.colorTexture?.descriptor.internalFormat,O=C?3:b===f.R16F||b===f.R32F||b===f.R8?1:b===f.RG8?2:b===f.RGBA16F?4:0;return l.setUniform1i("inputType",O),C&&l.setUniform2fv("nearFar",this.camera.nearFar),a.screen.draw(),a.bindFramebuffer(null),a.setViewport(F.x,F.y,F.width,F.height),o===v.ON&&(this._focusedFBO=h,this._focusedFBOType=O),m&&e.colorTexture?.clearMipmap(),h}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,o,t){if(!o)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(u.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA),n.setViewport(0,0,e,r);const s=this._ensureShader(n,!1,0);n.useProgram(s),n.bindTexture(o.getColorTexture(t),0),s.setUniform1i("colorTex",0),s.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,h.RGBA,m.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),n.bindFramebuffer(null),i?.release(),a}_ensureShader(e,r,o){const t={hasDepth:r,attachments:o},n=this._program.get(t);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",u=(e,r)=>{let o="";const t=e?2:1;for(let n=0;n<r;n++)o+=`layout(location = ${c.int(t)}) out vec4 fragColor${c.int(n)};\n uniform sampler2D colorTex${c.int(n)};`;return o},p=e=>{let r="";for(let o=0;o<e;o++)r+=`fragColor${c.int(o)} = texture(colorTex${c.int(o)}, uv);`;return r},d=`#version 300 es\n precision highp float;\n\n in vec2 uv;\n uniform sampler2D colorTex;\n layout(location = 0) out vec4 fragColor;\n ${a(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${u(r,o)}\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgba2float(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgba2float(depth));\n }\n\n float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }\n\n void main() {\n vec4 color;\n if(inputType == 1) {\n color = vec4(vec3(texture(colorTex, uv).r), 1.0);\n } else if(inputType == 2) {\n color = vec4(texture(colorTex, uv).rg, 0.0, 1.0);\n } else if(inputType == 3) {\n float depth = 1.0 - (-linearDepthFromTexture(colorTex, uv) / (nearFar[1] - nearFar[0]));\n color = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if(inputType == 4) {\n color = texture(colorTex, uv);\n color = vec4(color.rgb / color.a, color.a);\n } else {\n color = texture(colorTex, uv);\n }\n\n\n if(color.a < ${c.float(s)})\n discard;\n else {\n fragColor = color;\n ${a(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n ${a(o>0,p(o))}\n }\n }`;return this._program.set(t,e.programCache.acquire(i,d,l)),this._program.get(t)}};var v;e([r()],T.prototype,"destroyedCB",void 0),e([r()],T.prototype,"produces",void 0),e([r()],T.prototype,"consumes",void 0),e([r()],T.prototype,"clearColor",void 0),T=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],T),function(e){e[e.ON=0]="ON",e[e.OFF=1]="OFF"}(v||(v={}));export{v as FocusState,T as RenderNodeVisualizerNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as t}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorFormat as n}from"../../../webgl/formats.js";import i from"../../../webgl/RenderNode.js";import{alphaCutoff as s}from"../../core/shaderLibrary/util/AlphaCutoff.js";import{If as a,glsl as c}from"../../core/shaderModules/interfaces.js";import{Default3D as l}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as u,ColorAttachment as p,BlendFactor as d,SizedPixelFormat as f,PixelFormat as h,DataType as m}from"../../../../webgl/enums.js";let T=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces="final-color",this.consumes={required:["final-color"]},this.clearColor=t,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach((e=>e.dispose())),this._program.clear(),this.destroyedCB()}render(e){const r=e.find((({name:e})=>"final-color"===e));if(!this._focusedFBO)return r;const o=this.renderingContext;o.bindFramebuffer(r.fbo),o.setClearColor(0,0,0,0),o.clear(u.COLOR);const t=this._ensureShader(o,!1,0);return o.useProgram(t),o.bindTexture(this._focusedFBO.getTexture(),0),t.setUniform1i("colorTex",0),t.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&t.setUniform2fv("nearFar",this.camera.nearFar),o.screen.draw(),r}getDownscaledFBO(e,r,o,t,i,s){o===v.ON&&(i=e.width,s=e.height);const a=this.renderingContext,c=e.depthStencilTexture,l=this._ensureShader(a,null!=c,r),h=this.fboCache.acquire(i,s,"fbo visualizer"),m=!e.colorTexture?.descriptor.hasMipmap;m&&e.colorTexture?.generateMipmap(),a.useProgram(l),a.bindFramebuffer(h.fbo);let T=0;const g=[p.COLOR_ATTACHMENT0],x=null!=c;if(a.bindTexture(e.colorTexture,T),l.setUniform1i("colorTex",T),c){T++,a.bindTexture(c,T),l.setUniform1i("depthTex",T);const e=p.COLOR_ATTACHMENT0+T;h.acquireColor(e,n.RGBA,"depth to color"),g.push(e)}for(let u=0;u<r;u++){T++;const r=p.COLOR_ATTACHMENT0+T,o=x?1:0;a.bindTexture(e.getColorTexture(r-o),T),l.setUniform1i("colorTex"+(T-o-1),T),h.acquireColor(r,n.RGBA),g.push(r)}a.gl.drawBuffers(g);const F=a.getViewport();a.setViewport(0,0,i,s),a.setClearColor(0,0,0,0),a.clear(u.COLOR),a.setBlendingEnabled(!0),a.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA);const C="linear-depth"===t||t.includes("shadow"),b=e.colorTexture?.descriptor.internalFormat,O=C?3:b===f.R16F||b===f.R32F||b===f.R8?1:b===f.RG8?2:b===f.RGBA16F?4:0;return l.setUniform1i("inputType",O),C&&l.setUniform2fv("nearFar",this.camera.nearFar),a.screen.draw(),a.bindFramebuffer(null),a.setViewport(F.x,F.y,F.width,F.height),o===v.ON&&(this._focusedFBO=h,this._focusedFBOType=O),m&&e.colorTexture?.clearMipmap(),h}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,o,t){if(!o)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(u.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA),n.setViewport(0,0,e,r);const s=this._ensureShader(n,!1,0);n.useProgram(s),n.bindTexture(o.getColorTexture(t),0),s.setUniform1i("colorTex",0),s.setUniform1i("inputType",0),n.screen.draw();const a=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,h.RGBA,m.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),n.bindFramebuffer(null),i?.release(),a}_ensureShader(e,r,o){const t={hasDepth:r,attachments:o},n=this._program.get(t);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",u=(e,r)=>{let o="";const t=e?2:1;for(let n=0;n<r;n++)o+=`layout(location = ${c.int(t+n)}) out vec4 fragColor${c.int(n)};\n uniform sampler2D colorTex${c.int(n)};`;return o},p=e=>{let r="";for(let o=0;o<e;o++)r+=`fragColor${c.int(o)} = texture(colorTex${c.int(o)}, uv);`;return r},d=`#version 300 es\n precision highp float;\n\n in vec2 uv;\n uniform sampler2D colorTex;\n layout(location = 0) out vec4 fragColor;\n ${a(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${u(r,o)}\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgba2float(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgba2float(depth));\n }\n\n float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }\n\n void main() {\n vec4 color;\n if(inputType == 1) {\n color = vec4(vec3(texture(colorTex, uv).r), 1.0);\n } else if(inputType == 2) {\n color = vec4(texture(colorTex, uv).rg, 0.0, 1.0);\n } else if(inputType == 3) {\n float depth = 1.0 - (-linearDepthFromTexture(colorTex, uv) / (nearFar[1] - nearFar[0]));\n color = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if(inputType == 4) {\n color = texture(colorTex, uv);\n color = vec4(color.rgb / color.a, color.a);\n } else {\n color = texture(colorTex, uv);\n }\n\n\n if(color.a < ${c.float(s)})\n discard;\n else {\n fragColor = color;\n ${a(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n ${a(o>0,p(o))}\n }\n }`;return this._program.set(t,e.programCache.acquire(i,d,l)),this._program.get(t)}};var v;e([r()],T.prototype,"destroyedCB",void 0),e([r()],T.prototype,"produces",void 0),e([r()],T.prototype,"consumes",void 0),e([r()],T.prototype,"clearColor",void 0),T=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],T),function(e){e[e.ON=0]="ON",e[e.OFF=1]="OFF"}(v||(v={}));export{v as FocusState,T as RenderNodeVisualizerNode};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/interfaces.js";import"../../core/shaderModules/ShaderBuilder.js";import"../../core/shaderModules/Texture2DPassUniform.js";export{O as OITBlendPassParameters,b as build}from"../../../../../chunks/OITBlend.glsl.js";
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as r}from"./OITBlendTechnique.js";import{ColorAttachment as t}from"../../../../webgl/enums.js";class s{constructor(t){this._techniques=t,this._parameters=new e,t.precompile(r)}blend(e,s,a,i){this._parameters.colorTexture=s.getTexture(),this._parameters.alphaTexture=s.getTexture(t.COLOR_ATTACHMENT1),this._parameters.frontFaceTexture=a.getTexture();const n=this._techniques.acquire(r);e.bindTechnique(n,i,this._parameters),e.screen.draw(),n.release()}}export{s as OITBlend};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/OITBlend.glsl.js";import{Default3D as o}from"../../lib/DefaultVertexAttributeLocations.js";import{Program as t}from"../../lib/Program.js";import{BlendFactor as l}from"../../../../webgl/enums.js";import{makePipelineState as s,separateBlendingParams as n,defaultColorWrite as a}from"../../../../webgl/renderState.js";class m extends r{initializeProgram(e){return new t(e.rctx,m.shader.get().build(),o)}initializePipeline(){return s({blending:n(l.SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),colorWrite:a})}}m.shader=new e(i,(()=>import("./OITBlend.glsl.js")));export{m as OITBlendTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{C as t}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as i}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as e,BlitMode as s}from"../shaders/CompositingTechniqueConfiguration.js";import{H as o}from"../../../../chunks/HUDCompositing.glsl.js";import{HUDCompositingTechnique as r}from"../shaders/HUDCompositingTechnique.js";import{O as h}from"../../../../chunks/OITCompositing.glsl.js";import{OITCompositingTechnique as a}from"../shaders/OITCompositingTechnique.js";import{ColorAttachment as c}from"../../../webgl/enums.js";class n{constructor(c,n){this._rctx=c,this._techniques=n,this._configuration=new e,this._passParameters=new t,this._oitParameters=new h,this._hudParameters=new o,this._configuration.blitMode=s.PremultipliedAlpha,this._techniques.precompile(i,this._configuration),this._configuration.hasOpacityFactor=!0,this._techniques.precompile(i,this._configuration),this._configuration.hasOpacityFactor=!1,this._configuration.blitMode=s.Alpha,this._techniques.precompile(i,this._configuration),this._configuration.blitMode=s.Depth,this._techniques.precompile(i,this._configuration),this._techniques.precompile(a),this._techniques.precompile(r)}compositeOIT(t,i,e){this._oitParameters.colorTexture=i.getTexture(),this._oitParameters.alphaTexture=i.getTexture(c.COLOR_ATTACHMENT1),this._oitParameters.frontFaceTexture=e.getTexture();const s=this._techniques.acquire(a);this._rctx.bindTechnique(s,t,this._oitParameters),this._rctx.screen.draw(),s.release()}compositeHUD(t,i){this._hudParameters.texture=i;const e=this._techniques.acquire(r);this._rctx.bindTechnique(e,t,this._hudParameters),this._rctx.screen.draw(),e.release()}compositePreMultipliedAlpha(t,i,e=1){this._composite(t,i,s.PremultipliedAlpha,e)}composite(t,i){this._composite(t,i,s.Alpha,1)}blitDepthToLinearDepth(t,i){this._composite(t,i,s.Depth,1)}_composite(t,e,s,o){this._configuration.blitMode=s,this._configuration.hasOpacityFactor=1!==o,this._passParameters.texture=e,this._passParameters.opacity=o;const r=this._techniques.acquire(i,this._configuration);this._rctx.bindTechnique(r,t,this._passParameters),this._rctx.screen.draw(),r.release()}}export{n as default};
5
+ import{C as i}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as t}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as s,BlitMode as e}from"../shaders/CompositingTechniqueConfiguration.js";import{H as o}from"../../../../chunks/HUDCompositing.glsl.js";import{HUDCompositingTechnique as r}from"../shaders/HUDCompositingTechnique.js";class h{constructor(h,a){this._rctx=h,this._techniques=a,this._configuration=new s,this._passParameters=new i,this._hudParameters=new o,this._configuration.blitMode=e.PremultipliedAlpha,this._techniques.precompile(t,this._configuration),this._configuration.hasOpacityFactor=!0,this._techniques.precompile(t,this._configuration),this._configuration.hasOpacityFactor=!1,this._configuration.blitMode=e.Alpha,this._techniques.precompile(t,this._configuration),this._configuration.blitMode=e.Depth,this._techniques.precompile(t,this._configuration),this._techniques.precompile(r)}compositeHUD(i,t){this._hudParameters.texture=t;const s=this._techniques.acquire(r);this._rctx.bindTechnique(s,i,this._hudParameters),this._rctx.screen.draw(),s.release()}compositePreMultipliedAlpha(i,t,s=1){this._composite(i,t,e.PremultipliedAlpha,s)}composite(i,t){this._composite(i,t,e.Alpha,1)}blitDepthToLinearDepth(i,t){this._composite(i,t,e.Depth,1)}_composite(i,s,e,o){this._configuration.blitMode=e,this._configuration.hasOpacityFactor=1!==o,this._passParameters.texture=s,this._passParameters.opacity=o;const r=this._techniques.acquire(t,this._configuration);this._rctx.bindTechnique(r,i,this._passParameters),this._rctx.screen.draw(),r.release()}}export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,abortMaybe as a,destroyMaybe as n,releaseMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as _,sync as u}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as T}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as E}from"../../../../chunks/vec42.js";import{fromValues as A,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as P,RenderCategory as S}from"../../webgl.js";import{debugFlags as I}from"../../support/debugFlags.js";import{DepthFormat as C,ColorFormat as w}from"../../webgl/formats.js";import{FBOCache as N,defaultWebGLFBO as D}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as M,isColorOrColorEmission as O}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as y}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as H}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as L}from"../effects/RenderNodes.js";import{releaseTechniques as U}from"../effects/RenderPlugin.js";import{RenderPluginManager as v}from"../effects/RenderPluginManager.js";import{Blit as F}from"../effects/blit/Blit.js";import{renderHighlightBuffer as q}from"../effects/highlight/Highlight.js";import{AnimationTimeStep as G}from"./AnimationTimeStep.js";import{Decorations as V,RenderRequestType as j}from"./basicInterfaces.js";import{BoundingInfo as B}from"./BoundingInfo.js";import{zero as Q,union as W}from"./depthRange.js";import{depthRangeFromScene as k}from"./depthRangeUtils.js";import{MainFramebuffer as z}from"./MainFramebuffer.js";import{RenderOccludedFlag as X}from"./Material.js";import{OITPass as Y}from"./OITPass.js";import{RenderContext as J,defaultRenderOccludedMask as K}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as $,RendererTarget as Z}from"./rendererUtils.js";import{setupFeatureDefaults as ee,RenderFeature as te}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{RenderSlot as ie}from"./RenderSlot.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ae,SnapshotSlot as ne}from"./ShadowMap.js";import he from"./SliceHelper.js";import{Transparency as oe}from"./edgeRendering/interfaces.js";import{MergedRenderer as de}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as le}from"../parts/renderUtils.js";import{OITCompositingTechnique as _e}from"../shaders/OITCompositingTechnique.js";import{RendererPerformanceInfo as ue,PerformanceCategory as pe}from"../statistics/RendererPerformanceInfo.js";import{RenderState as me}from"../../../support/RenderState.js";import{PixelFormat as ce,PixelType as fe,DepthStencilAttachment as ge,FramebufferBit as be,ColorAttachment as Te}from"../../../webgl/enums.js";class Ee{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new x,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new he,this._blit=null,this._state=p(me.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new G,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new re,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new N(s),this._renderStateFeatures=p(ee(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new z(this.fboCache),this.performanceInfo=new ue(this._rctx),this._shadowMap=new ae(this.fboCache,e.viewingMode),this._shadowAccumulator=new se(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(M.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new J(this._rctx,this._shadowMap),this._nodes=new L(this._renderContext),this._plugins=new v({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this._handles=[d((()=>this._stage.view.state.camera),(()=>n()),l),d((()=>I.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(oe.TRANSPARENT):()=>{},n()}),_),d((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):R;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),l),d((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=H),l)]}destroy(){this._handles.forEach((e=>e.remove())),this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=a(this._loadEdgeViewTask),this._edgeView=n(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._renderers.clear(),this._blit=null,B.prune()}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=ee(t,e),this._plugins.renderFeatureChanged(),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(te.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(te.WaterReflection))}get hasHighlights(){return this._plugins.produces(M.Highlight,ie.OPAQUE_MATERIAL,ie.TRANSPARENT_MATERIAL,ie.DRAPED_MATERIAL,ie.HUD_MATERIAL,ie.LABEL_MATERIAL)}get hasHighlightsOnHUD(){return this._plugins.produces(M.Highlight,ie.HUD_MATERIAL,ie.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(te.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(te.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(te.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=h(this._bindParameters.ssr.lastFrameColor),this._bindParameters.multipassTerrain.depth=h(this._bindParameters.multipassTerrain.depth),this._bindParameters.multipassGeometry.depth=h(this._bindParameters.multipassGeometry.depth),this._pluginInput.release("highlight mix")}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:De(this._stage.view.resourceController)});return this._handles.push(d((()=>r.updating),(()=>this._requestRender()),u)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;$(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new de({material:i}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(M.Color,ie.LINE_CALLOUTS_HUD_DEPTH,ie.HUD_MATERIAL,ie.LABEL_MATERIAL),has.water=this._plugins.produces(M.Normal,ie.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e){const t=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(e),this._hasAnimations=this._nodes.updateAnimation()||this._hasAnimations,this._hasAnimations!==t&&(this._gpuTimerHandle=t?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=Z.Default,i=V.ON){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new le(this._pluginInput.get("final-color"),null)}_render(e,t,r=Z.Default,i=V.ON){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===Z.Default,this._disposeBindBuffers();const s=this._framebuffer,{camera:a,contentCamera:n,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.overlay=this.overlay?.render(t),this._bindParameters.overlay&&this.performanceInfo.advance(pe.OVERLAY),this._renderContext.time=t,this._bindParameters.oitPass=Y.NONE,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=i,this._bindParameters.mainDepth=null,this._bindParameters.viewshedEnabled=this._nodes.produces(P.VIEWSHED);const l=this._nodes.produces("magnifier-color"),_=this._nodes.produces("final-color");this._bindParameters.slicePlane=this._sliceHelper.plane,a.setGLViewport(this._rctx);const u=this._nodes.require("emissive")>0&&this._plugins.hasEmissions,p=u?M.ColorEmission:M.Color,m=s.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,u);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(a,n),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&i===V.ON;const c=this._highQualityTransparency&&this._needsTransparentTerrain,f=this._plugins.produces(M.Color,...Ie);this._precompileNormals(),this.performanceInfo.advance(pe.PREPARE);const g=this._computeDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,g),this._ensureBindParametersCamera(a,n),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(g,a,n),this._ensureBindParametersSSR(t),this._precompileShaders(c,f,p),this._renderContext.output=p,s.bind(),this._bindParameters.mainDepth=s.depth.attachment;const b=this.plugins.produces(M.Color,...Se);b&&this._renderOpaqueGeometry(),s.update((e=>this._renderNodes(S.OPAQUE,e,b))),this.fboCache.debugCallback?.("opaque-color",s.color.fbo),this._renderPlugins(ie.OPAQUE_ENVIRONMENT,pe.OPAQUE_ENVIRONMENT),this._renderMultipassTerrainDepth(c),this._setMultipassTerrain(c),this._renderEdges(oe.OPAQUE),s.bind(),this._renderPlugins(ie.VOXEL,pe.VOXEL),this._renderHiddenTransparentEdges(),f&&(this._oitEnabled?this._renderOIT(Ae.Geometry,p):this._renderTransparentMaterial()),s.update((e=>this._renderNodes(S.TRANSPARENT,e,f))),this.fboCache.debugCallback?.("transparent-color",s.color.fbo),this._renderMultipassGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,ie.LINE_CALLOUTS);const T=r===Z.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(oe.TRANSPARENT);const E=this._needsTransparentTerrain?this._renderTransparentTerrain():null;E&&(this.performanceInfo.advance(pe.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(y.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,E.getTexture())),this._renderHUD(y.Occluded,s.color,p))),this._setTerrainCulling(!1),E&&(s.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,E.getTexture()),E.release(),c&&(this._renderEdges(oe.OPAQUE),f&&(this._oitEnabled?this._renderOIT(Ae.Geometry,p):this._renderTransparentMaterial(),this.performanceInfo.advance(pe.TRANSPARENT)),this._renderEdges(oe.TRANSPARENT))),this._bindParameters.ssao=h(this._bindParameters.ssao),c&&this._renderLineCallouts(y.NotOccluded),this._setMultipassEnabled(!1),this._renderTransparentEnvironment(),s.update((e=>this._renderNodes(P.VIEWSHED,e))),s.update((e=>this._renderNodes(P.LASERLINES,e))),s.update((e=>this._renderNodes(P.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),s.update((e=>this._renderNodes(S.COMPOSITE,e)));const A=!(r!==Z.Default||_||l&&i===V.ON&&r===Z.Default),R=this._pluginInput.get("composite-color"),I=A?D:this.fboCache.acquire(R.fbo.width,R.fbo.height,"aa-color"),C=this._nodes.produces("aa-color")?this._renderNodes(P.ANTIALIASING,I):this._blitFBO(R,I,!1);let w;this._pluginInput.set(P.ANTIALIASING,C),this.hasHighlightsOnHUD?(this._renderHUD(y.NotOccluded,C,p),w=this._renderNodes(P.HIGHLIGHTS,C)):(w=this._renderNodes(P.HIGHLIGHTS,C),this._renderHUD(y.NotOccluded,w,p));const N=this._renderNodes(P.MAGNIFIER,w);return l&&i===V.ON&&r===Z.Default&&!_&&this._blitFBO(N),_?(N.attachDepth(s.depth),this._blitFBO(this._renderNodes(S.FINAL,N)),N.detachDepth()):this._pluginInput.set(S.FINAL,N),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),s.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==Z.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new le(this._pluginInput.get("final-color"),T)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._setMultipassTerrain(e),this._renderContext.output=M.Depth,this._plugins.precompile(ie.TRANSPARENT_TERRAIN),this._renderContext.output=r,this._plugins.precompile(ie.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(r),this._needsTransparentTerrain&&(this._setTerrainCulling(!1),this._precompileTransparentGeometry(r))),this._setMultipassTerrain(!1),e||this._plugins.precompile(ie.LINE_CALLOUTS),this._needsHUDVisibility&&this._plugins.precompile(ie.OCCLUSION_PIXELS),this._plugins.precompile(ie.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,ie.TRANSPARENT_ENVIRONMENT),--this._plugins.context.techniques.precompiling}_renderObjectAndLayerIdColor(){if(this._nodes.produces("olid")){const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"olid");return t.acquireDepth(C.DEPTH_STENCIL_TEXTURE),t=this._nodes.render(t,this._pluginInput),this.performanceInfo.advance(pe.OBJECT_AND_LAYER_ID_COLOR),t}return null}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===j.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readDepthPixels(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(R),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],ce.RGBA,fe.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,ce.RGBA,fe.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassEnabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.multipassGeometry.depth;this.renderToTargets(s,i,a??this._framebuffer.depth,R),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===oe.OPAQUE?pe.OPAQUE_EDGES:pe.TRANSPARENT_EDGES)}_renderShadowMap(e,t,r){const i=this._shadowMap;i.enabled&&(i.start(e,t,r,this.isFeatureEnabled(te.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(M.ShadowHighlight,this._shadowMap),i.moveSnapshot(ne.Highlight),this._renderShadowCascades(M.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(ne.ExcludeHighlight),this._renderShadowCascades(M.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(M.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(pe.SHADOW_MAP))}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(M.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals"),t=this._needsDepth;if(e){const r=t?e.getAttachment(ge):null;r?.retain(),this._pluginInput.set("ssao",this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t,r)}else this._renderAllGeometryDepth(t)}_renderGeometryWithoutNormalsDepth(e,t){if(!e||!t)return void(this._bindParameters.depth=h(this._bindParameters.depth));const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"depth");i.attachDepth(t),t.release(),this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.STENCIL),this._renderGeometryWithoutNormals(M.Depth),h(this._bindParameters.depth),this._bindParameters.depth=i.obtainDepthTexture(),i.release(),this.performanceInfo.advance(pe.DEPTH)}_renderAllGeometryDepth(e){if(!e)return void(this._bindParameters.depth=h(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this.renderAllGeometry(M.Depth),h(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(pe.DEPTH)}_renderMultipassTerrainDepth(e){if(!e)return void(this._bindParameters.multipassTerrain.depth=h(this._bindParameters.multipassTerrain.depth));const t=this._renderContext.output;this._renderContext.output=M.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderTransparentTerrain(),h(this._bindParameters.multipassTerrain.depth),this._bindParameters.multipassTerrain.depth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderMultipassGeometryDepth(e){if(!e)return void(this._bindParameters.multipassGeometry.depth=h(this._bindParameters.multipassGeometry.depth));const t=this._renderContext.output,r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"geometry depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderOpaqueGeometryAndTransparentMaterial(M.Depth),this._renderContext.output=t,h(this._bindParameters.multipassGeometry.depth),this._bindParameters.multipassGeometry.depth=i.obtainDepthTexture(),i.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return Q;const t=k(e,this._plugins.plugins,this._stage.layers);return W(t,this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals","final-color","composite-color","opaque-color","transparent-color","laserline-color");return(this.hasSSAO?1:0)+e}_precompileNormals(){this._normalsRequired&&(this._renderContext.output=M.Normal,this._plugins.precompile(...Re,ie.TRANSPARENT_TERRAIN))}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",w.RGBA);r.acquireDepth(C.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(R,!0,!0),this._renderGeometryWithNormals(M.Normal);const i=this._nodes.optional("normals","final-color","composite-color","opaque-color","transparent-color","viewshed-color");return r.retain(e+i-1),this.performanceInfo.advance(pe.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();D.setName("ssao");const t=this._nodes.render(D,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(pe.SSAO),t}renderAllGeometry(e){this._renderContext.output=e,this._plugins.precompile(ie.TRANSPARENT_TERRAIN),this._renderOpaqueGeometryAndTransparentMaterial(e),this._renderTransparentTerrain()}renderSlot(e,t){this._bindParameters.slot=e,t.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&(e.render(this._renderContext,t,this._pluginInput),U(t))}))}renderOccludedMask(e,t){this._renderContext.renderOccludedMask=t;this.plugins.renderOccludedFlags>X.Occlude&&this._plugins.render(this._pluginInput,ie.OCCLUDED_TERRAIN),this.renderSlot(ie.OPAQUE_MATERIAL,e),this.renderSlot(ie.TRANSPARENT_MATERIAL,e),this.renderSlot(ie.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e),this._renderContext.renderOccludedMask=K}renderAllHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,ie.HUD_MATERIAL)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(M.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueGeometryAndTransparentMaterial(e){this._renderContext.output=e,this._plugins.precompile(...Ie),this._renderOpaqueGeometry(),this._renderTransparentMaterial()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Re),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Pe)}_precompileOpaqueGeometry(){this._plugins.precompile(...Se,ie.OPAQUE_ENVIRONMENT)}_renderOpaqueGeometry(){this._precompileOpaqueGeometry(),this._plugins.render(this._pluginInput,...Se)}_renderTransparentMaterial(){this._plugins.render(this._pluginInput,...Ie)}get _needsTransparentTerrain(){return this._plugins.produces(M.Color,ie.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,ie.TRANSPARENT_TERRAIN);if(!O(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,R),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,ie.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(this._needsHUDVisibility){const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",w.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.multipassGeometry.depth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,ie.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(pe.HUD_VISIBILITY)}else this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===y.Occluded){const e=()=>this._plugins.render(this._pluginInput,ie.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,ie.LINE_CALLOUTS)}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ae.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(e===y.Occluded){this._renderContext.output=M.Color;const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else this._renderContext.output=M.Color,t.acquireDepth(C.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===y.Occluded?pe.HUD_OCCLUDED:pe.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.precompile(ie.LINE_CALLOUTS_HUD_DEPTH,ie.HUD_MATERIAL,ie.LABEL_MATERIAL),this._plugins.render(this._pluginInput,ie.LINE_CALLOUTS_HUD_DEPTH,ie.HUD_MATERIAL,ie.LABEL_MATERIAL)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(M.ShadowHighlight,ie.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this.hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize;let s=this._pluginInput.get("highlight mix");null==s&&(s=e.acquire(i.width,i.height,"highlight mix",w.RGBA),this._pluginInput.set("highlight mix",s),r.highlightMixTexture=s.getTexture()),t.bindFramebuffer(s.fbo),t.clearFramebuffer(R);const a=s.getTexture(),n=e.acquire(i.width,i.height,"highlights",w.RGBA);n.acquireDepth(C.DEPTH16_BUFFER),t.bindFramebuffer(n.fbo),t.clearFramebuffer(R,!0),this._renderContext.output=M.Highlight;const h=()=>{const e=[ie.TRANSPARENT_MATERIAL,ie.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,ie.OPAQUE_MATERIAL,ie.OPAQUE_MATERIAL_WITHOUT_NORMALS];0===this._bindParameters.highlightLevel&&e.push(ie.TRANSPARENT_TERRAIN,ie.INTEGRATED_MESH,ie.OPAQUE_TERRAIN),this._plugins.precompile(...e),this._plugins.render(this._pluginInput,...e),t.clear(be.DEPTH),this._renderHUDElements(y.Both)};return q(t,i,a,this._stage.view.highlights,r,h),n}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,t,r){this._needsShadowCast&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(pe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(e){++this._plugins.context.techniques.precompiling,this._oitEnabled?(this._renderContext.output=e,this._bindParameters.oitPass=Y.ColorAlpha,this._plugins.precompile(...Ie),this._bindParameters.oitPass=Y.FrontFace,this._plugins.precompile(...Ie),this._bindParameters.oitPass=Y.NONE,this._techniques.precompile(_e)):(this._renderContext.output=e,this._plugins.precompile(...Ie)),--this._plugins.context.techniques.precompiling}_renderOIT(e,t,r=y.Both){const i=e===Ae.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentMaterial(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=Y.ColorAlpha;const d=a?"oit hud color alpha":"oit color alpha",l=this.fboCache.acquire(s.width,s.height,d,w.RGBA16F);l.acquireColor(Te.COLOR_ATTACHMENT1,w.R16F),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),n(),l.detachDepth(),h.oitPass=Y.FrontFace;const _=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return a?_.acquireDepth(C.DEPTH16_BUFFER):_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer(R,!!a),n(),_.detachDepth(),h.oitPass=Y.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(be.COLOR)):this._framebuffer.bind(),this._compositingHelper.compositeOIT(h,l,_),a?.detachDepth(),_.release(),l.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this._framebuffer.bind(),this._plugins.render(this._pluginInput,ie.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,ie.TRANSPARENT_ENVIRONMENT),this.performanceInfo.advance(pe.TRANSPARENT_ENVIRONMENT)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=D,r=!0){return this._blit??=new F(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(we,this._bindParameters.camera.viewMatrix),f(Ce,this._bindParameters.camera.projectionMatrix),g(Ne,we,Ce),g(Ne,this._renderContext.lastFrameCamera.viewMatrix,Ne),g(Ne,this._renderContext.lastFrameCamera.projectionMatrix,Ne),this._reprojectionMatrix=Ne);const t=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}}var Ae;e([m({readOnly:!0})],Ee.prototype,"fullResolutionAtmosphere",null),e([m()],Ee.prototype,"_edgeView",void 0),e([m()],Ee.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ae||(Ae={}));const Re=[ie.INTEGRATED_MESH,ie.OPAQUE_TERRAIN,ie.OPAQUE_MATERIAL,ie.TRANSPARENT_MATERIAL],Pe=[ie.OPAQUE_MATERIAL_WITHOUT_NORMALS,ie.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Se=[ie.INTEGRATED_MESH,ie.OPAQUE_TERRAIN,ie.OPAQUE_MATERIAL,ie.OPAQUE_MATERIAL_WITHOUT_NORMALS],Ie=[ie.TRANSPARENT_MATERIAL,ie.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Ce=T(),we=T(),Ne=T();function De(e){return t=>e.immediate.schedule(t)}export{Ee as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,abortMaybe as a,destroyMaybe as n,releaseMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as _,sync as u}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as T}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as E}from"../../../../chunks/vec42.js";import{fromValues as A,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as P,RenderCategory as S}from"../../webgl.js";import{debugFlags as I}from"../../support/debugFlags.js";import{DepthFormat as C,ColorFormat as w}from"../../webgl/formats.js";import{FBOCache as N,defaultWebGLFBO as D}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as M,isColorOrColorEmission as O}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as y}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as H}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as L}from"../effects/RenderNodes.js";import{releaseTechniques as U}from"../effects/RenderPlugin.js";import{RenderPluginManager as v}from"../effects/RenderPluginManager.js";import{Blit as F}from"../effects/blit/Blit.js";import{renderHighlightBuffer as q}from"../effects/highlight/Highlight.js";import{OITBlend as G}from"../effects/transparency/OITBlend.js";import{AnimationTimeStep as V}from"./AnimationTimeStep.js";import{Decorations as j,RenderRequestType as B}from"./basicInterfaces.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{zero as W,union as k}from"./depthRange.js";import{depthRangeFromScene as z}from"./depthRangeUtils.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{RenderOccludedFlag as Y}from"./Material.js";import{OITPass as J}from"./OITPass.js";import{RenderContext as K,defaultRenderOccludedMask as $}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as Z,RendererTarget as ee}from"./rendererUtils.js";import{setupFeatureDefaults as te,RenderFeature as re}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{RenderSlot as se}from"./RenderSlot.js";import{ShadowAccumulator as ae}from"./ShadowAccumulator.js";import{ShadowMap as ne,SnapshotSlot as he}from"./ShadowMap.js";import oe from"./SliceHelper.js";import{Transparency as de}from"./edgeRendering/interfaces.js";import{MergedRenderer as le}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as _e}from"../parts/renderUtils.js";import{RendererPerformanceInfo as ue,PerformanceCategory as pe}from"../statistics/RendererPerformanceInfo.js";import{RenderState as me}from"../../../support/RenderState.js";import{PixelFormat as ce,PixelType as fe,DepthStencilAttachment as ge,FramebufferBit as be,ColorAttachment as Te}from"../../../webgl/enums.js";class Ee{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new x,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new oe,this._blit=null,this._oitblend=null,this._state=p(me.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new V,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new N(s),this._renderStateFeatures=p(te(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new X(this.fboCache),this.performanceInfo=new ue(this._rctx),this._shadowMap=new ne(this.fboCache,e.viewingMode),this._shadowAccumulator=new ae(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(M.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new K(this._rctx,this._shadowMap),this._nodes=new L(this._renderContext),this._plugins=new v({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this._handles=[d((()=>this._stage.view.state.camera),(()=>n()),l),d((()=>I.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(de.TRANSPARENT):()=>{},n()}),_),d((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):R;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),l),d((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=H),l)]}destroy(){this._handles.forEach((e=>e.remove())),this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=a(this._loadEdgeViewTask),this._edgeView=n(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._renderers.clear(),this._blit=null,this._oitblend=null,Q.prune()}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=te(t,e),this._plugins.renderFeatureChanged(),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(re.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(re.WaterReflection))}get hasHighlights(){return this._plugins.produces(M.Highlight,se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL,se.DRAPED_MATERIAL,se.HUD_MATERIAL,se.LABEL_MATERIAL)}get hasHighlightsOnHUD(){return this._plugins.produces(M.Highlight,se.HUD_MATERIAL,se.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(re.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(re.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(re.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=h(this._bindParameters.ssr.lastFrameColor),this._bindParameters.multipassTerrain.depth=h(this._bindParameters.multipassTerrain.depth),this._bindParameters.multipassGeometry.depth=h(this._bindParameters.multipassGeometry.depth),this._pluginInput.release("highlight mix")}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:De(this._stage.view.resourceController)});return this._handles.push(d((()=>r.updating),(()=>this._requestRender()),u)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;Z(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new le({material:i}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(M.Color,se.LINE_CALLOUTS_HUD_DEPTH,se.HUD_MATERIAL,se.LABEL_MATERIAL),has.water=this._plugins.produces(M.Normal,se.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e){const t=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(e),this._hasAnimations=this._nodes.updateAnimation()||this._hasAnimations,this._hasAnimations!==t&&(this._gpuTimerHandle=t?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=ee.Default,i=j.ON){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new _e(this._pluginInput.get("final-color"),null)}_render(e,t,r=ee.Default,i=j.ON){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===ee.Default,this._disposeBindBuffers();const s=this._framebuffer,{camera:a,contentCamera:n,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.overlay=this.overlay?.render(t),this._bindParameters.overlay&&this.performanceInfo.advance(pe.OVERLAY),this._renderContext.time=t,this._bindParameters.oitPass=J.NONE,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=i,this._bindParameters.mainDepth=null,this._bindParameters.viewshedEnabled=this._nodes.produces(P.VIEWSHED);const l=this._nodes.produces("magnifier-color"),_=this._nodes.produces("final-color");this._bindParameters.slicePlane=this._sliceHelper.plane,a.setGLViewport(this._rctx);const u=this._nodes.require("emissive")>0&&this._plugins.hasEmissions,p=u?M.ColorEmission:M.Color,m=s.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,u);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(a,n),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&i===j.ON;const c=this._highQualityTransparency&&this._needsTransparentTerrain,f=this._plugins.produces(M.Color,...Ie);this._precompileNormals(),this.performanceInfo.advance(pe.PREPARE);const g=this._computeDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,g),this._ensureBindParametersCamera(a,n),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(g,a,n),this._ensureBindParametersSSR(t),this._precompileShaders(c,f,p),this._renderContext.output=p,s.bind(),this._bindParameters.mainDepth=s.depth.attachment;const b=this.plugins.produces(M.Color,...Se);b&&this._renderOpaqueGeometry(),s.update((e=>this._renderNodes(S.OPAQUE,e,b))),this.fboCache.debugCallback?.("opaque-color",s.color.fbo),this._renderPlugins(se.OPAQUE_ENVIRONMENT,pe.OPAQUE_ENVIRONMENT),this._renderMultipassTerrainDepth(c),this._setMultipassTerrain(c),this._renderEdges(de.OPAQUE),s.bind(),this._renderPlugins(se.VOXEL,pe.VOXEL),this._renderHiddenTransparentEdges(),f&&(this._oitEnabled?this._renderOIT(Ae.Geometry,p):this._renderTransparentMaterial()),s.update((e=>this._renderNodes(S.TRANSPARENT,e,f))),this.fboCache.debugCallback?.("transparent-color",s.color.fbo),this._renderMultipassGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,se.LINE_CALLOUTS);const T=r===ee.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;this._renderEdges(de.TRANSPARENT);const E=this._needsTransparentTerrain?this._renderTransparentTerrain():null;E&&(this.performanceInfo.advance(pe.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(y.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,E.getTexture())),this._renderHUD(y.Occluded,s.color,p))),this._setTerrainCulling(!1),E&&(s.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,E.getTexture()),E.release(),c&&(this._renderEdges(de.OPAQUE),f&&(this._oitEnabled?this._renderOIT(Ae.Geometry,p):this._renderTransparentMaterial(),this.performanceInfo.advance(pe.TRANSPARENT)),this._renderEdges(de.TRANSPARENT))),this._bindParameters.ssao=h(this._bindParameters.ssao),c&&this._renderLineCallouts(y.NotOccluded),this._setMultipassEnabled(!1),this._renderTransparentEnvironment(),s.update((e=>this._renderNodes(P.VIEWSHED,e))),s.update((e=>this._renderNodes(P.LASERLINES,e))),s.update((e=>this._renderNodes(P.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),s.update((e=>this._renderNodes(S.COMPOSITE,e)));const A=!(r!==ee.Default||_||l&&i===j.ON&&r===ee.Default),R=this._pluginInput.get("composite-color"),I=A?D:this.fboCache.acquire(R.fbo.width,R.fbo.height,"aa-color"),C=this._nodes.produces("aa-color")?this._renderNodes(P.ANTIALIASING,I):this._blitFBO(R,I,!1);let w;this._pluginInput.set(P.ANTIALIASING,C),this.hasHighlightsOnHUD?(this._renderHUD(y.NotOccluded,C,p),w=this._renderNodes(P.HIGHLIGHTS,C)):(w=this._renderNodes(P.HIGHLIGHTS,C),this._renderHUD(y.NotOccluded,w,p));const N=this._renderNodes(P.MAGNIFIER,w);return l&&i===j.ON&&r===ee.Default&&!_&&this._blitFBO(N),_?(N.attachDepth(s.depth),this._blitFBO(this._renderNodes(S.FINAL,N)),N.detachDepth()):this._pluginInput.set(S.FINAL,N),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),s.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==ee.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new _e(this._pluginInput.get("final-color"),T)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._setMultipassTerrain(e),this._renderContext.output=M.Depth,this._plugins.precompile(se.TRANSPARENT_TERRAIN),this._renderContext.output=r,this._plugins.precompile(se.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(r),this._needsTransparentTerrain&&(this._setTerrainCulling(!1),this._precompileTransparentGeometry(r))),this._setMultipassTerrain(!1),e||this._plugins.precompile(se.LINE_CALLOUTS),this._needsHUDVisibility&&this._plugins.precompile(se.OCCLUSION_PIXELS),this._plugins.precompile(se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,se.TRANSPARENT_ENVIRONMENT),--this._plugins.context.techniques.precompiling}_renderObjectAndLayerIdColor(){if(this._nodes.produces("olid")){const e=this._framebufferSize;let t=this.fboCache.acquire(e.width,e.height,"olid");return t.acquireDepth(C.DEPTH_STENCIL_TEXTURE),t=this._nodes.render(t,this._pluginInput),this.performanceInfo.advance(pe.OBJECT_AND_LAYER_ID_COLOR),t}return null}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===B.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readDepthPixels(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(R),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],ce.RGBA,fe.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,ce.RGBA,fe.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassEnabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.multipassGeometry.depth;this.renderToTargets(s,i,a??this._framebuffer.depth,R),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===de.OPAQUE?pe.OPAQUE_EDGES:pe.TRANSPARENT_EDGES)}_renderShadowMap(e,t,r){const i=this._shadowMap;i.enabled&&(i.start(e,t,r,this.isFeatureEnabled(re.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(M.ShadowHighlight,this._shadowMap),i.moveSnapshot(he.Highlight),this._renderShadowCascades(M.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(he.ExcludeHighlight),this._renderShadowCascades(M.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(M.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(pe.SHADOW_MAP))}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(M.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals"),t=this._needsDepth;if(e){const r=t?e.getAttachment(ge):null;r?.retain(),this._pluginInput.set("ssao",this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t,r)}else this._renderAllGeometryDepth(t)}_renderGeometryWithoutNormalsDepth(e,t){if(!e||!t)return void(this._bindParameters.depth=h(this._bindParameters.depth));const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"depth");i.attachDepth(t),t.release(),this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.STENCIL),this._renderGeometryWithoutNormals(M.Depth),h(this._bindParameters.depth),this._bindParameters.depth=i.obtainDepthTexture(),i.release(),this.performanceInfo.advance(pe.DEPTH)}_renderAllGeometryDepth(e){if(!e)return void(this._bindParameters.depth=h(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this.renderAllGeometry(M.Depth),h(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(pe.DEPTH)}_renderMultipassTerrainDepth(e){if(!e)return void(this._bindParameters.multipassTerrain.depth=h(this._bindParameters.multipassTerrain.depth));const t=this._renderContext.output;this._renderContext.output=M.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderTransparentTerrain(),h(this._bindParameters.multipassTerrain.depth),this._bindParameters.multipassTerrain.depth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderMultipassGeometryDepth(e){if(!e)return void(this._bindParameters.multipassGeometry.depth=h(this._bindParameters.multipassGeometry.depth));const t=this._renderContext.output,r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"geometry depth").acquireDepth(C.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(be.DEPTH|be.STENCIL),this._renderOpaqueGeometryAndTransparentMaterial(M.Depth),this._renderContext.output=t,h(this._bindParameters.multipassGeometry.depth),this._bindParameters.multipassGeometry.depth=i.obtainDepthTexture(),i.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return W;const t=z(e,this._plugins.plugins,this._stage.layers);return k(t,this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals","final-color","composite-color","opaque-color","transparent-color","laserline-color");return(this.hasSSAO?1:0)+e}_precompileNormals(){this._normalsRequired&&(this._renderContext.output=M.Normal,this._plugins.precompile(...Re,se.TRANSPARENT_TERRAIN))}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",w.RGBA);r.acquireDepth(C.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(R,!0,!0),this._renderGeometryWithNormals(M.Normal);const i=this._nodes.optional("normals","final-color","composite-color","opaque-color","transparent-color","viewshed-color");return r.retain(e+i-1),this.performanceInfo.advance(pe.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();D.setName("ssao");const t=this._nodes.render(D,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(pe.SSAO),t}renderAllGeometry(e){this._renderContext.output=e,this._plugins.precompile(se.TRANSPARENT_TERRAIN),this._renderOpaqueGeometryAndTransparentMaterial(e),this._renderTransparentTerrain()}renderSlot(e,t){this._bindParameters.slot=e,t.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&(e.render(this._renderContext,t,this._pluginInput),U(t))}))}renderOccludedMask(e,t){this._renderContext.renderOccludedMask=t;this.plugins.renderOccludedFlags>Y.Occlude&&this._plugins.render(this._pluginInput,se.OCCLUDED_TERRAIN),this.renderSlot(se.OPAQUE_MATERIAL,e),this.renderSlot(se.TRANSPARENT_MATERIAL,e),this.renderSlot(se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e),this._renderContext.renderOccludedMask=$}renderAllHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,se.HUD_MATERIAL)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(M.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueGeometryAndTransparentMaterial(e){this._renderContext.output=e,this._plugins.precompile(...Ie),this._renderOpaqueGeometry(),this._renderTransparentMaterial()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Re),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Pe)}_precompileOpaqueGeometry(){this._plugins.precompile(...Se,se.OPAQUE_ENVIRONMENT)}_renderOpaqueGeometry(){this._precompileOpaqueGeometry(),this._plugins.render(this._pluginInput,...Se)}_renderTransparentMaterial(){this._plugins.render(this._pluginInput,...Ie)}get _needsTransparentTerrain(){return this._plugins.produces(M.Color,se.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,se.TRANSPARENT_TERRAIN);if(!O(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,R),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,se.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(this._needsHUDVisibility){const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",w.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.multipassGeometry.depth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,se.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(pe.HUD_VISIBILITY)}else this._bindParameters.hudVisibility=h(this._bindParameters.hudVisibility)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===y.Occluded){const e=()=>this._plugins.render(this._pluginInput,se.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,se.LINE_CALLOUTS)}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ae.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(e===y.Occluded){this._renderContext.output=M.Color;const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(C.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else this._renderContext.output=M.Color,t.acquireDepth(C.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===y.Occluded?pe.HUD_OCCLUDED:pe.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.precompile(se.LINE_CALLOUTS_HUD_DEPTH,se.HUD_MATERIAL,se.LABEL_MATERIAL),this._plugins.render(this._pluginInput,se.LINE_CALLOUTS_HUD_DEPTH,se.HUD_MATERIAL,se.LABEL_MATERIAL)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(M.ShadowHighlight,se.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this.hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize;let s=this._pluginInput.get("highlight mix");null==s&&(s=e.acquire(i.width,i.height,"highlight mix",w.RGBA),this._pluginInput.set("highlight mix",s),r.highlightMixTexture=s.getTexture()),t.bindFramebuffer(s.fbo),t.clearFramebuffer(R);const a=s.getTexture(),n=e.acquire(i.width,i.height,"highlights",w.RGBA);n.acquireDepth(C.DEPTH_STENCIL_TEXTURE),t.bindFramebuffer(n.fbo),t.clearFramebuffer(R,!0),this._renderContext.output=M.Highlight;const h=()=>{const e=[se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,se.OPAQUE_MATERIAL,se.OPAQUE_MATERIAL_WITHOUT_NORMALS];0===this._bindParameters.highlightLevel&&e.push(se.TRANSPARENT_TERRAIN,se.INTEGRATED_MESH,se.OPAQUE_TERRAIN),this._plugins.precompile(...e),this._plugins.render(this._pluginInput,...e),t.clear(be.DEPTH),this._renderHUDElements(y.Both)};return q(t,i,a,this._stage.view.highlights,r,h),n}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,t,r){this._needsShadowCast&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(pe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(e){++this._plugins.context.techniques.precompiling,this._oitEnabled?(this._renderContext.output=e,this._bindParameters.oitPass=J.ColorAlpha,this._plugins.precompile(...Ie),this._bindParameters.oitPass=J.FrontFace,this._plugins.precompile(...Ie),this._bindParameters.oitPass=J.NONE):(this._renderContext.output=e,this._plugins.precompile(...Ie)),--this._plugins.context.techniques.precompiling}_renderOIT(e,t,r=y.Both){const i=e===Ae.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentMaterial(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=J.ColorAlpha;const d=a?"oit hud color alpha":"oit color alpha",l=this.fboCache.acquire(s.width,s.height,d,w.RGBA16F);l.acquireColor(Te.COLOR_ATTACHMENT1,w.R16F),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),n(),l.detachDepth(),h.oitPass=J.FrontFace;const _=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return a?_.acquireDepth(C.DEPTH16_BUFFER):_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer(R,!!a),n(),_.detachDepth(),h.oitPass=J.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(be.COLOR)):this._framebuffer.bind(),this._oitblend??=new G(this._techniques),this._oitblend.blend(this._rctx,l,_,h),a?.detachDepth(),_.release(),l.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this._framebuffer.bind(),this._plugins.render(this._pluginInput,se.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,se.TRANSPARENT_ENVIRONMENT),this.performanceInfo.advance(pe.TRANSPARENT_ENVIRONMENT)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=D,r=!0){return this._blit??=new F(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(we,this._bindParameters.camera.viewMatrix),f(Ce,this._bindParameters.camera.projectionMatrix),g(Ne,we,Ce),g(Ne,this._renderContext.lastFrameCamera.viewMatrix,Ne),g(Ne,this._renderContext.lastFrameCamera.projectionMatrix,Ne),this._reprojectionMatrix=Ne);const t=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}}var Ae;e([m({readOnly:!0})],Ee.prototype,"fullResolutionAtmosphere",null),e([m()],Ee.prototype,"_edgeView",void 0),e([m()],Ee.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ae||(Ae={}));const Re=[se.INTEGRATED_MESH,se.OPAQUE_TERRAIN,se.OPAQUE_MATERIAL,se.TRANSPARENT_MATERIAL],Pe=[se.OPAQUE_MATERIAL_WITHOUT_NORMALS,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Se=[se.INTEGRATED_MESH,se.OPAQUE_TERRAIN,se.OPAQUE_MATERIAL,se.OPAQUE_MATERIAL_WITHOUT_NORMALS],Ie=[se.TRANSPARENT_MATERIAL,se.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Ce=T(),we=T(),Ne=T();function De(e){return t=>e.immediate.schedule(t)}export{Ee as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import r from"../WebLinkChart.js";import{watch as o}from"../core/reactiveUtils.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{layoutTypes as a,layoutMap as i}from"../linkChart/enums.js";import p from"./View2D.js";let l=class extends p{constructor(t){super(t),this.map=null}initialize(){this.addHandles(o((()=>this.layoutType),(async t=>{if(i.has(t)){const r=i.get(t);await(this.map.activeLinkChartLayer?.applyNewLinkChartLayout(r))}})))}get layoutType(){return this.map.linkChartProperties.layoutType}set layoutType(t){this._override("layoutType",t)}};t([e({type:r})],l.prototype,"map",void 0),t([e({type:a,nonNullable:!0})],l.prototype,"layoutType",null),l=t([s("esri.views.LinkChartView")],l);const m=l;export{m as default};
5
+ import{_ as r}from"../chunks/tslib.es6.js";import o from"../WebLinkChart.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as e}from"../core/accessorSupport/decorators/subclass.js";import s from"./View2D.js";let p=class extends s{constructor(r){super(r),this.map=null,this.view2dType="linkchart"}get inGeographicLayout(){return"geographic-organic-standard"===this.map?.linkChartProperties.layoutType}};r([t()],p.prototype,"inGeographicLayout",null),r([t({type:o})],p.prototype,"map",void 0),r([t({readOnly:!0})],p.prototype,"view2dType",void 0),p=r([e("esri.views.LinkChartView")],p);const i=p;export{i as default};
package/views/MapView.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../chunks/tslib.es6.js";import"../core/Logger.js";import"../core/has.js";import"../core/RandomLCG.js";import"../core/Error.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import o from"./View2D.js";let e=class extends o{constructor(r){super(r)}};e=r([s("esri.views.MapView")],e);const t=e;export{t as default};
5
+ import{_ as o}from"../chunks/tslib.es6.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import e from"./View2D.js";let t=class extends e{constructor(o){super(o),this.view2dType="map"}};o([r({readOnly:!0})],t.prototype,"view2dType",void 0),t=o([s("esri.views.MapView")],t);const p=t;export{p as default};
package/views/View.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../core/Accessor.js";import{createTask as r}from"../core/asyncUtils.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import s from"../core/Error.js";import n from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import"../core/has.js";import h from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as c}from"../core/maybe.js";import{EsriPromiseMixin as u}from"../core/Promise.js";import{after as m}from"../core/promiseUtils.js";import{watch as g,whenOnce as f,when as w,sync as v,syncAndInitial as M}from"../core/reactiveUtils.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as _}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import j from"../geometry/Extent.js";import F from"../geometry/HeightModelInfo.js";import L from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as b}from"../support/AnalysesCollection.js";import{GraphicsCollection as O}from"../support/GraphicsCollection.js";import T from"../time/TimeExtent.js";import{system as C,isTimeZoneValid as k}from"../time/timeZoneUtils.js";import{BasemapView as x}from"./BasemapView.js";import Z from"./LayerViewManager.js";import I from"./Magnifier.js";import D from"./SelectionManager.js";import H from"./Theme.js";import{ToolViewManager as q}from"./ToolViewManager.js";import P from"./input/Input.js";import{ViewEvents as U}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";var W;let G=W=class extends(n.EventedMixin(u(i))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:B}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new O,this.analyses=new b,this.typeSpecificPreconditionsReady=!0,this.layerViews=new a,this.magnifier=new I,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new P,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.persistableViewModels=new a,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(g((()=>this.preconditionsReady),(e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,W.views.add(this)):(this._lockedSpatialReference=null,W.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask((()=>{this.fatalError=new s("startup-error",null,i)}))}null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach()}}),v))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then((()=>(this._isValid=!0,f((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new Z({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new q({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new D({view:this}),this.addHandles([g((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),M),g((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),v),g((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),M)])}_setupSpatialReferenceLogger(){let e=null;this.addHandles([g((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(null!=e)return;const t=p((()=>e=c(e)));e=r((async t=>{try{await m(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.addHandles(t,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")}),{sync:!0})])}destroy(){this.destroyed||(W.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??C}set timeZone(e){this._userTimeZone=e,k(e)||d.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new H}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}importLayerView(e){throw new s("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(w((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};G.views=new a,e([V()],G.prototype,"_userSpatialReference",void 0),e([V()],G.prototype,"activeTool",null),e([V({readOnly:!0})],G.prototype,"allLayerViews",void 0),e([V()],G.prototype,"groundView",void 0),e([V()],G.prototype,"animation",null),e([V()],G.prototype,"basemapView",void 0),e([V()],G.prototype,"center",null),e([V()],G.prototype,"defaultsFromMapSettings",null),e([V()],G.prototype,"defaultsFromMap",null),e([V()],G.prototype,"fatalError",void 0),e([V({type:j})],G.prototype,"extent",null),e([V(_(O,"graphics"))],G.prototype,"graphics",void 0),e([V(_(b,"analyses"))],G.prototype,"analyses",void 0),e([V({readOnly:!0,type:F})],G.prototype,"heightModelInfo",null),e([V({readOnly:!0})],G.prototype,"interacting",null),e([V({readOnly:!0})],G.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],G.prototype,"preconditionsReady",null),e([V({readOnly:!0})],G.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:a,readOnly:!0})],G.prototype,"layerViews",void 0),e([V()],G.prototype,"resolution",null),e([V({type:I})],G.prototype,"magnifier",void 0),e([V({value:null,type:t})],G.prototype,"map",null),e([V()],G.prototype,"padding",void 0),e([V({readOnly:!0})],G.prototype,"ready",void 0),e([V({type:L})],G.prototype,"spatialReference",null),e([V()],G.prototype,"spatialReferenceWarningDelay",void 0),e([V()],G.prototype,"stationary",null),e([V({readOnly:!0})],G.prototype,"supportsGround",void 0),e([V({type:T})],G.prototype,"timeExtent",void 0),e([V({type:String,nonNullable:!0})],G.prototype,"timeZone",null),e([V()],G.prototype,"tools",null),e([V()],G.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],G.prototype,"type",void 0),e([V({type:Number})],G.prototype,"scale",void 0),e([V({readOnly:!0})],G.prototype,"updating",void 0),e([V({readOnly:!0})],G.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],G.prototype,"initialExtent",null),e([V()],G.prototype,"cursor",null),e([V({readOnly:!0})],G.prototype,"input",void 0),e([V({type:A,nonNullable:!0})],G.prototype,"navigation",void 0),e([V()],G.prototype,"layerViewManager",void 0),e([V()],G.prototype,"analysisViewManager",void 0),e([V()],G.prototype,"selectionManager",void 0),e([V()],G.prototype,"width",void 0),e([V()],G.prototype,"height",void 0),e([V({readOnly:!0})],G.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],G.prototype,"size",null),e([V({readOnly:!0})],G.prototype,"suspended",void 0),e([V({readOnly:!0})],G.prototype,"viewEvents",void 0),e([V({readOnly:!0})],G.prototype,"persistableViewModels",void 0),e([V()],G.prototype,"_isValid",void 0),e([V()],G.prototype,"_readyCycleForced",void 0),e([V()],G.prototype,"_lockedSpatialReference",void 0),e([V()],G.prototype,"_userTimeZone",void 0),e([V()],G.prototype,"_lockedTimeZone",void 0),e([V({type:H})],G.prototype,"theme",void 0),e([V({readOnly:!0,type:H})],G.prototype,"effectiveTheme",null),G=W=e([R("esri.views.View")],G);const N=G;function B(e){return e.layerViews}export{N as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../core/Accessor.js";import{createTask as r}from"../core/asyncUtils.js";import o from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import a from"../core/Error.js";import n from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import"../core/has.js";import h from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as u,abortMaybe as y}from"../core/maybe.js";import{EsriPromiseMixin as c}from"../core/Promise.js";import{after as m}from"../core/promiseUtils.js";import{watch as g,whenOnce as f,when as w,sync as v,syncAndInitial as M}from"../core/reactiveUtils.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as R}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import j from"../geometry/Extent.js";import E from"../geometry/HeightModelInfo.js";import F from"../geometry/SpatialReference.js";import{equals as T}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as x}from"../support/AnalysesCollection.js";import{GraphicsCollection as L}from"../support/GraphicsCollection.js";import k from"../time/TimeExtent.js";import{system as b,isTimeZoneValid as O}from"../time/timeZoneUtils.js";import{BasemapView as C}from"./BasemapView.js";import Z from"./LayerViewManager.js";import I from"./Magnifier.js";import D from"./SelectionManager.js";import H from"./Theme.js";import{ToolViewManager as q}from"./ToolViewManager.js";import P from"./input/Input.js";import{ViewEvents as U}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";var W;let G=W=class extends(n.EventedMixin(c(i))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:B}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new L,this.analyses=new x,this.typeSpecificPreconditionsReady=!0,this.layerViews=new o,this.magnifier=new I,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new P,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.persistableViewModels=new o,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g((()=>this.preconditionsReady),(e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,W.views.add(this)):(this._lockedSpatialReference=null,W.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask((()=>{this.fatalError=new a("startup-error",null,i)}))}null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach()}}),v))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then((()=>(this._isValid=!0,f((()=>this.ready)))))),this.basemapView=new C({view:this}),this.layerViewManager=new Z({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new q({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new D({view:this}),this.addHandles([g((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),M),g((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),v),g((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),M)])}_setupSpatialReferenceLogger(){let e=null;this.addHandles([g((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(null!=e)return;const t=p((()=>e=y(e)));e=r((async t=>{try{await m(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.addHandles(t,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")}),{sync:!0})])}destroy(){this.destroyed||(W.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=u(this.graphics),this.analyses=u(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),u(this.analysisViewManager),this.toolViewManager=u(this.toolViewManager),this.layerViewManager=u(this.layerViewManager),this.selectionManager=u(this.selectionManager),this.basemapView=u(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=u(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!T(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??b}set timeZone(e){this._userTimeZone=e,O(e)||d.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new H}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(e){throw new a("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(w((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};G.views=new o,e([V()],G.prototype,"_userSpatialReference",void 0),e([V()],G.prototype,"activeTool",null),e([V({readOnly:!0})],G.prototype,"allLayerViews",void 0),e([V()],G.prototype,"groundView",void 0),e([V()],G.prototype,"animation",null),e([V()],G.prototype,"basemapView",void 0),e([V()],G.prototype,"center",null),e([V()],G.prototype,"defaultsFromMapSettings",null),e([V()],G.prototype,"defaultsFromMap",null),e([V()],G.prototype,"fatalError",void 0),e([V({type:j})],G.prototype,"extent",null),e([V(R(L,"graphics"))],G.prototype,"graphics",void 0),e([V(R(x,"analyses"))],G.prototype,"analyses",void 0),e([V({readOnly:!0,type:E})],G.prototype,"heightModelInfo",null),e([V({readOnly:!0})],G.prototype,"interacting",null),e([V({readOnly:!0})],G.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],G.prototype,"preconditionsReady",null),e([V({readOnly:!0})],G.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:o,readOnly:!0})],G.prototype,"layerViews",void 0),e([V()],G.prototype,"resolution",null),e([V({type:I})],G.prototype,"magnifier",void 0),e([V({value:null,type:t})],G.prototype,"map",null),e([V()],G.prototype,"padding",void 0),e([V({readOnly:!0})],G.prototype,"ready",void 0),e([V({type:F})],G.prototype,"spatialReference",null),e([V()],G.prototype,"spatialReferenceWarningDelay",void 0),e([V()],G.prototype,"stationary",null),e([V({readOnly:!0})],G.prototype,"supportsGround",void 0),e([V({type:k})],G.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],G.prototype,"timeZone",null),e([V()],G.prototype,"tools",null),e([V()],G.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],G.prototype,"type",void 0),e([V({type:Number})],G.prototype,"scale",void 0),e([V({readOnly:!0})],G.prototype,"updating",void 0),e([V({readOnly:!0})],G.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],G.prototype,"initialExtent",null),e([V()],G.prototype,"cursor",null),e([V({readOnly:!0})],G.prototype,"input",void 0),e([V({type:A,nonNullable:!0})],G.prototype,"navigation",void 0),e([V()],G.prototype,"layerViewManager",void 0),e([V()],G.prototype,"analysisViewManager",void 0),e([V()],G.prototype,"selectionManager",void 0),e([V()],G.prototype,"width",void 0),e([V()],G.prototype,"height",void 0),e([V({readOnly:!0})],G.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],G.prototype,"size",null),e([V({readOnly:!0})],G.prototype,"suspended",void 0),e([V({readOnly:!0})],G.prototype,"viewEvents",void 0),e([V({readOnly:!0})],G.prototype,"persistableViewModels",void 0),e([V()],G.prototype,"_isValid",void 0),e([V()],G.prototype,"_readyCycleForced",void 0),e([V()],G.prototype,"_lockedSpatialReference",void 0),e([V()],G.prototype,"_userTimeZone",void 0),e([V()],G.prototype,"_lockedTimeZone",void 0),e([V()],G.prototype,"_userTimeExtent",void 0),e([V()],G.prototype,"_lockedTimeExtent",void 0),e([V({type:H})],G.prototype,"theme",void 0),e([V({readOnly:!0,type:H})],G.prototype,"effectiveTheme",null),G=W=e([_("esri.views.View")],G);const N=G;function B(e){return e.layerViews}export{N as default};
package/views/View2D.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,sync as l,syncAndInitial as p}from"../core/reactiveUtils.js";import{initialize as h}from"../core/workers/workers.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import{isLoadedOrLoadFor as m}from"../geometry/projection.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import M from"./View.js";import v from"./2d/AnimationManager.js";import b from"./2d/FrameTask.js";import{GoToManager as _}from"./2d/GoToManager.js";import{layerView2DImporter as j}from"./2d/layerViewModuleImportUtils.js";import S from"./2d/MapViewConstraints.js";import O from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as T}from"./2d/viewpointUtils.js";import{ViewStateManager as L}from"./2d/ViewStateManager.js";import R from"./2d/input/MapViewInputManager.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as C}from"./2d/layers/support/util.js";import{HighlightGroup as D}from"./2d/support/HighlightGroup.js";import{createInitialHighlightGroups as x,getDefaultHighlightOptions as E,setDefaultHighlightOptions as G,admissibleHighlightGroupNames as z}from"./2d/support/highlightGroupUtils.js";import P from"./2d/support/HighlightOptions.js";import{hitTest as A}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as U,takeScreenshot as q}from"./2d/support/screenshotUtils.js";import{StationaryManager as I}from"./2d/support/StationaryManager.js";import{Timeline as F}from"./2d/support/Timeline.js";import{isSupportedScreenPointEvent as $,createScreenPointFromSupportedEvent as N}from"./support/screenUtils.js";import{check as W}from"./support/WebGLRequirements.js";import H from"./ui/DefaultUI.js";import B from"./ui/2d/DefaultUI2D.js";import{isWebMap as Z}from"../webmap/utils.js";import J from"../webmap/background/ColorBackground.js";import K from"../geometry/Polygon.js";let Q,X,Y,ee,te,ie,re;async function se(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);X=e,Y=t,ee=i,te=r,ie=s,re=a,Q=n}let ae=class extends(f(V(w(M)))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new _({view:this}),this.graphicsView=null,this.stateManager=new L({constraints:new S({view:this})}),this.stationaryManager=new I,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new b(this),this.floors=new i,this.grid=null,this.highlights=x(),this.inputManager=new R({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new F,this.type="2d",this.ui=new B,this.test={takeScreenshot:async e=>U(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([o((()=>this.viewpoint),(()=>this.stationaryManager.flip()),l),this.on("resize",(e=>this.stateManager.resize(e.width,e.height)))]),h()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),e!==this.animationManager.animation&&this.animationManager.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e);const i=()=>{this.destroyed||e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};e.when(i,i)}get background(){return Z(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return this.stateManager?.constraints}set constraints(e){e.view=this;const t=this.stateManager.constraints;this.stateManager.constraints=e,t?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(e){this.stateManager.extent=e}get highlightOptions(){return E(this)}set highlightOptions(e){G(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(e){this.stateManager.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(e){const{rotationEnabled:t}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=e,this.constraints.rotationEnabled=t}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating))||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(e){this.stateManager.viewpoint=e,this.frameTask.requestFrame()}get visibleArea(){const e=this.stateManager.visibleArea;return e?new K({rings:[e.map((e=>[e[0],e[1]]))],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(e,t){return this.goToManager.goTo(e,t)}async hitTest(e,t){return A(this,e,t)}async takeScreenshot(e){return q(this._getScreenshotView(e),e)}toMap(e){if(!this.ready)return null;const t=$(e)?N(this,e):e;return this.stateManager.toMap(t)}toScreen(e,t){return this.stateManager.toScreen(e,t)}on(e,t,i,r){const s=this.inputManager&&this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Z(this.map)?this.map.initialViewProperties.timeZone:null}hasLayerViewModule(e){return j.hasLayerViewModule(e)}importLayerView(e){return j.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=W(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e)throw a.getLogger(this).warn("#validate()",e.message),e}loadAsyncDependencies(){return se()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&T(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new Q(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new ie,this._magnifierView.magnifier=this.magnifier,this._gridView=new re;const i=new ee({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new te({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>t.stationary=e),p),o((()=>this.background),(e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),p),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),p),o((()=>this.grid),(e=>this._gridView.grid=e),p),o((()=>this.renderingOptions),(e=>t.renderingOptions=e),p),o((()=>this.highlights.items.map((e=>({name:e.name,options:{fillColor:e.options.color,haloColor:e.options.haloColor,fillOpacity:e.options.fillOpacity,haloOpacity:e.options.haloOpacity,haloWidth:e.options.haloWidth,haloBlur:e.options.haloBlur}})))),(()=>{t.highlightGradient=C(t.highlightGradient,this.highlights.items)}),p),o((()=>this.state.id),(()=>t.state=this.state),p),o((()=>this.highlights?this.highlights.items.map((e=>e.name)).join(","):""),(e=>{e!==z.join(",")&&a.getLogger(this).error("#highlights",`The highlights collection must contain a definition for groups ${z.map((e=>`"${e}"`)).join(", ")}, in this order.`)}),{initial:!0})],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new O(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new X({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Y(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};ae.type="2d",e([g({readOnly:!0})],ae.prototype,"animationManager",void 0),e([g({constructOnly:!0})],ae.prototype,"deactivatedWebGLExtensions",void 0),e([g({constructOnly:!0})],ae.prototype,"debugWebGLExtensions",void 0),e([g({readOnly:!0})],ae.prototype,"featuresTilingScheme",void 0),e([g({readOnly:!0})],ae.prototype,"fullOpacity",void 0),e([g()],ae.prototype,"goToManager",void 0),e([g({readOnly:!0})],ae.prototype,"graphicsTileStore",null),e([g()],ae.prototype,"graphicsView",void 0),e([g()],ae.prototype,"stateManager",void 0),e([g()],ae.prototype,"constraintsInfo",null),e([g({readOnly:!0})],ae.prototype,"state",null),e([g()],ae.prototype,"initialExtentRequired",null),e([g()],ae.prototype,"labelManager",void 0),e([g({readOnly:!0})],ae.prototype,"mapViewNavigation",void 0),e([g({constructOnly:!0})],ae.prototype,"renderCanvas",void 0),e([g()],ae.prototype,"renderingOptions",void 0),e([g({constructOnly:!0})],ae.prototype,"supersampleScreenshotsEnabled",void 0),e([g({readOnly:!0})],ae.prototype,"supportsGround",void 0),e([g()],ae.prototype,"defaultsFromMapSettings",null),e([g({readOnly:!0})],ae.prototype,"typeSpecificPreconditionsReady",null),e([g()],ae.prototype,"animation",null),e([g({type:J})],ae.prototype,"background",null),e([g()],ae.prototype,"center",null),e([g({type:S})],ae.prototype,"constraints",null),e([g()],ae.prototype,"extent",null),e([g()],ae.prototype,"floors",void 0),e([g()],ae.prototype,"grid",void 0),e([g({type:P})],ae.prototype,"highlightOptions",null),e([g({type:i.ofType(D)})],ae.prototype,"highlights",void 0),e([g({readOnly:!0})],ae.prototype,"inputManager",void 0),e([g()],ae.prototype,"map",void 0),e([g()],ae.prototype,"padding",null),e([g({readOnly:!0})],ae.prototype,"rendering",null),e([g()],ae.prototype,"resizeAlign",null),e([g({readOnly:!0})],ae.prototype,"resolution",null),e([g()],ae.prototype,"rotation",null),e([g()],ae.prototype,"scale",null),e([g({constructOnly:!0})],ae.prototype,"spatialReferenceLocked",void 0),e([g()],ae.prototype,"stationary",null),e([g({readOnly:!0})],ae.prototype,"tileInfo",null),e([g({type:F,readOnly:!0})],ae.prototype,"timeline",void 0),e([g({readOnly:!0})],ae.prototype,"type",void 0),e([g({readOnly:!0})],ae.prototype,"updating",null),e([g()],ae.prototype,"viewpoint",null),e([g({readOnly:!0})],ae.prototype,"visibleArea",null),e([g()],ae.prototype,"zoom",null),e([g({readOnly:!0})],ae.prototype,"navigating",null),e([g(),d((e=>e instanceof H?e:c(B,e)))],ae.prototype,"ui",void 0),ae=e([u("esri.views.View2D")],ae);const ne=ae;export{ne as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,sync as l,syncAndInitial as p}from"../core/reactiveUtils.js";import{initialize as h}from"../core/workers/workers.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import{isLoadedOrLoadFor as m}from"../geometry/projection.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import M from"./View.js";import v from"./2d/AnimationManager.js";import b from"./2d/FrameTask.js";import{GoToManager as _}from"./2d/GoToManager.js";import{layerView2DImporter as j}from"./2d/layerViewModuleImportUtils.js";import S from"./2d/MapViewConstraints.js";import T from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as O}from"./2d/viewpointUtils.js";import{ViewStateManager as L}from"./2d/ViewStateManager.js";import R from"./2d/input/MapViewInputManager.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as C}from"./2d/layers/support/util.js";import{HighlightGroup as x}from"./2d/support/HighlightGroup.js";import{createInitialHighlightGroups as D,getDefaultHighlightOptions as E,setDefaultHighlightOptions as G}from"./2d/support/highlightGroupUtils.js";import P from"./2d/support/HighlightOptions.js";import{hitTest as z}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as A,takeScreenshot as U}from"./2d/support/screenshotUtils.js";import{StationaryManager as q}from"./2d/support/StationaryManager.js";import{Timeline as I}from"./2d/support/Timeline.js";import{isSupportedScreenPointEvent as F,createScreenPointFromSupportedEvent as N}from"./support/screenUtils.js";import{check as W}from"./support/WebGLRequirements.js";import $ from"./ui/DefaultUI.js";import H from"./ui/2d/DefaultUI2D.js";import{isWebMap as B}from"../webmap/utils.js";import Z from"../webmap/background/ColorBackground.js";import J from"../geometry/Polygon.js";let K,Q,X,Y,ee,te,ie;async function re(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);Q=e,X=t,Y=i,ee=r,te=s,ie=a,K=n}let se=class extends(f(V(w(M)))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new _({view:this}),this.graphicsView=null,this.stateManager=new L({constraints:new S({view:this})}),this.stationaryManager=new q,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new b(this),this.floors=new i,this.grid=null,this.highlights=D(),this.inputManager=new R({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new I,this.type="2d",this.view2dType=null,this.ui=new H,this.test={takeScreenshot:async e=>A(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([o((()=>this.viewpoint),(()=>this.stationaryManager.flip()),l),this.on("resize",(e=>this.stateManager.resize(e.width,e.height)))]),h()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),e!==this.animationManager.animation&&this.animationManager.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e);const i=()=>{this.destroyed||e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};e.when(i,i)}get background(){return B(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return this.stateManager?.constraints}set constraints(e){e.view=this;const t=this.stateManager.constraints;this.stateManager.constraints=e,t?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(e){this.stateManager.extent=e}get highlightOptions(){return E(this)}set highlightOptions(e){G(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(e){this.stateManager.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(e){const{rotationEnabled:t}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=e,this.constraints.rotationEnabled=t}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating))||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce(((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating})),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(e){this.stateManager.viewpoint=e,this.frameTask.requestFrame()}get visibleArea(){const e=this.stateManager.visibleArea;return e?new J({rings:[e.map((e=>[e[0],e[1]]))],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(e,t){return this.goToManager.goTo(e,t)}async hitTest(e,t){return z(this,e,t)}async takeScreenshot(e){return U(this._getScreenshotView(e),e)}toMap(e){if(!this.ready)return null;const t=F(e)?N(this,e):e;return this.stateManager.toMap(t)}toScreen(e,t){return this.stateManager.toScreen(e,t)}on(e,t,i,r){const s=this.inputManager&&this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return B(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return B(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return j.hasLayerViewModule(e)}importLayerView(e){return j.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().reverse(),s=new globalThis.Map(r.map((e=>[e.layer.uid,e]))),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=W(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e)throw a.getLogger(this).warn("#validate()",e.message),e}loadAsyncDependencies(){return re()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&O(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new K(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new te,this._magnifierView.magnifier=this.magnifier,this._gridView=new ie;const i=new Y({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new ee({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("webgl-error",(e=>this.fatalError=e.error)),o((()=>this.stationary),(e=>t.stationary=e),p),o((()=>this.background),(e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color}),p),o((()=>this.magnifier),(e=>this._magnifierView.magnifier=e),p),o((()=>this.grid),(e=>this._gridView.grid=e),p),o((()=>this.renderingOptions),(e=>t.renderingOptions=e),p),o((()=>this.highlights.items.map((e=>({name:e.name,options:{fillColor:e.options.color,haloColor:e.options.haloColor,fillOpacity:e.options.fillOpacity,haloOpacity:e.options.haloOpacity,haloWidth:e.options.haloWidth,haloBlur:e.options.haloBlur}})))),(()=>{t.highlightGradient=C(t.highlightGradient,this.highlights.items)}),p),o((()=>this.state.id),(()=>t.state=this.state),p)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((e=>e(this))),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this.stage.addChild(e.container)}));const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new T(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new Q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new X(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};se.type="2d",e([g({readOnly:!0})],se.prototype,"animationManager",void 0),e([g({constructOnly:!0})],se.prototype,"deactivatedWebGLExtensions",void 0),e([g({constructOnly:!0})],se.prototype,"debugWebGLExtensions",void 0),e([g({readOnly:!0})],se.prototype,"featuresTilingScheme",void 0),e([g({readOnly:!0})],se.prototype,"fullOpacity",void 0),e([g()],se.prototype,"goToManager",void 0),e([g({readOnly:!0})],se.prototype,"graphicsTileStore",null),e([g()],se.prototype,"graphicsView",void 0),e([g()],se.prototype,"stateManager",void 0),e([g()],se.prototype,"constraintsInfo",null),e([g({readOnly:!0})],se.prototype,"state",null),e([g()],se.prototype,"initialExtentRequired",null),e([g()],se.prototype,"labelManager",void 0),e([g({readOnly:!0})],se.prototype,"mapViewNavigation",void 0),e([g({constructOnly:!0})],se.prototype,"renderCanvas",void 0),e([g()],se.prototype,"renderingOptions",void 0),e([g({constructOnly:!0})],se.prototype,"supersampleScreenshotsEnabled",void 0),e([g({readOnly:!0})],se.prototype,"supportsGround",void 0),e([g()],se.prototype,"defaultsFromMapSettings",null),e([g({readOnly:!0})],se.prototype,"typeSpecificPreconditionsReady",null),e([g()],se.prototype,"animation",null),e([g({type:Z})],se.prototype,"background",null),e([g()],se.prototype,"center",null),e([g({type:S})],se.prototype,"constraints",null),e([g()],se.prototype,"extent",null),e([g()],se.prototype,"floors",void 0),e([g()],se.prototype,"grid",void 0),e([g({type:P})],se.prototype,"highlightOptions",null),e([g({type:i.ofType(x)})],se.prototype,"highlights",void 0),e([g({readOnly:!0})],se.prototype,"inputManager",void 0),e([g()],se.prototype,"map",void 0),e([g()],se.prototype,"padding",null),e([g({readOnly:!0})],se.prototype,"rendering",null),e([g()],se.prototype,"resizeAlign",null),e([g({readOnly:!0})],se.prototype,"resolution",null),e([g()],se.prototype,"rotation",null),e([g()],se.prototype,"scale",null),e([g({constructOnly:!0})],se.prototype,"spatialReferenceLocked",void 0),e([g()],se.prototype,"stationary",null),e([g({readOnly:!0})],se.prototype,"tileInfo",null),e([g({type:I,readOnly:!0})],se.prototype,"timeline",void 0),e([g({readOnly:!0})],se.prototype,"type",void 0),e([g({readOnly:!0})],se.prototype,"updating",null),e([g({readOnly:!0})],se.prototype,"view2dType",void 0),e([g()],se.prototype,"viewpoint",null),e([g({readOnly:!0})],se.prototype,"visibleArea",null),e([g()],se.prototype,"zoom",null),e([g({readOnly:!0})],se.prototype,"navigating",null),e([g(),d((e=>e instanceof $?e:c(H,e)))],se.prototype,"ui",void 0),se=e([u("esri.views.View2D")],se);const ae=se;export{ae as default};