@arcgis/core 4.27.0-next.20230321 → 4.27.0-next.20230323

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 (267) hide show
  1. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02b6227c156ee0d8eb66.js +1 -0
  4. package/assets/esri/core/workers/chunks/{7e0c65aa61c2ff0c3504.js → 1c98b92933a48cf96c1e.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a27951dbe83c63f9d01a.js → 26bc91a9d9d7345a3eba.js} +1 -1
  6. package/assets/esri/core/workers/chunks/321f272d4c7ed6b0cb46.js +1 -0
  7. package/assets/esri/core/workers/chunks/{a09cc8e2ff43fe4afa04.js → 375628de4cfc71cb41c1.js} +1 -1
  8. package/assets/esri/core/workers/chunks/47bd558e2ce89f47f908.js +1 -0
  9. package/assets/esri/core/workers/chunks/4cb62855bb1ae608bfde.js +1 -0
  10. package/assets/esri/core/workers/chunks/4f0c2b6b200bf8222fd7.js +1 -0
  11. package/assets/esri/core/workers/chunks/5252f3cc244204edc299.js +1 -0
  12. package/assets/esri/core/workers/chunks/6f952a6464cf9e62dbac.js +1098 -0
  13. package/assets/esri/core/workers/chunks/76d6c1fc25f02bcf258e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d6ec7682de8fad9718e9.js → 77dccfaf1f9e778973b3.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{c5d872adce711ec61ede.js → 8980c5dc389c27368b73.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{6acaf28cba5d49a98fb6.js → 91b292f310f06a0cbf72.js} +1 -1
  17. package/assets/esri/core/workers/chunks/9bac27976e7a71268b7b.js +1 -0
  18. package/assets/esri/core/workers/chunks/{ff9efa829497557ec26a.js → aa4640a0207e0be224e2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{81a6f4b43e047c3395c0.js → aebc5091bd4159197ce0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c8cd3fde6d8d43ddb954.js → b6cdf4daf07d9e55f61e.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{6b14673a4afd6ef81487.js → c76cabd2d2510a653dff.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{4be7647605300e07e843.js → c90fff7e28ba5b443b11.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{e637e47000f4dc48054d.js → cc7f4fd20443a2acf0f1.js} +1 -1
  24. package/assets/esri/core/workers/chunks/d19e9fab4f4fb765c6a3.js +1 -0
  25. package/assets/esri/core/workers/chunks/d9ef4891c8b0bdd90f5b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{d92d6a43270fb0d366b4.js → de4f5c48efbcee82c3c1.js} +1 -1
  27. package/assets/esri/core/workers/chunks/f6e7948075b3742b4ef9.js +1 -0
  28. package/assets/esri/core/workers/chunks/{32f9b488915a4a8864e5.js → f8b9e0c1671e55b61904.js} +1 -1
  29. package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.ts.svg +7 -28
  30. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.svg +11 -0
  31. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList.json +1 -1
  32. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  33. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  34. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  35. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  36. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  37. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  38. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  39. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  40. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_en.json +1 -1
  41. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  42. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  43. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  44. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  45. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  46. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  47. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  48. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  49. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  50. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  51. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  52. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  53. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  54. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  55. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  56. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  57. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  58. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  59. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  60. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  61. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  62. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  63. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  64. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  65. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  66. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  67. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  68. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  69. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  70. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  71. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  89. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  100. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  101. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  102. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  103. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  104. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  105. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  106. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  107. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  108. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  109. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  110. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  111. package/assets/esri/widgets/LayerList/t9n/LayerList.json +1 -1
  112. package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
  113. package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
  114. package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
  115. package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
  116. package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
  117. package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
  118. package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
  119. package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
  120. package/assets/esri/widgets/LayerList/t9n/LayerList_en.json +1 -1
  121. package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
  122. package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
  123. package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
  124. package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
  125. package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
  126. package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
  127. package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
  128. package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
  129. package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
  130. package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
  131. package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
  132. package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
  133. package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
  134. package/assets/esri/widgets/LayerList/t9n/LayerList_nb.json +1 -1
  135. package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
  136. package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
  137. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
  138. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
  139. package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
  140. package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
  141. package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
  142. package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
  143. package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
  144. package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
  145. package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
  146. package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
  147. package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
  148. package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
  149. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
  150. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
  151. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
  152. package/chunks/ComponentShader.glsl.js +1 -1
  153. package/chunks/DefaultMaterial.glsl.js +4 -4
  154. package/chunks/vec42.js +1 -1
  155. package/core/Loadable.js +1 -1
  156. package/core/accessorSupport/Property.js +1 -1
  157. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  158. package/core/analysisThemeUtils.js +1 -1
  159. package/core/maybe.js +1 -1
  160. package/geometry/support/buffer/math/vec4.js +1 -1
  161. package/interfaces.d.ts +1 -1
  162. package/layers/IntegratedMeshLayer.js +1 -1
  163. package/layers/LineOfSightLayer.js +1 -1
  164. package/layers/SceneLayer.js +1 -1
  165. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  166. package/layers/mixins/ImageryTileMixin.js +1 -1
  167. package/layers/mixins/RefreshableLayer.js +1 -1
  168. package/layers/support/SceneFilter.js +1 -1
  169. package/layers/support/SceneModifications.js +1 -1
  170. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  171. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  172. package/package.json +1 -1
  173. package/portal/PortalItemResource.js +1 -1
  174. package/portal/support/resourceUtils.js +1 -1
  175. package/support/revision.js +1 -1
  176. package/symbols/support/utils.js +1 -1
  177. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  178. package/views/2d/viewpointUtils.js +1 -1
  179. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  180. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  181. package/views/3d/analysis/Dimension/settings.js +1 -1
  182. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  183. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  184. package/views/3d/analysis/Slice/images/Factory.js +1 -1
  185. package/views/3d/analysis/Slice/images/generateTextures.js +1 -1
  186. package/views/3d/analysis/Slice/images/heading-rotate-svg.js +1 -1
  187. package/views/3d/analysis/Slice/images/tilt-rotate-svg.js +5 -0
  188. package/views/3d/analysis/Slice/settings.js +5 -0
  189. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  190. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  191. package/views/3d/environment/Stars.js +1 -1
  192. package/views/3d/interactive/Manipulator3D.js +1 -1
  193. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  194. package/views/3d/interactive/manipulatorUtils.js +1 -1
  195. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  196. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  197. package/views/3d/layers/PointCloudWorker.js +1 -1
  198. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  200. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  209. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  210. package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
  211. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  212. package/views/3d/layers/i3s/PointGraphic.js +1 -1
  213. package/views/3d/state/ViewState.js +1 -1
  214. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
  215. package/views/3d/terrain/GeometryState.js +1 -1
  216. package/views/3d/terrain/PatchGeometry.js +1 -1
  217. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  218. package/views/3d/terrain/TileAgent.js +1 -1
  219. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  220. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  221. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  222. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +6 -5
  223. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
  224. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +11 -11
  225. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +1 -1
  226. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  227. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  228. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  229. package/views/3d/webgl-engine/lib/Normals.js +5 -0
  230. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  231. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  232. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  233. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  234. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  235. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  236. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  237. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  238. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  239. package/views/LayerViewManager.js +1 -1
  240. package/views/SceneView.js +1 -1
  241. package/views/draw/support/Reshape.js +1 -1
  242. package/views/layers/SceneLayerView.js +1 -1
  243. package/views/support/colorUtils.js +1 -1
  244. package/views/webgl/ShaderTranspiler.js +1 -1
  245. package/widgets/BasemapLayerList.js +1 -1
  246. package/widgets/Daylight/DaylightViewModel.js +1 -1
  247. package/widgets/Expand.js +1 -1
  248. package/widgets/FeatureForm/FieldInput.js +1 -1
  249. package/widgets/LayerList.js +1 -1
  250. package/widgets/Search.js +1 -1
  251. package/widgets/Sketch/SketchViewModel.js +1 -1
  252. package/assets/esri/core/workers/chunks/0487ab23a20ec356ab4c.js +0 -1
  253. package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +0 -1
  254. package/assets/esri/core/workers/chunks/2c0775541cfec9d43acb.js +0 -1
  255. package/assets/esri/core/workers/chunks/4879164b48da9ad4547a.js +0 -1
  256. package/assets/esri/core/workers/chunks/69060e5cffc19e76062a.js +0 -1
  257. package/assets/esri/core/workers/chunks/87edeb09a948122fa030.js +0 -1
  258. package/assets/esri/core/workers/chunks/92951b85676df776961f.js +0 -1100
  259. package/assets/esri/core/workers/chunks/a71a5c8a9aa302bf6f01.js +0 -1
  260. package/assets/esri/core/workers/chunks/ad5c61daaed286c74982.js +0 -1
  261. package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +0 -1
  262. package/assets/esri/core/workers/chunks/ef2d3e84cd58df5f80af.js +0 -1
  263. package/assets/esri/core/workers/chunks/fec5e55e0fbf1710e22d.js +0 -1
  264. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +0 -80
  265. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.png +0 -0
  266. package/views/3d/analysis/Slice/images/tilt-rotate-png.js +0 -5
  267. package/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js +0 -8
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{adjustStaticAGOUrl as e}from"../../../../core/devEnvironmentUtils.js";import{get as t}from"../../../../core/maybe.js";import{b as r}from"../../../../chunks/mat3.js";import{c as o}from"../../../../chunks/mat3f64.js";import{a as s}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{m as i,b as l,D as a,l as u,n as c,h as m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{empty as d,expandWithVec3 as p}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as g}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec4f as x,BufferViewVec4u8 as b,BufferViewVec4u16 as h,BufferViewVec3f as T,BufferViewVec3u8 as y,BufferViewVec3u16 as w}from"../../../../geometry/support/buffer/BufferView.js";import{t as R,a as j,s as M}from"../../../../chunks/vec32.js";import{t as v,s as B}from"../../../../chunks/vec42.js";import{n as S}from"../../../../chunks/vec22.js";import{c as L}from"../../../../chunks/vec33.js";import{c as A}from"../../../../chunks/vec43.js";import{DefaultLoadingContext as O}from"../../glTF/DefaultLoadingContext.js";import{loadGLTF as I}from"../../glTF/loader.js";import{convertPrimitiveToTriangles as k}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as C}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as F}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as E}from"./ProcessedObjectResource.js";import{load as N,processLoadResult as P}from"./wosrLoader.js";import{NormalAttributeType as U}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{Attribute as V}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as D,DepthTestFunction as _,CullFaceOptions as G}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as H}from"../../webgl-engine/lib/Geometry.js";import{Texture as q}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as W}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as $}from"../../webgl-engine/materials/DefaultMaterial.js";import{COLOR_GAMMA as z}from"../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";async function K(r,o){const s=Q(e(r));if("wosr"===s.fileType){const e=await(o.cache?o.cache.loadWOSR(s.url,o):N(s.url,o)),{engineResources:t,referenceBoundingBox:r}=P(e,o);return{lods:t,referenceBoundingBox:r,isEsriSymbolResource:!1,isWosr:!0}}const n=await(o.cache?o.cache.loadGLTF(s.url,o,!!o.usePBR):I(new O(o.streamDataRequester),s.url,o,o.usePBR)),i=t(n.model.meta,"ESRI_proxyEllipsoid"),l=n.meta.isEsriSymbolResource&&null!=i&&n.meta.uri.includes("/RealisticTrees/");l&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,te(n,i));const a=!!o.usePBR,u=n.meta.isEsriSymbolResource?{usePBR:a,isSchematic:!1,treeRendering:l,mrrFactors:[0,1,.2]}:{usePBR:a,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},c={...o.materialParamsMixin,treeRendering:l},{engineResources:m,referenceBoundingBox:f}=J(n,u,c,o.skipHighLods&&null==s.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:s.specifiedLodIndex});return{lods:m,referenceBoundingBox:f,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}function Q(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(t)return{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function J(e,t,r,o){const s=e.model,n=new Array,i=new Map,l=new Map,a=s.lods.length,u=d();return s.lods.forEach(((e,c)=>{const m=!0===o.skipHighLods&&(a>1&&0===c||a>3&&1===c)||!1===o.skipHighLods&&null!=o.singleLodIndex&&c!==o.singleLodIndex;if(m&&0!==c)return;const f=new E(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const o=m?new $({}):X(s,e,f,t,r,i,l),{geometry:n,vertexCount:a}=Y(e,null!=o?o:new $({})),d=n.boundingInfo;null!=d&&0===c&&(p(u,d.bbMin),p(u,d.bbMax)),null!=o&&(f.stageResources.geometries.push(n),f.numberOfVertices+=a)})),m||n.push(f)})),{engineResources:n,referenceBoundingBox:u}}function X(e,t,r,o,s,n,i){const l=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),a=e.materials.get(t.material),u=null!=t.attributes.texCoord0,c=null!=t.attributes.normal;if(null==a)return null;const m=ee(a.alphaMode);if(!n.has(l)){if(u){const t=(t,r=!1)=>{if(null!=t&&!i.has(t)){const o=e.textures.get(t);if(null!=o){const e=o.data;i.set(t,new q(C(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!C(e)&&r,encoding:C(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(a.textureColor,m!==D.Opaque),t(a.textureNormal),t(a.textureOcclusion),t(a.textureEmissive),t(a.textureMetallicRoughness)}const r=a.color[0]**(1/z),f=a.color[1]**(1/z),d=a.color[2]**(1/z),p=a.emissiveFactor[0]**(1/z),g=a.emissiveFactor[1]**(1/z),x=a.emissiveFactor[2]**(1/z),b=null!=a.textureColor&&u?i.get(a.textureColor):null;n.set(l,new $({...o,transparent:m===D.Blend,customDepthTest:_.Lequal,textureAlphaMode:m,textureAlphaCutoff:a.alphaCutoff,diffuse:[r,f,d],ambient:[r,f,d],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?G.None:G.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:c?U.Attribute:U.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=b?b.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:null!=a.textureNormal&&u?i.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:null!=b&&!!b.params.preMultiplyAlpha,occlusionTextureId:null!=a.textureOcclusion&&u?i.get(a.textureOcclusion).id:void 0,emissiveTextureId:null!=a.textureEmissive&&u?i.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=a.textureMetallicRoughness&&u?i.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[p,g,x],mrrFactors:[a.metallicFactor,a.roughnessFactor,o.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:F(a.colorTextureTransform),normalTextureTransformMatrix:F(a.normalTextureTransform),occlusionTextureTransformMatrix:F(a.occlusionTextureTransform),emissiveTextureTransformMatrix:F(a.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:F(a.metallicRoughnessTextureTransform),...s}))}const f=n.get(l);if(r.stageResources.materials.push(f),u){const e=e=>{null!=e&&r.stageResources.textures.push(i.get(e))};e(a.textureColor),e(a.textureNormal),e(a.textureOcclusion),e(a.textureEmissive),e(a.textureMetallicRoughness)}return f}function Y(e,t){const o=e.attributes.position.count,s=k(e.indices||o,e.primitiveType),n=g(3*o),{typedBuffer:i,typedBufferStride:l}=e.attributes.position;R(n,i,e.transform,3,l);const a=[[W.POSITION,new V(n,3,!0)]],u=[[W.POSITION,s]];if(null!=e.attributes.normal){const t=g(3*o),{typedBuffer:n,typedBufferStride:i}=e.attributes.normal;r(Z,e.transform),j(t,n,Z,3,i),a.push([W.NORMAL,new V(t,3,!0)]),u.push([W.NORMAL,s])}if(null!=e.attributes.tangent){const t=g(4*o),{typedBuffer:n,typedBufferStride:i}=e.attributes.tangent;r(Z,e.transform),v(t,n,Z,4,i),a.push([W.TANGENT,new V(t,4,!0)]),u.push([W.TANGENT,s])}if(null!=e.attributes.texCoord0){const t=g(2*o),{typedBuffer:r,typedBufferStride:n}=e.attributes.texCoord0;S(t,r,2,n),a.push([W.UV0,new V(t,2,!0)]),u.push([W.UV0,s])}if(null!=e.attributes.color){const t=new Uint8Array(4*o);4===e.attributes.color.elementCount?e.attributes.color instanceof x?B(t,e.attributes.color,255):e.attributes.color instanceof b?A(t,e.attributes.color):e.attributes.color instanceof h&&B(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof T?M(t,e.attributes.color,255,4):e.attributes.color instanceof y?L(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof w&&M(t,e.attributes.color,1/256,4)),a.push([W.COLOR,new V(t,4,!0)]),u.push([W.COLOR,s])}return{geometry:new H(t,a,u),vertexCount:o}}const Z=o();function ee(e){switch(e){case"BLEND":return D.Blend;case"MASK":return D.Mask;case"OPAQUE":case null:case void 0:return D.Opaque}}function te(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const d of o.parts){const o=d.attributes.normal;if(null==o)return;const p=d.attributes.position,g=p.count,x=f(),h=f(),y=f(),w=new Uint8Array(4*g),R=new Float64Array(3*g),j=s(n(),d.transform);let M=0,v=0;for(let s=0;s<g;s++){p.getVec(s,h),o.getVec(s,x),i(h,h,d.transform),l(y,h,t.center),a(y,y,t.radius);const n=y[2],f=u(y),g=Math.min(.45+.55*f*f,1);a(y,y,t.radius),null!==j&&i(y,y,j),c(y,y),r+1!==e.model.lods.length&&e.model.lods.length>1&&m(y,y,x,n>-1?.2:Math.min(-4*n-3.8,1)),R[M]=y[0],R[M+1]=y[1],R[M+2]=y[2],M+=3,w[v]=255*g,w[v+1]=255*g,w[v+2]=255*g,w[v+3]=255,v+=4}d.attributes.normal=new T(R),d.attributes.color=new b(w)}}}export{K as fetch,J as gltfToEngineResources,Q as parseUrl};
5
+ import{adjustStaticAGOUrl as e}from"../../../../core/devEnvironmentUtils.js";import{b as t}from"../../../../chunks/mat3.js";import{c as r}from"../../../../chunks/mat3f64.js";import{a as o}from"../../../../chunks/mat4.js";import{c as s}from"../../../../chunks/mat4f64.js";import{m as n,b as i,D as l,l as u,n as a,h as c}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{empty as f,expandWithVec3 as d}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as p}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec4f as g,BufferViewVec4u8 as x,BufferViewVec4u16 as b,BufferViewVec3f as h,BufferViewVec3u8 as T,BufferViewVec3u16 as y}from"../../../../geometry/support/buffer/BufferView.js";import{t as w,a as R,s as M}from"../../../../chunks/vec32.js";import{t as j,s as v}from"../../../../chunks/vec42.js";import{n as B}from"../../../../chunks/vec22.js";import{c as S}from"../../../../chunks/vec33.js";import{c as L}from"../../../../chunks/vec43.js";import{DefaultLoadingContext as A}from"../../glTF/DefaultLoadingContext.js";import{loadGLTF as O}from"../../glTF/loader.js";import{convertPrimitiveToTriangles as I}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as k}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as C}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as F}from"./ProcessedObjectResource.js";import{load as E,processLoadResult as N}from"./wosrLoader.js";import{NormalType as P}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{Attribute as U}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as V,DepthTestFunction as D,CullFaceOptions as _}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as G}from"../../webgl-engine/lib/Geometry.js";import{Texture as H}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as q}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";import{COLOR_GAMMA as $}from"../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";async function z(t,r){const o=K(e(t));if("wosr"===o.fileType){const e=await(r.cache?r.cache.loadWOSR(o.url,r):E(o.url,r)),{engineResources:t,referenceBoundingBox:s}=N(e,r);return{lods:t,referenceBoundingBox:s,isEsriSymbolResource:!1,isWosr:!0}}const s=await(r.cache?r.cache.loadGLTF(o.url,r,!!r.usePBR):O(new A(r.streamDataRequester),o.url,r,r.usePBR)),n=s.model.meta?.ESRI_proxyEllipsoid,i=s.meta.isEsriSymbolResource&&null!=n&&s.meta.uri.includes("/RealisticTrees/");i&&!s.customMeta.esriTreeRendering&&(s.customMeta.esriTreeRendering=!0,ee(s,n));const l=!!r.usePBR,u=s.meta.isEsriSymbolResource?{usePBR:l,isSchematic:!1,treeRendering:i,mrrFactors:[0,1,.2]}:{usePBR:l,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},a={...r.materialParamsMixin,treeRendering:i},{engineResources:c,referenceBoundingBox:m}=Q(s,u,a,r.skipHighLods&&null==o.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:o.specifiedLodIndex});return{lods:c,referenceBoundingBox:m,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}function K(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(t)return{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function Q(e,t,r,o){const s=e.model,n=new Array,i=new Map,l=new Map,u=s.lods.length,a=f();return s.lods.forEach(((e,c)=>{const m=!0===o.skipHighLods&&(u>1&&0===c||u>3&&1===c)||!1===o.skipHighLods&&null!=o.singleLodIndex&&c!==o.singleLodIndex;if(m&&0!==c)return;const f=new F(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const o=m?new W({}):J(s,e,f,t,r,i,l),{geometry:n,vertexCount:u}=X(e,null!=o?o:new W({})),p=n.boundingInfo;null!=p&&0===c&&(d(a,p.bbMin),d(a,p.bbMax)),null!=o&&(f.stageResources.geometries.push(n),f.numberOfVertices+=u)})),m||n.push(f)})),{engineResources:n,referenceBoundingBox:a}}function J(e,t,r,o,s,n,i){const l=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),a=null!=t.attributes.texCoord0,c=null!=t.attributes.normal;if(null==u)return null;const m=Z(u.alphaMode);if(!n.has(l)){if(a){const t=(t,r=!1)=>{if(null!=t&&!i.has(t)){const o=e.textures.get(t);if(null!=o){const e=o.data;i.set(t,new H(k(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!k(e)&&r,encoding:k(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==V.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/$),f=u.color[1]**(1/$),d=u.color[2]**(1/$),p=u.emissiveFactor[0]**(1/$),g=u.emissiveFactor[1]**(1/$),x=u.emissiveFactor[2]**(1/$),b=null!=u.textureColor&&a?i.get(u.textureColor):null;n.set(l,new W({...o,transparent:m===V.Blend,customDepthTest:D.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,d],ambient:[r,f,d],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?_.None:_.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:c?P.Attribute:P.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=b?b.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&a?i.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=b&&!!b.params.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&a?i.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&a?i.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&a?i.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[p,g,x],mrrFactors:[u.metallicFactor,u.roughnessFactor,o.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:C(u.colorTextureTransform),normalTextureTransformMatrix:C(u.normalTextureTransform),occlusionTextureTransformMatrix:C(u.occlusionTextureTransform),emissiveTextureTransformMatrix:C(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:C(u.metallicRoughnessTextureTransform),...s}))}const f=n.get(l);if(r.stageResources.materials.push(f),a){const e=e=>{null!=e&&r.stageResources.textures.push(i.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}function X(e,r){const o=e.attributes.position.count,s=I(e.indices||o,e.primitiveType),n=p(3*o),{typedBuffer:i,typedBufferStride:l}=e.attributes.position;w(n,i,e.transform,3,l);const u=[[q.POSITION,new U(n,3,!0)]],a=[[q.POSITION,s]];if(null!=e.attributes.normal){const r=p(3*o),{typedBuffer:n,typedBufferStride:i}=e.attributes.normal;t(Y,e.transform),R(r,n,Y,3,i),u.push([q.NORMAL,new U(r,3,!0)]),a.push([q.NORMAL,s])}if(null!=e.attributes.tangent){const r=p(4*o),{typedBuffer:n,typedBufferStride:i}=e.attributes.tangent;t(Y,e.transform),j(r,n,Y,4,i),u.push([q.TANGENT,new U(r,4,!0)]),a.push([q.TANGENT,s])}if(null!=e.attributes.texCoord0){const t=p(2*o),{typedBuffer:r,typedBufferStride:n}=e.attributes.texCoord0;B(t,r,2,n),u.push([q.UV0,new U(t,2,!0)]),a.push([q.UV0,s])}if(null!=e.attributes.color){const t=new Uint8Array(4*o);4===e.attributes.color.elementCount?e.attributes.color instanceof g?v(t,e.attributes.color,255):e.attributes.color instanceof x?L(t,e.attributes.color):e.attributes.color instanceof b&&v(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof h?M(t,e.attributes.color,255,4):e.attributes.color instanceof T?S(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof y&&M(t,e.attributes.color,1/256,4)),u.push([q.COLOR,new U(t,4,!0)]),a.push([q.COLOR,s])}return{geometry:new G(r,u,a),vertexCount:o}}const Y=r();function Z(e){switch(e){case"BLEND":return V.Blend;case"MASK":return V.Mask;case"OPAQUE":case null:case void 0:return V.Opaque}}function ee(e,t){for(let r=0;r<e.model.lods.length;++r){const f=e.model.lods[r];for(const d of f.parts){const f=d.attributes.normal;if(null==f)return;const p=d.attributes.position,g=p.count,b=m(),T=m(),y=m(),w=new Uint8Array(4*g),R=new Float64Array(3*g),M=o(s(),d.transform);let j=0,v=0;for(let o=0;o<g;o++){p.getVec(o,T),f.getVec(o,b),n(T,T,d.transform),i(y,T,t.center),l(y,y,t.radius);const s=y[2],m=u(y),g=Math.min(.45+.55*m*m,1);l(y,y,t.radius),null!==M&&n(y,y,M),a(y,y),r+1!==e.model.lods.length&&e.model.lods.length>1&&c(y,y,b,s>-1?.2:Math.min(-4*s-3.8,1)),R[j]=y[0],R[j+1]=y[1],R[j+2]=y[2],j+=3,w[v]=255*g,w[v+1]=255*g,w[v+2]=255*g,w[v+3]=255,v+=4}d.attributes.normal=new h(R),d.attributes.color=new x(w)}}}export{z as fetch,Q as gltfToEngineResources,K as parseUrl};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import s from"../../../../core/Accessor.js";import{remove as i,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import{resultOrAbort as n,result as a}from"../../../../core/asyncUtils.js";import{estimateStringByteSize as o,estimateNumberByteSize as c}from"../../../../core/byteSizeEstimations.js";import d from"../../../../core/Logger.js";import{destroyMaybe as h,abortMaybe as l,get as u}from"../../../../core/maybe.js";import{whenOrAbort as m}from"../../../../core/promiseUtils.js";import{watch as g,initial as p}from"../../../../core/reactiveUtils.js";import{property as _}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{formatNumber as b}from"../../../../intl/number.js";import{getMaximumQuerySize as f,queryAllJSON as O}from"../../../../layers/support/featureQueryAll.js";import{direct3DObjectFeatureLayerDisplayEnabled as j,sceneLayerEditingEnabled as I}from"../../../../support/featureFlags.js";import C from"../FeatureLayerView3D.js";let v=class extends s{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._interactiveEditingSessions=null,this._maximumNumberOfEditOVerrides=F,this._original3DOFLDefinitionExpression=null,this._associatedLayerView=null,this._changedObjectIds=new Set,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController}initialize(){this._memCache=this.memoryController.newCache(`${this.layer.uid}-attribute-overrides`),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.then((()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})),this.is3DOFL&&j()&&null!=this._associatedLayer&&this._associatedLayer.load().then((e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(g((()=>this._definitionExpression),(t=>e.definitionExpression=t),p)),this._associatedLayerView=new C({layer:this._associatedLayer,view:this.view}))}))}destroy(){this.is3DOFL&&j()&&null!=this._associatedLayerView&&null!=this._associatedLayer&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression),this._set("layer",null),this._memCache=h(this._memCache),this._pendingFetchAbortController=l(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null}get is3DOFL(){return I()&&null!=this._associatedLayer&&null!=this._associatedLayer.infoFor3D}get geometryChangedObjectIds(){return this.is3DOFL?[...this._changedObjectIds]:[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get _definitionExpression(){const e=this.geometryChangedObjectIds;return 0===e.length?"1 = 0":`OBJECTID IN (${e.join(",")})`}get updating(){if(!this.is3DOFL)return!1;if(!j())return!1;return!(null!=this._associatedLayerView)||null!=this._associatedLayerView&&this._associatedLayerView.updating}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._changedObjectIds.size}createInteractiveEditSession(e){this._changedObjectIds.add(e),this.notifyChange("_changedObjectIds"),null==this._interactiveEditingSessions&&(this._interactiveEditingSessions=[]);const t=this._interactiveEditingSessions,s=new L(e,{rollback:()=>{i(t,s),0===t.length&&(this._interactiveEditingSessions=null)},commit:t=>{for(const[s,i]of t)this.updateAttributeValue(e,s,i)}});return t.unshift(s),s}async apply(e,t,s){if(null==t)return;const{loadedAttributes:i,attributeData:r}=t;if(null==i||0===i.length||null==r)return;if(this._pendingFetchChangedObjectIds&&await m(this._pendingFetchChangedObjectIds,s),0===this._changedObjectIds.size)return;const n={loadedAttributes:i,attributeData:r},a=this._getOverridesFromCache(e,n,this._changedObjectIds),{objectIds:o,fieldNames:c}=a;if(0===o.length||0===c.length)return;const d=await this._queryOverridesFromAssociatedLayer(o,c,s);null!=d&&this._processOverridesFromAssociatedLayer(e,d,c,n)}updateGeometry(e){this._changedObjectIds.add(e),this.notifyChange("_changedObjectIds")}updateAttributeValue(e,t,s){this._changedObjectIds.add(e),this._cacheAttributeValue(e,t,s),this.notifyChange("_changedObjectIds")}_cacheAttributeValue(e,t,s){this._memCache.put(this._getAttributeCacheKey(e,t),s,this._memCacheAttributeValueSize(s))}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:s},i){const r=new Set,n=new Array;for(const o of t)n[o.index]=s[o.name];const a=new Set;for(let o=0;o<e.length;o++){const s=e[o];if(i.has(s))for(const e of t){const t=this._fromCache(s,e.index);void 0===t?(r.add(s),a.add(e.name)):n[e.index][o]=t}}return{objectIds:Array.from(r),fieldNames:Array.from(a)}}_fromCache(e,t){const s=this._fromInteractiveEditingSession(e,t);if(void 0!==s)return s;const i=this._getAttributeCacheKey(e,t);return this._memCache.get(i)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const s of this._interactiveEditingSessions){if(s.objectId!==e)continue;const i=s.get(t);if(void 0!==i)return i}}_getAttributeCacheKey(e,t){return`${e}-${t}`}async _queryOverridesFromAssociatedLayer(e,t,s){if(0===e.length||0===t.length)return null;e=e.sort(((e,t)=>e-t)),this._warnMaximumChangedObjectsExceeded&&(this._warnMaximumChangedObjectsExceeded=!1,this._logMaximumObjectsExceededWarning());const i=this.layer.associatedLayer;if(null==i)return null;const a=i.createQuery();a.where="1=1",a.returnGeometry=!1,a.outFields=[i.objectIdField,...t],a.cacheHint=!0,a.objectIds=e;const o=f(i),c=e.length>o?r(e,o).map((e=>{const t=a.clone();return t.objectIds=e,n(O(i,t,{signal:s}))})):[n(O(i,a,{signal:s}))];return(await Promise.all(c)).reduce(((e,t)=>e.concat(t.ok?t.value.features:[])),[])}_logMaximumObjectsExceededWarning(){let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${b(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;t&&t.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,d.getLogger("esri.views.3d.layers.i3s.I3SOverrides").warn("#queryOverrides()",this.layer.title,`${e}.`)}_processOverridesFromAssociatedLayer(e,t,s,{loadedAttributes:i,attributeData:r}){const n=this.layer.associatedLayer;if(null==n)return;const a=n.objectIdField,o=s.map((e=>r[e])),c=new Map(i.map((e=>[e.name,e.index]))),d=s.map((e=>c.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[a];for(let t=0;t<s.length;t++){const i=d[t],r=h.get(e),n=l.attributes[s[t]];o[t][r]=n,this._cacheAttributeValue(e,i,n)}}}_memCacheAttributeValueSize(e){return"string"==typeof e?o(e):c()}async _fetchChangedObjectIds(e){const s=this.layer;if(await s.load({signal:e}),this._changedObjectIds.clear(),null==s.associatedLayer||!s.associatedLayer.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const r=s.associatedLayer.layerId,n=null!=s.associatedLayer.infoFor3D,o=await a(t(`${s.associatedLayer.url}/extractChanges`,{method:"post",query:{f:"json",returnIdsOnly:!0,layers:`[${r}]`,returnUpdates:!0,returnDeletes:n,returnInserts:n,layerServerGens:JSON.stringify([{id:r,serverGen:i}])},timeout:A,signal:e}));if(o.ok&&o.value.data?.edits&&1===o.value.data.edits.length){const e=o.value.data.edits[0],t=u(e,"objectIds","adds"),s=u(e,"objectIds","updates"),i=u(e,"objectIds","deletes");let r=[];null!=t&&(r=r.concat(t)),null!=s&&(r=r.concat(s)),null!=i&&(r=r.concat(i));const n=Math.min(this._maximumNumberOfEditOVerrides,r.length);n<r.length&&(this._warnMaximumChangedObjectsExceeded=!0);const a=r.sort(((e,t)=>e-t));for(let o=0;o<n;o++)this._changedObjectIds.add(a[o])}this.notifyChange("_changedObjectIds")}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp&&null!=e.serviceUpdateTimeStamp.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t&&null!=t.serverGens&&null!=t.serverGens.minServerGen?t.serverGens.minServerGen:null}get test(){const e=Array.from(this._changedObjectIds),t=this._pendingFetchChangedObjectIds,s=this;return{changedObjectIds:e,pendingFetchChangedObjectIds:t,get maximumNumberOfEditOVerrides(){return s._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(e){s._maximumNumberOfEditOVerrides=e}}}};e([_({constructOnly:!0})],v.prototype,"view",void 0),e([_({constructOnly:!0})],v.prototype,"layer",void 0),e([_({readOnly:!0})],v.prototype,"is3DOFL",null),e([_({readOnly:!0})],v.prototype,"geometryChangedObjectIds",null),e([_()],v.prototype,"_associatedLayer",null),e([_()],v.prototype,"_associatedLayerView",void 0),e([_({constructOnly:!0})],v.prototype,"memoryController",void 0),e([_()],v.prototype,"_changedObjectIds",void 0),e([_()],v.prototype,"_pendingFetchChangedObjectIds",void 0),e([_()],v.prototype,"_definitionExpression",null),e([_()],v.prototype,"updating",null),e([_()],v.prototype,"isEmpty",null),v=e([y("esri.views.3d.layers.i3s.I3SOverrides")],v);class L{constructor(e,t){this.objectId=e,this._options=t,this._updates=new Map,this._state=E.ACTIVE}get(e){return this._updates.get(e)}set(e,t){this._isActive&&this._updates.set(e,t)}rollback(){this._isActive&&(this._state=E.ROLLED_BACK,this._options.rollback())}commit(){this._isActive&&(this._state=E.COMMITTED,this._options.commit(this._updates),this._updates.clear())}get _isActive(){return this._state===E.ACTIVE}}var E;!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.COMMITTED=1]="COMMITTED",e[e.ROLLED_BACK=2]="ROLLED_BACK"}(E||(E={}));const A=1e4,F=5e4;export{v as I3SOverrides};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import s from"../../../../core/Accessor.js";import{remove as i,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import{resultOrAbort as n,result as a}from"../../../../core/asyncUtils.js";import{estimateStringByteSize as o,estimateNumberByteSize as c}from"../../../../core/byteSizeEstimations.js";import d from"../../../../core/Logger.js";import{destroyMaybe as h,abortMaybe as l}from"../../../../core/maybe.js";import{whenOrAbort as u}from"../../../../core/promiseUtils.js";import{watch as m,initial as g}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as _}from"../../../../core/accessorSupport/decorators/subclass.js";import{formatNumber as y}from"../../../../intl/number.js";import{getMaximumQuerySize as b,queryAllJSON as f}from"../../../../layers/support/featureQueryAll.js";import{direct3DObjectFeatureLayerDisplayEnabled as O,sceneLayerEditingEnabled as j}from"../../../../support/featureFlags.js";import C from"../FeatureLayerView3D.js";let I=class extends s{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._interactiveEditingSessions=null,this._maximumNumberOfEditOVerrides=A,this._original3DOFLDefinitionExpression=null,this._associatedLayerView=null,this._changedObjectIds=new Set,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController}initialize(){this._memCache=this.memoryController.newCache(`${this.layer.uid}-attribute-overrides`),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.then((()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})),this.is3DOFL&&O()&&null!=this._associatedLayer&&this._associatedLayer.load().then((e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(m((()=>this._definitionExpression),(t=>e.definitionExpression=t),g)),this._associatedLayerView=new C({layer:this._associatedLayer,view:this.view}))}))}destroy(){this.is3DOFL&&O()&&null!=this._associatedLayerView&&null!=this._associatedLayer&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression),this._set("layer",null),this._memCache=h(this._memCache),this._pendingFetchAbortController=l(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null}get is3DOFL(){return j()&&null!=this._associatedLayer&&null!=this._associatedLayer.infoFor3D}get geometryChangedObjectIds(){return this.is3DOFL?[...this._changedObjectIds]:[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get _definitionExpression(){const e=this.geometryChangedObjectIds;return 0===e.length?"1 = 0":`OBJECTID IN (${e.join(",")})`}get updating(){if(!this.is3DOFL)return!1;if(!O())return!1;return!(null!=this._associatedLayerView)||null!=this._associatedLayerView&&this._associatedLayerView.updating}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._changedObjectIds.size}createInteractiveEditSession(e){this._changedObjectIds.add(e),this.notifyChange("_changedObjectIds"),null==this._interactiveEditingSessions&&(this._interactiveEditingSessions=[]);const t=this._interactiveEditingSessions,s=new v(e,{rollback:()=>{i(t,s),0===t.length&&(this._interactiveEditingSessions=null)},commit:t=>{for(const[s,i]of t)this.updateAttributeValue(e,s,i)}});return t.unshift(s),s}async apply(e,t,s){if(null==t)return;const{loadedAttributes:i,attributeData:r}=t;if(null==i||0===i.length||null==r)return;if(this._pendingFetchChangedObjectIds&&await u(this._pendingFetchChangedObjectIds,s),0===this._changedObjectIds.size)return;const n={loadedAttributes:i,attributeData:r},a=this._getOverridesFromCache(e,n,this._changedObjectIds),{objectIds:o,fieldNames:c}=a;if(0===o.length||0===c.length)return;const d=await this._queryOverridesFromAssociatedLayer(o,c,s);null!=d&&this._processOverridesFromAssociatedLayer(e,d,c,n)}updateGeometry(e){this._changedObjectIds.add(e),this.notifyChange("_changedObjectIds")}updateAttributeValue(e,t,s){this._changedObjectIds.add(e),this._cacheAttributeValue(e,t,s),this.notifyChange("_changedObjectIds")}_cacheAttributeValue(e,t,s){this._memCache.put(this._getAttributeCacheKey(e,t),s,this._memCacheAttributeValueSize(s))}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:s},i){const r=new Set,n=new Array;for(const o of t)n[o.index]=s[o.name];const a=new Set;for(let o=0;o<e.length;o++){const s=e[o];if(i.has(s))for(const e of t){const t=this._fromCache(s,e.index);void 0===t?(r.add(s),a.add(e.name)):n[e.index][o]=t}}return{objectIds:Array.from(r),fieldNames:Array.from(a)}}_fromCache(e,t){const s=this._fromInteractiveEditingSession(e,t);if(void 0!==s)return s;const i=this._getAttributeCacheKey(e,t);return this._memCache.get(i)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const s of this._interactiveEditingSessions){if(s.objectId!==e)continue;const i=s.get(t);if(void 0!==i)return i}}_getAttributeCacheKey(e,t){return`${e}-${t}`}async _queryOverridesFromAssociatedLayer(e,t,s){if(0===e.length||0===t.length)return null;e=e.sort(((e,t)=>e-t)),this._warnMaximumChangedObjectsExceeded&&(this._warnMaximumChangedObjectsExceeded=!1,this._logMaximumObjectsExceededWarning());const i=this.layer.associatedLayer;if(null==i)return null;const a=i.createQuery();a.where="1=1",a.returnGeometry=!1,a.outFields=[i.objectIdField,...t],a.cacheHint=!0,a.objectIds=e;const o=b(i),c=e.length>o?r(e,o).map((e=>{const t=a.clone();return t.objectIds=e,n(f(i,t,{signal:s}))})):[n(f(i,a,{signal:s}))];return(await Promise.all(c)).reduce(((e,t)=>e.concat(t.ok?t.value.features:[])),[])}_logMaximumObjectsExceededWarning(){let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${y(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;t&&t.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,d.getLogger("esri.views.3d.layers.i3s.I3SOverrides").warn("#queryOverrides()",this.layer.title,`${e}.`)}_processOverridesFromAssociatedLayer(e,t,s,{loadedAttributes:i,attributeData:r}){const n=this.layer.associatedLayer;if(null==n)return;const a=n.objectIdField,o=s.map((e=>r[e])),c=new Map(i.map((e=>[e.name,e.index]))),d=s.map((e=>c.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[a];for(let t=0;t<s.length;t++){const i=d[t],r=h.get(e),n=l.attributes[s[t]];o[t][r]=n,this._cacheAttributeValue(e,i,n)}}}_memCacheAttributeValueSize(e){return"string"==typeof e?o(e):c()}async _fetchChangedObjectIds(e){const s=this.layer;if(await s.load({signal:e}),this._changedObjectIds.clear(),null==s.associatedLayer||!s.associatedLayer.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const r=s.associatedLayer.layerId,n=null!=s.associatedLayer.infoFor3D,o=await a(t(`${s.associatedLayer.url}/extractChanges`,{method:"post",query:{f:"json",returnIdsOnly:!0,layers:`[${r}]`,returnUpdates:!0,returnDeletes:n,returnInserts:n,layerServerGens:JSON.stringify([{id:r,serverGen:i}])},timeout:E,signal:e}));if(o.ok&&1===o.value.data?.edits?.length){const e=o.value.data.edits[0]?.objectIds,t=e?.adds,s=e?.updates,i=e?.deletes;let r=[];null!=t&&(r=r.concat(t)),null!=s&&(r=r.concat(s)),null!=i&&(r=r.concat(i));const n=Math.min(this._maximumNumberOfEditOVerrides,r.length);n<r.length&&(this._warnMaximumChangedObjectsExceeded=!0);const a=r.sort(((e,t)=>e-t));for(let o=0;o<n;o++)this._changedObjectIds.add(a[o])}this.notifyChange("_changedObjectIds")}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp&&null!=e.serviceUpdateTimeStamp.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t&&null!=t.serverGens&&null!=t.serverGens.minServerGen?t.serverGens.minServerGen:null}get test(){const e=Array.from(this._changedObjectIds),t=this._pendingFetchChangedObjectIds,s=this;return{changedObjectIds:e,pendingFetchChangedObjectIds:t,get maximumNumberOfEditOVerrides(){return s._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(e){s._maximumNumberOfEditOVerrides=e}}}};e([p({constructOnly:!0})],I.prototype,"view",void 0),e([p({constructOnly:!0})],I.prototype,"layer",void 0),e([p({readOnly:!0})],I.prototype,"is3DOFL",null),e([p({readOnly:!0})],I.prototype,"geometryChangedObjectIds",null),e([p()],I.prototype,"_associatedLayer",null),e([p()],I.prototype,"_associatedLayerView",void 0),e([p({constructOnly:!0})],I.prototype,"memoryController",void 0),e([p()],I.prototype,"_changedObjectIds",void 0),e([p()],I.prototype,"_pendingFetchChangedObjectIds",void 0),e([p()],I.prototype,"_definitionExpression",null),e([p()],I.prototype,"updating",null),e([p()],I.prototype,"isEmpty",null),I=e([_("esri.views.3d.layers.i3s.I3SOverrides")],I);class v{constructor(e,t){this.objectId=e,this._options=t,this._updates=new Map,this._state=L.ACTIVE}get(e){return this._updates.get(e)}set(e,t){this._isActive&&this._updates.set(e,t)}rollback(){this._isActive&&(this._state=L.ROLLED_BACK,this._options.rollback())}commit(){this._isActive&&(this._state=L.COMMITTED,this._options.commit(this._updates),this._updates.clear())}get _isActive(){return this._state===L.ACTIVE}}var L;!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.COMMITTED=1]="COMMITTED",e[e.ROLLED_BACK=2]="ROLLED_BACK"}(L||(L={}));const E=1e4,A=5e4;export{I as I3SOverrides};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- function t(t){const e=t.renderer,n=e?.type,o=e?.toJSON()??null;let l=null,i=!1;const a=t.attributeStorageInfo;"point-cloud-unique-value"===n||"point-cloud-stretch"===n||"point-cloud-class-breaks"===n?l=u(a,e.field):"point-cloud-rgb"===n?(l=r(a,e.field),i=null!=l):(l=r(a,"RGB"),i=null!=l);let s=null;return e?.colorModulation&&(s=u(a,e.colorModulation.field)),{rendererJSON:o,isRGBRenderer:i,primaryAttribute:l,modulationAttribute:s}}function e(t){const e=t.filters;return e?e.map((e=>({filterJSON:e.toJSON(),attributeInfo:u(t.attributeStorageInfo,e.field)}))):[]}function n(t){const e=t?.pointSizeAlgorithm;return e&&"splat"===e.type?e:null}function o(t){const e=t?.pointSizeAlgorithm;return e&&"fixed-size"===e.type?e:null}function l(t){const e=t?.pointSizeAlgorithm;return!(!e||!e.type)&&"fixed-size"===e.type}function r(t,e){for(const n of t??[])if(n.name===e&&null!=n.attributeValues&&"UInt8"===n.attributeValues.valueType&&3===n.attributeValues.valuesPerElement)return{name:e,storageInfo:n,useElevation:!1};return null}function u(t,e){for(const n of t??[])if(n.name===e){const t="embedded-elevation"===n.encoding;return{name:e,storageInfo:t?null:n,useElevation:t}}return"elevation"===e?.toLowerCase()?{name:e,storageInfo:null,useElevation:!0}:null}export{u as getAttributeInfo,e as getFilterInfo,o as getFixedSizeAlgorithm,t as getRendererInfo,n as getSplatSizeAlgorithm,l as rendererUsesFixedSizes};
5
+ function t(t){const e=t.renderer,n=e?.type,o=e?.toJSON()??null;let l=null,i=!1;const a=t.attributeStorageInfo;"point-cloud-unique-value"===n||"point-cloud-stretch"===n||"point-cloud-class-breaks"===n?l=u(a,e.field):"point-cloud-rgb"===n?(l=r(a,e.field),i=null!=l):(l=r(a,"RGB"),i=null!=l);let s=null;return e?.colorModulation&&(s=u(a,e.colorModulation.field)),{rendererJSON:o,isRGBRenderer:i,primaryAttribute:l,modulationAttribute:s}}function e(t){const e=t.filters;return e?e.map((e=>({filterJSON:e.toJSON(),attributeInfo:u(t.attributeStorageInfo,e.field)}))):[]}function n(t){const e=t?.pointSizeAlgorithm;return e&&"splat"===e.type?e:null}function o(t){const e=t?.pointSizeAlgorithm;return e&&"fixed-size"===e.type?e:null}function l(t){const e=t?.pointSizeAlgorithm;return!(!e||!e.type)&&"fixed-size"===e.type}function r(t,e){for(const n of t??[])if(n.name===e&&null!=n.attributeValues&&"UInt8"===n.attributeValues.valueType&&3===n.attributeValues.valuesPerElement)return{name:e,storageInfo:n,useElevation:!1};return null}function u(t,e){for(const n of t??[])if(n.name===e){const t="embedded-elevation"===n.encoding;return t?{name:e,storageInfo:null,useElevation:t}:{name:e,storageInfo:n,useElevation:t}}return"elevation"===e?.toLowerCase()?{name:e,storageInfo:null,useElevation:!0}:null}export{u as getAttributeInfo,e as getFilterInfo,o as getFixedSizeAlgorithm,t as getRendererInfo,n as getSplatSizeAlgorithm,l as rendererUsesFixedSizes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../renderers/PointCloudClassBreaksRenderer.js";import o from"../../../../renderers/PointCloudStretchRenderer.js";import r from"../../../../renderers/PointCloudUniqueValueRenderer.js";import{createGeometryIndexFromSchema as t,createTypedView as l,readBinaryAttribute as n}from"./I3SBinaryReader.js";import{decodeXYZ as s}from"./LEPCC.js";function i(t,l,n,s){const{rendererJSON:i,isRGBRenderer:u}=t;let f=null,c=null;if(l&&u)f=l;else if(l&&"pointCloudUniqueValueRenderer"===i?.type){c=r.fromJSON(i);const e=c.colorUniqueValueInfos;f=new Uint8Array(3*s);const o=d(c.fieldTransformType);for(let r=0;r<s;r++){const t=(o?o(l[r]):l[r])+"";for(let o=0;o<e.length;o++)if(e[o].values.includes(t)){f[3*r]=e[o].color.r,f[3*r+1]=e[o].color.g,f[3*r+2]=e[o].color.b;break}}}else if(l&&"pointCloudStretchRenderer"===i?.type){c=o.fromJSON(i);const e=c.stops;f=new Uint8Array(3*s);const r=d(c.fieldTransformType);for(let o=0;o<s;o++){const t=r?r(l[o]):l[o],n=e.length-1;if(t<e[0].value)f[3*o]=e[0].color.r,f[3*o+1]=e[0].color.g,f[3*o+2]=e[0].color.b;else if(t>=e[n].value)f[3*o]=e[n].color.r,f[3*o+1]=e[n].color.g,f[3*o+2]=e[n].color.b;else for(let r=1;r<e.length;r++)if(t<e[r].value){const l=(t-e[r-1].value)/(e[r].value-e[r-1].value);f[3*o]=e[r].color.r*l+e[r-1].color.r*(1-l),f[3*o+1]=e[r].color.g*l+e[r-1].color.g*(1-l),f[3*o+2]=e[r].color.b*l+e[r-1].color.b*(1-l);break}}}else if(l&&"pointCloudClassBreaksRenderer"===i?.type){c=e.fromJSON(i);const o=c.colorClassBreakInfos;f=new Uint8Array(3*s);const r=d(c.fieldTransformType);for(let e=0;e<s;e++){const t=r?r(l[e]):l[e];for(let r=0;r<o.length;r++)if(t>=o[r].minValue&&t<=o[r].maxValue){f[3*e]=o[r].color.r,f[3*e+1]=o[r].color.g,f[3*e+2]=o[r].color.b;break}}}else{f=new Uint8Array(3*s);for(let e=0;e<f.length;e++)f[e]=255}if(n&&c&&c.colorModulation){const e=c.colorModulation.minValue,o=c.colorModulation.maxValue,r=.3;for(let t=0;t<s;t++){const l=n[t],s=l>=o?1:l<=e?r:r+(1-r)*(l-e)/(o-e);f[3*t]=s*f[3*t],f[3*t+1]=s*f[3*t+1],f[3*t+2]=s*f[3*t+2]}}return f}function u(e,o){if(null==e.encoding||""===e.encoding){const r=t(o,e);if(null==r.vertexAttributes.position)return;const n=l(o,r.vertexAttributes.position),s=r.header.fields,i=[s.offsetX,s.offsetY,s.offsetZ],u=[s.scaleX,s.scaleY,s.scaleZ],f=n.length/3,c=new Float64Array(3*f);for(let e=0;e<f;e++)c[3*e]=n[3*e]*u[0]+i[0],c[3*e+1]=n[3*e+1]*u[1]+i[1],c[3*e+2]=n[3*e+2]*u[2]+i[2];return c}if("lepcc-xyz"===e.encoding)return s(o).result}function f(e,o,r){return null!=e&&e.attributeInfo.useElevation?o?c(o,r):null:null!=e&&e.attributeInfo.storageInfo?n(e.attributeInfo.storageInfo,e.buffer,r):null}function c(e,o){const r=new Float64Array(o);for(let t=0;t<o;t++)r[t]=e[3*t+2];return r}function a(e,o,r,t,l){const n=e.length/3;let s=0;for(let i=0;i<n;i++){let n=!0;for(let e=0;e<t.length&&n;e++){const{filterJSON:o}=t[e],r=l[e].values[i];switch(o.type){case"pointCloudValueFilter":{const e="exclude"===o.mode;o.values.includes(r)===e&&(n=!1);break}case"pointCloudBitfieldFilter":{const e=b(o.requiredSetBits),t=b(o.requiredClearBits);(r&e)===e&&0==(r&t)||(n=!1);break}case"pointCloudReturnFilter":{const e=15&r,t=r>>>4&15,l=t>1,s=1===e,i=e===t;let u=!1;for(const r of o.includedReturns)if("last"===r&&i||"firstOfMany"===r&&s&&l||"lastOfMany"===r&&i&&l||"single"===r&&!l){u=!0;break}u||(n=!1);break}}}n&&(r[s]=i,e[3*s]=e[3*i],e[3*s+1]=e[3*i+1],e[3*s+2]=e[3*i+2],o[3*s]=o[3*i],o[3*s+1]=o[3*i+1],o[3*s+2]=o[3*i+2],s++)}return s}function d(e){return null==e||"none"===e?null:"low-four-bit"===e?e=>15&e:"high-four-bit"===e?e=>(240&e)>>4:"absolute-value"===e?e=>Math.abs(e):"modulo-ten"===e?e=>e%10:null}function b(e){let o=0;for(const r of e||[])o|=1<<r;return o}export{c as elevationFromPositions,i as evaluateRenderer,a as filterInPlace,f as getAttributeValues,u as readGeometry};
5
+ import"../../../../core/has.js";import e from"../../../../renderers/PointCloudClassBreaksRenderer.js";import r from"../../../../renderers/PointCloudStretchRenderer.js";import o from"../../../../renderers/PointCloudUniqueValueRenderer.js";import{createGeometryIndexFromSchema as t,createTypedView as n,readBinaryAttribute as l}from"./I3SBinaryReader.js";import{decodeXYZ as s}from"./LEPCC.js";function i(t,n,l,s){const{rendererJSON:i,isRGBRenderer:u}=t;let c=null,a=null;if(n&&u)c=n;else if(n&&"pointCloudUniqueValueRenderer"===i?.type){a=o.fromJSON(i);const e=a.colorUniqueValueInfos;c=new Uint8Array(3*s);const r=d(a.fieldTransformType);for(let o=0;o<s;o++){const t=(r?r(n[o]):n[o])+"";for(let r=0;r<e.length;r++)if(e[r].values.includes(t)){c[3*o]=e[r].color.r,c[3*o+1]=e[r].color.g,c[3*o+2]=e[r].color.b;break}}}else if(n&&"pointCloudStretchRenderer"===i?.type){a=r.fromJSON(i);const e=a.stops;c=new Uint8Array(3*s);const o=d(a.fieldTransformType);for(let r=0;r<s;r++){const t=o?o(n[r]):n[r],l=e.length-1;if(t<e[0].value)c[3*r]=e[0].color.r,c[3*r+1]=e[0].color.g,c[3*r+2]=e[0].color.b;else if(t>=e[l].value)c[3*r]=e[l].color.r,c[3*r+1]=e[l].color.g,c[3*r+2]=e[l].color.b;else for(let o=1;o<e.length;o++)if(t<e[o].value){const n=(t-e[o-1].value)/(e[o].value-e[o-1].value);c[3*r]=e[o].color.r*n+e[o-1].color.r*(1-n),c[3*r+1]=e[o].color.g*n+e[o-1].color.g*(1-n),c[3*r+2]=e[o].color.b*n+e[o-1].color.b*(1-n);break}}}else if(n&&"pointCloudClassBreaksRenderer"===i?.type){a=e.fromJSON(i);const r=a.colorClassBreakInfos;c=new Uint8Array(3*s);const o=d(a.fieldTransformType);for(let e=0;e<s;e++){const t=o?o(n[e]):n[e];for(let o=0;o<r.length;o++)if(t>=r[o].minValue&&t<=r[o].maxValue){c[3*e]=r[o].color.r,c[3*e+1]=r[o].color.g,c[3*e+2]=r[o].color.b;break}}}else c=new Uint8Array(3*s).fill(255);if(l&&a&&a.colorModulation){const e=a.colorModulation.minValue,r=a.colorModulation.maxValue,o=.3;for(let t=0;t<s;t++){const n=l[t],s=n>=r?1:n<=e?o:o+(1-o)*(n-e)/(r-e);c[3*t]=s*c[3*t],c[3*t+1]=s*c[3*t+1],c[3*t+2]=s*c[3*t+2]}}return c}function u(e,r){if(null==e.encoding||""===e.encoding){const o=t(r,e);if(null==o.vertexAttributes.position)return;const l=n(r,o.vertexAttributes.position),s=o.header.fields,i=[s.offsetX,s.offsetY,s.offsetZ],u=[s.scaleX,s.scaleY,s.scaleZ],c=l.length/3,a=new Float64Array(3*c);for(let e=0;e<c;e++)a[3*e]=l[3*e]*u[0]+i[0],a[3*e+1]=l[3*e+1]*u[1]+i[1],a[3*e+2]=l[3*e+2]*u[2]+i[2];return a}if("lepcc-xyz"===e.encoding)return s(r).result}function c(e,r,o){return null!=e&&e.attributeInfo.useElevation?r?a(r,o):null:null!=e&&e.attributeInfo.storageInfo?l(e.attributeInfo.storageInfo,e.buffer,o):null}function a(e,r){const o=new Float64Array(r);for(let t=0;t<r;t++)o[t]=e[3*t+2];return o}function f(e,r,o,t,n){const l=e.length/3;let s=0;for(let i=0;i<l;i++){let l=!0;for(let e=0;e<t.length&&l;e++){const{filterJSON:r}=t[e],o=n[e].values[i];switch(r.type){case"pointCloudValueFilter":{const e="exclude"===r.mode;r.values.includes(o)===e&&(l=!1);break}case"pointCloudBitfieldFilter":{const e=p(r.requiredSetBits),t=p(r.requiredClearBits);(o&e)===e&&0==(o&t)||(l=!1);break}case"pointCloudReturnFilter":{const e=15&o,t=o>>>4&15,n=t>1,s=1===e,i=e===t;let u=!1;for(const o of r.includedReturns)if("last"===o&&i||"firstOfMany"===o&&s&&n||"lastOfMany"===o&&i&&n||"single"===o&&!n){u=!0;break}u||(l=!1);break}}}l&&(o[s]=i,e[3*s]=e[3*i],e[3*s+1]=e[3*i+1],e[3*s+2]=e[3*i+2],r[3*s]=r[3*i],r[3*s+1]=r[3*i+1],r[3*s+2]=r[3*i+2],s++)}return s}function d(e){switch(e){default:case null:case"none":return e=>e;case"low-four-bit":return e=>15&e;case"high-four-bit":return e=>(240&e)>>4;case"absolute-value":return e=>Math.abs(e);case"modulo-ten":return e=>e%10}}function p(e){let r=0;for(const o of e||[])r|=1<<o;return r}export{a as elevationFromPositions,i as evaluateRenderer,f as filterInPlace,c as getAttributeValues,u as readGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../../chunks/tslib.es6.js";import o from"../../../../Graphic.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";let t=class extends o{constructor(r){super(r)}};r([s({constructOnly:!0,clonable:"reference"})],t.prototype,"pointCloudMetadata",void 0),t=r([e("esri.views.3d.layers.i3s.PointGraphic")],t);export{t as PointGraphic};
5
+ import{_ as r}from"../../../../chunks/tslib.es6.js";import o from"../../../../Graphic.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";let e=class extends o{constructor(r){super(r),this.pointCloudMetadata=null}};r([s({constructOnly:!0,clonable:"reference"})],e.prototype,"pointCloudMetadata",void 0),e=r([t("esri.views.3d.layers.i3s.PointGraphic")],e);export{e as PointGraphic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Evented.js";import{when as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{afterDispatch as s}from"../../../core/accessorSupport/watch.js";import{f as n}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import p from"../../ViewAnimation.js";import{ViewingMode as c}from"../../ViewingMode.js";import{Constraints as m}from"./Constraints.js";import{AnimationController as h}from"./controllers/AnimationController.js";import{State as d}from"./controllers/CameraController.js";import{PropertiesPool as u}from"../support/PropertiesPool.js";import{Camera as g,PaddingSide as C}from"../webgl-engine/lib/Camera.js";import{RenderState as y}from"../../support/RenderState.js";let _=class extends t{constructor(){super(...arguments),this._propertiesPool=new u({camera:g},this),this._lastSeenCameraProjectionValues=new g,this.mode=y.ANIMATING,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.events=new r,this.viewingMode=c.Global,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}init(e,t){this._set("viewingMode",e),this._set("spatialReference",t),this._set("constraints",new m({mode:this.viewingMode}))}exit(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new u({camera:g},this)}createInitialCamera(){if(this.viewingMode===c.Global){const e=l(this.spatialReference).radius;this.camera=new g({eye:n(4*e,0,0),center:n(e,0,0),up:n(0,0,1)})}else this.camera=new g({eye:n(0,0,100),center:n(0,0,0),up:n(0,1,0)})}get animation(){return this.cameraController instanceof h&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get camera(){return this._get("camera")}set camera(e){e!==v&&v.copyFrom(e),v.computeUp(this.viewingMode),this.events.emit("before-camera-change",v);const t=this._get("camera");if(this._cameraProjectionChanged(this._lastSeenCameraProjectionValues,v)&&(this._lastSeenCameraProjectionValues.copyFrom(v),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),(!t||!t.equals(v))&&(this._set("camera",this._propertiesPool.get("camera").copyFrom(v)),this._cameraChanged=!t||!t.almostEquals(v),this._cameraChanged)){const e=s((()=>{this._cameraChanged=!1,e.remove()}))}}get pixelRatio(){return this.camera.pixelRatio}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){this._contentCamera=null!=e?e.clone():null}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return this.viewingMode===c.Global}get isLocal(){return this.viewingMode===c.Local}get navigating(){return!(!this.cameraController||!this.cameraController.isInteractive)}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(e&&(this.removeHandles(w),this.addHandles(o((()=>e.state===d.Finished||e.state===d.Stopped),(()=>{this._set("cameraController",null),this.updateCamera((t=>e.onControllerEnd(t)))}),{sync:!0,once:!0}),w),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=d.Rejected)}switchCameraController(e){return this.cameraController=e,e.state!==d.Rejected}stopActiveCameraController(){return!(this.cameraController&&!this.cameraController.stopController())}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();v.copyFrom(this._get("camera")),e(v),this.camera=v,this._processingUpdates=!1,this._processUpdateQueue()}_cameraProjectionChanged(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[C.TOP]!==t.padding[C.TOP]||e.padding[C.RIGHT]!==t.padding[C.RIGHT]||e.padding[C.BOTTOM]!==t.padding[C.BOTTOM]||e.padding[C.LEFT]!==t.padding[C.LEFT]))}};e([a()],_.prototype,"mode",void 0),e([a({readOnly:!0,type:p})],_.prototype,"animation",null),e([a({type:g})],_.prototype,"camera",null),e([a({readOnly:!0})],_.prototype,"pixelRatio",null),e([a()],_.prototype,"rasterPixelRatio",void 0),e([a()],_.prototype,"contentPixelRatio",void 0),e([a({})],_.prototype,"_contentCamera",void 0),e([a({type:g})],_.prototype,"contentCamera",null),e([a({readOnly:!0})],_.prototype,"fixedContentCamera",null),e([a({readOnly:!0})],_.prototype,"constraints",void 0),e([a({readOnly:!0})],_.prototype,"events",void 0),e([a({readOnly:!0})],_.prototype,"isGlobal",null),e([a({readOnly:!0})],_.prototype,"isLocal",null),e([a({readOnly:!0})],_.prototype,"viewingMode",void 0),e([a({readOnly:!0})],_.prototype,"spatialReference",void 0),e([a()],_.prototype,"navigating",null),e([a()],_.prototype,"stationary",null),e([a()],_.prototype,"_cameraChanged",void 0),e([a()],_.prototype,"cameraController",null),_=e([i("esri.views.3d.state.ViewState")],_);const f=_,v=new g,w="ViewStateHandles";export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Evented.js";import{when as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{afterDispatch as s}from"../../../core/accessorSupport/watch.js";import{f as n}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import p from"../../ViewAnimation.js";import{ViewingMode as c}from"../../ViewingMode.js";import{Constraints as m}from"./Constraints.js";import{AnimationController as h}from"./controllers/AnimationController.js";import{State as d}from"./controllers/CameraController.js";import{PropertiesPool as u}from"../support/PropertiesPool.js";import{Camera as C,PaddingSide as g}from"../webgl-engine/lib/Camera.js";import{RenderState as y}from"../../support/RenderState.js";let _=class extends t{constructor(){super(...arguments),this._propertiesPool=new u({camera:C},this),this._lastSeenCameraProjectionValues=new C,this.mode=y.ANIMATING,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.events=new r,this.viewingMode=c.Global,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}init(e,t){this._set("viewingMode",e),this._set("spatialReference",t),this._set("constraints",new m({mode:this.viewingMode}))}exit(){this.cameraController?.destroy(),this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new u({camera:C},this)}destroy(){this.cameraController?.destroy(),this.cameraController=null,this._propertiesPool?.destroy(),this._propertiesPool=null}createInitialCamera(){if(this.viewingMode===c.Global){const e=l(this.spatialReference).radius;this.camera=new C({eye:n(4*e,0,0),center:n(e,0,0),up:n(0,0,1)})}else this.camera=new C({eye:n(0,0,100),center:n(0,0,0),up:n(0,1,0)})}get animation(){return this.cameraController instanceof h&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get camera(){return this._get("camera")}set camera(e){e!==v&&v.copyFrom(e),v.computeUp(this.viewingMode),this.events.emit("before-camera-change",v);const t=this._get("camera");if(this._cameraProjectionChanged(this._lastSeenCameraProjectionValues,v)&&(this._lastSeenCameraProjectionValues.copyFrom(v),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),(!t||!t.equals(v))&&(this._set("camera",this._propertiesPool.get("camera").copyFrom(v)),this._cameraChanged=!t||!t.almostEquals(v),this._cameraChanged)){const e=s((()=>{this._cameraChanged=!1,e.remove()}))}}get pixelRatio(){return this.camera.pixelRatio}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){this._contentCamera=null!=e?e.clone():null}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return this.viewingMode===c.Global}get isLocal(){return this.viewingMode===c.Local}get navigating(){return!(!this.cameraController||!this.cameraController.isInteractive)}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(this.cameraController?.destroy(),e&&(this.removeHandles(w),this.addHandles(o((()=>e.state===d.Finished||e.state===d.Stopped),(()=>{this._set("cameraController",null),this.updateCamera((t=>e.onControllerEnd(t)))}),{sync:!0,once:!0}),w),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=d.Rejected)}switchCameraController(e){return this.cameraController=e,e.state!==d.Rejected}stopActiveCameraController(){return!(this.cameraController&&!this.cameraController.stopController())}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();v.copyFrom(this._get("camera")),e(v),this.camera=v,this._processingUpdates=!1,this._processUpdateQueue()}_cameraProjectionChanged(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[g.TOP]!==t.padding[g.TOP]||e.padding[g.RIGHT]!==t.padding[g.RIGHT]||e.padding[g.BOTTOM]!==t.padding[g.BOTTOM]||e.padding[g.LEFT]!==t.padding[g.LEFT]))}};e([a()],_.prototype,"mode",void 0),e([a({readOnly:!0,type:p})],_.prototype,"animation",null),e([a({type:C})],_.prototype,"camera",null),e([a({readOnly:!0})],_.prototype,"pixelRatio",null),e([a()],_.prototype,"rasterPixelRatio",void 0),e([a()],_.prototype,"contentPixelRatio",void 0),e([a({})],_.prototype,"_contentCamera",void 0),e([a({type:C})],_.prototype,"contentCamera",null),e([a({readOnly:!0})],_.prototype,"fixedContentCamera",null),e([a({readOnly:!0})],_.prototype,"constraints",void 0),e([a({readOnly:!0})],_.prototype,"events",void 0),e([a({readOnly:!0})],_.prototype,"isGlobal",null),e([a({readOnly:!0})],_.prototype,"isLocal",null),e([a({readOnly:!0})],_.prototype,"viewingMode",void 0),e([a({readOnly:!0})],_.prototype,"spatialReference",void 0),e([a()],_.prototype,"navigating",null),e([a()],_.prototype,"stationary",null),e([a()],_.prototype,"_cameraChanged",void 0),e([a()],_.prototype,"cameraController",null),_=e([i("esri.views.3d.state.ViewState")],_);const f=_,v=new C,w="ViewStateHandles";export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Handles.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{eyeWithinExtent as o}from"../../camera/intersectionUtils.js";import{applySurfaceCollisionConstraint as a,Mode as i}from"../../camera/constraintUtils/surfaceCollision.js";import{CameraController as n,State as l}from"./CameraController.js";let c=class extends n{set desiredCamera(e){this._set("desiredCamera",e.clone())}constructor(e){super(e),this._handles=new r}get canStop(){return!0}get constraintEnabled(){return this.view.state.constraints.collision.enabled}onControllerStart(){this.state=l.Running,this._handles.add(this.view.basemapTerrain.on("elevation-change",(e=>this._handleElevationChangeEvent(e)))),this._applyCorrection()}onControllerEnd(){this._handles.removeAll()}stepController(){}_handleElevationChangeEvent(e){(null==e.spatialReference||o(this.view,this.desiredCamera,e.extent,e.spatialReference))&&this._applyCorrection()}_applyCorrection(){this.view.state.updateCamera((e=>{e.copyViewFrom(this.desiredCamera),a(this.view,e,i.EYE_AND_CENTER)||this.constraintEnabled||(this.state=l.Stopped)}))}};e([t({constructOnly:!0})],c.prototype,"desiredCamera",null),c=e([s("esri.views.3d.state.controllers.SurfaceCollisionCorrectionController")],c);export{c as SurfaceCollisionCorrectionController};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{eyeWithinExtent as s}from"../../camera/intersectionUtils.js";import{applySurfaceCollisionConstraint as o,Mode as a}from"../../camera/constraintUtils/surfaceCollision.js";import{CameraController as i,State as n}from"./CameraController.js";let l=class extends i{set desiredCamera(e){this._set("desiredCamera",e.clone())}constructor(e){super(e)}get canStop(){return!0}get constraintEnabled(){return this.view.state.constraints.collision.enabled}onControllerStart(){this.state=n.Running,this.addHandles(this.view.basemapTerrain.on("elevation-change",(e=>this._handleElevationChangeEvent(e)))),this._applyCorrection()}onControllerEnd(){this.removeAllHandles()}stepController(){}_handleElevationChangeEvent(e){(null==e.spatialReference||s(this.view,this.desiredCamera,e.extent,e.spatialReference))&&this._applyCorrection()}_applyCorrection(){this.view.state.updateCamera((e=>{e.copyViewFrom(this.desiredCamera),o(this.view,e,a.EYE_AND_CENTER)||this.constraintEnabled||(this.state=n.Stopped)}))}};e([t({constructOnly:!0})],l.prototype,"desiredCamera",null),l=e([r("esri.views.3d.state.controllers.SurfaceCollisionCorrectionController")],l);export{l as SurfaceCollisionCorrectionController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(){this.cornerTiles=[null,null,null,null],this.cornerTileSamplerVersions=[-1,-1,-1,-1]}}class l{constructor(){this.cornerNeighborData=[new e,new e,new e,new e],this.edgeResolutions=[-1,-1,-1,-1],this.edgePeerNeighbors=[null,null,null,null],this.edgePeerNeighborSamplerVersions=[-1,-1,-1,-1],this.cornerPeerNeighbors=[null,null,null,null]}}class s{constructor(){this.numVerticesPerSide=0,this.samplerData=null,this.clippingArea=null,this.wireframe=!1,this.shading=!1,this.samplerDataVersion=0,this.neighborData=new l}}export{e as CornerNeighborData,s as GeometryState,l as NeighborhoodData};
5
+ class e{constructor(){this.cornerTiles=[null,null,null,null],this.cornerTileSamplerVersions=[-1,-1,-1,-1]}}class l{constructor(){this.cornerNeighborData=[new e,new e,new e,new e],this.edgeResolutions=[-1,-1,-1,-1],this.edgePeerNeighbors=[null,null,null,null],this.edgePeerNeighborSamplerVersions=[-1,-1,-1,-1],this.cornerPeerNeighbors=[null,null,null,null]}}class r{constructor(){this.numVerticesPerSide=0,this.samplerData=null,this.clippingArea=null,this.wireframe=!1,this.samplerDataVersion=0,this.neighborData=new l}}export{e as CornerNeighborData,r as GeometryState,l as NeighborhoodData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../core/mathUtils.js";import{a as e}from"../../../chunks/vec2f64.js";import{a as s,n as i}from"../../../chunks/vec3.js";import{empty as r}from"../../../geometry/support/aaBoundingBox.js";import{BufferPool as n}from"../../../geometry/support/buffer/BufferPool.js";import{newLayout as o}from"../support/buffer/InterleavedLayout.js";import{internalAssert as u}from"./terrainUtils.js";import{VertexAttribute as a}from"../webgl-engine/lib/VertexAttribute.js";class l{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=r(),this.indexCount=0,this.numVerticesPerSide=0,this.uvRange=[0,0,1,1],this.outerEdges=[null,null,null,null],this.innerEdges=[null,null,null,null]}}class h{constructor(t,e,s,i,r){this.attributes=t,this.localOrigin=e,this.index0=s,this.stride=i,this.count=r}getVertexIndex(t){return this.getAttributeIndex(t)}getAttributeIndex(t){return u(0<=t&&t<this.count),this.index0+this.stride*t}_getVertexRaw(t,e){this.attributes.position.getVec(t,e)}_getNormalRaw(t,e){this.attributes.normalCompressed.getVec(t,e)}getVertexPos(t,e){this._getVertexRaw(this.getAttributeIndex(e),t),s(t,t,this.localOrigin)}getNormal(t,s){const i=e();this._getNormalRaw(this.getAttributeIndex(s),i),x(t,i)}_setNormal(t,e,s,i){d(this.attributes.normalCompressed,t,e,s,i)}_setUV(t,e,s){p(this.attributes.uv0,t,e,s)}setNormalFromValues(t,e,s,i){this._setNormal(this.getAttributeIndex(t),e,s,i)}setVertexFromValuesRawPositionUV(t,e,s,i,r,n){const o=this.getAttributeIndex(t);this.attributes.position.setValues(o,e,s,i),this._setUV(o,r,n)}setVertexFromValuesRawPositionUVNormal(t,e,s,i,r,n,o,u,a){const l=this.getAttributeIndex(t);this.attributes.position.setValues(l,e,s,i),this._setUV(l,r,n),this._setNormal(l,o,u,a)}}const c=o().vec3f(a.POSITION).vec2i16(a.UV0).vec2i16(a.NORMALCOMPRESSED,{glNormalized:!0}),m=new n((t=>c.createBuffer(t)),(t=>t.count));function b(){m.clear()}function g(t){return m.acquire(t)}function f(t){m.release(t.vertexAttributes),t.vertexAttributes=null,t.indices=null}function d(t,e,s,i,r){const n=1/(Math.abs(s)+Math.abs(i)+Math.abs(r)),o=s*n,u=i*n,a=r<=0?(o>=0?1:-1)*(1-Math.abs(u)):o,l=r<=0?(u>=0?1:-1)*(1-Math.abs(o)):u;t.setValues(e,A(a),A(l))}function x(t,e){const s=M(e[0]),r=M(e[1]),n=1-Math.abs(s)-Math.abs(r);t[2]=n,n<0?(t[0]=(s>=0?1:-1)*(1-Math.abs(r)),t[1]=(r>=0?1:-1)*(1-Math.abs(s))):(t[0]=s,t[1]=r),i(t,t)}const V=16384;function p(t,e,s,i){t.setValues(e,s*V,i*V)}function A(e){return t(Math.round(32767*e),-32767,32767)}function M(e){return t(e/32767,-1,1)}function v(t,e,s,i){t<i[0]?i[0]=t:t>i[3]&&(i[3]=t),e<i[1]?i[1]=e:e>i[4]&&(i[4]=e),s<i[2]?i[2]=s:s>i[5]&&(i[5]=s)}export{h as EdgeDescriptor,l as PatchGeometry,g as acquireTerrainAttributes,b as clearCaches,M as decodeInt16,x as decodeNormal,A as encodeInt16,d as encodeNormalInBuffer,p as encodeUVInBuffer,v as minMaxBoundingBox,f as releaseGeometry};
5
+ import{a as t}from"../../../chunks/vec3.js";import{empty as e}from"../../../geometry/support/aaBoundingBox.js";import{BufferPool as s}from"../../../geometry/support/buffer/BufferPool.js";import{newLayout as i}from"../support/buffer/InterleavedLayout.js";import{internalAssert as r}from"./terrainUtils.js";import{decompressNormal as n,compressNormal as o}from"../webgl-engine/lib/Normals.js";import{VertexAttribute as u}from"../webgl-engine/lib/VertexAttribute.js";class l{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=e(),this.indexCount=0,this.numVerticesPerSide=0,this.uvRange=[0,0,1,1],this.outerEdges=[null,null,null,null],this.innerEdges=[null,null,null,null]}}class a{constructor(t,e,s,i,r){this.attributes=t,this.localOrigin=e,this.index0=s,this.stride=i,this.count=r}getVertexIndex(t){return this.getAttributeIndex(t)}getAttributeIndex(t){return r(0<=t&&t<this.count),this.index0+this.stride*t}_getVertexRaw(t,e){this.attributes.position.getVec(t,e)}getVertexPos(e,s){this._getVertexRaw(this.getAttributeIndex(s),e),t(e,e,this.localOrigin)}getNormal(t,e){const{typedBuffer:s,typedBufferStride:i}=this.attributes.normalCompressed;n(t,s,this.getAttributeIndex(e),i)}_setNormal(t,e,s,i){const{typedBuffer:r,typedBufferStride:n}=this.attributes.normalCompressed;o(r,t,e,s,i,n)}_setUV(t,e,s){b(this.attributes.uv0,t,e,s)}setNormalFromValues(t,e,s,i){this._setNormal(this.getAttributeIndex(t),e,s,i)}setVertexFromValuesRawPositionUV(t,e,s,i,r,n){const o=this.getAttributeIndex(t);this.attributes.position.setValues(o,e,s,i),this._setUV(o,r,n)}setVertexFromValuesRawPositionUVNormal(t,e,s,i,r,n,o,u,l){const a=this.getAttributeIndex(t);this.attributes.position.setValues(a,e,s,i),this._setUV(a,r,n),this._setNormal(a,o,u,l)}}const h=i().vec3f(u.POSITION).vec2i16(u.UV0).vec2i16(u.NORMALCOMPRESSED,{glNormalized:!0}),c=new s((t=>h.createBuffer(t)),(t=>t.count));function m(){c.clear()}function d(t){return c.acquire(t)}function f(t){c.release(t.vertexAttributes),t.vertexAttributes=null,t.indices=null}const g=16384;function b(t,e,s,i){t.setValues(e,s*g,i*g)}function x(t,e,s,i){t<i[0]?i[0]=t:t>i[3]&&(i[3]=t),e<i[1]?i[1]=e:e>i[4]&&(i[4]=e),s<i[2]?i[2]=s:s>i[5]&&(i[5]=s)}export{a as EdgeDescriptor,l as PatchGeometry,d as acquireTerrainAttributes,m as clearCaches,b as encodeUVInBuffer,x as minMaxBoundingBox,f as releaseGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{isPowerOfTwo as t,clamp as e}from"../../../core/mathUtils.js";import{s as n}from"../../../chunks/vec4.js";import{empty as o}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as r}from"./ElevationData.js";import{PatchType as i,NeighborIndex as a}from"./interfaces.js";import{acquireTerrainAttributes as c,minMaxBoundingBox as l,encodeUVInBuffer as u,encodeNormalInBuffer as f,EdgeDescriptor as d}from"./PatchGeometry.js";import{PatchGeometryLUT as g}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as m}from"./PatchRenderData.js";import{ENABLE_TERRAIN_INTERNAL_CHECKS as p,internalAssert as h,neighborEdgeIndices as M,almostEquals as x}from"./terrainUtils.js";import{isCornerNeighbor as y}from"./Tile.js";import{compareTilesByLij as S}from"./tileUtils.js";const v=65536;function b(t,e){const n=t.tile,{extent:s,extentInRadians:r,surface:a}=n,d=t.localOrigin,g=t.geometryState,m=a.isWebMercator,M=g.numVerticesPerSide,x=M-1,y=(M-2)**2,S=m&&(e===i.HAS_SOUTH_POLE||e===i.HAS_BOTH_POLES),v=m&&(e===i.HAS_NORTH_POLE||e===i.HAS_BOTH_POLES),b=6,R=((S?1:0)+(v?1:0))*b*(x+1),B=g.neighborData,T=B.edgeResolutions.reduce(((t,e)=>t+e+1),0),D=c(y+R+T),A=t.geometry;A.numVerticesPerSide=g.numVerticesPerSide,A.vertexAttributes=D;const V=A.boundingBox;o(V);const U=E(t);X.update(x,r,U),L(t),k(t,y),O(t);const C=[];if((()=>{let t=y+T;const e=d[0],o=d[1],r=d[2],i=n.ellipsoid.radius,a=s[1],c=s[3],g=(n,s)=>{const d=s*M;l(-e,-o,n*i-r,V),C.push({connectedRowOffset:d,connectedOuterEdgeOffset:1===n?0:2,rowOffset:t,latitudeResolution:b});const g=P(-1===n?a:c,i),m=n*Math.PI/2-g,p=.99*(1===n?1:-1),h=i+0,y=D.position,S=D.uv0,v=D.normalCompressed;for(let i=1;i<=b;++i){const n=g+m*(i/b),s=Math.cos(n),a=Math.sin(n);for(let i=0;i<=x;i++){const n=i/x,c=X.sinLonLUT[i],d=X.cosLonLUT[i]*s,g=c*s,m=a,M=d*h-e,b=g*h-o,L=m*h-r;l(M,b,L,V),y.setValues(t,M,b,L),u(S,t,n,p),f(v,t,d,g,m),++t}}};S&&g(-1,0),v&&g(1,x)})(),F(A,g.numVerticesPerSide,C,[0,M-1],[0,M-1],g.wireframe),t.intersectionData=null,p)for(let o=0;o<4;++o)h(A.outerEdges[o].count===B.edgeResolutions[o]+1)}function L(t){const e=t.tile;if(!e.intersectsClippingArea)return;const n=t.geometryState,o=n.numVerticesPerSide,s=o-2,i=o-1,a=t.geometry,c=a.vertexAttributes,d=c.position,g=c.uv0,m=c.normalCompressed,p=e.extent,h=p[0],M=p[2],x=p[1],y=p[3],S=e.ellipsoid.radius,v=n.samplerData,b=t.localOrigin,L=b[0],R=b[1],B=b[2],O=d.typedBuffer,T=d.typedBufferStride,D=1/i,P=a.boundingBox;let A=0;if(1<=s){const t=D,e=x*(1-t)+y*t,n=X.sinLatLUT[1],o=X.cosLatLUT[1];for(let i=1;i<=s;i++){const s=i*D,a=h*(1-s)+M*s,c=X.sinLonLUT[i],f=X.cosLonLUT[i],d=S+r(a,e,v),m=d*f*o-L,p=d*c*o-R,x=d*n-B;l(m,p,x,P);const y=(i-1)*T;O[y]=m,O[y+1]=p,O[y+2]=x,u(g,i-1,s,t)}}for(let V=1;V<=s;V++){const t=V*D,e=x*(1-t)+y*t,n=X.sinLatLUT[V],o=X.cosLatLUT[V],a=V+1,c=a*D,d=x*(1-c)+y*c,p=X.sinLatLUT[a],b=X.cosLatLUT[a],E=X.sinLonLUT[0],U=X.cosLonLUT[0],C=S+r(h,e,v);let I=U*o*C-L,j=E*o*C-R,w=n*C-B;const N=A*T;let H=O[N],_=O[N+1],q=O[N+2];for(let y=1;y<=s;y++){const t=y*D,a=h*(1-t)+M*t,E=X.sinLonLUT[y],U=X.cosLonLUT[y];let C=0,N=0,W=0;if(y<s){const t=(A+1)*T;C=O[t],N=O[t+1],W=O[t+2]}else{const t=X.sinLonLUT[i],s=X.cosLonLUT[i],a=S+r(M,e,v);C=s*o*a-L,N=t*o*a-R,W=n*a-B}const F=I,k=j,z=w;I=H,j=_,w=q,H=C,_=N,q=W;const G=C-F,J=N-k,K=W-z;let Q=0,Y=0,Z=0;if(V>1){const t=(A-s)*T;Q=O[t],Y=O[t+1],Z=O[t+2]}else{const t=X.sinLatLUT[0],e=X.cosLatLUT[0],n=S+r(a,x,v);Q=U*e*n-L,Y=E*e*n-R,Z=t*n-B}const $=S+r(a,d,v),tt=U*b*$-L,et=E*b*$-R,nt=p*$-B;if(V<s){const e=A+s,n=e*T;O[n]=tt,O[n+1]=et,O[n+2]=nt,l(tt,et,nt,P),u(g,e,t,c)}const ot=Q-tt,st=Y-et,rt=Z-nt;let it=U*o,at=E*o,ct=n;ct*ct<.999&&(it=K*st-J*rt,at=G*rt-K*ot,ct=J*ot-G*st);const lt=1/Math.sqrt(it*it+at*at+ct*ct);f(m,A,it*lt,at*lt,ct*lt),++A}}}function R(t){t.tile.intersectsClippingArea&&(O(t),K(t))}function B(t){t.tile.intersectsClippingArea&&(D(t),T(t,!0),K(t))}function O(t){t.tile.intersectsClippingArea&&(D(t),T(t))}function T(e,n=!1){const o=e.geometryState,s=e.geometry,i=o.neighborData,a=e.tile,c=a.level,f=a.extent,d=a.ellipsoid.radius,g=a.extentInRadians,y=g[0],v=g[2],b=g[1],L=g[3],R=o.samplerData,B=f[0],O=f[2],T=f[1],D=f[3],P=E(e),A=s.boundingBox,V=e.localOrigin,U=V[0],C=V[1],I=V[2],j=s.vertexAttributes,w=j.position,N=w.typedBuffer,H=w.typedBufferStride,_=j.uv0;for(let E=0;E<4;++E){const o=1===E||3===E,g=i.edgeResolutions[E];h(t(g));const V=g+1,j=m(a,i.edgePeerNeighbors[E]);if($(a,j,E)){z(e,E,j);continue}const w=null!=j;h(!w||j.level===a.level),h(!w||S(a,j)<=0);const q=j?.renderData,W=q?.geometryState;if(p){const t=a.surface;if(!j&&t&&!t.updatingRootTiles){const e=M[E],n=a.findNeighborTile(e,(t=>t.isLoaded||t.isLeaf||t.level===a.level));n?n.intersectsClippingArea&&(h(!n.isLoaded),h(!n.isLeaf),h(n.level===c)):h(null==t?.rootTiles||!a.shouldHaveNeighbor(e))}}const F=1===E?f[2]:f[0],k=j?.extent,G=k&&o?1===E?k[0]:k[2]:F,J=0===E?f[3]:f[1],K=1===E?1:0,Q=0===E?1:0,X=1===E?v:y,Y=0===E?L:b,Z=Math.sin(X),tt=Math.cos(X),et=Math.sin(Y),nt=Math.cos(Y),ot=W?.samplerData,st=w?(t,e,n)=>.5*(r(t,e,R)+r(n,e,ot)):(t,e,n)=>r(t,e,R),rt=s.outerEdges[E],it=n&&V>3?V-3:1,at=null!=R&&R.some((t=>null!=t)),ct=null!=ot&&ot.some((t=>null!=t)),lt=at||ct,ut=1/g,ft=rt.index0;h(!k||x(k[2]-k[0],f[2]-f[0]));(()=>{const t=1===E?-1:3===E?1:0,e=0===E?-1:2===E?1:0,n=(f[2]-f[0])*ut,s=t*n,i=e*n,a=o?t*((v-y)*ut):0,c=o?0:e*ut,g=Q,m=o?X+a:X,p=o?Math.sin(m):Z,h=o?Math.cos(m):tt,M=o?X-a:X,x=o?Math.sin(M):Z,S=o?Math.cos(M):tt,b=o?Y:P(g+c),L=o?et:Math.sin(b),j=o?nt:Math.cos(b),q=o?Y:P(g-c),W=o?et:Math.sin(q),k=o?nt:Math.cos(q);let z=0,$=0,at=0;{const t=0*ut,e=o?F:B*(1-t)+O*t,n=o?G:e,s=o?T*(1-t)+D*t:J,r=o?X:y*(1-t)+v*t,i=o?Z:Math.sin(r),a=o?tt:Math.cos(r),c=o?P(t):Y,l=o?Math.sin(c):et,u=o?Math.cos(c):nt,f=d+st(e,s,n);z=a*u*f,$=i*u*f,at=l*f}let ct=0,dt=0,gt=0;{const t=1*ut,e=o?F:B*(1-t)+O*t,n=o?G:e,s=o?T*(1-t)+D*t:J,r=o?X:y*(1-t)+v*t,i=o?Z:Math.sin(r),a=o?tt:Math.cos(r),c=o?P(t):Y,l=o?Math.sin(c):et,u=o?Math.cos(c):nt,f=d+st(e,s,n);ct=a*u*f,dt=i*u*f,gt=l*f}for(let f=1;f<V-1;f+=it){let t=0,e=0,n=0;{const s=(f+1)*ut,r=o?F:B*(1-s)+O*s,i=o?G:r,a=o?T*(1-s)+D*s:J,c=o?X:y*(1-s)+v*s,l=o?Z:Math.sin(c),u=o?tt:Math.cos(c),g=o?P(s):Y,m=o?Math.sin(g):et,p=o?Math.cos(g):nt,h=d+st(r,a,i);t=u*p*h,e=l*p*h,n=m*h}const a=t,c=e,g=n,m=ct,M=dt,b=gt;ct=a,dt=c,gt=g;{const t=ft+f,e=t*H,n=m-U,s=M-C,r=b-I;N[e]=n,N[e+1]=s,N[e+2]=r,l(n,s,r,A);const i=f*ut;u(_,t,o?K:i,o?i:Q)}const V=z,q=$,it=at;z=m,$=M,at=b;const mt=m,pt=M,ht=b,Mt=1/Math.sqrt(mt*mt+pt*pt+ht*ht),xt=ht*Mt;let yt=0,St=0,vt=0;if(lt&&xt*xt<.999){let t=0,e=0,n=0;{const o=0===E?-1:1;t=o*(a-V),e=o*(c-q),n=o*(g-it)}{const a=f*ut,c=o?F:B*(1-a)+O*a,l=o?G:c,u=o?T*(1-a)+D*a:J,g=o?X:y*(1-a)+v*a,m=o?Z:Math.sin(g),M=o?tt:Math.cos(g),b=o?P(a):Y,A=o?Math.sin(b):et,V=o?Math.cos(b):nt;let U=mt,C=pt,I=ht;if(w){const t=d+r(l-s,u-i,ot),e=o?V:k;U=(o?S:M)*e*t,C=(o?x:m)*e*t,I=(o?A:W)*t}{const a=d+r(c+s,u+i,R),l=o?V:j,f=(o?h:M)*l*a,g=(o?p:m)*l*a,x=(o?A:L)*a;w||(U=2*mt-f,C=2*pt-g,I=2*ht-x);const y=3===E?-1:1,S=y*(U-f),v=y*(C-g),b=y*(I-x);yt=n*v-e*b,St=t*b-n*S,vt=e*S-t*v;const B=1/Math.sqrt(yt*yt+St*St+vt*vt);yt*=B,St*=B,vt*=B}}}else yt=mt*Mt,St=pt*Mt,vt=ht*Mt;rt.setNormalFromValues(f,yt,St,vt)}})()}}function D(t){G(t)}function P(t,e){return Math.PI/2-2*Math.atan(Math.exp(-t/e))}function A(t,e,n,o){return P(t*(1-o)+e*o,n)}function V(t,e,n){return t*(1-n)+e*n}function E(t){const e=t.tile;if(e.surface.isWebMercator){const t=e.extent,n=e.ellipsoid.radius;return e=>A(t[1],t[3],n,e)}const n=e.extentInRadians;return t=>V(n[1],n[3],t)}function U(t,e){const s=t.tile.extent,r=t.geometryState,i=s[0],a=s[1],l=s[2]-i,u=s[3]-a,f=r.clippingArea,d=null!=f?Math.max(0,(f[0]-i)/l):0,g=null!=f?Math.max(0,(f[1]-a)/u):0,m=null!=f?Math.min(1,(f[2]-i)/l):1,p=null!=f?Math.min(1,(f[3]-a)/u):1,h=r.numVerticesPerSide,M=(h-2)**2,x=r.neighborData.edgeResolutions.reduce(((t,e)=>t+e+1),0),y=c(M+x),S=t.geometry,v=S.boundingBox;o(v),S.numVerticesPerSide=r.numVerticesPerSide,S.vertexAttributes=y,n(S.uvRange,d,g,m,p),C(t),k(t,M),w(t),F(S,r.numVerticesPerSide,[],[0,h-1],[0,h-1],r.wireframe),t.intersectionData=null}function C(t){const n=t.tile;if(!n.intersectsClippingArea)return;const o=n.surface,s=t.geometryState,i=s.samplerData,a=t.localOrigin,c=o.isWebMercatorOnPlateeCarree,d=s.clippingArea,g=null!=d?d:Y,m=n.extent,p=m[0],h=m[1],M=m[2],x=m[3],y=Math.max(p,g[0]),S=Math.min(M,g[2]),v=Math.max(h,g[1]),b=Math.min(x,g[3]),L=n.ellipsoid.radius,R=n.horizontalScale,B=s.numVerticesPerSide,O=B-1,T=B-2,D=t.geometry,P=D.vertexAttributes,A=P.position,V=P.uv0,E=P.normalCompressed,U=D.uvRange,C=U[0],I=U[1],j=U[2],w=U[3],N=D.boundingBox,H=a[0],_=a[1],q=a[2],W=A.typedBuffer,F=A.typedBufferStride;let k=0;const z=e(h,v,b),G=c?(Math.PI/2-2*Math.atan(Math.exp(-z/L)))*L:z*R,J=1/O,K=e(h*(1-J)+x*J,v,b);let Q=G,X=c?(Math.PI/2-2*Math.atan(Math.exp(-K/L)))*L:K*R;for(let Y=1;Y<=T;Y++){const t=Y/O,n=e(h*(1-t)+x*t,v,b),o=e(t,I,w),s=X,a=(Y-1)/O,d=e(h*(1-a)+x*a,v,b),g=Q,m=(Y+1)/O,B=e(h*(1-m)+x*m,v,b),D=c?(Math.PI/2-2*Math.atan(Math.exp(-B/L)))*L:B*R,P=e(m,I,w);Q=X,X=D;const A=e(p,y,S);let U=A*R,z=r(A,n,i);const G=1/O,J=e(G,C,j),K=e(p*(1-J)+M*J,y,S);let Z=J,$=K,tt=K*R,et=r(K,n,i);if(1===Y){const t=tt-H,n=Q-_,s=et-q,r=0*F;W[r]=t,W[r+1]=n,W[r+2]=s,l(t,n,s,N);const i=e(G,C,j);u(V,k,i,o)}for(let c=1;c<=T;c++){const t=tt,a=et,m=(c+1)/O,h=e(m,C,j),x=e(p*(1-m)+M*m,y,S),v=$;$=x;{const t=k+1,e=t*F;if(1===Y||c===T){const a=x*R,f=r(x,n,i);if(1===Y&&c<T){const n=a-H,r=s-_,i=f-q;W[e]=n,W[e+1]=r,W[e+2]=i,l(n,r,i,N),u(V,t,h,o)}tt=a,et=f}else tt=W[e]+H,et=W[e+2]+q}const b=tt,L=et,A=U,I=z;U=t,z=a;const w=(k-T)*F,G=1===Y?r(v,d,i):W[w+2]+q,J=r(v,B,i);if(Y<T){const e=k+T,n=e*F,o=t-H,s=D-_,r=J-q;W[n]=o,W[n+1]=s,W[n+2]=r,l(o,s,r,N);const i=Z;Z=h,u(V,e,i,P)}{const t=b-A,e=g-D,n=e*(L-I),o=t*(G-J),s=-e*t,r=n*n+o*o+s*s;if(0===r)f(E,k,0,0,1);else{const t=1/Math.sqrt(r);f(E,k,n*t,o*t,s*t)}}++k}}}function I(t,e){t.tile.intersectsClippingArea&&(H(t),N(t,!0),K(t))}function j(t,e){t.tile.intersectsClippingArea&&(w(t),K(t))}function w(t,e){t.tile.intersectsClippingArea&&(H(t),N(t,!1))}function N(n,o){const s=n.geometryState,i=s.neighborData,a=n.tile,c=a.surface,u=a.extent,f=s.clippingArea,d=null!=f?f:Y,g=u[0],x=u[2],y=u[1],v=u[3],b=[v>d[3],x>d[2],y<d[1],g<d[0]],L=n.geometry,R=a.horizontalScale,B=W(c.isWebMercatorOnPlateeCarree,a.ellipsoid.radius,R),O=L.boundingBox,T=L.uvRange[0],D=L.uvRange[1],P=L.uvRange[2],A=L.uvRange[3],V=Math.max(g,d[0]),E=Math.min(x,d[2]),U=Math.max(y,d[1]),C=Math.min(v,d[3]),I=n.localOrigin,j=I[0],w=I[1],N=I[2],H=s.samplerData;for(let _=0;_<4;++_){const s=1===_||3===_,u=i.edgeResolutions[_];h(t(u));const f=u+1,d=b[_],I=m(a,i.edgePeerNeighbors[_]);if(!d&&$(a,I,_)){z(n,_,I);continue}const q=null!=I&&!d,W=I?.renderData,F=W?.geometryState;if(p&&(h(!q||I.level===a.level),h(!q||S(a,I)<=0),a&&!I&&!c.updatingRootTiles)){const t=M[_],e=a.findNeighborTile(t,(t=>t.isLoaded||t.isLeaf||t.level===a.level));c.updatingRootTiles||(e?e.intersectsClippingArea&&(h(!e.isLoaded),h(!e.isLeaf),h(e.level===a.level)):h(null==c?.rootTiles||!a.shouldHaveNeighbor(t)))}const k=e(1===_?x:g,V,E),G=e(0===_?v:y,U,C),J=F?.samplerData,K=L.outerEdges[_],Q=o&&f>3?f-3:1,X=e(1===_?1:0,T,P),Y=e(0===_?1:0,D,A),Z=q?(t,e)=>.5*(r(t,e,J)+r(t,e,H)):(t,e)=>r(t,e,H),tt=(x-g)/u,et=s?1===_?tt:-tt:0,nt=s?0:0===_?tt:-tt,ot=-et,st=-nt;let rt=0,it=0,at=0;{const t=0/u,n=s?k:e(g*(1-t)+x*t,V,E),o=s?e(y*(1-t)+v*t,U,C):G,r=Z(n,o);rt=n*R,it=B(o),at=r}let ct=0,lt=0,ut=0;{const t=1/u,n=s?k:e(g*(1-t)+x*t,V,E),o=s?e(y*(1-t)+v*t,U,C):G,r=Z(n,o);ct=n*R,lt=B(o),ut=r}for(let t=1;t<f-1;t+=Q){const n=t/u,o=ct,i=lt,a=ut;{const r=s?X:e(n,T,P),c=s?e(n,D,A):Y,u=o-j,f=i-w,d=a-N;l(o,f,d,O),K.setVertexFromValuesRawPositionUV(t,u,f,d,r,c)}{const n=(t+1)/u,o=s?k:e(g*(1-n)+x*n,V,E),r=s?e(y*(1-n)+v*n,U,C):G,i=Z(o,r);ct=o*R,lt=B(r),ut=i}const c=ct,f=ut,d=rt,m=it,p=at;rt=o,it=i,at=a;let h=0,M=0,S=0;if(s){const t=lt-i,s=f-a,c=m-i,l=p-a,u=e(y*(1-n)+v*n,U,C),d=k+ot,g=d*R-o,x=r(d,u,H)-a,b=3===_?-1:1;if(h=b*(-c+t)*x,M=b*g*(-l+s),S=-b*g*(-c+t),q){const e=k+et,n=e*R-o;h=(-c+t)*(x-(r(e,u,J)-a)),M=(g-n)*(-l+s),S=-(g-n)*(-c+t)}}else{const t=c-o,s=f-a,l=d-o,u=p-a,m=e(g*(1-n)+x*n,V,E),y=G+st,v=r(m,y,H)-a,b=B(y)-i,L=2===_?-1:1;if(h=L*b*(-u+s),M=L*(-l+t)*v,S=-L*b*(-l+t),q){const e=m,n=G+nt,o=B(n)-i;h=(-b+o)*(-u+s),M=(-l+t)*(-v+(r(e,n,J)-a)),S=-(-b+o)*(-l+t)}}const b=1/Math.sqrt(h*h+M*M+S*S);K.setNormalFromValues(t,h*b,M*b,S*b)}}}function H(t,e){G(t)}function _(t,e){return(Math.PI/2-2*Math.atan(Math.exp(-t/e)))*e}function q(t,e){return t*e}function W(t,e,n){return t?t=>_(t,e):t=>q(t,n)}function F(t,e,n,o,s,r){const i=e-1,a=t.vertexAttributes.count,c=2*(Math.min(e-2,o[1])-Math.max(1,o[0]))*(Math.min(e-2,s[1])-Math.max(1,s[0])),l=M.map(((t,n)=>0===n&&s[1]<e-2||1===n&&o[1]<e-2||2===n&&s[0]>1||3===n&&o[0]>1)),u=t.outerEdges.reduce(((t,e,n)=>t+(l[n]?0:i-2+e.count-1)),0),f=n.reduce(((t,e)=>t+i*(2*(e.latitudeResolution-1)+1)),0),d=r?2:1,g=3*(c+u+f)*d,m=a>=v?new Uint32Array(g):new Uint16Array(g);let x=0;const y=e-2,S=i-2;h(S>=0);const b=(t,e,n,o,s,r)=>{const i=t*s,a=r[i],c=r[i+1],l=r[i+2],u=e*s,f=r[u],d=r[u+1],g=r[u+2],m=n*s,p=r[m],h=r[m+1],M=r[m+2],x=o*s,y=r[x],S=r[x+1],v=r[x+2];return(f-y)*(f-y)+(d-S)*(d-S)+(g-v)*(g-v)>(a-p)*(a-p)+(c-h)*(c-h)+(l-M)*(l-M)};if(r){const r=(t,e,n)=>{m[x++]=t,m[x++]=e,m[x++]=e,m[x++]=n,m[x++]=n,m[x++]=t,p&&(h(t<a),h(e<a),h(n<a),h(x<=g))};(()=>{for(let n=Math.max(s[0],1)-1;n<Math.min(s[1],e-2)-1;++n){const s=n*y;for(let i=Math.max(o[0],1)-1;i<Math.min(o[1],e-2)-1;++i){const e=n*y+i,o=e+1,a=o+y,c=a-1,l=s+i,u=l+1,f=u+y,d=f-1,g=t.vertexAttributes.position.typedBuffer,m=t.vertexAttributes.position.typedBufferStride;b(l,u,f,d,m,g)?(r(e,o,a),r(a,c,e)):(r(e,o,c),r(c,a,o))}}})(),h(x===3*c*d);(()=>{for(let e=0;e<4;++e){const n=x;if(l[e])continue;const o=t.outerEdges[e],s=t.innerEdges[e];let a=0,c=0;const u=o.count,f=s.count;h(f===i-1);let g=0;const m=1===e||2===e?(t,e,n)=>r(t,e,n):(t,e,n)=>r(t,n,e);for(;a<u-1||c<f-1;){const t=s.getVertexIndex(c),e=o.getVertexIndex(a),n=a<u-1,r=c<f-1;if(n&&(!r||(n?0+i*(a+.5)/(u-1):0)<=(r?1+S*(c+.5)/(f-1):0))){++a,p&&h(a<u);m(t,e,o.getVertexIndex(a)),g++}else{++c,p&&h(c<f);m(t,e,s.getVertexIndex(c)),g++}}p&&(h(a===u-1),h(c===f-1),h(g===u+f-2),h(g===i-2+o.count-1),h(x===n+3*g*d))}})(),h(x===3*(c+u)*d);const f=n=>{const o=t.outerEdges[n.connectedOuterEdgeOffset];let s=o.getVertexIndex(0),a=o.stride;for(let t=0;t<n.latitudeResolution;++t){const o=0===t?n.rowOffset:s+e;for(let e=0;e<i;e++)r(s,s+1,o+e),t<n.latitudeResolution-1&&r(s+1,o+e+1,o+e),s+=a;s=o,a=1}};(()=>n.forEach(f))()}else{(()=>{const n=Math.max(s[0],1)-1,r=Math.min(s[1],e-2)-1,i=Math.max(o[0],1)-1,a=Math.min(o[1],e-2)-1;for(let e=n;e<r;++e){const n=e*y;for(let e=i;e<a;++e){const o=n+e,s=o+1,r=s+y,i=r-1,a=t.vertexAttributes.position.typedBuffer,c=t.vertexAttributes.position.typedBufferStride;b(o,s,r,i,c,a)?(m[x]=o,m[x+1]=s,m[x+2]=r,m[x+3]=r,m[x+4]=i,m[x+5]=o):(m[x]=o,m[x+1]=s,m[x+2]=i,m[x+3]=i,m[x+4]=s,m[x+5]=r),x+=6}}})(),h(x===3*c*d);(()=>{for(let e=0;e<4;++e){if(l[e])continue;const n=t.outerEdges[e],o=t.innerEdges[e];let s=0,r=0;const a=n.count,c=o.count;h(c===i-1);const u=1===e||2===e,f=u?1:2,d=u?2:1,g=n.index0,p=n.stride,M=o.index0,y=o.stride;for(;s<a-1||r<c-1;){const t=M+r*y,e=g+s*p,n=s<a-1,o=r<c-1,l=n&&(!o||(n?0+i*(s+.5)/(a-1):0)<=(o?1+S*(r+.5)/(c-1):0));l?++s:++r;const u=l?e+p:t+y;m[x]=t,m[x+f]=e,m[x+d]=u,x+=3}}})(),h(x===3*(c+u)*d);const r=n=>{const o=t.outerEdges[n.connectedOuterEdgeOffset];let s=o.getVertexIndex(0),r=o.stride;for(let t=0;t<n.latitudeResolution;++t){const o=0===t?n.rowOffset:s+e;for(let e=0;e<i;e++){const i=o+e;m[x]=s,m[x+1]=s+1,m[x+2]=i,t<n.latitudeResolution-1?(m[x+3]=s+1,m[x+4]=i+1,m[x+5]=i,x+=6):x+=3,s+=r}s=o,r=1}};(()=>n.forEach(r))()}h(x===g),t.indices=m,t.indexCount=g}function k(t,e){const n=t.localOrigin,o=t.geometry,s=t.geometryState.neighborData.edgeResolutions,r=o.numVerticesPerSide-2,i=o.vertexAttributes;let a=e;for(let c=0;c<4;++c){{const t=0===c||2===c,e=(0===c?r-1:0)*r+(1===c?r-1:0),s=(t?0:1)*r+(t?1:0);o.innerEdges[c]=new d(i,n,e,s,r)}{const t=a,e=s[c]+1;o.outerEdges[c]=new d(i,n,t,1,e),a+=e}}}function z(n,o,s){const r=(o+2)%4,i=n.geometryState,a=n.tile,c=i.neighborData,f=a.level-s.level,d=1===o||3===o,g=c.edgeResolutions[o];h(t(g));const m=g+1,p=n.geometry,M=p.boundingBox,x=p.outerEdges[o],y=p.uvRange[0],S=p.uvRange[1],v=p.uvRange[2],b=p.uvRange[3],L=e(1===o?1:0,y,v),R=e(0===o?1:0,S,b),B=s.renderData,O=B.geometryState,T=B.geometry.outerEdges[r],D=a.getNeighborEdgeStartVertexIndex(o,s)*g,P=g*2**f;h(O.neighborData.edgeResolutions[r]===P),h(T.count-1===P);const A=B.localOrigin[0]-n.localOrigin[0],V=B.localOrigin[1]-n.localOrigin[1],E=B.localOrigin[2]-n.localOrigin[2],U=x.attributes,C=x.index0,I=x.stride,j=U.position.typedBuffer,w=U.position.typedBufferStride,N=U.normalCompressed.typedBuffer,H=U.normalCompressed.typedBufferStride,_=U.uv0,q=T.attributes,W=T.index0,F=T.stride,k=q.position.typedBuffer,z=q.position.typedBufferStride,G=q.normalCompressed.typedBuffer,J=q.normalCompressed.typedBufferStride;for(let t=1;t<m-1;++t){const n=C+I*t,o=W+F*(D+t),s=n*w,r=o*z,i=k[r]+A,a=k[r+1]+V,c=k[r+2]+E;j[s]=i,j[s+1]=a,j[s+2]=c,l(i,a,c,M);const f=n*H,m=o*J;N[f]=G[m],N[f+1]=G[m+1];const p=t/g,h=d?L:e(p,y,v),x=d?e(p,S,b):R;u(_,n,h,x)}}function G(t){const n=t.geometryState,o=n.neighborData,s=t.localOrigin,i=o.cornerNeighborData,a=t.geometry,c=a.outerEdges,f=a.boundingBox,d=t.tile,g="local"===t.tile.surface.view?.viewingMode,m=d.ellipsoid.radius,p=d.extentInRadians,M=d.horizontalScale;let x=0,y=0,v=0;const b=(t,e,n)=>{const o=p[0===e?1:3],s=p[0===t?0:2],r=Math.cos(o),i=Math.sin(o),a=Math.sin(s),c=Math.cos(s),l=m+n;x=c*r*l,y=a*r*l,v=i*l},L=g?(()=>{const n=t.geometryState.clippingArea,o=d.extent,s=null!=n&&(o[3]>n[3]||o[2]>n[2]||o[1]<n[1]||o[0]<n[0]),r=W(d.surface.isWebMercatorOnPlateeCarree,d.ellipsoid.radius,M);return(t,o,i)=>{const a=0===t?j[0]:j[2],c=0===o?j[1]:j[3],l=s?e(a,n[0],n[2]):a,u=s?e(c,n[1],n[3]):c,f=i;x=l*M,y=r(u),v=f}})():b;let R=0,B=0,O=0,T=0,D=0,P=0,A=0,V=0,U=0;const C=g&&t.tile.surface.isWebMercatorOnPlateeCarree,I=(t,e,n,o,s)=>{let r=0,i=0,a=0;if(g){const t=e*M,s=C?(Math.PI/2-2*Math.atan(Math.exp(-n/m)))*m:n*M;r=t-x,i=s-y,a=o-v}else{const s=E(t),c=t.tile,l=c.extent,u=c.extentInRadians,f=(e-l[0])/(l[2]-l[0]),d=(n-l[1])/(l[3]-l[1]),g=u[0]*(1-f)+u[2]*f,p=s(d),h=Math.cos(p),M=Math.sin(p),S=Math.sin(g),b=Math.cos(g),L=m+o;r=b*h*L-x,i=S*h*L-y,a=M*L-v}switch(s){case 0:A+=r,V+=i,U+=a;break;case 1:T-=r,D-=i,P-=a;break;case 2:A-=r,V-=i,U-=a;break;case 3:T+=r,D+=i,P+=a}},j=d.extent,w=n.clippingArea,N=null!=w?w:Y,H=j[0],_=j[2],q=j[1],F=j[3],k=[F>N[3],_>N[2],q<N[1],H<N[0]],z=Math.max(H,N[0]),G=Math.min(_,N[2]),K=Math.max(q,N[1]),X=Math.min(F,N[3]),$=a.uvRange[0],tt=a.uvRange[1],et=a.uvRange[2],nt=a.uvRange[3],ot=t=>{const e=i[t].cornerTiles;R=0,B=0,O=1;let n=1/0;for(let r=0;r<4;++r)n=Math.min(n,e[r]?.level??1/0);for(let r=0;r<4;++r){const t=e[r];Z[r]=t?.level===n?t:null}let o=1,s=0;for(let r=0;r<4;++r){const t=Z[r];t&&(o=Math.max(o,t?.renderData.geometryState.numVerticesPerSide),s=t.extent[2]-t.extent[0])}const a=s,c=o;h(c>1);const l=a/c;for(let i=0;i<4;++i){const t=Z[(i+3)%4],e=Z[i%4];if(!t&&!e)continue;const n=0===i?1:1===i?2:2===i?3:0,o=0===i?2:1===i?3:2===i?0:1;if(t&&e){const s=Q[i][0]*l,a=Q[i][1]*l,c=t.extent,u=c[0===n||1===n?2:0]+s,f=c[0===n||3===n?3:1]+a,d=e.extent,g=d[0===o||1===o?2:0]+s,m=d[0===o||3===o?3:1]+a,p=t.renderData,h=e.renderData,M=r(u,f,p.geometryState.samplerData),x=r(g,m,h.geometryState.samplerData);I(p,u,f,.5*(M+x),i)}else{const s=t??e,a=t?n:o,c=s.extent,u=Q[i],f=c[0===a||1===a?2:0]+u[0]*l,d=c[0===a||3===a?3:1]+u[1]*l,g=s.renderData,m=r(f,d,g.geometryState.samplerData);I(g,f,d,m,i)}}if(!g){const t=Math.sqrt(x*x+y*y+v*v);R=x/t,B=y/t,O=v/t}const u=Math.sqrt(T*T+D*D+P*P);T/=u,D/=u,P/=u;const f=Math.sqrt(A*A+V*V+U*U);if(A/=f,V/=f,U/=f,g||O*O<.999){R=P*V-D*U,B=T*U-P*A,O=D*A-T*V;const t=1/Math.sqrt(R*R+B*B+O*O);R*=t,B*=t,O*=t}};for(let E=0;E<4;++E){const o=E,a=(E+1)%4,g=0===E||1===E?1:0,m=0===E||3===E?1:0,p=e(g,$,et),M=e(m,tt,nt),b=c[o],T=0===E||3===E?b.count-1:0,D=c[a],P=0===E||1===E?D.count-1:0,A=i[E].cornerTiles;let V=-1;for(let t=0;t<4;++t){const e=A[t];e&&(-1===V||S(A[V],e)>0)&&(V=t)}const U=V,C=A[U];if(R=0,B=0,O=1,C!==d){const e=d.level-C.level,n=2**e,o=[C.lij[0]+e,C.lij[1]*n,C.lij[2]*n],s=[o[1]+n===d.lij[1],0===E&&(1===U||0===U&&C!==A[3])||1===E&&(0===U||1===U&&C!==A[2]),o[1]===d.lij[1]+1,2===E&&(3===U||2===U&&C!==A[1])||3===E&&(2===U||3===U&&C!==A[0])],r=s.reduce(((t,e)=>t+(e?1:0)),0);h(1===r||2===r);let i=-1,a=-1;const c=C.renderData;if(1===r){const e=s.findIndex((t=>t));h(0<=e&&e<=3),i=(e+2)%4;const n=t.geometryState.neighborData.edgeResolutions[e];a=d.getNeighborEdgeStartVertexIndex(e,C)*n+n*(0===e&&0===E||1===e&&0===E||2===e&&1===E||3===e&&3===E?1:0)}else{h(s[1]||s[3]),i=s[1]?3:1;const t=c.geometryState.neighborData.edgeResolutions[i];a=0===E||3===E?0:t}const g=c.geometry.outerEdges[i];{const e=b.index0+T*b.stride,n=D.index0+P*D.stride,o=g.index0+a*g.stride;{const s=g.attributes.position,r=s.typedBuffer,i=o*s.typedBufferStride,a=t.localOrigin,c=g.localOrigin,u=r[i]+c[0]-a[0],d=r[i+1]+c[1]-a[1],m=r[i+2]+c[2]-a[2];l(u,d,m,f);{const t=b.attributes.position,n=t.typedBuffer,o=e*t.typedBufferStride;n[o]=u,n[o+1]=d,n[o+2]=m}{const t=D.attributes.position,e=t.typedBuffer,o=n*t.typedBufferStride;e[o]=u,e[o+1]=d,e[o+2]=m}}u(b.attributes.uv0,e,p,M),u(D.attributes.uv0,n,p,M);{const t=g.attributes.normalCompressed.typedBuffer,s=o*g.attributes.normalCompressed.typedBufferStride;{const n=b.attributes.normalCompressed,o=n.typedBuffer,r=e*n.typedBufferStride;o[r]=t[s],o[r+1]=t[s+1]}{const e=D.attributes.normalCompressed,o=e.typedBuffer,r=n*e.typedBufferStride;o[r]=t[s],o[r+1]=t[s+1]}}}}else{const t=k[o],i=k[a];let c;if(t||i){const t=e(H*(1-g)+_*g,z,G),o=e(q*(1-m)+F*m,K,X),s=n.samplerData;c=r(t,o,s)}else c=J(A);L(g,m,c),ot(E);const u=x-s[0],d=y-s[1],h=v-s[2];l(u,d,h,f),b.setVertexFromValuesRawPositionUVNormal(T,u,d,h,p,M,R,B,O),D.setVertexFromValuesRawPositionUVNormal(P,u,d,h,p,M,R,B,O)}}for(let e=0;e<4;++e)Z[e]=null}function J(t){const e=t.reduce(((t,e)=>Math.min(t,e?.level??1/0)),1/0);p&&(h(!t[0]||!t[2]||y(t[0],t[2],a.SOUTH_WEST)),h(!t[1]||!t[3]||y(t[1],t[3],a.NORTH_WEST)));let n=0,o=0;for(let i=0;i<4;++i){const s=t[i];if(s&&s.level===e){const t=0===i||1===i,e=0===i||3===i,a=s.extent,c=a[t?0:2],l=a[e?1:3],u=s.renderData?.geometryState?.samplerData;o+=r(c,l,u),n++}}const s=n?o/n:0;return h(null!=s),s}function K(t){const e=t.vao,n=t.geometry.vertexAttributes.position.typedBuffer;e.vertexBuffers.geometry.setSubData(n,0,0,n.length)}const Q=[[0,1],[1,0],[0,-1],[-1,0]],X=new g,Y=s(-1/0,-1/0,1/0,1/0),Z=[null,null,null,null];function $(t,e,n){if(!e)return!1;const o=S(t,e);return o>0||0===o&&n>=2}export{U as createPlanarGlobePatch,b as createSphericalGlobePatch,B as updateCornerSpherical,I as updateCornersPlanar,j as updateEdgesAndCornersPlanar,R as updateEdgesAndCornersSpherical};
5
+ import{isPowerOfTwo as t,clamp as e}from"../../../core/mathUtils.js";import{s as n}from"../../../chunks/vec4.js";import{empty as o}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as r}from"./ElevationData.js";import{PatchType as i,NeighborIndex as a}from"./interfaces.js";import{acquireTerrainAttributes as l,minMaxBoundingBox as c,encodeUVInBuffer as u,EdgeDescriptor as f}from"./PatchGeometry.js";import{PatchGeometryLUT as d}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as g}from"./PatchRenderData.js";import{ENABLE_TERRAIN_INTERNAL_CHECKS as m,internalAssert as p,neighborEdgeIndices as h,almostEquals as M}from"./terrainUtils.js";import{isCornerNeighbor as x}from"./Tile.js";import{compareTilesByLij as y}from"./tileUtils.js";import{compressNormal as S}from"../webgl-engine/lib/Normals.js";const b=65536;function v(t,e){const n=t.tile,{extent:s,extentInRadians:r,surface:a}=n,f=t.localOrigin,d=t.geometryState,g=a.isWebMercator,h=d.numVerticesPerSide,M=h-1,x=(h-2)**2,y=g&&(e===i.HAS_SOUTH_POLE||e===i.HAS_BOTH_POLES),b=g&&(e===i.HAS_NORTH_POLE||e===i.HAS_BOTH_POLES),v=6,L=((y?1:0)+(b?1:0))*v*(M+1),R=d.neighborData,T=R.edgeResolutions.reduce(((t,e)=>t+e+1),0),D=l(x+L+T),A=t.geometry;A.numVerticesPerSide=d.numVerticesPerSide,A.vertexAttributes=D;const V=A.boundingBox;o(V);const U=E(t);X.update(M,r,U),B(t),k(t,x),O(t);const C=[];if((()=>{let t=x+T;const e=f[0],o=f[1],r=f[2],i=n.ellipsoid.radius,a=s[1],l=s[3],d=(n,s)=>{const f=s*h;c(-e,-o,n*i-r,V),C.push({connectedRowOffset:f,connectedOuterEdgeOffset:1===n?0:2,rowOffset:t,latitudeResolution:v});const d=P(-1===n?a:l,i),g=n*Math.PI/2-d,m=.99*(1===n?1:-1),p=i+0,x=D.position,y=D.uv0,{typedBuffer:b,typedBufferStride:B}=D.normalCompressed;for(let i=1;i<=v;++i){const n=d+g*(i/v),s=Math.cos(n),a=Math.sin(n);for(let i=0;i<=M;i++){const n=i/M,l=X.sinLonLUT[i],f=X.cosLonLUT[i]*s,d=l*s,g=a,h=f*p-e,v=d*p-o,L=g*p-r;c(h,v,L,V),x.setValues(t,h,v,L),u(y,t,n,m),S(b,t,f,d,g,B),++t}}};y&&d(-1,0),b&&d(1,M)})(),F(A,d.numVerticesPerSide,C,[0,h-1],[0,h-1],d.wireframe),t.intersectionData=null,m)for(let o=0;o<4;++o)p(A.outerEdges[o].count===R.edgeResolutions[o]+1)}function B(t){const e=t.tile;if(!e.intersectsClippingArea)return;const n=t.geometryState,o=n.numVerticesPerSide,s=o-2,i=o-1,a=t.geometry,l=a.vertexAttributes,f=l.position,d=l.uv0,{typedBuffer:g,typedBufferStride:m}=l.normalCompressed,p=e.extent,h=p[0],M=p[2],x=p[1],y=p[3],b=e.ellipsoid.radius,v=n.samplerData,B=t.localOrigin,L=B[0],R=B[1],O=B[2],T=f.typedBuffer,D=f.typedBufferStride,P=1/i,A=a.boundingBox;let V=0;if(1<=s){const t=P,e=x*(1-t)+y*t,n=X.sinLatLUT[1],o=X.cosLatLUT[1];for(let i=1;i<=s;i++){const s=i*P,a=h*(1-s)+M*s,l=X.sinLonLUT[i],f=X.cosLonLUT[i],g=b+r(a,e,v),m=g*f*o-L,p=g*l*o-R,x=g*n-O;c(m,p,x,A);const y=(i-1)*D;T[y]=m,T[y+1]=p,T[y+2]=x,u(d,i-1,s,t)}}for(let E=1;E<=s;E++){const t=E*P,e=x*(1-t)+y*t,n=X.sinLatLUT[E],o=X.cosLatLUT[E],a=E+1,l=a*P,f=x*(1-l)+y*l,p=X.sinLatLUT[a],B=X.cosLatLUT[a],U=X.sinLonLUT[0],C=X.cosLonLUT[0],I=b+r(h,e,v);let j=C*o*I-L,w=U*o*I-R,N=n*I-O;const H=V*D;let _=T[H],q=T[H+1],W=T[H+2];for(let y=1;y<=s;y++){const t=y*P,a=h*(1-t)+M*t,U=X.sinLonLUT[y],C=X.cosLonLUT[y];let I=0,H=0,F=0;if(y<s){const t=(V+1)*D;I=T[t],H=T[t+1],F=T[t+2]}else{const t=X.sinLonLUT[i],s=X.cosLonLUT[i],a=b+r(M,e,v);I=s*o*a-L,H=t*o*a-R,F=n*a-O}const k=j,z=w,G=N;j=_,w=q,N=W,_=I,q=H,W=F;const J=I-k,K=H-z,Q=F-G;let Y=0,Z=0,$=0;if(E>1){const t=(V-s)*D;Y=T[t],Z=T[t+1],$=T[t+2]}else{const t=X.sinLatLUT[0],e=X.cosLatLUT[0],n=b+r(a,x,v);Y=C*e*n-L,Z=U*e*n-R,$=t*n-O}const tt=b+r(a,f,v),et=C*B*tt-L,nt=U*B*tt-R,ot=p*tt-O;if(E<s){const e=V+s,n=e*D;T[n]=et,T[n+1]=nt,T[n+2]=ot,c(et,nt,ot,A),u(d,e,t,l)}const st=Y-et,rt=Z-nt,it=$-ot;let at=C*o,lt=U*o,ct=n;ct*ct<.999&&(at=Q*rt-K*it,lt=J*it-Q*st,ct=K*st-J*rt);const ut=1/Math.sqrt(at*at+lt*lt+ct*ct);S(g,V,at*ut,lt*ut,ct*ut,m),++V}}}function L(t){t.tile.intersectsClippingArea&&(O(t),K(t))}function R(t){t.tile.intersectsClippingArea&&(D(t),T(t,!0),K(t))}function O(t){t.tile.intersectsClippingArea&&(D(t),T(t))}function T(e,n=!1){const o=e.geometryState,s=e.geometry,i=o.neighborData,a=e.tile,l=a.level,f=a.extent,d=a.ellipsoid.radius,x=a.extentInRadians,S=x[0],b=x[2],v=x[1],B=x[3],L=o.samplerData,R=f[0],O=f[2],T=f[1],D=f[3],P=E(e),A=s.boundingBox,V=e.localOrigin,U=V[0],C=V[1],I=V[2],j=s.vertexAttributes,w=j.position,N=w.typedBuffer,H=w.typedBufferStride,_=j.uv0;for(let E=0;E<4;++E){const o=1===E||3===E,x=i.edgeResolutions[E];p(t(x));const V=x+1,j=g(a,i.edgePeerNeighbors[E]);if($(a,j,E)){z(e,E,j);continue}const w=null!=j;p(!w||j.level===a.level),p(!w||y(a,j)<=0);const q=j?.renderData,W=q?.geometryState;if(m){const t=a.surface;if(!j&&t&&!t.updatingRootTiles){const e=h[E],n=a.findNeighborTile(e,(t=>t.isLoaded||t.isLeaf||t.level===a.level));n?n.intersectsClippingArea&&(p(!n.isLoaded),p(!n.isLeaf),p(n.level===l)):p(null==t?.rootTiles||!a.shouldHaveNeighbor(e))}}const F=1===E?f[2]:f[0],k=j?.extent,G=k&&o?1===E?k[0]:k[2]:F,J=0===E?f[3]:f[1],K=1===E?1:0,Q=0===E?1:0,X=1===E?b:S,Y=0===E?B:v,Z=Math.sin(X),tt=Math.cos(X),et=Math.sin(Y),nt=Math.cos(Y),ot=W?.samplerData,st=w?(t,e,n)=>.5*(r(t,e,L)+r(n,e,ot)):(t,e,n)=>r(t,e,L),rt=s.outerEdges[E],it=n&&V>3?V-3:1,at=null!=L&&L.some((t=>null!=t)),lt=null!=ot&&ot.some((t=>null!=t)),ct=at||lt,ut=1/x,ft=rt.index0;p(!k||M(k[2]-k[0],f[2]-f[0]));(()=>{const t=1===E?-1:3===E?1:0,e=0===E?-1:2===E?1:0,n=(f[2]-f[0])*ut,s=t*n,i=e*n,a=o?t*((b-S)*ut):0,l=o?0:e*ut,g=Q,m=o?X+a:X,p=o?Math.sin(m):Z,h=o?Math.cos(m):tt,M=o?X-a:X,x=o?Math.sin(M):Z,y=o?Math.cos(M):tt,v=o?Y:P(g+l),B=o?et:Math.sin(v),j=o?nt:Math.cos(v),q=o?Y:P(g-l),W=o?et:Math.sin(q),k=o?nt:Math.cos(q);let z=0,$=0,at=0;{const t=0*ut,e=o?F:R*(1-t)+O*t,n=o?G:e,s=o?T*(1-t)+D*t:J,r=o?X:S*(1-t)+b*t,i=o?Z:Math.sin(r),a=o?tt:Math.cos(r),l=o?P(t):Y,c=o?Math.sin(l):et,u=o?Math.cos(l):nt,f=d+st(e,s,n);z=a*u*f,$=i*u*f,at=c*f}let lt=0,dt=0,gt=0;{const t=1*ut,e=o?F:R*(1-t)+O*t,n=o?G:e,s=o?T*(1-t)+D*t:J,r=o?X:S*(1-t)+b*t,i=o?Z:Math.sin(r),a=o?tt:Math.cos(r),l=o?P(t):Y,c=o?Math.sin(l):et,u=o?Math.cos(l):nt,f=d+st(e,s,n);lt=a*u*f,dt=i*u*f,gt=c*f}for(let f=1;f<V-1;f+=it){let t=0,e=0,n=0;{const s=(f+1)*ut,r=o?F:R*(1-s)+O*s,i=o?G:r,a=o?T*(1-s)+D*s:J,l=o?X:S*(1-s)+b*s,c=o?Z:Math.sin(l),u=o?tt:Math.cos(l),g=o?P(s):Y,m=o?Math.sin(g):et,p=o?Math.cos(g):nt,h=d+st(r,a,i);t=u*p*h,e=c*p*h,n=m*h}const a=t,l=e,g=n,m=lt,M=dt,v=gt;lt=a,dt=l,gt=g;{const t=ft+f,e=t*H,n=m-U,s=M-C,r=v-I;N[e]=n,N[e+1]=s,N[e+2]=r,c(n,s,r,A);const i=f*ut;u(_,t,o?K:i,o?i:Q)}const V=z,q=$,it=at;z=m,$=M,at=v;const mt=m,pt=M,ht=v,Mt=1/Math.sqrt(mt*mt+pt*pt+ht*ht),xt=ht*Mt;let yt=0,St=0,bt=0;if(ct&&xt*xt<.999){let t=0,e=0,n=0;{const o=0===E?-1:1;t=o*(a-V),e=o*(l-q),n=o*(g-it)}{const a=f*ut,l=o?F:R*(1-a)+O*a,c=o?G:l,u=o?T*(1-a)+D*a:J,g=o?X:S*(1-a)+b*a,m=o?Z:Math.sin(g),M=o?tt:Math.cos(g),v=o?P(a):Y,A=o?Math.sin(v):et,V=o?Math.cos(v):nt;let U=mt,C=pt,I=ht;if(w){const t=d+r(c-s,u-i,ot),e=o?V:k;U=(o?y:M)*e*t,C=(o?x:m)*e*t,I=(o?A:W)*t}{const a=d+r(l+s,u+i,L),c=o?V:j,f=(o?h:M)*c*a,g=(o?p:m)*c*a,x=(o?A:B)*a;w||(U=2*mt-f,C=2*pt-g,I=2*ht-x);const y=3===E?-1:1,S=y*(U-f),b=y*(C-g),v=y*(I-x);yt=n*b-e*v,St=t*v-n*S,bt=e*S-t*b;const R=1/Math.sqrt(yt*yt+St*St+bt*bt);yt*=R,St*=R,bt*=R}}}else yt=mt*Mt,St=pt*Mt,bt=ht*Mt;rt.setNormalFromValues(f,yt,St,bt)}})()}}function D(t){G(t)}function P(t,e){return Math.PI/2-2*Math.atan(Math.exp(-t/e))}function A(t,e,n,o){return P(t*(1-o)+e*o,n)}function V(t,e,n){return t*(1-n)+e*n}function E(t){const e=t.tile;if(e.surface.isWebMercator){const t=e.extent,n=e.ellipsoid.radius;return e=>A(t[1],t[3],n,e)}const n=e.extentInRadians;return t=>V(n[1],n[3],t)}function U(t,e){const s=t.tile.extent,r=t.geometryState,i=s[0],a=s[1],c=s[2]-i,u=s[3]-a,f=r.clippingArea,d=null!=f?Math.max(0,(f[0]-i)/c):0,g=null!=f?Math.max(0,(f[1]-a)/u):0,m=null!=f?Math.min(1,(f[2]-i)/c):1,p=null!=f?Math.min(1,(f[3]-a)/u):1,h=r.numVerticesPerSide,M=(h-2)**2,x=r.neighborData.edgeResolutions.reduce(((t,e)=>t+e+1),0),y=l(M+x),S=t.geometry,b=S.boundingBox;o(b),S.numVerticesPerSide=r.numVerticesPerSide,S.vertexAttributes=y,n(S.uvRange,d,g,m,p),C(t),k(t,M),w(t),F(S,r.numVerticesPerSide,[],[0,h-1],[0,h-1],r.wireframe),t.intersectionData=null}function C(t){const n=t.tile;if(!n.intersectsClippingArea)return;const o=n.surface,s=t.geometryState,i=s.samplerData,a=t.localOrigin,l=o.isWebMercatorOnPlateeCarree,f=s.clippingArea,d=null!=f?f:Y,g=n.extent,m=g[0],p=g[1],h=g[2],M=g[3],x=Math.max(m,d[0]),y=Math.min(h,d[2]),b=Math.max(p,d[1]),v=Math.min(M,d[3]),B=n.ellipsoid.radius,L=n.horizontalScale,R=s.numVerticesPerSide,O=R-1,T=R-2,D=t.geometry,P=D.vertexAttributes,A=P.position,V=P.uv0,{typedBuffer:E,typedBufferStride:U}=P.normalCompressed,C=D.uvRange,I=C[0],j=C[1],w=C[2],N=C[3],H=D.boundingBox,_=a[0],q=a[1],W=a[2],F=A.typedBuffer,k=A.typedBufferStride;let z=0;const G=e(p,b,v),J=l?(Math.PI/2-2*Math.atan(Math.exp(-G/B)))*B:G*L,K=1/O,Q=e(p*(1-K)+M*K,b,v);let X=J,Z=l?(Math.PI/2-2*Math.atan(Math.exp(-Q/B)))*B:Q*L;for(let Y=1;Y<=T;Y++){const t=Y/O,n=e(p*(1-t)+M*t,b,v),o=e(t,j,N),s=Z,a=(Y-1)/O,f=e(p*(1-a)+M*a,b,v),d=X,g=(Y+1)/O,R=e(p*(1-g)+M*g,b,v),D=l?(Math.PI/2-2*Math.atan(Math.exp(-R/B)))*B:R*L,P=e(g,j,N);X=Z,Z=D;const A=e(m,x,y);let C=A*L,G=r(A,n,i);const J=1/O,K=e(J,I,w),Q=e(m*(1-K)+h*K,x,y);let $=K,tt=Q,et=Q*L,nt=r(Q,n,i);if(1===Y){const t=et-_,n=X-q,s=nt-W,r=0*k;F[r]=t,F[r+1]=n,F[r+2]=s,c(t,n,s,H);const i=e(J,I,w);u(V,z,i,o)}for(let l=1;l<=T;l++){const t=et,a=nt,g=(l+1)/O,p=e(g,I,w),M=e(m*(1-g)+h*g,x,y),b=tt;tt=M;{const t=z+1,e=t*k;if(1===Y||l===T){const a=M*L,f=r(M,n,i);if(1===Y&&l<T){const n=a-_,r=s-q,i=f-W;F[e]=n,F[e+1]=r,F[e+2]=i,c(n,r,i,H),u(V,t,p,o)}et=a,nt=f}else et=F[e]+_,nt=F[e+2]+W}const v=et,B=nt,A=C,j=G;C=t,G=a;const N=(z-T)*k,J=1===Y?r(b,f,i):F[N+2]+W,K=r(b,R,i);if(Y<T){const e=z+T,n=e*k,o=t-_,s=D-q,r=K-W;F[n]=o,F[n+1]=s,F[n+2]=r,c(o,s,r,H);const i=$;$=p,u(V,e,i,P)}{const t=v-A,e=d-D,n=e*(B-j),o=t*(J-K),s=-e*t,r=n*n+o*o+s*s;if(0===r)S(E,z,0,0,1,U);else{const t=1/Math.sqrt(r);S(E,z,n*t,o*t,s*t,U)}}++z}}}function I(t,e){t.tile.intersectsClippingArea&&(H(t),N(t,!0),K(t))}function j(t,e){t.tile.intersectsClippingArea&&(w(t),K(t))}function w(t,e){t.tile.intersectsClippingArea&&(H(t),N(t,!1))}function N(n,o){const s=n.geometryState,i=s.neighborData,a=n.tile,l=a.surface,u=a.extent,f=s.clippingArea,d=null!=f?f:Y,M=u[0],x=u[2],S=u[1],b=u[3],v=[b>d[3],x>d[2],S<d[1],M<d[0]],B=n.geometry,L=a.horizontalScale,R=W(l.isWebMercatorOnPlateeCarree,a.ellipsoid.radius,L),O=B.boundingBox,T=B.uvRange[0],D=B.uvRange[1],P=B.uvRange[2],A=B.uvRange[3],V=Math.max(M,d[0]),E=Math.min(x,d[2]),U=Math.max(S,d[1]),C=Math.min(b,d[3]),I=n.localOrigin,j=I[0],w=I[1],N=I[2],H=s.samplerData;for(let _=0;_<4;++_){const s=1===_||3===_,u=i.edgeResolutions[_];p(t(u));const f=u+1,d=v[_],I=g(a,i.edgePeerNeighbors[_]);if(!d&&$(a,I,_)){z(n,_,I);continue}const q=null!=I&&!d,W=I?.renderData,F=W?.geometryState;if(m&&(p(!q||I.level===a.level),p(!q||y(a,I)<=0),a&&!I&&!l.updatingRootTiles)){const t=h[_],e=a.findNeighborTile(t,(t=>t.isLoaded||t.isLeaf||t.level===a.level));l.updatingRootTiles||(e?e.intersectsClippingArea&&(p(!e.isLoaded),p(!e.isLeaf),p(e.level===a.level)):p(null==l?.rootTiles||!a.shouldHaveNeighbor(t)))}const k=e(1===_?x:M,V,E),G=e(0===_?b:S,U,C),J=F?.samplerData,K=B.outerEdges[_],Q=o&&f>3?f-3:1,X=e(1===_?1:0,T,P),Y=e(0===_?1:0,D,A),Z=q?(t,e)=>.5*(r(t,e,J)+r(t,e,H)):(t,e)=>r(t,e,H),tt=(x-M)/u,et=s?1===_?tt:-tt:0,nt=s?0:0===_?tt:-tt,ot=-et,st=-nt;let rt=0,it=0,at=0;{const t=0/u,n=s?k:e(M*(1-t)+x*t,V,E),o=s?e(S*(1-t)+b*t,U,C):G,r=Z(n,o);rt=n*L,it=R(o),at=r}let lt=0,ct=0,ut=0;{const t=1/u,n=s?k:e(M*(1-t)+x*t,V,E),o=s?e(S*(1-t)+b*t,U,C):G,r=Z(n,o);lt=n*L,ct=R(o),ut=r}for(let t=1;t<f-1;t+=Q){const n=t/u,o=lt,i=ct,a=ut;{const r=s?X:e(n,T,P),l=s?e(n,D,A):Y,u=o-j,f=i-w,d=a-N;c(o,f,d,O),K.setVertexFromValuesRawPositionUV(t,u,f,d,r,l)}{const n=(t+1)/u,o=s?k:e(M*(1-n)+x*n,V,E),r=s?e(S*(1-n)+b*n,U,C):G,i=Z(o,r);lt=o*L,ct=R(r),ut=i}const l=lt,f=ut,d=rt,g=it,m=at;rt=o,it=i,at=a;let p=0,h=0,y=0;if(s){const t=ct-i,s=f-a,l=g-i,c=m-a,u=e(S*(1-n)+b*n,U,C),d=k+ot,M=d*L-o,x=r(d,u,H)-a,v=3===_?-1:1;if(p=v*(-l+t)*x,h=v*M*(-c+s),y=-v*M*(-l+t),q){const e=k+et,n=e*L-o;p=(-l+t)*(x-(r(e,u,J)-a)),h=(M-n)*(-c+s),y=-(M-n)*(-l+t)}}else{const t=l-o,s=f-a,c=d-o,u=m-a,g=e(M*(1-n)+x*n,V,E),S=G+st,b=r(g,S,H)-a,v=R(S)-i,B=2===_?-1:1;if(p=B*v*(-u+s),h=B*(-c+t)*b,y=-B*v*(-c+t),q){const e=g,n=G+nt,o=R(n)-i;p=(-v+o)*(-u+s),h=(-c+t)*(-b+(r(e,n,J)-a)),y=-(-v+o)*(-c+t)}}const v=1/Math.sqrt(p*p+h*h+y*y);K.setNormalFromValues(t,p*v,h*v,y*v)}}}function H(t,e){G(t)}function _(t,e){return(Math.PI/2-2*Math.atan(Math.exp(-t/e)))*e}function q(t,e){return t*e}function W(t,e,n){return t?t=>_(t,e):t=>q(t,n)}function F(t,e,n,o,s,r){const i=e-1,a=t.vertexAttributes.count,l=2*(Math.min(e-2,o[1])-Math.max(1,o[0]))*(Math.min(e-2,s[1])-Math.max(1,s[0])),c=h.map(((t,n)=>0===n&&s[1]<e-2||1===n&&o[1]<e-2||2===n&&s[0]>1||3===n&&o[0]>1)),u=t.outerEdges.reduce(((t,e,n)=>t+(c[n]?0:i-2+e.count-1)),0),f=n.reduce(((t,e)=>t+i*(2*(e.latitudeResolution-1)+1)),0),d=r?2:1,g=3*(l+u+f)*d,M=a>=b?new Uint32Array(g):new Uint16Array(g);let x=0;const y=e-2,S=i-2;p(S>=0);const v=(t,e,n,o,s,r)=>{const i=t*s,a=r[i],l=r[i+1],c=r[i+2],u=e*s,f=r[u],d=r[u+1],g=r[u+2],m=n*s,p=r[m],h=r[m+1],M=r[m+2],x=o*s,y=r[x],S=r[x+1],b=r[x+2];return(f-y)*(f-y)+(d-S)*(d-S)+(g-b)*(g-b)>(a-p)*(a-p)+(l-h)*(l-h)+(c-M)*(c-M)};if(r){const r=(t,e,n)=>{M[x++]=t,M[x++]=e,M[x++]=e,M[x++]=n,M[x++]=n,M[x++]=t,m&&(p(t<a),p(e<a),p(n<a),p(x<=g))};(()=>{for(let n=Math.max(s[0],1)-1;n<Math.min(s[1],e-2)-1;++n){const s=n*y;for(let i=Math.max(o[0],1)-1;i<Math.min(o[1],e-2)-1;++i){const e=n*y+i,o=e+1,a=o+y,l=a-1,c=s+i,u=c+1,f=u+y,d=f-1,g=t.vertexAttributes.position.typedBuffer,m=t.vertexAttributes.position.typedBufferStride;v(c,u,f,d,m,g)?(r(e,o,a),r(a,l,e)):(r(e,o,l),r(l,a,o))}}})(),p(x===3*l*d);(()=>{for(let e=0;e<4;++e){const n=x;if(c[e])continue;const o=t.outerEdges[e],s=t.innerEdges[e];let a=0,l=0;const u=o.count,f=s.count;p(f===i-1);let g=0;const h=1===e||2===e?(t,e,n)=>r(t,e,n):(t,e,n)=>r(t,n,e);for(;a<u-1||l<f-1;){const t=s.getVertexIndex(l),e=o.getVertexIndex(a),n=a<u-1,r=l<f-1;if(n&&(!r||(n?0+i*(a+.5)/(u-1):0)<=(r?1+S*(l+.5)/(f-1):0))){++a,m&&p(a<u);h(t,e,o.getVertexIndex(a)),g++}else{++l,m&&p(l<f);h(t,e,s.getVertexIndex(l)),g++}}m&&(p(a===u-1),p(l===f-1),p(g===u+f-2),p(g===i-2+o.count-1),p(x===n+3*g*d))}})(),p(x===3*(l+u)*d);const f=n=>{const o=t.outerEdges[n.connectedOuterEdgeOffset];let s=o.getVertexIndex(0),a=o.stride;for(let t=0;t<n.latitudeResolution;++t){const o=0===t?n.rowOffset:s+e;for(let e=0;e<i;e++)r(s,s+1,o+e),t<n.latitudeResolution-1&&r(s+1,o+e+1,o+e),s+=a;s=o,a=1}};(()=>n.forEach(f))()}else{(()=>{const n=Math.max(s[0],1)-1,r=Math.min(s[1],e-2)-1,i=Math.max(o[0],1)-1,a=Math.min(o[1],e-2)-1;for(let e=n;e<r;++e){const n=e*y;for(let e=i;e<a;++e){const o=n+e,s=o+1,r=s+y,i=r-1,a=t.vertexAttributes.position.typedBuffer,l=t.vertexAttributes.position.typedBufferStride;v(o,s,r,i,l,a)?(M[x]=o,M[x+1]=s,M[x+2]=r,M[x+3]=r,M[x+4]=i,M[x+5]=o):(M[x]=o,M[x+1]=s,M[x+2]=i,M[x+3]=i,M[x+4]=s,M[x+5]=r),x+=6}}})(),p(x===3*l*d);(()=>{for(let e=0;e<4;++e){if(c[e])continue;const n=t.outerEdges[e],o=t.innerEdges[e];let s=0,r=0;const a=n.count,l=o.count;p(l===i-1);const u=1===e||2===e,f=u?1:2,d=u?2:1,g=n.index0,m=n.stride,h=o.index0,y=o.stride;for(;s<a-1||r<l-1;){const t=h+r*y,e=g+s*m,n=s<a-1,o=r<l-1,c=n&&(!o||(n?0+i*(s+.5)/(a-1):0)<=(o?1+S*(r+.5)/(l-1):0));c?++s:++r;const u=c?e+m:t+y;M[x]=t,M[x+f]=e,M[x+d]=u,x+=3}}})(),p(x===3*(l+u)*d);const r=n=>{const o=t.outerEdges[n.connectedOuterEdgeOffset];let s=o.getVertexIndex(0),r=o.stride;for(let t=0;t<n.latitudeResolution;++t){const o=0===t?n.rowOffset:s+e;for(let e=0;e<i;e++){const i=o+e;M[x]=s,M[x+1]=s+1,M[x+2]=i,t<n.latitudeResolution-1?(M[x+3]=s+1,M[x+4]=i+1,M[x+5]=i,x+=6):x+=3,s+=r}s=o,r=1}};(()=>n.forEach(r))()}p(x===g),t.indices=M,t.indexCount=g}function k(t,e){const n=t.localOrigin,o=t.geometry,s=t.geometryState.neighborData.edgeResolutions,r=o.numVerticesPerSide-2,i=o.vertexAttributes;let a=e;for(let l=0;l<4;++l){{const t=0===l||2===l,e=(0===l?r-1:0)*r+(1===l?r-1:0),s=(t?0:1)*r+(t?1:0);o.innerEdges[l]=new f(i,n,e,s,r)}{const t=a,e=s[l]+1;o.outerEdges[l]=new f(i,n,t,1,e),a+=e}}}function z(n,o,s){const r=(o+2)%4,i=n.geometryState,a=n.tile,l=i.neighborData,f=a.level-s.level,d=1===o||3===o,g=l.edgeResolutions[o];p(t(g));const m=g+1,h=n.geometry,M=h.boundingBox,x=h.outerEdges[o],y=h.uvRange[0],S=h.uvRange[1],b=h.uvRange[2],v=h.uvRange[3],B=e(1===o?1:0,y,b),L=e(0===o?1:0,S,v),R=s.renderData,O=R.geometryState,T=R.geometry.outerEdges[r],D=a.getNeighborEdgeStartVertexIndex(o,s)*g,P=g*2**f;p(O.neighborData.edgeResolutions[r]===P),p(T.count-1===P);const A=R.localOrigin[0]-n.localOrigin[0],V=R.localOrigin[1]-n.localOrigin[1],E=R.localOrigin[2]-n.localOrigin[2],U=x.attributes,C=x.index0,I=x.stride,j=U.position.typedBuffer,w=U.position.typedBufferStride,N=U.normalCompressed.typedBuffer,H=U.normalCompressed.typedBufferStride,_=U.uv0,q=T.attributes,W=T.index0,F=T.stride,k=q.position.typedBuffer,z=q.position.typedBufferStride,G=q.normalCompressed.typedBuffer,J=q.normalCompressed.typedBufferStride;for(let t=1;t<m-1;++t){const n=C+I*t,o=W+F*(D+t),s=n*w,r=o*z,i=k[r]+A,a=k[r+1]+V,l=k[r+2]+E;j[s]=i,j[s+1]=a,j[s+2]=l,c(i,a,l,M);const f=n*H,m=o*J;N[f]=G[m],N[f+1]=G[m+1];const p=t/g,h=d?B:e(p,y,b),x=d?e(p,S,v):L;u(_,n,h,x)}}function G(t){const n=t.geometryState,o=n.neighborData,s=t.localOrigin,i=o.cornerNeighborData,a=t.geometry,l=a.outerEdges,f=a.boundingBox,d=t.tile,g="local"===t.tile.surface.view?.viewingMode,m=d.ellipsoid.radius,h=d.extentInRadians,M=d.horizontalScale;let x=0,S=0,b=0;const v=(t,e,n)=>{const o=h[0===e?1:3],s=h[0===t?0:2],r=Math.cos(o),i=Math.sin(o),a=Math.sin(s),l=Math.cos(s),c=m+n;x=l*r*c,S=a*r*c,b=i*c},B=g?(()=>{const n=t.geometryState.clippingArea,o=d.extent,s=null!=n&&(o[3]>n[3]||o[2]>n[2]||o[1]<n[1]||o[0]<n[0]),r=W(d.surface.isWebMercatorOnPlateeCarree,d.ellipsoid.radius,M);return(t,o,i)=>{const a=0===t?j[0]:j[2],l=0===o?j[1]:j[3],c=s?e(a,n[0],n[2]):a,u=s?e(l,n[1],n[3]):l,f=i;x=c*M,S=r(u),b=f}})():v;let L=0,R=0,O=0,T=0,D=0,P=0,A=0,V=0,U=0;const C=g&&t.tile.surface.isWebMercatorOnPlateeCarree,I=(t,e,n,o,s)=>{let r=0,i=0,a=0;if(g){const t=e*M,s=C?(Math.PI/2-2*Math.atan(Math.exp(-n/m)))*m:n*M;r=t-x,i=s-S,a=o-b}else{const s=E(t),l=t.tile,c=l.extent,u=l.extentInRadians,f=(e-c[0])/(c[2]-c[0]),d=(n-c[1])/(c[3]-c[1]),g=u[0]*(1-f)+u[2]*f,p=s(d),h=Math.cos(p),M=Math.sin(p),y=Math.sin(g),v=Math.cos(g),B=m+o;r=v*h*B-x,i=y*h*B-S,a=M*B-b}switch(s){case 0:A+=r,V+=i,U+=a;break;case 1:T-=r,D-=i,P-=a;break;case 2:A-=r,V-=i,U-=a;break;case 3:T+=r,D+=i,P+=a}},j=d.extent,w=n.clippingArea,N=null!=w?w:Y,H=j[0],_=j[2],q=j[1],F=j[3],k=[F>N[3],_>N[2],q<N[1],H<N[0]],z=Math.max(H,N[0]),G=Math.min(_,N[2]),K=Math.max(q,N[1]),X=Math.min(F,N[3]),$=a.uvRange[0],tt=a.uvRange[1],et=a.uvRange[2],nt=a.uvRange[3],ot=t=>{const e=i[t].cornerTiles;L=0,R=0,O=1;let n=1/0;for(let r=0;r<4;++r)n=Math.min(n,e[r]?.level??1/0);for(let r=0;r<4;++r){const t=e[r];Z[r]=t?.level===n?t:null}let o=1,s=0;for(let r=0;r<4;++r){const t=Z[r];t&&(o=Math.max(o,t?.renderData.geometryState.numVerticesPerSide),s=t.extent[2]-t.extent[0])}const a=s,l=o;p(l>1);const c=a/l;for(let i=0;i<4;++i){const t=Z[(i+3)%4],e=Z[i%4];if(!t&&!e)continue;const n=0===i?1:1===i?2:2===i?3:0,o=0===i?2:1===i?3:2===i?0:1;if(t&&e){const s=Q[i][0]*c,a=Q[i][1]*c,l=t.extent,u=l[0===n||1===n?2:0]+s,f=l[0===n||3===n?3:1]+a,d=e.extent,g=d[0===o||1===o?2:0]+s,m=d[0===o||3===o?3:1]+a,p=t.renderData,h=e.renderData,M=r(u,f,p.geometryState.samplerData),x=r(g,m,h.geometryState.samplerData);I(p,u,f,.5*(M+x),i)}else{const s=t??e,a=t?n:o,l=s.extent,u=Q[i],f=l[0===a||1===a?2:0]+u[0]*c,d=l[0===a||3===a?3:1]+u[1]*c,g=s.renderData,m=r(f,d,g.geometryState.samplerData);I(g,f,d,m,i)}}if(!g){const t=Math.sqrt(x*x+S*S+b*b);L=x/t,R=S/t,O=b/t}const u=Math.sqrt(T*T+D*D+P*P);T/=u,D/=u,P/=u;const f=Math.sqrt(A*A+V*V+U*U);if(A/=f,V/=f,U/=f,g||O*O<.999){L=P*V-D*U,R=T*U-P*A,O=D*A-T*V;const t=1/Math.sqrt(L*L+R*R+O*O);L*=t,R*=t,O*=t}};for(let E=0;E<4;++E){const o=E,a=(E+1)%4,g=0===E||1===E?1:0,m=0===E||3===E?1:0,h=e(g,$,et),M=e(m,tt,nt),v=l[o],T=0===E||3===E?v.count-1:0,D=l[a],P=0===E||1===E?D.count-1:0,A=i[E].cornerTiles;let V=-1;for(let t=0;t<4;++t){const e=A[t];e&&(-1===V||y(A[V],e)>0)&&(V=t)}const U=V,C=A[U];if(L=0,R=0,O=1,C!==d){const e=d.level-C.level,n=2**e,o=[C.lij[0]+e,C.lij[1]*n,C.lij[2]*n],s=[o[1]+n===d.lij[1],0===E&&(1===U||0===U&&C!==A[3])||1===E&&(0===U||1===U&&C!==A[2]),o[1]===d.lij[1]+1,2===E&&(3===U||2===U&&C!==A[1])||3===E&&(2===U||3===U&&C!==A[0])],r=s.reduce(((t,e)=>t+(e?1:0)),0);p(1===r||2===r);let i=-1,a=-1;const l=C.renderData;if(1===r){const e=s.findIndex((t=>t));p(0<=e&&e<=3),i=(e+2)%4;const n=t.geometryState.neighborData.edgeResolutions[e];a=d.getNeighborEdgeStartVertexIndex(e,C)*n+n*(0===e&&0===E||1===e&&0===E||2===e&&1===E||3===e&&3===E?1:0)}else{p(s[1]||s[3]),i=s[1]?3:1;const t=l.geometryState.neighborData.edgeResolutions[i];a=0===E||3===E?0:t}const g=l.geometry.outerEdges[i];{const e=v.index0+T*v.stride,n=D.index0+P*D.stride,o=g.index0+a*g.stride;{const s=g.attributes.position,r=s.typedBuffer,i=o*s.typedBufferStride,a=t.localOrigin,l=g.localOrigin,u=r[i]+l[0]-a[0],d=r[i+1]+l[1]-a[1],m=r[i+2]+l[2]-a[2];c(u,d,m,f);{const t=v.attributes.position,n=t.typedBuffer,o=e*t.typedBufferStride;n[o]=u,n[o+1]=d,n[o+2]=m}{const t=D.attributes.position,e=t.typedBuffer,o=n*t.typedBufferStride;e[o]=u,e[o+1]=d,e[o+2]=m}}u(v.attributes.uv0,e,h,M),u(D.attributes.uv0,n,h,M);{const t=g.attributes.normalCompressed.typedBuffer,s=o*g.attributes.normalCompressed.typedBufferStride;{const n=v.attributes.normalCompressed,o=n.typedBuffer,r=e*n.typedBufferStride;o[r]=t[s],o[r+1]=t[s+1]}{const e=D.attributes.normalCompressed,o=e.typedBuffer,r=n*e.typedBufferStride;o[r]=t[s],o[r+1]=t[s+1]}}}}else{const t=k[o],i=k[a];let l;if(t||i){const t=e(H*(1-g)+_*g,z,G),o=e(q*(1-m)+F*m,K,X),s=n.samplerData;l=r(t,o,s)}else l=J(A);B(g,m,l),ot(E);const u=x-s[0],d=S-s[1],p=b-s[2];c(u,d,p,f),v.setVertexFromValuesRawPositionUVNormal(T,u,d,p,h,M,L,R,O),D.setVertexFromValuesRawPositionUVNormal(P,u,d,p,h,M,L,R,O)}}for(let e=0;e<4;++e)Z[e]=null}function J(t){const e=t.reduce(((t,e)=>Math.min(t,e?.level??1/0)),1/0);m&&(p(!t[0]||!t[2]||x(t[0],t[2],a.SOUTH_WEST)),p(!t[1]||!t[3]||x(t[1],t[3],a.NORTH_WEST)));let n=0,o=0;for(let i=0;i<4;++i){const s=t[i];if(s&&s.level===e){const t=0===i||1===i,e=0===i||3===i,a=s.extent,l=a[t?0:2],c=a[e?1:3],u=s.renderData?.geometryState?.samplerData;o+=r(l,c,u),n++}}const s=n?o/n:0;return p(null!=s),s}function K(t){const e=t.vao,n=t.geometry.vertexAttributes.position.typedBuffer;e.vertexBuffers.geometry.setSubData(n,0,0,n.length)}const Q=[[0,1],[1,0],[0,-1],[-1,0]],X=new d,Y=s(-1/0,-1/0,1/0,1/0),Z=[null,null,null,null];function $(t,e,n){if(!e)return!1;const o=y(t,e);return o>0||0===o&&n>=2}export{U as createPlanarGlobePatch,v as createSphericalGlobePatch,R as updateCornerSpherical,I as updateCornersPlanar,j as updateEdgesAndCornersPlanar,L as updateEdgesAndCornersSpherical};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{get as e}from"../../../core/maybe.js";import{TextureUpdate as t}from"./interfaces.js";import{PROGRESSIVE_LOADING_MODULO as s}from"./TerrainConst.js";import{getLayerWithExtentRange as i}from"./terrainUtils.js";import{fallsWithinLayer as l}from"./tileUtils.js";class a{get updating(){return!!this._tileRequested}init(e,t,s,i){this.tile=e,this._layerIdx=t,this._layerClass=s,this._suspended=i,this._tileLayerInfo=e.getLayerInfo(t,s),this._tileRequested=null;const l=this._findAncestorWithData();this._setUpsampleTile(l)}startLoading(){return this._requestNext()}dispose(){this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null),this.tile=null,this._tileLayerInfo=null}setSuspension(e){e!==this._suspended&&(this._suspended=e,e?this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null):this._tileLayerInfo.data||this.update())}update(){const e=this._findAncestorWithData();return this._setUpsampleTile(e),this._requestNext()}dataArrived(e){this._setUpsampleTile(e),this._tileRequested=null,e===this.tile?this.tile.updateRenderData(this._layerClass,t.FADING):this._requestNext()}dataMissing(){this._tileRequested=null,this._tileLayerInfo.data=null,this._requestNext()}_agentDone(){this.tile.agentDone(this._layerIdx,this._layerClass),this.dispose()}_requestNext(){if(this._suspended)return!0;const e=this._findNextDownload();if(this._tileRequested){if(e===this._tileRequested)return!0;this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null}return null!=e?e.requestLayerData(this._layerIdx,this._layerClass,this)&&(this._tileRequested=e):this._agentDone(),!!this._tileRequested}_findNextDownload(){const t=this._layerIdx,a=this._layerClass,n=this.tile.surface.layerViewByIndex(t,a),r=i(n),{minLevel:h,maxLevel:d}=n.dataLevelRange,u=this._desiredMinLevelDelta,_=this._progressiveLevelModulo+u,o=this._scaleRangeEnabled?l:()=>!0;let f=this.tile;const p=f.level;let y;const I=this._tileLayerInfo.upsampleInfo,q=null!=I?I.tile.level:-1,v=null!=I&&q-p>=u,L=e(r,"tilemapCache");for(;f&&o(f,r,!1)&&f.level>=h;){const e=f.level,i=p-e,l=f.layerInfo[a][t];if(l.data&&i>=u){(!v||e>q)&&this._setUpsampleTile(f),l.dataInvalidated&&(y=f);break}if((null==L||"unavailable"!==L.getAvailability(f.lij[0],f.lij[1],f.lij[2]))&&e<=d&&!l.data&&!l.dataMissing&&((null==y||f.level===h||e%s==0||p-y.level<u)&&(y=f),i>=_))break;f=f.parent}if(null!=y&&p-y.level<u)if(I)y=null;else{const e=this._findAncestorWithData();if(null!=e){this._setUpsampleTile(e);y=e.layerInfo[a][t].dataInvalidated?e:null}}return y}_findAncestorWithData(){const e=this.tile.elevationLevel,t=this._desiredMinLevelDelta;let s;for(let i=this.tile;i;i=i.parent)if(i.hasLayerData(this._layerIdx,this._layerClass)){if(e-i.level>=t)return i;s=i}return s}_setUpsampleTile(e){this._tileLayerInfo.setUpsampleInfo(this.tile,e),this.tile.updateRenderData(this._layerClass,t.FADING)}get test(){return{findNextDownload:()=>this._findNextDownload(),tileLayerInfo:this._tileLayerInfo}}}class n extends a{get _desiredMinLevelDelta(){throw r}get _progressiveLevelModulo(){throw r}dispose(){}}const r=new Error("Abstract method called on TileAgent"),h=new n;export{h as TILE_AGENT_DONE,a as TileAgent};
5
+ import{TextureUpdate as e}from"./interfaces.js";import{PROGRESSIVE_LOADING_MODULO as t}from"./TerrainConst.js";import{getLayerWithExtentRange as s}from"./terrainUtils.js";import{fallsWithinLayer as i}from"./tileUtils.js";class l{get updating(){return!!this._tileRequested}init(e,t,s,i){this.tile=e,this._layerIdx=t,this._layerClass=s,this._suspended=i,this._tileLayerInfo=e.getLayerInfo(t,s),this._tileRequested=null;const l=this._findAncestorWithData();this._setUpsampleTile(l)}startLoading(){return this._requestNext()}dispose(){this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null),this.tile=null,this._tileLayerInfo=null}setSuspension(e){e!==this._suspended&&(this._suspended=e,e?this._tileRequested&&(this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null):this._tileLayerInfo.data||this.update())}update(){const e=this._findAncestorWithData();return this._setUpsampleTile(e),this._requestNext()}dataArrived(t){this._setUpsampleTile(t),this._tileRequested=null,t===this.tile?this.tile.updateRenderData(this._layerClass,e.FADING):this._requestNext()}dataMissing(){this._tileRequested=null,this._tileLayerInfo.data=null,this._requestNext()}_agentDone(){this.tile.agentDone(this._layerIdx,this._layerClass),this.dispose()}_requestNext(){if(this._suspended)return!0;const e=this._findNextDownload();if(this._tileRequested){if(e===this._tileRequested)return!0;this._tileRequested.unrequestLayerData(this._layerIdx,this._layerClass,this),this._tileRequested=null}return null!=e?e.requestLayerData(this._layerIdx,this._layerClass,this)&&(this._tileRequested=e):this._agentDone(),!!this._tileRequested}_findNextDownload(){const e=this._layerIdx,l=this._layerClass,a=this.tile.surface.layerViewByIndex(e,l),n=s(a),{minLevel:r,maxLevel:h}=a.dataLevelRange,d=this._desiredMinLevelDelta,u=this._progressiveLevelModulo+d,_=this._scaleRangeEnabled?i:()=>!0;let o=this.tile;const f=o.level;let p;const y=this._tileLayerInfo.upsampleInfo,I=null!=y?y.tile.level:-1,q=null!=y&&I-f>=d,v=n?.tilemapCache;for(;o&&_(o,n,!1)&&o.level>=r;){const s=o.level,i=f-s,a=o.layerInfo[l][e];if(a.data&&i>=d){(!q||s>I)&&this._setUpsampleTile(o),a.dataInvalidated&&(p=o);break}if((null==v||"unavailable"!==v.getAvailability(o.lij[0],o.lij[1],o.lij[2]))&&s<=h&&!a.data&&!a.dataMissing&&((null==p||o.level===r||s%t==0||f-p.level<d)&&(p=o),i>=u))break;o=o.parent}if(null!=p&&f-p.level<d)if(y)p=null;else{const t=this._findAncestorWithData();if(null!=t){this._setUpsampleTile(t);p=t.layerInfo[l][e].dataInvalidated?t:null}}return p}_findAncestorWithData(){const e=this.tile.elevationLevel,t=this._desiredMinLevelDelta;let s;for(let i=this.tile;i;i=i.parent)if(i.hasLayerData(this._layerIdx,this._layerClass)){if(e-i.level>=t)return i;s=i}return s}_setUpsampleTile(t){this._tileLayerInfo.setUpsampleInfo(this.tile,t),this.tile.updateRenderData(this._layerClass,e.FADING)}get test(){return{findNextDownload:()=>this._findNextDownload(),tileLayerInfo:this._tileLayerInfo}}}class a extends l{get _desiredMinLevelDelta(){throw n}get _progressiveLevelModulo(){throw n}dispose(){}}const n=new Error("Abstract method called on TileAgent"),r=new a;export{r as TILE_AGENT_DONE,l as TileAgent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{applySome as t}from"../../../../../core/maybe.js";import o from"../../../../../core/PooledArray.js";import{isArray as n}from"../../../../../core/typedArrayUtil.js";import{e as r,t as i}from"../../../../../chunks/mat3.js";import{c as s}from"../../../../../chunks/mat3f32.js";import{d as a,w as c,t as l}from"../../../../../chunks/vec3.js";import{a as m,c as f}from"../../../../../chunks/vec3f64.js";import{b as p}from"../../../../../chunks/vec32.js";import{c as u}from"../../../../../chunks/vec33.js";import{ViewingMode as h}from"../../../../ViewingMode.js";import{ColorMixModeEnum as b,encodeSymbolColor as g}from"../../../layers/support/symbolColorUtils.js";import{clone as d,computeOffsetObb as y,radius as j}from"../../../support/orientedBoundingBox.js";import{glLayout as C}from"../../../support/buffer/glUtil.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import _ from"./ComponentData.js";import{State as w,ComponentObject as O}from"./ComponentObject.js";import M from"./IntersectionGeometry.js";import{Renderable as x}from"./Renderable.js";import{RenderGeometry as A}from"./RenderGeometry.js";import{RenderSubmitSystem as D}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as S}from"./SourceGeometry.js";import{UniformComponentParameters as I}from"./UniformComponentParameters.js";import{ComponentParametersVarying as P,ComponentParametersUniform as E,ComponentParameterSummary as R,ComponentMaterial as U}from"./Material/ComponentMaterial.js";import{attributeLocations as B}from"./Material/ComponentTechnique.js";import{encodeElevationOffset as T}from"./Material/shader/ComponentData.glsl.js";import{getVisibility as L,updateVisibilityWithCount as V}from"../../lib/ComponentUtils.js";import{assert as k}from"../../lib/Util.js";import{VertexAttribute as G}from"../../lib/VertexAttribute.js";import{getVerticalOffsetI3S as N}from"../../lib/verticalOffsetUtils.js";import{EdgeInputBufferLayout as q}from"../../lib/edgeRendering/bufferLayouts.js";import{extractComponentsEdgeLocationsLayout as H}from"../../lib/edgeRendering/edgeProcessing.js";import{BufferManager as z}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as W}from"../../../../webgl/BufferObject.js";import{Usage as X,PrimitiveType as Y}from"../../../../webgl/enums.js";import{VertexArrayObject as F}from"../../../../webgl/VertexArrayObject.js";const J=e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class K{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._objects=[new o,new o],this._renderSubmit=new D(this),this._renderManager.register(this._renderSubmit),this._hasObjectAndLayerId=has("enable-feature:objectAndLayerId-rendering"),this._componentBufferManager=new z(e.rctx,2+(this._hasObjectAndLayerId?1:0))}destroy(){k(0===this._objects[w.Hidden].length&&0===this._objects[w.Visible].length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy()}createObject(e){const t=new O;return t.toMapSpace=e.toMapSpace,t.transform=e.transform,t.obb=d(e.obb),t.components=new _(this._componentBufferManager,e.geometry.componentOffsets),t.renderable=this._createRenderable(e,t.components),t.intersectionGeometry=new M(e.geometry.positionData,t.components),this._objects[t.visible].push(t),t}destroyObject(e){const t=e;this._objects[t.visible].removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const o=e;t!==o.visible&&(this._objects[o.visible].removeUnordered(o),this._objects[t].push(o),o.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>e.renderable.meta.cameraDepthSquared=a(t,e.obb.center)))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const o=e.renderable.material;t(o),o.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const o=e;o.components.visibility.reset(t),o.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.components.visibility.forEachComponent(t)}getComponentCount(e){const t=e,o=t.components.visibility.componentCount();return{visible:o,invisible:t.components.count-o}}setComponentData(e,t){const o=e,n=o.renderable.material,r=o.components,i=r.materialDataBuffer,s=r.materialDataIndices,a=new I,c=i.textureBuffer,l=new Uint8Array(4),m=new Uint32Array(l.buffer);let f=0,p=0,u=0,h=r.verticalOffsets,j=1/0,C=-1/0,v=!1,_=!1,w=0;for(let d=0;d<r.count;d++){t(d,a),f+=+(a.externalColor[3]<1),p+=+(a.externalColorMixMode===b.Replace&&1===a.externalColor[3]),u+=+a.castShadows,g(a.externalColor,a.externalColorMixMode,l),l[2]=254&l[2]|+a.castShadows,c.setData(s[d],0,l[0],l[1],l[2],l[3]),v||(v=d>0&&w!==m[0]),w=m[0],_||(_=0!==a.elevationOffset),_&&null==h&&(h=new Array(d).fill(0)),null!=h&&(h[d]=a.elevationOffset),j=Math.min(j,a.elevationOffset),C=Math.max(C,a.elevationOffset),T(a.elevationOffset,l),c.setData(s[d],1,l[0],l[1],l[2],l[3]);const e=a.objectAndLayerIdColor;null!=e&&c.setData(s[d],2,e[0],e[1],e[2],e[3]),a.pickable!==L(r.pickability,d)&&(r.pickability=V(r.pickability,r.count,d,a.pickable))}r.verticalOffsets=_?h:null,o.offsetObb=_?y(o.obb,j,C,this._viewingMode,null!=o.offsetObb?o.offsetObb:d(o.obb)):null,v||_||this._hasObjectAndLayerId?(n.componentParameters=new P,n.componentParameters.castShadows=Z(u,r.count),n.componentParameters.transparent=Z(f,r.count),n.componentParameters.opaqueOverride=Z(p,r.count),n.componentParameters.texture=c,c.updateTexture()):(n.componentParameters=new E,n.componentParameters.castShadows=a.castShadows?R.All:R.None,n.componentParameters.externalColor=a.externalColor,n.componentParameters.externalColorMixMode=a.externalColorMixMode),this._notifyDirty()}getComponentAabb(e,t,o,n=!1){e.intersectionGeometry.getComponentAabb(t,o);const r=e,i=r.components.verticalOffsets;if(n||null==i)return o;const s=i[t];if(this._viewingMode===h.Local||0===s)return o[2]+=s,o[5]+=s,o;const a=N(s);return a.localOrigin=r.transform.position,a.applyToAabb(o)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,o){return e.intersectionGeometry.getComponentPositions(t,o)}intersect(e,t,o,n,s,a){const m=e;null!=s&&(s.localOrigin=m.transform.position);const f=r($,m.transform.rotationScale);c(ee,t,m.transform.position),c(te,o,m.transform.position),l(ee,ee,f),l(te,te,f);const p=i($,f);return m.intersectionGeometry.intersect(ee,te,n,p,s,m.components.verticalOffsets,a)}addEdges(e,t,o,n){const r=e,{indices:i,positions:s}=r.intersectionGeometry,a=r.components.offsets;return t.addComponentObject(e,r.transform,{center:r.obb.center,radius:j(r.obb)},s,i,a,o,n)}async extractEdgeInformation(e,t,o){const n=e,r=n.components.visibility;if(r.allInvisible())return{buffer:H.createBuffer(0),origin:[0,0,0]};const{indices:i,positions:s}=n.intersectionGeometry,a=n.components.offsets,c=q.createBuffer(s.length/3);u(c.position.typedBuffer,s,c.position.typedBufferStride,3),p(c.position,c.position,n.transform.rotationScale),this._setComponentIndices(c.componentIndex,i,a);const l=c.count,f=this._computeVisibilityIndices(i,r,a,l);return{origin:m(n.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:f,indicesLength:f.length,skipDeduplicate:!0,data:c,writerSettings:{reducedPrecision:!1,variants:0}},o)}}_setComponentIndices(e,t,o){let n=0;for(let r=0;r<o.length-1;r++){const i=o[r],s=o[r+1];for(let o=i;o<s;o++){const r=t?t[o]:o;e.set(r,n)}n++}}_computeVisibilityIndices(e,t,o,r){if(e&&t.allVisible())return e;let i=0;t.forEachComponentRange(((e,t)=>(i+=o[t]-o[e],!0)));const s=n(e)?new Array(i):2===e?.BYTES_PER_ELEMENT||r<=65536?new Uint16Array(i):new Uint32Array(i);let a=0;return t.forEachComponentRange(((t,n)=>{const r=o[t],i=o[n];for(let o=r;o<i;o++)s[a++]=e?e[o]:o;return!0})),s}addComponentHighlight(e,t){const o=e.components;null==o.highlightCounts&&(o.highlightCounts=new Uint32Array(o.count+1));0===o.highlightCounts[t]++&&(o.highlightsDirty(),this._notifyDirty()),o.highlightCounts[o.count]++}removeComponentHighlight(e,t){const o=e.components;if(null==o.highlightCounts)return void J.warn("Removing non-existing highlight.");const n=o.highlightCounts[t],r=o.highlightCounts[o.count];if(0!==n){if(n>1)return o.highlightCounts[t]=n-1,void(o.highlightCounts[o.count]=r-1);o.highlightCounts[t]=0,o.highlightsDirty(),this._notifyDirty(),1===r?o.highlightCounts=null:o.highlightCounts[o.count]=r-1}else J.warn("Removing non-existing highlight.")}clearHighlights(e){const t=e.components;null!=t.highlightCounts&&(t.highlightCounts=null,t.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[w.Visible]}_createRenderable(e,o){const n=this._renderManager.rctx,r=e.geometry,i=r.vertices.layoutParameters,s=W.createVertex(n,X.STATIC_DRAW,r.vertices.data),a=t(r.indices,(e=>W.createIndex(n,X.STATIC_DRAW,e))),c=C(S(i)),l=new Uint16Array(r.vertices.count);for(let t=0;t<o.count;t++){const e=o.offsets[t],n=o.offsets[t+1],i=o.materialDataIndices[t];if(null!=r.indices)for(let t=e;t<n;t++){l[r.indices[t]]=i}else for(let t=e;t<n;t++)l[t]=i}const m=W.createVertex(n,X.STATIC_DRAW,l.buffer),f=new U(e.transform,e.toMapSpace),p=new F(n,B,{data:c,componentIndices:Q},{data:s,componentIndices:m},a),u=new A(p,Y.TRIANGLES,i,null!=a),h={cameraDepthSquared:.5,gpuMemoryEstimate:s.byteSize+m.byteSize+(null!=a?a.byteSize:0)};return new x(f,u,h)}_notifyDirty(){this._renderManager.notifyDirty()}}const Q=C(v().u16(G.COMPONENTINDEX));function Z(e,t){return e===t?R.All:0===e?R.None:R.Some}const $=s(),ee=f(),te=f();export{K as ComponentObjectCollection};
5
+ import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{applySome as t}from"../../../../../core/maybe.js";import o from"../../../../../core/PooledArray.js";import{isArray as n}from"../../../../../core/typedArrayUtil.js";import{e as r,t as i}from"../../../../../chunks/mat3.js";import{c as s}from"../../../../../chunks/mat3f32.js";import{d as a,w as c,t as l}from"../../../../../chunks/vec3.js";import{a as m,c as f}from"../../../../../chunks/vec3f64.js";import{b as p}from"../../../../../chunks/vec32.js";import{c as h}from"../../../../../chunks/vec33.js";import{ViewingMode as u}from"../../../../ViewingMode.js";import{ColorMixModeEnum as b,encodeSymbolColor as d}from"../../../layers/support/symbolColorUtils.js";import{clone as g,computeOffsetObb as y,radius as j}from"../../../support/orientedBoundingBox.js";import{glLayout as C}from"../../../support/buffer/glUtil.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import _ from"./ComponentData.js";import{State as w,ComponentObject as M}from"./ComponentObject.js";import O from"./IntersectionGeometry.js";import{Renderable as x}from"./Renderable.js";import{RenderGeometry as A}from"./RenderGeometry.js";import{RenderSubmitSystem as D}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as S}from"./SourceGeometry.js";import{UniformComponentParameters as I}from"./UniformComponentParameters.js";import{ComponentParametersVarying as P,ComponentParametersUniform as E,ComponentParameterSummary as R,ComponentMaterial as U}from"./Material/ComponentMaterial.js";import{attributeLocations as B}from"./Material/ComponentTechnique.js";import{encodeElevationOffset as T}from"./Material/shader/ComponentData.glsl.js";import{getVisibility as L,updateVisibilityWithCount as V}from"../../lib/ComponentUtils.js";import{assert as k}from"../../lib/Util.js";import{VertexAttribute as G}from"../../lib/VertexAttribute.js";import{getVerticalOffsetI3S as N}from"../../lib/verticalOffsetUtils.js";import{EdgeInputBufferLayout as q}from"../../lib/edgeRendering/bufferLayouts.js";import{extractComponentsEdgeLocationsLayout as H}from"../../lib/edgeRendering/edgeProcessing.js";import{BufferManager as z}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as W}from"../../../../webgl/BufferObject.js";import{Usage as X,PrimitiveType as Y}from"../../../../webgl/enums.js";import{VertexArrayObject as F}from"../../../../webgl/VertexArrayObject.js";const J=e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class K{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._objects=[new o,new o],this._renderSubmit=new D(this),this._renderManager.register(this._renderSubmit),this._hasObjectAndLayerId=has("enable-feature:objectAndLayerId-rendering"),this._componentBufferManager=new z(e.rctx,2+(this._hasObjectAndLayerId?1:0))}destroy(){k(0===this._objects[w.Hidden].length&&0===this._objects[w.Visible].length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy();const e=this._objects.flatMap((e=>e.toArray()));for(const t of e)t?.destroy()}createObject(e){const t=new M;return t.toMapSpace=e.toMapSpace,t.transform=e.transform,t.obb=g(e.obb),t.components=new _(this._componentBufferManager,e.geometry.componentOffsets),t.renderable=this._createRenderable(e,t.components),t.intersectionGeometry=new O(e.geometry.positionData,t.components),this._objects[t.visible].push(t),t}destroyObject(e){const t=e;this._objects[t.visible].removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const o=e;t!==o.visible&&(this._objects[o.visible].removeUnordered(o),this._objects[t].push(o),o.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>e.renderable.meta.cameraDepthSquared=a(t,e.obb.center)))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const o=e.renderable.material;t(o),o.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const o=e;o.components.visibility.reset(t),o.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.components.visibility.forEachComponent(t)}getComponentCount(e){const t=e,o=t.components.visibility.componentCount();return{visible:o,invisible:t.components.count-o}}setComponentData(e,t){const o=e,n=o.renderable.material,r=o.components,i=r.materialDataBuffer,s=r.materialDataIndices,a=new I,c=i.textureBuffer,l=new Uint8Array(4),m=new Uint32Array(l.buffer);let f=0,p=0,h=0,u=r.verticalOffsets,j=1/0,C=-1/0,v=!1,_=!1,w=0;for(let g=0;g<r.count;g++){t(g,a),f+=+(a.externalColor[3]<1),p+=+(a.externalColorMixMode===b.Replace&&1===a.externalColor[3]),h+=+a.castShadows,d(a.externalColor,a.externalColorMixMode,l),l[2]=254&l[2]|+a.castShadows,c.setData(s[g],0,l[0],l[1],l[2],l[3]),v||(v=g>0&&w!==m[0]),w=m[0],_||(_=0!==a.elevationOffset),_&&null==u&&(u=new Array(g).fill(0)),null!=u&&(u[g]=a.elevationOffset),j=Math.min(j,a.elevationOffset),C=Math.max(C,a.elevationOffset),T(a.elevationOffset,l),c.setData(s[g],1,l[0],l[1],l[2],l[3]);const e=a.objectAndLayerIdColor;null!=e&&c.setData(s[g],2,e[0],e[1],e[2],e[3]),a.pickable!==L(r.pickability,g)&&(r.pickability=V(r.pickability,r.count,g,a.pickable))}r.verticalOffsets=_?u:null,o.offsetObb=_?y(o.obb,j,C,this._viewingMode,null!=o.offsetObb?o.offsetObb:g(o.obb)):null,v||_||this._hasObjectAndLayerId?(n.componentParameters=new P,n.componentParameters.castShadows=Z(h,r.count),n.componentParameters.transparent=Z(f,r.count),n.componentParameters.opaqueOverride=Z(p,r.count),n.componentParameters.texture=c,c.updateTexture()):(n.componentParameters=new E,n.componentParameters.castShadows=a.castShadows?R.All:R.None,n.componentParameters.externalColor=a.externalColor,n.componentParameters.externalColorMixMode=a.externalColorMixMode),this._notifyDirty()}getComponentAabb(e,t,o,n=!1){e.intersectionGeometry.getComponentAabb(t,o);const r=e,i=r.components.verticalOffsets;if(n||null==i)return o;const s=i[t];if(this._viewingMode===u.Local||0===s)return o[2]+=s,o[5]+=s,o;const a=N(s);return a.localOrigin=r.transform.position,a.applyToAabb(o)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,o){return e.intersectionGeometry.getComponentPositions(t,o)}intersect(e,t,o,n,s,a){const m=e;null!=s&&(s.localOrigin=m.transform.position);const f=r($,m.transform.rotationScale);c(ee,t,m.transform.position),c(te,o,m.transform.position),l(ee,ee,f),l(te,te,f);const p=i($,f);return m.intersectionGeometry.intersect(ee,te,n,p,s,m.components.verticalOffsets,a)}addEdges(e,t,o,n){const r=e,{indices:i,positions:s}=r.intersectionGeometry,a=r.components.offsets;return t.addComponentObject(e,r.transform,{center:r.obb.center,radius:j(r.obb)},s,i,a,o,n)}async extractEdgeInformation(e,t,o){const n=e,r=n.components.visibility;if(r.allInvisible())return{buffer:H.createBuffer(0),origin:[0,0,0]};const{indices:i,positions:s}=n.intersectionGeometry,a=n.components.offsets,c=q.createBuffer(s.length/3);h(c.position.typedBuffer,s,c.position.typedBufferStride,3),p(c.position,c.position,n.transform.rotationScale),this._setComponentIndices(c.componentIndex,i,a);const l=c.count,f=this._computeVisibilityIndices(i,r,a,l);return{origin:m(n.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:f,indicesLength:f.length,skipDeduplicate:!0,data:c,writerSettings:{reducedPrecision:!1,variants:0}},o)}}_setComponentIndices(e,t,o){let n=0;for(let r=0;r<o.length-1;r++){const i=o[r],s=o[r+1];for(let o=i;o<s;o++){const r=t?t[o]:o;e.set(r,n)}n++}}_computeVisibilityIndices(e,t,o,r){if(e&&t.allVisible())return e;let i=0;t.forEachComponentRange(((e,t)=>(i+=o[t]-o[e],!0)));const s=n(e)?new Array(i):2===e?.BYTES_PER_ELEMENT||r<=65536?new Uint16Array(i):new Uint32Array(i);let a=0;return t.forEachComponentRange(((t,n)=>{const r=o[t],i=o[n];for(let o=r;o<i;o++)s[a++]=e?e[o]:o;return!0})),s}addComponentHighlight(e,t){const o=e.components;null==o.highlightCounts&&(o.highlightCounts=new Uint32Array(o.count+1));0===o.highlightCounts[t]++&&(o.highlightsDirty(),this._notifyDirty()),o.highlightCounts[o.count]++}removeComponentHighlight(e,t){const o=e.components;if(null==o.highlightCounts)return void J.warn("Removing non-existing highlight.");const n=o.highlightCounts[t],r=o.highlightCounts[o.count];if(0!==n){if(n>1)return o.highlightCounts[t]=n-1,void(o.highlightCounts[o.count]=r-1);o.highlightCounts[t]=0,o.highlightsDirty(),this._notifyDirty(),1===r?o.highlightCounts=null:o.highlightCounts[o.count]=r-1}else J.warn("Removing non-existing highlight.")}clearHighlights(e){const t=e.components;null!=t.highlightCounts&&(t.highlightCounts=null,t.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[w.Visible]}_createRenderable(e,o){const n=this._renderManager.rctx,r=e.geometry,i=r.vertices.layoutParameters,s=W.createVertex(n,X.STATIC_DRAW,r.vertices.data),a=t(r.indices,(e=>W.createIndex(n,X.STATIC_DRAW,e))),c=C(S(i)),l=new Uint16Array(r.vertices.count);for(let t=0;t<o.count;t++){const e=o.offsets[t],n=o.offsets[t+1],i=o.materialDataIndices[t];if(null!=r.indices)for(let t=e;t<n;t++){l[r.indices[t]]=i}else for(let t=e;t<n;t++)l[t]=i}const m=W.createVertex(n,X.STATIC_DRAW,l.buffer),f=new U(e.transform,e.toMapSpace),p=new F(n,B,{data:c,componentIndices:Q},{data:s,componentIndices:m},a),h=new A(p,Y.TRIANGLES,i,null!=a),u={cameraDepthSquared:.5,gpuMemoryEstimate:s.byteSize+m.byteSize+(null!=a?a.byteSize:0)};return new x(f,h,u)}_notifyDirty(){this._renderManager.notifyDirty()}}const Q=C(v().u16(G.COMPONENTINDEX));function Z(e,t){return e===t?R.All:0===e?R.None:R.Some}const $=s(),ee=f(),te=f();export{K as ComponentObjectCollection};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{releaseMaybe as t}from"../../../../../../core/maybe.js";import{e as r,t as s}from"../../../../../../chunks/mat3.js";import{a as o}from"../../../../../../chunks/mat3f32.js";import{G as a}from"../../../../../../chunks/vec3.js";import{f as i}from"../../../../../../chunks/vec3f32.js";import{v as l}from"../../../../../../chunks/vec4.js";import{f as n}from"../../../../../../chunks/vec4f32.js";import{f as u}from"../../../../../../chunks/vec4f64.js";import{ColorMixModeEnum as h}from"../../../../layers/support/symbolColorUtils.js";import{OverlayIndex as p,RenderTargetType as c}from"../../../../terrain/interfaces.js";import{ComponentTechnique as d}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as m,IntegratedMeshMode as g}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as y}from"./shader/ComponentData.glsl.js";import{g as T}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as x}from"./shader/VertexDiscardByOpacity.glsl.js";import{MaterialBase as f,parameter as v,parameterBlock as b,MaterialParameterBlock as M}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as O}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as C}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as S}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as P}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{defaultMaskAlphaCutoff as j}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as N}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as A,CullFaceOptions as D}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as R}from"../../../lib/TransparencyPassType.js";class I extends f{constructor(e,t){super(),this.toMapSpace=t,this.baseColor=n(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=i(1,1,.5),this.emissiveFactor=i(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new _,this.componentParameters=new W,this.textureAlphaCutoff=j,this.alphaDiscardMode=A.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=N.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new m;const a=new q(e.position),l=o(e.rotationScale);r(l,l),this.transformNormalGlobalFromModel=s(l,l),this.transformWorldFromModelTL=a.low,this.transformWorldFromModelTH=a.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return null!=this.baseColorTexture?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return null!=this.metallicRoughnessTexture?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return null!=this.emissionTexture?this.emissionTexture.glTexture:null}get textureOcclusion(){return null!=this.occlusionTexture?this.occlusionTexture.glTexture:null}get textureNormal(){return null!=this.normalTexture?this.normalTexture.glTexture:null}prepareTechnique(e,t,r,s){const o=this._techniqueConfiguration;o.hasVertexColors=s.colors,o.hasNormals=s.normals,o.textureCoordinateType=s.textureCoordinates,o.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,o.hasEmissionTexture=null!=this.emissionTexture,o.hasOcclusionTexture=null!=this.occlusionTexture,o.hasNormalTexture=null!=this.normalTexture,o.transparencyPassType=t.identifier===O.Material&&null!=r.transparencyPassType?r.transparencyPassType:R.NONE,o.hasMultipassTerrain=t.identifier===O.Material&&null!=r.multipassTerrain&&r.multipassTerrain.enabled,o.cullAboveGround=t.identifier===O.Material&&null!=r.multipassTerrain&&r.multipassTerrain.cullAboveGround,o.ellipsoidMode=this.ellipsoidMode,o.componentData=this.componentParameters.type,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?S.View:S.None,o.hasBaseColorTexture=null!=this.baseColorTexture;const a=this._computeWhichMaterialPass();o.blendingEnabled=a===k.Transparent||a===k.OpaqueAndTransparent,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?L(r)?T(r)?g.ColorOverlayWithWater:g.ColorOverlay:g.NoOverlay:g.None,o.hasPolygonOffset=this.polygonOffsetEnabled;const i=this.hasParametersFromSource&&null==this.baseColorTexture;if(o.pbrMode=o.integratedMeshMode===g.ColorOverlayWithWater?P.WaterOnIntegratedMesh:this.usePBR?i?P.Schematic:P.Normal:P.Disabled,o.normalType=o.integratedMeshMode===g.None?o.hasNormals?w.CompressedAttribute:w.ScreenDerivative:w.Ground,o.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,t.identifier===O.ShadowMap)o.output=C.Shadow,o.vertexDiscardMode=x.None;else if(t.identifier===O.Highlight)o.output=C.Highlight,o.vertexDiscardMode=x.None;else{switch(this._computeWhichMaterialPass()===k.OpaqueAndTransparent?o.vertexDiscardMode=t.transparent?x.Opaque:x.Transparent:o.vertexDiscardMode=x.None,o.output=t.output,o.receiveAmbientOcclusion=!1,o.receiveShadows=!1,t.output){case C.Color:o.receiveAmbientOcclusion=r.ssaoHelper.active,o.hasOccludees=r.hasOccludees,o.receiveShadows=r.shadowMap.ready,o.hasScreenSpaceReflections=r.ssr.enabled,o.hasCloudsReflections=null!=r.cloudsFade.data;break;case C.Alpha:o.hasOccludees=r.hasOccludees;break;case C.ObjectAndLayerIdColor:o.objectAndLayerIdColor=!0}o.snowCover=this.hasSnowCover(r)}return this._technique=e.releaseAndAcquire(d,o,this._technique),this._setClean(),this._technique}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,r){if(0===this.objectOpacity)return;const s=r.renderable.geometry,o=r.components,a=r.renderable.meta.cameraDepthSquared,i=o.geometryRanges,l=o.highlightRanges,n=o.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case k.Opaque:e.materialOpaque.submitDraw(this,s,i,a);break;case k.Transparent:e.materialTransparent.submitDraw(this,s,i,a);break;case k.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,s,i,a),e.materialTransparent.submitDraw(this,s,i,a);break;case k.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,s,i,a),B(t)&&e.highlightIntegratedMesh.submitDraw(this,s,i,a)}const u=this.componentParameters.castShadows!==F.None;u&&e.shadowMap.submitDraw(this,s,i,a),null!=l&&(e.highlight.submitDraw(this,s,l,a),u&&e.highlightShadowMap.submitDraw(this,s,l,a)),u&&null!=n&&e.defaultShadowMap.submitDraw(this,s,n,a)}_computeWhichMaterialPass(){return this.isIntegratedMesh?k.IntegratedMesh:this.objectOpacity<1?k.Transparent:this.componentParameters.opaqueOverride===F.All?k.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===A.Blend||this.alphaDiscardMode===A.MaskBlend?k.Transparent:this.componentParameters.transparent===F.None?k.Opaque:this.componentParameters.transparent===F.All?k.Transparent:k.OpaqueAndTransparent}}var k,F;e([v({vectorOps:l})],I.prototype,"baseColor",void 0),e([v()],I.prototype,"usePBR",void 0),e([v()],I.prototype,"hasParametersFromSource",void 0),e([v({vectorOps:a})],I.prototype,"mrrFactors",void 0),e([v({vectorOps:a})],I.prototype,"emissiveFactor",void 0),e([v({dispose:!0})],I.prototype,"baseColorTexture",void 0),e([v({dispose:!0})],I.prototype,"metallicRoughnessTexture",void 0),e([v({dispose:!0})],I.prototype,"emissionTexture",void 0),e([v({dispose:!0})],I.prototype,"occlusionTexture",void 0),e([v({dispose:!0})],I.prototype,"normalTexture",void 0),e([v()],I.prototype,"objectOpacity",void 0),e([b()],I.prototype,"commonMaterialParameters",void 0),e([b()],I.prototype,"componentParameters",void 0),e([v()],I.prototype,"textureAlphaCutoff",void 0),e([v()],I.prototype,"alphaDiscardMode",void 0),e([v()],I.prototype,"isIntegratedMesh",void 0),e([v()],I.prototype,"polygonOffsetEnabled",void 0),e([v()],I.prototype,"ellipsoidMode",void 0),e([v()],I.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class _ extends M{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=D.Back,this.hasSlicePlane=!0}}e([v()],_.prototype,"doubleSided",void 0),e([v()],_.prototype,"cullFace",void 0),e([v()],_.prototype,"hasSlicePlane",void 0);class W extends M{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=h.Multiply,this.castShadows=F.All}get transparent(){return this.externalColor[3]<1?F.All:F.None}get opaqueOverride(){return this.externalColorMixMode===h.Replace&&1===this.externalColor[3]?F.All:F.None}get visible(){return this.externalColor[3]>0?F.All:F.None}get type(){return y.Uniform}}e([v({vectorOps:l})],W.prototype,"externalColor",void 0),e([v()],W.prototype,"externalColorMixMode",void 0),e([v()],W.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(F||(F={}));class E extends M{constructor(){super(...arguments),this.texture=null,this.transparent=F.None,this.opaqueOverride=F.None,this.castShadows=F.None}get type(){return y.Varying}}function B(e){return 0!==e.overlays.length&&null!=e.overlays[p.INNER].getValidTexture(c.Highlight)}function L(e){return 0!==e.overlays.length&&null!=e.overlays[p.INNER].getColorTextureNoRasterImage()}e([v()],E.prototype,"texture",void 0),e([v()],E.prototype,"transparent",void 0),e([v()],E.prototype,"opaqueOverride",void 0),e([v()],E.prototype,"castShadows",void 0);export{_ as CommonMaterialParameters,I as ComponentMaterial,F as ComponentParameterSummary,W as ComponentParametersUniform,E as ComponentParametersVarying};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{releaseMaybe as t}from"../../../../../../core/maybe.js";import{e as r,t as s}from"../../../../../../chunks/mat3.js";import{a as o}from"../../../../../../chunks/mat3f32.js";import{G as a}from"../../../../../../chunks/vec3.js";import{f as i}from"../../../../../../chunks/vec3f32.js";import{v as l}from"../../../../../../chunks/vec4.js";import{f as n}from"../../../../../../chunks/vec4f32.js";import{f as u}from"../../../../../../chunks/vec4f64.js";import{ColorMixModeEnum as h}from"../../../../layers/support/symbolColorUtils.js";import{OverlayIndex as p,RenderTargetType as c}from"../../../../terrain/interfaces.js";import{ComponentTechnique as d}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as m,IntegratedMeshMode as g}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as y}from"./shader/ComponentData.glsl.js";import{g as T}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as x}from"./shader/VertexDiscardByOpacity.glsl.js";import{MaterialBase as f,parameter as v,parameterBlock as b,MaterialParameterBlock as M}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as O}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as C}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as S}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as P}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{defaultMaskAlphaCutoff as j}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as N}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as A,CullFaceOptions as D}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as R}from"../../../lib/TransparencyPassType.js";class I extends f{constructor(e,t){super(),this.toMapSpace=t,this.baseColor=n(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=i(1,1,.5),this.emissiveFactor=i(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new _,this.componentParameters=new W,this.textureAlphaCutoff=j,this.alphaDiscardMode=A.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=N.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new m;const a=new q(e.position),l=o(e.rotationScale);r(l,l),this.transformNormalGlobalFromModel=s(l,l),this.transformWorldFromModelTL=a.low,this.transformWorldFromModelTH=a.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return null!=this.baseColorTexture?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return null!=this.metallicRoughnessTexture?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return null!=this.emissionTexture?this.emissionTexture.glTexture:null}get textureOcclusion(){return null!=this.occlusionTexture?this.occlusionTexture.glTexture:null}get textureNormal(){return null!=this.normalTexture?this.normalTexture.glTexture:null}prepareTechnique(e,t,r,s){const o=this._techniqueConfiguration;o.hasVertexColors=s.colors,o.hasNormals=s.normals,o.textureCoordinateType=s.textureCoordinates,o.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,o.hasEmissionTexture=null!=this.emissionTexture,o.hasOcclusionTexture=null!=this.occlusionTexture,o.hasNormalTexture=null!=this.normalTexture,o.transparencyPassType=t.identifier===O.Material&&null!=r.transparencyPassType?r.transparencyPassType:R.NONE,o.hasMultipassTerrain=t.identifier===O.Material&&null!=r.multipassTerrain&&r.multipassTerrain.enabled,o.cullAboveGround=t.identifier===O.Material&&null!=r.multipassTerrain&&r.multipassTerrain.cullAboveGround,o.ellipsoidMode=this.ellipsoidMode,o.componentData=this.componentParameters.type,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?S.View:S.None,o.hasBaseColorTexture=null!=this.baseColorTexture;const a=this._computeWhichMaterialPass();o.blendingEnabled=a===k.Transparent||a===k.OpaqueAndTransparent,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?L(r)?T(r)?g.ColorOverlayWithWater:g.ColorOverlay:g.NoOverlay:g.None,o.hasPolygonOffset=this.polygonOffsetEnabled;const i=this.hasParametersFromSource&&null==this.baseColorTexture;if(o.pbrMode=o.integratedMeshMode===g.ColorOverlayWithWater?P.WaterOnIntegratedMesh:this.usePBR?i?P.Schematic:P.Normal:P.Disabled,o.normalType=o.integratedMeshMode===g.None?o.hasNormals?w.CompressedAttribute:w.ScreenDerivative:w.Ground,o.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,t.identifier===O.ShadowMap)o.output=C.Shadow,o.vertexDiscardMode=x.None;else if(t.identifier===O.Highlight)o.output=C.Highlight,o.vertexDiscardMode=x.None;else{switch(this._computeWhichMaterialPass()===k.OpaqueAndTransparent?o.vertexDiscardMode=t.transparent?x.Opaque:x.Transparent:o.vertexDiscardMode=x.None,o.output=t.output,o.receiveAmbientOcclusion=!1,o.receiveShadows=!1,t.output){case C.Color:o.receiveAmbientOcclusion=r.ssaoHelper.active,o.hasOccludees=r.hasOccludees,o.receiveShadows=r.shadowMap.ready,o.hasScreenSpaceReflections=r.ssr.enabled,o.hasCloudsReflections=null!=r.cloudsFade.data;break;case C.Alpha:o.hasOccludees=r.hasOccludees;break;case C.ObjectAndLayerIdColor:o.objectAndLayerIdColor=!0}o.snowCover=this.hasSnowCover(r)}return this._technique=e.releaseAndAcquire(d,o,this._technique),this._setClean(),this._technique}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,r){if(0===this.objectOpacity)return;const s=r.renderable.geometry,o=r.components,a=r.renderable.meta.cameraDepthSquared,i=o.geometryRanges,l=o.highlightRanges,n=o.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case k.Opaque:e.materialOpaque.submitDraw(this,s,i,a);break;case k.Transparent:e.materialTransparent.submitDraw(this,s,i,a);break;case k.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,s,i,a),e.materialTransparent.submitDraw(this,s,i,a);break;case k.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,s,i,a),B(t)&&e.highlightIntegratedMesh.submitDraw(this,s,i,a)}const u=this.componentParameters.castShadows!==F.None;u&&e.shadowMap.submitDraw(this,s,i,a),null!=l&&(e.highlight.submitDraw(this,s,l,a),u&&e.highlightShadowMap.submitDraw(this,s,l,a)),u&&null!=n&&e.defaultShadowMap.submitDraw(this,s,n,a)}_computeWhichMaterialPass(){return this.isIntegratedMesh?k.IntegratedMesh:this.objectOpacity<1?k.Transparent:this.componentParameters.opaqueOverride===F.All?k.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===A.Blend||this.alphaDiscardMode===A.MaskBlend?k.Transparent:this.componentParameters.transparent===F.None?k.Opaque:this.componentParameters.transparent===F.All?k.Transparent:k.OpaqueAndTransparent}}var k,F;e([v({vectorOps:l})],I.prototype,"baseColor",void 0),e([v()],I.prototype,"usePBR",void 0),e([v()],I.prototype,"hasParametersFromSource",void 0),e([v({vectorOps:a})],I.prototype,"mrrFactors",void 0),e([v({vectorOps:a})],I.prototype,"emissiveFactor",void 0),e([v({dispose:!0})],I.prototype,"baseColorTexture",void 0),e([v({dispose:!0})],I.prototype,"metallicRoughnessTexture",void 0),e([v({dispose:!0})],I.prototype,"emissionTexture",void 0),e([v({dispose:!0})],I.prototype,"occlusionTexture",void 0),e([v({dispose:!0})],I.prototype,"normalTexture",void 0),e([v()],I.prototype,"objectOpacity",void 0),e([b()],I.prototype,"commonMaterialParameters",void 0),e([b()],I.prototype,"componentParameters",void 0),e([v()],I.prototype,"textureAlphaCutoff",void 0),e([v()],I.prototype,"alphaDiscardMode",void 0),e([v()],I.prototype,"isIntegratedMesh",void 0),e([v()],I.prototype,"polygonOffsetEnabled",void 0),e([v()],I.prototype,"ellipsoidMode",void 0),e([v()],I.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class _ extends M{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=D.Back,this.hasSlicePlane=!0}}e([v()],_.prototype,"doubleSided",void 0),e([v()],_.prototype,"cullFace",void 0),e([v()],_.prototype,"hasSlicePlane",void 0);class W extends M{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=h.Multiply,this.castShadows=F.All}get transparent(){return this.externalColor[3]<1?F.All:F.None}get opaqueOverride(){return this.externalColorMixMode===h.Replace&&1===this.externalColor[3]?F.All:F.None}get visible(){return this.externalColor[3]>0?F.All:F.None}get type(){return y.Uniform}}e([v({vectorOps:l})],W.prototype,"externalColor",void 0),e([v()],W.prototype,"externalColorMixMode",void 0),e([v()],W.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(F||(F={}));class E extends M{constructor(){super(...arguments),this.texture=null,this.transparent=F.None,this.opaqueOverride=F.None,this.castShadows=F.None}get type(){return y.Varying}}function B(e){return 0!==e.overlays.length&&null!=e.overlays[p.INNER].getValidTexture(c.Highlight)}function L(e){return 0!==e.overlays.length&&null!=e.overlays[p.INNER].getColorTextureNoRasterImage()}e([v()],E.prototype,"texture",void 0),e([v()],E.prototype,"transparent",void 0),e([v()],E.prototype,"opaqueOverride",void 0),e([v()],E.prototype,"castShadows",void 0);export{_ as CommonMaterialParameters,I as ComponentMaterial,F as ComponentParameterSummary,W as ComponentParametersUniform,E as ComponentParametersVarying};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/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{NormalAttributeType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as a}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as d}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as n}from"../../../core/shaderTechnique/BindType.js";import{parameter as l,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as h,AlphaDiscardMode as u}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as y}from"../../../lib/TransparencyPassType.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 m extends c{constructor(){super(...arguments),this.output=r.Color,this.textureCoordinateType=i.None,this.componentData=e.Uniform,this.cullFace=h.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=a.WindingOrder,this.alphaDiscardMode=u.Opaque,this.integratedMeshMode=v.None,this.transparencyPassType=y.NONE,this.ellipsoidMode=d.Earth,this.pbrMode=p.Disabled,this.normalType=s.Attribute,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.hasSlicePlane=!1,this.hasBaseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.hasScreenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.hasCloudsReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1}}o([l({count:r.COUNT})],m.prototype,"output",void 0),o([l({count:i.COUNT})],m.prototype,"textureCoordinateType",void 0),o([l({count:e.COUNT})],m.prototype,"componentData",void 0),o([l({count:h.COUNT})],m.prototype,"cullFace",void 0),o([l({count:t.COUNT})],m.prototype,"vertexDiscardMode",void 0),o([l({count:a.COUNT})],m.prototype,"doubleSidedMode",void 0),o([l({count:u.COUNT})],m.prototype,"alphaDiscardMode",void 0),o([l({count:v.COUNT})],m.prototype,"integratedMeshMode",void 0),o([l({count:y.COUNT})],m.prototype,"transparencyPassType",void 0),o([l({count:d.COUNT})],m.prototype,"ellipsoidMode",void 0),o([l({count:p.COUNT})],m.prototype,"pbrMode",void 0),o([l({count:s.COUNT})],m.prototype,"normalType",void 0),o([l()],m.prototype,"spherical",void 0),o([l()],m.prototype,"doublePrecisionRequiresObfuscation",void 0),o([l()],m.prototype,"hasVertexColors",void 0),o([l()],m.prototype,"hasNormals",void 0),o([l()],m.prototype,"hasSlicePlane",void 0),o([l()],m.prototype,"hasBaseColorTexture",void 0),o([l()],m.prototype,"receiveAmbientOcclusion",void 0),o([l()],m.prototype,"receiveShadows",void 0),o([l()],m.prototype,"blendingEnabled",void 0),o([l()],m.prototype,"hasScreenSpaceReflections",void 0),o([l()],m.prototype,"hasPolygonOffset",void 0),o([l()],m.prototype,"hasMetallicRoughnessTexture",void 0),o([l()],m.prototype,"hasEmissionTexture",void 0),o([l()],m.prototype,"hasOcclusionTexture",void 0),o([l()],m.prototype,"hasNormalTexture",void 0),o([l()],m.prototype,"hasOccludees",void 0),o([l()],m.prototype,"hasMultipassTerrain",void 0),o([l()],m.prototype,"cullAboveGround",void 0),o([l()],m.prototype,"hasCloudsReflections",void 0),o([l()],m.prototype,"snowCover",void 0),o([l()],m.prototype,"objectAndLayerIdColor",void 0),o([l({constValue:n.Draw})],m.prototype,"pbrTextureBindType",void 0),o([l({constValue:!0})],m.prototype,"hasSliceHighlight",void 0),o([l({constValue:!1})],m.prototype,"hasSliceInVertexProgram",void 0),o([l({constValue:!1})],m.prototype,"useCustomDTRExponentForWater",void 0),o([l({constValue:!1})],m.prototype,"hasVertexTangents",void 0),o([l({constValue:!0})],m.prototype,"supportsTextureAtlas",void 0),o([l({constValue:!1})],m.prototype,"highStepCount",void 0),o([l({constValue:!1})],m.prototype,"instancedDoublePrecision",void 0),o([l({constValue:!0})],m.prototype,"useFillLights",void 0),o([l({constValue:!1})],m.prototype,"objectAndLayerIdColorInstanced",void 0);export{m 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{TextureCoordinateAttributeType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as a}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as d}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as n}from"../../../core/shaderTechnique/BindType.js";import{parameter as l,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as h,AlphaDiscardMode as u}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as y}from"../../../lib/TransparencyPassType.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 m extends c{constructor(){super(...arguments),this.output=r.Color,this.textureCoordinateType=i.None,this.componentData=e.Uniform,this.cullFace=h.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=a.WindingOrder,this.alphaDiscardMode=u.Opaque,this.integratedMeshMode=v.None,this.transparencyPassType=y.NONE,this.ellipsoidMode=d.Earth,this.pbrMode=p.Disabled,this.normalType=s.Attribute,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.hasSlicePlane=!1,this.hasBaseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.hasScreenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.hasCloudsReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1}}o([l({count:r.COUNT})],m.prototype,"output",void 0),o([l({count:i.COUNT})],m.prototype,"textureCoordinateType",void 0),o([l({count:e.COUNT})],m.prototype,"componentData",void 0),o([l({count:h.COUNT})],m.prototype,"cullFace",void 0),o([l({count:t.COUNT})],m.prototype,"vertexDiscardMode",void 0),o([l({count:a.COUNT})],m.prototype,"doubleSidedMode",void 0),o([l({count:u.COUNT})],m.prototype,"alphaDiscardMode",void 0),o([l({count:v.COUNT})],m.prototype,"integratedMeshMode",void 0),o([l({count:y.COUNT})],m.prototype,"transparencyPassType",void 0),o([l({count:d.COUNT})],m.prototype,"ellipsoidMode",void 0),o([l({count:p.COUNT})],m.prototype,"pbrMode",void 0),o([l({count:s.COUNT})],m.prototype,"normalType",void 0),o([l()],m.prototype,"spherical",void 0),o([l()],m.prototype,"doublePrecisionRequiresObfuscation",void 0),o([l()],m.prototype,"hasVertexColors",void 0),o([l()],m.prototype,"hasNormals",void 0),o([l()],m.prototype,"hasSlicePlane",void 0),o([l()],m.prototype,"hasBaseColorTexture",void 0),o([l()],m.prototype,"receiveAmbientOcclusion",void 0),o([l()],m.prototype,"receiveShadows",void 0),o([l()],m.prototype,"blendingEnabled",void 0),o([l()],m.prototype,"hasScreenSpaceReflections",void 0),o([l()],m.prototype,"hasPolygonOffset",void 0),o([l()],m.prototype,"hasMetallicRoughnessTexture",void 0),o([l()],m.prototype,"hasEmissionTexture",void 0),o([l()],m.prototype,"hasOcclusionTexture",void 0),o([l()],m.prototype,"hasNormalTexture",void 0),o([l()],m.prototype,"hasOccludees",void 0),o([l()],m.prototype,"hasMultipassTerrain",void 0),o([l()],m.prototype,"cullAboveGround",void 0),o([l()],m.prototype,"hasCloudsReflections",void 0),o([l()],m.prototype,"snowCover",void 0),o([l()],m.prototype,"objectAndLayerIdColor",void 0),o([l({constValue:n.Draw})],m.prototype,"pbrTextureBindType",void 0),o([l({constValue:!0})],m.prototype,"hasSliceHighlight",void 0),o([l({constValue:!1})],m.prototype,"hasSliceInVertexProgram",void 0),o([l({constValue:!1})],m.prototype,"useCustomDTRExponentForWater",void 0),o([l({constValue:!1})],m.prototype,"hasVertexTangents",void 0),o([l({constValue:!0})],m.prototype,"supportsTextureAtlas",void 0),o([l({constValue:!1})],m.prototype,"highStepCount",void 0),o([l({constValue:!1})],m.prototype,"instancedDoublePrecision",void 0),o([l({constValue:!0})],m.prototype,"useFillLights",void 0),o([l({constValue:!1})],m.prototype,"objectAndLayerIdColorInstanced",void 0);export{m as ComponentTechniqueConfiguration,v as IntegratedMeshMode};