@arcgis/core 5.0.0-next.45 → 5.0.0-next.47

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 (332) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
  3. package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/108675a17e432a02cf66.js +1 -0
  6. package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
  7. package/assets/esri/core/workers/chunks/19270a2de33f2662005b.js +1 -0
  8. package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
  11. package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c5d6b416baf24e74b9ba.js → 1dfa949cc4f4c18ed4cf.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
  15. package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
  16. package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
  17. package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
  18. package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
  19. package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
  20. package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
  21. package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
  25. package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
  29. package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
  30. package/assets/esri/core/workers/chunks/404229f10aef5ac23c87.js +1 -0
  31. package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
  33. package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/46b63a65484b102e9ccb.js +1 -0
  36. package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
  37. package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
  38. package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
  39. package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
  42. package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
  43. package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
  45. package/assets/esri/core/workers/chunks/{9f6c63a580b28ab715bd.js → 5ffeb8fb58d59bad68c3.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
  50. package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
  51. package/assets/esri/core/workers/chunks/657602e6a84e8b4576fb.js +1 -0
  52. package/assets/esri/core/workers/chunks/6d3ae7969ea86a2e0b13.js +1 -0
  53. package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
  54. package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
  55. package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
  56. package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
  59. package/assets/esri/core/workers/chunks/75d8244b725a2aee2003.js +1 -0
  60. package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
  61. package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a4f492aa5444e6381063.js → 7d631ebf8f79225cf0f6.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
  65. package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
  67. package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
  68. package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
  70. package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
  71. package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
  72. package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
  73. package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
  74. package/assets/esri/core/workers/chunks/9319d57494482668ab19.js +1 -0
  75. package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
  76. package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
  77. package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
  78. package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
  79. package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
  81. package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
  82. package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
  83. package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
  84. package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
  85. package/assets/esri/core/workers/chunks/{bf5f9da0837ed09729c6.js → aab93e885b6c7c6aa76e.js} +1 -1
  86. package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
  87. package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
  88. package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
  89. package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
  90. package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
  91. package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
  92. package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
  93. package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
  97. package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
  98. package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
  99. package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
  101. package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
  102. package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
  105. package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
  106. package/assets/esri/core/workers/chunks/dae715b2b0094641e42f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
  108. package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
  109. package/assets/esri/core/workers/chunks/ecb4c223c0278971cdc9.js +1 -0
  110. package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
  112. package/assets/esri/core/workers/chunks/f92a78ce5510e0d0d0f7.js +1 -0
  113. package/assets/esri/core/workers/chunks/fa92a7c11befbad8739f.js +1 -0
  114. package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
  115. package/chunks/Laserlines.glsl.js +1 -1
  116. package/chunks/boundedPlane.js +1 -1
  117. package/chunks/cameraUtilsSpherical.js +1 -1
  118. package/chunks/vec32.js +1 -1
  119. package/config.js +1 -1
  120. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  121. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  122. package/geometry/FlatGeometry.js +1 -1
  123. package/geometry/operators/support/apiConverter.js +1 -1
  124. package/geometry/operators/support/jsonConverter.js +1 -1
  125. package/geometry/support/curves/circleUtils.js +1 -1
  126. package/geometry/support/lineSegment.js +1 -1
  127. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  128. package/geometry/support/meshUtils/merge.js +1 -1
  129. package/geometry/support/sphere.js +1 -1
  130. package/interfaces.d.ts +179 -71
  131. package/kernel.js +1 -1
  132. package/layers/ParquetLayer.js +1 -1
  133. package/layers/VoxelWasmPerSceneView.js +1 -1
  134. package/layers/graphics/sources/ParquetSource.js +1 -1
  135. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  136. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  137. package/layers/support/{ParquetEncodingBase.js → ParquetGeometryEncodingBase.js} +1 -1
  138. package/layers/support/ParquetGeometryEncodingLocation.d.ts +4 -0
  139. package/layers/support/ParquetGeometryEncodingLocation.js +5 -0
  140. package/layers/support/ParquetGeometryEncodingWkb.d.ts +4 -0
  141. package/layers/support/ParquetGeometryEncodingWkb.js +5 -0
  142. package/layers/support/parquetEncodingUtils.js +1 -1
  143. package/layers/support/parquetUtils.js +1 -1
  144. package/layers/support/tiles3DUtils.js +1 -1
  145. package/layers/voxel/VoxelVolume.js +1 -1
  146. package/libs/parquet/parquet.js +1 -1
  147. package/package.json +2 -2
  148. package/support/revision.js +1 -1
  149. package/symbols/cim/effects/EffectSuppress.js +1 -1
  150. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  151. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  152. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  154. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  155. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  156. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  157. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  158. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  159. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  160. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  161. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  162. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  163. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  165. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  166. package/views/3d/camera/constraintUtils/distance.js +1 -1
  167. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsParameters.js +1 -1
  170. package/views/3d/environment/EnvironmentManager.js +1 -1
  171. package/views/3d/environment/MarsAtmosphere.js +1 -1
  172. package/views/3d/glTF/internal/Resource.js +1 -1
  173. package/views/3d/glTF/loader.js +1 -1
  174. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  175. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  176. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  177. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  178. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  179. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  180. package/views/3d/layers/I3SMeshView3D.js +1 -1
  181. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  184. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  185. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  186. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  187. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  188. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  189. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  190. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  191. package/views/3d/state/Frustum.js +1 -1
  192. package/views/3d/state/controllers/FovController.js +1 -1
  193. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  194. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  195. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  196. package/views/3d/support/cameraUtils.js +1 -1
  197. package/views/3d/support/intersectionUtils.js +1 -1
  198. package/views/3d/support/orientedBoundingBox.js +1 -1
  199. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  200. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  201. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  202. package/views/3d/support/viewpointUtils.js +1 -1
  203. package/views/3d/terrain/OverlayManager.js +1 -1
  204. package/views/3d/terrain/PatchRenderData.js +1 -1
  205. package/views/3d/terrain/SphericalPatch.js +1 -1
  206. package/views/3d/terrain/Tile.js +1 -1
  207. package/views/3d/webgl/RenderCamera.js +1 -1
  208. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  209. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  210. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  211. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  212. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  213. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  214. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  215. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  216. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  217. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  218. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  219. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  220. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  225. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  226. package/views/SelectionManager.js +1 -1
  227. package/views/draw/support/Reshape.js +1 -1
  228. package/views/interactive/GraphicManipulator.js +1 -1
  229. package/views/interactive/coordinateHelper.js +1 -1
  230. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  231. package/views/interactive/sketch/constraints.js +1 -1
  232. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  233. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  234. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  235. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  236. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  237. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  238. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  239. package/views/support/geometry3dUtils.js +1 -1
  240. package/views/support/selectionUtils.js +1 -1
  241. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  242. package/widgets/BatchAttributeForm/css.js +1 -1
  243. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
  244. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
  245. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
  246. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
  247. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  248. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  249. package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
  250. package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
  251. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  252. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  253. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  254. package/widgets/BatchAttributeForm.js +1 -1
  255. package/widgets/Editor/support/SketchController.js +1 -1
  256. package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
  257. package/widgets/FeatureForm/TextElementInput.js +1 -1
  258. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  259. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  260. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  261. package/widgets/OrientedImageryViewer.js +1 -1
  262. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  263. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  264. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  265. package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
  266. package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
  267. package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
  268. package/widgets/PanoramicViewer/utils.js +1 -1
  269. package/widgets/PanoramicViewer.js +1 -1
  270. package/widgets/Search/SearchViewModel.js +1 -1
  271. package/widgets/Search.js +1 -1
  272. package/widgets/Sketch.js +1 -1
  273. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  274. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  275. package/assets/esri/core/workers/chunks/024104997daea0d74b38.js +0 -1
  276. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
  277. package/assets/esri/core/workers/chunks/08ef90e3fcfd4eda4301.js +0 -1
  278. package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
  279. package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
  280. package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
  281. package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
  282. package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
  283. package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
  284. package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
  285. package/assets/esri/core/workers/chunks/2d3ae187f8aa3495d4ae.js +0 -1
  286. package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
  287. package/assets/esri/core/workers/chunks/2f8cf7d9ff1f4de19a4c.js +0 -1
  288. package/assets/esri/core/workers/chunks/338570424337be05cef5.js +0 -1
  289. package/assets/esri/core/workers/chunks/36130910ba141f34531b.js +0 -1
  290. package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
  291. package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
  292. package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
  293. package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
  294. package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
  295. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
  296. package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
  297. package/assets/esri/core/workers/chunks/59889855d23baec1adf9.js +0 -1
  298. package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
  299. package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
  300. package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
  301. package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
  302. package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
  303. package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
  304. package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
  305. package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
  306. package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
  307. package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
  308. package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
  309. package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
  310. package/assets/esri/core/workers/chunks/8d4cc5f1d07b4aa3aea0.js +0 -1
  311. package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
  312. package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
  313. package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
  314. package/assets/esri/core/workers/chunks/a00bba1c7cbf8cd7892c.js +0 -1
  315. package/assets/esri/core/workers/chunks/a34a14fd989dbbd3c2d0.js +0 -1
  316. package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
  317. package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
  318. package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
  319. package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
  320. package/assets/esri/core/workers/chunks/d0014b4a8c013f59b113.js +0 -1
  321. package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
  322. package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
  323. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
  324. package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
  325. package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
  326. package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
  327. package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +0 -1
  328. package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
  329. package/layers/support/ParquetEncodingLocation.d.ts +0 -4
  330. package/layers/support/ParquetEncodingLocation.js +0 -5
  331. package/layers/support/ParquetEncodingWkb.d.ts +0 -4
  332. package/layers/support/ParquetEncodingWkb.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as s,subclass as h}from"../../../core/accessorSupport/decorators.js";import{F as l,d as c,j as g,l as p}from"../../../chunks/vec32.js";import{create as d,clone as m,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoadedOrLoadFor as u}from"../../../geometry/projectionUtils.js";import v from"../../../geometry/SpatialReference.js";import{projectPointToVector as f}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as w}from"../../../geometry/support/planetGCSUtils.js";import{isEarth as y}from"../../../geometry/support/spatialReferenceUtils.js";import{EnvironmentRenderer as P}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as b}from"../support/earthUtils.js";import{ColorAndIntensity as T,computeColorAndIntensity as j,computeVirtualLightDirection as L,computeShadowsEnabled as G}from"../support/sunUtils.js";import{MainLight as U,AmbientLight as H,FillLight as C}from"../webgl-engine/lighting/Lightsources.js";let E=class extends t{constructor(e){super(e),this._tmpLightParameters=new T,this._defaultLightParameters=new T,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new U,this._ambientLight=new H,this._moonLight=new C,this._disableWeather=!1,this._renderer=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!!this._renderer?.updating||!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&1===this._view?.state?.viewingMode&&y(this._view.spatialReference)}get _weatherAvailable(){return this.weatherEnabled&&this._renderer?.weatherAvailable}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this._view?.stateManager?.camera?.position?.spatialReference??v.WGS84,t=w(e);return u(e,t)}connectView(e){if(this._renderer)return;this._renderer=new P({view:e});const t=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this.addHandles([n(()=>e.environment.lighting,e=>this._updateLightingHandler(e),o),n(()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null,e=>this._lightingDateHandler(e),o),n(()=>e.environment.lighting.directShadowsEnabled,t,o),n(()=>e.spatialReference,()=>this._resetReferencePosition(!0),o),n(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),o),n(()=>"snowy"===e.environment.weather.type&&e.environment.weather.snowCover,t,o),n(()=>e.environment,e=>e.setComputeWeatherAvailable(()=>this._weatherAvailable),a),n(()=>e.viewingMode,()=>this._resetReferencePosition(!0),a),n(()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),a),n(()=>e.state.camera,i,a),r(()=>this._canProjectCameraPosition,i,o)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=b(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const i=t.stateManager.camera;if(!i)return;const{position:n}=i,r=n.spatialReference??v.WGS84,o=w(r);if(!f(n,k,o)){if(null==this._referencePositionGeographic)return;return this._referencePositionGeographic=null,void this._updateLighting()}this._referencePositionGeographic?l(this._referencePositionGeographic,k)||(c(this._referencePositionGeographic,k),this.notifyChange("referencePositionGeographic")):this._referencePositionGeographic=m(k),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e)}_updateLighting(e,t=0){const i=this._view,{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,a=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";j(e,o,i.state.viewingMode,t,i.state.camera,a)}else r&&L(i.state.camera,i.state.viewingMode,a.direct.directionToLightSource);const s=this._mainLight,h=a.direct;g(s.intensity,h.color,h.intensity*Math.PI),c(s.direction,h.directionToLightSource),s.specularStrength=a.specularStrength,s.environmentStrength=a.environmentStrength;const l=this._ambientLight;g(l.intensity,a.ambient.color,a.ambient.intensity);const d=this._moonLight;p(d.intensity,R,S,a.globalFactor);const m=(1-.5*a.globalFactor)*(1-.4*a.noonFactor*(1-a.globalFactor));g(d.intensity,d.intensity,m),c(d.direction,h.directionToLightSource),this._view.stage?.renderer.updateLighting([s,l,d],a.noonFactor,a.globalFactor,this._weatherAvailable?t:0),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this._view.environment.lighting.date).getTime());const n=b(e,this._tmpTz);if(null==n)return!1;let r=this._view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),a=i.getUTCMinutes()-(n.minutes-r.minutes),s=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(a),i.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view.stage;if(!e)return;const t=null==this._referencePositionGeographic||G(this._referencePositionGeographic[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._weatherAvailable})}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([s({type:Boolean,readOnly:!0})],E.prototype,"updating",null),e([s()],E.prototype,"_disableWeather",void 0),e([s()],E.prototype,"weatherEnabled",null),e([s()],E.prototype,"_weatherAvailable",null),e([s()],E.prototype,"referencePositionGeographic",null),e([s()],E.prototype,"_referencePositionGeographic",void 0),e([s()],E.prototype,"_renderer",void 0),e([s()],E.prototype,"_canProjectCameraPosition",null),E=e([h("esri.views.3d.environment.EnvironmentManager")],E);const R=_(.22,.22,.33),S=_(.22,.22,.22),k=d();export{E as EnvironmentManager};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as s,subclass as h}from"../../../core/accessorSupport/decorators.js";import{G as l,d as c,j as g,l as p}from"../../../chunks/vec32.js";import{create as d,clone as m,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoadedOrLoadFor as u}from"../../../geometry/projectionUtils.js";import v from"../../../geometry/SpatialReference.js";import{projectPointToVector as f}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as w}from"../../../geometry/support/planetGCSUtils.js";import{isEarth as y}from"../../../geometry/support/spatialReferenceUtils.js";import{EnvironmentRenderer as P}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as b}from"../support/earthUtils.js";import{ColorAndIntensity as T,computeColorAndIntensity as j,computeVirtualLightDirection as L,computeShadowsEnabled as G}from"../support/sunUtils.js";import{MainLight as U,AmbientLight as H,FillLight as C}from"../webgl-engine/lighting/Lightsources.js";let E=class extends t{constructor(e){super(e),this._tmpLightParameters=new T,this._defaultLightParameters=new T,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new U,this._ambientLight=new H,this._moonLight=new C,this._disableWeather=!1,this._renderer=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!!this._renderer?.updating||!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&1===this._view?.state?.viewingMode&&y(this._view.spatialReference)}get _weatherAvailable(){return this.weatherEnabled&&this._renderer?.weatherAvailable}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this._view?.stateManager?.camera?.position?.spatialReference??v.WGS84,t=w(e);return u(e,t)}connectView(e){if(this._renderer)return;this._renderer=new P({view:e});const t=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this.addHandles([n(()=>e.environment.lighting,e=>this._updateLightingHandler(e),o),n(()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null,e=>this._lightingDateHandler(e),o),n(()=>e.environment.lighting.directShadowsEnabled,t,o),n(()=>e.spatialReference,()=>this._resetReferencePosition(!0),o),n(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),o),n(()=>"snowy"===e.environment.weather.type&&e.environment.weather.snowCover,t,o),n(()=>e.environment,e=>e.setComputeWeatherAvailable(()=>this._weatherAvailable),a),n(()=>e.viewingMode,()=>this._resetReferencePosition(!0),a),n(()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),a),n(()=>e.state.camera,i,a),r(()=>this._canProjectCameraPosition,i,o)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=b(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const i=t.stateManager.camera;if(!i)return;const{position:n}=i,r=n.spatialReference??v.WGS84,o=w(r);if(!f(n,k,o)){if(null==this._referencePositionGeographic)return;return this._referencePositionGeographic=null,void this._updateLighting()}this._referencePositionGeographic?l(this._referencePositionGeographic,k)||(c(this._referencePositionGeographic,k),this.notifyChange("referencePositionGeographic")):this._referencePositionGeographic=m(k),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e)}_updateLighting(e,t=0){const i=this._view,{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,a=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";j(e,o,i.state.viewingMode,t,i.state.camera,a)}else r&&L(i.state.camera,i.state.viewingMode,a.direct.directionToLightSource);const s=this._mainLight,h=a.direct;g(s.intensity,h.color,h.intensity*Math.PI),c(s.direction,h.directionToLightSource),s.specularStrength=a.specularStrength,s.environmentStrength=a.environmentStrength;const l=this._ambientLight;g(l.intensity,a.ambient.color,a.ambient.intensity);const d=this._moonLight;p(d.intensity,R,S,a.globalFactor);const m=(1-.5*a.globalFactor)*(1-.4*a.noonFactor*(1-a.globalFactor));g(d.intensity,d.intensity,m),c(d.direction,h.directionToLightSource),this._view.stage?.renderer.updateLighting([s,l,d],a.noonFactor,a.globalFactor,this._weatherAvailable?t:0),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this._view.environment.lighting.date).getTime());const n=b(e,this._tmpTz);if(null==n)return!1;let r=this._view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),a=i.getUTCMinutes()-(n.minutes-r.minutes),s=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(a),i.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view.stage;if(!e)return;const t=null==this._referencePositionGeographic||G(this._referencePositionGeographic[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._weatherAvailable})}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([s({type:Boolean,readOnly:!0})],E.prototype,"updating",null),e([s()],E.prototype,"_disableWeather",void 0),e([s()],E.prototype,"weatherEnabled",null),e([s()],E.prototype,"_weatherAvailable",null),e([s()],E.prototype,"referencePositionGeographic",null),e([s()],E.prototype,"_referencePositionGeographic",void 0),e([s()],E.prototype,"_renderer",void 0),e([s()],E.prototype,"_canProjectCameraPosition",null),E=e([h("esri.views.3d.environment.EnvironmentManager")],E);const R=_(.22,.22,.33),S=_(.22,.22,.22),k=d();export{E as EnvironmentManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t,clamp as r}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{subclass as a}from"../../../core/accessorSupport/decorators.js";import{lookAt as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as h}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{b as p,j as c,i as u,C as l,f,E as _}from"../../../chunks/vec32.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as b}from"../../../geometry/support/FloatArray.js";import{InternalRenderCategory as x}from"../webgl.js";import{computeInnerAltitudeFade as j,innerAtmosphereDepth as V}from"./atmosphereUtils.js";import{S as w}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as v,layout as P}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as R}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as y}from"../support/mathUtils.js";import{glLayout as S}from"../support/buffer/glUtil.js";import{OpaqueEnvironment as q}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{project as M}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as T}from"../webgl-engine/lib/VertexArrayObject.js";import{PrimitiveType as U}from"../../webgl/enums.js";import{Texture as E}from"../../webgl/Texture.js";import{TextureDescriptor as O}from"../../webgl/TextureDescriptor.js";import{VertexBuffer as C}from"../../webgl/VertexBuffer.js";const N=128,I=-V,W=0,k=50,B=()=>1-511/512,D=y([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let G=class extends q{constructor(e){super(e),this._passParameters=new w,this._configuration=new R,this._vao=null,this._fadeVao=null,this._texV1=1;const t=e.view,r=g(t.spatialReference),{outerAtmosphereRimWidth:s,radius:i}=r;this._planetRadius=i,this._innerRimFactor=1+I/i,this._middleRimFactor=1+W/i,this._outerRimFactor=1+s/i,this._texV0=W/s,this._texVScale=this._texV1-this._texV0;const o=t.stage.renderView.techniques;o.precompile(v,this._configuration),this._configuration.geometry=2,o.precompile(v,this._configuration)}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o))}destroy(){this._passParameters.texture=s(this._passParameters.texture),this._fadeVao=s(this._fadeVao),this._vao=s(this._vao)}render(e){const t=e.find(({name:e})=>e===x.OPAQUE_ENVIRONMENT);this._update();const r=this.renderingContext;if(!this._passParameters.texture){const e=new O(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new E(r,e,A)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(r),this._configuration.geometry=0;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(U.TRIANGLES,0,this._vao.vertexCount("geometry"))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=F(r),this._configuration.geometry=2;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._fadeVao),r.drawArrays(U.TRIANGLE_STRIP,0,this._fadeVao.vertexCount("geometry"))}return t}_update(){const e=this.bindParameters.camera,s=d(),i=this._planetRadius,o=p(e.eye),a=o-i;if(a<0){const e=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const n=Math.max(k,a),m=i+I;this._passParameters.innerScale=J(i+n,i,m)-1,this._passParameters.altitudeFade=j(a),c(s,e.eye,(i+k)/o),L(s,e.center,e.up,i,this._passParameters.silhouette);const u=this._computeScreenRimWidth(e,s,e.up,this._passParameters.silhouette),l=B(),f=D(a);let _=this._texV0+l*this._texVScale,g=this._texV0+u*f*this._texVScale;if(a>k){L(e.eye,e.center,e.up,i,this._passParameters.silhouette);const s=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),o=r((s-1.5)/(u-1.5),0,1);_=this._texV0+o*l*this._texVScale,g=this._texV0+t(this._texV1,u*f,o)*this._texVScale}h(this._passParameters.texV,_,g)}_createRibbon(e){const t=b(3+3*N*3),r=new Uint32Array(3*N*5);t[0]=0,t[1]=0,t[2]=-1;for(let o=0;o<N;o++){const e=9*o+3;t[e]=o,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=o,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=o,t[e+7]=this._outerRimFactor,t[e+8]=1;const s=3*o+1,i=o===N-1?1:s+3,a=15*o;r[a]=s,r[a+1]=s+1,r[a+2]=i+1,r[a+3]=i+1,r[a+4]=i,r[a+5]=s,r[a+6]=s+1,r[a+7]=s+2,r[a+8]=i+2,r[a+9]=i+2,r[a+10]=i+1,r[a+11]=s+1,r[a+12]=s,r[a+13]=i,r[a+14]=0}const s=P.createBuffer(r.length),i=s.position;for(let o=0;o<r.length;++o){const e=3*r[o];i.set(o,0,t[e]),i.set(o,1,t[e+1]),i.set(o,2,t[e+2])}return new T(e,new C(e,S(P),s.buffer))}_computeScreenRimWidth(e,t,r,s){return u(H,s.center,s.v2),c(Q,H,this._outerRimFactor),n(z,t,H,r),M(H,z,e.projectionMatrix,e.viewport,H),M(Q,z,e.projectionMatrix,e.viewport,Q),l(H,Q)/e.height}};function L(e,t,r,s,i){const o=p(e),a=s*Math.sqrt(o*o-s*s)/o,n=Math.sqrt(s*s-a*a),m=i.v1,h=i.v2;return c(i.center,e,n/o),f(m,e,t),_(m)<1&&f(m,e,r),c(m,m,a/p(m)),f(h,m,e),c(h,h,a/p(h)),a}G=e([a("esri.views.3d.environment.MarsAtmosphere")],G);const z=m(),H=d(),Q=d();function J(e,t,r){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-r*r)+t*r)}export{G as MarsAtmosphere};
