@arcgis/core 5.1.0-next.111 → 5.1.0-next.113

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 (323) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +3 -0
  2. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -0
  3. package/analysis/ElevationProfileAnalysis.d.ts +5 -0
  4. package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
  5. package/analysis/ShadowCast/TotalDurationOptions.d.ts +13 -4
  6. package/analysis/ShadowCastAnalysis.d.ts +8 -5
  7. package/arcade/Dictionary.js +1 -1
  8. package/arcade/Feature.js +1 -1
  9. package/arcade/Pixel.js +1 -1
  10. package/arcade/Voxel.js +1 -1
  11. package/arcade/arcade.js +1 -1
  12. package/arcade/arcadeAsyncRuntime.js +1 -1
  13. package/arcade/arcadeCompiler.js +1 -1
  14. package/arcade/arcadeEnvironment.js +1 -1
  15. package/arcade/arcadeRuntime.js +1 -1
  16. package/arcade/compilerUtils.js +1 -1
  17. package/arcade/containerUtils.js +1 -1
  18. package/arcade/debug.js +1 -1
  19. package/arcade/enum.js +1 -1
  20. package/arcade/executionError.js +1 -1
  21. package/arcade/functions/convertdirection.js +1 -1
  22. package/arcade/functions/date.js +1 -1
  23. package/arcade/functions/feature.js +1 -1
  24. package/arcade/functions/featuresetbase.js +1 -1
  25. package/arcade/functions/featuresetgeom.js +1 -1
  26. package/arcade/functions/featuresetstats.js +1 -1
  27. package/arcade/functions/featuresetstring.js +1 -1
  28. package/arcade/functions/geomasync.js +1 -1
  29. package/arcade/functions/geometry.js +1 -1
  30. package/arcade/functions/geomsync.js +1 -1
  31. package/arcade/functions/knowledgegraph.js +1 -1
  32. package/arcade/functions/maths.js +1 -1
  33. package/arcade/functions/stats.js +1 -1
  34. package/arcade/functions/string.js +1 -1
  35. package/arcade/functions/track.js +1 -1
  36. package/arcade/geometry/constructors.js +1 -1
  37. package/arcade/geometry/functions.js +1 -1
  38. package/arcade/geometry/unitConversion.js +1 -1
  39. package/arcade.js +1 -1
  40. package/assets/components/assets/icon/returnToDefault16.json +1 -0
  41. package/assets/components/assets/icon/returnToDefault24.json +1 -0
  42. package/assets/components/assets/icon/returnToDefault32.json +1 -0
  43. package/assets/components/assets/icon/reviewMap16.json +1 -0
  44. package/assets/components/assets/icon/reviewMap24.json +1 -0
  45. package/assets/components/assets/icon/reviewMap32.json +1 -0
  46. package/assets/esri/core/workers/RemoteClient.js +1 -1
  47. package/assets/esri/core/workers/chunks/{622bdd1b9d5d292ec12b.js → 02c0640005b09007bb70.js} +1 -1
  48. package/assets/esri/core/workers/chunks/0b76534b60014d74ecb9.js +1 -0
  49. package/assets/esri/core/workers/chunks/{34e026549ba2822b8ebd.js → 13d43a0683c42b94feb6.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{4f9ea7544b2d0e88a05c.js → 13f0e08de2dfab07d212.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{35bbd63319d8aa9f31cc.js → 169c9eb6cd000e067c4b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{d4014213c476bf8099af.js → 18c4207b1cb0777560ba.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{58c15c42e6a618386a2f.js → 1c8c8050d60205cf2156.js} +1 -1
  54. package/assets/esri/core/workers/chunks/1f537c05c2f643acb5e7.js +1 -0
  55. package/assets/esri/core/workers/chunks/241aeff6afd074ce105b.js +1 -0
  56. package/assets/esri/core/workers/chunks/{beff5b4e15edee12bd4c.js → 271e42b7cd3c3441839e.js} +3 -3
  57. package/assets/esri/core/workers/chunks/{ddebc1dc10a2d207389f.js → 282f3d364411efac7b80.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{d6d5ee9d0d998d730f81.js → 2bd334f9ab89334df713.js} +1 -1
  59. package/assets/esri/core/workers/chunks/32f128a1615d71bbe899.js +2 -0
  60. package/assets/esri/core/workers/chunks/{17604cbd4d24158e2c16.js → 3835097520296b0517af.js} +1 -1
  61. package/assets/esri/core/workers/chunks/40df608337d562553ce1.js +2 -0
  62. package/assets/esri/core/workers/chunks/{9f4a9b193485f88d4461.js → 4afe76de6e82e86fe697.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{ac408c62565e2c8b5975.js → 4c5cdd2712c938fafc5d.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{94eab215bab3e4e0e5b5.js → 52a91c314afec70199bc.js} +1 -1
  65. package/assets/esri/core/workers/chunks/5c6742728fa705d2e16e.js +1 -0
  66. package/assets/esri/core/workers/chunks/{ece30bfd5c49b8d99752.js → 5e5c7cc74ff1c9603aff.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{502c3da8c49bf885f51d.js → 63ea9035dcf9ce45560c.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{33ec193e6d7a0cb9d8dd.js → 6b66a6f69aa03338c346.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{56b6b68d9459b1edea43.js → 6c97b5bc408f051606d2.js} +1 -1
  70. package/assets/esri/core/workers/chunks/701125f6cdd91ff3655f.js +2 -0
  71. package/assets/esri/core/workers/chunks/7995e6983456c779adf9.js +1 -0
  72. package/assets/esri/core/workers/chunks/{4e13d639419ac64f7563.js → 7c077e1a63ab97bf3e87.js} +1 -1
  73. package/assets/esri/core/workers/chunks/860465c4f44c373d0a1c.js +1 -0
  74. package/assets/esri/core/workers/chunks/86f2de7dda7992ae706c.js +1 -0
  75. package/assets/esri/core/workers/chunks/{a29cd1f5c7bb4f6a5a4f.js → 8d4881c879c86b353e08.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{6e21675bbd7a44070771.js → 8ff83c59462dea6e3427.js} +1 -1
  77. package/assets/esri/core/workers/chunks/979bab62cad788180770.js +1 -0
  78. package/assets/esri/core/workers/chunks/9890c85a238879490926.js +1 -0
  79. package/assets/esri/core/workers/chunks/9a11ff75009fef45b8c1.js +1 -0
  80. package/assets/esri/core/workers/chunks/a70fa35b2d19460637e9.js +2 -0
  81. package/assets/esri/core/workers/chunks/a95398214e530f896a2d.js +1 -0
  82. package/assets/esri/core/workers/chunks/ae74f722fb385e45fcf1.js +1 -0
  83. package/assets/esri/core/workers/chunks/{fc1fe1f58a65a1694c09.js → b4badbcf1bdb7823d825.js} +1 -1
  84. package/assets/esri/core/workers/chunks/b78fb24b47d9f31f18c6.js +1 -0
  85. package/assets/esri/core/workers/chunks/ba31616de9d73d83d867.js +1 -0
  86. package/assets/esri/core/workers/chunks/c7662455252b48531da1.js +1 -0
  87. package/assets/esri/core/workers/chunks/ca92176d5348e2c533d7.js +1 -0
  88. package/assets/esri/core/workers/chunks/cd5206e19d86c60e3cf0.js +1 -0
  89. package/assets/esri/core/workers/chunks/{bfb417d72d0c90e116fe.js → cedf3e316d6f89cf7005.js} +1 -1
  90. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +1 -0
  91. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +1 -0
  92. package/assets/esri/core/workers/chunks/e0036fa0324a96a88248.js +1 -0
  93. package/assets/esri/core/workers/chunks/e95ce76b5b816256a519.js +1 -0
  94. package/assets/esri/core/workers/chunks/ed939fd5d3827a3f70e0.js +1 -0
  95. package/assets/esri/core/workers/chunks/fbcf09526dc1bbe94b91.js +2 -0
  96. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +22 -6
  97. package/assets/esri/themes/dark/main.css +1 -1
  98. package/assets/esri/themes/light/main.css +1 -1
  99. package/assets/esri/themes/light/view.css +1 -1
  100. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  101. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  102. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  105. package/assets/esri/widgets/Features/t9n/Features_en.json +1 -1
  106. package/chunks/GaussianSplatShadow.glsl.js +11 -9
  107. package/chunks/ShadowCastVisualize.glsl.js +26 -18
  108. package/chunks/aiServices.js +1 -1
  109. package/chunks/arcade.js +1 -1
  110. package/chunks/array.js +1 -1
  111. package/chunks/languageUtils.js +1 -1
  112. package/config.js +1 -1
  113. package/identity/IdentityModal.js +1 -1
  114. package/kernel.js +1 -1
  115. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  116. package/layers/KnowledgeGraphLayer.d.ts +6 -4
  117. package/layers/KnowledgeGraphLayer.js +1 -1
  118. package/layers/LinkChartLayer.js +1 -1
  119. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  120. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  121. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  122. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  123. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  124. package/layers/support/SceneModification.js +1 -1
  125. package/layers/support/SceneModifications.js +1 -1
  126. package/layers/support/featureLayerUtils.js +1 -1
  127. package/layers/support/parquetUtils.js +1 -1
  128. package/linkChart/LinkChartProperties.js +1 -1
  129. package/linkChart/utils.js +1 -1
  130. package/package.json +2 -2
  131. package/renderers/ClassBreaksRenderer.js +1 -1
  132. package/renderers/UniqueValueRenderer.js +1 -1
  133. package/rest/support/TranslateContent.js +1 -1
  134. package/rest/support/TranslateParameters.js +1 -1
  135. package/rest/support/TranslateResult.js +1 -1
  136. package/rest/translate.js +1 -1
  137. package/rest/utils.js +1 -1
  138. package/support/arcadeUtils.js +1 -1
  139. package/support/revision.js +1 -1
  140. package/symbols/cim/types.d.ts +45 -1
  141. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  146. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  147. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  148. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  149. package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +1 -1
  150. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  151. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  152. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  153. package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
  154. package/views/3d/environment/EnvironmentManager.js +1 -1
  155. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  156. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  158. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  159. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  160. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  161. package/views/3d/state/utils/navigationUtils.js +1 -1
  162. package/views/3d/support/QualityProfile.js +1 -1
  163. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  164. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
  165. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  166. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  167. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  168. package/views/3d/webgl-engine/lib/PathEvaluator.js +2 -0
  169. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  170. package/views/3d/webgl-engine/lib/PathFrame2D.js +2 -0
  171. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  172. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  173. package/views/3d/webgl-engine/lib/PathVertexInfo.js +2 -0
  174. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  175. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  176. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  177. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  178. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
  179. package/views/DOMContainer.d.ts +2 -0
  180. package/views/LinkChartView.d.ts +47 -0
  181. package/views/MapView.d.ts +1 -85
  182. package/views/VideoView.d.ts +8 -1
  183. package/views/View2D.d.ts +78 -2
  184. package/views/draw/support/Reshape.js +1 -1
  185. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  186. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  187. package/views/types.d.ts +2 -3
  188. package/views/ui/DefaultUI.d.ts +1 -0
  189. package/widgets/Attachments.js +1 -1
  190. package/widgets/BasemapGallery.js +1 -1
  191. package/widgets/BasemapLayerList.js +1 -1
  192. package/widgets/BasemapToggle.js +1 -1
  193. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +17 -3
  194. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  195. package/widgets/BatchAttributeForm/css.js +1 -1
  196. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +25 -1
  197. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  198. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  199. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +46 -1
  200. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  201. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
  202. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  203. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  204. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  205. package/widgets/BatchAttributeForm/types.d.ts +1 -1
  206. package/widgets/BatchAttributeForm.d.ts +2 -1
  207. package/widgets/BatchAttributeForm.js +1 -1
  208. package/widgets/Bookmarks.js +1 -1
  209. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  210. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  211. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  212. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  213. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  214. package/widgets/CatalogLayerList.js +1 -1
  215. package/widgets/Compass.js +1 -1
  216. package/widgets/CoordinateConversion.js +1 -1
  217. package/widgets/Daylight.js +1 -1
  218. package/widgets/DirectionalPad.js +1 -1
  219. package/widgets/Directions.js +1 -1
  220. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  221. package/widgets/Editor/UpdateWorkflow.js +1 -1
  222. package/widgets/Editor/components/FeatureList.js +1 -1
  223. package/widgets/Editor/components/FooterActions.js +1 -1
  224. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  225. package/widgets/Editor/components/Prompt.js +1 -1
  226. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  227. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  228. package/widgets/ElevationProfile.js +1 -1
  229. package/widgets/Expand.js +1 -1
  230. package/widgets/Feature/FeatureMedia.js +1 -1
  231. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  232. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  233. package/widgets/FeatureForm/RelationshipInput.d.ts +3 -3
  234. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  235. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  236. package/widgets/FeatureForm.js +1 -1
  237. package/widgets/FeatureTable.js +1 -1
  238. package/widgets/Features/FeaturesDrillIn.js +1 -1
  239. package/widgets/Features.js +1 -1
  240. package/widgets/FloorFilter.js +1 -1
  241. package/widgets/FovOverlay.js +1 -1
  242. package/widgets/Fullscreen.js +1 -1
  243. package/widgets/Home.js +1 -1
  244. package/widgets/LayerList/LayerListItem.js +1 -1
  245. package/widgets/LayerList.js +1 -1
  246. package/widgets/Locate.js +1 -1
  247. package/widgets/NavigationToggle.js +1 -1
  248. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  249. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  250. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  251. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  252. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  253. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  254. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  255. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  256. package/widgets/OrientedImageryViewer.js +1 -1
  257. package/widgets/PanoramicVideoViewer.js +1 -1
  258. package/widgets/Print.js +1 -1
  259. package/widgets/Search.js +1 -1
  260. package/widgets/Sketch/SketchViewModel.js +1 -1
  261. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  262. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  263. package/widgets/Sketch.js +1 -1
  264. package/widgets/Slice.js +1 -1
  265. package/widgets/Slider.js +1 -1
  266. package/widgets/Swipe.js +1 -1
  267. package/widgets/TableList.js +1 -1
  268. package/widgets/TimeSlider.js +1 -1
  269. package/widgets/TimeZoneLabel.js +1 -1
  270. package/widgets/Track.js +1 -1
  271. package/widgets/UtilityNetworkAssociations.js +1 -1
  272. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  273. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  274. package/widgets/UtilityNetworkTrace.js +1 -1
  275. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  276. package/widgets/ValuePicker.js +1 -1
  277. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  278. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  279. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  280. package/widgets/Weather.js +1 -1
  281. package/widgets/Zoom.js +1 -1
  282. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  283. package/widgets/support/ColorPicker.js +1 -1
  284. package/widgets/support/ContingentValuesManager.js +1 -1
  285. package/widgets/support/FilterBuilder.js +1 -1
  286. package/widgets/support/GridControls.js +1 -1
  287. package/widgets/support/ItemList.js +1 -1
  288. package/widgets/support/LabeledSwitch.js +1 -1
  289. package/widgets/support/SelectionList.js +1 -1
  290. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +66 -6
  291. package/widgets/support/SelectionToolbar/types.d.ts +20 -1
  292. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +0 -2
  293. package/assets/esri/core/workers/chunks/286bf3be9f524bde9529.js +0 -1
  294. package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +0 -1
  295. package/assets/esri/core/workers/chunks/41a95ad470ec42ecd5a2.js +0 -1
  296. package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +0 -1
  297. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +0 -2
  298. package/assets/esri/core/workers/chunks/55334ad3618899cdbf78.js +0 -2
  299. package/assets/esri/core/workers/chunks/56d9d3f108ff6e719dd4.js +0 -1
  300. package/assets/esri/core/workers/chunks/5c44638670e40e092ce3.js +0 -1
  301. package/assets/esri/core/workers/chunks/63934843c9f4ef779a07.js +0 -1
  302. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +0 -2
  303. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +0 -1
  304. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +0 -1
  305. package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +0 -1
  306. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +0 -1
  307. package/assets/esri/core/workers/chunks/9da2f2b67837b491cfa3.js +0 -1
  308. package/assets/esri/core/workers/chunks/a913a1c83a667ed0e711.js +0 -1
  309. package/assets/esri/core/workers/chunks/aca9591d3467a24f8329.js +0 -1
  310. package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +0 -2
  311. package/assets/esri/core/workers/chunks/bc249bb667f0564ad093.js +0 -1
  312. package/assets/esri/core/workers/chunks/c8b96104641cb4afd4df.js +0 -1
  313. package/assets/esri/core/workers/chunks/cdb48d198145493f76f3.js +0 -1
  314. package/assets/esri/core/workers/chunks/d00b9c1fd0865bf8f317.js +0 -1
  315. package/assets/esri/core/workers/chunks/deab352545c34cac148c.js +0 -1
  316. package/assets/esri/core/workers/chunks/e2bb95d601789bbda73b.js +0 -1
  317. package/assets/esri/core/workers/chunks/f1bb426400dac02880f1.js +0 -1
  318. package/assets/esri/core/workers/chunks/f3f984c62311c20a9db8.js +0 -1
  319. /package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js.LICENSE.txt → 32f128a1615d71bbe899.js.LICENSE.txt} +0 -0
  320. /package/assets/esri/core/workers/chunks/{69c9eb93553b006b640d.js.LICENSE.txt → 40df608337d562553ce1.js.LICENSE.txt} +0 -0
  321. /package/assets/esri/core/workers/chunks/{549d348ca181d06aefb7.js.LICENSE.txt → 701125f6cdd91ff3655f.js.LICENSE.txt} +0 -0
  322. /package/assets/esri/core/workers/chunks/{b69d1d528e271568cbd8.js.LICENSE.txt → a70fa35b2d19460637e9.js.LICENSE.txt} +0 -0
  323. /package/assets/esri/core/workers/chunks/{1d1929f98d941179be29.js.LICENSE.txt → fbcf09526dc1bbe94b91.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{negate as a,copy as r,dot as m,subtract as h,length as l,normalize as c,scale as p,add as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,fromValues as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as g}from"../../../../geometry/support/axisAngle.js";import{create as C,fromNormalAndOffset as v,setOffsetFromPoint as b,negate as w,getNormal as M}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as f,applyAll as P}from"../../camera/constraintUtils.js";import{ConstraintOptions as z}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as V}from"../../input/util.js";import{getVoxelWasm as S}from"../../layers/VoxelWasm.js";import{InteractiveController as j}from"./InteractiveController.js";import{PanPlanarMomentumController as E}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as H}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as y}from"./momentum/ZoomPlanarMomentumController.js";import{excludeTerrain as x,inferNavigationMode as O,getTiltScaleFactor as F,maxPanDistanceModifier as R,minPinchAndPanCameraHeight as A,pivotSearchAreaSize as T,centroid as U,applyZoomToPoint as D,applyPanPlanar as I,normalizeRotationDelta as Z,applyRotation as k,intersectPlaneFromScreenPointAtEye as G}from"../utils/navigationUtils.js";import L from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as W}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as q}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as B}from"../../../navigation/ZoomMomentumEstimator.js";const J=d(0,0,1);let K=class extends j{constructor(t){super(t),this.forceHorizontalPan=!1,this._rotationValueSmooth=new V(.05),this._scalingValueSmooth=new V(.05),this._planeHorizontal=C(),this._planeVertical=C(),this._rotationMomentumEstimator=new q,this._panMomentumEstimator=new W(300,12,.9),this._zoomMomentumEstimator=new B,this._beginRadius=0,this._beginCenter=u(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=i(),this._tmpCentroid3d=u(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new L,this._constraintOptions=new z(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),v(J,0,this._planeHorizontal);const n=u(),o=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,n,this.view.basemapTerrain.invisible?x:{}),s=u();a(s,this.startCamera.viewForward);const d=u();r(d,J);const g=m(s,d);this.forceHorizontalPan?this._navigationMode=1:this._navigationMode=O(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const C=F(d,this.startCamera.viewForward,R)*Math.max(Math.abs(this.view.camera.position.z),A);b(this._planeHorizontal,this._planeHorizontal,n),this.startCamera.aboveGround||w(this._planeHorizontal,this._planeHorizontal);const f=u(),P=u(),z=u();h(f,n,this.currentCamera.eye);const V=l(f);if(c(f,f),0===this._navigationMode){p(d,d,g),h(M(this._planeVertical),s,d),c(M(this._planeVertical),M(this._planeVertical)),b(this._planeVertical,this._planeVertical,n);const i=this.view.stage.renderView.getMinimalDepthForArea(S(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,T);let e=null!=i?i:C;o&&(e=Math.min(e,V)),r(z,_(P,this.currentCamera.eye,p(P,f,e))),this._planeVertical[3]=-m(M(this._planeVertical),z),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}else{const i=o?V:C;r(z,_(P,this.currentCamera.eye,p(P,f,i))),this._planeHorizontal[3]=-m(M(this._planeHorizontal),z),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=1===this._navigationMode?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),D(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(Math.abs(t.radius-this._beginRadius)),P(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),U(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),I(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(s(this._beginCenterScreen,this._tmpCentroid2d)),P(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+Z(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const a=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(a,.001*t.timestamp);const r=M(this._planeHorizontal);k(this.currentCamera,i,g(r,a)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(Math.abs(t.radius*a)),P(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return new y({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:this._beginCenter,axis:M(this._planeHorizontal)});const n=this.view.animationsEnabled&&this._panMomentumEstimator.evaluateMomentum();return n?new E({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const o=this._tmp2d;let s=0;return t.forEach(t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=u()),G(i,e,o,n[s]),s+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};t([n({constructOnly:!0})],K.prototype,"forceHorizontalPan",void 0),K=t([o("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],K);export{K as PinchAndPanControllerLocal};
2
+ import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as s,distance as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{negate as a,copy as m,dot as h,subtract as l,length as c,normalize as _,scale as p,add as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,fromValues as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as C}from"../../../../geometry/support/axisAngle.js";import{create as v,fromNormalAndOffset as b,setOffsetFromPoint as S,negate as M,getNormal as w}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as P,applyAll as z}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as V}from"../../input/util.js";import{getVoxelWasm as H}from"../../layers/VoxelWasm.js";import{InteractiveController as E}from"./InteractiveController.js";import{PanPlanarMomentumController as j}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as F}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as y}from"./momentum/ZoomPlanarMomentumController.js";import{inferNavigationMode as L,excludeTerrain as Y,getTiltScaleFactor as x,maxPanDistanceModifier as A,minPinchAndPanCameraHeight as O,pivotSearchAreaSize as R,centroid as T,applyZoomToPoint as U,applyPanPlanar as D,normalizeRotationDelta as I,applyRotation as Z,intersectPlaneFromScreenPointAtEye as k,findHorizonScreenY as G,intersectsPlaneAtScreenPoint as W,computeHorizonDownLimitScreenY as q,computeHorizonUpLimitScreenY as B,shouldClampScreenY as J}from"../utils/navigationUtils.js";import K from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as N}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as Q}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as X}from"../../../navigation/ZoomMomentumEstimator.js";const $=g(0,0,1);let tt=class extends E{constructor(t){super(t),this.forceHorizontalPan=!1,this._rotationValueSmooth=new V(.05),this._scalingValueSmooth=new V(.05),this._planeHorizontal=v(),this._planeVertical=v(),this._rotationMomentumEstimator=new Q,this._panMomentumEstimator=new N(300,12,.9),this._zoomMomentumEstimator=new X,this._beginRadius=0,this._beginCenter=d(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=i(),this._tmpCentroid3d=d(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._clampedScreenPoint=i(),this._horizonScreenY=null,this._panLimitScreenY=null,this._panLimitFromAbove=!1,this._pointerCount=0,this._beginCamera=new K,this._constraintOptions=new f(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),b($,0,this._planeHorizontal);const n=d();a(n,this.startCamera.viewForward);const o=d();m(o,$);const r=h(n,o);this.forceHorizontalPan?this._navigationMode=1:this._navigationMode=L(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode&&(this._initClampValues(),s(this._beginCenterScreen,this._clampScreenPointToHorizonPaddingRegion(this._beginCenterScreen)));const g=d(),C=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,g,this.view.basemapTerrain.invisible?Y:{}),v=x(o,this.startCamera.viewForward,A)*Math.max(Math.abs(this.view.camera.position.z),O);S(this._planeHorizontal,this._planeHorizontal,g),this.startCamera.aboveGround||M(this._planeHorizontal,this._planeHorizontal);const P=d(),z=d(),f=d();l(P,g,this.currentCamera.eye);const V=c(P);if(_(P,P),0===this._navigationMode){p(o,o,r),l(w(this._planeVertical),n,o),_(w(this._planeVertical),w(this._planeVertical)),S(this._planeVertical,this._planeVertical,g);const i=this.view.stage.renderView.getMinimalDepthForArea(H(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,R);let e=null!=i?i:v;C&&(e=Math.min(e,V)),m(f,u(z,this.currentCamera.eye,p(z,P,e))),this._planeVertical[3]=-h(w(this._planeVertical),f),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}else{const i=C?V:v;m(f,u(z,this.currentCamera.eye,p(z,P,i))),this._planeHorizontal[3]=-h(w(this._planeHorizontal),f),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=1===this._navigationMode?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),U(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=P(Math.abs(t.radius-this._beginRadius)),z(this.view,this.currentCamera,this._constraintOptions)}this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),T(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d);const s=1===this._navigationMode?this._clampScreenPointToHorizonPaddingRegion(this._tmpCentroid2d):this._tmpCentroid2d;if(D(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(s,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=P(r(this._beginCenterScreen,s)),z(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+I(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const r=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp);const a=w(this._planeHorizontal);Z(this.currentCamera,i,C(a,r)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=P(Math.abs(t.radius*r)),z(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return new y({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new F({view:this.view,momentum:e,center:this._beginCenter,axis:w(this._planeHorizontal)});const n=this.view.animationsEnabled&&this._panMomentumEstimator.evaluateMomentum();return n?new j({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const o=this._tmp2d;let s=0;return t.forEach(t=>{o[0]=t.x,o[1]=t.y;const r=1===this._navigationMode?this._clampScreenPointToHorizonPaddingRegion(o):o;void 0===n[s]&&(n[s]=d()),k(i,e,r,n[s]),s+=1}),n}_initClampValues(){if(this._horizonScreenY=G(this.startCamera,t=>W(this._planeHorizontal,this.startCamera,this._beginCenterScreen[0],t)),null==this._horizonScreenY)return this._panLimitScreenY=null,void(this._panLimitFromAbove=!1);this._panLimitFromAbove=this._beginCenterScreen[1]<this._horizonScreenY,this._panLimitScreenY=this._panLimitFromAbove?q(this.startCamera,this._horizonScreenY):B(this.startCamera,this._horizonScreenY)}_clampScreenPointToHorizonPaddingRegion(t){if(s(this._clampedScreenPoint,t),null==this._panLimitScreenY)return this._clampedScreenPoint;const i=G(this.startCamera,i=>W(this._planeHorizontal,this.currentCamera,t[0],i));return null!=i&&(this._horizonScreenY=i,this._panLimitScreenY=this._panLimitFromAbove?q(this.currentCamera,i):B(this.currentCamera,i)),J(t[1],this._panLimitFromAbove,this._panLimitScreenY)&&(this._clampedScreenPoint[1]=this._panLimitScreenY,this._panMomentumEstimator.reset()),this._clampedScreenPoint}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};t([n()],tt.prototype,"forceHorizontalPan",void 0),tt=t([o("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],tt);export{tt as PinchAndPanControllerLocal};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{distance as h,length as M,dot as g,subtract as y,transformMat4 as d,add as b,normalize as x,squaredDistance as j,copy as v,cross as P,scale as z,lerp as w,set as I}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as S,fromPoints as T,axis as U,wrapAxisAngle as G}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as R,vectorCoordinates as k}from"../../../../geometry/support/coordinateSystem.js";import{create as E,fromNormalAndOffset as H,intersectRay as q}from"../../../../geometry/support/plane.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{sm4d as F,sv3d as O}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as W,fromScreen as B}from"../../support/geometryUtils/ray.js";import{intersectScreen as D}from"../../support/geometryUtils/sphere.js";import J from"../../webgl/RenderCamera.js";import{terrainId as K}from"../../webgl-engine/lib/verticalOffsetUtils.js";const L=30,N=[1,3e8],Q=8,V=[200,1508e5],X=5,Y=50,Z=5,$=10,_=80,tt=90,et=1e-6,nt={exclude:new Set([K])};function ot(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function rt(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function it(t,e,n){const o=a(F.get(),n[3],U(n));null==o||s(o,m)||(y(ne,t.eye,e),d(ne,ne,o),t.eye=b(ne,ne,e),y(ne,t.center,e),d(ne,ne,o),t.center=b(ne,ne,e),t.up=d(ne,t.up,o))}function at(t,e,n,o){return q(t,B(e,n,ce),o)}function st(t,e,n,o){return q(t,W(e,n,ce),o)}function ct(t,e,n,o){const r=O.get();let i=1-n;y(r,e,t.eye);const a=M(r);let s=a*(1-i);i>=0&&s<o&&(s=o,i=-(s-a)/a),Math.abs(a-s)<et||(z(r,r,i),t.eye=b(ne,t.eye,r),t.center=w(ne,t.center,e,i))}function lt(t,e,n){e.getScreenCenter(mt),D(t,e,mt,ne)&&(e.center=ne);const o=e.distance,r=o*n;if(Math.abs(o-r)<et)return;const i=z(O.get(),e.viewForward,r);e.eye=y(ne,e.center,i)}const mt=i();function ut(t,e){I(e,0,0,0);for(const n of t)b(e,e,n);z(e,e,1/t.length)}function ft(t,e,n,o){return Math.sin(t/M(e))*(n+o.radius)}function pt(t,e,n,o){return ft(Math.PI/2,e,n,o)+(t-Math.PI/2)}const ht={Elevation:3e4,Angle:e(16)},Mt=e(80);function gt(t,e,n,o,r,i){const a=A(),s=new C;let c=!0,l=!0;const{eye:m}=e;return t.intersectScreen(n,a,i)&&Bt(m,a,o)?s.radius=M(a):(l=!1,e.aboveGround&&0!==r?s.radius=Math.max(M(e.center),.9*o):s.radius=M(e.eye)-e.relativeElevation,1===r?xt(s,e,n,a):c=D(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:l}}function yt(t,e,n,o){const r=t.relativeElevation;if(r>ht.Elevation&&"global"===o)return 1;W(t,e,le);const i=Math.sign(r),a=n.worldUpAtPosition(t.eye,ne);return-i*g(a,le.direction)<Math.sin(ht.Angle)*M(le.direction)?0:1}function dt(t,e,n){y(bt,n,e),t.eye=y(ne,t.eye,bt),t.center=y(ne,t.center,bt)}const bt=A();function xt(t,e,n,o){const r=W(e,n,ce);return null!=r&&(t.closestPointOnSilhouette(r,jt),t.intersectRay(r,o)?!(j(jt,r.origin)<j(o,r.origin))||(v(o,jt),!1):(y(vt,e.eye,e.center),x(vt,vt),H(vt,-g(x(vt,vt),jt),Pt),q(Pt,r,o),!1))}const jt=A(),vt=A(),Pt=E();function zt(i,a,s,c,l,m){let u=0;if(P(ie,i,a),y(oe,i,a),M(i)<=l||!c.aboveGround){P(s,oe,c.eye);const f=g(i,a)/(M(i)*M(a));if(f<.9999)u=o(f);else{const t=M(P(A(),i,a))/(M(i)*M(a));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,Mt));u=-u-Math.max(0,M(a)-l)/(p*l)}else y(wt,c.eye,c.center),P(s,oe,wt),u=-M(oe)/l;return x(s,s),z(s,s,M(ie)),u}const wt=A();function It(r,i,a,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,Mt));return c=i>a?-(i-a)/(m*a):i<-a?Math.PI-(i+a)/(m*a):o(i/a),l=r>a?-(r-a)/(m*a):r<-a?Math.PI-(r+a)/(m*a):o(r/a),(l-c)*a}function At(t,e,n,o,r,i,a,s,c,l){const m=It(t[2],e[2],i.radius,s),u=c?It(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*u-Math.cos(a)*m,h=Math.cos(a)*u+Math.sin(a)*m;x(ne,r);const M=c?p/Math.sqrt(Math.abs(i.radius**2-g(n,ne)**2)):p/i.radius,y=h/Math.sqrt(Math.abs(i.radius**2-g(n,o)**2));f(l,M,y)}function St(t,e,n,o,r,i,a,s,c,l){P(ie,t,e),R(i.up,i.eye,Lt,Nt,Qt),R([0,0,1],i.eye,Dt,Jt,Kt),v(n,Jt),v(o,Dt),x(n,n),z(n,n,M(ie)),k(t,x(Nt,Nt),x(Qt,Qt),x(Lt,Lt),Vt),k(e,Nt,Qt,Lt,Xt),At(Vt,Xt,t,Dt,Jt,a,s,c,l,r)}function Tt(t,e,n,o,r,i,s){a($t,r,o),a(_t,s,i),l(te,$t,_t),y(e,t,n),d(e,e,te),b(e,e,n)}function Ut(t,e,n,o,r,i){a($t,o,n),a(_t,i,r),l(te,$t,_t),y(ne,t.eye,e),d(ne,ne,te),t.eye=b(ne,ne,e),y(ne,t.center,e),d(ne,ne,te),t.center=b(ne,ne,e),y(ne,t.up,e),d(ne,ne,te),t.up=b(ne,ne,e)}const Gt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let Rt=!1;function kt(t,e,n,o,r,i){const a=Math.abs(o)>Math.PI-Gt.Angle||Math.abs(o)<Gt.Angle,s=(Math.abs(t[2])<n*Gt.Pole||Math.abs(e)>n)&&i;return a&&s?!Rt&&r<Gt.Tilt-Gt.TiltHysteresisMargin?Rt=!0:Rt&&r>Gt.Tilt+Gt.TiltHysteresisMargin&&(Rt=!1):Rt=!1,Rt}function Et(t,e,n,o,r,i){if(i)T(n,o,Zt),it(e,t.center,Zt);else{const i=zt(n,o,ae,e,t.radius,r);it(e,t.center,G(ae,i))}}function Ht(t,e,n,o,r,i,a){const s=a?20:1,c=1e-12;let l,m;v(ee,o),re.copyFrom(e);for(let u=0;u<s&&j(n,ee)>c&&(l=j(n,ee),St(n,ee,Jt,Dt,Yt,re,t,r,i,a),Ut(re,t.center,Dt,Yt[1],Jt,Yt[0]),Tt(ee,ee,t.center,Dt,Yt[1],Jt,Yt[0]),m=j(n,ee),m<l||0===u);u++)e.copyFrom(re)}function qt(n,o,r,i,a,s,c){kt(r,g(o.up,r),n.radius,-t.normalize(e(a)),s,o.aboveGround)?Ht(n,o,r,i,-t.normalize(e(a)),s,c):Et(n,o,r,i,s,c)}function Ct(t,e,n,o,r,i){const{eye:a}=t;R([0,0,1],a,Dt,Jt,Kt);const s=e.translation[0]*n.pan,l="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-g(t.center,Dt)**2/M(t.center)**2)),.5),u=(Math.sin(i)*l+Math.cos(i)*s)/m,f=-Math.cos(i)*l+Math.sin(i)*s;switch(c(o.pan.matrix,o.pan.matrix,u,Dt),o.pan.enabled=!0,r.mode){case"pan":c(o.pan.matrix,o.pan.matrix,f,Jt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Ft(t,e,n,o,r){const{eye:i,viewRight:a}=t,s=P(O.get(),a,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(o.pan.matrix,o.pan.matrix,-l,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(o.pan.matrix,o.pan.matrix,t,a),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Ot(n,o,r,i,a,s,c,l,m){kt(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(s)),c,o.aboveGround)?Ct(o,r,i,l,m,-t.normalize(e(a))):Ft(o,r,i,l,m)}function Wt(t,e,n=1/0){const o=Math.abs(g(t,e));return Math.min(n,1/o)}function Bt(t,e,n){const o=h(t,e),r=M(t);return o<Math.max(r,n)}const Dt=A(),Jt=A(),Kt=A(),Lt=A(),Nt=A(),Qt=A(),Vt=A(),Xt=A(),Yt=p(),Zt=S(),$t=u(),_t=u(),te=u(),ee=A(),ne=A(),oe=A();let re=new J;const ie=A(),ae=A();function se(){re=new J}const ce={origin:A(),direction:A()},le={origin:A(),direction:A()};export{Mt as TiltThresholdPanningSpeed,ht as VerticalPanTresholds,dt as applyPanPlanar,Et as applyPanSphericalDirectRotation,Ht as applyPanSphericalPreserveHeading,it as applyRotation,Ut as applyRotationWithTwoAxes,lt as applyZoomOnSphere,ct as applyZoomToPoint,ut as centroid,se as cleanupNavigationUtils,et as distanceComparisonTolerance,nt as excludeTerrain,Wt as getTiltScaleFactor,yt as inferNavigationMode,at as intersectPlaneFromScreenPoint,st as intersectPlaneFromScreenPointAtEye,Bt as isHitOnSamePlanetSide,It as lengthFromPoints,X as maxPanDistanceModifier,Z as maxRotatePivotDistanceModifier,L as maxZoomPivotDistanceModifier,Q as maxZoomStepDistanceModifier,Y as minPinchAndPanCameraHeight,$ as minRotatePivotDistance,ot as normalizeCoordinate,rt as normalizeRotationDelta,pt as offSurfaceTiltToEyeTiltGlobal,ft as onSurfaceTiltToEyeTiltGlobal,Ot as panMotionToRotationMatrix,qt as panToPosition,gt as pickPointAndInitSphere,_ as pivotSearchAreaSize,Gt as preservingHeadingThresholds,tt as rotatePivotSearchAreaSize,Tt as rotatePointAroundTwoAxes,zt as rotationAngleAndAxisDirectRotation,St as rotationAnglesAndAxesHeadingPreserving,At as rotationAnglesHeadingPreserving,kt as shouldPreserveHeading,xt as sphereOrPlanePointFromScreenPoint,N as zoomPivotDistanceClamp,V as zoomStepDistanceClamp};
2
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as u,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{distance as h,length as M,dot as g,subtract as y,transformMat4 as d,add as b,normalize as x,squaredDistance as j,copy as v,cross as P,scale as z,lerp as w,set as I}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,fromPoints as H,axis as S,wrapAxisAngle as T}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as U,vectorCoordinates as G}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as E,intersectRay as q}from"../../../../geometry/support/plane.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{sm4d as F,sv3d as O}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as W,fromScreen as B}from"../../support/geometryUtils/ray.js";import{intersectScreen as D}from"../../support/geometryUtils/sphere.js";import J from"../../webgl/RenderCamera.js";import{terrainId as K}from"../../webgl-engine/lib/verticalOffsetUtils.js";const L=30,N=[1,3e8],Q=8,V=[200,1508e5],X=5,Y=50,Z=5,$=10,_=80,tt=90,et=1e-6,nt={exclude:new Set([K])};function rt(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function ot(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function it(t,e,n){const r=a(F.get(),n[3],S(n));null==r||s(r,u)||(y(fe,t.eye,e),d(fe,fe,r),t.eye=b(fe,fe,e),y(fe,t.center,e),d(fe,fe,r),t.center=b(fe,fe,e),t.up=d(fe,t.up,r))}function at(t,e,n,r){return q(t,B(e,n,de),r)}function st(t,e,n,r){return q(t,W(e,n,de),r)}function ct(t,e,n,r){const o=O.get();let i=1-n;y(o,e,t.eye);const a=M(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<et||(z(o,o,i),t.eye=b(fe,t.eye,o),t.center=w(fe,t.center,e,i))}function lt(t,e,n){e.getScreenCenter(ut),D(t,e,ut,fe)&&(e.center=fe);const r=e.distance,o=r*n;if(Math.abs(r-o)<et)return;const i=z(O.get(),e.viewForward,o);e.eye=y(fe,e.center,i)}const ut=i();function mt(t,e){I(e,0,0,0);for(const n of t)b(e,e,n);z(e,e,1/t.length)}function ft(t,e,n,r){return Math.sin(t/M(e))*(n+r.radius)}function pt(t,e,n,r){return ft(Math.PI/2,e,n,r)+(t-Math.PI/2)}const ht={Elevation:3e4,Angle:e(16)},Mt=.05,gt=12,yt=12,dt=e(80);function bt(t,e,n,r,o,i){const a=R(),s=new C;let c=!0,l=!0;const{eye:u}=e;return t.intersectScreen(n,a,i)&&Zt(u,a,r)?s.radius=M(a):(l=!1,e.aboveGround&&0!==o?s.radius=Math.max(M(e.center),.9*r):s.radius=M(e.eye)-e.relativeElevation,1===o?Pt(s,e,n,a):c=D(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:l}}function xt(t,e,n,r){const o=t.relativeElevation;if(o>ht.Elevation&&"global"===r)return 1;W(t,e,be);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,fe);return-i*g(a,be.direction)<Math.sin(ht.Angle)*M(be.direction)?0:1}function jt(t,e,n){y(vt,n,e),t.eye=y(fe,t.eye,vt),t.center=y(fe,t.center,vt)}const vt=R();function Pt(t,e,n,r){const o=W(e,n,de);return null!=o&&(t.closestPointOnSilhouette(o,zt),t.intersectRay(o,r)?!(j(zt,o.origin)<j(r,o.origin))||(v(r,zt),!1):(y(wt,e.eye,e.center),x(wt,wt),E(wt,-g(x(wt,wt),zt),It),q(It,o,r),!1))}const zt=R(),wt=R(),It=k();function Rt(t,e){const n=t.fullHeight/t.pixelRatio,r=e(0),o=e(n);if(r||!o)return null;let i=0,a=n;for(let s=0;s<yt;s++){const t=.5*(i+a);e(t)?a=t:i=t}return a}function At(t,e,n){return e?t>n:t<n}function Ht(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(gt,Mt*r)}function St(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+Ht(t,e))}function Tt(t,e){return Math.max(0,e-Ht(t,e))}function Ut(t,e,n,r){return xe[0]=n,xe[1]=r,t.intersectRay(W(e,xe,de),fe)}function Gt(t,e,n,r){return xe[0]=n,xe[1]=r,q(t,W(e,xe,de),fe)}function kt(i,a,s,c,l,u){let m=0;if(P(Me,i,a),y(pe,i,a),M(i)<=l||!c.aboveGround){P(s,pe,c.eye);const f=g(i,a)/(M(i)*M(a));if(f<.9999)m=r(f);else{const t=M(P(R(),i,a))/(M(i)*M(a));m=o(t)}const p=Math.cos(n(t.normalize(e(u)),0,dt));m=-m-Math.max(0,M(a)-l)/(p*l)}else y(Et,c.eye,c.center),P(s,pe,Et),m=-M(pe)/l;return x(s,s),z(s,s,M(Me)),m}const Et=R();function qt(o,i,a,s){let c,l;const u=Math.cos(n(t.normalize(e(s)),0,dt));return c=i>a?-(i-a)/(u*a):i<-a?Math.PI-(i+a)/(u*a):r(i/a),l=o>a?-(o-a)/(u*a):o<-a?Math.PI-(o+a)/(u*a):r(o/a),(l-c)*a}function Ct(t,e,n,r,o,i,a,s,c,l){const u=qt(t[2],e[2],i.radius,s),m=c?qt(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*m-Math.cos(a)*u,h=Math.cos(a)*m+Math.sin(a)*u;x(fe,o);const M=c?p/Math.sqrt(Math.abs(i.radius**2-g(n,fe)**2)):p/i.radius,y=h/Math.sqrt(Math.abs(i.radius**2-g(n,r)**2));f(l,M,y)}function Ft(t,e,n,r,o,i,a,s,c,l){P(Me,t,e),U(i.up,i.eye,ee,ne,re),U([0,0,1],i.eye,$t,_t,te),v(n,_t),v(r,$t),x(n,n),z(n,n,M(Me)),G(t,x(ne,ne),x(re,re),x(ee,ee),oe),G(e,ne,re,ee,ie),Ct(oe,ie,t,$t,_t,a,s,c,l,o)}function Ot(t,e,n,r,o,i,s){a(ce,o,r),a(le,s,i),l(ue,ce,le),y(e,t,n),d(e,e,ue),b(e,e,n)}function Wt(t,e,n,r,o,i){a(ce,r,n),a(le,i,o),l(ue,ce,le),y(fe,t.eye,e),d(fe,fe,ue),t.eye=b(fe,fe,e),y(fe,t.center,e),d(fe,fe,ue),t.center=b(fe,fe,e),y(fe,t.up,e),d(fe,fe,ue),t.up=b(fe,fe,e)}const Bt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let Dt=!1;function Jt(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-Bt.Angle||Math.abs(r)<Bt.Angle,s=(Math.abs(t[2])<n*Bt.Pole||Math.abs(e)>n)&&i;return a&&s?!Dt&&o<Bt.Tilt-Bt.TiltHysteresisMargin?Dt=!0:Dt&&o>Bt.Tilt+Bt.TiltHysteresisMargin&&(Dt=!1):Dt=!1,Dt}function Kt(t,e,n,r,o,i){if(i)H(n,r,se),it(e,t.center,se);else{const i=kt(n,r,ge,e,t.radius,o);it(e,t.center,T(ge,i))}}function Lt(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let l,u;v(me,r),he.copyFrom(e);for(let m=0;m<s&&j(n,me)>c&&(l=j(n,me),Ft(n,me,_t,$t,ae,he,t,o,i,a),Wt(he,t.center,$t,ae[1],_t,ae[0]),Ot(me,me,t.center,$t,ae[1],_t,ae[0]),u=j(n,me),u<l||0===m);m++)e.copyFrom(he)}function Nt(n,r,o,i,a,s,c){Jt(o,g(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?Lt(n,r,o,i,-t.normalize(e(a)),s,c):Kt(n,r,o,i,s,c)}function Qt(t,e,n,r,o,i){const{eye:a}=t;U([0,0,1],a,$t,_t,te);const s=e.translation[0]*n.pan,l="zoom"===o.mode?0:e.translation[1]*n.pan,u=Math.max(Math.sqrt(Math.abs(1-g(t.center,$t)**2/M(t.center)**2)),.5),m=(Math.sin(i)*l+Math.cos(i)*s)/u,f=-Math.cos(i)*l+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,$t),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,f,_t),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function Vt(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(O.get(),a,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(r.pan.matrix,r.pan.matrix,-l,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function Xt(n,r,o,i,a,s,c,l,u){Jt(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(s)),c,r.aboveGround)?Qt(r,o,i,l,u,-t.normalize(e(a))):Vt(r,o,i,l,u)}function Yt(t,e,n=1/0){const r=Math.abs(g(t,e));return Math.min(n,1/r)}function Zt(t,e,n){const r=h(t,e),o=M(t);return r<Math.max(o,n)}const $t=R(),_t=R(),te=R(),ee=R(),ne=R(),re=R(),oe=R(),ie=R(),ae=p(),se=A(),ce=m(),le=m(),ue=m(),me=R(),fe=R(),pe=R();let he=new J;const Me=R(),ge=R();function ye(){he=new J}const de={origin:R(),direction:R()},be={origin:R(),direction:R()},xe=i();export{dt as TiltThresholdPanningSpeed,ht as VerticalPanTresholds,jt as applyPanPlanar,Kt as applyPanSphericalDirectRotation,Lt as applyPanSphericalPreserveHeading,it as applyRotation,Wt as applyRotationWithTwoAxes,lt as applyZoomOnSphere,ct as applyZoomToPoint,mt as centroid,ye as cleanupNavigationUtils,Tt as computeHorizonDownLimitScreenY,Ht as computeHorizonPadding,St as computeHorizonUpLimitScreenY,et as distanceComparisonTolerance,nt as excludeTerrain,Rt as findHorizonScreenY,Yt as getTiltScaleFactor,xt as inferNavigationMode,at as intersectPlaneFromScreenPoint,st as intersectPlaneFromScreenPointAtEye,Gt as intersectsPlaneAtScreenPoint,Ut as intersectsSphereAtScreenPoint,Zt as isHitOnSamePlanetSide,qt as lengthFromPoints,X as maxPanDistanceModifier,Z as maxRotatePivotDistanceModifier,L as maxZoomPivotDistanceModifier,Q as maxZoomStepDistanceModifier,Y as minPinchAndPanCameraHeight,$ as minRotatePivotDistance,rt as normalizeCoordinate,ot as normalizeRotationDelta,pt as offSurfaceTiltToEyeTiltGlobal,ft as onSurfaceTiltToEyeTiltGlobal,Xt as panMotionToRotationMatrix,Nt as panToPosition,bt as pickPointAndInitSphere,_ as pivotSearchAreaSize,Bt as preservingHeadingThresholds,Mt as relativeHorizonPanPadding,tt as rotatePivotSearchAreaSize,Ot as rotatePointAroundTwoAxes,kt as rotationAngleAndAxisDirectRotation,Ft as rotationAnglesAndAxesHeadingPreserving,Ct as rotationAnglesHeadingPreserving,At as shouldClampScreenY,Jt as shouldPreserveHeading,Pt as sphereOrPlanePointFromScreenPoint,N as zoomPivotDistanceClamp,V as zoomStepDistanceClamp};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function a(e){return t[e]}function i(){return has("esri-iPhone")?"low":"medium"}const o={reset(){const e=m();for(const a of Object.keys(e))t[a]=e[a]}},l={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430},t=m();function m(){const a=!!has("esri-mobile"),i=!!has("ios"),o=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125},sceneService:{objectLoDFactor:.2,pointLoDFactor:1,meshLoDFactor:.6,pointCloudLoDFactor:.5},gaussianSplat:{idleMinimumSplatPixelRadius:2,nonIdleMinimumSplatPixelRadius:4,idleMinimumOpacity:0,nonIdleMinimumOpacity:0,maximumNumberOfGaussians:1e6},flow:{maxTotalNumberOfStreamlines:5e3,maxTracingResolution:1024,transitionEnabled:!1},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:e(0),physicallyBasedRenderingEnabled:!1,maxTexturePixels:a?1048576:4194304,memoryLimit:200+l.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:15e4,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25},sceneService:{objectLoDFactor:1,pointLoDFactor:1,meshLoDFactor:1,pointCloudLoDFactor:1},gaussianSplat:{idleMinimumSplatPixelRadius:1,nonIdleMinimumSplatPixelRadius:1.5,idleMinimumOpacity:1,nonIdleMinimumOpacity:2,maximumNumberOfGaussians:2e6},flow:{maxTotalNumberOfStreamlines:2e4,maxTracingResolution:2048,transitionEnabled:!0},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:o,physicallyBasedRenderingEnabled:!0,maxTexturePixels:a?4194304:4096**2,memoryLimit:a?600+l.GalaxyS20:750+l.FullHD,additionalCacheMemory:a?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:3e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5},sceneService:{objectLoDFactor:1,pointLoDFactor:1,meshLoDFactor:1,pointCloudLoDFactor:1},gaussianSplat:{idleMinimumSplatPixelRadius:.5,nonIdleMinimumSplatPixelRadius:1,idleMinimumOpacity:3,nonIdleMinimumOpacity:1,maximumNumberOfGaussians:4e6},flow:{maxTotalNumberOfStreamlines:2e4,maxTracingResolution:2048,transitionEnabled:!0},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!0},fadeDuration:o,physicallyBasedRenderingEnabled:!0,maxTexturePixels:a?4096**2:1/0,memoryLimit:a?900+l.SurfacePro7:1500+l.FullHDRetina,additionalCacheMemory:a?-150:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}export{o as QualityProfileTest,i as getDefaultQualityProfileName,a as getQualityProfileSettings};
2
+ import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function a(e){return t[e]}function i(){return has("esri-iPhone")?"low":"medium"}const o={reset(){const e=m();for(const a of Object.keys(e))t[a]=e[a]}},l={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430},t=m();function m(){const a=!!has("esri-mobile"),i=!!has("ios"),o=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125},sceneService:{objectLoDFactor:.2,pointLoDFactor:1,meshLoDFactor:.6,pointCloudLoDFactor:.5},gaussianSplat:{idleMinimumSplatPixelRadius:2,nonIdleMinimumSplatPixelRadius:4,idleMinimumOpacity:0,nonIdleMinimumOpacity:0,maximumNumberOfGaussians:1e6},flow:{maxTotalNumberOfStreamlines:5e3,maxTracingResolution:1024,transitionEnabled:!1},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:e(0),physicallyBasedRenderingEnabled:!1,maxTexturePixels:a?1048576:4194304,memoryLimit:200+l.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:15e4,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25},sceneService:{objectLoDFactor:1,pointLoDFactor:1,meshLoDFactor:1,pointCloudLoDFactor:1},gaussianSplat:{idleMinimumSplatPixelRadius:1,nonIdleMinimumSplatPixelRadius:1.5,idleMinimumOpacity:1,nonIdleMinimumOpacity:0,maximumNumberOfGaussians:2e6},flow:{maxTotalNumberOfStreamlines:2e4,maxTracingResolution:2048,transitionEnabled:!0},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:o,physicallyBasedRenderingEnabled:!0,maxTexturePixels:a?4194304:4096**2,memoryLimit:a?600+l.GalaxyS20:750+l.FullHD,additionalCacheMemory:a?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:3e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5},sceneService:{objectLoDFactor:1,pointLoDFactor:1,meshLoDFactor:1,pointCloudLoDFactor:1},gaussianSplat:{idleMinimumSplatPixelRadius:.5,nonIdleMinimumSplatPixelRadius:1,idleMinimumOpacity:2,nonIdleMinimumOpacity:1,maximumNumberOfGaussians:4e6},flow:{maxTotalNumberOfStreamlines:2e4,maxTracingResolution:2048,transitionEnabled:!0},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!0},fadeDuration:o,physicallyBasedRenderingEnabled:!0,maxTexturePixels:a?4096**2:1/0,memoryLimit:a?900+l.SurfacePro7:1500+l.FullHDRetina,additionalCacheMemory:a?-150:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}export{o as QualityProfileTest,i as getDefaultQualityProfileName,a as getQualityProfileSettings};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{signal as e}from"../../../../core/signal.js";class i{static{this.fadeInEase=e=>e*(2-e)}static{this.fadeOutEase=e=>e*e}constructor(i){this.layerView=i,this._numFadingTiles=e(0),this._tmpFullyFadedOutTiles=new Array}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(e,i){const t=this._getTargetOpacity(i);if(e.fadeDirection=i,0===this.fadeDuration)return void this._instantTileFading(e,t);const a=e.opacityModifier;if(a!==t){const i=1-Math.abs(t-a);this._startTileFading(e,i)}else this._stopTileFading(e)}updateAllTileFading(e){const i=this._tmpFullyFadedOutTiles;i.length=0,this.layerView.tileHandles.forEach(t=>{this._updateTileFading(t,e)&&i.push(t)});i.length>0&&(this.layerView.notifyTileObbsChanged(i),0===this._numFadingTiles.value&&this.layerView.updateGaussians()),this._numFadingTiles.value>0&&this.layerView.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(e){0===e&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(e){return null!=e.fadeProgress&&1===e.fadeDirection}onTileDiscarded(e){null!=e.fadeProgress&&this._numFadingTiles.value--}get updating(){return this._numFadingTiles.value>0}get fadeDuration(){return this.layerView.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.fadeDuration}_startTileFading(e,i){null==e.fadeProgress&&this._numFadingTiles.value++,e.fadeProgress=i}_stopTileFading(e){null!=e.fadeProgress&&(1===e.fadeDirection&&this._onTileFullyFadedOut(e),this._numFadingTiles.value--,e.fadeProgress=null)}_updateTileFading(e,t){const{fadeProgress:a,fadeDirection:s}=e;if(null==a)return!1;const n=this._fadeDirectionToSign(s),l=n*this.fadeDuration,d=this._getTargetOpacity(s),r=t/Math.abs(l||1),u=Math.min(a+r,1),o=n*(1-(0===s?i.fadeInEase:i.fadeOutEase)(u)),g=1===u;if(e.opacityModifier=g?d:d-o,g){const i=1===s;return this._stopTileFading(e),this._updateOpacityModifier(e),i}return e.fadeProgress=u,this._updateOpacityModifier(e),!1}_updateOpacityModifier(e){const i=255*e.opacityModifier;for(let t=0;t<e.pageIds.length;t++){const a=e.pageIds[t];this.layerView.data.fadingTexture.updateBuffer(i,a)}}_instantTileFading(e,i){e.fadeProgress=null,e.opacityModifier=i,this._updateOpacityModifier(e),1===e.fadeDirection&&this._onTileFullyFadedOut(e)}_instantlyFullyFadeAllTiles(){const e=this._tmpFullyFadedOutTiles;e.length=0,this.layerView.tileHandles.forEach(i=>{if(null!=i.fadeProgress){const t=1===i.fadeDirection;this._instantTileFading(i,this._getTargetOpacity(i.fadeDirection)),t&&e.push(i)}});e.length>0&&(this.layerView.updateGaussians(),this.layerView.notifyTileObbsChanged(e)),this._numFadingTiles.value=0}_onTileFullyFadedOut(e){e.lifecycleState=0,this.layerView.moveTileToCache(e)}_fadeDirectionToSign(e){return 0===e?1:-1}_getTargetOpacity(e){return 0===e?1:0}}export{i as GaussianSplatFadeHelper};
2
+ import{signal as e}from"../../../../core/signal.js";import{Milliseconds as i}from"../../../../core/time.js";class t{static{this.fadeInEase=e=>e*(2-e)}static{this.fadeOutEase=e=>e*e}static{this.inverseFadeInEase=e=>1-Math.sqrt(1-e)}static{this.inverseFadeOutEase=e=>Math.sqrt(1-e)}static{this.minimumFadeDuration=i(80)}static{this.resetFadeDurationInterval=i(1e3)}constructor(t){this.layerView=t,this._numFadingTiles=e(0),this._tmpFullyFadedOutTiles=new Array,this._previousNumFadingTiles=0,this._lastStoppedFading=i(0),this._currentFadeDuration=this.baseFadeDuration}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(e,i,t){const a=this._getTargetOpacity(i);if(e.fadeDirection=i,!this.fadingEnabled)return void this._instantTileFading(e,a);const s=e.opacityModifier;if(s!==a){const a=this._getFadeProgressFromOpacity(s,i);this._startTileFading(e,a,t)}else this._stopTileFading(e)}updateAllTileFading(e){const i=this._tmpFullyFadedOutTiles;i.length=0,this.layerView.tileHandles.forEach(t=>{this._updateTileFading(t,e)&&i.push(t)});i.length>0&&(this.layerView.notifyTileObbsChanged(i),0===this._numFadingTiles.value&&this.layerView.updateGaussians()),this._numFadingTiles.value>0&&this.layerView.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(e){0===e&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(e){return null!=e.fadeProgress&&1===e.fadeDirection}onTileDiscarded(e){null!=e.fadeProgress&&(this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=i(performance.now())))}updateFadeDuration(){if(this.numFadingTiles&&this.numFadingTiles>=this._previousNumFadingTiles){const e=.95*this._currentFadeDuration;this._currentFadeDuration=i(Math.max(e,t.minimumFadeDuration))}else 0===this.numFadingTiles&&performance.now()-this._lastStoppedFading>t.resetFadeDurationInterval&&(this._currentFadeDuration=this.baseFadeDuration);return this._previousNumFadingTiles=this.numFadingTiles,this._currentFadeDuration}get updating(){return this._numFadingTiles.value>0}get baseFadeDuration(){return this.layerView.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.baseFadeDuration}_startTileFading(e,i,t){null==e.fadeProgress&&this._numFadingTiles.value++,e.fadeDuration=t,e.fadeProgress=i}_stopTileFading(e){null!=e.fadeProgress&&(1===e.fadeDirection&&this._onTileFullyFadedOut(e),this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=i(performance.now())),e.fadeDuration=null,e.fadeProgress=null)}_updateTileFading(e,i){const{fadeProgress:a,fadeDirection:s}=e;if(null==a)return!1;const n=this._fadeDirectionToSign(s),r=e.fadeDuration,d=this._getTargetOpacity(s),l=i/Math.abs(r||1),u=Math.min(a+l,1),o=n*(1-(0===s?t.fadeInEase:t.fadeOutEase)(u)),h=1===u;if(e.opacityModifier=h?d:d-o,h){const i=1===s;return this._stopTileFading(e),this._updateOpacityModifier(e),i}return e.fadeProgress=u,this._updateOpacityModifier(e),!1}_updateOpacityModifier(e){const i=255*e.opacityModifier;for(let t=0;t<e.pageIds.length;t++){const a=e.pageIds[t];this.layerView.data.fadingTexture.updateBuffer(i,a)}}_instantTileFading(e,i){e.fadeDuration=null,e.fadeProgress=null,e.opacityModifier=i,this._updateOpacityModifier(e),1===e.fadeDirection&&this._onTileFullyFadedOut(e)}_instantlyFullyFadeAllTiles(){const e=this._tmpFullyFadedOutTiles;e.length=0,this.layerView.tileHandles.forEach(i=>{if(null!=i.fadeProgress){const t=1===i.fadeDirection;this._instantTileFading(i,this._getTargetOpacity(i.fadeDirection)),t&&e.push(i)}});e.length>0&&(this.layerView.updateGaussians(),this.layerView.notifyTileObbsChanged(e)),this._numFadingTiles.value=0}_onTileFullyFadedOut(e){e.lifecycleState=0,this.layerView.moveTileToCache(e)}_fadeDirectionToSign(e){return 0===e?1:-1}_getTargetOpacity(e){return 0===e?1:0}_getFadeProgressFromOpacity(e,i){const a=Math.max(0,Math.min(e,1));return 0===i?t.inverseFadeInEase(a):t.inverseFadeOutEase(a)}}export{t as GaussianSplatFadeHelper};
@@ -1,9 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import{glsl as t}from"../../shaderModules/glsl.js";function a(a,e){switch(e.output){case 5:case 6:case 7:case 8:a.fragment.code.add(t`float _calculateFragDepth(const in float depth) {
3
- const float SLOPE_SCALE = 2.0;
4
- const float BIAS = 20.0 * .000015259;
3
+ const float slope_scale = 2.0;
4
+ const float bias = 20.0 * .000015259;
5
5
  float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
6
- return depth + SLOPE_SCALE * m + BIAS;
6
+ return depth + slope_scale * m + bias;
7
7
  }
8
8
  void outputDepth(float _linearDepth){
9
9
  float fragDepth = _calculateFragDepth(_linearDepth);
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,cast as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeVisualizerNode as h,getAttachmentName as a}from"./RenderNodeVisualizerNode.js";import c from"../../../../../widgets/Widget.js";import{tsx as p}from"../../../../../widgets/support/widget.js";let u=class extends c{constructor(){super(...arguments),this.clearColor=d,this.previewSize=v,this.filter=["color"],this.node=null,this.active=!0,this._previews=new Map,this._allPreviews=new Set,this._dirty=!0}castPreviewSize(e){return Math.max(e,v)}get _namedFilters(){const e=this.filter?.filter(e=>"color"!==e&&"depth"!==e);return e&&e.length>0?e:null}initialize(){this.node||(this.node=new h({view:this.view,destroyedCB:()=>{this.node=null,this.destroy()},clearColor:this.clearColor}));const e=this.node;this._updateInterval=setInterval(()=>this._updatePreviews()),this.addHandles([r(()=>this.active,i=>{this.view.stage.renderer.fboCache.debugCallback=i?(i,r)=>{if(null==i||null==r||!this.view.stage.renderView.renderingContext)return this._previews.forEach(([e])=>e.release()),void this._previews.clear();if("fbo visualizer"===i||!this._matchesFilter(i)||r&&0===r.colorAttachments.length&&null==r.depthStencilTexture)return;const{width:s,height:o}=r,l=o>this.previewSize?Math.round(s*this.previewSize/o):s,n=o>this.previewSize?this.previewSize:o;if(l/n>4)return void t.getLogger(this).warnOnce(`Skipping preview of wide ${i} FBO (${l}x${n}px)`);r.level&&(i+=` ${r.level}`);const d=e.getDownscaledFBO(r,i,this._focusedAttachment,l,n),h=null!=r.depthStencilTexture,c=this.filter?.includes("color")||!this.filter?.includes("depth"),p=this.filter?.includes("depth")||!this.filter?.includes("color");d.fbo?.colorAttachments.forEach((e,t)=>{const l=d.getAttachment(e);if(l){const n=h&&t===r.colorAttachments.length;if(n&&!p||!n&&!c)return;l.retain();const d=a(i,r,e,n),u=this._previews.get(d);u?.[0]?.release(),this._previews.set(d,[l,s,o]),this._allPreviews.add(d)}}),d.detachAllColors(),d.release(),this._dirty=!0}:null},s)])}destroy(){this.removeHandles(),this.view.stage?.renderer&&(this.view.stage.renderer.fboCache.debugCallback=null),this._removeUpdate(),this.node&&(this.node.destroyedCB=()=>{},this.node=i(this.node)),this._previews.forEach(([e])=>e.release()),this._previews.clear()}_matchesFilter(e){return this._namedFilters?.some(t=>e.includes(t))??!0}_updatePreviews(){if(!this._dirty)return;this._dirty=!1,this.renderNow();const e=this._focusedAttachment&&Array.from(this._previews.keys()).includes(this._focusedAttachment);this._focusedAttachment&&!e&&this._deselectFocusFBO(),this._allPreviews.forEach((e,t)=>{const i=this._getElement(t);if(!i)return;i.getContext("2d").clearRect(0,0,i.width,i.height)}),this._previews.forEach(([e,t,i],r)=>{const s=this._getElement(r);if(!s)return;const o=i>this.previewSize?Math.round(t*this.previewSize/i):t,l=i>this.previewSize?this.previewSize:i;s.style.width=`${o}px`,s.style.height=`${l}px`;const n=s.width,d=s.height,h=this._getElement(`label-${r}`);h&&(h.innerText=`${r} (${t}x${i})`);const a=this.node?.getPreviewContent(n,d,e,r),c=s.getContext("2d");c.clearRect(0,0,n,d),a&&c.putImageData(a,0,0)})}_getElement(e){return document.querySelector("arcgis-scene")?.shadowRoot?.getElementById(e)??document.getElementById(e)}_fboPreviewStyle(e){return{width:"1px",height:"1px",background:e?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transform:"rotateX(180deg)"}}_removeUpdate(){null!=this._updateInterval&&(clearInterval(this._updateInterval),this._updateInterval=null)}_selectFocusFBO(e){this._focusedAttachment=e,this.view.stage.renderView.requestRender()}_deselectFocusFBO(){this._focusedAttachment=null,this.node?.clearFocusedFBO(),this.view.stage.renderView.requestRender()}_renderFBOPreviews(){const e=this._allPreviews.size>0?Array.from(this._allPreviews.keys()).sort().map(e=>this._renderFBOPreview(e)):p("div",null);return p("div",{styles:{display:"flex",flexFlow:"row wrap",justifyContent:"flex-end",gap:"2px"}},e)}_renderFBOPreview(e){const t=this._previews.has(e);return p("div",{key:e,onclick:()=>this._selectFocusFBO(e),styles:{display:"flex",flexFlow:"column nowrap",alignItems:"center"}},p("canvas",{id:e,styles:this._fboPreviewStyle(t)}),p("div",{id:e,styles:{display:"flex",justifyContent:"center"}},p("p",{id:`label-${e}`,styles:{fontSize:"12px",color:"white",margin:"1px",textShadow:"-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000"}})))}render(){return p("div",{class:"esri-widget debug-widget",styles:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-end",background:"rgba(255, 255, 255, 0)"}},this._renderFBOPreviews(),p("button",{onclick:()=>this._deselectFocusFBO(),type:"button"},"Reset focus"))}};e([o({constructOnly:!0})],u.prototype,"view",void 0),e([o({constructOnly:!0})],u.prototype,"clearColor",void 0),e([o()],u.prototype,"previewSize",void 0),e([l("previewSize")],u.prototype,"castPreviewSize",null),e([o()],u.prototype,"filter",void 0),e([o()],u.prototype,"_namedFilters",null),e([o()],u.prototype,"node",void 0),e([o()],u.prototype,"active",void 0),u=e([n("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizer")],u);const v=140;export{u as RenderNodeVisualizer,v as minimumPreviewSize};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,cast as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeVisualizerNode as h,getAttachmentName as a}from"./RenderNodeVisualizerNode.js";import c from"../../../../../widgets/Widget.js";import{tsx as p}from"../../../../../widgets/support/widget.js";let u=class extends c{constructor(){super(...arguments),this.clearColor=d,this.previewSize=v,this.filter=["color"],this.node=null,this.active=!0,this._previews=new Map,this._allPreviews=new Set,this._dirty=!0}castPreviewSize(e){return Math.max(e,v)}get _namedFilters(){const e=this.filter?.filter(e=>"color"!==e&&"depth"!==e);return e&&e.length>0?e:null}initialize(){this.node||(this.node=new h({view:this.view,destroyedCB:()=>{this.node=null,this.destroy()},clearColor:this.clearColor}));const e=this.node;this._updateInterval=setInterval(()=>this._updatePreviews()),this.addHandles([r(()=>this.active,i=>{this.view.stage.renderer.fboCache.debugCallback=i?(i,r)=>{if(null==i||null==r||!this.view.stage.renderView.renderingContext)return this._previews.forEach(([e])=>e.release()),void this._previews.clear();if("fbo visualizer"===i||!this._matchesFilter(i)||r&&0===r.colorAttachments.length&&null==r.depthStencilTexture)return;const{width:s,height:o}=r,l=o>this.previewSize?Math.round(s*this.previewSize/o):s,n=o>this.previewSize?this.previewSize:o;if(l/n>4)return void t.getLogger(this).warnOnce(`Skipping preview of wide ${i} FBO (${l}x${n}px)`);r.level&&(i+=` ${r.level}`);const d=e.getDownscaledFBO(r,i,this._focusedAttachment,l,n),h=null!=r.depthStencilTexture,c=this.filter?.includes("color")||!this.filter?.includes("depth"),p=this.filter?.includes("depth")||!this.filter?.includes("color");d.fbo?.colorAttachments.forEach((e,t)=>{const l=d.getAttachment(e);if(l){const n=h&&t===r.colorAttachments.length;if(n&&!p||!n&&!c)return;l.retain();const d=a(i,r,e,n),u=this._previews.get(d);u?.[0]?.release(),this._previews.set(d,[l,s,o]),this._allPreviews.add(d)}}),d.detachAllColors(),d.release(),this._dirty=!0}:null},s)])}destroy(){this.removeHandles(),this.view.stage?.renderer&&(this.view.stage.renderer.fboCache.debugCallback=null),this._removeUpdate(),this.node&&(this.node.destroyedCB=()=>{},this.node=i(this.node)),this._previews.forEach(([e])=>e.release()),this._previews.clear()}_matchesFilter(e){return this._namedFilters?.some(t=>e.includes(t))??!0}_updatePreviews(){if(!this._dirty)return;this._dirty=!1,this.renderNow();const e=this._focusedAttachment&&Array.from(this._previews.keys()).includes(this._focusedAttachment);this._focusedAttachment&&!e&&this._deselectFocusFBO(),this._allPreviews.forEach((e,t)=>{const i=this._getElement(t);if(!i)return;i.getContext("2d").clearRect(0,0,i.width,i.height)}),this._previews.forEach(([e,t,i],r)=>{const s=this._getElement(r);if(!s)return;const o=i>this.previewSize?Math.round(t*this.previewSize/i):t,l=i>this.previewSize?this.previewSize:i;s.style.width=`${o}px`,s.style.height=`${l}px`;const n=s.width,d=s.height,h=this._getElement(`label-${r}`);h&&(h.innerText=`${r} (${t}x${i})`);const a=this.node?.getPreviewContent(n,d,e,r),c=s.getContext("2d");c.clearRect(0,0,n,d),a&&c.putImageData(a,0,0)})}_getElement(e){return document.querySelector("arcgis-scene")?.shadowRoot?.getElementById(e)??document.getElementById(e)}_fboPreviewStyle(e){return{width:"1px",height:"1px",background:e?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transform:"rotateX(180deg)"}}_removeUpdate(){null!=this._updateInterval&&(clearInterval(this._updateInterval),this._updateInterval=null)}_selectFocusFBO(e){this._focusedAttachment=e,this.view.stage.renderView.requestRender()}_deselectFocusFBO(){this._focusedAttachment=null,this.node?.clearFocusedFBO(),this.view.stage.renderView.requestRender()}_renderFBOPreviews(){const e=this._allPreviews.size>0?Array.from(this._allPreviews.keys()).sort().map(e=>this._renderFBOPreview(e)):p("div",null);return p("div",{styles:{display:"flex",flexFlow:"row wrap",justifyContent:"flex-end",gap:"2px"}},e)}_renderFBOPreview(e){const t=this._previews.has(e);return p("div",{key:e,styles:{display:"flex",flexFlow:"column nowrap",alignItems:"center"},onclick:()=>this._selectFocusFBO(e)},p("canvas",{id:e,styles:this._fboPreviewStyle(t)}),p("div",{id:e,styles:{display:"flex",justifyContent:"center"}},p("p",{id:`label-${e}`,styles:{fontSize:"12px",color:"white",margin:"1px",textShadow:"-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000"}})))}render(){return p("div",{class:"esri-widget debug-widget",styles:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-end",background:"rgba(255, 255, 255, 0)"}},this._renderFBOPreviews(),p("button",{type:"button",onclick:()=>this._deselectFocusFBO()},"Reset focus"))}};e([o({constructOnly:!0})],u.prototype,"view",void 0),e([o({constructOnly:!0})],u.prototype,"clearColor",void 0),e([o()],u.prototype,"previewSize",void 0),e([l("previewSize")],u.prototype,"castPreviewSize",null),e([o()],u.prototype,"filter",void 0),e([o()],u.prototype,"_namedFilters",null),e([o()],u.prototype,"node",void 0),e([o()],u.prototype,"active",void 0),u=e([n("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizer")],u);const v=140;export{u as RenderNodeVisualizer,v as minimumPreviewSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{floatSubArray as t}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as e}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as i,compactIndices as s}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{compressNormal as o}from"./Normals.js";class n{constructor(s,o,n,h,a,u={}){this.path=s,this.profile=o,this.extruder=n,this.startCap=h,this.endCap=a,this.options=u,this._extrusionVertexCount=0,this._extrusionFrameCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=n.numProfilesPerJoin()*l+2,this.numVerticesTotal=o.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=n.numProfileFramesPerPathVertex()*l+4,this.startCap.vertexBufferStart=this.numVerticesTotal;const p=this.startCap.numVertices;this.numVerticesTotal+=p,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.profileRightAxes=r(2*this.numExtrusionFrames),this.profileUpAxes=r(2*this.numExtrusionFrames),this.framePositionIndices=i(this.numExtrusionFrames),this.profileVertexAndNormals=e(4*this.numVerticesTotal),this.profileAuxData=e(3*this.numVerticesTotal),this.vertexFrameIndices=i(this.numVerticesTotal),this.positions=t(s.positions,s.offset,3*s.vertices.length),this._rebuildGeometry(),this._buildTopology()}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],o=3*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;this.profileAuxData[o+2]=0,this.vertexFrameIndices[this._extrusionVertexCount]=e,++this._extrusionVertexCount}emitExtrusionFrame(t,e){return o(this.profileRightAxes,this._extrusionFrameCount,t.right[0],t.right[1],t.right[2]),o(this.profileUpAxes,this._extrusionFrameCount,t.up[0],t.up[1],t.up[2]),this.framePositionIndices[this._extrusionFrameCount]=e,this._extrusionFrameCount++}emitCapVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;this.profileVertexAndNormals[o]=e[0],this.profileVertexAndNormals[o+1]=e[1],this.profileVertexAndNormals[o+2]=i[0],this.profileVertexAndNormals[o+3]=i[1],o=3*this._extrusionVertexCount,this.profileAuxData[o]=s,this.profileAuxData[o+1]=r,this.profileAuxData[o+2]=1,this.vertexFrameIndices[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;const{positions:e,offset:i,vertices:s}=this.path;this.positions=t(e,i,3*s.length);let r=0;const o=(t,e,i,s,r)=>this.emitCapVertex(t,e,i,s,r),n=(t,e,i,s)=>this.emitVertex(r,t,e,i,s),h=t=>this.emitExtrusionFrame(t,r);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o,h),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,n,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o,h),r=0,this.startCap.rebuildCapGeometry(s[r],o,h),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o,h)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let r=3*(2*(e*i));this.startCap.indexBufferStart=r,this.startCap.firstProfileVertexIndex=0,r+=this.startCap.numIndices,this.endCap.indexBufferStart=r,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,n=(t,e,i)=>{o.push(t),o.push(e),o.push(i)};for(let s=0;s<e;++s){const e=this.profile.indices[2*s],r=this.profile.indices[2*s+1];for(let s=0;s<i;++s){const i=s*t+e,o=(s+1)*t+r,h=s*t+r;n(i,(s+1)*t+e,o),n(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],n),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],n),this.vertexIndices=s(o)}onPathChanged(){this._rebuildGeometry()}}export{n as PathBuilder};
2
+ import{fromRotation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as r,floatSubArray as o}from"../../../../geometry/support/FloatArray.js";import{newIndexArray as n,compactIndices as h}from"../../../../geometry/support/Indices.js";import{newShortArray as a}from"../../../../geometry/support/ShortArray.js";import{compressNormal as m}from"./Normals.js";import{PathEvaluator as u}from"./PathEvaluator.js";import{encodePathVertexInfo as p}from"./PathVertexInfo.js";class c{constructor(t,e,i,s,h){this.path=t,this.profile=e,this.extruder=i,this.cap=s,this._extrusionVertexCount=0,this._extrusionFrameCount=0;const m=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*m+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=i.numProfileFramesPerPathVertex()*m+2;const p=this.cap.numVertices;this.startCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=p,this.endCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=p,this.profileRightAxes=a(2*this.numExtrusionFrames),this.profileUpAxes=a(2*this.numExtrusionFrames),this.profileRotationFrameRightAxes=1===h?r(2*this.numExtrusionFrames):null,this.pathMaxStretchDistances=r(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=n(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.vertexFrameIndices=n(this.numVerticesTotal),this.positions=o(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new u(this,e,s.type,i.cutoffAngle,h)}emitVertexDescriptor(t,e){const i=this._extrusionVertexCount;this.pathVertexInfos[i]=p(t),this.vertexFrameIndices[i]=e,++this._extrusionVertexCount}emitExtrusionFrame(e,s,r){const{frame:o,rotationRight:n,rotationFrameUp:h,rotationAngle:a,maxStretchDistance:u}=e,p=this._extrusionFrameCount;return 0===r?(m(this.profileRightAxes,p,o.right[0],o.right[1],o.right[2]),m(this.profileUpAxes,p,o.up[0],o.up[1],o.up[2])):(t(f,r,h),i(l,o.up,f),i(x,o.right,f),m(this.profileRightAxes,p,x[0],x[1],x[2]),m(this.profileUpAxes,p,l[0],l[1],l[2])),this.profileRotations[p]=a,this.profileRotationFrameRightAxes&&(this.profileRotationFrameRightAxes[2*p]=n[0],this.profileRotationFrameRightAxes[2*p+1]=n[1]),this.pathMaxStretchDistances[p]=u,this.framePositionIndices[p]=s,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;const{positions:t,offset:e,vertices:i}=this.path,{profile:s}=this;this.positions=o(t,e,3*i.length);const r=this.emitExtrusionFrame(i[0],0,0);for(let o=0;o<s.vertices.length;++o)this.emitVertexDescriptor({sourceIndex:o,subdivision:0,type:1,capSide:0},r);const n=(t,e,i)=>{this.emitVertexDescriptor({sourceIndex:e,subdivision:i,type:0,capSide:0},t)},h=(t,e,i)=>this.emitExtrusionFrame(t,e,i);for(let o=1;o<i.length-1;++o){const t=i[o];this.extruder.extrude(t,o,this.profile,n,h)}const a=i.length-1,m=this.emitExtrusionFrame(i[a],a,0);for(let o=0;o<s.vertices.length;++o)this.emitVertexDescriptor({sourceIndex:o,subdivision:0,type:1,capSide:1},m);const u=(t,e,i)=>this.emitVertexDescriptor({sourceIndex:t,subdivision:e,type:i,capSide:0},0),p=(t,e,i)=>this.emitVertexDescriptor({sourceIndex:t,subdivision:e,type:i,capSide:1},m);this.cap.rebuildCapGeometry(u),this.cap.rebuildCapGeometry(p)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1,s=0,r=t*(this.numExtrusionProfiles-1),o=new Array,n=(t,e,i)=>{o.push(t),o.push(e),o.push(i)};for(let h=0;h<e;++h){const e=this.profile.indices[2*h],s=this.profile.indices[2*h+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;n(i,(r+1)*t+e,o),n(i,o,h)}}this.cap.buildTopology(n,0,this.startCapVertexBufferStart,s),this.cap.buildTopology(n,1,this.endCapVertexBufferStart,r),this.vertexIndices=h(o)}onPathChanged(){this._rebuildGeometry()}}const l=s(),x=s(),f=e();export{c as PathBuilder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{set as e,subtract as t,scale as s,add as i,normalize as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";class o{rebuildConnectingProfileGeometry(e,t,s,i){const r=i(e.frame);for(let n=0;n<t.vertices.length;++n)s(r,t.vertices[n],t.normals[n],0,0)}}class l extends o{constructor(){super(),this.numVertices=0,this.numIndices=0}rebuildCapGeometry(){}buildTopology(){}}class f extends o{constructor(e,t=0,s=!1){super(),this.profile=e,this.profilePlaneOffset=t,this.flip=s}get numVertices(){return this.profile.vertices.length}get numIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(e,t,s,i){const r=this.profilePlaneOffset,n=i(e.frame);for(let o=0;o<t.vertices.length;++o)s(n,t.vertices[o],t.normals[o],r,0)}rebuildCapGeometry(t,s,i){const r=this.profile,n=this.flip?1:-1,o=this.profilePlaneOffset,l=m;e(l,0,0);const f=i(t.frame);for(let e=0;e<r.vertices.length;++e)s(f,r.vertices[e],l,o,n)}buildTopology(e,t){const s=this.profile,i=this.vertexBufferStart+s.indices[0];for(let r=1;r<s.numSegments;++r){const e=s.indices[2*r],n=s.indices[2*r+1],o=this.vertexBufferStart+e,l=this.vertexBufferStart+n;this.flip?t(l,o,i):t(i,o,l)}}}class h extends o{constructor(e){super(),this.flip=!1,this.sign=0,this.breakNormals=!1,this.numSegments=3,this.profile=e.profile,this.flip=e.flip,this.sign=this.flip?1:-1,this.breakNormals=e.breakNormals,this.numSegments=e.subdivisions}get numVertices(){let e=this.profile.vertices.length*(this.numSegments-1)+this.profile.poles.length;return this.breakNormals&&(e+=this.profile.vertices.length),e}get numIndices(){let e=0;const t=this.profile;e+=2*t.numSegments*(this.numSegments-1);for(let s=0;s<t.numSegments;++s){const i=t.indices[2*s],r=t.indices[2*s+1];t.poleIndices[i]===t.poleIndices[r]?e+=1:e+=2}return 3*e}rebuildCapGeometry(n,o,l){const f=this.profile,h=l(n.frame),p=.5*this.sign,a=c,u=m;e(u,0,0);for(const e of f.poles)e.normal?o(h,e.position,e.normal,p,0):o(h,e.position,u,p,this.sign);if(this.breakNormals)for(let e=0;e<f.vertices.length;++e)o(h,f.vertices[e],f.normals[e],0,0);for(let e=0;e<this.numSegments-1;++e){const n=(1-(e+1)/this.numSegments)*Math.PI*.5,l=Math.sin(n),c=Math.cos(n);for(let e=0;e<f.vertices.length;++e){const n=f.poles[f.poleIndices[e]];t(a,f.vertices[e],n.position),s(a,a,l),n.normal?(i(a,a,n.position),o(h,a,n.normal,p*c,0)):(r(u,a),s(u,u,l),i(a,a,n.position),o(h,a,u,p*c,this.sign*c))}}}buildTopology(e,t){const s=this.profile,i=this.breakNormals?this.vertexBufferStart+s.poles.length:this.firstProfileVertexIndex,r=this.breakNormals?this.vertexBufferStart+s.poles.length+s.vertices.length:this.vertexBufferStart+s.poles.length;for(let n=0;n<s.numSegments;++n){const e=s.indices[2*n],o=s.indices[2*n+1],l=this.vertexBufferStart+s.poleIndices[e],f=this.vertexBufferStart+s.poleIndices[o];let h=i+e,c=i+o;for(let i=0;i<this.numSegments-1;++i){const n=r+i*s.vertices.length+e,l=r+i*s.vertices.length+o;this.flip?(t(n,c,h),t(c,n,l)):(t(h,c,n),t(l,n,c)),h=n,c=l}this.flip?(t(l,c,h),l!==f&&t(l,f,c)):(t(h,c,l),l!==f&&t(c,f,l))}}}const c=n(),m=n();export{l as NoCapBuilder,o as PathCapBuilder,h as RoundCapBuilder,f as TriangulationCapBuilder};
2
+ import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class s{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return 3*this._profile.numSegments}rebuildCapGeometry(e){const t=this._profile;for(let s=0;s<t.vertices.length;++s)e(s,0,2)}buildTopology(e,t,s){const i=this._profile,r=s+i.indices[0],o=1===t;for(let l=1;l<i.numSegments;++l){const t=s+i.indices[2*l],n=s+i.indices[2*l+1];o?e(n,t,r):e(r,t,n)}}}class i{constructor(e,t){this._profile=e,this._breakNormals=t,this.type=3}get numVertices(){let t=this._profile.vertices.length*(e-1)+this._profile.poles.length;return this._breakNormals&&(t+=this._profile.vertices.length),t}get numIndices(){let t=0;const s=this._profile;t+=2*s.numSegments*(e-1);for(let e=0;e<s.numSegments;++e){const i=s.indices[2*e],r=s.indices[2*e+1];s.poleIndices[i]===s.poleIndices[r]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t){const s=this._profile;for(let e=0;e<s.poles.length;++e)t(e,0,3);if(this._breakNormals)for(let e=0;e<s.vertices.length;++e)t(e,0,1);for(let i=0;i<e-1;++i)for(let e=0;e<s.vertices.length;++e)t(e,i,4)}buildTopology(t,s,i,r){const o=this._profile,l=this._breakNormals?i+o.poles.length:r,n=this._breakNormals?i+o.poles.length+o.vertices.length:i+o.poles.length,c=1===s;for(let h=0;h<o.numSegments;++h){const s=o.indices[2*h],r=o.indices[2*h+1],p=i+o.poleIndices[s],g=i+o.poleIndices[r];let m=l+s,u=l+r;for(let i=0;i<e-1;++i){const e=n+i*o.vertices.length+s,l=n+i*o.vertices.length+r;c?(t(e,u,m),t(u,e,l)):(t(m,u,e),t(l,e,u)),m=e,u=l}c?(t(p,u,m),p!==g&&t(p,g,u)):(t(m,u,p),p!==g&&t(u,g,p))}}}export{t as NoCapBuilder,i as RoundCapBuilder,s as TriangulationCapBuilder};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{set as i,length as s,normalize as o,dot as a,scale as l,add as c,subtract as n,transformMat2 as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as m,ZEROS as h,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as x,set as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newHalfFloatArray as d}from"../../../../geometry/support/HalfFloatArray.js";import{pathNumRoundCapExtrusionSubdivisions as P}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decompressNormal as _,compressNormal as b}from"./Normals.js";import{decodePathVertexInfo as w}from"./PathVertexInfo.js";class V{constructor(e,t,r,i,s){this.builder=e,this.profile=t,this.capType=r,this.miterCutoffAngle=i,this.upVectorAlignment=s}evaluateBakedVertices(e,t,r){const{numVerticesTotal:n,profileRightAxes:f,profileUpAxes:m,framePositionIndices:h,vertexFrameIndices:p,positions:A}=this.builder,P=d(4),w=d(3);for(let d=0;d<n;++d){this._evaluateProfileVertexNormalAux(P,w,d,0);const n=k;let V=0,v=0;const g=p[d],I=_(C,f,g),D=_(M,m,g),N=3*h[g],j=i(F,P[0]*r[0],P[1]*r[1]);if(1===w[2])x(n,D,I),V=w[0]*r[0],v=w[1];else{const e=T,t=R;i(e,w[0],w[1]);const r=s(e);o(e,e);const f=a(j,e);if(Math.abs(f)>r){i(t,-e[1],e[0]);const s=a(j,t);l(e,e,r*Math.sign(f)),l(t,t,s),c(j,e,t)}u(n,0,0,0)}const y=I[0]*j[0]+D[0]*j[1],J=I[1]*j[0]+D[1]*j[1],S=I[2]*j[0]+D[2]*j[1],U=3*d;e[U]=A[N]+y+n[0]*V,e[U+1]=A[N+1]+J+n[1]*V,e[U+2]=A[N+2]+S+n[2]*V;const B=P[2],G=P[3];b(t,d,I[0]*B+D[0]*G+n[0]*v,I[1]*B+D[1]*G+n[1]*v,I[2]*B+D[2]*G+n[2]*v)}}evaluateFastPathVertices(e,t){const{numVerticesTotal:r}=this.builder;for(let i=0;i<r;++i)this._evaluateProfileVertexNormalAux(e,t,i,i)}_evaluateProfileVertexNormalAux(e,t,r,s){const{profileRotations:f,profileRotationFrameRightAxes:p,pathMaxStretchDistances:x,pathVertexInfos:u,vertexFrameIndices:A}=this.builder,{miterCutoffAngle:d,profile:_,upVectorAlignment:b}=this,V=v[b],j=w(u[r]),C=A[r],M=f[C],k=null!=p?i(y,p[2*C],p[2*C+1]):m,F=x[C];switch(j.type){case 0:{const r=_.vertices[j.sourceIndex],i=_.normals[j.sourceIndex],o=Math.abs(M)>=d,c=a(r,k)*M>=0;if(o&&c)this._writeProfileVertexAndNormal(e,s,r,i);else{const t=V(D,r,M,k);this._writeProfileVertexAndNormal(e,s,t,i)}if(c)this._writeProfileAuxDataJoin(t,s,h);else{const e=l(N,k,F);this._writeProfileAuxDataJoin(t,s,e)}break}case 1:{const r=_.vertices[j.sourceIndex],i=_.normals[j.sourceIndex];switch(this._writeProfileVertexAndNormal(e,s,r,i),this.capType){case 0:case 1:case 3:this._writeProfileAuxDataCap(t,s,0,0);break;case 2:this._writeProfileAuxDataCap(t,s,g(j)?.5:-.5,0)}break}case 2:{const r=_.vertices[j.sourceIndex],i=g(j),o=i?1:-1,a=2===this.capType?i?.5:-.5:0,l=h;this._writeProfileVertexAndNormal(e,s,r,l),this._writeProfileAuxDataCap(t,s,a,o);break}case 3:{const r=g(j)?1:-1,i=.5*r,o=_.poles[j.sourceIndex],a=o.position,l=o.normal;l?(this._writeProfileVertexAndNormal(e,s,a,l),this._writeProfileAuxDataCap(t,s,i,0)):(this._writeProfileVertexAndNormal(e,s,a,h),this._writeProfileAuxDataCap(t,s,i,r));break}case 4:{const r=g(j)?1:-1,i=.5*r,a=(1-(j.subdivision+1)/P)*Math.PI*.5,f=Math.sin(a),m=Math.cos(a),h=_.poleIndices[j.sourceIndex],p=_.poles[h],x=p.position,u=p.normal,A=_.vertices[j.sourceIndex];n(D,A,x),l(D,D,f),u?(c(D,D,x),this._writeProfileVertexAndNormal(e,s,D,u),this._writeProfileAuxDataCap(t,s,i*m,0)):(o(I,D),l(I,I,f),c(D,D,x),this._writeProfileVertexAndNormal(e,s,D,I),this._writeProfileAuxDataCap(t,s,i*m,r*m));break}}}_writeProfileVertexAndNormal(e,t,r,i){const s=4*t;e[s]=r[0],e[s+1]=r[1],e[s+2]=i[0],e[s+3]=i[1]}_writeProfileAuxDataJoin(e,t,r){const i=3*t;e[i]=r[0],e[i+1]=r[1],e[i+2]=0}_writeProfileAuxDataCap(e,t,r,i){const s=3*t;e[s]=r,e[s+1]=i,e[s+2]=1}}const v={0:(t,r,s)=>{if(Math.abs(s)<=0)return r;const o=e(Math.cos(.5*s));return i(t,(o-1+1)*r[0],r[1])},1:(r,i,s,o)=>{if(0===Math.abs(s))return i;const a=e(Math.cos(.5*s)),l=t(j,1+(a-1)*o[0]*o[0],(a-1)*o[0]*o[1],(a-1)*o[0]*o[1],1+(a-1)*o[1]*o[1]);return f(r,i,l)}};function g(e){return 1===e.capSide}const I=p(),D=p(),N=p(),j=r(),C=A(),M=A(),y=p(),k=A(),F=p(),T=p(),R=p();export{V as PathEvaluator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fromRotation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{dot as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class n{}class m{numProfilesPerJoin(){return 1}numProfileFramesPerPathVertex(){return 1}extrude(t,e,r,i){const s=i(t.frame);for(let o=0;o<e.vertices.length;++o)r(s,e.vertices[o],e.normals[o],!1)}}class c{constructor(t,e){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}numProfileFramesPerPathVertex(){return this.numBendSubdivisions+2}extrude(e,i,s,o){const n=h,{rotationAngle:m,rotationRight:c,frame:a}=e,v=o(a),d=new Array,g=e.rotationFrameUp;for(let r=0;r<this.numBendSubdivisions+1;++r)t(f,.5*-m+r*m/this.numBendSubdivisions,g),l(n,a,f),d.push(o(n));if(Math.abs(m)>=this.cutoffAngle)for(let t=0;t<this.numBendSubdivisions+1;++t){const o=d[t];for(let t=0;t<i.vertices.length;++t){if(r(i.vertices[t],c)*m>=0)s(o,i.vertices[t],i.normals[t],!1);else{s(v,e.applyMiterStretch(u,i.vertices[t]),i.normals[t],!0)}}}else for(let t=0;t<this.numBendSubdivisions+1;++t)for(let o=0;o<i.vertices.length;++o){const t=r(i.vertices[o],c)*m>=0;s(v,e.applyMiterStretch(u,i.vertices[o]),i.normals[o],!t)}}}class a{constructor(){this.up=o(),this.right=o()}}function l(t,e,r){s(t.up,e.up,r),s(t.right,e.right,r)}const u=i(),f=e(),h=new a;export{a as Frame2D,c as MiterExtruder,n as PathExtruder,m as SimpleExtruder};
2
+ import{dot as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";class t{constructor(i,t){this.cutoffAngle=i,this.numBendSubdivisions=t}numProfilesPerJoin(){return this.numBendSubdivisions+1}numProfileFramesPerPathVertex(){return this.numBendSubdivisions+2}extrude(t,e,s,n,o){const{rotationAngle:r,rotationRight:u}=t,h=o(t,e,0),l=new Array;for(let i=0;i<this.numBendSubdivisions+1;++i){const s=.5*-r+i*r/this.numBendSubdivisions;l.push(o(t,e,s))}if(Math.abs(r)>=this.cutoffAngle)for(let d=0;d<this.numBendSubdivisions+1;++d){const t=l[d];for(let e=0;e<s.vertices.length;++e){n(i(s.vertices[e],u)*r>=0?t:h,e,d)}}else for(let i=0;i<this.numBendSubdivisions+1;++i)for(let t=0;t<s.vertices.length;++t)n(h,t,i)}}export{t as MiterExtruder};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class t{constructor(){this.up=r(),this.right=r()}}export{t as PathFrame2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{copy as t,set as e,length as i,normalize as s,dot as o,scale as r,add as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as l,set as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as m}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as f,getZeroIndexArray as d}from"../../../../geometry/support/Indices.js";import{Attribute as b,Vertices as x}from"./Attribute.js";import{decompressNormal as v,compressNormal as g}from"./Normals.js";import{intersectTriangles as A}from"./RayIntersections.js";class w{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class y extends w{constructor(t){super(t),this.color=p(255,255,255,255),this._size=a(),this.positions=u(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){m(this.color,t)}bake(a){t(this._size,a);const{numVerticesTotal:h,positions:m,profileRightAxes:p,profileUpAxes:u,profileVertexAndNormals:f,profileAuxData:d,vertexFrameIndices:b,framePositionIndices:x}=this.builder;for(let t=0;t<h;++t){const h=z;let A=0,w=0;const y=b[t],j=v(_,p,y),F=v(P,u,y),D=3*x[y],k=4*t,N=e(I,f[k]*a[0],f[k+1]*a[1]),R=3*t;if(1===d[R+2])l(h,F,j),A=d[R]*a[0],w=d[R+1];else{const t=C,a=V;e(t,d[R],d[R+1]);const l=i(t);s(t,t);const m=o(N,t);if(Math.abs(m)>l){e(a,-t[1],t[0]);const i=o(N,a);r(t,t,l*Math.sign(m)),r(a,a,i),n(N,t,a)}c(h,0,0,0)}const M=j[0]*N[0]+F[0]*N[1],T=j[1]*N[0]+F[1]*N[1],U=j[2]*N[0]+F[2]*N[1];this.positions[R]=m[D]+M+h[0]*A,this.positions[R+1]=m[D+1]+T+h[1]*A,this.positions[R+2]=m[D+2]+U+h[2]*A;const E=f[k+2],G=f[k+3];g(this.normals,t,j[0]*E+F[0]*G+h[0]*w,j[1]*E+F[1]*G+h[1]*w,j[2]*E+F[2]*G+h[2]*w)}}createGeometryData(){const t=this.builder.vertexIndices;return[["position",new b(this.positions,t,3,!0)],["normalCompressed",new b(this.normals,t,2,!0)],["color",new b(this.color,d(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,i,s){const o=this.builder.vertexIndices,r=new x(this.positions,3),n=o.length/3;A(t,e,0,n,o,r,void 0,i,s)}get size(){return this._size}}class j extends w{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.baked=new y(t),this._vvSize=e,this._vvColor=i,this._vvOpacity=s}createGeometryData(){const t=this.builder,{vertexIndices:e,framePositionIndices:i,numExtrusionFrames:s}=t,o=f(s),r=d(s);return[["position",new b(t.positions,i,3,!0)],["profileRight",new b(t.profileRightAxes,o,2,!0)],["profileUp",new b(t.profileUpAxes,o,2,!0)],["sizeFeatureAttribute",new b([this._vvSize],r,1,!0)],["colorFeatureAttribute",new b([this._vvColor],r,1,!0)],["opacityFeatureAttribute",new b([this._vvOpacity],r,1,!0)],["textureElementIndex",new b(t.vertexFrameIndices,e,1,!0)],["profileVertexAndNormal",new b(t.profileVertexAndNormals,e,4,!0)],["profileAuxData",new b(t.profileAuxData,e,3,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute("position");e&&(e.data=this.builder.positions)}}const I=a(),C=a(),V=a(),z=h(),_=h(),P=h();export{j as FastUpdatePathGeometry,w as PathGeometryData,y as StaticPathGeometry};
2
+ import{copy as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as s}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as o}from"../../../../geometry/support/HalfFloatArray.js";import{getContinuousIndexArray as a,getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{Attribute as n,Vertices as h}from"./Attribute.js";import{intersectTriangles as u}from"./RayIntersections.js";class c{constructor(t){this.builder=t,this.color=r(255,255,255,255),this._size=e(),this.positions=s(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){i(this.color,t)}bake(e){t(this._size,e),this.builder.evaluator.evaluateBakedVertices(this.positions,this.normals,e)}createGeometryData(){const t=this.builder.vertexIndices;return[["position",new n(this.positions,t,3,!0)],["normalCompressed",new n(this.normals,t,2,!0)],["color",new n(this.color,l(t.length),4,!0)]]}onPathChanged(){this.builder.onPathChanged(),this.bake(this.size)}intersect(t,e,i,r){const s=this.builder.vertexIndices,o=new h(this.positions,3),a=s.length/3;u(t,e,0,a,s,o,void 0,i,r)}get size(){return this._size}}class m{constructor(t,e,i,r){this.builder=t,this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=r,this.baked=new c(t),this._profileVertexAndNormal=o(4*t.numVerticesTotal),this._profileAuxData=o(3*t.numVerticesTotal),t.evaluator.evaluateFastPathVertices(this._profileVertexAndNormal,this._profileAuxData),this._vvSize=e,this._vvColor=i,this._vvOpacity=r}createGeometryData(){const t=this.builder,{vertexIndices:e,framePositionIndices:i,numExtrusionFrames:r}=t,s=a(r),o=l(r);return[["position",new n(t.positions,i,3,!0)],["profileRight",new n(t.profileRightAxes,s,2,!0)],["profileUp",new n(t.profileUpAxes,s,2,!0)],["sizeFeatureAttribute",new n([this._vvSize],o,1,!0)],["colorFeatureAttribute",new n([this._vvColor],o,1,!0)],["opacityFeatureAttribute",new n([this._vvOpacity],o,1,!0)],["textureElementIndex",new n(t.vertexFrameIndices,e,1,!0)],["profileVertexAndNormal",new n(this._profileVertexAndNormal,e,4,!0)],["profileAuxData",new n(this._profileAuxData,e,3,!0)]]}onPathChanged(t){const e=this.builder;e.onPathChanged(),e.evaluator.evaluateFastPathVertices(this._profileVertexAndNormal,this._profileAuxData);const i=t.getMutableAttribute("position");i&&(i.data=this.builder.positions)}}export{m as FastUpdatePathGeometry,c as StaticPathGeometry};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{acosClamped as t,reciprocalClamped as i}from"../../../../core/mathUtils.js";import{set as r}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{transformMat2 as s,set as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as a,create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{dot as n,cross as m,scale as g,normalize as f,add as c,negate as l,subtract as u,copy as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Frame2D as M}from"./PathExtruder.js";class b{constructor(){this.vLeft=v(),this.vRight=v(),this.vMinSiblingLength=0,this.frame=new M}setFrameFromUpVector(t){p(this.frame.up,t),c(y,this.vLeft,this.vRight),f(y,y),g(I,this.frame.up,n(y,this.frame.up)),u(D,y,I),f(D,D),m(this.frame.right,D,this.frame.up)}get foldingAngle(){return Math.PI-this.rotationAngle}}class x extends b{get rotationFrameUp(){return this.frame.up}get rotationRight(){return a}get rotationAngle(){g(w,this.frame.up,n(this.frame.up,this.vLeft)),u(w,this.vLeft,w),l(w,w),f(w,w),g(P,this.frame.up,n(this.frame.up,this.vRight)),u(P,this.vRight,P),f(P,P),m(U,this.rotationFrameUp,this.vLeft);return Math.sign(n(U,this.vRight))*(Math.PI-t(n(w,P)))}get maxStretchDistance(){return Math.abs(this.vMinSiblingLength/Math.cos(.5*this.foldingAngle))}applyMiterStretch(t,r){const e=this.rotationAngle;if(Math.abs(e)<=0)return r;const s=i(Math.cos(.5*e));return h(t,(s-1+1)*r[0],r[1])}}class R extends b{get rotationFrameUp(){const t=Math.sign(n(this.frame.right,this.vRight));return m(A,this.vRight,this.vLeft),g(A,A,t),f(A,A)}get rotationRight(){const t=this.rotationFrameUp,i=n(t,this.frame.up),r=n(t,this.frame.right);return g(d,this.frame.up,-r),g(F,this.frame.right,i),c(d,d,F),f(d,d),L(S,this.frame,d),S}get rotationAngle(){const i=Math.sign(n(this.frame.right,this.vRight));return l(U,this.vLeft),-i*(Math.PI-t(n(U,this.vRight)))}get maxStretchDistance(){return Math.abs(this.vMinSiblingLength*i(Math.cos(.5*this.foldingAngle)))}applyMiterStretch(t,e){const h=this.rotationAngle;if(0===Math.abs(h))return e;const a=i(Math.cos(.5*h)),o=this.rotationRight,n=r(E,1+(a-1)*o[0]*o[0],(a-1)*o[0]*o[1],(a-1)*o[0]*o[1],1+(a-1)*o[1]*o[1]);return s(t,e,n)}}function L(t,i,r){h(t,n(r,i.right),n(r,i.up))}function j(t){switch(t){case 0:return new x;case 1:return new R}}const A=v(),S=o(),d=v(),F=v(),U=v(),w=v(),P=v(),I=v(),y=v(),D=v(),E=e();export{b as PathVertex,j as newPathVertex};
2
+ import{acosClamped as t,reciprocalClamped as i}from"../../../../core/mathUtils.js";import{set as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as e,create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{dot as h,cross as a,scale as n,normalize as o,add as g,negate as m,subtract as f,copy as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{PathFrame2D as l}from"./PathFrame2D.js";class p{constructor(){this.vLeft=u(),this.vRight=u(),this.vMinSiblingLength=0,this.frame=new l}setFrameFromUpVector(t){c(this.frame.up,t),g(w,this.vLeft,this.vRight),o(w,w),n(S,this.frame.up,h(w,this.frame.up)),f(P,w,S),o(P,P),a(this.frame.right,P,this.frame.up)}get foldingAngle(){return Math.PI-this.rotationAngle}}class v extends p{get rotationFrameUp(){return this.frame.up}get rotationRight(){return e}get rotationAngle(){n(U,this.frame.up,h(this.frame.up,this.vLeft)),f(U,this.vLeft,U),m(U,U),o(U,U),n(d,this.frame.up,h(this.frame.up,this.vRight)),f(d,this.vRight,d),o(d,d),a(A,this.rotationFrameUp,this.vLeft);return Math.sign(h(A,this.vRight))*(Math.PI-t(h(U,d)))}get maxStretchDistance(){return Math.abs(this.vMinSiblingLength/Math.cos(.5*this.foldingAngle))}}class M extends p{get rotationFrameUp(){const t=Math.sign(h(this.frame.right,this.vRight));return a(b,this.vRight,this.vLeft),n(b,b,t),o(b,b)}get rotationRight(){const t=this.rotationFrameUp,i=h(t,this.frame.up),r=h(t,this.frame.right);return n(F,this.frame.up,-r),n(j,this.frame.right,i),g(F,F,j),o(F,F),R(x,this.frame,F),x}get rotationAngle(){const i=Math.sign(h(this.frame.right,this.vRight));return m(A,this.vLeft),-i*(Math.PI-t(h(A,this.vRight)))}get maxStretchDistance(){return Math.abs(this.vMinSiblingLength*i(Math.cos(.5*this.foldingAngle)))}}function R(t,i,e){r(t,h(e,i.right),h(e,i.up))}function L(t){switch(t){case 0:return new v;case 1:return new M}}const b=u(),x=s(),F=u(),j=u(),A=u(),U=u(),d=u(),S=u(),w=u(),P=u();export{p as PathVertex,L as newPathVertex};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{assert as i}from"./Util.js";const n=0,e=15,o=4,s=7,d=o+3,r=7,t=d+3,u=1;function c({sourceIndex:c,subdivision:p,type:v,capSide:a}){return i(c>=0&&c<=e,"invalid sourceIndex"),i(p>=0&&p<=s,"invalid subdivision"),(c&e)<<n|(p&s)<<o|(v&r)<<d|(a&u)<<t}function p(i){return{sourceIndex:i>>n&e,subdivision:i>>o&s,type:i>>d&r,capSide:i>>t&u}}export{p as decodePathVertexInfo,c as encodePathVertexInfo,u as pathVertexInfoCapSideMask,t as pathVertexInfoCapSideShift,e as pathVertexInfoSourceIndexMask,n as pathVertexInfoSourceIndexShift,s as pathVertexInfoSubdivisionMask,o as pathVertexInfoSubdivisionShift,r as pathVertexInfoTypeMask,d as pathVertexInfoTypeShift};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as I,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as S,InternalRenderCategory as R,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{FBOCache as N}from"../core/FBOCache.js";import{RenderPassManager as H}from"../core/renderPasses/RenderPassManager.js";import{isColor as x}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as y}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as L}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as q}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{Compositor as z}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as X}from"./depthRangeUtils.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderContext as J,defaultRenderOccludedMask as K}from"./RenderContext.js";import{RendererBase as Z}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment2 as me,ColorAttachment0 as ue,DrawBufferNone as _e}from"../../../webgl/enums.js";let pe=class extends Z{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new H,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new re,this.sceneDepthRange=_(Y.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Se)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new N(i),this._compositor=new z(i,s),this._renderStateFeatures=_(ee(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new J(this._rctx,a,s),this._framebuffer=new $(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this._shadowAccumulator=new se(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new v(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new L({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=y,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Q.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ge(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,I)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ee),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(S.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),r.setGLViewport(this._rctx);const m=this._framebuffer,u=m.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),_=this._needsLastFrameColor;_?(u?.retain(_-1),u?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=u):u?.release(),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ae),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...be),this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),m.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(S.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=m.color.obtainAttachment(de)),m.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&m.update(e=>this._renderHUD(b,e)),m.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||m.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,m.update(e=>this._renderNodes(R.MAGNIFIER,e)),m.update(e=>this._renderNodes(S.FINAL,e)),i&&this._blit.toFramebuffer(m.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),m.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=m.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const t=this._bindParameters,s=t.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(s,R.OPAQUE_ENVIRONMENT,R.GAUSSIAN_SPLAT,R.OPAQUE_OCCLUSION_QUERY,R.VOXEL);if(2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2),this._bindParameters.output=3,this._plugins.precompile(...fe),this._bindParameters.output=0,this._plugins.precompile(...fe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(s,R.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(s,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(s,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(s,S.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),s&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(14),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=t===this._bindParameters.shadowMap&&6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowCasterNodes();t.finish(e),this._bindParameters.output=s}_renderShadowCasterNodes(){if(!this._nodes.produces(R.SHADOW_CASTERS))return;const e=this._bindParameters.shadowMap.renderTarget;if(!e)return;const t=e.name;e.setName(R.SHADOW_CASTERS),this._pluginInput.set(R.SHADOW_CASTERS,e);try{this._nodes.render(e,this._pluginInput,this._releaseNodeInputs)}finally{e.setName(t),this._pluginInput.set(R.SHADOW_CASTERS,null)}}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(oe.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=X(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),this._bindParameters.shadowMap.enabled&&t.union(this._nodes.queryDepthRange(R.SHADOW_CASTERS,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<q)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=X(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,ge),this._needsDepth&&this._precompilePlugins(3,Pe)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&(this._shadowAccumulator.precompilePrepass(),this._precompileAllGeometry(5)),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...ge);const r=this._nodes.optional("normals",...O,R.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.hasGlobalIlluminationHighQuality?this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION_HIGH_QUALITY):this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor),this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...fe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ie);this._renderContext.renderOccludedMask=K}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ie),this._renderContext.renderOccludedMask=K}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Te)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Te),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Pe)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...ce),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...ce)}_renderTransparentGeometry(){this._plugins.render(...be),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...fe)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ee),this._bindParameters.output=2,this._plugins.precompile(...Ee),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ee)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>j?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),B(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){x(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...be),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...be),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...be)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(de,o,"oit emissive");const _=u?me:de;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");u&&p.acquireColor(de,o,"oit front emissive"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...ce)||this.plugins.produces(5,...ce)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(S.OPAQUE,t,e)),this.fboCache.debugCallback?.(S.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(R.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(R.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(R.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.VOXEL,e)),this.fboCache.debugCallback?.(R.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(S.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(S.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){if(this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([_e,de]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=I);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(Oe,t.viewMatrix),f(Re,t.projectionMatrix),g(De,Oe,Re),g(De,s.viewMatrix,De),g(De,s.projectionMatrix,De),this._reprojectionMatrix=De):this._reprojectionMatrix=I,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Fe,s.viewMatrix,Oe),P(t,Fe)):P(t,I)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],pe.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],pe.prototype,"highResolutionAtmosphere",null),e([p()],pe.prototype,"_edgeView",void 0),e([p()],pe.prototype,"updating",null),pe=e([c("esri.views.3d.webgl-engine.lib.Renderer")],pe);const ce=[0,1,2,3],be=[7,6,4,5],fe=[7,6],ge=[0,1,2,4,...fe],Pe=[3,5],Ie=[2,4,8],Ee=[16,12,14,13],we=[4,5,2,3,0,1,...fe],Ae=[4,8,5,11],Ce={0:[13],1:[12],2:[13,12],3:[13,12]},Te=[0,1,...fe],Se=["normals","highlights"],Re=E(),Oe=E(),De=E(),Fe=E();function Ge(e){return t=>e.immediate.schedule(t)}export{pe as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as I,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as S}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as T,InternalRenderCategory as R,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{computeShadowsEnabled as N}from"../../support/sunUtils.js";import{FBOCache as H}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as q}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as U}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as V}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as z}from"./BoundingInfo.js";import{Compositor as Y}from"./Compositor.js";import{DepthRange as X}from"./DepthRange.js";import{depthRangeFromScene as $}from"./depthRangeUtils.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as re}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as le,PixelType as me,ColorAttachment2 as ue,ColorAttachment0 as _e,DrawBufferNone as pe}from"../../../webgl/enums.js";let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ae,this.sceneDepthRange=_(X.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new Q,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new H(i),this._compositor=new Y(i,s),this._renderStateFeatures=_(te(e.view.qualityProfile));const a=new re(this._fboCache,e.viewingMode);this._renderContext=new K(this._rctx,a,s),this._framebuffer=new J(this._fboCache,this._bindParameters),this._performanceInfo=new oe(this._rctx),this._blit=new j(s),this._shadowAccumulator=new ie(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new M(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new q({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,z.prune(),ne.prune(),S()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new k(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ne(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,I)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}modifyShadowsEnabled(){const e=this.stage.view.environmentManager.referencePositionGeographic,t=null==e||N(e[2],this.stage.viewingMode),s=this.stage.view.environment.lighting.directShadowsEnabled&&t;this._bindParameters.shadowMap.enabled!==s&&(this._bindParameters.shadowMap.enabled=s,this._requestRender(1))}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(T.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),r.setGLViewport(this._rctx);const m=this._framebuffer,u=m.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),_=this._needsLastFrameColor;_?(u?.retain(_-1),u?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=u):u?.release(),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),m.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(T.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=m.color.obtainAttachment(le)),m.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&m.update(e=>this._renderHUD(b,e)),m.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||m.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,m.update(e=>this._renderNodes(R.MAGNIFIER,e)),m.update(e=>this._renderNodes(T.FINAL,e)),i&&this._blit.toFramebuffer(m.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),m.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=m.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new he(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const t=this._bindParameters,s=t.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(s,R.OPAQUE_ENVIRONMENT,R.GAUSSIAN_SPLAT,R.OPAQUE_OCCLUSION_QUERY,R.VOXEL);if(2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2),this._bindParameters.output=3,this._plugins.precompile(...ge),this._bindParameters.output=0,this._plugins.precompile(...ge),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(s,R.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(s,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(s,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(s,T.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),s&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(14),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,me.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(de.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=t===this._bindParameters.shadowMap&&6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowCasterNodes();t.finish(e),this._bindParameters.output=s}_renderShadowCasterNodes(){if(!this._nodes.produces(R.SHADOW_CASTERS))return;const e=this._bindParameters.shadowMap.renderTarget;if(!e)return;const t=e.name;e.setName(R.SHADOW_CASTERS),this._pluginInput.set(R.SHADOW_CASTERS,e);try{this._nodes.render(e,this._pluginInput,this._releaseNodeInputs)}finally{e.setName(t),this._pluginInput.set(R.SHADOW_CASTERS,null)}}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(de.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(de.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return X.Zero;const t=$(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),this._bindParameters.shadowMap.enabled&&t.union(this._nodes.queryDepthRange(R.SHADOW_CASTERS,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=X.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<U)return void(this.sceneDepthRange.value=X.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=$(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ie)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&(this._shadowAccumulator.precompilePrepass(),this._precompileAllGeometry(5)),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe);const r=this._nodes.optional("normals",...O,R.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(de.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.hasGlobalIlluminationHighQuality?this.performanceInfo.advance(de.AMBIENT_ILLUMINATION_HIGH_QUALITY):this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor),this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ge),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ee),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Se[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Te)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Te),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ie)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...be),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...be)}_renderTransparentGeometry(){this._plugins.render(...fe),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...ge)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(le);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>B?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),V(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ae),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...fe)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(le,o,"oit emissive");const _=u?ue:le;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");u&&p.acquireColor(le,o,"oit front emissive"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-_e,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...be)||this.plugins.produces(5,...be)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(T.OPAQUE,t,e)),this.fboCache.debugCallback?.(T.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(R.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(R.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(R.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.VOXEL,e)),this.fboCache.debugCallback?.(R.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(T.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(T.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){if(this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(de.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([pe,le]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=I);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(De,t.viewMatrix),f(Oe,t.projectionMatrix),g(Fe,De,Oe),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=I,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Ge,s.viewMatrix,De),P(t,Ge)):P(t,I)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],ce.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const be=[0,1,2,3],fe=[7,6,4,5],ge=[7,6],Pe=[0,1,2,4,...ge],Ie=[3,5],Ee=[2,4,8],we=[16,12,14,13],Ae=[4,5,2,3,0,1,...ge],Ce=[4,8,5,11],Se={0:[13],1:[12],2:[13,12],3:[13,12]},Te=[0,1,...ge],Re=["normals","highlights"],Oe=E(),De=E(),Fe=E(),Ge=E();function Ne(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};