@arcgis/core 4.33.0-next.20250324 → 4.33.0-next.20250326

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 (237) hide show
  1. package/arcade/arcadeAsyncRuntime.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/arcade/arcadeRuntime.js +1 -1
  4. package/arcade/containerUtils.js +1 -1
  5. package/arcade/functions/date.js +1 -1
  6. package/arcade/functions/feature.js +1 -1
  7. package/arcade/functions/featuresetbase.js +1 -1
  8. package/arcade/functions/featuresetgeom.js +1 -1
  9. package/arcade/functions/featuresetstats.js +1 -1
  10. package/arcade/functions/featuresetstring.js +1 -1
  11. package/arcade/functions/fieldStats.js +1 -1
  12. package/arcade/functions/geomasync.js +1 -1
  13. package/arcade/functions/geometry.js +1 -1
  14. package/arcade/functions/geomsync.js +1 -1
  15. package/arcade/functions/knowledgegraph.js +1 -1
  16. package/arcade/functions/maths.js +1 -1
  17. package/arcade/functions/stats.js +1 -1
  18. package/arcade/functions/string.js +1 -1
  19. package/arcade/geometry/functions.js +1 -1
  20. package/arcade/languageUtils.js +1 -1
  21. package/assets/esri/core/workers/RemoteClient.js +1 -1
  22. package/assets/esri/core/workers/chunks/0059295780fa4a090f30.js +319 -0
  23. package/assets/esri/core/workers/chunks/{8f4bcca8b0525e19374f.js → 042771b4e56355924140.js} +1 -1
  24. package/assets/esri/core/workers/chunks/09c9e4e94f09ba9f4c22.js +1 -0
  25. package/assets/esri/core/workers/chunks/{3bea1400160042dca9f3.js → 0e82365be7d9257e7cb2.js} +1 -1
  26. package/assets/esri/core/workers/chunks/1dd6d68d23ba07587ae4.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fef46b841e8369b30227.js → 2873cb727c59328074db.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3808f10747cecc8a1a9b.js +1 -0
  29. package/assets/esri/core/workers/chunks/{9cfce9414b874878d761.js → 4dc1e7d7ac2a4b0144c4.js} +96 -96
  30. package/assets/esri/core/workers/chunks/{e5e1f8ac53c70427a60b.js → 59e4e780dcdfed555ca5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{33005043f7084048296d.js → 6ab96eaaad0aaad46db9.js} +1 -1
  32. package/assets/esri/core/workers/chunks/705c1ebb327f680f8519.js +1 -0
  33. package/assets/esri/core/workers/chunks/{bd2dcc55ac3418421ee5.js → 726e3f413824f02fe689.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{4c9160e3d596fe75392d.js → 75ec4d2ae9d427a1434f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{11f9d7cd95891596b716.js → 77199b4b39ee8b4303de.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{74c01de62ccaed0666e0.js → 81f2f1614ea27f4c2e65.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{d787474e78360c925fd9.js → a59ad50d932da1e28c8f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/afe94e351b4a50d7bc53.js +1 -0
  39. package/assets/esri/core/workers/chunks/{47c04980098dc0c228d7.js → b02ac03503bfff1ff922.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{cbbbaccc0d3683e1c0fe.js → b8a4352f83502449ff95.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{605eddec7aac891ed141.js → ba47e43ef039fe4b8c5c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{3ee000c92e4d5d21e22d.js → bc3f42401131a12fce9b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{2cedf4222238c86a98e8.js → c6bcfa99fb222894fa0e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/cb386923200272cf26a9.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a2377969f76640f1d6fe.js → d5d2a4e8e19898d86c6d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{5f8028928ae8e5d27dda.js → e088edb9ffbaa1ed12eb.js} +1 -1
  47. package/assets/esri/core/workers/chunks/ed831e51c2a03ee95879.js +1 -0
  48. package/assets/esri/core/workers/chunks/{3e9cd82325c473ddbf1f.js → edcc0fefd57323d2cb67.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{065ae931b5891847a06f.js → f28eaf1d3a7f12788bcf.js} +1 -1
  50. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +1 -0
  51. package/assets/esri/core/workers/chunks/{f86736a60856ef7fdacb.js → fa3eeb40e2d732c184d8.js} +1 -1
  52. package/chunks/BloomBlur.glsl.js +1 -1
  53. package/chunks/BloomComposition.glsl.js +2 -2
  54. package/chunks/ComponentShader.glsl.js +24 -25
  55. package/chunks/HighlightApply.glsl.js +1 -1
  56. package/chunks/HighlightDownsample.glsl.js +1 -1
  57. package/chunks/HighlightToSingle.glsl.js +1 -1
  58. package/chunks/LineSeries.js +1 -1
  59. package/chunks/ShadowHighlight.glsl.js +1 -1
  60. package/chunks/Theme.js +1 -1
  61. package/chunks/Tick.js +1 -1
  62. package/chunks/WaterSurface.glsl.js +1 -1
  63. package/chunks/aiServices.js +1 -1
  64. package/chunks/array.js +1 -1
  65. package/chunks/chartUtilsAm5.js +1 -1
  66. package/chunks/languageUtils.js +1 -1
  67. package/chunks/nl_NL.js +1 -1
  68. package/chunks/vec32.js +1 -1
  69. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  70. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  71. package/geometry/operators/projectOperator.js +1 -1
  72. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  73. package/geometry/support/buffer/BufferView.js +1 -1
  74. package/geometry/support/meshUtils/merge.js +1 -1
  75. package/interfaces.d.ts +17 -17
  76. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  77. package/package.json +1 -1
  78. package/rest/support/DirectionLine.js +1 -1
  79. package/rest/support/DirectionPoint.js +1 -1
  80. package/rest/support/PointBarrier.js +1 -1
  81. package/rest/support/PolygonBarrier.js +1 -1
  82. package/rest/support/PolylineBarrier.js +1 -1
  83. package/rest/support/RasterData.js +1 -1
  84. package/rest/support/RouteInfo.js +1 -1
  85. package/rest/support/Stop.js +1 -1
  86. package/support/revision.js +1 -1
  87. package/views/2d/LabelManager.js +1 -1
  88. package/views/2d/engine/vectorTiles/Placement.js +1 -1
  89. package/views/2d/engine/vectorTiles/SourceLayerData.js +1 -1
  90. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  91. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  92. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  93. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  94. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  95. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  96. package/views/2d/engine/vectorTiles/buckets/BaseBucket.js +1 -1
  97. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  98. package/views/2d/engine/vectorTiles/constants.js +5 -0
  99. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +5 -0
  100. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  101. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  102. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  103. package/views/2d/engine/vectorTiles/decluttering/core.js +1 -1
  104. package/views/2d/engine/vectorTiles/decluttering/jobsUtil.js +1 -1
  105. package/views/2d/engine/vectorTiles/decluttering/util.js +1 -1
  106. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  107. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  108. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  109. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  110. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  111. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  112. package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
  113. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  114. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  115. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  116. package/views/2d/engine/webgl/mesh/meshDebugUtils.js +1 -1
  117. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  118. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  119. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  120. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js +1 -1
  123. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  124. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  125. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  126. package/views/2d/layers/MediaLayerView2D.js +1 -1
  127. package/views/2d/layers/RouteLayerView2D.js +1 -1
  128. package/views/2d/layers/TileLayerView2D.js +1 -1
  129. package/views/2d/layers/features/FeatureContainer.js +1 -1
  130. package/views/2d/layers/features/RenderState.js +1 -1
  131. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  132. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  133. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  134. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  135. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  136. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  137. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  138. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  139. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  140. package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
  141. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  142. package/views/2d/layers/features/schema/processor/SubtypeProcessorSchema.js +1 -1
  143. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  144. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  145. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  146. package/views/2d/tiling/FeatureTileSubscriptionManager.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  148. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  149. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  150. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  151. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  152. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  153. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  154. package/views/3d/layers/I3SMeshView3D.js +1 -1
  155. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  156. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  157. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  158. package/views/3d/layers/graphics/Labeler.js +1 -1
  159. package/views/3d/layers/graphics/deconflictorDebug.js +1 -1
  160. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  161. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  162. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  163. package/views/3d/support/QualitySettings.js +1 -1
  164. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  165. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  166. package/views/3d/terrain/OverlayRenderer.js +1 -1
  167. package/views/3d/terrain/PatchRenderData.js +1 -1
  168. package/views/3d/terrain/SphericalPatch.js +1 -1
  169. package/views/3d/terrain/TerrainRenderer.js +1 -1
  170. package/views/3d/terrain/TileCompositor.js +1 -1
  171. package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +1 -1
  172. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoubleConfiguration.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +4 -4
  174. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  175. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +9 -9
  176. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +2 -2
  177. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  178. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  179. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +6 -6
  180. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +1 -1
  181. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +1 -1
  182. package/views/3d/webgl-engine/core/shaderModules/{UintTexture2DBindUniform.js → Texture2DUintBindUniform.js} +1 -1
  183. package/views/3d/webgl-engine/core/shaderModules/{UintTexture2DPassUniform.js → Texture2DUintPassUniform.js} +1 -1
  184. package/views/3d/webgl-engine/effects/bloom/BloomBlur.glsl.js +1 -1
  185. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +1 -1
  186. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  187. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  188. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  189. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  190. package/views/3d/webgl-engine/lib/Program.js +1 -1
  191. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  192. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  193. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  194. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  195. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  196. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  197. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  198. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  199. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  200. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  201. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  202. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  203. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  204. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  205. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  206. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
  207. package/views/3d/webgl-engine/shaders/HighlightToSingle.glsl.js +1 -1
  208. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  209. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  210. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  211. package/views/VideoView.js +1 -1
  212. package/views/interactive/SegmentLabels.js +1 -1
  213. package/views/interactive/coordinateHelper.js +1 -1
  214. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  215. package/views/interactive/sketch/constraints.js +1 -1
  216. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  217. package/views/support/geometry3dUtils.js +1 -1
  218. package/views/webgl/ShaderBuilder.js +1 -1
  219. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  220. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  221. package/assets/esri/core/workers/chunks/0e164b19e4ea3aa73843.js +0 -1
  222. package/assets/esri/core/workers/chunks/1034155c525d2b7baaa1.js +0 -1
  223. package/assets/esri/core/workers/chunks/2b9ce6648823f6962f58.js +0 -1
  224. package/assets/esri/core/workers/chunks/88a7780b1c689afff8bd.js +0 -1
  225. package/assets/esri/core/workers/chunks/ac6b582ca180210e596c.js +0 -1
  226. package/assets/esri/core/workers/chunks/accd0661a6dd297fab6b.js +0 -1
  227. package/assets/esri/core/workers/chunks/b5f44cf03c4e5cc07bc4.js +0 -1
  228. package/assets/esri/core/workers/chunks/bfbb118ae3b4a4ce1c74.js +0 -319
  229. package/assets/esri/core/workers/chunks/fa7ddf3c89cdb8052b26.js +0 -1
  230. package/chunks/BloomDepthAdjust.glsl.js +0 -14
  231. package/views/2d/engine/vectorTiles/decluttering/jobs.js +0 -5
  232. package/views/2d/engine/webgl/collisions/CollisionEngine.js +0 -5
  233. package/views/2d/engine/webgl/collisions/CollisionGrid.js +0 -5
  234. package/views/3d/webgl-engine/core/shaderModules/TextureCubeBindUniform.js +0 -5
  235. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DDrawUniform.js +0 -5
  236. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjust.glsl.js +0 -5
  237. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjustTechnique.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{NoConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import t from"../lib/GLMaterial.js";import{RenderOccludedFlag as i}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{PositionUvLayout as a}from"./DefaultLayouts.js";import{TriangleMaterial as n}from"./TriangleMaterial.js";import{SlicePlaneMaterialTechnique as u,SlicePlaneMaterialPassParameters as c}from"../shaders/SlicePlaneMaterialTechnique.js";class l extends n{constructor(e){super(e,p),this.produces=new Map([[o.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>r(e)]])}get visible(){return!0}createGLMaterial(r){return new m(r)}createBufferWriter(){return new s(a)}getConfiguration(){return e}}class m extends t{constructor(r){super(r)}beginSlot(r){return this.getTechnique(u,r)}}class p extends c{constructor(){super(...arguments),this.renderOccluded=i.Occlude,this.isDecoration=!1}}export{p as Parameters,l as SlicePlaneMaterial};
5
+ import{isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{InstancedDoubleConfiguration as e}from"../core/shaderLibrary/attributes/InstancedDoubleConfiguration.js";import t from"../lib/GLMaterial.js";import{RenderOccludedFlag as i}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{PositionUvLayout as a}from"./DefaultLayouts.js";import{TriangleMaterial as n}from"./TriangleMaterial.js";import{SlicePlaneMaterialTechnique as u,SlicePlaneMaterialPassParameters as c}from"../shaders/SlicePlaneMaterialTechnique.js";class l extends n{constructor(t){super(t,m),this.produces=new Map([[o.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>r(e)]]),this._configuration=new e}get visible(){return!0}createGLMaterial(r){return new f(r)}createBufferWriter(){return new s(a)}getConfiguration(){return this._configuration}}class f extends t{constructor(r){super(r)}beginSlot(r){return this.getTechnique(u,r)}}class m extends c{constructor(){super(...arguments),this.renderOccluded=i.Occlude,this.isDecoration=!1}}export{m as Parameters,l as SlicePlaneMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{hasIdentityRotation as e,isOrthoNormal as t}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec2f as r,BufferViewVec4f16 as o,BufferViewVec4f as i,BufferViewFloat as s,BufferViewVec2i16 as n,BufferViewVec2f16 as c,BufferViewVec3f as l}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as d}from"../../lib/Util.js";import{VertexAttribute as u}from"../../lib/VertexAttribute.js";function a(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function p(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function g(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function y(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function B(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function b(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function O(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function h(t,f,r,o,i=1){if(!f)return void g(t,r,o,i);const{data:s,indices:n}=t,c=r.typedBuffer,l=r.typedBufferStride,d=n.length,u=f[0],a=f[1],p=f[2],y=f[4],B=f[5],b=f[6],O=f[8],h=f[9],m=f[10],N=f[12],S=f[13],F=f[14];o*=l;let I=0,R=0,z=0;const E=e(f)?e=>{I=s[e]+N,R=s[e+1]+S,z=s[e+2]+F}:e=>{const t=s[e],f=s[e+1],r=s[e+2];I=u*t+y*f+O*r+N,R=a*t+B*f+h*r+S,z=p*t+b*f+m*r+F};if(1===i)for(let e=0;e<d;++e)E(3*n[e]),c[o]=I,c[o+1]=R,c[o+2]=z,o+=l;else for(let e=0;e<d;++e){E(3*n[e]);for(let e=0;e<i;++e)c[o]=I,c[o+1]=R,c[o+2]=z,o+=l}}function m(f,r,o,i,s=1){if(!r)return void g(f,o,i,s);const{data:n,indices:c}=f,l=r,d=o.typedBuffer,u=o.typedBufferStride,a=c.length,p=l[0],y=l[1],B=l[2],b=l[4],O=l[5],h=l[6],m=l[8],N=l[9],S=l[10],F=!t(l),I=1e-6,R=1-I;i*=u;let z=0,E=0,v=0;const w=e(l)?e=>{z=n[e],E=n[e+1],v=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];z=p*t+b*f+m*r,E=y*t+O*f+N*r,v=B*t+h*f+S*r};if(1===s)if(F)for(let e=0;e<a;++e){w(3*c[e]);const t=z*z+E*E+v*v;if(t<R&&t>I){const e=1/Math.sqrt(t);d[i]=z*e,d[i+1]=E*e,d[i+2]=v*e}else d[i]=z,d[i+1]=E,d[i+2]=v;i+=u}else for(let e=0;e<a;++e)w(3*c[e]),d[i]=z,d[i+1]=E,d[i+2]=v,i+=u;else for(let e=0;e<a;++e){if(w(3*c[e]),F){const e=z*z+E*E+v*v;if(e<R&&e>I){const t=1/Math.sqrt(e);z*=t,E*=t,v*=t}}for(let e=0;e<s;++e)d[i]=z,d[i+1]=E,d[i+2]=v,i+=u}}function N(e,f,r,o,i=1){if(!f)return void y(e,r,o,i);const{data:s,indices:n}=e,c=f,l=r.typedBuffer,d=r.typedBufferStride,u=n.length,a=c[0],p=c[1],g=c[2],B=c[4],b=c[5],O=c[6],h=c[8],m=c[9],N=c[10],S=!t(c),F=1e-6,I=1-F;if(o*=d,1===i)for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],i=s[e+2],c=s[e+3];let u=a*f+B*r+h*i,y=p*f+b*r+m*i,R=g*f+O*r+N*i;if(S){const e=u*u+y*y+R*R;if(e<I&&e>F){const t=1/Math.sqrt(e);u*=t,y*=t,R*=t}}l[o]=u,l[o+1]=y,l[o+2]=R,l[o+3]=c,o+=d}else for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],c=s[e+2],u=s[e+3];let y=a*f+B*r+h*c,R=p*f+b*r+m*c,z=g*f+O*r+N*c;if(S){const e=y*y+R*R+z*z;if(e<I&&e>F){const t=1/Math.sqrt(e);y*=t,R*=t,z*=t}}for(let t=0;t<i;++t)l[o]=y,l[o+1]=R,l[o+2]=z,l[o+3]=u,o+=d}}function S(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function F(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function I(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function R(e,t,r,o,i,s,n){let c={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),d=r?.indices;if(r&&d)l===u.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),z(l,r,o,i,s,n);else if(l===u.OLIDCOLOR&&null!=t){const r=e.get(u.POSITION)?.indices;if(r){const e=r.length;I(t,s.getField(l,f),e,n)}}}return c}function z(e,t,a,g,B,b){switch(e){case u.POSITION:{d(3===t.size);const f=B.getField(e,l);d(!!f,`No buffer view for ${e}`),f&&h(t,a,f,b);break}case u.NORMAL:{d(3===t.size);const f=B.getField(e,l);d(!!f,`No buffer view for ${e}`),f&&m(t,g,f,b);break}case u.NORMALCOMPRESSED:case u.PROFILERIGHT:case u.PROFILEUP:{d(2===t.size);const f=B.getField(e,n);d(!!f,`No buffer view for ${e}`),f&&p(t,f,b);break}case u.UV0:{d(2===t.size);const f=B.getField(e,c);d(!!f,`No buffer view for ${e}`),f&&p(t,f,b);break}case u.UVI:{d(2===t.size);const f=B.getField(e,n);d(!!f,`No buffer view for ${e}`),f&&p(t,f,b);break}case u.COLOR:case u.SYMBOLCOLOR:{const r=B.getField(e,f);d(!!r,`No buffer view for ${e}`),d(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||S(t,t.size,r,b);break}case u.COLORFEATUREATTRIBUTE:{const f=B.getField(e,s);d(!!f,`No buffer view for ${e}`),d(1===t.size),f&&1===t.size&&F(t,f,b);break}case u.TANGENT:{d(4===t.size);const f=B.getField(e,i);d(!!f,`No buffer view for ${e}`),f&&N(t,a,f,b);break}case u.PROFILEVERTEXANDNORMAL:{d(4===t.size);const f=B.getField(e,i);d(!!f,`No buffer view for ${e}`),f&&y(t,f,b)}break;case u.FEATUREVALUE:{d(4===t.size);const f=B.getField(e,o);d(!!f,`No buffer view for ${e}`),f&&y(t,f,b)}break;case u.PROFILEAUXDATA:{d(2===t.size);const f=B.getField(e,r);d(!!f,`No buffer view for ${e}`),f&&p(t,f,b)}}}export{a as writeBufferFloat,b as writeBufferMat3f,O as writeBufferMat4f,p as writeBufferVec2,g as writeBufferVec3,y as writeBufferVec4,B as writeBufferVec4Zeros,S as writeColor,F as writeColorFeatureAttribute,z as writeDefaultAttribute,R as writeDefaultAttributes,m as writeNormal,I as writeOlidColor,h as writePosition,N as writeTangent};
5
+ import{hasIdentityRotation as e,isOrthoNormal as t}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec4f16 as r,BufferViewVec4f as o,BufferViewFloat as i,BufferViewVec2i16 as s,BufferViewVec2f16 as n,BufferViewVec3f as c}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as l}from"../../lib/Util.js";import{VertexAttribute as d}from"../../lib/VertexAttribute.js";function u(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function a(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function p(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function y(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function B(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function g(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function O(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function b(t,f,r,o,i=1){if(!f)return void p(t,r,o,i);const{data:s,indices:n}=t,c=r.typedBuffer,l=r.typedBufferStride,d=n.length,u=f[0],a=f[1],y=f[2],B=f[4],g=f[5],O=f[6],b=f[8],h=f[9],m=f[10],S=f[12],I=f[13],N=f[14];o*=l;let R=0,F=0,E=0;const z=e(f)?e=>{R=s[e]+S,F=s[e+1]+I,E=s[e+2]+N}:e=>{const t=s[e],f=s[e+1],r=s[e+2];R=u*t+B*f+b*r+S,F=a*t+g*f+h*r+I,E=y*t+O*f+m*r+N};if(1===i)for(let e=0;e<d;++e)z(3*n[e]),c[o]=R,c[o+1]=F,c[o+2]=E,o+=l;else for(let e=0;e<d;++e){z(3*n[e]);for(let e=0;e<i;++e)c[o]=R,c[o+1]=F,c[o+2]=E,o+=l}}function h(f,r,o,i,s=1){if(!r)return void p(f,o,i,s);const{data:n,indices:c}=f,l=r,d=o.typedBuffer,u=o.typedBufferStride,a=c.length,y=l[0],B=l[1],g=l[2],O=l[4],b=l[5],h=l[6],m=l[8],S=l[9],I=l[10],N=!t(l),R=1e-6,F=1-R;i*=u;let E=0,z=0,A=0;const L=e(l)?e=>{E=n[e],z=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];E=y*t+O*f+m*r,z=B*t+b*f+S*r,A=g*t+h*f+I*r};if(1===s)if(N)for(let e=0;e<a;++e){L(3*c[e]);const t=E*E+z*z+A*A;if(t<F&&t>R){const e=1/Math.sqrt(t);d[i]=E*e,d[i+1]=z*e,d[i+2]=A*e}else d[i]=E,d[i+1]=z,d[i+2]=A;i+=u}else for(let e=0;e<a;++e)L(3*c[e]),d[i]=E,d[i+1]=z,d[i+2]=A,i+=u;else for(let e=0;e<a;++e){if(L(3*c[e]),N){const e=E*E+z*z+A*A;if(e<F&&e>R){const t=1/Math.sqrt(e);E*=t,z*=t,A*=t}}for(let e=0;e<s;++e)d[i]=E,d[i+1]=z,d[i+2]=A,i+=u}}function m(e,f,r,o,i=1){if(!f)return void y(e,r,o,i);const{data:s,indices:n}=e,c=f,l=r.typedBuffer,d=r.typedBufferStride,u=n.length,a=c[0],p=c[1],B=c[2],g=c[4],O=c[5],b=c[6],h=c[8],m=c[9],S=c[10],I=!t(c),N=1e-6,R=1-N;if(o*=d,1===i)for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],i=s[e+2],c=s[e+3];let u=a*f+g*r+h*i,y=p*f+O*r+m*i,F=B*f+b*r+S*i;if(I){const e=u*u+y*y+F*F;if(e<R&&e>N){const t=1/Math.sqrt(e);u*=t,y*=t,F*=t}}l[o]=u,l[o+1]=y,l[o+2]=F,l[o+3]=c,o+=d}else for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],c=s[e+2],u=s[e+3];let y=a*f+g*r+h*c,F=p*f+O*r+m*c,E=B*f+b*r+S*c;if(I){const e=y*y+F*F+E*E;if(e<R&&e>N){const t=1/Math.sqrt(e);y*=t,F*=t,E*=t}}for(let t=0;t<i;++t)l[o]=y,l[o+1]=F,l[o+2]=E,l[o+3]=u,o+=d}}function S(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function I(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function N(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function R(e,t,r,o,i,s,n){let c={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),u=r?.indices;if(r&&u)l===d.POSITION&&(c={numItems:1,numVerticesPerItem:u.length}),F(l,r,o,i,s,n);else if(l===d.OLIDCOLOR&&null!=t){const r=e.get(d.POSITION)?.indices;if(r){const e=r.length;N(t,s.getField(l,f),e,n)}}}return c}function F(e,t,u,p,B,g){switch(e){case d.POSITION:{l(3===t.size);const f=B.getField(e,c);l(!!f,`No buffer view for ${e}`),f&&b(t,u,f,g);break}case d.NORMAL:{l(3===t.size);const f=B.getField(e,c);l(!!f,`No buffer view for ${e}`),f&&h(t,p,f,g);break}case d.NORMALCOMPRESSED:case d.PROFILERIGHT:case d.PROFILEUP:{l(2===t.size);const f=B.getField(e,s);l(!!f,`No buffer view for ${e}`),f&&a(t,f,g);break}case d.UV0:case d.PROFILEAUXDATA:{l(2===t.size);const f=B.getField(e,n);l(!!f,`No buffer view for ${e}`),f&&a(t,f,g);break}case d.UVI:{l(2===t.size);const f=B.getField(e,s);l(!!f,`No buffer view for ${e}`),f&&a(t,f,g);break}case d.COLOR:case d.SYMBOLCOLOR:{const r=B.getField(e,f);l(!!r,`No buffer view for ${e}`),l(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||S(t,t.size,r,g);break}case d.COLORFEATUREATTRIBUTE:{const f=B.getField(e,i);l(!!f,`No buffer view for ${e}`),l(1===t.size),f&&1===t.size&&I(t,f,g);break}case d.TANGENT:{l(4===t.size);const f=B.getField(e,o);l(!!f,`No buffer view for ${e}`),f&&m(t,u,f,g);break}case d.PROFILEVERTEXANDNORMAL:case d.FEATUREVALUE:{l(4===t.size);const f=B.getField(e,r);l(!!f,`No buffer view for ${e}`),f&&y(t,f,g)}}}export{u as writeBufferFloat,g as writeBufferMat3f,O as writeBufferMat4f,a as writeBufferVec2,p as writeBufferVec3,y as writeBufferVec4,B as writeBufferVec4Zeros,S as writeColor,I as writeColorFeatureAttribute,F as writeDefaultAttribute,R as writeDefaultAttributes,h as writeNormal,N as writeOlidColor,b as writePosition,m as writeTangent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as h,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../core/scheduling.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{isMoon as u,isMars as f}from"../../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as _}from"../../../ViewingMode.js";import{ChapmanAtmosphere as g}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as x}from"../../environment/CloudsComposition.js";import{Fog as w}from"../../environment/Fog.js";import{LocalAtmosphere as v}from"../../environment/LocalAtmosphere.js";import j from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as y}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as R}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ObjectAndLayerIDRenderNode as A}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as S}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as C}from"../effects/geometry/RenderOccludedRenderNode.js";import{Haze as T}from"../effects/haze/Haze.js";import{Highlight as O}from"../effects/highlight/Highlight.js";import{ShadowHighlight as U}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as q}from"../effects/magnifier/Magnifier.js";import{SMAA as D}from"../effects/smaa/SMAA.js";import{SSAO as L}from"../effects/ssao/SSAO.js";import{Stars as M}from"../effects/stars/Stars.js";import{RenderRequestType as k}from"../lib/basicInterfaces.js";import E from"../lib/CompositingHelper.js";import{GLMaterialRepository as F}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as W}from"../lib/Renderer.js";import{RenderingContext as B}from"../lib/RenderingContext.js";import{TextureRepository as G}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as z}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as N}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as I}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as P}from"./contextCache.js";import{removeLoadedShaderModules as K}from"./renderUtils.js";import{ScreenshotManager as V,ScreenshotContext as X}from"./ScreenshotManager.js";import{contextCache as Q}from"./testUtils.js";import{RenderState as J}from"../../../support/RenderState.js";let Y=class extends t{constructor(e){super(e),this.events=new r,this.waterTextures=new I,this.olidRenderHelper=S()?new H:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.test=null;const t=e.stage;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:s}=t.view.resourceController;this.stippleTextures=N(this._rctx,s),this.markerTextures=z(this._rctx,s),this._techniques=new b(new R(this._rctx,t.viewingMode,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new G(t),this.addHandles(this._textures.events.on("changed",(e=>this.requestRender(e)))),this._materials=new F(this._textures,this._techniques,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new E(this._rctx,this._techniques),this.renderer=new W(t,this._materials,this._techniques,this._rctx,this._compositingHelper,(e=>this.requestRender(e))),this.addHandles([a((()=>t.view.ready),(e=>{e&&this._createRenderNodes()}),h),a((()=>this.waterTextures?.updating),(()=>this.requestRender()),h),a((()=>t.view.qualityProfile),(e=>this.renderer?.updateRenderFeatures(e)),p)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new V(this._rctx,i,(e=>this.events.emit("force-camera-for-screenshot",e))),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this._techniques=o(this._techniques),this._componentObjects=o(this._componentObjects),this._screenshotManager=o(this._screenshotManager),o(this.renderer),this._textures=o(this._textures),o(this.waterTextures),o(this.markerTextures),o(this.stippleTextures),this._canvas=null,this._rctx=o(this._rctx)}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new M({view:e}),u(e.spatialReference)||(t===_.Local?new v({view:e}):f(e.spatialReference)?new j({view:e}):(new g({view:e}),new x({view:e}),new T({view:e}),new w({view:e}))),new L({view:e,isEnabled:()=>this.renderer.hasSSAO}),new D({view:e,isEnabled:()=>this.renderer.hasSMAA}),new q({view:e}),new O({view:e}),new U({view:e,viewingMode:t}),new C({view:e}),S()&&new A({view:e})}requestRender(e=k.UPDATE){this._needsRender=!0,e===k.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then((e=>e[0]))}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const p=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let d=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=p(4*s,h,i.nearFar);d>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(d=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&d>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(d=s)}return d===Number.MAX_VALUE?void 0:d}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){K(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=k.BACKGROUND,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?k.UPDATE:k.BACKGROUND,e.commitSyncLayers(),i=this.test?.time??i;(c(i-this._lastAnimationUpdate)>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(k.BACKGROUND),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(k.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this._textures.update();const r=new X(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(t.mode===J.IDLE?s:k.UPDATE),i=!1)}};this._frameTask=d(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");this._rctx=Z(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return null==this._componentObjects&&(this._componentObjects=new y(this.renderer.renderPassManager,this._viewingMode)),this._componentObjects}set componentObjectCollection(e){this._componentObjects=e}updateQualitySettings(e){this.test&&null!=this.test.time&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=c(0)),this._rctx.updateOptions({maxPreferredTextureSize:this.stage.view.qualitySettings.maxTextureSize})}};function Z(e,t){const r=(e,r)=>t.view.resourceController.memoryController.newCache(e,r),s={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8,maxPreferredTextureSize:t.view.qualitySettings.maxTextureSize,newCache:r};if(Q.enabled){let t=$.get(e);return t?(t.configure(s),t.ref(),t):(t=new B(e,s),$.set(e,t),t.ref(),t)}return new B(e,s)}e([l({type:Boolean,readOnly:!0})],Y.prototype,"updating",null),e([l({constructOnly:!0})],Y.prototype,"stage",void 0),e([l()],Y.prototype,"_rctx",void 0),e([l()],Y.prototype,"_canvas",void 0),e([l()],Y.prototype,"stippleTextures",void 0),e([l()],Y.prototype,"markerTextures",void 0),e([l()],Y.prototype,"waterTextures",void 0),e([l({readOnly:!0})],Y.prototype,"olidRenderHelper",void 0),e([l()],Y.prototype,"_textures",void 0),e([l({readOnly:!0})],Y.prototype,"renderer",void 0),e([l()],Y.prototype,"_screenshotManager",void 0),e([l()],Y.prototype,"componentObjectCollection",null),e([l()],Y.prototype,"_componentObjects",void 0),e([l()],Y.prototype,"_needsUpdate",void 0),e([l()],Y.prototype,"_needsWaterReflectionUpdate",void 0),Y=e([m("esri.views.3d.webgl-engine.parts.RenderView")],Y);const $=P();export{Y as RenderView};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as h,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../core/scheduling.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{isMoon as u,isMars as f}from"../../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as _}from"../../../ViewingMode.js";import{ChapmanAtmosphere as g}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as w}from"../../environment/CloudsComposition.js";import{Fog as x}from"../../environment/Fog.js";import{LocalAtmosphere as v}from"../../environment/LocalAtmosphere.js";import j from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as y}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as R}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{BloomRenderNode as A}from"../effects/bloom/BloomRenderNode.js";import{ObjectAndLayerIDRenderNode as S}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as T}from"../effects/geometry/RenderOccludedRenderNode.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as U}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as D}from"../effects/magnifier/Magnifier.js";import{SMAA as L}from"../effects/smaa/SMAA.js";import{SSAO as M}from"../effects/ssao/SSAO.js";import{Stars as k}from"../effects/stars/Stars.js";import{RenderRequestType as E}from"../lib/basicInterfaces.js";import B from"../lib/CompositingHelper.js";import{GLMaterialRepository as F}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as W}from"../lib/Renderer.js";import{RenderingContext as G}from"../lib/RenderingContext.js";import{TextureRepository as N}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as z}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as I}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as P}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as K}from"./contextCache.js";import{removeLoadedShaderModules as V}from"./renderUtils.js";import{ScreenshotManager as X,ScreenshotContext as Q}from"./ScreenshotManager.js";import{contextCache as J}from"./testUtils.js";import{RenderState as Y}from"../../../support/RenderState.js";let Z=class extends t{constructor(e){super(e),this.events=new r,this.waterTextures=new P,this.olidRenderHelper=C()?new H:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.test=null;const t=e.stage;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:s}=t.view.resourceController;this.stippleTextures=I(this._rctx,s),this.markerTextures=z(this._rctx,s),this._techniques=new b(new R(this._rctx,t.viewingMode,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new N(t),this.addHandles(this._textures.events.on("changed",(e=>this.requestRender(e)))),this._materials=new F(this._textures,this._techniques,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new B(this._rctx,this._techniques),this.renderer=new W(t,this._materials,this._techniques,this._rctx,this._compositingHelper,(e=>this.requestRender(e))),this.addHandles([a((()=>t.view.ready),(e=>{e&&this._createRenderNodes()}),h),a((()=>this.waterTextures?.updating),(()=>this.requestRender()),h),a((()=>t.view.qualityProfile),(e=>this.renderer?.updateRenderFeatures(e)),p)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new X(this._rctx,i,(e=>this.events.emit("force-camera-for-screenshot",e))),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this._techniques=o(this._techniques),this._componentObjects=o(this._componentObjects),this._screenshotManager=o(this._screenshotManager),o(this.renderer),this._textures=o(this._textures),o(this.waterTextures),o(this.markerTextures),o(this.stippleTextures),this._canvas=null,this._rctx=o(this._rctx)}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new k({view:e}),u(e.spatialReference)||(t===_.Local?(new v({view:e}),new A({view:e})):f(e.spatialReference)?(new j({view:e}),new A({view:e})):(new g({view:e}),new w({view:e}),new A({view:e}),new O({view:e}),new x({view:e}))),new M({view:e,isEnabled:()=>this.renderer.hasSSAO}),new L({view:e,isEnabled:()=>this.renderer.hasSMAA}),new D({view:e}),new U({view:e}),new q({view:e,viewingMode:t}),new T({view:e}),C()&&new S({view:e})}requestRender(e=E.UPDATE){this._needsRender=!0,e===E.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then((e=>e[0]))}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const p=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let d=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=p(4*s,h,i.nearFar);d>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(d=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&d>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(d=s)}return d===Number.MAX_VALUE?void 0:d}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){V(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=E.BACKGROUND,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?E.UPDATE:E.BACKGROUND,e.commitSyncLayers(),i=this.test?.time??i;(c(i-this._lastAnimationUpdate)>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(E.BACKGROUND),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(E.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this._textures.update();const r=new Q(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(t.mode===Y.IDLE?s:E.UPDATE),i=!1)}};this._frameTask=d(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");this._rctx=$(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return null==this._componentObjects&&(this._componentObjects=new y(this.renderer.renderPassManager,this._viewingMode)),this._componentObjects}set componentObjectCollection(e){this._componentObjects=e}updateQualitySettings(e){this.test&&null!=this.test.time&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=c(0)),this._rctx.updateOptions({maxPreferredTextureSize:this.stage.view.qualitySettings.maxTextureSize})}};function $(e,t){const r=(e,r)=>t.view.resourceController.memoryController.newCache(e,r),s={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8,maxPreferredTextureSize:t.view.qualitySettings.maxTextureSize,newCache:r};if(J.enabled){let t=ee.get(e);return t?(t.configure(s),t.ref(),t):(t=new G(e,s),ee.set(e,t),t.ref(),t)}return new G(e,s)}e([l({type:Boolean,readOnly:!0})],Z.prototype,"updating",null),e([l({constructOnly:!0})],Z.prototype,"stage",void 0),e([l()],Z.prototype,"_rctx",void 0),e([l()],Z.prototype,"_canvas",void 0),e([l()],Z.prototype,"stippleTextures",void 0),e([l()],Z.prototype,"markerTextures",void 0),e([l()],Z.prototype,"waterTextures",void 0),e([l({readOnly:!0})],Z.prototype,"olidRenderHelper",void 0),e([l()],Z.prototype,"_textures",void 0),e([l({readOnly:!0})],Z.prototype,"renderer",void 0),e([l()],Z.prototype,"_screenshotManager",void 0),e([l()],Z.prototype,"componentObjectCollection",null),e([l()],Z.prototype,"_componentObjects",void 0),e([l()],Z.prototype,"_needsUpdate",void 0),e([l()],Z.prototype,"_needsWaterReflectionUpdate",void 0),Z=e([m("esri.views.3d.webgl-engine.parts.RenderView")],Z);const ee=K();export{Z as RenderView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as o}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as h,CullFaceOptions as p,DepthTestFunction as n}from"../lib/basicInterfaces.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class u extends l{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=h.Opaque,this.doubleSidedMode=s.None,this.pbrMode=i.Disabled,this.cullFace=p.None,this.normalType=t.Attribute,this.customDepthTest=n.Less,this.emissionSource=r.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===r.Texture||this.hasOcclusionTexture||this.hasNormalTexture?o.Default:o.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}e([a({count:h.COUNT})],u.prototype,"alphaDiscardMode",void 0),e([a({count:s.COUNT})],u.prototype,"doubleSidedMode",void 0),e([a({count:i.COUNT})],u.prototype,"pbrMode",void 0),e([a({count:p.COUNT})],u.prototype,"cullFace",void 0),e([a({count:t.COUNT})],u.prototype,"normalType",void 0),e([a({count:n.COUNT})],u.prototype,"customDepthTest",void 0),e([a({count:r.COUNT})],u.prototype,"emissionSource",void 0),e([a()],u.prototype,"hasVertexColors",void 0),e([a()],u.prototype,"hasSymbolColors",void 0),e([a()],u.prototype,"hasVerticalOffset",void 0),e([a()],u.prototype,"hasColorTexture",void 0),e([a()],u.prototype,"hasMetallicRoughnessTexture",void 0),e([a()],u.prototype,"hasOcclusionTexture",void 0),e([a()],u.prototype,"hasNormalTexture",void 0),e([a()],u.prototype,"hasScreenSizePerspective",void 0),e([a()],u.prototype,"hasVertexTangents",void 0),e([a()],u.prototype,"hasOccludees",void 0),e([a()],u.prototype,"hasModelTransformation",void 0),e([a()],u.prototype,"offsetBackfaces",void 0),e([a()],u.prototype,"vvSize",void 0),e([a()],u.prototype,"vvColor",void 0),e([a()],u.prototype,"receiveShadows",void 0),e([a()],u.prototype,"receiveAmbientOcclusion",void 0),e([a()],u.prototype,"textureAlphaPremultiplied",void 0),e([a()],u.prototype,"instanced",void 0),e([a()],u.prototype,"instancedColor",void 0),e([a()],u.prototype,"writeDepth",void 0),e([a()],u.prototype,"transparent",void 0),e([a()],u.prototype,"enableOffset",void 0),e([a()],u.prototype,"terrainDepthTest",void 0),e([a()],u.prototype,"cullAboveTerrain",void 0),e([a()],u.prototype,"snowCover",void 0),e([a()],u.prototype,"hasColorTextureTransform",void 0),e([a()],u.prototype,"hasEmissionTextureTransform",void 0),e([a()],u.prototype,"hasNormalTextureTransform",void 0),e([a()],u.prototype,"hasOcclusionTextureTransform",void 0),e([a()],u.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{u as DefaultMaterialTechniqueConfiguration};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as o}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as s}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as h,CullFaceOptions as n,DepthTestFunction as p}from"../lib/basicInterfaces.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=h.Opaque,this.doubleSidedMode=r.None,this.pbrMode=i.Disabled,this.cullFace=n.None,this.normalType=t.Attribute,this.customDepthTest=p.Less,this.emissionSource=s.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===s.Texture||this.hasOcclusionTexture||this.hasNormalTexture?o.Default:o.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}e([a({count:h.COUNT})],c.prototype,"alphaDiscardMode",void 0),e([a({count:r.COUNT})],c.prototype,"doubleSidedMode",void 0),e([a({count:i.COUNT})],c.prototype,"pbrMode",void 0),e([a({count:n.COUNT})],c.prototype,"cullFace",void 0),e([a({count:t.COUNT})],c.prototype,"normalType",void 0),e([a({count:p.COUNT})],c.prototype,"customDepthTest",void 0),e([a({count:s.COUNT})],c.prototype,"emissionSource",void 0),e([a()],c.prototype,"hasVertexColors",void 0),e([a()],c.prototype,"hasSymbolColors",void 0),e([a()],c.prototype,"hasVerticalOffset",void 0),e([a()],c.prototype,"hasColorTexture",void 0),e([a()],c.prototype,"hasMetallicRoughnessTexture",void 0),e([a()],c.prototype,"hasOcclusionTexture",void 0),e([a()],c.prototype,"hasNormalTexture",void 0),e([a()],c.prototype,"hasScreenSizePerspective",void 0),e([a()],c.prototype,"hasVertexTangents",void 0),e([a()],c.prototype,"hasOccludees",void 0),e([a()],c.prototype,"instancedDoublePrecision",void 0),e([a()],c.prototype,"hasModelTransformation",void 0),e([a()],c.prototype,"offsetBackfaces",void 0),e([a()],c.prototype,"vvSize",void 0),e([a()],c.prototype,"vvColor",void 0),e([a()],c.prototype,"receiveShadows",void 0),e([a()],c.prototype,"receiveAmbientOcclusion",void 0),e([a()],c.prototype,"textureAlphaPremultiplied",void 0),e([a()],c.prototype,"instanced",void 0),e([a()],c.prototype,"instancedColor",void 0),e([a()],c.prototype,"writeDepth",void 0),e([a()],c.prototype,"transparent",void 0),e([a()],c.prototype,"enableOffset",void 0),e([a()],c.prototype,"terrainDepthTest",void 0),e([a()],c.prototype,"cullAboveTerrain",void 0),e([a()],c.prototype,"snowCover",void 0),e([a()],c.prototype,"hasColorTextureTransform",void 0),e([a()],c.prototype,"hasEmissionTextureTransform",void 0),e([a()],c.prototype,"hasNormalTextureTransform",void 0),e([a()],c.prototype,"hasOcclusionTextureTransform",void 0),e([a()],c.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{c as DefaultMaterialTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderLibrary/HighlightReadBitmap.glsl.js";import"../core/shaderModules/Float2DrawUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../core/shaderModules/UintTexture2DPassUniform.js";import"../../../../chunks/HighlightDownsample.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HighlightApply.glsl.js";
5
+ import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderLibrary/HighlightReadBitmap.glsl.js";import"../core/shaderModules/Float2DrawUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"../../../../chunks/HighlightDownsample.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HighlightApply.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/UintTexture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{H as HighlightDownsampleDrawParameters,b as blurSize,c as build,g as gridCellPixelSize,o as outlineSize}from"../../../../chunks/HighlightDownsample.glsl.js";
5
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{H as HighlightDownsampleDrawParameters,b as blurSize,c as build,g as gridCellPixelSize,o as outlineSize}from"../../../../chunks/HighlightDownsample.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderLibrary/HighlightReadBitmap.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/UintTexture2DPassUniform.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HighlightToSingle.glsl.js";
5
+ import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderLibrary/HighlightReadBitmap.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HighlightToSingle.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as o,getDrawBuffers as u,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as d,depthCompareAlways as T,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as O,stencilToolMaskOccluderParams as m,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as b,SpecialDrawBuffers as I}from"../../../webgl/enums.js";import{makePipelineState as N,defaultColorWrite as g,premultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";class A extends r{constructor(e,t){super(e,t,new i(R,(()=>import("./RibbonLine.glsl.js"))),L),this.primitiveType=t.wireframe?b.LINES:b.TRIANGLE_STRIP}_makePipelineState(i,r){const{oitPass:c,output:T,hasOccludees:h,hasPolygonOffset:O}=i,m=c===l.NONE,E=c===l.FrontFace;return N({blending:e(T)?s(c):null,depthTest:{func:n(c)},depthWrite:o(i),drawBuffers:T===t.Depth?{buffers:[I.NONE]}:u(c,T),colorWrite:g,stencilWrite:h?a:null,stencilTest:h?r?f:d:null,polygonOffset:m||E?O?_:null:p})}initializePipeline(e){if(e.occluder){const i=e.hasPolygonOffset?_:null;this._occluderPipelineTransparent=N({blending:S,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:h,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null}),this._occluderPipelineOpaque=N({blending:S,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:g,stencilWrite:O,stencilTest:m,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null}),this._occluderPipelineMaskWrite=N({blending:null,polygonOffset:i,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:f,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const _={factor:0,units:-4},L=new Map([[P.POSITION,0],[P.PREVPOSITION,1],[P.NEXTPOSITION,2],[P.LINEPARAMETERS,3],[P.U0,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{A as RibbonLineTechnique,L as vertexAttributeLocations};
5
+ import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as o,getDrawBuffers as u,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as d,depthCompareAlways as T,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as O,stencilToolMaskOccluderParams as m,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as b,SpecialDrawBuffers as I}from"../../../webgl/enums.js";import{makePipelineState as N,defaultColorWrite as g,premultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";class A extends r{constructor(e,t){super(e,t,new i(R,(()=>import("./RibbonLine.glsl.js"))),L),this.primitiveType=t.wireframe?b.LINES:b.TRIANGLE_STRIP}_makePipelineState(i,r){const{oitPass:c,output:T,hasOccludees:h,hasPolygonOffset:O}=i,m=c===l.NONE,E=c===l.FrontFace;return N({blending:e(T)?s(c):null,depthTest:{func:n(c)},depthWrite:o(i),drawBuffers:T===t.Depth?{buffers:[I.NONE]}:u(c,T),colorWrite:g,stencilWrite:h?a:null,stencilTest:h?r?f:d:null,polygonOffset:m||E?O?_:null:p})}initializePipeline(e){if(e.occluder){const i=e.hasPolygonOffset?_:null;this._occluderPipelineTransparent=N({blending:S,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:h,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null}),this._occluderPipelineOpaque=N({blending:S,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:g,stencilWrite:O,stencilTest:m,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null}),this._occluderPipelineMaskWrite=N({blending:null,polygonOffset:i,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:f,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const _={factor:0,units:-4},L=new Map([[P.POSITION,0],[P.PREVPOSITION,1],[P.NEXTPOSITION,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{A as RibbonLineTechnique,L as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../chunks/vec32.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/NormalFromDepth.glsl.js";import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../core/shaderModules/UintTexture2DPassUniform.js";import"../lib/ShadowMap.js";import"./ReadShadowMapConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/ShadowHighlight.glsl.js";
5
+ import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../chunks/vec32.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/NormalFromDepth.glsl.js";import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"../lib/ShadowMap.js";import"./ReadShadowMapConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/ShadowHighlight.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{TransparencyMode as r}from"../../terrain/TransparencyMode.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as o}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as a}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as n}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as p}from"../materials/DefaultTechniqueConfiguration.js";class d extends p{constructor(e){super(),this.spherical=e,this.overlayMode=s.Disabled,this.tileBlendInput=a.LayerOnly,this.transparencyMode=r.Opaque,this.pbrMode=i.Simplified,this.receiveShadows=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.normalType=t.Compressed,this.textureCoordinateType=o.Default,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.canHaveOverlay=!0}}e([n({count:s.COUNT})],d.prototype,"overlayMode",void 0),e([n({count:a.COUNT})],d.prototype,"tileBlendInput",void 0),e([n({count:r.COUNT})],d.prototype,"transparencyMode",void 0),e([n({count:i.COUNT})],d.prototype,"pbrMode",void 0),e([n()],d.prototype,"receiveShadows",void 0),e([n()],d.prototype,"backfaceCullingEnabled",void 0),e([n()],d.prototype,"textureFadingEnabled",void 0),e([n()],d.prototype,"renderOccluded",void 0),e([n()],d.prototype,"screenSpaceReflections",void 0),e([n()],d.prototype,"cloudReflections",void 0),e([n()],d.prototype,"tileBorders",void 0),e([n()],d.prototype,"visualizeNormals",void 0),e([n()],d.prototype,"screenSizePerspective",void 0),e([n()],d.prototype,"receiveAmbientOcclusion",void 0);export{d as TerrainTechniqueConfiguration};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{TransparencyMode as r}from"../../terrain/TransparencyMode.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as o}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as a}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as n}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as p}from"../materials/DefaultTechniqueConfiguration.js";class d extends p{constructor(e){super(),this.spherical=e,this.overlayMode=s.Disabled,this.tileBlendInput=a.LayerOnly,this.transparencyMode=r.Opaque,this.pbrMode=i.Simplified,this.receiveShadows=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.normalType=t.Compressed,this.textureCoordinateType=o.Default,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.canHaveOverlay=!0}}e([n({count:s.COUNT})],d.prototype,"overlayMode",void 0),e([n({count:a.COUNT})],d.prototype,"tileBlendInput",void 0),e([n({count:r.COUNT})],d.prototype,"transparencyMode",void 0),e([n({count:i.COUNT})],d.prototype,"pbrMode",void 0),e([n()],d.prototype,"receiveShadows",void 0),e([n()],d.prototype,"backfaceCullingEnabled",void 0),e([n()],d.prototype,"textureFadingEnabled",void 0),e([n()],d.prototype,"renderOccluded",void 0),e([n()],d.prototype,"screenSpaceReflections",void 0),e([n()],d.prototype,"cloudReflections",void 0),e([n()],d.prototype,"screenSizePerspective",void 0),e([n()],d.prototype,"receiveAmbientOcclusion",void 0),e([n()],d.prototype,"tileBorders",void 0),e([n()],d.prototype,"visualizeNormals",void 0);export{d as TerrainTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,whenOnce as m,initial as l,syncAndInitial as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import G from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/accessorSupport/tracking/Flags.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import"../layers/effects/EffectView.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./webgl/GLObjectType.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/JSONSupport.js";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import S from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as C}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import E from"./2d/engine/webgl/OverlayContainer.js";import q from"./navigation/Navigation.js";import V from"./ui/DefaultUI.js";import R from"./ui/2d/DefaultUI2D.js";const O=new t("#000");let T;async function W(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);T=e}const k=.01;let z=class extends s{};z=e([d("esri.views.VideoView.Base")],z);let A=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(z))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new q,this.ready=!1,this.stateManager=new C({constraints:new G({view:this,minScale:1,maxScale:k})}),this.spatialReference=new y({wkid:0}),this.type="2d",this.ui=new R,this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(m((()=>this.ready)))),l),a((()=>[this.layer?.effect,this._overlayContainer,this.effect]),(()=>{this._overlayContainer&&(this._overlayContainer.effect=this.effect??this.layer?.effect??null)}),p),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}))])}initialize(){this.addResolvingPromise(W().then((()=>(this._isValid=!0,m((()=>this.ready))))))}destroy(){this._teardown()}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get effect(){return this.layer?.effect}set effect(e){this._override("effect",e)}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new T(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:O}),this._prepareStage(this.stage);const t=new x({view:this});this._set("animationManager",t);const i=new S({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeAllHandles(),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear(),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),p),a((()=>this.state.id),(()=>e.state=this.state),p),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),p)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new E,this._overlayContainer.addChild(t),this.stage.addChild(this._overlayContainer)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>k;r/=2)i.push(r);i.push(k);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([c()],A.prototype,"_overlayContainer",void 0),e([c()],A.prototype,"_isValid",void 0),e([c()],A.prototype,"constraintsInfo",null),e([c()],A.prototype,"effect",null),e([c()],A.prototype,"layer",void 0),e([c({type:q,nonNullable:!0})],A.prototype,"navigation",void 0),e([c({readOnly:!0})],A.prototype,"preconditionsReady",null),e([c({readOnly:!0})],A.prototype,"ready",void 0),e([c({readOnly:!0})],A.prototype,"rendering",null),e([c()],A.prototype,"stateManager",void 0),e([c({readOnly:!0})],A.prototype,"videoSize",null),e([c()],A.prototype,"scale",null),e([c()],A.prototype,"spatialReference",void 0),e([c()],A.prototype,"type",void 0),e([c(),h((e=>e instanceof V?e:g(R,e)))],A.prototype,"ui",void 0),A=e([d("esri.views.VideoView")],A);const D=A;export{D as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,whenOnce as m,initial as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import G from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/accessorSupport/tracking/Flags.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import"../layers/effects/EffectView.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./webgl/GLObjectType.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/JSONSupport.js";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import S from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as C}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import E from"./2d/engine/webgl/OverlayContainer.js";import q from"./navigation/Navigation.js";import V from"./ui/DefaultUI.js";import R from"./ui/2d/DefaultUI2D.js";const O=new t("#000");let T;async function W(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);T=e}const k=.01;let z=class extends s{};z=e([d("esri.views.VideoView.Base")],z);let A=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(z))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new q,this.ready=!1,this.stateManager=new C({constraints:new G({view:this,minScale:1,maxScale:k})}),this.spatialReference=new y({wkid:0}),this.type="2d",this.ui=new R,this.addHandles([a((()=>this.preconditionsReady),(e=>e?this._startup():this._teardown())),a((()=>this.layer),(()=>this.addResolvingPromise(m((()=>this.ready)))),p),a((()=>[this.layer?.effect,this._overlayContainer,this.effect]),(()=>{this._overlayContainer&&(this._overlayContainer.effect=this.effect??this.layer?.effect??null)}),l),a((()=>this.videoSize),(([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}))])}initialize(){this.addResolvingPromise(W().then((()=>(this._isValid=!0,m((()=>this.ready))))))}destroy(){this._teardown()}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get effect(){return this.layer?.effect}set effect(e){this._override("effect",e)}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new T(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:O}),this._prepareStage(this.stage);const t=new x({view:this});this._set("animationManager",t);const i=new S({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeAllHandles(),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear(),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a((()=>this.stationary),(t=>e.stationary=t),l),a((()=>this.state.id),(()=>e.state=this.state),l),a((()=>this.renderingOptions),(t=>e.renderingOptions=t),l)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new E,this._overlayContainer.addChild(t),this.stage.addChild(this._overlayContainer)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>k;r/=2)i.push(r);i.push(k);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([c()],A.prototype,"_overlayContainer",void 0),e([c()],A.prototype,"_isValid",void 0),e([c()],A.prototype,"constraintsInfo",null),e([c()],A.prototype,"effect",null),e([c()],A.prototype,"layer",void 0),e([c({type:q,nonNullable:!0})],A.prototype,"navigation",void 0),e([c({readOnly:!0})],A.prototype,"preconditionsReady",null),e([c({readOnly:!0})],A.prototype,"ready",void 0),e([c({readOnly:!0})],A.prototype,"rendering",null),e([c()],A.prototype,"stateManager",void 0),e([c({readOnly:!0})],A.prototype,"videoSize",null),e([c()],A.prototype,"scale",null),e([c()],A.prototype,"spatialReference",void 0),e([c()],A.prototype,"type",void 0),e([c(),h((e=>e instanceof V?e:g(R,e)))],A.prototype,"ui",void 0),A=e([d("esri.views.VideoView")],A);const D=A;export{D as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import"../../intl.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i,BrightnessThreshold as n}from"../../core/colorUtils.js";import{makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as a}from"../../core/mathUtils.js";import{formatLength as c}from"../../core/quantityFormatUtils.js";import{watch as h,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../core/screenUtils.js";import{getMetersPerUnit as d,getMetersPerVerticalUnitForSR as u}from"../../core/unitUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as b,set as _,normalize as x,scale as y,lerp as v,add as j}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as U}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{I as L}from"../../chunks/vec32.js";import{isClockwise as I}from"../../geometry/support/coordsUtils.js";import{sv3d as C}from"../../geometry/support/vectorStacks.js";import{fetchMessageBundle as k}from"../../intl/messages.js";import{getConvertedElevationFromVector as w,absoluteHeightElevationInfo as S}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as D}from"../../support/getDefaultUnitForView.js";import M from"../overlay/TextOverlayItem.js";import{autoDistance2D as T}from"../support/automaticLengthMeasurementUtils.js";import{onLocaleChange as O}from"../../intl/locale.js";const P=3025,V={default:15,far:25};let A=class extends s{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messageUnitsTask=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){this.addHandles([h((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((t=>p((()=>this.context?.editGeometryOperations),t,(()=>this._update())))),h((()=>this._colors),(t=>this._updateStyle(t))),O((()=>this._refreshMessages())),l((()=>this._messageUnitsTask?.abort()))]),this._refreshMessages()}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){}get _messagesUnits(){return this._messageUnitsTask?.value}get _edgeDistancePixels(){return V[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t,n.Low),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{components:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let l=0;l<n;++l){const o=G(r,s,e,i,l);if(o.length<2||!R(o,t.view,t.elevationInfo,i.spatialReference))continue;const a=1===n&&!I(o);let c=H,h=X;this.toScreenPointArray(t,o[0],c);for(let e=1;e<o.length;++e){const s=o[e-1],r=o[e];this.toScreenPointArray(t,r,h),this._addLabel(t,s,c,r,h,a),[c,h]=[h,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||b(s,r)<P)return void(n.visible=!1);const{spatialReference:l}=t.editGeometryOperations.data,a=T(e,o,l),h=this._messagesUnits,p=D(t.view);n.text=null!=h&&null!=a?c(h,a,p):"",n.visible=!0;const m=r[0]-s[0],d=r[1]-s[1];i?_(z,-d,m):_(z,d,-m),x(z,z),y(z,z,this._edgeDistancePixels),v(F,s,r,.5),j(F,F,z),n.position=[F[0],F[1]],Math.abs(z[0])>Math.abs(z[1])?n.anchor=z[0]>0?"left":"right":n.anchor=-z[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new M({anchor:"center",fontSize:8,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}_refreshMessages(){this._messageUnitsTask?.abort(),this._messageUnitsTask=o((()=>k("esri/core/t9n/Units")))}};function G(t,e,s,o,r){const i=[];if(e.data.components[r].iterateVertices((t=>{i.push(o.toXYZ(t.pos,C.get()))})),0===r&&null!=s&&i.push(o.toXYZ(s,C.get())),i.length<2)return i;const n=i[0],l=i[i.length-1];return"polygon"===t.type&&i.length>2&&!L(n,l)&&i.push(n),i}function R(t,e,s,o){if("2d"===e.type)return!0;const r=d(o)??1,i=u(o),n=t=>w(e,t,o,s,S)??0;for(let l=1;l<t.length;++l){const e=t[l-1],s=t[l],o=(s[0]-e[0])*r,a=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+a*a)>q)return!1}return!0}t([f()],A.prototype,"context",void 0),t([f()],A.prototype,"stagedVertex",void 0),t([f()],A.prototype,"visible",void 0),t([f()],A.prototype,"edgeDistance",void 0),t([f()],A.prototype,"updating",null),t([f()],A.prototype,"_messageUnitsTask",void 0),t([f()],A.prototype,"_messagesUnits",null),t([f()],A.prototype,"_edgeDistancePixels",null),t([f()],A.prototype,"_colors",null),A=t([g("esri.views.interactive.SegmentLabels")],A);const q=a(5),z=U(),F=U(),H=m(),X=m();export{A as SegmentLabels};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import"../../intl.js";import s from"../../core/Accessor.js";import{createTask as o}from"../../core/asyncUtils.js";import{multiplyOpacity as r,getContrast as i,BrightnessThreshold as n}from"../../core/colorUtils.js";import{makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import{deg2rad as a}from"../../core/mathUtils.js";import{formatLength as c}from"../../core/quantityFormatUtils.js";import{watch as h,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../core/screenUtils.js";import{getMetersPerUnit as d,getMetersPerVerticalUnitForSR as u}from"../../core/unitUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as b,set as _,normalize as x,scale as y,lerp as v,add as j}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as U}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{H as L}from"../../chunks/vec32.js";import{isClockwise as I}from"../../geometry/support/coordsUtils.js";import{sv3d as C}from"../../geometry/support/vectorStacks.js";import{fetchMessageBundle as k}from"../../intl/messages.js";import{getConvertedElevationFromVector as w,absoluteHeightElevationInfo as S}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as D}from"../../support/getDefaultUnitForView.js";import M from"../overlay/TextOverlayItem.js";import{autoDistance2D as T}from"../support/automaticLengthMeasurementUtils.js";import{onLocaleChange as O}from"../../intl/locale.js";const P=3025,V={default:15,far:25};let A=class extends s{constructor(t){super(t),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messageUnitsTask=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){this.addHandles([h((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((t=>p((()=>this.context?.editGeometryOperations),t,(()=>this._update())))),h((()=>this._colors),(t=>this._updateStyle(t))),O((()=>this._refreshMessages())),l((()=>this._messageUnitsTask?.abort()))]),this._refreshMessages()}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){}get _messagesUnits(){return this._messageUnitsTask?.value}get _edgeDistancePixels(){return V[this.edgeDistance]}get _colors(){const t=this.context?.view.effectiveTheme.textColor??e.fromArray([255,255,255]);return{textColor:t,backgroundColor:r(i(t,n.Low),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const{context:t,stagedVertex:e}=this;if(!t)return this._destroyUnusedLabels();const{editGeometryOperations:s}=t,{components:o,geometry:r,coordinateHelper:i}=s.data;if(!r)return this._destroyUnusedLabels();const n=o.length;for(let l=0;l<n;++l){const o=G(r,s,e,i,l);if(o.length<2||!H(o,t.view,t.elevationInfo,i.spatialReference))continue;const a=1===n&&!I(o);let c=F,h=X;this.toScreenPointArray(t,o[0],c);for(let e=1;e<o.length;++e){const s=o[e-1],r=o[e];this.toScreenPointArray(t,r,h),this._addLabel(t,s,c,r,h,a),[c,h]=[h,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:t,backgroundColor:e}){const s=this._nextLabelIndex,o=this._labelInfos;for(let r=0;r<s;++r){const{label:s}=o[r];s.textColor=t,s.backgroundColor=e}}_addLabel(t,e,s,o,r,i){const{label:n}=this._getOrCreateLabel(t);if(!this.visible||b(s,r)<P)return void(n.visible=!1);const{spatialReference:l}=t.editGeometryOperations.data,a=T(e,o,l),h=this._messagesUnits,p=D(t.view);n.text=null!=h&&null!=a?c(h,a,p):"",n.visible=!0;const m=r[0]-s[0],d=r[1]-s[1];i?_(q,-d,m):_(q,d,-m),x(q,q),y(q,q,this._edgeDistancePixels),v(z,s,r,.5),j(z,z,q),n.position=[z[0],z[1]],Math.abs(q[0])>Math.abs(q[1])?n.anchor=q[0]>0?"left":"right":n.anchor=-q[1]<0?"top":"bottom"}_getOrCreateLabel(t){const e=this._labelInfos.length>this._nextLabelIndex,{textColor:s,backgroundColor:o}=this._colors;if(e){const t=this._labelInfos[this._nextLabelIndex++],{label:e}=t;return e.textColor=s,e.backgroundColor=o,t}const r=new M({anchor:"center",fontSize:8,textColor:s,backgroundColor:o});t.view.overlay?.items.add(r);const i={label:r};return this._labelInfos.push(i),this._nextLabelIndex=this._labelInfos.length,i}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:t}){this.context?.view.overlay?.items.remove(t),t.destroy()}_refreshMessages(){this._messageUnitsTask?.abort(),this._messageUnitsTask=o((()=>k("esri/core/t9n/Units")))}};function G(t,e,s,o,r){const i=[];if(e.data.components[r].iterateVertices((t=>{i.push(o.toXYZ(t.pos,C.get()))})),0===r&&null!=s&&i.push(o.toXYZ(s,C.get())),i.length<2)return i;const n=i[0],l=i[i.length-1];return"polygon"===t.type&&i.length>2&&!L(n,l)&&i.push(n),i}function H(t,e,s,o){if("2d"===e.type)return!0;const r=d(o)??1,i=u(o),n=t=>w(e,t,o,s,S)??0;for(let l=1;l<t.length;++l){const e=t[l-1],s=t[l],o=(s[0]-e[0])*r,a=(s[1]-e[1])*r,c=(n(s)-n(e))*i;if(Math.abs(c)/Math.sqrt(o*o+a*a)>R)return!1}return!0}t([f()],A.prototype,"context",void 0),t([f()],A.prototype,"stagedVertex",void 0),t([f()],A.prototype,"visible",void 0),t([f()],A.prototype,"edgeDistance",void 0),t([f()],A.prototype,"updating",null),t([f()],A.prototype,"_messageUnitsTask",void 0),t([f()],A.prototype,"_messagesUnits",null),t([f()],A.prototype,"_edgeDistancePixels",null),t([f()],A.prototype,"_colors",null),A=t([g("esri.views.interactive.SegmentLabels")],A);const R=a(5),q=U(),z=U(),F=m(),X=m();export{A as SegmentLabels};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as s,m as u,j as c,c as h,I as p}from"../../chunks/vec32.js";import{create as v,fromValues as l,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as Z,fromArray as _}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import g from"../../geometry/Point.js";var x;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(x||(x={}));class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(r,t,a,i){return e(i,r,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(e,t){return r(e,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=v()){return s(r,e[0],e[1],0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class M{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(v())}pointToVector(e){return this._tag(l(e.x,e.y,this._valueType===x.Z?e.z:e.m))}arrayToVector(e){return this._tag(l(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===x.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=this._valueType===x.Z,a=this._valueType===x.M;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return u(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,this._valueType===x.Z&&(e[2]+=a)}distance(e,t){return this._valueType===x.Z?c(e,t):r(w(e),w(t))}getZ(e,r=void 0){return this._valueType===x.Z?e[2]:r}hasZ(){return this._valueType===x.Z}getM(e,r=void 0){return this._valueType===x.M?e[2]:r}hasM(){return this._valueType===x.M}clone(e){return this._tag(y(e))}copy(e,r){return h(r,e)}fromXYZ(e,r=0,t=0){return this._tag(l(e[0],e[1],this._valueType===x.Z?e.length>2?e[2]:r:t))}toXYZ(e,r=v()){return s(r,e[0],e[1],this._valueType===x.Z?e[2]:0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,this._valueType===x.Z?e.z??0:0)}equals(e,r){return p(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(Z(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Z(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return c(V(e),V(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(_(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(Z(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=v()){return s(r,e[0],e[1],e[2])}pointToXYZ(e,r=v()){return s(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function V(e){return e}function w(e){return e}function P(e,r,t){return e&&r?new z(t):r?new M(x.M,t):e?new M(x.Z,t):new R(t)}export{R as CoordinateHelper2D,M as CoordinateHelper3D,z as CoordinateHelper4D,P as createCoordinateHelper};
5
+ import{lerp as e,distance as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as s,m as u,j as c,c as h,H as p}from"../../chunks/vec32.js";import{create as v,fromValues as l,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,c as f,e as m}from"../../chunks/vec42.js";import{create as T,fromValues as Z,fromArray as _}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import g from"../../geometry/Point.js";var x;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(x||(x={}));class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(r,t,a,i){return e(i,r,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(e,t){return r(e,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=v()){return s(r,e[0],e[1],0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class M{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(v())}pointToVector(e){return this._tag(l(e.x,e.y,this._valueType===x.Z?e.z:e.m))}arrayToVector(e){return this._tag(l(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===x.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=this._valueType===x.Z?e[2]:void 0,r.m=this._valueType===x.M?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=this._valueType===x.Z,a=this._valueType===x.M;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return u(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,this._valueType===x.Z&&(e[2]+=a)}distance(e,t){return this._valueType===x.Z?c(e,t):r(w(e),w(t))}getZ(e,r=void 0){return this._valueType===x.Z?e[2]:r}hasZ(){return this._valueType===x.Z}getM(e,r=void 0){return this._valueType===x.M?e[2]:r}hasM(){return this._valueType===x.M}clone(e){return this._tag(y(e))}copy(e,r){return h(r,e)}fromXYZ(e,r=0,t=0){return this._tag(l(e[0],e[1],this._valueType===x.Z?e.length>2?e[2]:r:t))}toXYZ(e,r=v()){return s(r,e[0],e[1],this._valueType===x.Z?e[2]:0)}pointToXYZ(e,r=v()){return s(r,e.x,e.y,this._valueType===x.Z?e.z??0:0)}equals(e,r){return p(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(T())}pointToVector(e){return this._tag(Z(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Z(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new g){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return c(V(e),V(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(_(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(Z(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=v()){return s(r,e[0],e[1],e[2])}pointToXYZ(e,r=v()){return s(r,e.x,e.y,e.z??0)}equals(e,r){return m(e,r)}_tag(e){return e}}function V(e){return e}function w(e){return e}function P(e,r,t){return e&&r?new z(t):r?new M(x.M,t):e?new M(x.Z,t):new R(t)}export{R as CoordinateHelper2D,M as CoordinateHelper3D,z as CoordinateHelper4D,P as createCoordinateHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t,deg2rad as i}from"../../../../core/mathUtils.js";import{subtract as e,normalize as s,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{o as h,i as o,e as a,n as _,h as c,f as l,v as p,g,m as d,I as u,c as m}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as D,fromPositionAndNormal as x,signedDistance as E,copy as b,isPointInside as I,projectPoint as M,getNormal as V,intersectLine as N}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T,LineType as Z}from"../../../support/geometry2dUtils.js";class P{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,e,s=0,n=j.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,n===j.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=h(f(),t,e),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(e,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return null!=t?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,e,s){const n=f();if(i){h(n,t,i);const s=!this._passesBisectingAngleThreshold(n,e);return{start:t,end:i,direction:s?this._bisectVectorsPerpendicular(e,n):n,isOriginalDirection:!s}}return this._helper.hasZ()?s&&(a(n,e,s.direction),a(n,n,e),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):o(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(X(i,t));return e>=y&&e<=Math.PI-y}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<A||s>1-A))return this._bisectDirection(e,i);const n=a(f(),e,[0,0,1]);return _(n,n)}_bisectDirection(t,i){const e=g(f(),t,i);return _(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);l(t,i)<0&&p(i,i),x(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=a(f(),t.direction,this._edgeDirection);_(i,i);const e=a(f(),this._edgeDirection,i);return this._planeType===z.XY&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(E(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(E(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),h=this._edgeDirection,o=g(f(),this._left.start,this._left.direction),a=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,o),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,a),[u]=T({start:l,end:_,type:Z.LINE},{start:d,end:p,type:Z.LINE});if(!u)return;const m=e(r(),_,l);s(m,m);const D=e(r(),u,l),x=n(m,D),b=g(f(),o,c(f(),this._left.direction,-x)),I=E(t,b);this._updateDistanceConstraint(I)}_pointInBasis2D(t,i,e,s){return t[0]=Y(i,s),t[1]=Y(e,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&N(this._offsetPlane,t,g(f(),t,i),e),s=f();(t===this._edge.leftVertex?e(this._left.start,this._left.direction,s):e(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=I(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return E(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=M(this._plane,e,f()),n=E(this._plane,e),r=t(n,this._minDistance,this._maxDistance);return d(e,s,e,r/n),{start:s,end:e}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof P&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&u(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new P(this._helper,this._planeType,this._edge,this.distance,j.DEFERRED);return b(t._plane,this._plane),b(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=m(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&u(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:m(f(),t),end:null!=i?m(f(),i):null,direction:m(f(),e),isOriginalDirection:s}}}const y=i(15),A=.001;var z,j;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(z||(z={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(j||(j={}));export{P as OffsetEdgeVertex,z as PlaneType};
5
+ import{clamp as t,deg2rad as i}from"../../../../core/mathUtils.js";import{subtract as e,normalize as s,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{o as h,i as o,e as a,n as _,h as c,f as l,v as p,g,m as d,H as u,c as m}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as D,fromPositionAndNormal as x,signedDistance as E,copy as b,isPointInside as I,projectPoint as M,getNormal as V,intersectLine as N}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T,LineType as Z}from"../../../support/geometry2dUtils.js";class P{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,e,s=0,n=j.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,n===j.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=h(f(),t,e),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(e,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return null!=t?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,e,s){const n=f();if(i){h(n,t,i);const s=!this._passesBisectingAngleThreshold(n,e);return{start:t,end:i,direction:s?this._bisectVectorsPerpendicular(e,n):n,isOriginalDirection:!s}}return this._helper.hasZ()?s&&(a(n,e,s.direction),a(n,n,e),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):o(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(X(i,t));return e>=y&&e<=Math.PI-y}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<A||s>1-A))return this._bisectDirection(e,i);const n=a(f(),e,[0,0,1]);return _(n,n)}_bisectDirection(t,i){const e=g(f(),t,i);return _(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);l(t,i)<0&&p(i,i),x(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=a(f(),t.direction,this._edgeDirection);_(i,i);const e=a(f(),this._edgeDirection,i);return this._planeType===z.XY&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(E(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(E(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),h=this._edgeDirection,o=g(f(),this._left.start,this._left.direction),a=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,o),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,a),[u]=T({start:l,end:_,type:Z.LINE},{start:d,end:p,type:Z.LINE});if(!u)return;const m=e(r(),_,l);s(m,m);const D=e(r(),u,l),x=n(m,D),b=g(f(),o,c(f(),this._left.direction,-x)),I=E(t,b);this._updateDistanceConstraint(I)}_pointInBasis2D(t,i,e,s){return t[0]=Y(i,s),t[1]=Y(e,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&N(this._offsetPlane,t,g(f(),t,i),e),s=f();(t===this._edge.leftVertex?e(this._left.start,this._left.direction,s):e(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=I(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return E(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=M(this._plane,e,f()),n=E(this._plane,e),r=t(n,this._minDistance,this._maxDistance);return d(e,s,e,r/n),{start:s,end:e}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof P&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&u(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new P(this._helper,this._planeType,this._edge,this.distance,j.DEFERRED);return b(t._plane,this._plane),b(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=m(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&u(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:m(f(),t),end:null!=i?m(f(),i):null,direction:m(f(),e),isOriginalDirection:s}}}const y=i(15),A=.001;var z,j;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(z||(z={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(j||(j={}));export{P as OffsetEdgeVertex,z as PlaneType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as a,p as h,s as f,a as l,k as d,i as p,c as m,d as g,I as _,f as L,e as k,n as x}from"../../../chunks/vec32.js";import{clone as y,create as P,UNIT_Z as z,fromValues as M}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as j}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as v,inverseGeodeticSolver as A,InverseGeodeticSolverResult as D}from"../../../geometry/support/geodesicUtils.js";import{create as b,intersectLine as E,signedDistance as R,projectPoint as I,fromPositionAndNormal as N,fromPoints as U,distance as Z,getNormal as S}from"../../../geometry/support/plane.js";import{l as C,m as G,p as O,a as F,n as H}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q,createWritable as W}from"./normalizedPoint.js";import{vectorsHaveCloseZ as X,isClose as $,intersectVerticalPlaneAndVerticalCylinder as tt,isPointInsidePlane as et,projectPointToLineLike as st,projectPointToVerticalCylinder as rt,projectPointToVerticalPlane as nt,VerticalPlaneType as it,intersectLineLikes as ot,intersectVerticalPlaneAndLineLike as ct,intersectLineLikeAndVerticalCylinder as ut,intersectLineLikeAndCircle as at,intersectVerticalPlanes as ht,intersectVerticalCylinders as ft,pointsInsidePlane as lt,intersectVerticalPlaneAndPoint as dt}from"../../support/geometry3dUtils.js";import{LineType as pt}from"../../support/geometry2dUtils.js";class mt{intersect(t){return Ht(this,t)}closestPoints(t){return[this.closestTo(t)]}}class gt extends mt{constructor(t){super(),this.point=t}equals(t){return this===t||Le(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class _t extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||ke(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return st(t,this.lineLike,e),e}}class Lt extends _t{constructor(t,e){super(t,e,pt.LINE)}}class kt extends _t{constructor(t,e){super(t,e,pt.RAY)}}class xt extends mt{constructor(t){super(),this.constraints=t}equals(t){return this===t||_e(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=f(t,n);i<s&&(s=i,e=n)}return B(e??t)}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class yt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e}}class Pt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ze(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new zt(B(this.center),this.radius,J(0,0,1))}}class zt extends mt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||Me(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Tt),t,Mt);const r=l(Mt,Mt,e),n=d(r);if($(n,0))return B(t);const i=s/Math.sqrt(n),o=W();a(o,e,r,i);const{slicePlane:c}=this;if(c&&!et(c,o)){const e=Jt(c,this);return e?.closestTo(t)??B(t)}return o}getPlane(t=b()){return N(this.center,this.normal,t)}}const Mt=P(),Tt=b();class qt extends mt{constructor(t){super(),this.z=t}equals(t){return this===t||xe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=b()){return p(wt,0,0,this.z),N(wt,z,t)}}const wt=P();class jt extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||ye(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return nt(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(vt,s,e),n(At,K(t),e)))>0?this.end:this.start}getPlane(t=b()){const e=m(Dt,this.end);return e[2]+=1,U(this.start,this.end,e,t)}getSlicePlane(t=b()){const{start:e,end:s,type:r}=this.planeLike;if(r===it.PLANE)return;const n=p(Dt,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return N(n,o,t),t}}const vt=u(),At=u(),Dt=P(),bt=P();class Et extends jt{constructor(t,e){super(t,e,it.HALF_PLANE)}}class Rt extends jt{constructor(t,e){super(t,e,it.PLANE)}}class It extends mt{constructor(t,e){super(),this.sphere=C(t,e)}equals(t){return this===t||Te(t)&&G(this.sphere,t.sphere)}closestTo(t){const e=W();return O(this.sphere,t,e),e}get center(){return F(this.sphere)}get radius(){return this.sphere[3]}}class Nt extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:it.PLANE}}equals(t){return this===t||qe(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ft(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Ut extends mt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||je(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return Q(this._x??t,this._y??e,this._z??s)}}class Zt extends mt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||we(t)&&i(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return o(St,t,e),i(St,this._origin)||this._applyDirectionAndDistance(St),Q(St[0],St[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)v(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Gt(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=A(Ct,this._origin,t,this._spatialReference);v(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const St=[0,0],Ct=new D;function Gt(t,e,s,r,n){let{azimuth:i,distance:o}=A(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*j);c=Math.max(0,c),v(t,e,s,c,n)}const Ot=new D;function Ft(t,e){const s=W();return nt(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??ve,s}function Ht(t,e){if(_e(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return ge(s)}if(_e(e))return Ht(e,t);if(qe(t))return le(t,e);if(qe(e))return le(e,t);if(Le(t)){const{point:s}=t;if(Le(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return _(r,s)?t:void 0}if(ke(t)){if(Le(e))return Ht(e,t);if(ke(e))return pe(ot(t.lineLike,e.lineLike));if(xe(e))return Vt(t,e);if(ye(e))return pe(ct(e.planeLike,t.lineLike));if(Pe(e))return pe(ut(t.lineLike,e.center,e.radius));if(Me(e))return pe(at(t.lineLike,e));if(ze(e))return Yt(t,e);if(Te(e))return Bt(t,e)}else if(xe(t)){if(Le(e)||ke(e))return Ht(e,t);if(xe(e))return Kt(t,e);if(ye(e))return Qt(t,e);if(Pe(e))return Wt(t,e);if(Me(e))return $t(t,e);if(ze(e))return Xt(t,e);if(Te(e))return te(t,e)}else if(ye(t)){if(Le(e)||ke(e)||xe(e))return Ht(e,t);if(ye(e))return de(ht(t.planeLike,e.planeLike));if(Pe(e))return de(tt(t.planeLike,e.center,e.radius));if(Me(e))return se(t,e);if(ze(e))return ee(t,e);if(Te(e))return re(t,e)}else if(Pe(t)){if(Le(e)||ke(e)||xe(e)||ye(e))return Ht(e,t);if(Pe(e))return de(ft(K(t.center),t.radius,K(e.center),e.radius));if(Me(e))return ne();if(ze(e))return ie(t,e);if(Te(e))return oe()}else if(Me(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e))return Ht(e,t);if(Me(e))return ce();if(ze(e))return ce(e.asCircle());if(Te(e))return ue()}else if(ze(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||Me(e))return Ht(e,t);if(ze(e))return ae(e,t);if(Te(e))return he()}else if(Te(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||ze(e))return Ht(e,t);if(Te(e))return fe()}}const Vt=(()=>{const t=b();return(e,s)=>{const{start:r,end:n}=e;if(X(r,n)&&$(r[2],s.z))return e;const i=W();return E(s.getPlane(t),r,n,i)?new gt(i):void 0}})();function Yt({lineLike:t},{center:e,radius:s}){const r=e[2];return pe(ut(t,e,s).filter((t=>$(t[2],r))))}function Bt({lineLike:t},{sphere:e}){return pe(H(e,t.start,t.end))}const Jt=(()=>{const t=w(),e=P(),r=P();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const f=S(n),l=h*L(f,e),d=h*L(f,r);T(t,u[0],u[1],u[2],1);const p=q(n,t),m=Math.hypot(l,d),g=$(m,0);if($(Z(n,u),0)){if(g)return i;if($(h,0))return!o||et(o,u)?new gt(B(u)):void 0;k(e,f,c),x(e,e);const t=new Array,s=y(u);a(s,s,e,h),o&&!et(o,s)||t.push(s);const r=y(u);return a(r,r,e,-h),o&&!et(o,r)||t.push(r),pe(t)}if(g)return;const _=-p/m;if(Math.abs(_)>1||$(_,1))return;const z=Math.atan(l/d),M=s(_)-z,w=Math.PI-M,j=new Array,v=P();a(v,u,e,h*Math.cos(M)),a(v,v,r,h*Math.sin(M)),j.push(v);const A=P();return a(A,u,e,h*Math.cos(w)),a(A,A,r,h*Math.sin(w)),j.push(A),pe(o?lt(o,j):j)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Qt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===it.PLANE?new Lt(o,c):new kt(o,c)}function Wt(t,e){const[s,r]=e.center;return new Pt(J(s,r,t.z),e.radius)}function Xt(t,e){return $(e.center[2],t.z)?e:void 0}const $t=(()=>{const t=b();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function te(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new Pt(n,i)}const ee=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=tt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];et(t,e)&&o.push(e)}return pe(o)}})(),se=(()=>{const t=b(),e=b();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),re=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=R(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=W();return I(n,s,t),new gt(t)}const u=W(),h=y(S(n));return a(u,s,h,i),new zt(u,c,h,e.getSlicePlane())}})();function ne(t,e){}function ie(t,e){const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return me(ft(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function oe(t,e){}function ce(t,e){}function ue(t,e){}function ae(t,e){if(!X(t.center,e.center))return;const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return me(ft(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function he(t,e){}function fe(t,e){}function le(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(Le(e))t.addIfOnTheGround(n,dt(s,e.point));else if(ke(e))t.addIfOnTheGround(n,ct(s,e.lineLike));else if(Pe(e))for(const[i,o]of tt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(ye(e)||qe(e))for(const[i,o]of ht(s,e.planeLike)){const t=r(i,o)??ve;n.push(M(i,o,t))}return pe(n)}function de(t){return ge(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function pe(t){return ge(t.map((t=>t?new gt(Y(t)):void 0)))}function me(t,e){return pe(t.map((([t,s])=>[t,s,e])))}function ge(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new xt(e.filter(t))}function _e(t){return t instanceof xt}function Le(t){return t instanceof gt}function ke(t){return t instanceof _t}function xe(t){return t instanceof qt}function ye(t){return t instanceof jt}function Pe(t){return t instanceof yt}function ze(t){return t instanceof Pt}function Me(t){return t instanceof zt}function Te(t){return t instanceof It}function qe(t){return t instanceof Nt}function we(t){return t instanceof Zt}function je(t){return t instanceof Ut}const ve=0;export{zt as CircleConstraint,mt as Constraint,Ut as CoordinateConstraint,Nt as DrapedLineConstraint,Zt as GeodesicConstraint,Pt as HorizontalCircleConstraint,qt as HorizontalPlaneConstraint,Lt as LineConstraint,_t as LineLikeConstraint,gt as PointConstraint,kt as RayConstraint,xt as SetConstraint,It as SphereConstraint,yt as VerticalCylinderConstraint,Et as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,jt as VerticalPlaneLikeConstraint,ge as constraintOrSet,Le as isPoint};
5
+ import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,exactEquals as i,set as o,squaredDistance as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as a,p as h,s as f,a as l,k as d,i as p,c as m,d as g,H as _,f as L,e as k,n as x}from"../../../chunks/vec32.js";import{clone as y,create as P,UNIT_Z as z,fromValues as M}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{toRadians as j}from"../../../geometry/support/geodesicConstants.js";import{directGeodeticSolver as v,inverseGeodeticSolver as A,InverseGeodeticSolverResult as D}from"../../../geometry/support/geodesicUtils.js";import{create as b,intersectLine as E,signedDistance as R,projectPoint as N,fromPositionAndNormal as U,fromPoints as Z,distance as I,getNormal as S}from"../../../geometry/support/plane.js";import{l as C,m as G,p as O,a as H,n as F}from"../../../chunks/sphere.js";import{tangentFrame as V}from"../../3d/support/mathUtils.js";import{fromVec3 as Y,clone as B,fromValues as J,asVec2 as K,create as Q,createWritable as W}from"./normalizedPoint.js";import{vectorsHaveCloseZ as X,isClose as $,intersectVerticalPlaneAndVerticalCylinder as tt,isPointInsidePlane as et,projectPointToLineLike as st,projectPointToVerticalCylinder as rt,projectPointToVerticalPlane as nt,VerticalPlaneType as it,intersectLineLikes as ot,intersectVerticalPlaneAndLineLike as ct,intersectLineLikeAndVerticalCylinder as ut,intersectLineLikeAndCircle as at,intersectVerticalPlanes as ht,intersectVerticalCylinders as ft,pointsInsidePlane as lt,intersectVerticalPlaneAndPoint as dt}from"../../support/geometry3dUtils.js";import{LineType as pt}from"../../support/geometry2dUtils.js";class mt{intersect(t){return Ft(this,t)}closestPoints(t){return[this.closestTo(t)]}}class gt extends mt{constructor(t){super(),this.point=t}equals(t){return this===t||Le(t)&&h(this.point,t.point)}closestTo(){return B(this.point)}}class _t extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||ke(t)&&this.lineLike.type===t.lineLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return st(t,this.lineLike,e),e}}class Lt extends _t{constructor(t,e){super(t,e,pt.LINE)}}class kt extends _t{constructor(t,e){super(t,e,pt.RAY)}}class xt extends mt{constructor(t){super(),this.constraints=t}equals(t){return this===t||_e(t)&&e(this.constraints,t.constraints,((t,e)=>t.equals(e)))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=f(t,n);i<s&&(s=i,e=n)}return B(e??t)}closestPoints(t){return this.constraints.flatMap((e=>e===this?[]:e.closestPoints(t)))}}class yt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||Pe(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e}}class Pt extends mt{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ze(t)&&h(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=W();return rt(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new zt(B(this.center),this.radius,J(0,0,1))}}class zt extends mt{constructor(t,e,s,r=void 0){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||Me(t)&&h(this.center,t.center)&&h(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;N(this.getPlane(Tt),t,Mt);const r=l(Mt,Mt,e),n=d(r);if($(n,0))return B(t);const i=s/Math.sqrt(n),o=W();a(o,e,r,i);const{slicePlane:c}=this;if(c&&!et(c,o)){const e=Jt(c,this);return e?.closestTo(t)??B(t)}return o}getPlane(t=b()){return U(this.center,this.normal,t)}}const Mt=P(),Tt=b();class qt extends mt{constructor(t){super(),this.z=t}equals(t){return this===t||xe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=b()){return p(wt,0,0,this.z),U(wt,z,t)}}const wt=P();class jt extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:K(t),end:K(e),type:s}}equals(t){return this===t||ye(t)&&this.planeLike.type===t.planeLike.type&&h(this.start,t.start)&&h(this.end,t.end)}closestTo(t){const e=W();return nt(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(vt,s,e),n(At,K(t),e)))>0?this.end:this.start}getPlane(t=b()){const e=m(Dt,this.end);return e[2]+=1,Z(this.start,this.end,e,t)}getSlicePlane(t=b()){const{start:e,end:s,type:r}=this.planeLike;if(r===it.PLANE)return;const n=p(Dt,e[0],e[1],0),i=p(bt,s[0],s[1],0),o=g(bt,i,n);return U(n,o,t),t}}const vt=u(),At=u(),Dt=P(),bt=P();class Et extends jt{constructor(t,e){super(t,e,it.HALF_PLANE)}}class Rt extends jt{constructor(t,e){super(t,e,it.PLANE)}}class Nt extends mt{constructor(t,e){super(),this.sphere=C(t,e)}equals(t){return this===t||Te(t)&&G(this.sphere,t.sphere)}closestTo(t){const e=W();return O(this.sphere,t,e),e}get center(){return H(this.sphere)}get radius(){return this.sphere[3]}}class Ut extends mt{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:K(t),end:K(e),type:it.PLANE}}equals(t){return this===t||qe(t)&&h(this.start,t.start)&&h(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Ht(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;$(s[2],e)&&(s[2]=e,t.push(s))}}}class Zt extends mt{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||je(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return Q(this._x??t,this._y??e,this._z??s)}}class It extends mt{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||we(t)&&i(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return o(St,t,e),i(St,this._origin)||this._applyDirectionAndDistance(St),Q(St[0],St[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)v(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Gt(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=A(Ct,this._origin,t,this._spatialReference);v(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const St=[0,0],Ct=new D;function Gt(t,e,s,r,n){let{azimuth:i,distance:o}=A(Ot,e,r,n);i??=0;let c=o*Math.cos((i-s)*j);c=Math.max(0,c),v(t,e,s,c,n)}const Ot=new D;function Ht(t,e){const s=W();return nt(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??ve,s}function Ft(t,e){if(_e(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return ge(s)}if(_e(e))return Ft(e,t);if(qe(t))return le(t,e);if(qe(e))return le(e,t);if(Le(t)){const{point:s}=t;if(Le(e))return h(s,e.point)?t:void 0;const r=e.closestTo(s);return _(r,s)?t:void 0}if(ke(t)){if(Le(e))return Ft(e,t);if(ke(e))return pe(ot(t.lineLike,e.lineLike));if(xe(e))return Vt(t,e);if(ye(e))return pe(ct(e.planeLike,t.lineLike));if(Pe(e))return pe(ut(t.lineLike,e.center,e.radius));if(Me(e))return pe(at(t.lineLike,e));if(ze(e))return Yt(t,e);if(Te(e))return Bt(t,e)}else if(xe(t)){if(Le(e)||ke(e))return Ft(e,t);if(xe(e))return Kt(t,e);if(ye(e))return Qt(t,e);if(Pe(e))return Wt(t,e);if(Me(e))return $t(t,e);if(ze(e))return Xt(t,e);if(Te(e))return te(t,e)}else if(ye(t)){if(Le(e)||ke(e)||xe(e))return Ft(e,t);if(ye(e))return de(ht(t.planeLike,e.planeLike));if(Pe(e))return de(tt(t.planeLike,e.center,e.radius));if(Me(e))return se(t,e);if(ze(e))return ee(t,e);if(Te(e))return re(t,e)}else if(Pe(t)){if(Le(e)||ke(e)||xe(e)||ye(e))return Ft(e,t);if(Pe(e))return de(ft(K(t.center),t.radius,K(e.center),e.radius));if(Me(e))return ne();if(ze(e))return ie(t,e);if(Te(e))return oe()}else if(Me(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e))return Ft(e,t);if(Me(e))return ce();if(ze(e))return ce(e.asCircle());if(Te(e))return ue()}else if(ze(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||Me(e))return Ft(e,t);if(ze(e))return ae(e,t);if(Te(e))return he()}else if(Te(t)){if(Le(e)||ke(e)||xe(e)||ye(e)||Pe(e)||ze(e))return Ft(e,t);if(Te(e))return fe()}}const Vt=(()=>{const t=b();return(e,s)=>{const{start:r,end:n}=e;if(X(r,n)&&$(r[2],s.z))return e;const i=W();return E(s.getPlane(t),r,n,i)?new gt(i):void 0}})();function Yt({lineLike:t},{center:e,radius:s}){const r=e[2];return pe(ut(t,e,s).filter((t=>$(t[2],r))))}function Bt({lineLike:t},{sphere:e}){return pe(F(e,t.start,t.end))}const Jt=(()=>{const t=w(),e=P(),r=P();return(n,i,o)=>{const{normal:c,center:u,radius:h}=i;V(c,e,r);const f=S(n),l=h*L(f,e),d=h*L(f,r);T(t,u[0],u[1],u[2],1);const p=q(n,t),m=Math.hypot(l,d),g=$(m,0);if($(I(n,u),0)){if(g)return i;if($(h,0))return!o||et(o,u)?new gt(B(u)):void 0;k(e,f,c),x(e,e);const t=new Array,s=y(u);a(s,s,e,h),o&&!et(o,s)||t.push(s);const r=y(u);return a(r,r,e,-h),o&&!et(o,r)||t.push(r),pe(t)}if(g)return;const _=-p/m;if(Math.abs(_)>1||$(_,1))return;const z=Math.atan(l/d),M=s(_)-z,w=Math.PI-M,j=new Array,v=P();a(v,u,e,h*Math.cos(M)),a(v,v,r,h*Math.sin(M)),j.push(v);const A=P();return a(A,u,e,h*Math.cos(w)),a(A,A,r,h*Math.sin(w)),j.push(A),pe(o?lt(o,j):j)}})();function Kt(t,e){return $(t.z,e.z)?t:void 0}function Qt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return e.type===it.PLANE?new Lt(o,c):new kt(o,c)}function Wt(t,e){const[s,r]=e.center;return new Pt(J(s,r,t.z),e.radius)}function Xt(t,e){return $(e.center[2],t.z)?e:void 0}const $t=(()=>{const t=b();return(e,s)=>Jt(e.getPlane(t),s,s.slicePlane)})();function te(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!$(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return $(i,0)?void 0:new Pt(n,i)}const ee=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=tt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];et(t,e)&&o.push(e)}return pe(o)}})(),se=(()=>{const t=b(),e=b();return(s,r)=>Jt(s.getPlane(t),r,s.getSlicePlane(e))})(),re=(()=>{const t=b();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=R(n,s),o=Math.abs(i);if(o>r&&!$(o,r))return;const c=Math.sqrt(r**2-i**2);if($(c,0)){const t=W();return N(n,s,t),new gt(t)}const u=W(),h=y(S(n));return a(u,s,h,i),new zt(u,c,h,e.getSlicePlane())}})();function ne(t,e){}function ie(t,e){const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return e;return me(ft(K(t.center),t.radius,K(e.center),e.radius),e.center[2])}function oe(t,e){}function ce(t,e){}function ue(t,e){}function ae(t,e){if(!X(t.center,e.center))return;const s=c(K(t.center),K(e.center));if($(s,0)&&$(t.radius,e.radius))return t;return me(ft(K(t.center),t.radius,K(e.center),e.radius),t.center[2])}function he(t,e){}function fe(t,e){}function le(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(Le(e))t.addIfOnTheGround(n,dt(s,e.point));else if(ke(e))t.addIfOnTheGround(n,ct(s,e.lineLike));else if(Pe(e))for(const[i,o]of tt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(ye(e)||qe(e))for(const[i,o]of ht(s,e.planeLike)){const t=r(i,o)??ve;n.push(M(i,o,t))}return pe(n)}function de(t){return ge(t.map((([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new Lt(s,r)})))}function pe(t){return ge(t.map((t=>t?new gt(Y(t)):void 0)))}function me(t,e){return pe(t.map((([t,s])=>[t,s,e])))}function ge(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new xt(e.filter(t))}function _e(t){return t instanceof xt}function Le(t){return t instanceof gt}function ke(t){return t instanceof _t}function xe(t){return t instanceof qt}function ye(t){return t instanceof jt}function Pe(t){return t instanceof yt}function ze(t){return t instanceof Pt}function Me(t){return t instanceof zt}function Te(t){return t instanceof Nt}function qe(t){return t instanceof Ut}function we(t){return t instanceof It}function je(t){return t instanceof Zt}const ve=0;export{zt as CircleConstraint,mt as Constraint,Zt as CoordinateConstraint,Ut as DrapedLineConstraint,It as GeodesicConstraint,Pt as HorizontalCircleConstraint,qt as HorizontalPlaneConstraint,Lt as LineConstraint,_t as LineLikeConstraint,gt as PointConstraint,kt as RayConstraint,xt as SetConstraint,Nt as SphereConstraint,yt as VerticalCylinderConstraint,Et as VerticalHalfPlaneConstraint,Rt as VerticalPlaneConstraint,jt as VerticalPlaneLikeConstraint,ge as constraintOrSet,Le as isPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as l}from"../../../core/quantityUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/unitUtils.js";import{v as u,h as c,I as p}from"../../../chunks/vec32.js";import{clone as f,ONES as m,create as d,UNIT_Z as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as U}from"../keybindings.js";import S from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new S(t());return o.addHandles(a((()=>t()),(({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)}))),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:l}=t,{transform:a}=o,s=T(a);e&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),e?(n.actual=i(H(a)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const n=M(t.orientation.actual),r=q(o.rotationAxis);if(null==n||null==r)return;const i=o.rotationAngle,l=n*r,a=(n-i)*r;i!==l&&(e?.onRotateStart(0),o.rotationAngle=l,e?.onRotate(a),e?.onRotateStop(a))}function P(t,o,e){const n=t.scale.actual?.value,r=H(o);if(null==n||n===r)return;const{scale:i}=o;let l;if(0===r)l=f(m);else{const t=n/r;l=c(d(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=l,e?.onScale(l[0],l[1],l[2]),e?.onScaleStop(l[0],l[1],l[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:l,y:a,z:s}=I(t,o.spatialReference);return{dx:null==l||n(l,e)?0:l-e,dy:null==a||n(a,r)?0:a-r,dz:null==s||null==i||n(s,i)?0:s-i}}function I(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,E):null!=e?e=h(e,0,E)[0]:null!=n&&(n=h(0,n,E)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?l(r,i):void 0}}const E=[0,0];function T(t){if(!t)return 0;const o=q(t.rotationAxis);return null!=o?o*t.rotationAngle:null}function q(t){return p(t,g)?1:p(t,B)?-1:null}const B=u(d(),g);function H(t){return t?Math.max(...t.scale):1}function O(t,o){return!("key-down"!==t.type||t.key!==U.enterInputMode||!o||!C(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function C(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some((({name:t})=>"x"===t||"y"===t?n.coordinates:n[t]))}function G(n,r){let i=null;return o([n.on("paste",(async o=>{i?.abort(),i=t((async()=>{y()||await v(),J(o,n.info,r)}))})),t((()=>v())),e((()=>i?.abort()))])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r((()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)}))}else{const t=A(n);t&&r((()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)}))}}export{G as connectPasteEvent,O as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
5
+ import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as l}from"../../../core/quantityUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/unitUtils.js";import{v as u,h as c,H as p}from"../../../chunks/vec32.js";import{clone as f,ONES as m,create as d,UNIT_Z as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as U}from"../keybindings.js";import S from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new S(t());return o.addHandles(a((()=>t()),(({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)}))),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:l}=t,{transform:a}=o,s=I(a);e&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),e?(n.actual=i(B(a)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const n=M(t.orientation.actual),r=T(o.rotationAxis);if(null==n||null==r)return;const i=o.rotationAngle,l=n*r,a=(n-i)*r;i!==l&&(e?.onRotateStart(0),o.rotationAngle=l,e?.onRotate(a),e?.onRotateStop(a))}function P(t,o,e){const n=t.scale.actual?.value,r=B(o);if(null==n||n===r)return;const{scale:i}=o;let l;if(0===r)l=f(m);else{const t=n/r;l=c(d(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=l,e?.onScale(l[0],l[1],l[2]),e?.onScaleStop(l[0],l[1],l[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:l,y:a,z:s}=E(t,o.spatialReference);return{dx:null==l||n(l,e)?0:l-e,dy:null==a||n(a,r)?0:a-r,dz:null==s||null==i||n(s,i)?0:s-i}}function E(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,H):null!=e?e=h(e,0,H)[0]:null!=n&&(n=h(0,n,H)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?l(r,i):void 0}}const H=[0,0];function I(t){if(!t)return 0;const o=T(t.rotationAxis);return null!=o?o*t.rotationAngle:null}function T(t){return p(t,g)?1:p(t,q)?-1:null}const q=u(d(),g);function B(t){return t?Math.max(...t.scale):1}function O(t,o){return!("key-down"!==t.type||t.key!==U.enterInputMode||!o||!C(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function C(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some((({name:t})=>"x"===t||"y"===t?n.coordinates:n[t]))}function G(n,r){let i=null;return o([n.on("paste",(async o=>{i?.abort(),i=t((async()=>{y()||await v(),J(o,n.info,r)}))})),t((()=>v())),e((()=>i?.abort()))])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r((()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)}))}else{const t=A(n);t&&r((()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)}))}}export{G as connectPasteEvent,O as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,squaredLength as r,dot as s,scaleAndAdd as e,sub as o,length as c,distance as i,squaredDistance as u,lerp as a,set as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as L}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as h,a as A,f as d,b as l,j as E,e as N,H as y,c as P,d as b,z as j}from"../../chunks/vec32.js";import{create as M,clone as I}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as R}from"../../core/libs/gl-matrix-2/math/common.js";import{create as Y,fromPositionAndNormal as g,distance as x,intersectLine as v,isPointInside as H}from"../../geometry/support/plane.js";import{tangentFrame as q}from"../3d/support/mathUtils.js";import{LineType as F,intersectLineLikeAndCircle as _}from"./geometry2dUtils.js";function U({start:t,end:o,type:c},i,u){const a=[],f=n(et,o,t),m=n(ot,t,i),L=r(f),h=2*s(f,m),A=h*h-4*L*(r(m)-u*u);if(0===A){const n=-h/(2*L);(c===rt.PLANE||n>=0)&&a.push(e(p(),t,f,n))}else if(A>0){const n=Math.sqrt(A),r=(-h+n)/(2*L);(c===rt.PLANE||r>=0)&&a.push(e(p(),t,f,r));const s=(-h-n)/(2*L);(c===rt.PLANE||s>=0)&&a.push(e(p(),t,f,s))}return a}function k(t,r){const e=t.start,c=t.end,i=n(et,c,e),u=h(it,-i[1],i[0],0),a=r.start,f=r.end,p=A(ut,f,a),m=d(p,u),L=h(at,e[0],e[1],0),E=A(ft,L,a),N=d(E,u),y=R();if(Math.abs(m)<y)return Math.abs(N),[];const P=l(pt,a,p,N/m);if(r.type===F.RAY){const t=A(mt,P,a);if(d(t,p)<-y)return[]}if(t.type===rt.HALF_PLANE){const t=o(ot,P,e);if(s(t,i)<-y)return[]}return[I(P)]}function w(t,n){return T(X(ht,n[2],t),n)}function z(t,n){const r=0;return S(X(ht,r,t),X(At,r,n)).map((([t,n])=>m(t,n)))}function C(t,n,r){return J(t,X(ht,t[2],n),r)}function B(t,n){return K(X(ht,t[2],n),t)}function D(t,r,s,o=M()){const i=n(et,t,r),u=c(i);return e(o,r,i,0===u?1:s/u),o[2]=t[2],o}function G(t,n,r){return i(t,n)-r}function J(t,{start:n,end:r,type:s},e=M()){const o=A(ct,t,n),c=A(it,r,n),i=d(o,c)/d(c,c);return l(e,n,c,s===F.RAY?Math.max(i,0):i)}function K({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t);if(r===F.RAY&&d(o,e)<-R())return E(t,s);const c=N(ut,o,e);return y(c)/y(o)}const O=(()=>{const t=M(),n=M(),r=M();return({start:s,end:e},{center:o,radius:c,normal:i,slicePlane:u})=>{const a=g(o,i,Lt);if($(x(a,s),0)&&$(x(a,e),0)){q(i,t,n);const a=(s,e)=>(b(r,e,o),f(s,d(r,t),d(r,n)),s),p=_({start:a(et,s),end:a(ot,e),type:F.LINE},L,c),m=[];for(const[r,s]of p){const e=P(M(),o);l(e,e,t,r),l(e,e,n,s),u&&!nt(u,e)||m.push(e)}return m}const p=M();return v(a,s,e,p)?!$(E(p,o),c)||u&&!nt(u,p)?[]:[p]:[]}})();function Q({start:t,end:e,type:o},c,i){const u=[],a=b(ct,e,t),f=n(ot,t,c),p=r(a),m=2*s(a,f),L=m*m-4*p*(r(f)-i*i);if(0===L){const n=-m/(2*p);(o===F.LINE||n>=0)&&u.push(l(M(),t,a,n))}else if(L>0){const n=Math.sqrt(L),r=(-m+n)/(2*p);(o===F.LINE||r>=0)&&u.push(l(M(),t,a,r));const s=(-m-n)/(2*p);(o===F.LINE||s>=0)&&u.push(l(M(),t,a,s))}return u}function S(t,n){const r=t.start,s=t.end,e=n.start,o=n.end,c=A(ct,s,r),i=A(it,o,e),u=A(ut,e,r),a=N(at,c,i);if(!$(d(u,a),0))return[];const f=j(a);if($(f,0))return[];const p=N(ft,u,i),m=d(p,a)/f,L=l(pt,r,c,m);if(t.type===F.RAY){const t=A(mt,L,r);if(d(c,t)<-R())return[]}if(n.type===F.RAY){const t=A(mt,L,e);if(d(i,t)<-R())return[]}return[I(L)]}function T({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t),c=N(ut,o,e),i=j(c)/j(o),u=R();if(i<u)switch(r){case F.LINE:return[I(s)];case F.RAY:return d(o,e)<-u?[]:[I(s)]}return[]}function V(t,n,r){return $(u(r,t),n*n)?[I(r)]:[]}function W(t,n,r,s){const[e,o]=t,[c,i]=r,u=c-e,f=i-o,p=u*u+f*f,L=Math.sqrt(p);if(L>n+s)return[];if(L<Math.abs(n-s))return[];if($(L,0)&&$(n,s))return[];const h=(n*n-s*s+p)/(2*L),A=Math.sqrt(n*n-h*h),d=A*f/L,l=A*u/L,[E,N]=a(et,t,r,h/L);return $(d,l)?[m(E,N)]:[m(E+d,N-l),m(E-d,N+l)]}function X(t,n,{start:r,end:s,type:e}){return h(t.start,r[0],r[1],n),h(t.end,s[0],s[1],n),t.type=st[e],t}function Z(t,n){return $(t[2],n[2])}function $(n,r){return t(Math.abs(n-r),0,R())}function tt(t,n){return n.filter((n=>nt(t,n)))}function nt(t,n){return H(t,n)}var rt;!function(t){t[t.PLANE=0]="PLANE",t[t.HALF_PLANE=1]="HALF_PLANE"}(rt||(rt={}));const st={[rt.PLANE]:F.LINE,[rt.HALF_PLANE]:F.RAY},et=p(),ot=p(),ct=M(),it=M(),ut=M(),at=M(),ft=M(),pt=M(),mt=M(),Lt=Y(),ht={start:M(),end:M(),type:F.LINE},At={start:M(),end:M(),type:F.LINE};export{F as LineType,rt as VerticalPlaneType,T as intersectLineAndPoint,O as intersectLineLikeAndCircle,Q as intersectLineLikeAndVerticalCylinder,S as intersectLineLikes,V as intersectVerticalCylinderAndPoint,W as intersectVerticalCylinders,k as intersectVerticalPlaneAndLineLike,w as intersectVerticalPlaneAndPoint,U as intersectVerticalPlaneAndVerticalCylinder,z as intersectVerticalPlanes,$ as isClose,nt as isPointInsidePlane,K as pointToLineLikeDistance,G as pointToVerticalCylinderDistance,B as pointToVerticalPlaneDistance,tt as pointsInsidePlane,J as projectPointToLineLike,D as projectPointToVerticalCylinder,C as projectPointToVerticalPlane,Z as vectorsHaveCloseZ};
5
+ import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,squaredLength as r,dot as s,scaleAndAdd as e,sub as o,length as c,distance as i,squaredDistance as u,lerp as a,set as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as L}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as h,a as A,f as d,b as l,j as E,e as N,I as y,c as P,d as b,z as j}from"../../chunks/vec32.js";import{create as I,clone as M}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as R}from"../../core/libs/gl-matrix-2/math/common.js";import{create as Y,fromPositionAndNormal as g,distance as x,intersectLine as v,isPointInside as q}from"../../geometry/support/plane.js";import{tangentFrame as F}from"../3d/support/mathUtils.js";import{LineType as H,intersectLineLikeAndCircle as _}from"./geometry2dUtils.js";function U({start:t,end:o,type:c},i,u){const a=[],f=n(et,o,t),m=n(ot,t,i),L=r(f),h=2*s(f,m),A=h*h-4*L*(r(m)-u*u);if(0===A){const n=-h/(2*L);(c===rt.PLANE||n>=0)&&a.push(e(p(),t,f,n))}else if(A>0){const n=Math.sqrt(A),r=(-h+n)/(2*L);(c===rt.PLANE||r>=0)&&a.push(e(p(),t,f,r));const s=(-h-n)/(2*L);(c===rt.PLANE||s>=0)&&a.push(e(p(),t,f,s))}return a}function k(t,r){const e=t.start,c=t.end,i=n(et,c,e),u=h(it,-i[1],i[0],0),a=r.start,f=r.end,p=A(ut,f,a),m=d(p,u),L=h(at,e[0],e[1],0),E=A(ft,L,a),N=d(E,u),y=R();if(Math.abs(m)<y)return Math.abs(N),[];const P=l(pt,a,p,N/m);if(r.type===H.RAY){const t=A(mt,P,a);if(d(t,p)<-y)return[]}if(t.type===rt.HALF_PLANE){const t=o(ot,P,e);if(s(t,i)<-y)return[]}return[M(P)]}function w(t,n){return T(X(ht,n[2],t),n)}function z(t,n){const r=0;return S(X(ht,r,t),X(At,r,n)).map((([t,n])=>m(t,n)))}function C(t,n,r){return J(t,X(ht,t[2],n),r)}function B(t,n){return K(X(ht,t[2],n),t)}function D(t,r,s,o=I()){const i=n(et,t,r),u=c(i);return e(o,r,i,0===u?1:s/u),o[2]=t[2],o}function G(t,n,r){return i(t,n)-r}function J(t,{start:n,end:r,type:s},e=I()){const o=A(ct,t,n),c=A(it,r,n),i=d(o,c)/d(c,c);return l(e,n,c,s===H.RAY?Math.max(i,0):i)}function K({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t);if(r===H.RAY&&d(o,e)<-R())return E(t,s);const c=N(ut,o,e);return y(c)/y(o)}const O=(()=>{const t=I(),n=I(),r=I();return({start:s,end:e},{center:o,radius:c,normal:i,slicePlane:u})=>{const a=g(o,i,Lt);if($(x(a,s),0)&&$(x(a,e),0)){F(i,t,n);const a=(s,e)=>(b(r,e,o),f(s,d(r,t),d(r,n)),s),p=_({start:a(et,s),end:a(ot,e),type:H.LINE},L,c),m=[];for(const[r,s]of p){const e=P(I(),o);l(e,e,t,r),l(e,e,n,s),u&&!nt(u,e)||m.push(e)}return m}const p=I();return v(a,s,e,p)?!$(E(p,o),c)||u&&!nt(u,p)?[]:[p]:[]}})();function Q({start:t,end:e,type:o},c,i){const u=[],a=b(ct,e,t),f=n(ot,t,c),p=r(a),m=2*s(a,f),L=m*m-4*p*(r(f)-i*i);if(0===L){const n=-m/(2*p);(o===H.LINE||n>=0)&&u.push(l(I(),t,a,n))}else if(L>0){const n=Math.sqrt(L),r=(-m+n)/(2*p);(o===H.LINE||r>=0)&&u.push(l(I(),t,a,r));const s=(-m-n)/(2*p);(o===H.LINE||s>=0)&&u.push(l(I(),t,a,s))}return u}function S(t,n){const r=t.start,s=t.end,e=n.start,o=n.end,c=A(ct,s,r),i=A(it,o,e),u=A(ut,e,r),a=N(at,c,i);if(!$(d(u,a),0))return[];const f=j(a);if($(f,0))return[];const p=N(ft,u,i),m=d(p,a)/f,L=l(pt,r,c,m);if(t.type===H.RAY){const t=A(mt,L,r);if(d(c,t)<-R())return[]}if(n.type===H.RAY){const t=A(mt,L,e);if(d(i,t)<-R())return[]}return[M(L)]}function T({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t),c=N(ut,o,e),i=j(c)/j(o),u=R();if(i<u)switch(r){case H.LINE:return[M(s)];case H.RAY:return d(o,e)<-u?[]:[M(s)]}return[]}function V(t,n,r){return $(u(r,t),n*n)?[M(r)]:[]}function W(t,n,r,s){const[e,o]=t,[c,i]=r,u=c-e,f=i-o,p=u*u+f*f,L=Math.sqrt(p);if(L>n+s)return[];if(L<Math.abs(n-s))return[];if($(L,0)&&$(n,s))return[];const h=(n*n-s*s+p)/(2*L),A=Math.sqrt(n*n-h*h),d=A*f/L,l=A*u/L,[E,N]=a(et,t,r,h/L);return $(d,l)?[m(E,N)]:[m(E+d,N-l),m(E-d,N+l)]}function X(t,n,{start:r,end:s,type:e}){return h(t.start,r[0],r[1],n),h(t.end,s[0],s[1],n),t.type=st[e],t}function Z(t,n){return $(t[2],n[2])}function $(n,r){return t(Math.abs(n-r),0,R())}function tt(t,n){return n.filter((n=>nt(t,n)))}function nt(t,n){return q(t,n)}var rt;!function(t){t[t.PLANE=0]="PLANE",t[t.HALF_PLANE=1]="HALF_PLANE"}(rt||(rt={}));const st={[rt.PLANE]:H.LINE,[rt.HALF_PLANE]:H.RAY},et=p(),ot=p(),ct=I(),it=I(),ut=I(),at=I(),ft=I(),pt=I(),mt=I(),Lt=Y(),ht={start:I(),end:I(),type:H.LINE},At={start:I(),end:I(),type:H.LINE};export{H as LineType,rt as VerticalPlaneType,T as intersectLineAndPoint,O as intersectLineLikeAndCircle,Q as intersectLineLikeAndVerticalCylinder,S as intersectLineLikes,V as intersectVerticalCylinderAndPoint,W as intersectVerticalCylinders,k as intersectVerticalPlaneAndLineLike,w as intersectVerticalPlaneAndPoint,U as intersectVerticalPlaneAndVerticalCylinder,z as intersectVerticalPlanes,$ as isClose,nt as isPointInsidePlane,K as pointToLineLikeDistance,G as pointToVerticalCylinderDistance,B as pointToVerticalPlaneDistance,tt as pointsInsidePlane,J as projectPointToLineLike,D as projectPointToVerticalCylinder,C as projectPointToVerticalPlane,Z as vectorsHaveCloseZ};