5
+ import{__decorate as e}from"tslib";import{lerp as t,clamp as r}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{subclass as a}from"../../../core/accessorSupport/decorators.js";import{lookAt as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as h}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{b as p,j as c,i as u,D as l,f,F as _}from"../../../chunks/vec32.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as b}from"../../../geometry/support/FloatArray.js";import{InternalRenderCategory as x}from"../webgl.js";import{computeInnerAltitudeFade as j,innerAtmosphereDepth as V}from"./atmosphereUtils.js";import{S as w}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as v,layout as P}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as R}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as y}from"../support/mathUtils.js";import{glLayout as S}from"../support/buffer/glUtil.js";import{OpaqueEnvironment as q}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{project as M}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as T}from"../webgl-engine/lib/VertexArrayObject.js";import{PrimitiveType as U}from"../../webgl/enums.js";import{Texture as E}from"../../webgl/Texture.js";import{TextureDescriptor as O}from"../../webgl/TextureDescriptor.js";import{VertexBuffer as N}from"../../webgl/VertexBuffer.js";const C=128,I=-V,W=0,D=50,k=()=>1-511/512,B=y([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let G=class extends q{constructor(e){super(e),this._passParameters=new w,this._configuration=new R,this._vao=null,this._fadeVao=null,this._texV1=1;const t=e.view,r=g(t.spatialReference),{outerAtmosphereRimWidth:s,radius:i}=r;this._planetRadius=i,this._innerRimFactor=1+I/i,this._middleRimFactor=1+W/i,this._outerRimFactor=1+s/i,this._texV0=W/s,this._texVScale=this._texV1-this._texV0;const o=t.stage.renderView.techniques;o.precompile(v,this._configuration),this._configuration.geometry=2,o.precompile(v,this._configuration)}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o))}destroy(){this._passParameters.texture=s(this._passParameters.texture),this._fadeVao=s(this._fadeVao),this._vao=s(this._vao)}render(e){const t=e.find(({name:e})=>e===x.OPAQUE_ENVIRONMENT);this._update();const r=this.renderingContext;if(!this._passParameters.texture){const e=new O(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new E(r,e,A)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(r),this._configuration.geometry=0;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(U.TRIANGLES,0,this._vao.vertexCount("geometry"))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=F(r),this._configuration.geometry=2;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._fadeVao),r.drawArrays(U.TRIANGLE_STRIP,0,this._fadeVao.vertexCount("geometry"))}return t}_update(){const e=this.bindParameters.camera,s=d(),i=this._planetRadius,o=p(e.eye),a=o-i;if(a<0){const e=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const n=Math.max(D,a),m=i+I;this._passParameters.innerScale=J(i+n,i,m)-1,this._passParameters.altitudeFade=j(a),c(s,e.eye,(i+D)/o),L(s,e.center,e.up,i,this._passParameters.silhouette);const u=this._computeScreenRimWidth(e,s,e.up,this._passParameters.silhouette),l=k(),f=B(a);let _=this._texV0+l*this._texVScale,g=this._texV0+u*f*this._texVScale;if(a>D){L(e.eye,e.center,e.up,i,this._passParameters.silhouette);const s=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),o=r((s-1.5)/(u-1.5),0,1);_=this._texV0+o*l*this._texVScale,g=this._texV0+t(this._texV1,u*f,o)*this._texVScale}h(this._passParameters.texV,_,g)}_createRibbon(e){const t=b(3+3*C*3),r=new Uint32Array(3*C*5);t[0]=0,t[1]=0,t[2]=-1;for(let o=0;o<C;o++){const e=9*o+3;t[e]=o,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=o,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=o,t[e+7]=this._outerRimFactor,t[e+8]=1;const s=3*o+1,i=o===C-1?1:s+3,a=15*o;r[a]=s,r[a+1]=s+1,r[a+2]=i+1,r[a+3]=i+1,r[a+4]=i,r[a+5]=s,r[a+6]=s+1,r[a+7]=s+2,r[a+8]=i+2,r[a+9]=i+2,r[a+10]=i+1,r[a+11]=s+1,r[a+12]=s,r[a+13]=i,r[a+14]=0}const s=P.createBuffer(r.length),i=s.position;for(let o=0;o<r.length;++o){const e=3*r[o];i.set(o,0,t[e]),i.set(o,1,t[e+1]),i.set(o,2,t[e+2])}return new T(e,new N(e,S(P),s.buffer))}_computeScreenRimWidth(e,t,r,s){return u(H,s.center,s.v2),c(Q,H,this._outerRimFactor),n(z,t,H,r),M(H,z,e.projectionMatrix,e.viewport,H),M(Q,z,e.projectionMatrix,e.viewport,Q),l(H,Q)/e.height}};function L(e,t,r,s,i){const o=p(e),a=s*Math.sqrt(o*o-s*s)/o,n=Math.sqrt(s*s-a*a),m=i.v1,h=i.v2;return c(i.center,e,n/o),f(m,e,t),_(m)<1&&f(m,e,r),c(m,m,a/p(m)),f(h,m,e),c(h,h,a/p(h)),a}G=e([a("esri.views.3d.environment.MarsAtmosphere")],G);const z=m(),H=d(),Q=d();function J(e,t,r){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-r*r)+t*r)}export{G as MarsAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{getKey as o}from"../../../../core/object.js";import{allSettledValues as n}from"../../../../core/promiseUtils.js";import{isDataProtocol as s,dataComponents as a,dataToArrayBuffer as i,makeAbsolute as u}from"../../../../core/urlUtils.js";import{Version as f}from"../../../../core/Version.js";import{fromXRotation as c,multiply as d,translate as l,rotate as p,scale as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h,clone as b}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getAxisAngle as w}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{BufferViewVec2f as g,BufferViewVec2u32 as T,BufferViewVec2u16 as _,BufferViewVec2i16 as x,BufferViewVec2u8 as O,BufferViewVec2i8 as N,BufferViewUint32 as S,BufferViewUint16 as C,BufferViewUint8 as A,BufferViewVec3f as R,BufferViewVec4f as L,BufferViewVec4u8 as v,BufferViewVec4u16 as E,BufferViewVec3u8 as I,BufferViewVec3u16 as D}from"../../../../geometry/support/buffer/BufferView.js";import{m as B}from"../../../../chunks/scalar.js";import"../../../../core/has.js";import{getDracoMeshDecoder as U}from"../../../../libs/dracoMeshDecoder/dracoMeshDecoder.js";import{BinaryStreamReader as M}from"./BinaryStreamReader.js";import{material as j,textureSampler as G}from"./fillDefaults.js";import{splitURI as F}from"./pathUtils.js";import{jsonFromBinaryData as H,EncodedMeshTexture as P,imageFromBinaryData as V,isEncodedMeshTexture as K}from"./resourceUtils.js";import{DataType as z}from"../../../webgl/enums.js";const k={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562};class Y{constructor(t,r,o,n){if(this._context=t,this.uri=r,this.json=o,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform","KHR_draco_mesh_compression","KHR_materials_emissive_strength"],this._baseUri=F(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==o.scenes)throw new e("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==o.meshes)throw new e("gltf-loader-unsupported-feature","Meshes must be defined");if(null==o.nodes)throw new e("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(t,r,o){if(s(r)){const e=a(r);if(e&&"model/gltf-binary"!==e.mediaType)try{const o=JSON.parse(e.isBase64?atob(e.data):e.data);return new Y(t,r,o)}catch{}const o=i(r);if(Y._isGLBData(o))return this._fromGLBData(t,r,o)}if(te.test(r)||"gltf"===o?.expectedType){const e=await t.loadJSON(r,o);return new Y(t,r,e)}const n=await t.loadBinary(r,o);if(Y._isGLBData(n))return this._fromGLBData(t,r,n);if(re.test(r)||"glb"===o?.expectedType)throw new e("gltf-loader-invalid-glb","This is not a valid glb file.");const u=await t.loadJSON(r,o);return new Y(t,r,u)}static _isGLBData(e){if(null==e)return!1;const t=new M(e);return t.remainingBytes()>=4&&t.readUint32()===k.MAGIC}static async _fromGLBData(e,t,r){const o=await Y._parseGLBData(r);return new Y(e,t,o.json,o.binaryData)}static async _parseGLBData(r){const o=new M(r);if(o.remainingBytes()<12)throw new e("gltf-loader-error","glb binary data is insufficiently large.");const n=o.readUint32(),s=o.readUint32(),a=o.readUint32();if(n!==k.MAGIC)throw new e("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(r.byteLength<a)throw new e("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==s)throw new e("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");let i,u,f=0;for(;o.remainingBytes()>=8;){const r=o.readUint32(),n=o.readUint32();if(0===f){if(n!==k.CHUNK_TYPE_JSON)throw new e("gltf-loader-error","First glb chunk must be JSON.");if(r<0)throw new e("gltf-loader-error","No JSON data found.");i=await H(o.readUint8Array(r))}else if(1===f){if(n!==k.CHUNK_TYPE_BIN)throw new e("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");u=o.readUint8Array(r)}else t.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!i)throw new e("gltf-loader-error","No glb JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(t,r){const o=this.json.buffers[t];if(null==o.uri){if(null==this._glbBuffer)throw new e("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(t,r);if(n.byteLength!==o.byteLength)throw new e("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const o=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(o),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,n),n}_validateAccessor(t){if(!this.json.accessors)throw new e("gltf-loader-unsupported-feature","Accessors missing.");const r=this.json.accessors[t];if(r.type in["MAT2","MAT3","MAT4"])throw new e("gltf-loader-unsupported-feature",`AttributeType ${r.type} is not supported`);return r}_getComponentInfo(e,t){const r=$[e.type],o=t?.componentType||e.componentType,n=W[o];return{componentType:o,componentCount:r,componentByteSize:n,denseByteStride:r*n}}getDracoAccessor(e,t){const r=this._validateAccessor(e),o=t.accessorInfos.get(e),{componentType:n,componentCount:s,componentByteSize:a,denseByteStride:i}=this._getComponentInfo(r,o);return{raw:t.data.buffer,byteStride:i,byteOffset:t.data.byteOffset+(o?.byteOffset||0),entryCount:o?.count??r.count,isDenselyPacked:!0,componentCount:s,componentByteSize:a,componentType:n,min:r.min,max:r.max,normalized:!!r.normalized}}async getAccessor(t,r){const o=this._validateAccessor(t);if(null==o?.bufferView)throw new e("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");const{componentCount:n,componentByteSize:s,denseByteStride:a}=this._getComponentInfo(o),i=this.json.bufferViews[o.bufferView],u=await this.getBuffer(i.buffer,r),f=i.byteStride||a;return{raw:u.buffer,byteStride:f,byteOffset:u.byteOffset+(i.byteOffset||0)+(o.byteOffset||0),entryCount:o.count,isDenselyPacked:f===a,componentCount:n,componentByteSize:s,componentType:o.componentType,min:o.min,max:o.max,normalized:!!o.normalized}}async getIndexData(e,t,r){if(null==e.indices)return;const o=e.indices,n=r?this.getDracoAccessor(o,r):await this.getAccessor(o,t);if(n.isDenselyPacked)switch(n.componentType){case z.UNSIGNED_BYTE:return new Uint8Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_SHORT:return new Uint16Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_INT:return new Uint32Array(n.raw,n.byteOffset,n.entryCount)}else switch(n.componentType){case z.UNSIGNED_BYTE:return B(Z(A,n));case z.UNSIGNED_SHORT:return B(Z(C,n));case z.UNSIGNED_INT:return B(Z(S,n))}}async getPositionData(t,r,n){if(null==t.attributes.POSITION)throw new e("gltf-loader-unsupported-feature","No POSITION vertex data found.");const s=t.attributes.POSITION,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getNormalData(t,r,n){if(null==t.attributes.NORMAL)throw new e("gltf-loader-error","No NORMAL vertex data found.");const s=t.attributes.NORMAL,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getTangentData(t,r,n){if(null==t.attributes.TANGENT)throw new e("gltf-loader-error","No TANGENT vertex data found.");const s=t.attributes.TANGENT,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+o(z,a.componentType));if(4!==a.componentCount)throw new e("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+a.componentCount.toFixed());return Z(L,a)}async getTextureCoordinates(t,r,o){if(null==t.attributes.TEXCOORD_0)throw new e("gltf-loader-error","No TEXCOORD_0 vertex data found.");const n=t.attributes.TEXCOORD_0,s=o?this.getDracoAccessor(n,o):await this.getAccessor(n,r);if(2!==s.componentCount)throw new e("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed());if(s.componentType===z.FLOAT)return Z(g,s);if(!s.normalized)throw new e("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Q(s)}async getVertexColors(t,r,n){if(null==t.attributes.COLOR_0)throw new e("gltf-loader-error","No COLOR_0 vertex data found.");const s=t.attributes.COLOR_0,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(4!==a.componentCount&&3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+a.componentCount.toFixed());if(4===a.componentCount){if(a.componentType===z.FLOAT)return Z(L,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(v,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(E,a)}else if(3===a.componentCount){if(a.componentType===z.FLOAT)return Z(R,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(I,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(D,a)}throw new e("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+o(z,a.componentType))}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let o=e.material?this._materialCache.get(e.material):void 0;if(!o){const n=null!=e.material?j(this.json.materials[e.material]):j(),s=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),f=r?this.getTexture(n.occlusionTexture,t):void 0,c=r?this.getTexture(n.emissiveTexture,t):void 0,d=r?this.getTexture(s.metallicRoughnessTexture,t):void 0,l=null!=e.material?e.material:-1;o={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:s.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:l,occlusionTexture:await f,emissiveTexture:await c,emissiveFactor:n.emissiveFactor,emissiveStrengthKHR:n.extensions?.KHR_materials_emissive_strength?.emissiveStrength,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await d,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:s?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:s?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return o}async decode(t,r){const o=t.extensions?.KHR_draco_mesh_compression;if(!o)return;if(null==t.indices)throw new e("gltf-loader-error","Found Draco compressed primitive without indices.");const n=this.json.bufferViews[o.bufferView],s=await this.getBuffer(n.buffer,r),a=(await U()).decode(new Uint8Array(s.buffer,s.byteOffset+(n.byteOffset||0),n.byteLength));this._bufferLoaders.delete(n.buffer);const i=new Map([[t.indices,a.indices],[t.attributes.POSITION,a.positions]]);return t.attributes.TEXCOORD_0&&i.set(t.attributes.TEXCOORD_0,a.uvs),t.attributes.NORMAL&&i.set(t.attributes.NORMAL,a.normals),t.attributes.COLOR_0&&i.set(t.attributes.COLOR_0,a.colors),t.attributes.TANGENT&&i.set(t.attributes.TANGENT,a.tangents),this._dracoBuffersSize+=a.buffer.byteLength,{data:a.buffer,accessorInfos:i}}async getTexture(t,o){if(!t)return;if(0!==(t.texCoord||0))throw new e("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const n=t.index,s=this.json.textures[n],a=G(null!=s.sampler?this.json.samplers[s.sampler]:{}),i=ee(s),u=this.json.images[i],f=await this._loadTextureImageData(n,s,o);return r(this._textureCache,n,()=>{const t=e=>33071===e||33648===e||10497===e,r=t=>{throw new e("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${t}`)};return{data:f,wrapS:t(a.wrapS)?a.wrapS:r(a.wrapS),wrapT:t(a.wrapT)?a.wrapT:r(a.wrapT),minFilter:a.minFilter,name:u.name,id:n}})}getNodeTransform(e){if(void 0===e)return X;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),o=this.json.nodes[e];o.matrix?t=d(h(),r,o.matrix):o.translation||o.rotation||o.scale?(t=b(r),o.translation&&l(t,t,o.translation),o.rotation&&(J[3]=w(J,o.rotation),p(t,t,J[3],J)),o.scale&&m(t,t,o.scale)):t=b(r),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return u(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=f.parse(this.json.asset.version,"glTF");q.validate(e)}_checkRequiredExtensionsSupported(){const t=this.json;if(t.extensionsRequired){if(!t.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new e("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+t.extensionsRequired.join(", "))}}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,r){const o=this._textureLoaders.get(e);if(o)return o;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(t,r){const o=ee(t),n=this.json.images[o];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),r);return new P(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(null==n.bufferView)throw new e("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new e("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(null!=s.byteStride)throw new e("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return V(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await n(Array.from(this._bufferLoaders.values())),t=await n(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?K(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const X=c(h(),Math.PI/2),q=new f(2,0,"glTF"),J=y(),$={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W={[z.BYTE]:1,[z.UNSIGNED_BYTE]:1,[z.SHORT]:2,[z.UNSIGNED_SHORT]:2,[z.HALF_FLOAT]:2,[z.FLOAT]:4,[z.INT]:4,[z.UNSIGNED_INT]:4};function Q(e){switch(e.componentType){case z.BYTE:return new N(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_BYTE:return new O(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.SHORT:return new x(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_SHORT:return new _(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_INT:return new T(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.FLOAT:return new g(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}function Z(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function ee(t){if(null!=t.extensions?.KHR_texture_basisu)return t.extensions.KHR_texture_basisu.source;if(null!==t.source)return t.source;throw new e("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const te=/\.gltf$/i,re=/\.glb$/i;export{Y as GLTFResource,X as transformGltfToEngine};
5
+ import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{getKey as o}from"../../../../core/object.js";import{allSettledValues as n}from"../../../../core/promiseUtils.js";import{isDataProtocol as s,dataComponents as a,dataToArrayBuffer as i,makeAbsolute as u}from"../../../../core/urlUtils.js";import{Version as f}from"../../../../core/Version.js";import{fromXRotation as c,multiply as d,translate as l,rotate as p,scale as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h,clone as b}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getAxisAngle as w}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{BufferViewVec2f as g,BufferViewVec2u32 as T,BufferViewVec2u16 as _,BufferViewVec2i16 as x,BufferViewVec2u8 as O,BufferViewVec2i8 as N,BufferViewUint32 as S,BufferViewUint16 as C,BufferViewUint8 as A,BufferViewVec3f as R,BufferViewVec4f as L,BufferViewVec4u8 as v,BufferViewVec4u16 as E,BufferViewVec3u8 as I,BufferViewVec3u16 as D}from"../../../../geometry/support/buffer/BufferView.js";import{m as B}from"../../../../chunks/scalar.js";import"../../../../core/has.js";import{getDracoMeshDecoder as U}from"../../../../libs/dracoMeshDecoder/dracoMeshDecoder.js";import{BinaryStreamReader as M}from"./BinaryStreamReader.js";import{material as j,textureSampler as G}from"./fillDefaults.js";import{splitURI as F}from"./pathUtils.js";import{jsonFromBinaryData as H,EncodedMeshTexture as P,imageFromBinaryData as V,isEncodedMeshTexture as K}from"./resourceUtils.js";import{DataType as z}from"../../../webgl/enums.js";const k={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562};class Y{constructor(t,r,o,n){if(this._context=t,this.uri=r,this.json=o,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform","KHR_draco_mesh_compression","KHR_materials_emissive_strength"],this._baseUri=F(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==o.scenes)throw new e("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==o.meshes)throw new e("gltf-loader-unsupported-feature","Meshes must be defined");if(null==o.nodes)throw new e("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(t,r,o){if(s(r)){const e=a(r);if(e&&"model/gltf-binary"!==e.mediaType)try{const o=JSON.parse(e.isBase64?atob(e.data):e.data);return new Y(t,r,o)}catch{}const o=i(r);if(Y._isGLBData(o))return this._fromGLBData(t,r,o)}if(te.test(r)||"gltf"===o?.expectedType){const e=await t.loadJSON(r,o);return new Y(t,r,e)}const n=await t.loadBinary(r,o);if(Y._isGLBData(n))return this._fromGLBData(t,r,n);if(re.test(r)||"glb"===o?.expectedType)throw new e("gltf-loader-invalid-glb","This is not a valid glb file.");const u=await t.loadJSON(r,o);return new Y(t,r,u)}static _isGLBData(e){if(null==e)return!1;const t=new M(e);return t.remainingBytes()>=4&&t.readUint32()===k.MAGIC}static async _fromGLBData(e,t,r){const o=await Y._parseGLBData(r);return new Y(e,t,o.json,o.binaryData)}static async _parseGLBData(r){const o=new M(r);if(o.remainingBytes()<12)throw new e("gltf-loader-error","glb binary data is insufficiently large.");const n=o.readUint32(),s=o.readUint32(),a=o.readUint32();if(n!==k.MAGIC)throw new e("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(r.byteLength<a)throw new e("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==s)throw new e("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");let i,u,f=0;for(;o.remainingBytes()>=8;){const r=o.readUint32(),n=o.readUint32();if(0===f){if(n!==k.CHUNK_TYPE_JSON)throw new e("gltf-loader-error","First glb chunk must be JSON.");if(r<0)throw new e("gltf-loader-error","No JSON data found.");i=await H(o.readUint8Array(r))}else if(1===f){if(n!==k.CHUNK_TYPE_BIN)throw new e("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");u=o.readUint8Array(r)}else t.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!i)throw new e("gltf-loader-error","No glb JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(t,r){const o=this.json.buffers[t];if(null==o.uri){if(null==this._glbBuffer)throw new e("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(t,r);if(n.byteLength!==o.byteLength)throw new e("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const o=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(o),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,n),n}_validateAccessor(t){if(!this.json.accessors)throw new e("gltf-loader-unsupported-feature","Accessors missing.");const r=this.json.accessors[t];if(r.type in["MAT2","MAT3","MAT4"])throw new e("gltf-loader-unsupported-feature",`AttributeType ${r.type} is not supported`);return r}_getComponentInfo(e,t){const r=$[e.type],o=t?.componentType||e.componentType,n=W[o];return{componentType:o,componentCount:r,componentByteSize:n,denseByteStride:r*n}}getDracoAccessor(e,t){const r=this._validateAccessor(e),o=t.accessorInfos.get(e),{componentType:n,componentCount:s,componentByteSize:a,denseByteStride:i}=this._getComponentInfo(r,o);return{raw:t.data.buffer,byteStride:i,byteOffset:t.data.byteOffset+(o?.byteOffset||0),entryCount:o?.count??r.count,isDenselyPacked:!0,componentCount:s,componentByteSize:a,componentType:n,min:r.min,max:r.max,normalized:!!r.normalized}}async getAccessor(t,r){const o=this._validateAccessor(t);if(null==o?.bufferView)throw new e("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");const{componentCount:n,componentByteSize:s,denseByteStride:a}=this._getComponentInfo(o),i=this.json.bufferViews[o.bufferView],u=await this.getBuffer(i.buffer,r),f=i.byteStride||a;return{raw:u.buffer,byteStride:f,byteOffset:u.byteOffset+(i.byteOffset||0)+(o.byteOffset||0),entryCount:o.count,isDenselyPacked:f===a,componentCount:n,componentByteSize:s,componentType:o.componentType,min:o.min,max:o.max,normalized:!!o.normalized}}async getIndexData(e,t,r){if(null==e.indices)return;const o=e.indices,n=r?this.getDracoAccessor(o,r):await this.getAccessor(o,t);if(n.isDenselyPacked)switch(n.componentType){case z.UNSIGNED_BYTE:return new Uint8Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_SHORT:return new Uint16Array(n.raw,n.byteOffset,n.entryCount);case z.UNSIGNED_INT:return new Uint32Array(n.raw,n.byteOffset,n.entryCount)}else switch(n.componentType){case z.UNSIGNED_BYTE:return B(Z(A,n));case z.UNSIGNED_SHORT:return B(Z(C,n));case z.UNSIGNED_INT:return B(Z(S,n))}}async getPositionData(t,r,n){if(null==t.attributes.POSITION)throw new e("gltf-loader-unsupported-feature","No POSITION vertex data found.");const s=t.attributes.POSITION,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getNormalData(t,r,n){if(null==t.attributes.NORMAL)throw new e("gltf-loader-error","No NORMAL vertex data found.");const s=t.attributes.NORMAL,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+o(z,a.componentType));if(3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+a.componentCount.toFixed());return Z(R,a)}async getTangentData(t,r,n){if(null==t.attributes.TANGENT)throw new e("gltf-loader-error","No TANGENT vertex data found.");const s=t.attributes.TANGENT,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(a.componentType!==z.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+o(z,a.componentType));if(4!==a.componentCount)throw new e("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+a.componentCount.toFixed());return Z(L,a)}async getTextureCoordinates(t,r,o){if(null==t.attributes.TEXCOORD_0)throw new e("gltf-loader-error","No TEXCOORD_0 vertex data found.");const n=t.attributes.TEXCOORD_0,s=o?this.getDracoAccessor(n,o):await this.getAccessor(n,r);if(2!==s.componentCount)throw new e("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed());if(s.componentType===z.FLOAT)return Z(g,s);if(!s.normalized)throw new e("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Q(s)}async getVertexColors(t,r,n){if(null==t.attributes.COLOR_0)throw new e("gltf-loader-error","No COLOR_0 vertex data found.");const s=t.attributes.COLOR_0,a=n?this.getDracoAccessor(s,n):await this.getAccessor(s,r);if(4!==a.componentCount&&3!==a.componentCount)throw new e("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+a.componentCount.toFixed());if(4===a.componentCount){if(a.componentType===z.FLOAT)return Z(L,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(v,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(E,a)}else if(3===a.componentCount){if(a.componentType===z.FLOAT)return Z(R,a);if(a.componentType===z.UNSIGNED_BYTE)return Z(I,a);if(a.componentType===z.UNSIGNED_SHORT)return Z(D,a)}throw new e("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+o(z,a.componentType))}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r,o){let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const s=null!=e.material?j(this.json.materials[e.material]):j(),a=s.pbrMetallicRoughness,i=this.hasVertexColors(e),u=this.getTexture(a.baseColorTexture,t),f=this.getTexture(s.normalTexture,t),c=r?this.getTexture(s.occlusionTexture,t):void 0,d=o?this.getTexture(s.emissiveTexture,t):void 0,l=r?this.getTexture(a.metallicRoughnessTexture,t):void 0,p=null!=e.material?e.material:-1;n={alphaMode:s.alphaMode,alphaCutoff:s.alphaCutoff,color:a.baseColorFactor,doubleSided:!!s.doubleSided,colorTexture:await u,normalTexture:await f,name:s.name,id:p,occlusionTexture:await c,emissiveTexture:await d,emissiveFactor:s.emissiveFactor,emissiveStrengthKHR:s.extensions?.KHR_materials_emissive_strength?.emissiveStrength,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await l,hasVertexColors:i,ESRI_externalColorMixMode:s.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:s.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:s.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:s.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:s.extras.ESRI_receiveAmbientOcclusion,receiveShadows:s.extras.ESRI_receiveShadows}}return n}async decode(t,r){const o=t.extensions?.KHR_draco_mesh_compression;if(!o)return;if(null==t.indices)throw new e("gltf-loader-error","Found Draco compressed primitive without indices.");const n=this.json.bufferViews[o.bufferView],s=await this.getBuffer(n.buffer,r),a=(await U()).decode(new Uint8Array(s.buffer,s.byteOffset+(n.byteOffset||0),n.byteLength));this._bufferLoaders.delete(n.buffer);const i=new Map([[t.indices,a.indices],[t.attributes.POSITION,a.positions]]);return t.attributes.TEXCOORD_0&&i.set(t.attributes.TEXCOORD_0,a.uvs),t.attributes.NORMAL&&i.set(t.attributes.NORMAL,a.normals),t.attributes.COLOR_0&&i.set(t.attributes.COLOR_0,a.colors),t.attributes.TANGENT&&i.set(t.attributes.TANGENT,a.tangents),this._dracoBuffersSize+=a.buffer.byteLength,{data:a.buffer,accessorInfos:i}}async getTexture(t,o){if(!t)return;if(0!==(t.texCoord||0))throw new e("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const n=t.index,s=this.json.textures[n],a=G(null!=s.sampler?this.json.samplers[s.sampler]:{}),i=ee(s),u=this.json.images[i],f=await this._loadTextureImageData(n,s,o);return r(this._textureCache,n,()=>{const t=e=>33071===e||33648===e||10497===e,r=t=>{throw new e("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${t}`)};return{data:f,wrapS:t(a.wrapS)?a.wrapS:r(a.wrapS),wrapT:t(a.wrapT)?a.wrapT:r(a.wrapT),minFilter:a.minFilter,name:u.name,id:n}})}getNodeTransform(e){if(void 0===e)return X;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),o=this.json.nodes[e];o.matrix?t=d(h(),r,o.matrix):o.translation||o.rotation||o.scale?(t=b(r),o.translation&&l(t,t,o.translation),o.rotation&&(J[3]=w(J,o.rotation),p(t,t,J[3],J)),o.scale&&m(t,t,o.scale)):t=b(r),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return u(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=f.parse(this.json.asset.version,"glTF");q.validate(e)}_checkRequiredExtensionsSupported(){const t=this.json;if(t.extensionsRequired){if(!t.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new e("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+t.extensionsRequired.join(", "))}}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,r){const o=this._textureLoaders.get(e);if(o)return o;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(t,r){const o=ee(t),n=this.json.images[o];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),r);return new P(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(null==n.bufferView)throw new e("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new e("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(null!=s.byteStride)throw new e("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return V(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await n(Array.from(this._bufferLoaders.values())),t=await n(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?K(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const X=c(h(),Math.PI/2),q=new f(2,0,"glTF"),J=y(),$={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W={[z.BYTE]:1,[z.UNSIGNED_BYTE]:1,[z.SHORT]:2,[z.UNSIGNED_SHORT]:2,[z.HALF_FLOAT]:2,[z.FLOAT]:4,[z.INT]:4,[z.UNSIGNED_INT]:4};function Q(e){switch(e.componentType){case z.BYTE:return new N(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_BYTE:return new O(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.SHORT:return new x(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_SHORT:return new _(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.UNSIGNED_INT:return new T(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case z.FLOAT:return new g(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}function Z(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function ee(t){if(null!=t.extensions?.KHR_texture_basisu)return t.extensions.KHR_texture_basisu.source;if(null!==t.source)return t.source;throw new e("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const te=/\.gltf$/i,re=/\.glb$/i;export{Y as GLTFResource,X as transformGltfToEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{getKey as o}from"../../../core/object.js";import{clone as t}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{makeMaterialParameters as r,makeTextureSource as s}from"./LoaderResult.js";import{GLTFResource as a}from"./internal/Resource.js";import{PrimitiveType as i}from"../../webgl/enums.js";let n=0;async function l(r,s,l={},m=!0){const T=await a.load(r,s,l),p="gltf_"+n++,f={lods:[],materials:new Map,textures:new Map,meta:u(T)},x=!(!T.json.asset.extras||"symbolResource"!==T.json.asset.extras.ESRI_type),g=T.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,h=new Map;let w=!1;await c(T,async(r,s,a,n)=>{const u=h.get(a)??0;h.set(a,u+1);const c=void 0!==r.mode?r.mode:i.TRIANGLES,x=c===i.TRIANGLES||c===i.TRIANGLE_STRIP||c===i.TRIANGLE_FAN?c:null;if(null==x)return void e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+o(i,c)+"). Skipping primitive.");if(!T.hasPositions(r))return void e.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const g=await T.decode(r,l);w||=!!g;const v=T.getPositionData(r,l,g),S=T.getMaterial(r,l,m),R=T.hasNormals(r)?T.getNormalData(r,l,g):null,_=T.hasTangents(r)?T.getTangentData(r,l,g):null,F=T.hasTextureCoordinates(r)?T.getTextureCoordinates(r,l,g):null,y=T.hasVertexColors(r)?T.getVertexColors(r,l,g):null,E=T.getIndexData(r,l,g),I={name:n,transform:t(s),attributes:{position:await v,normal:R?await R:null,texCoord0:F?await F:null,color:y?await y:null,tangent:_?await _:null},indices:await E,primitiveType:x,material:d(f,await S,p)};let M=null;null!=f.meta?.ESRI_lod&&"screenSpaceRadius"===f.meta.ESRI_lod.metric&&(M=f.meta.ESRI_lod.thresholds[a]),f.lods[a]=f.lods[a]||{parts:[],name:n,lodThreshold:M},f.lods[a].parts[u]=I});for(const e of f.lods)e.parts=e.parts.filter(e=>!!e);const v=await T.getLoadedBuffersSize();return{model:f,meta:{isEsriSymbolResource:x,uri:T.uri,ESRI_webstyle:g,isDracoDecompressed:w},customMeta:{},usedMemory:v}}function u(e){const o=e.json;let t=null;return o.nodes.forEach(e=>{const o=e.extras;null!=o&&(o.ESRI_proxyEllipsoid||o.ESRI_lod)&&(t=o)}),t}async function c(o,t){const r=o.json,s=r.scenes[r.scene||0].nodes,a=s.length>1,i=[];for(const e of s){const o=r.nodes[e];if(i.push(n(e,0)),m(o)&&!a){o.extensions.MSFT_lod.ids.forEach((e,o)=>n(e,o+1))}}async function n(s,a){const l=r.nodes[s],u=o.getNodeTransform(s);if(null!=l.weights&&e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=l.mesh){const e=r.meshes[l.mesh];for(const o of e.primitives)i.push(t(o,u,a,e.name))}for(const e of l.children||[])i.push(n(e,a))}await Promise.all(i)}function m(e){return e.extensions?.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function d(e,o,t){const a=o=>{const r=`${t}_tex_${o&&o.id}${o?.name?"_"+o.name:""}`;if(o&&!e.textures.has(r)){const t=s(o.data,{wrap:{s:o.wrapS,t:o.wrapT},mipmap:T.has(o.minFilter),noUnpackFlip:!0});e.textures.set(r,t)}return r},i=`${t}_mat_${o.id}_${o.name}`;if(!e.materials.has(i)){const t=r({color:[o.color[0],o.color[1],o.color[2]],opacity:o.color[3],alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,doubleSided:o.doubleSided,colorMixMode:o.ESRI_externalColorMixMode,colorTexture:o.colorTexture?a(o.colorTexture):void 0,normalTexture:o.normalTexture?a(o.normalTexture):void 0,occlusionTexture:o.occlusionTexture?a(o.occlusionTexture):void 0,emissiveTexture:o.emissiveTexture?a(o.emissiveTexture):void 0,metallicRoughnessTexture:o.metallicRoughnessTexture?a(o.metallicRoughnessTexture):void 0,emissiveFactor:[o.emissiveFactor[0],o.emissiveFactor[1],o.emissiveFactor[2]],emissiveStrengthKHR:o.emissiveStrengthKHR,colorTextureTransform:o.colorTextureTransform,normalTextureTransform:o.normalTextureTransform,occlusionTextureTransform:o.occlusionTextureTransform,emissiveTextureTransform:o.emissiveTextureTransform,metallicRoughnessTextureTransform:o.metallicRoughnessTextureTransform,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,receiveShadows:o.receiveShadows,receiveAmbientOcclusion:o.receiveAmbientOcclusion});e.materials.set(i,t)}return i}const T=new Set([9987,9985]);export{l as loadGLTF};
5
+ import e from"../../../core/Logger.js";import{getKey as o}from"../../../core/object.js";import{clone as t}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{makeMaterialParameters as r,makeTextureSource as s}from"./LoaderResult.js";import{GLTFResource as a}from"./internal/Resource.js";import{PrimitiveType as i}from"../../webgl/enums.js";let n=0;async function l(r,s,l={},m=!0,T=!0){const p=await a.load(r,s,l),f="gltf_"+n++,x={lods:[],materials:new Map,textures:new Map,meta:u(p)},g=!(!p.json.asset.extras||"symbolResource"!==p.json.asset.extras.ESRI_type),h=p.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,w=new Map;let v=!1;await c(p,async(r,s,a,n)=>{const u=w.get(a)??0;w.set(a,u+1);const c=void 0!==r.mode?r.mode:i.TRIANGLES,g=c===i.TRIANGLES||c===i.TRIANGLE_STRIP||c===i.TRIANGLE_FAN?c:null;if(null==g)return void e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+o(i,c)+"). Skipping primitive.");if(!p.hasPositions(r))return void e.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const h=await p.decode(r,l);v||=!!h;const S=p.getPositionData(r,l,h),R=p.getMaterial(r,l,m,T),_=p.hasNormals(r)?p.getNormalData(r,l,h):null,F=p.hasTangents(r)?p.getTangentData(r,l,h):null,y=p.hasTextureCoordinates(r)?p.getTextureCoordinates(r,l,h):null,E=p.hasVertexColors(r)?p.getVertexColors(r,l,h):null,I=p.getIndexData(r,l,h),M={name:n,transform:t(s),attributes:{position:await S,normal:_?await _:null,texCoord0:y?await y:null,color:E?await E:null,tangent:F?await F:null},indices:await I,primitiveType:g,material:d(x,await R,f)};let b=null;null!=x.meta?.ESRI_lod&&"screenSpaceRadius"===x.meta.ESRI_lod.metric&&(b=x.meta.ESRI_lod.thresholds[a]),x.lods[a]=x.lods[a]||{parts:[],name:n,lodThreshold:b},x.lods[a].parts[u]=M});for(const e of x.lods)e.parts=e.parts.filter(e=>!!e);const S=await p.getLoadedBuffersSize();return{model:x,meta:{isEsriSymbolResource:g,uri:p.uri,ESRI_webstyle:h,isDracoDecompressed:v},customMeta:{},usedMemory:S}}function u(e){const o=e.json;let t=null;return o.nodes.forEach(e=>{const o=e.extras;null!=o&&(o.ESRI_proxyEllipsoid||o.ESRI_lod)&&(t=o)}),t}async function c(o,t){const r=o.json,s=r.scenes[r.scene||0].nodes,a=s.length>1,i=[];for(const e of s){const o=r.nodes[e];if(i.push(n(e,0)),m(o)&&!a){o.extensions.MSFT_lod.ids.forEach((e,o)=>n(e,o+1))}}async function n(s,a){const l=r.nodes[s],u=o.getNodeTransform(s);if(null!=l.weights&&e.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=l.mesh){const e=r.meshes[l.mesh];for(const o of e.primitives)i.push(t(o,u,a,e.name))}for(const e of l.children||[])i.push(n(e,a))}await Promise.all(i)}function m(e){return e.extensions?.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function d(e,o,t){const a=o=>{const r=`${t}_tex_${o&&o.id}${o?.name?"_"+o.name:""}`;if(o&&!e.textures.has(r)){const t=s(o.data,{wrap:{s:o.wrapS,t:o.wrapT},mipmap:T.has(o.minFilter),noUnpackFlip:!0});e.textures.set(r,t)}return r},i=`${t}_mat_${o.id}_${o.name}`;if(!e.materials.has(i)){const t=r({color:[o.color[0],o.color[1],o.color[2]],opacity:o.color[3],alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,doubleSided:o.doubleSided,colorMixMode:o.ESRI_externalColorMixMode,colorTexture:o.colorTexture?a(o.colorTexture):void 0,normalTexture:o.normalTexture?a(o.normalTexture):void 0,occlusionTexture:o.occlusionTexture?a(o.occlusionTexture):void 0,emissiveTexture:o.emissiveTexture?a(o.emissiveTexture):void 0,metallicRoughnessTexture:o.metallicRoughnessTexture?a(o.metallicRoughnessTexture):void 0,emissiveFactor:[o.emissiveFactor[0],o.emissiveFactor[1],o.emissiveFactor[2]],emissiveStrengthKHR:o.emissiveStrengthKHR,colorTextureTransform:o.colorTextureTransform,normalTextureTransform:o.normalTextureTransform,occlusionTextureTransform:o.occlusionTextureTransform,emissiveTextureTransform:o.emissiveTextureTransform,metallicRoughnessTextureTransform:o.metallicRoughnessTextureTransform,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,receiveShadows:o.receiveShadows,receiveAmbientOcclusion:o.receiveAmbientOcclusion});e.materials.set(i,t)}return i}const T=new Set([9987,9985]);export{l as loadGLTF};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{createScreenPointArray as t}from"../../../core/screenUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{F as o}from"../../../chunks/vec32.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as i}from"../../../geometry/support/vectorStacks.js";import{vectorToRender as n}from"./support/viewUtils.js";import{SegmentLabels as a}from"../../interactive/SegmentLabels.js";let c=class extends a{getCameraOrExtent({view:e}){return e.state.camera}toScreenPointArray({view:e,elevationInfo:r,editGeometryOperations:o},s,i=t()){const{spatialReference:a}=o.data.coordinateHelper;return n(s,a,r,e,p),e.state.camera.projectToScreen(p,i),i}getRing(e,t,r,s,n){const a=[];for(const o of t.parts[n].iterateVertices())a.push(s.toXYZ(o.pos,i.get()));if(0===n&&null!=r&&a.push(s.toXYZ(r,i.get())),a.length<2)return a;const c=a[0],p=a[a.length-1];return"polygon"===e.type&&a.length>2&&!o(c,p)&&a.push(c),a}};c=e([r("esri.views.3d.interactive.SegmentLabels3D")],c);const p=s();export{c as SegmentLabels3D};
5
+ import{__decorate as e}from"tslib";import{createScreenPointArray as t}from"../../../core/screenUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{G as o}from"../../../chunks/vec32.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as i}from"../../../geometry/support/vectorStacks.js";import{vectorToRender as n}from"./support/viewUtils.js";import{SegmentLabels as a}from"../../interactive/SegmentLabels.js";let c=class extends a{getCameraOrExtent({view:e}){return e.state.camera}toScreenPointArray({view:e,elevationInfo:r,editGeometryOperations:o},s,i=t()){const{spatialReference:a}=o.data.coordinateHelper;return n(s,a,r,e,p),e.state.camera.projectToScreen(p,i),i}getRing(e,t,r,s,n){const a=[];for(const o of t.parts[n].iterateVertices())a.push(s.toXYZ(o.pos,i.get()));if(0===n&&null!=r&&a.push(s.toXYZ(r,i.get())),a.length<2)return a;const c=a[0],p=a[a.length-1];return"polygon"===e.type&&a.length>2&&!o(c,p)&&a.push(c),a}};c=e([r("esri.views.3d.interactive.SegmentLabels3D")],c);const p=s();export{c as SegmentLabels3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{G as m,e as d,n as u,g as p,f as h,j as f}from"../../../../../chunks/vec32.js";import{fromValues as _,create as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{Settings as O}from"../settings.js";import{discRadius as U}from"./config.js";import{Manipulation as b}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as y,createConeGeometry as z}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class C extends b{constructor(t){super(),this._radius=U,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(D(r,1,.25),1),materialFocused:v(D(r,1,0),1),materialOccludedUnfocused:v(D(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(D(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s(()=>this._view.effectiveTheme.accentColor,t=>{const e=D(t,1,.25),i=D(t,1,0),r=D(t,.7,0),a=D(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})}),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=R,this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){t(this._manipulator,0)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,e=>this.createDragPipeline((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a)),a))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,(r,a,o,s,n)=>{const l=a.next(t=>({...t,manipulatorType:0})).next(M(i,r.renderLocation,e)).next(T());t(r,l,o,s,n)})}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/U,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[_(0,0,0),_(0,0,i)],m=[_(0,0,0),_(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,j=y(u,s,o/2,16,!1),w=z(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,1),new g(j,1),new g(w.instantiate({material:p}),2),new g(j.instantiate({material:p}),2),new g(w.instantiate({material:h}),1),new g(j.instantiate({material:h}),1),new g(w.instantiate({material:f}),2),new g(j.instantiate({material:f}),2)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=E;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(F,r,i.eye);u(n,n);const l=H;t.renderCoordsHelper.worldUpAtPosition(E,l);const c=Math.abs(p(n,l)),_=h(F,n,l),j=h(F,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/U,O=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*O),e[12]-=F[0],e[13]-=F[1],e[14]-=F[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function D(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const E=j(),F=j(),H=j(),R=()=>{};export{C as MoveZManipulation};
5
+ import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{H as m,e as d,n as u,g as p,f as h,j as f}from"../../../../../chunks/vec32.js";import{fromValues as _,create as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{Settings as O}from"../settings.js";import{discRadius as U}from"./config.js";import{Manipulation as b}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as y,createConeGeometry as z}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class H extends b{constructor(t){super(),this._radius=U,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(C(r,1,.25),1),materialFocused:v(C(r,1,0),1),materialOccludedUnfocused:v(C(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(C(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s(()=>this._view.effectiveTheme.accentColor,t=>{const e=C(t,1,.25),i=C(t,1,0),r=C(t,.7,0),a=C(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})}),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=R,this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){t(this._manipulator,0)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,e=>this.createDragPipeline((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a)),a))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,(r,a,o,s,n)=>{const l=a.next(t=>({...t,manipulatorType:0})).next(M(i,r.renderLocation,e)).next(T());t(r,l,o,s,n)})}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/U,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[_(0,0,0),_(0,0,i)],m=[_(0,0,0),_(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,j=y(u,s,o/2,16,!1),w=z(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,1),new g(j,1),new g(w.instantiate({material:p}),2),new g(j.instantiate({material:p}),2),new g(w.instantiate({material:h}),1),new g(j.instantiate({material:h}),1),new g(w.instantiate({material:f}),2),new g(j.instantiate({material:f}),2)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=D;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(E,r,i.eye);u(n,n);const l=F;t.renderCoordsHelper.worldUpAtPosition(D,l);const c=Math.abs(p(n,l)),_=h(E,n,l),j=h(E,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/U,O=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*O),e[12]-=E[0],e[13]-=E[1],e[14]-=E[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function C(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const D=j(),E=j(),F=j(),R=()=>{};export{H as MoveZManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{watch as r,sync as i}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{C as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as a}from"../../../../../geometry/projection/projectPointToVector.js";import{isMediaElementVisibleView as p}from"./mediaElementUtils.js";let d=class extends t{grabbableForEvent(){return!0}constructor(e){super(e),this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.grabbing=!1,this.dragging=!1,this.hovering=!0,this.selected=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o,this.addHandles(r(()=>this.selected,e=>this.events.emit("select-changed",{action:e?"select":"deselect"}),i))}destroy(){this._set("view",null)}intersectionDistance(e){const{view:t,layer:o,element:r}=this;if(!p(t,o,r))return null;const i=t.toMap(e,{include:{layer:o,element:r}});return i&&a(i,m,t.renderSpatialReference)?l(m,t.state.camera.eye):null}onElevationChange(){}onViewChange(){}};e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"element",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"layer",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"view",void 0),e([s()],d.prototype,"interactive",void 0),e([s()],d.prototype,"selectable",void 0),e([s()],d.prototype,"grabbable",void 0),e([s()],d.prototype,"grabbing",void 0),e([s()],d.prototype,"dragging",void 0),e([s()],d.prototype,"hovering",void 0),e([s()],d.prototype,"selected",void 0),e([s()],d.prototype,"cursor",void 0),d=e([n("esri.views.3d.interactive.editingTools.media.MediaElementManipulator3D")],d);const m=c();export{d as MediaElementManipulator3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{watch as r,sync as i}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{D as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as a}from"../../../../../geometry/projection/projectPointToVector.js";import{isMediaElementVisibleView as p}from"./mediaElementUtils.js";let d=class extends t{grabbableForEvent(){return!0}constructor(e){super(e),this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.grabbing=!1,this.dragging=!1,this.hovering=!0,this.selected=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o,this.addHandles(r(()=>this.selected,e=>this.events.emit("select-changed",{action:e?"select":"deselect"}),i))}destroy(){this._set("view",null)}intersectionDistance(e){const{view:t,layer:o,element:r}=this;if(!p(t,o,r))return null;const i=t.toMap(e,{include:{layer:o,element:r}});return i&&a(i,m,t.renderSpatialReference)?l(m,t.state.camera.eye):null}onElevationChange(){}onViewChange(){}};e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"element",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"layer",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"view",void 0),e([s()],d.prototype,"interactive",void 0),e([s()],d.prototype,"selectable",void 0),e([s()],d.prototype,"grabbable",void 0),e([s()],d.prototype,"grabbing",void 0),e([s()],d.prototype,"dragging",void 0),e([s()],d.prototype,"hovering",void 0),e([s()],d.prototype,"selected",void 0),e([s()],d.prototype,"cursor",void 0),d=e([n("esri.views.3d.interactive.editingTools.media.MediaElementManipulator3D")],d);const m=c();export{d as MediaElementManipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{valueInUnit as e}from"../../../../../core/quantity.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as t}from"../../../../../core/units.js";import{fromValues as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as s,D as i,E as c,e as l,c as a}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{geodesicCompatibleSpatialReference as p,inverseGeodeticSolver as f,InverseGeodeticSolverResult as u,directGeodeticSolver as d}from"../../../../../geometry/geodesicUtils.js";import{projectPoint as j}from"../../../../../geometry/projectionUtils.js";import{projectVectorToVector as g}from"../../../../../geometry/projection/projectVectorToVector.js";import{getNormal as y,fromPositionAndNormal as h,create as R}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as v}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as x}from"../../../../../support/elevationInfoUtils.js";import{OffsetEdgeVertex as C}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function H(e,r,o){const t="on-the-ground"===o.mode?1:0;return new C(e,t,r,0)}function w(e,r,o){const t=m();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const n=T(e,r,y(o.plane)),i=T(e,r,o.edgeDirection);if(null==n||null==i)return null;const c=s(m(),n,i);return h(t,c,R())}function T(e,r,o){const t=v(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),n=m(),s=m();return e.renderCoordsHelper.toRenderCoords(r,n)&&e.renderCoordsHelper.toRenderCoords(t,s)?i(s,n,s):null}function U(e,r,o){const t=y(e),c=i(m(),r,o),l=s(m(),c,t),a=s(m(),c,l);return n(c[0],c[1],c[2],0,l[0],l[1],l[2],0,a[0],a[1],a[2],0,0,0,0,1)}function q(e,r,t){const n=t.projectToRenderScreen(e,o()),s=t.projectToRenderScreen(r,o());return null!=n&&null!=s?c(l(n,n,s)):0}function A(e,o,t,n){const{elevationInfo:s,operations:i}=t;if(!i||!e)return null;const c=n.manipulator.elevationAlignedLocation,l=x(c,o,s),a=o.sceneIntersectionHelper.intersectElevationFromScreen(r(e.x,e.y),s,l);return a&&j(a,a,i.data.spatialReference)?a:null}function E(r,o,n,{data:{coordinateHelper:s,spatialReference:i}}){const c=e(r,"meters"),l=t(i),j=Math.sign(c*n.selectedArrow),h=p(i),R=y(n.plane),v=s.pointToXYZ(o),x=m();a(x,v,R,j*(I/l));const C=c*n.selectedArrow/l;if(!h||!g(v,i,v,h)||!g(x,i,x,h))return C;const H=new u;if(f(H,v,x,h),d(x,v,H.azimuth,c,h),!g(x,h,x,i))return C;const w=x[0]-o.x,T=x[1]-o.y,U=Math.sqrt(w*w+T*T)*j,[q,A]=R,E=Math.sqrt(q*q+A*A);return 0===E?0:U/E}const I=10;export{w as createEdgeOffsetIntersectionPlane,H as createEdgeOffsetOperation,U as edgeOffsetRotationMatrix,E as getDistanceInGeometrySR,A as getMapPointAtEdgeOffsetManipulatorElevation,q as screenEdgeLengthSquared};
5
+ import{valueInUnit as e}from"../../../../../core/quantity.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as t}from"../../../../../core/units.js";import{fromValues as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as s,E as i,F as c,e as l,c as a}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{geodesicCompatibleSpatialReference as p,inverseGeodeticSolver as f,InverseGeodeticSolverResult as u,directGeodeticSolver as d}from"../../../../../geometry/geodesicUtils.js";import{projectPoint as j}from"../../../../../geometry/projectionUtils.js";import{projectVectorToVector as g}from"../../../../../geometry/projection/projectVectorToVector.js";import{getNormal as y,fromPositionAndNormal as h,create as R}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as v}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as x}from"../../../../../support/elevationInfoUtils.js";import{OffsetEdgeVertex as C}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function H(e,r,o){const t="on-the-ground"===o.mode?1:0;return new C(e,t,r,0)}function w(e,r,o){const t=m();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const n=T(e,r,y(o.plane)),i=T(e,r,o.edgeDirection);if(null==n||null==i)return null;const c=s(m(),n,i);return h(t,c,R())}function T(e,r,o){const t=v(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),n=m(),s=m();return e.renderCoordsHelper.toRenderCoords(r,n)&&e.renderCoordsHelper.toRenderCoords(t,s)?i(s,n,s):null}function U(e,r,o){const t=y(e),c=i(m(),r,o),l=s(m(),c,t),a=s(m(),c,l);return n(c[0],c[1],c[2],0,l[0],l[1],l[2],0,a[0],a[1],a[2],0,0,0,0,1)}function q(e,r,t){const n=t.projectToRenderScreen(e,o()),s=t.projectToRenderScreen(r,o());return null!=n&&null!=s?c(l(n,n,s)):0}function A(e,o,t,n){const{elevationInfo:s,operations:i}=t;if(!i||!e)return null;const c=n.manipulator.elevationAlignedLocation,l=x(c,o,s),a=o.sceneIntersectionHelper.intersectElevationFromScreen(r(e.x,e.y),s,l);return a&&j(a,a,i.data.spatialReference)?a:null}function E(r,o,n,{data:{coordinateHelper:s,spatialReference:i}}){const c=e(r,"meters"),l=t(i),j=Math.sign(c*n.selectedArrow),h=p(i),R=y(n.plane),v=s.pointToXYZ(o),x=m();a(x,v,R,j*(I/l));const C=c*n.selectedArrow/l;if(!h||!g(v,i,v,h)||!g(x,i,x,h))return C;const H=new u;if(f(H,v,x,h),d(x,v,H.azimuth,c,h),!g(x,h,x,i))return C;const w=x[0]-o.x,T=x[1]-o.y,U=Math.sqrt(w*w+T*T)*j,[q,A]=R,E=Math.sqrt(q*q+A*A);return 0===E?0:U/E}const I=10;export{w as createEdgeOffsetIntersectionPlane,H as createEdgeOffsetOperation,U as edgeOffsetRotationMatrix,E as getDistanceInGeometrySR,A as getMapPointAtEdgeOffsetManipulatorElevation,q as screenEdgeLengthSquared};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{colorVectorEquals as t}from"../../../../core/colorUtils.js";import e from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as i,e as a,a as n,f as h,H as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as d}from"../../../../chunks/vec42.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{MeasurementArrowMaterial as f}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class C extends p{constructor(t){super(t),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=4,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=_(),this._contrastColor=_(),this.applyProperties(t)}get renderOccluded(){return this._renderOccluded}set renderOccluded(t){t!==this._renderOccluded&&(this._renderOccluded=t,this._arrowMaterial?.setParameters({renderOccluded:t}))}get geometry(){return this._geometry}set geometry(t){this._geometry=t,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(t){this._stripeLength=t,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(t){if(this._stripesEnabled=t,this.attached){const t=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:t})}}get color(){return this._color}set color(e){t(e,this._color)||(d(this._color,e),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(e){t(e,this._color)||(d(this._contrastColor,e),this._updateArrowColor())}createExternalResources(){const t=this._color,r=this._contrastColor,o=this._stripesEnabled?r:t;this._arrowMaterial=new f({outlineColor:t,stripeEvenColor:o,stripeOddColor:t,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new e,this._handles.add(s(()=>this.view.state.camera,()=>{this._viewChanged()}))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachMaterial(t){t(this._arrowMaterial)}createGeometries(t){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const e=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);e.transformation=this._originTransform,t.addGeometry(e),this._viewChanged()}_createArrowGeometry(t,e,r,s){const o=this.view,n=o.renderCoordsHelper,h=[],l=[],c=(t,e)=>{const s=m.get();a(s,t,r),h.push(s),l.push(e)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=m.get();if(n.worldUpAtPosition(this._arrowCenter,r),y(t,e,r)){const{heading:e,tilt:s}=o.camera,{direction:a}=g(o,t,e,s,b);i(r,a)}c(t,r),c(e,r)}else{s.eval(.5,this._arrowCenter);const t=this._arrowSubdivisions+1&-2;for(let e=0;e<t;++e){const r=e/(t-1),o=m.get(),i=m.get();s.eval(r,o),n.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,h,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const t=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*t})}}_updateArrowColor(){if(!this.attached)return;const t=this._color,e=this._contrastColor,r=this._stripesEnabled?e:t,s=t,o=t;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function y(t,e,r){const s=n(v,e,t),o=h(v,s,r);return 0===l(o)}const v=c(),b=u();export{C as MeasurementArrowVisualElement};
5
+ import{colorVectorEquals as t}from"../../../../core/colorUtils.js";import e from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as i,e as a,a as n,f as h,u as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as d}from"../../../../chunks/vec42.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{MeasurementArrowMaterial as f}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class C extends p{constructor(t){super(t),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=4,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=_(),this._contrastColor=_(),this.applyProperties(t)}get renderOccluded(){return this._renderOccluded}set renderOccluded(t){t!==this._renderOccluded&&(this._renderOccluded=t,this._arrowMaterial?.setParameters({renderOccluded:t}))}get geometry(){return this._geometry}set geometry(t){this._geometry=t,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(t){this._stripeLength=t,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(t){if(this._stripesEnabled=t,this.attached){const t=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:t})}}get color(){return this._color}set color(e){t(e,this._color)||(d(this._color,e),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(e){t(e,this._color)||(d(this._contrastColor,e),this._updateArrowColor())}createExternalResources(){const t=this._color,r=this._contrastColor,o=this._stripesEnabled?r:t;this._arrowMaterial=new f({outlineColor:t,stripeEvenColor:o,stripeOddColor:t,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new e,this._handles.add(s(()=>this.view.state.camera,()=>{this._viewChanged()}))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachMaterial(t){t(this._arrowMaterial)}createGeometries(t){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const e=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);e.transformation=this._originTransform,t.addGeometry(e),this._viewChanged()}_createArrowGeometry(t,e,r,s){const o=this.view,n=o.renderCoordsHelper,h=[],l=[],c=(t,e)=>{const s=m.get();a(s,t,r),h.push(s),l.push(e)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=m.get();if(n.worldUpAtPosition(this._arrowCenter,r),y(t,e,r)){const{heading:e,tilt:s}=o.camera,{direction:a}=g(o,t,e,s,b);i(r,a)}c(t,r),c(e,r)}else{s.eval(.5,this._arrowCenter);const t=this._arrowSubdivisions+1&-2;for(let e=0;e<t;++e){const r=e/(t-1),o=m.get(),i=m.get();s.eval(r,o),n.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,h,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const t=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*t})}}_updateArrowColor(){if(!this.attached)return;const t=this._color,e=this._contrastColor,r=this._stripesEnabled?e:t,s=t,o=t;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function y(t,e,r){const s=n(v,e,t),o=h(v,s,r);return 0===l(o)}const v=c(),b=u();export{C as MeasurementArrowVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{C as s,n as a,e as o,d as n,m as c,i as l}from"../../../../chunks/vec32.js";import{create as u,ZEROS as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as d}from"../../../../chunks/vec42.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as f}from"./EngineVisualElement.js";import{drapedZ as g}from"../../terrain/OverlayRenderer.js";import{Attribute as M}from"../../webgl-engine/lib/Attribute.js";import{Geometry as b}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as j}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as D}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends f{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=4,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:z,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){d(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){d(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r}}_createObject3DGeometries(e,t,r){if(c(this._up,h)&&c(this._right,h))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal),i=this._createGeometries(t,r).map(e=>new O(e));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),a=v(r,i,s,e);if(!t)return[a];return[a,R(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=l(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,s);t(y,this._position),r(y,y,[a,a,a]),e.transformation=y}_setTransformDraped(e){if(0===e.length)return;const{view:{overlayManager:i,state:{contentPixelRatio:s}}}=this,{_position:a,_size:o}=this,c=n(_.get(),a);c[2]=g;const l=P;l.spatialReference=i.spatialReference,l.x=c[0],l.y=c[1];const u=o*(this.view.overlayPixelSizeInMapUnits(l)*s),h=Math.min(this._maxSize,u);t(y,c),r(y,y,[h,h,1]);for(const t of e)t.transformation=y}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function z(e){e.pixelRatioHandle.remove(),e.geometries=[]}function v(e,t,r,i){return new b(i,[["position",new M([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}const y=i(),P=p(0,0,void 0,null);export{w as RightAngleQuadVisualElement};
5
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{D as s,n as a,e as o,d as n,m as c,i as l}from"../../../../chunks/vec32.js";import{create as u,ZEROS as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as d}from"../../../../chunks/vec42.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as f}from"./EngineVisualElement.js";import{drapedZ as g}from"../../terrain/OverlayRenderer.js";import{Attribute as M}from"../../webgl-engine/lib/Attribute.js";import{Geometry as b}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as j}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as D}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends f{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=4,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:z,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){d(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){d(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r}}_createObject3DGeometries(e,t,r){if(c(this._up,h)&&c(this._right,h))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal),i=this._createGeometries(t,r).map(e=>new O(e));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),a=v(r,i,s,e);if(!t)return[a];return[a,R(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=l(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,s);t(y,this._position),r(y,y,[a,a,a]),e.transformation=y}_setTransformDraped(e){if(0===e.length)return;const{view:{overlayManager:i,state:{contentPixelRatio:s}}}=this,{_position:a,_size:o}=this,c=n(_.get(),a);c[2]=g;const l=P;l.spatialReference=i.spatialReference,l.x=c[0],l.y=c[1];const u=o*(this.view.overlayPixelSizeInMapUnits(l)*s),h=Math.min(this._maxSize,u);t(y,c),r(y,y,[h,h,1]);for(const t of e)t.transformation=y}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function z(e){e.pixelRatioHandle.remove(),e.geometries=[]}function v(e,t,r,i){return new b(i,[["position",new M([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}const y=i(),P=p(0,0,void 0,null);export{w as RightAngleQuadVisualElement};