@arcgis/core 4.34.0-next.64 → 4.34.0-next.66

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 (260) hide show
  1. package/Graphic.js +1 -1
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/05016b0713ef760fc57d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{861a6d6fe7958df36aa1.js → 06ff5f34ad9bdf9705de.js} +49 -40
  6. package/assets/esri/core/workers/chunks/{eadac757f74470b89a36.js → 0952aeddddc16705b7a3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/09dd8613bc03e7a3a4cb.js +1 -0
  8. package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/117eb1422e9795d37ea3.js +1 -0
  10. package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/16fe21ca9b24eaee3069.js +1 -0
  12. package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
  13. package/assets/esri/core/workers/chunks/{e72aee3f857aa473822c.js → 1c7b5ca80e80c314f78d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2a938096a42613425c7b.js +1 -0
  16. package/assets/esri/core/workers/chunks/31e7358fe802abb3f8db.js +1 -0
  17. package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
  18. package/assets/esri/core/workers/chunks/3bc50ee639a4d16c4f80.js +1 -0
  19. package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 44031bef6d500167ef0b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 481aea82501d04667ba2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.js → 4be2bab8ff3bd14ffdfb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/4f0f6653b8e92c633d14.js +1 -0
  25. package/assets/esri/core/workers/chunks/4fda6e90822bc0198b28.js +2 -0
  26. package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
  27. package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
  28. package/assets/esri/core/workers/chunks/60920d4856a011ace7e2.js +1 -0
  29. package/assets/esri/core/workers/chunks/66cb5b294d7f251c2cc8.js +1 -0
  30. package/assets/esri/core/workers/chunks/66ffefd46fe6175c2af4.js +1 -0
  31. package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
  32. package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → 707311e24b2f458d9209.js} +1 -1
  33. package/assets/esri/core/workers/chunks/7a17e78c76076ed4476f.js +1 -0
  34. package/assets/esri/core/workers/chunks/7e95896ac41c7e2ca26a.js +1 -0
  35. package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
  36. package/assets/esri/core/workers/chunks/88b8f33ce1cbf8a0f855.js +33 -0
  37. package/assets/esri/core/workers/chunks/8f60804c7ba445f25df8.js +1 -0
  38. package/assets/esri/core/workers/chunks/9a6d359ead62a8eadd3c.js +1 -0
  39. package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 9e3f8c06b4e090a35710.js} +1 -1
  40. package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
  41. package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.js} +1 -1
  42. package/assets/esri/core/workers/chunks/ad7aa7d09bfceb12609e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
  44. package/assets/esri/core/workers/chunks/af1030e4c4437d4eb600.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
  46. package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → c20aead85cdea91c4b74.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.js} +1 -1
  50. package/assets/esri/core/workers/chunks/dcad3dcbd4ea2f5a6a04.js +1 -0
  51. package/assets/esri/core/workers/chunks/e0fe6bb51ecc9b2faf69.js +1 -0
  52. package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
  53. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
  54. package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
  55. package/assets/esri/core/workers/chunks/f5101f5f93f776a6456f.js +1 -0
  56. package/assets/esri/themes/base/widgets/_Attribution.scss +0 -1
  57. package/assets/esri/themes/dark/main.css +1 -1
  58. package/assets/esri/themes/light/main.css +1 -1
  59. package/assets/esri/themes/light/view.css +1 -1
  60. package/chunks/ComponentShader.glsl.js +1 -1
  61. package/chunks/DefaultMaterial.glsl.js +2 -2
  62. package/chunks/Fog.glsl.js +2 -2
  63. package/chunks/{BloomBlur.glsl.js → GlowBlur.glsl.js} +5 -5
  64. package/chunks/GlowComposition.glsl.js +41 -0
  65. package/chunks/Path.glsl.js +1 -1
  66. package/chunks/RealisticTree.glsl.js +18 -15
  67. package/config.js +1 -1
  68. package/core/AsyncUpdate.js +1 -1
  69. package/core/mapCollectionUtils.js +1 -1
  70. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  71. package/geometry/Polygon.js +1 -1
  72. package/geometry/support/centroid.js +1 -1
  73. package/geometry/support/geometryUtils.js +1 -1
  74. package/graphic/AggregateGraphicOrigin.js +1 -1
  75. package/graphic/BuildingGraphicOrigin.js +1 -1
  76. package/graphic/CSVGraphicOrigin.js +1 -1
  77. package/graphic/CatalogGraphicOrigin.js +1 -1
  78. package/graphic/FeatureGraphicOrigin.js +1 -1
  79. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  80. package/graphic/GeoRSSGraphicOrigin.js +1 -1
  81. package/graphic/ImageryGraphicOrigin.js +1 -1
  82. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  83. package/graphic/KMLGraphicOrigin.js +1 -1
  84. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  85. package/graphic/LinkChartGraphicOrigin.js +1 -1
  86. package/graphic/MapImageGraphicOrigin.js +1 -1
  87. package/graphic/MapNotesGraphicOrigin.js +1 -1
  88. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  89. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  90. package/graphic/ParquetGraphicOrigin.js +1 -1
  91. package/graphic/PointCloudGraphicOrigin.js +1 -1
  92. package/graphic/SceneGraphicOrigin.js +1 -1
  93. package/graphic/StreamGraphicOrigin.js +1 -1
  94. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  95. package/graphic/TileGraphicOrigin.js +1 -1
  96. package/graphic/TrackGraphicOrigin.js +1 -1
  97. package/graphic/VectorTileGraphicOrigin.js +1 -1
  98. package/graphic/VoxelGraphicOrigin.js +1 -1
  99. package/graphic/WCSGraphicOrigin.js +1 -1
  100. package/graphic/WFSGraphicOrigin.js +1 -1
  101. package/graphic/getIdFieldsProvider.js +5 -0
  102. package/graphic/getSliceableContainer.js +5 -0
  103. package/graphic/graphicOrigins.d.ts +0 -2
  104. package/graphic/graphicOrigins.js +1 -1
  105. package/interfaces.d.ts +141 -60
  106. package/kernel.js +1 -1
  107. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  108. package/layers/IntegratedMeshLayer.js +1 -1
  109. package/layers/LinkChartLayer.js +1 -1
  110. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  111. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  112. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  113. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  114. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  115. package/package.json +1 -1
  116. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  117. package/support/revision.js +1 -1
  118. package/symbols/support/previewCIMSymbol.js +1 -1
  119. package/symbols/support/previewSymbol2D.js +1 -1
  120. package/symbols/support/renderUtils.js +1 -1
  121. package/symbols/support/svgUtils.js +1 -1
  122. package/symbols/support/symbolUtils.js +1 -1
  123. package/symbols/support/utils.js +1 -1
  124. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
  125. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
  126. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
  127. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  128. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  129. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
  130. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
  131. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
  132. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  133. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  134. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  135. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  136. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  137. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  138. package/views/3d/environment/Fog.js +1 -1
  139. package/views/3d/environment/FogTechniqueConfiguration.js +1 -1
  140. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  141. package/views/3d/layers/I3SMeshView3D.js +1 -1
  142. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  143. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  144. package/views/3d/layers/SceneLayerView3D.js +1 -1
  145. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  146. package/views/3d/layers/i3s/Intersector.js +1 -1
  147. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  148. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
  149. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  150. package/views/3d/support/hitTest.js +1 -1
  151. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  152. package/views/3d/support/viewpointUtils.js +1 -1
  153. package/views/3d/terrain/Intersector.js +1 -1
  154. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  155. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  156. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentBVH.js +1 -1
  157. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  158. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  159. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  160. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  161. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  162. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  163. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
  164. package/views/3d/webgl-engine/effects/{bloom/BloomBlur.glsl.js → glow/GlowBlur.glsl.js} +1 -1
  165. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +5 -0
  166. package/views/3d/webgl-engine/effects/{bloom/BloomBlurTechniqueConfiguration.js → glow/GlowBlurTechniqueConfiguration.js} +1 -1
  167. package/views/3d/webgl-engine/effects/{bloom/BloomComposition.glsl.js → glow/GlowComposition.glsl.js} +1 -1
  168. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +5 -0
  169. package/views/3d/webgl-engine/effects/{bloom/BloomCompositionTechniqueConfiguration.js → glow/GlowCompositionTechniqueConfiguration.js} +1 -1
  170. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +5 -0
  171. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +5 -0
  172. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  173. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +8 -2
  174. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  175. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  176. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  177. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  178. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  179. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  180. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  181. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  182. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  184. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  185. package/views/View2D.js +1 -1
  186. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
  187. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  188. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  189. package/views/analysis/ElevationProfile/constants.js +1 -1
  190. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
  191. package/views/draw/support/createUtils.js +1 -1
  192. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  193. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  194. package/widgets/Legend/styles/card/CardView.js +1 -1
  195. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  196. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  197. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  198. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  199. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  200. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  201. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  202. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  203. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  204. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  205. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  206. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  207. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  208. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  209. package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
  210. package/assets/esri/core/workers/chunks/0264905da9fa56166538.js +0 -1
  211. package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
  212. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +0 -1
  213. package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
  214. package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
  215. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
  216. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
  217. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
  218. package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
  219. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
  220. package/assets/esri/core/workers/chunks/5de07f7a09eb9f3ab666.js +0 -1
  221. package/assets/esri/core/workers/chunks/659f7e99b2d524ef53fb.js +0 -2
  222. package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
  223. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
  224. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
  225. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
  226. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
  227. package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
  228. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
  229. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
  230. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
  231. package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
  232. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
  233. package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
  234. package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
  235. package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
  236. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
  237. package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
  238. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
  239. package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
  240. package/assets/esri/core/workers/chunks/eacc7fccdc3fb670ac8f.js +0 -33
  241. package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
  242. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
  243. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
  244. package/chunks/BloomComposition.glsl.js +0 -41
  245. package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
  246. package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
  247. package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
  248. package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
  249. package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
  250. package/graphic/isIntegratedMeshGraphicOrigin.js +0 -5
  251. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
  252. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
  253. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
  254. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
  255. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +0 -5
  256. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +0 -5
  257. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +0 -5
  258. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +0 -5
  259. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +0 -5
  260. /package/assets/esri/core/workers/chunks/{659f7e99b2d524ef53fb.js.LICENSE.txt → 4fda6e90822bc0198b28.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../core/arrayUtils.js";import n from"../DimensionalDefinition.js";function t(e,n,i){const a=n.shift();if(0===i.length){const e=[];i.push({sliceId:-1,multidimensionalDefinition:e})}const s=i.length;for(let t=0;t<s;t++){const n=i.shift().multidimensionalDefinition;a.values?.forEach(t=>{i.push({sliceId:-1,multidimensionalDefinition:[...n,{variableName:e,dimensionName:a.name,values:[t]}]})})}n.length&&t(e,n,i)}function i(e,n){const i=[];let a=0;return(n?e.variables.filter(e=>e.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((e,n)=>e.name>n.name?1:-1)).forEach(e=>{const n=[],s=[...e.dimensions].sort((e,n)=>e.name>n.name?-1:1);t(e.name,s,n),n.forEach(e=>{i.push({...e,sliceId:a++})})}),i}function a(e,n,t){let i=e;if(n&&(n=[...n].sort((e,n)=>e.dimensionName<n.dimensionName?-1:1)).forEach(({dimensionName:e,values:n,isSlice:t})=>{n.length&&(i=i.filter(i=>{const a=i.multidimensionalDefinition.find(n=>n.dimensionName===e);if(null==a)return!1;const s=a.values[0];return"number"==typeof s?"number"==typeof n[0]?n.includes(s):n.some(e=>e[0]<=s&&e[1]>=s):"number"==typeof n[0]?n.some(e=>s[0]<=e&&s[1]>=e):t?n.some(e=>e[0]===s[0]&&e[0]===s[1]):n.some(e=>e[0]>=s[0]&&e[0]<=s[1]||e[1]>=s[0]&&e[1]<=s[1]||e[0]<s[0]&&e[1]>s[1])}))}),i.length&&null!=t?.start&&null!=t.end){const e=t.start.getTime(),n=t.end.getTime(),a=i[0].multidimensionalDefinition.findIndex(e=>"StdTime"===e.dimensionName);a>-1&&(i=i.filter(t=>{const i=t.multidimensionalDefinition[a].values[0];return e<=i&&n>=i}))}return i.map(e=>e.sliceId)}function s(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function l(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function r(e){return 1===e.length?[e[0],e[0]]:[e[0],e[e.length-1]]}function u(e,n,t){if(!n?.subsetDefinitions?.length)return e;let i;if(t){const{variables:a}=n;if(a.length&&!a.includes(t))return null;const s=n.subsetDefinitions.find(n=>n.dimensionName===e.name&&n.variableName===t);if(!s?.values?.length)return e;i=r(s.values)}else{const t=n.dimensions.find(({name:n})=>n===e.name);i=t?.extent}const a=i;if(!a?.length)return e;const l=e.values.filter(e=>s(e,a));return{...e,extent:[...a],values:l}}function o(e,n,t){if(!n?.subsetDefinitions?.length)return!1;const{variables:i}=n;if(i.length&&e.some(({variableName:e})=>e&&!i.includes(e)))return!0;for(let a=0;a<e.length;a++){const i=e[a],u=n.subsetDefinitions.find(e=>(""===i.variableName||e.variableName===i.variableName)&&e.dimensionName===i.dimensionName);if(u?.values.length){const e=r(u.values);if(!i.isSlice&&2===i.values.length&&!Array.isArray(i.values[0])&&i.values[0]!==i.values[1]&&t){if(!l(i.values,e))return!0}else if(i.values.some(n=>!s(n,e)))return!0}}return!1}function m(e,n){if(null==e)return{isOutside:!1};const{geometry:t,timeExtent:i,multidimensionalDefinition:a}=n;let s=null;if(null!=i&&(s=c(e,i),null==s))return{isOutside:!0};const{areaOfInterest:l}=e;if(l&&t){const e="point"===t.type?t:"extent"===t.type?t.center:"polygon"===t.type?t.centroid:null;if(e&&!l.contains(e))return{isOutside:!0}}return null!=a&&a.length&&o(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:t,timeExtent:s,multidimensionalDefinition:a}}}function c(e,t){const i=e.dimensions.find(({name:e})=>"StdTime"===e);if(null==i||null==t.start&&null==t.end)return t;t=t.clone();const{start:a,end:s}=t.toJSON(),l=a===s?[a]:null!=a&&null!=s?[a,s]:[a??s];if(2===l.length&&i?.extent.length&&(l[0]=Math.max(l[0],i.extent[0]),l[1]=Math.min(l[1],i.extent[1]??i.extent[0]),l[1]<l[0]))return null;return o([new n({variableName:"",dimensionName:"StdTime",isSlice:1===l.length,values:l})],e,!0)?null:(t.start=new Date(l[0]),t.end=new Date(l[1]??l[0]),t)}function f(e){const{rasterInfo:n,multidimensionalSubset:t}=e,{multidimensionalInfo:i}=n;if(null==i)return null;let a=e.multidimensionalDefinition?.length?e.multidimensionalDefinition:h(n,{multidimensionalSubset:t});if(!a?.length)return null;if(a.some(e=>!e.dimensionName)){const{variableName:e}=a[0],i=h(n,{multidimensionalSubset:t,variableName:e});i?.forEach(e=>{const n=a?.find(({dimensionName:n})=>n===e.dimensionName);n?.values?.length&&(e.values=n.values,e.isSlice=n.isSlice)}),a=i}const{timeExtent:s}=e;if(null!=a&&null!=s&&(null!=s.start||null!=s.end)){a=a.map(e=>e.clone());const e=i.variables.find(({name:e})=>e===a[0].variableName)?.dimensions?.find(({name:e})=>"StdTime"===e),n=a.find(({dimensionName:e})=>"StdTime"===e);if(!e||!n)return null;const{start:t,end:l}=s,r=null==t?null:t.getTime(),u=null==l?null:l.getTime(),o=r??u,m=u??r;if(null!=e.values){const t=e.values.filter(e=>{if(Array.isArray(e)){if(o===m)return e[0]<=o&&e[1]>=o;const n=e[0]<=o&&e[1]>o||e[0]<m&&e[1]>=m,t=e[0]>=o&&e[1]<=m||e[0]<o&&e[1]>m;return n||t}return o===m?e===o:e>=o&&e<=m});if(t.length){const e=t.sort((e,n)=>{const t=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:e,a=Array.isArray(n)?n[0]:n,s=Array.isArray(n)?n[1]:n;if(o===m)return t-a;return Math.abs(i-m)-Math.abs(s-m)})[0];n.values=[e]}else a=null}else if(e.hasRegularIntervals&&e.extent){const[t,i]=e.extent;o>i||m<t?a=null:n.values=o===m?[o]:[Math.max(t,o),Math.min(i,m)]}}return null!=a&&o(a,t)?null:a}function d(e,n={}){const{multidimensionalInfo:t,keyProperties:i}=e;if(null==t)return null;const{variableName:a,multidimensionalSubset:s,multidimensionalDefinition:l}=n,r=null!=l?l[0]?.variableName:null,u=a||r||i?.DefaultVariable;let{variables:o}=t;s?.variables?.length&&(o=o.filter(({name:e})=>s.variables.includes(e)));return u?o.find(({name:e})=>e===u)??o[0]:o[0]}function h(e,t={}){const i=d(e,t);if(!i)return null;const a=[],{dimensions:s,name:l}=i;if(0===s.length)return[new n({variableName:l,dimensionName:"",values:[],isSlice:!0})];for(let r=0;r<s.length;r++){const e=u(s[r],t.multidimensionalSubset,l);if(!e)return null;const{values:i,extent:o}=e;let m=i?.[0]??o?.[0];"stdz"===e.name.toLowerCase()&&!e.hasRanges&&o&&Math.abs(o[1])<=Math.abs(o[0])&&(m=i?.length?i[i.length-1]:o[1]),a.push(new n({variableName:l,dimensionName:e.name,values:[m],isSlice:!t.useRangeForRangedDimensionInfo||!!e.hasRanges}))}return a}function g(e){return!!e?.length&&e.some(e=>{if(null==e.values)return!0;const n=e.values.length;return 0===n||n>1||!e.isSlice&&Array.isArray(e.values[0])})}function v(n,t){if(null==t||null==n)return null;let i=t.variables.map(e=>({...e}));return n?.variables?.length&&(i=i.filter(({name:e})=>n.variables.includes(e)),i.forEach(t=>{t.dimensions=t.dimensions.map(e=>u(e,n,t.name)).filter(e)})),i}function b(e,n){const{values:t}=n;if(t?.length){const n=Array.isArray(t[0]),i=Array.isArray(e);return n!==i?-1:n&&i?t.findIndex(n=>n[0]===e[0]&&n[1]===e[1]):t.indexOf(e)}const{extent:i}=n;if(Array.isArray(e)||!i||e<i[0]||e>i[1])return-1;const a=n.interval||1;if("ISO8601"!==n.unit)return Math.round((e-i[0])/a);const s=i[0];let l=-1;switch(n.intervalUnit?.toLowerCase()||"days"){case"seconds":l=Math.round((e-s)/1e3/a);break;case"minutes":l=Math.round((e-s)/6e4/a);break;case"hours":l=Math.round((e-s)/36e5/a);break;case"days":l=Math.round((e-s)/864e5/a);break;case"months":{const n=new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear(),t=new Date(s).getUTCMonth(),i=new Date(e).getUTCMonth();l=0===n?i-t:i+11-t+12*(n-1)}break;case"years":l=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/a);break;case"decades":l=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/10/a)}return l}function y(e){let n=e.values?.length;if(n)return n;const{extent:t,unit:i}=e,a=e.interval||1,s=t?t[1]-t[0]:0;if("ISO8601"!==i)return Math.round(s/a);switch(e.intervalUnit?.toLowerCase()??"seconds"){case"seconds":n=Math.round(s/1e3/a);break;case"minutes":n=Math.round(s/6e4/a);break;case"hours":n=Math.round(s/36e5/a);break;case"days":n=Math.round(s/864e5/a);break;case"months":if(t){const e=new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear(),i=new Date(t[0]).getUTCMonth(),a=new Date(t[1]).getUTCMonth();n=0===e?a-i+1:a+11-i+12*(e-1)+1}else n=0;break;case"years":n=t?Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/a):0;break;case"decades":n=t?Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/10/a):0;break;default:n=0}return n}function D(e){if(2!==e.extent?.length||!e.interval)return[];const{extent:[n,t],interval:i}=e;if("ISO8601"===e.unit){const a=e.intervalUnit?.toLowerCase()??"days";return["decades","years","months","days","hours","minutes","seconds"].includes(a)?T(n,t,i,a):[]}const a=Math.round((t-n)/i);return Array.from({length:a},(e,s)=>s===a-1?t:n+s*i)}function T(e,n,t,i){const a=[];let s=e;const l=new Date(e);for(;s<=n;)switch(a.push(s),i){case"decades":l.setUTCFullYear(l.getUTCFullYear()+10*t),s=l.getTime();break;case"years":l.setUTCFullYear(l.getUTCFullYear()+t),s=l.getTime();break;case"months":l.setUTCMonth(l.getUTCMonth()+t),s=l.getTime();break;case"days":s+=864e5*t;break;case"hours":s+=36e5*t;break;case"minutes":s+=6e4*t;break;case"seconds":s+=1e3*t}return 1===a.length?a[1]=n:a[a.length-1]=n,a}function N(e,n){let t=0;const i=e[0].variableName,a=[...n.variables].sort((e,n)=>e.name>n.name?1:-1);for(let s=0;s<a.length;s++){const n=a[s],l=[...n.dimensions].sort((e,n)=>e.name>n.name?-1:1);if(n.name!==i){t+=l.map(e=>y(e)).reduce((e,n)=>e*n);continue}const r=l.map(e=>y(e)),u=l.length;for(let i=0;i<u;i++){const n=e.find(e=>e.dimensionName===l[i].name);if(null==n)return null;const a=b(n.values[0],l[i]);if(-1===a)return null;r.shift(),t+=i===u-1?a:a*r.reduce((e,n)=>e*n)}break}return t}function w(e){return Math.round(24*(e-25569)*3600*1e3)}export{w as convertOleDateTimeToEpoch,i as createSlices,h as getDefaultMultidimensionalDefinition,d as getDefaultVariableInfo,D as getDimensionValues,f as getEffectiveMultidimensionalDefinition,a as getSliceIds,N as getSliceIndex,v as getSubsetVariablesFromMdInfo,T as getTimeDimensionValues,o as hasExcludedVariableOrDimension,m as intersectMultimensionalSubset,g as isMultiSliceOrRangeDefinition};
5
+ import{isSome as e}from"../../../core/arrayUtils.js";import n from"../../../geometry/Point.js";import{polygonCentroidPoint as t}from"../../../geometry/support/centroid.js";import i from"../DimensionalDefinition.js";function a(e,n,t){const i=n.shift();if(0===t.length){const e=[];t.push({sliceId:-1,multidimensionalDefinition:e})}const s=t.length;for(let a=0;a<s;a++){const n=t.shift().multidimensionalDefinition;i.values?.forEach(a=>{t.push({sliceId:-1,multidimensionalDefinition:[...n,{variableName:e,dimensionName:i.name,values:[a]}]})})}n.length&&a(e,n,t)}function s(e,n){const t=[];let i=0;return(n?e.variables.filter(e=>e.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((e,n)=>e.name>n.name?1:-1)).forEach(e=>{const n=[],s=[...e.dimensions].sort((e,n)=>e.name>n.name?-1:1);a(e.name,s,n),n.forEach(e=>{t.push({...e,sliceId:i++})})}),t}function r(e,n,t){let i=e;if(n&&(n=[...n].sort((e,n)=>e.dimensionName<n.dimensionName?-1:1)).forEach(({dimensionName:e,values:n,isSlice:t})=>{n.length&&(i=i.filter(i=>{const a=i.multidimensionalDefinition.find(n=>n.dimensionName===e);if(null==a)return!1;const s=a.values[0];return"number"==typeof s?"number"==typeof n[0]?n.includes(s):n.some(e=>e[0]<=s&&e[1]>=s):"number"==typeof n[0]?n.some(e=>s[0]<=e&&s[1]>=e):t?n.some(e=>e[0]===s[0]&&e[0]===s[1]):n.some(e=>e[0]>=s[0]&&e[0]<=s[1]||e[1]>=s[0]&&e[1]<=s[1]||e[0]<s[0]&&e[1]>s[1])}))}),i.length&&null!=t?.start&&null!=t.end){const e=t.start.getTime(),n=t.end.getTime(),a=i[0].multidimensionalDefinition.findIndex(e=>"StdTime"===e.dimensionName);a>-1&&(i=i.filter(t=>{const i=t.multidimensionalDefinition[a].values[0];return e<=i&&n>=i}))}return i.map(e=>e.sliceId)}function l(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function u(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function o(e){return 1===e.length?[e[0],e[0]]:[e[0],e[e.length-1]]}function m(e,n,t){if(!n?.subsetDefinitions?.length)return e;let i;if(t){const{variables:a}=n;if(a.length&&!a.includes(t))return null;const s=n.subsetDefinitions.find(n=>n.dimensionName===e.name&&n.variableName===t);if(!s?.values?.length)return e;i=o(s.values)}else{const t=n.dimensions.find(({name:n})=>n===e.name);i=t?.extent}const a=i;if(!a?.length)return e;const s=e.values.filter(e=>l(e,a));return{...e,extent:[...a],values:s}}function c(e,n,t){if(!n?.subsetDefinitions?.length)return!1;const{variables:i}=n;if(i.length&&e.some(({variableName:e})=>e&&!i.includes(e)))return!0;for(let a=0;a<e.length;a++){const i=e[a],s=n.subsetDefinitions.find(e=>(""===i.variableName||e.variableName===i.variableName)&&e.dimensionName===i.dimensionName);if(s?.values.length){const e=o(s.values);if(!i.isSlice&&2===i.values.length&&!Array.isArray(i.values[0])&&i.values[0]!==i.values[1]&&t){if(!u(i.values,e))return!0}else if(i.values.some(n=>!l(n,e)))return!0}}return!1}function f(e,n){if(null==e)return{isOutside:!1};const{geometry:t,timeExtent:i,multidimensionalDefinition:a}=n;let s=null;if(null!=i&&(s=h(e,i),null==s))return{isOutside:!0};const{areaOfInterest:r}=e;if(r&&t){const e=d(t);if(e&&!r.contains(e))return{isOutside:!0}}return null!=a&&a.length&&c(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:t,timeExtent:s,multidimensionalDefinition:a}}}function d(e){switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":{const i=t(e);return i?n.fromJSON(i):null}}return null}function h(e,n){const t=e.dimensions.find(({name:e})=>"StdTime"===e);if(null==t||null==n.start&&null==n.end)return n;n=n.clone();const{start:a,end:s}=n.toJSON(),r=a===s?[a]:null!=a&&null!=s?[a,s]:[a??s];if(2===r.length&&t?.extent.length&&(r[0]=Math.max(r[0],t.extent[0]),r[1]=Math.min(r[1],t.extent[1]??t.extent[0]),r[1]<r[0]))return null;return c([new i({variableName:"",dimensionName:"StdTime",isSlice:1===r.length,values:r})],e,!0)?null:(n.start=new Date(r[0]),n.end=new Date(r[1]??r[0]),n)}function g(e){const{rasterInfo:n,multidimensionalSubset:t}=e,{multidimensionalInfo:i}=n;if(null==i)return null;let a=e.multidimensionalDefinition?.length?e.multidimensionalDefinition:b(n,{multidimensionalSubset:t});if(!a?.length)return null;if(a.some(e=>!e.dimensionName)){const{variableName:e}=a[0],i=b(n,{multidimensionalSubset:t,variableName:e});i?.forEach(e=>{const n=a?.find(({dimensionName:n})=>n===e.dimensionName);n?.values?.length&&(e.values=n.values,e.isSlice=n.isSlice)}),a=i}const{timeExtent:s}=e;if(null!=a&&null!=s&&(null!=s.start||null!=s.end)){a=a.map(e=>e.clone());const e=i.variables.find(({name:e})=>e===a[0].variableName)?.dimensions?.find(({name:e})=>"StdTime"===e),n=a.find(({dimensionName:e})=>"StdTime"===e);if(!e||!n)return null;const{start:t,end:r}=s,l=null==t?null:t.getTime(),u=null==r?null:r.getTime(),o=l??u,m=u??l;if(null!=e.values){const t=e.values.filter(e=>{if(Array.isArray(e)){if(o===m)return e[0]<=o&&e[1]>=o;const n=e[0]<=o&&e[1]>o||e[0]<m&&e[1]>=m,t=e[0]>=o&&e[1]<=m||e[0]<o&&e[1]>m;return n||t}return o===m?e===o:e>=o&&e<=m});if(t.length){const e=t.sort((e,n)=>{const t=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:e,a=Array.isArray(n)?n[0]:n,s=Array.isArray(n)?n[1]:n;if(o===m)return t-a;return Math.abs(i-m)-Math.abs(s-m)})[0];n.values=[e]}else a=null}else if(e.hasRegularIntervals&&e.extent){const[t,i]=e.extent;o>i||m<t?a=null:n.values=o===m?[o]:[Math.max(t,o),Math.min(i,m)]}}return null!=a&&c(a,t)?null:a}function v(e,n={}){const{multidimensionalInfo:t,keyProperties:i}=e;if(null==t)return null;const{variableName:a,multidimensionalSubset:s,multidimensionalDefinition:r}=n,l=null!=r?r[0]?.variableName:null,u=a||l||i?.DefaultVariable;let{variables:o}=t;s?.variables?.length&&(o=o.filter(({name:e})=>s.variables.includes(e)));return u?o.find(({name:e})=>e===u)??o[0]:o[0]}function b(e,n={}){const t=v(e,n);if(!t)return null;const a=[],{dimensions:s,name:r}=t;if(0===s.length)return[new i({variableName:r,dimensionName:"",values:[],isSlice:!0})];for(let l=0;l<s.length;l++){const e=m(s[l],n.multidimensionalSubset,r);if(!e)return null;const{values:t,extent:u}=e;let o=t?.[0]??u?.[0];"stdz"===e.name.toLowerCase()&&!e.hasRanges&&u&&Math.abs(u[1])<=Math.abs(u[0])&&(o=t?.length?t[t.length-1]:u[1]),a.push(new i({variableName:r,dimensionName:e.name,values:[o],isSlice:!n.useRangeForRangedDimensionInfo||!!e.hasRanges}))}return a}function y(e){return!!e?.length&&e.some(e=>{if(null==e.values)return!0;const n=e.values.length;return 0===n||n>1||!e.isSlice&&Array.isArray(e.values[0])})}function D(n,t){if(null==t||null==n)return null;let i=t.variables.map(e=>({...e}));return n?.variables?.length&&(i=i.filter(({name:e})=>n.variables.includes(e)),i.forEach(t=>{t.dimensions=t.dimensions.map(e=>m(e,n,t.name)).filter(e)})),i}function N(e,n){const{values:t}=n;if(t?.length){const n=Array.isArray(t[0]),i=Array.isArray(e);return n!==i?-1:n&&i?t.findIndex(n=>n[0]===e[0]&&n[1]===e[1]):t.indexOf(e)}const{extent:i}=n;if(Array.isArray(e)||!i||e<i[0]||e>i[1])return-1;const a=n.interval||1;if("ISO8601"!==n.unit)return Math.round((e-i[0])/a);const s=i[0];let r=-1;switch(n.intervalUnit?.toLowerCase()||"days"){case"seconds":r=Math.round((e-s)/1e3/a);break;case"minutes":r=Math.round((e-s)/6e4/a);break;case"hours":r=Math.round((e-s)/36e5/a);break;case"days":r=Math.round((e-s)/864e5/a);break;case"months":{const n=new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear(),t=new Date(s).getUTCMonth(),i=new Date(e).getUTCMonth();r=0===n?i-t:i+11-t+12*(n-1)}break;case"years":r=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/a);break;case"decades":r=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/10/a)}return r}function T(e){let n=e.values?.length;if(n)return n;const{extent:t,unit:i}=e,a=e.interval||1,s=t?t[1]-t[0]:0;if("ISO8601"!==i)return Math.round(s/a);switch(e.intervalUnit?.toLowerCase()??"seconds"){case"seconds":n=Math.round(s/1e3/a);break;case"minutes":n=Math.round(s/6e4/a);break;case"hours":n=Math.round(s/36e5/a);break;case"days":n=Math.round(s/864e5/a);break;case"months":if(t){const e=new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear(),i=new Date(t[0]).getUTCMonth(),a=new Date(t[1]).getUTCMonth();n=0===e?a-i+1:a+11-i+12*(e-1)+1}else n=0;break;case"years":n=t?Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/a):0;break;case"decades":n=t?Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/10/a):0;break;default:n=0}return n}function w(e){if(2!==e.extent?.length||!e.interval)return[];const{extent:[n,t],interval:i}=e;if("ISO8601"===e.unit){const a=e.intervalUnit?.toLowerCase()??"days";return["decades","years","months","days","hours","minutes","seconds"].includes(a)?M(n,t,i,a):[]}const a=Math.round((t-n)/i);return Array.from({length:a},(e,s)=>s===a-1?t:n+s*i)}function M(e,n,t,i){const a=[];let s=e;const r=new Date(e);for(;s<=n;)switch(a.push(s),i){case"decades":r.setUTCFullYear(r.getUTCFullYear()+10*t),s=r.getTime();break;case"years":r.setUTCFullYear(r.getUTCFullYear()+t),s=r.getTime();break;case"months":r.setUTCMonth(r.getUTCMonth()+t),s=r.getTime();break;case"days":s+=864e5*t;break;case"hours":s+=36e5*t;break;case"minutes":s+=6e4*t;break;case"seconds":s+=1e3*t}return 1===a.length?a[1]=n:a[a.length-1]=n,a}function C(e,n){let t=0;const i=e[0].variableName,a=[...n.variables].sort((e,n)=>e.name>n.name?1:-1);for(let s=0;s<a.length;s++){const n=a[s],r=[...n.dimensions].sort((e,n)=>e.name>n.name?-1:1);if(n.name!==i){t+=r.map(e=>T(e)).reduce((e,n)=>e*n);continue}const l=r.map(e=>T(e)),u=r.length;for(let i=0;i<u;i++){const n=e.find(e=>e.dimensionName===r[i].name);if(null==n)return null;const a=N(n.values[0],r[i]);if(-1===a)return null;l.shift(),t+=i===u-1?a:a*l.reduce((e,n)=>e*n)}break}return t}function U(e){return Math.round(24*(e-25569)*3600*1e3)}export{U as convertOleDateTimeToEpoch,s as createSlices,b as getDefaultMultidimensionalDefinition,v as getDefaultVariableInfo,w as getDimensionValues,g as getEffectiveMultidimensionalDefinition,r as getSliceIds,C as getSliceIndex,D as getSubsetVariablesFromMdInfo,M as getTimeDimensionValues,c as hasExcludedVariableOrDimension,f as intersectMultimensionalSubset,y as isMultiSliceOrRangeDefinition};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.64",
3
+ "version": "4.34.0-next.66",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import a from"../../../core/Error.js";import{assertIsSome as r}from"../../../core/maybe.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{kebabDict as n}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as l}from"../../../layers/support/fieldUtils.js";import{getArcadeForPredominantCategory as u}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as m,uniqueValues as p,histogram as g,classBreaks as y}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as d}from"../../statistics/support/utils.js";import{WorkerClient as c}from"../../statistics/support/WorkerClient.js";import{getFieldsList as f,fieldDelimiter as h,isAnyDateField as w}from"../utils.js";import F from"./FeatureLayerAdapter.js";import{getMissingFieldsForBinning as S,updateQueryWithFeatureFilter as v,getFeatureReductionFields as q,getViewInfoParams as V,getDomainsForFields as z,getPredominantCategoriesFromUVInfos as N}from"./support/utils.js";let T=class extends F{constructor(){super(...arguments),this.adapterName="feature-layer-binning-adapter"}async _getNormalizationTotalFromMemory(e,t,r){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"queryAggregateSummaryStatistics"in o?await o.queryAggregateSummaryStatistics(n,{field:e,outStatisticTypes:l},{signal:r}):i?await this.workerClient.summaryStatistics({field:e},i):await m({attribute:{field:e,outStatisticTypes:l},features:s})).sum;if(null==u)throw new a(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _processStatsFromMemoryParams(e){const{features:t,filter:i}=e;if(t?.length)return this._getFilteredFeatures(t,i);const{view:s,field:o,field2:n,field3:l,normalizationField:u,valueExpression:m,returnGeometry:p,layerViewFunc:g,signal:y}=e;let d=null,c=null,h=null,w=null,F=null;if(s)try{if(d=await s.whenLayerView(this.layer),r(d),c=null!=g&&g in d&&"function"==typeof d[g],c){await this._waitForLayerViewUpdate(d);const e=await f({field:o,field2:n,field3:l,normalizationField:u,valueExpression:m});S(this,e).length?c=!1:(h="createAggregateQuery"in d?d.createAggregateQuery():null,h?(h.outFields=e,h.returnGeometry=!1,v(h,i)):c=!1),d.suspended&&(c=!1)}}catch{c=!1}if(!c&&(F=q(this.layer).map(e=>e.toJSON()),w=await this._fetchFeaturesForStats({field:o,field2:n,field3:l,valueExpression:m,normalizationField:u,returnGeometry:p,filter:i,view:s,signal:y},"json"),!w?.length))throw new a(`${this.adapterName}:insufficient-data`,"No features are available to calculate statistics");return{layerView:d,query:h,featuresJSON:w,fieldInfos:F}}async _summaryStatsFromMemory(e,t){const{view:a,field:r,valueExpression:i,normalizationType:s,signal:o}=e,l={field:r,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:u,graphics:p,layerView:g,query:y,fieldInfos:d}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateSummaryStatistics"});return i&&a&&(u||p)&&(l.fieldType=t?.type?n.toJSON(t.type):null,l.viewInfoParams=V(a),l.timeZone=a.timeZone,l.fieldInfos=d),"percent-of-total"===s&&null==e.normalizationTotal&&(l.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:u,graphics:p,layerView:g,query:y},o)),!u&&!p&&g&&"queryAggregateSummaryStatistics"in g?g.queryAggregateSummaryStatistics(y,l,{signal:o}):u?this.workerClient.summaryStatistics(l,u):m({attribute:l,features:p})}async _uvFromMemory(e,t){const{view:a,field:r,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:g}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateUniqueValues"}),y={field:r,field2:e.field2,field3:e.field3,fieldDelimiter:h,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&a&&(n||l)&&(y.viewInfoParams=V(a),y.timeZone=a.timeZone,y.fieldInfos=g),!n&&!l&&u&&"queryAggregateUniqueValues"in u?u.queryAggregateUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):p({attribute:y,features:l})}async _histogramFromMemory(e){const{view:t,field:a,valueExpression:r,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateHistogram"}),m={field:a,valueExpression:r,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numBins:e.numBins};return r&&t&&(s||o)&&(m.viewInfoParams=V(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryAggregateHistogram"in n?n.queryAggregateHistogram(l,m,{signal:i}):s?this.workerClient.histogram(m,s):g({attribute:m,features:o})}async _classBreaksFromMemory(e){const{view:t,field:a,valueExpression:r,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateClassBreaks"}),m={field:a,valueExpression:r,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return r&&t&&(s||o)&&(m.viewInfoParams=V(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryAggregateClassBreaks"in n?n.queryAggregateClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):y({attribute:m,features:o})}getField(e=""){const t=q(this.layer);return t?.find(t=>t.name.toLowerCase()===e?.toLowerCase())}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!1,supportsStatistics:!0}:null}getFieldDomain(e,t){return null}async summaryStatistics(e){const{field:t}=e,r=t?this.getField(t):null,i=w(r)||l(r),s=e.sqlExpression&&!e.valueExpression&&!t;if(i||s)throw new a(`${this.adapterName}:not-supported`,"Date field and sqlExpression are not supported");return this._summaryStatsFromMemory(e,r)}async uniqueValues(e){const t=await z(e,this);return this._uvFromMemory(e,t)}async histogram(e){const{field:t}=e,r=t?this.getField(t):null,i=w(r)||l(r),s=e.sqlExpression&&!e.valueExpression&&!t;if(i||s)throw new a(`${this.adapterName}:not-supported`,"Date field and sqlExpression are not supported");return this._histogramFromMemory(e)}async classBreaks(e){return(!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)).catch(()=>(i(e.signal),this._classBreaksFromMemory(e)))}async queryFeatureCount(e){const t=await(e.view?.whenLayerView(this.layer));if(!t||!("queryAggregateCount"in t)||!t.queryAggregateCount)throw new a(`${this.adapterName}:not-supported`,"LayerView is not supported.");await this._waitForLayerViewUpdate(t);const r=t.createAggregateQuery();return r.where=d(r.where,e.whereClause),v(r,e.filter),t.queryAggregateCount(r,{signal:e.signal})}generateRenderer(e,t){throw new a(`${this.adapterName}:not-supported`,"'generateRenderer' is not supported.")}heatmapStatistics(e){throw new a(`${this.adapterName}:not-supported`,"'heatmapStatistics' is not supported.")}async predominantCategories(e){const{fields:t,view:a,signal:r}=e,i=u(t),s=await this._uvFromMemory({valueExpression:i,view:a,signal:r});return N(s.uniqueValueInfos,t)}async getSampleFeatures(e,r){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e;if(!i)throw new a(`${this.adapterName}:not-supported`,"'view' is required to get sample features for binning.");if("3d"===i.type)throw new a(`${this.adapterName}:not-supported`,"3d 'view' is not supported to get sample features for binning.");const m=await i.whenLayerView(this.layer);if(!("queryAggregateJSON"in m&&m.queryAggregateJSON&&"queryAggregates"in m&&m.queryAggregates))throw new a(`${this.adapterName}:not-supported`,"LayerView is not supported.");await this._waitForLayerViewUpdate(m);if(S(this,o).length)throw new a(`${this.adapterName}:insufficient-data`,"Layer does not have required fields");const p=1,g="json"===r,y=m.createAggregateQuery();y.outSpatialReference=i?.spatialReference,y.returnGeometry=!!n,y.outFields=o,v(y,l);const{features:d}=g?await m.queryAggregateJSON(y,{signal:u}):await m.queryAggregates(y,{signal:u});return d.length&&null!=s&&s>0&&s<=d.length?t(d,s,p):d}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType="polygon",this.objectIdField=null,this.supportsSQLExpression=!1,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent=t.fullExtent;const r="featureReduction"in t?t.featureReduction:null;if("binning"!==r?.type&&"cluster"!==r?.type)throw new a(`${this.adapterName}:invalid-parameters`,`Feature reduction type ${r?.type} is not supported`);this.workerClient=c.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([s({readOnly:!0})],T.prototype,"adapterName",void 0),T=e([o("esri.smartMapping.support.adapters.FeatureLayerBinningAdapter")],T);const x=T;export{x as default};
5
+ import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import a from"../../../core/Error.js";import{assertIsSome as r}from"../../../core/maybe.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{kebabDict as n}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as l}from"../../../layers/support/fieldUtils.js";import{getArcadeForPredominantCategory as u}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as m,uniqueValues as p,histogram as y,classBreaks as g}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as d}from"../../statistics/support/utils.js";import{WorkerClient as c}from"../../statistics/support/WorkerClient.js";import{getFieldsList as f,fieldDelimiter as h,isAnyDateField as w}from"../utils.js";import F from"./FeatureLayerAdapter.js";import{getMissingFieldsForBinning as S,updateQueryWithFeatureFilter as v,getFeatureReductionFields as q,getViewInfoParams as V,getDomainsForFields as z,getPredominantCategoriesFromUVInfos as N}from"./support/utils.js";let T=class extends F{constructor(){super(...arguments),this.adapterName="feature-layer-binning-adapter"}async _getNormalizationTotalFromMemory(e,t,r){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"queryAggregateSummaryStatistics"in o?await o.queryAggregateSummaryStatistics(n,{field:e,outStatisticTypes:l},{signal:r}):i?await this.workerClient.summaryStatistics({field:e},i):await m({attribute:{field:e,outStatisticTypes:l},features:s})).sum;if(null==u)throw new a(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _processStatsFromMemoryParams(e){const{features:t,filter:i}=e;if(t?.length)return this._getFilteredFeatures(t,i);const{view:s,field:o,field2:n,field3:l,normalizationField:u,valueExpression:m,returnGeometry:p,layerViewFunc:y,signal:g}=e;let d=null,c=null,h=null,w=null,F=null;if(s)try{if(d=await s.whenLayerView(this.layer),r(d),c=null!=y&&y in d&&"function"==typeof d[y],c){await this._waitForLayerViewUpdate(d);const e=await f({field:o,field2:n,field3:l,normalizationField:u,valueExpression:m});S(this,e).length?c=!1:(h="createAggregateQuery"in d?d.createAggregateQuery():null,h?(h.outFields=e,h.returnGeometry=!1,v(h,i)):c=!1),d.suspended&&(c=!1)}}catch{c=!1}if(!c&&(F=q(this.layer).map(e=>e.toJSON()),w=await this._fetchFeaturesForStats({field:o,field2:n,field3:l,valueExpression:m,normalizationField:u,returnGeometry:p,filter:i,view:s,signal:g},"json"),!w?.length))throw new a(`${this.adapterName}:insufficient-data`,"No features are available to calculate statistics");return{layerView:d,query:h,featuresJSON:w,fieldInfos:F}}async _summaryStatsFromMemory(e,t){const{view:a,field:r,valueExpression:i,normalizationType:s,signal:o}=e,l={field:r,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:u,graphics:p,layerView:y,query:g,fieldInfos:d}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateSummaryStatistics"});return i&&a&&(u||p)&&(l.fieldType=t?.type?n.toJSON(t.type):null,l.viewInfoParams=V(a),l.timeZone=a.timeZone,l.fieldInfos=d),"percent-of-total"===s&&null==e.normalizationTotal&&(l.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:u,graphics:p,layerView:y,query:g},o)),!u&&!p&&y&&"queryAggregateSummaryStatistics"in y?y.queryAggregateSummaryStatistics(g,l,{signal:o}):u?this.workerClient.summaryStatistics(l,u):m({attribute:l,features:p})}async _uvFromMemory(e,t){const{view:a,field:r,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:y}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateUniqueValues"}),g={field:r,field2:e.field2,field3:e.field3,fieldDelimiter:h,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&a&&(n||l)&&(g.viewInfoParams=V(a),g.timeZone=a.timeZone,g.fieldInfos=y),!n&&!l&&u&&"queryAggregateUniqueValues"in u?u.queryAggregateUniqueValues(m,g,{signal:o}):n?this.workerClient.uniqueValues(g,n):p({attribute:g,features:l})}async _histogramFromMemory(e){const{view:t,field:a,valueExpression:r,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateHistogram"}),m={field:a,valueExpression:r,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numBins:e.numBins};return r&&t&&(s||o)&&(m.viewInfoParams=V(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryAggregateHistogram"in n?n.queryAggregateHistogram(l,m,{signal:i}):s?this.workerClient.histogram(m,s):y({attribute:m,features:o})}async _classBreaksFromMemory(e){const{view:t,field:a,valueExpression:r,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAggregateClassBreaks"}),m={field:a,valueExpression:r,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return r&&t&&(s||o)&&(m.viewInfoParams=V(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryAggregateClassBreaks"in n?n.queryAggregateClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}getField(e=""){const t=q(this.layer);return t?.find(t=>t.name.toLowerCase()===e?.toLowerCase())}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!1,supportsStatistics:!0}:null}getFieldDomain(e,t){return null}async summaryStatistics(e){const{field:t}=e,r=t?this.getField(t):null,i=w(r)||l(r),s=e.sqlExpression&&!e.valueExpression&&!t;if(i||s)throw new a(`${this.adapterName}:not-supported`,"Date field and sqlExpression are not supported");return this._summaryStatsFromMemory(e,r)}async uniqueValues(e){const t=await z(e,this);return this._uvFromMemory(e,t)}async histogram(e){const{field:t}=e,r=t?this.getField(t):null,i=w(r)||l(r),s=e.sqlExpression&&!e.valueExpression&&!t;if(i||s)throw new a(`${this.adapterName}:not-supported`,"Date field and sqlExpression are not supported");return this._histogramFromMemory(e)}async classBreaks(e){return(!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)).catch(()=>(i(e.signal),this._classBreaksFromMemory(e)))}async queryFeatureCount(e){const t=await(e.view?.whenLayerView(this.layer));if(!t||!("queryAggregateCount"in t)||!t.queryAggregateCount)throw new a(`${this.adapterName}:not-supported`,"LayerView is not supported.");await this._waitForLayerViewUpdate(t);const r=t.createAggregateQuery();return r.where=d(r.where,e.whereClause),v(r,e.filter),t.queryAggregateCount(r,{signal:e.signal})}generateRenderer(e,t){throw new a(`${this.adapterName}:not-supported`,"'generateRenderer' is not supported.")}heatmapStatistics(e){throw new a(`${this.adapterName}:not-supported`,"'heatmapStatistics' is not supported.")}async predominantCategories(e){const{fields:t,view:a,signal:r}=e,i=u(t),s=await this._uvFromMemory({valueExpression:i,view:a,signal:r});return N(s.uniqueValueInfos,t)}async getSampleFeatures(e,r){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e;if(!i)throw new a(`${this.adapterName}:not-supported`,"'view' is required to get sample features for binning.");if("3d"===i.type)throw new a(`${this.adapterName}:not-supported`,"3d 'view' is not supported to get sample features for binning.");const m=await i.whenLayerView(this.layer);if(!("queryAggregateJSON"in m&&m.queryAggregateJSON&&"queryAggregates"in m&&m.queryAggregates))throw new a(`${this.adapterName}:not-supported`,"LayerView is not supported.");await this._waitForLayerViewUpdate(m);if(S(this,o).length)throw new a(`${this.adapterName}:insufficient-data`,"Layer does not have required fields");const p=1,y="json"===r,g=m.createAggregateQuery();g.outSpatialReference=i?.spatialReference,g.returnGeometry=!!n,g.outFields=o,v(g,l);const{features:d}=y?await m.queryAggregateJSON(g,{signal:u}):await m.queryAggregates(g,{signal:u});return d.length&&null!=s&&s>0&&s<=d.length?t(d,s,p):d}load(e){const t=this.layer.load(e).then(async t=>{const r="featureReduction"in t?t.featureReduction:null;if("binning"!==r?.type&&"cluster"!==r?.type)throw new a(`${this.adapterName}:invalid-parameters`,`Feature reduction type ${r?.type} is not supported`);this.geometryType="cluster"===r?.type?"point":"polygon",this.objectIdField=null,this.supportsSQLExpression=!1,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent=t.fullExtent,this.workerClient=c.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([s({readOnly:!0})],T.prototype,"adapterName",void 0),T=e([o("esri.smartMapping.support.adapters.FeatureLayerBinningAdapter")],T);const x=T;export{x 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.34/esri/copyright.txt for details.
4
4
  */
5
- const c="20250821",b="193cadb6edfccc893c9bb6a885fc521bfae22c17";export{c as buildDate,b as commitHash};
5
+ const c="20250823",d="8f8477d46495ccebfe2cdc31d31b693f0de7b196";export{c as buildDate,d as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as e,px2pt as t}from"../../core/screenUtils.js";import{CIMSymbolHelper as i}from"../cim/CIMSymbolHelper.js";import{CIMSymbolRasterizer as o}from"../cim/CIMSymbolRasterizer.js";import{OverrideHelper as l}from"../cim/OverrideHelper.js";import{mapCIMSymbolToGeometryType as n}from"../cim/utils.js";import{renderSymbol as r}from"./renderUtils.js";const a=new o(null),s=t(22),m=t(120),h=t(50),c=1;async function y(e,t,i){const o=t?.size;let l=null!=o&&"object"==typeof o&&"width"in o?o.width:o,n=null!=o&&"object"==typeof o&&"height"in o?o.height:o;if(!l||!n)if("esriGeometryPolygon"===i)l=n=t.maxSize?Math.min(t.maxSize,s):s;else{const o=await u(e,t,i);o&&(l=o.width,n=o.height),"esriGeometryPolyline"===i&&(l=t.maxSize?Math.min(t.maxSize,h):h),l=null!=l&&isFinite(l)?Math.min(l,m):s,n=null!=n&&isFinite(n)?Math.max(Math.min(n,m),c):s}return"legend"===t.style&&"esriGeometryPolyline"===i&&(l=h),{width:l,height:n}}async function u(e,t={},o){const r=t.cimOptions||t;o??=r.geometryType||n(e?.data?.symbol);const{feature:s,fieldMap:m,viewParams:h}=r,c=await l.resolveSymbolOverrides(e.data,s,null,m,o,null,h);if(!c)return null;(e=e.clone()).data={type:"CIMSymbolReference",symbol:c},e.data.primitiveOverrides=void 0;const y=[];return i.fetchResources(c,a.resourceManager,y),i.fetchFonts(c,a.resourceManager,y),y.length>0&&await Promise.all(y),i.getEnvelope(c,null,a.resourceManager)}async function g(i,o={}){const{node:l,opacity:s,symbolConfig:m}=o,h=null!=m&&"object"==typeof m&&"isSquareFill"in m&&m.isSquareFill,c=o.cimOptions||o,u=c.geometryType||n(i?.data?.symbol),g=await y(i,o,u),{feature:d,fieldMap:f}=c,p=o?.geometry||h||"esriGeometryPolygon"!==u?"preview":"legend";let w=g;const b=g;if(o?.geometry&&("esriGeometryPolygon"===u||"esriGeometryPolyline"===u)){const i=200;if(e(g.width)<i||e(g.height)<i){const e=g.width>g.height?t(i)*g.height/g.width:t(i);w={width:g.width>g.height?t(i):t(i)*g.width/g.height,height:e}}}const M=await a.rasterizeCIMSymbolAsync(i,d,w,p,f,u,null,c.viewParams,c.allowScalingUp,o?.geometry?.toJSON());if(!M)return null;const{width:S,height:v}=M,j=document.createElement("canvas");j.width=S,j.height=v;j.getContext("2d").putImageData(M,0,0);const P=e(b.width),x=e(b.height),z=new Image(P,x);z.src=j.toDataURL(),z.ariaLabel=o.ariaLabel??null,z.alt=o.ariaLabel??"",null!=s&&(z.style.opacity=`${s}`);let C=z;if(null!=o.effectView){const e={shape:{type:"image",x:0,y:0,width:P,height:x,src:z.src},fill:null,stroke:null,offset:[0,0]};C=r([[e]],[P,x],o)}return l&&C&&l.appendChild(C),C}export{u as getCIMSymbolPreviewSize,g as previewCIMSymbol};
5
+ import{pt2px as e,px2pt as t}from"../../core/screenUtils.js";import{CIMSymbolHelper as i}from"../cim/CIMSymbolHelper.js";import{CIMSymbolRasterizer as o}from"../cim/CIMSymbolRasterizer.js";import{OverrideHelper as l}from"../cim/OverrideHelper.js";import{mapCIMSymbolToGeometryType as r}from"../cim/utils.js";import{renderSymbol as n}from"./renderUtils.js";const a=new o(null),s=t(22),m=t(120),h=t(50),c=1;async function y(e,t,i){const o=t?.size;let l=null!=o&&"object"==typeof o&&"width"in o?o.width:o,r=null!=o&&"object"==typeof o&&"height"in o?o.height:o;if(!l||!r)if("esriGeometryPolygon"===i)l=r=t.maxSize?Math.min(t.maxSize,s):s;else{const o=await g(e,t,i);o&&(l=o.width,r=o.height),"esriGeometryPolyline"===i&&(l=t.maxSize?Math.min(t.maxSize,h):h),l=null!=l&&isFinite(l)?Math.min(l,m):s,r=null!=r&&isFinite(r)?Math.max(Math.min(r,m),c):s}return"legend"===t.style&&"esriGeometryPolyline"===i&&(l=h),{width:l,height:r}}async function g(e,t={},o){const n=t.cimOptions||t;o??=n.geometryType||r(e?.data?.symbol);const{feature:s,fieldMap:m,viewParams:h}=n,c=await l.resolveSymbolOverrides(e.data,s,null,m,o,null,h);if(!c)return null;(e=e.clone()).data={type:"CIMSymbolReference",symbol:c},e.data.primitiveOverrides=void 0;const y=[];return i.fetchResources(c,a.resourceManager,y),i.fetchFonts(c,a.resourceManager,y),y.length>0&&await Promise.all(y),i.getEnvelope(c,null,a.resourceManager)}async function u(i,o={}){const{node:l,opacity:s,symbolConfig:m}=o,h=null!=m&&"object"==typeof m&&"isSquareFill"in m&&m.isSquareFill,c=o.cimOptions||o,g=c.geometryType||r(i?.data?.symbol),u=await y(i,o,g),{feature:d,fieldMap:f}=c,p=o?.geometry||h||"esriGeometryPolygon"!==g?"preview":"legend";let w=u;const b=u;if(o?.geometry&&("esriGeometryPolygon"===g||"esriGeometryPolyline"===g)){const i=200;if(e(u.width)<i||e(u.height)<i){const e=u.width>u.height?t(i)*u.height/u.width:t(i);w={width:u.width>u.height?t(i):t(i)*u.width/u.height,height:e}}}const M=await a.rasterizeCIMSymbolAsync(i,d,w,p,f,g,null,c.viewParams,c.allowScalingUp,o?.geometry?.toJSON());if(!M)return null;const{width:S,height:v}=M,j=document.createElement("canvas");j.width=S,j.height=v;j.getContext("2d").putImageData(M,0,0);const P=e(b.width),x=e(b.height),z=new Image(P,x);z.src=j.toDataURL(),z.ariaLabel=o.ariaLabel??null,z.alt=o.ariaLabel??"",null!=s&&(z.style.opacity=`${s}`);let C=z;if(o.cssEffectFilter){const e={shape:{type:"image",x:0,y:0,width:P,height:x,src:z.src},fill:null,stroke:null,offset:[0,0]};C=n([[e]],[P,x],o)}return l&&C&&l.appendChild(C),C}export{g as getCIMSymbolPreviewSize,u as previewCIMSymbol};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import o from"../../core/Error.js";import{loadFont as i}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as a,quantizePolyline as l}from"../../geometry/support/quantizationUtils.js";import{getFill as s,getStroke as r,getDashArray as h,getPatternUrlWithColor as c}from"./gfxUtils.js";import{shapes as m,adjustColorBrightness as p}from"./previewUtils.js";import{renderSymbol as u}from"./renderUtils.js";import{backgroundPadding as d}from"./textUtils.js";const f="picture-fill",g="picture-marker",y="simple-fill",w="simple-line",x="simple-marker",b="text",v="Aa",M=22,S=120,k=80,z=50,L=225,C=document.createElement("canvas");function $(t,e,o){if("polygon"===t.type){const i=t.extent,n=0===i.width?1:i.width,l=0===i.height?1:i.height;t=a({originPosition:"upperLeft",scale:[n/e,l/o],translate:[i.xmin,i.ymax]},{},t);let s="";for(let e=0;e<t.rings.length;e++){const o=t.rings[e];for(let t=0;t<o.length;t++){const e=o[t][0],i=o[t][1];let n="";0===t?(n=`M${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n):t===o.length-1?(n=`l${e.toString()} ${i.toString()} Z`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}if("polyline"===t.type){const i=t.extent,n=0===i.width?1:i.width,a=0===i.height?1:i.height;t=l({originPosition:"upperLeft",scale:[n/e,a/o],translate:[i.xmin,i.ymax]},{},t);let s="";for(let e=0;e<t.paths.length;e++){const o=t.paths[e];for(let t=0;t<o.length;t++){const e=o[t][0],i=o[t][1];let n="";0===t?(n=`M${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}return""}function j(t,e){const o=C.getContext("2d"),i=[];e&&(e.weight&&i.push(e.weight),e.size&&i.push(e.size+"px"),e.family&&i.push(e.family)),o.font=i.join(" ");const{width:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:l,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=o.measureText(t);return{width:Math.ceil(Math.max(n,a+l)),height:Math.ceil(s+r),x:Math.floor(a),y:Math.floor((s-r)/2)}}function B(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function P(t,e){const o=e.fill,i=t.color;if("pattern"===o?.type&&i&&t.type!==f){const t=await c(o.src,i.toCss(!0));o.src=t,e.fill=o}}async function E(t,e,o,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await i(t.font)}catch{}const{width:a,height:l}=B(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:i,height:s,x:r,y:h}=j(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});o[0]=a??i,o[1]=l??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));o[1]=o[0]*e+o[1]*i}}}function U(t,e,o,i,a){if(null!=t.haloColor&&null!=t.haloSize){a.masking??=o.map(()=>[]);const l=n(t.haloSize);i[0]+=l,i[1]+=l,o.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*l,join:"round",cap:"round"}}]),a.masking.unshift([{shape:{type:"rect",x:0,y:0,width:i[0]+2*d,height:i[1]+2*d},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(i[0]+=2*d,i[1]+=2*d,o.unshift([{shape:{type:"rect",x:0,y:0,width:i[0],height:i[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),a.masking?.unshift([]))}function A(t,e){return t>e?"dark":"light"}function F(t,e){const o="number"==typeof e?.size?e?.size:null,i=null!=o?n(o):null,a=null!=e?.maxSize?n(e.maxSize):null;let l="angle"in t?t.angle:null;null!=e?.rotation&&(l=(l??0)+e.rotation);const c=s(t);let p=r(t);"dark"!==D(t,245)||e?.ignoreWhiteSymbols||(p={width:.75,...p,color:"#bdc3c7"});let u=null;const d={shape:null,fill:c,stroke:p,offset:[0,0]};p?.width&&(p.width=Math.min(p.width,k));const L=p?.width||0;let C=null!=e?.size&&(null==e?.scale||e?.scale),P=0,E=0,U=!1;switch(t.type){case x:{const o=t.style,{width:s,height:r}=B(e);let h=s===r&&null!=s?s:null!=i?i:Math.min(n(t.size),a||S);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),a||S);h=e>s&&e>r?Math.min(s,r):e}switch(P=h,E=h,o){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},C||(P+=L,E+=L);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*E]},{command:"L",values:[P,.5*E]},{command:"M",values:[.5*P,0]},{command:"L",values:[.5*P,E]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*E]},{command:"L",values:[.5*P,0]},{command:"L",values:[P,.5*E]},{command:"L",values:[.5*P,E]},{command:"Z",values:[]}]},C||(P+=L,E+=L);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[P,0]},{command:"L",values:[P,E]},{command:"L",values:[0,E]},{command:"Z",values:[]}]},C||(P+=L,E+=L),l&&(U=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*P,0]},{command:"L",values:[P,E]},{command:"L",values:[0,E]},{command:"Z",values:[]}]},C||(P+=L,E+=L),l&&(U=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[P,E]},{command:"M",values:[P,0]},{command:"L",values:[0,E]}]},l&&(U=!0);break;case"path":d.shape={type:"path",path:t.path||""},C||(P+=L,E+=L),l&&(U=!0),C=!0}break}case w:{const{width:t,height:o}=B(e),n=h(p).reduce((t,e)=>t+e,0),a=n&&Math.ceil(z/n),l=o??i??L,s=t??(n*a||z);if(C=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){P=s,E=o??P;const t=1e3,i=.15*t;u=[P,E],E=u[0]>u[1]?t*u[1]/u[0]:t,P=u[0]>u[1]?t:t*u[0]/u[1],p?.width&&(p.width=p.width*t/(u[1]>u[0]?u[1]:u[0]),p.width>i&&(p.width=i)),d.shape={type:"path",path:$(e.geometry,P,E)}}else P=null!=e?.maxSize?Math.min(s,e.maxSize):s,E=l,p&&(p.width=l),d.shape={type:"path",path:[{command:"M",values:[l/2,E/2]},{command:"L",values:[P-l/2,E/2]}]};break}case f:case y:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:o,height:n}=B(e);P=!t&&o!==n||null==o?null!=i?i:M:o,E=!t&&o!==n||null==n?P:n,C||(P+=L,E+=L),C=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(u=[P,E],E=u[0]>u[1]?1e3*u[1]/u[0]:1e3,P=u[0]>u[1]?1e3:1e3*u[0]/u[1],d.shape={type:"path",path:$(e.geometry,P,E)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[P,0]},{command:"L",values:[P,E]},{command:"L",values:[0,E]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:m.fill[0];break}case g:{const o=Math.min(n(t.width),a||S),s=Math.min(n(t.height),a||S),{width:r,height:h}=B(e),c=r===h&&null!=r?r:null!=i?i:Math.max(o,s),m=t.width/t.height;P=m<=1?Math.ceil(c*m):c,E=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round(P/2),y:-Math.round(E/2),width:P,height:E,src:t.url||""},l&&(U=!0);break}case b:{const o=t,l=e?.overrideText||o.text||v,s=o.font,{width:r,height:h}=B(e),c=null!=h?h:null!=i?i:Math.min(n(s.size),a||S),{width:m,height:p}=j(l,{weight:s.weight,size:c,family:s.family}),u=/[\uE600-\uE6FF]/.test(l);P=r??(u?c:m),E=u?c:p;let f=.5*(u?c:p);u&&(f+=5),d.shape={type:"text",text:l,x:o.xoffset||0,y:o.yoffset||f,align:"middle",alignBaseline:o.verticalAlignment,decoration:s&&s.decoration,rotated:o.rotated,kerning:o.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[P,E],outputSize:u,renderOptions:{node:e?.node,scale:C,opacity:e?.opacity,rotations:[l],useRotationSize:U,effectView:e?.effectView,ariaLabel:e?.ariaLabel,clipBloomEffect:e?.clipBloomEffect}}}async function Z(t,e){const{shapeDescriptor:i,size:n,renderOptions:a,outputSize:l}=F(t,e);if(!i.shape)throw new o("symbolPreview: renderPreviewHTML2D","symbol not supported.");await P(t,i),await E(t,i,n,e);const s=[[i]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...i,offset:[-t,0],fill:p(i.fill,-.3)}]),s.push([{...i,offset:[t,0],fill:p(i.fill,.3)}]),n[0]+=2*t,a.scale=!1}"text"===t.type&&U(t,i,s,n,a);const r=u(s,n,a);if(l&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",l[0].toString()),t.setAttribute("height",l[1].toString()),l.length>2&&(t.style.setProperty("padding-left",l[2]?.toString()+"px"),t.style.setProperty("padding-right",l[2]?.toString()+"px"),t.style.setProperty("padding-top",l[3]?.toString()+"px"),t.style.setProperty("padding-bottom",l[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function D(o,i=L){const n=s(o),a=r(o),l=!n||"type"in n?null:new t(n),h=a?.color?new t(a?.color):null,c=l?A(e(l),i):null,m=h?A(e(h),i):null;return m?c?c===m?c:i>=L?"light":"dark":m:c}export{D as getContrastingBackgroundTheme,F as getRenderSymbolParameters,Z as previewSymbol2D};
5
+ import t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import o from"../../core/Error.js";import{loadFont as i}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as l,quantizePolyline as a}from"../../geometry/support/quantizationUtils.js";import{getFill as s,getStroke as r,getDashArray as h,getPatternUrlWithColor as c}from"./gfxUtils.js";import{shapes as m,adjustColorBrightness as p}from"./previewUtils.js";import{renderSymbol as u}from"./renderUtils.js";import{backgroundPadding as d}from"./textUtils.js";const f="picture-fill",g="picture-marker",y="simple-fill",w="simple-line",x="simple-marker",b="text",v="Aa",M=22,S=120,k=80,z=50,L=225,C=document.createElement("canvas");function $(t,e,o){if("polygon"===t.type){const i=t.extent,n=0===i.width?1:i.width,a=0===i.height?1:i.height;t=l({originPosition:"upperLeft",scale:[n/e,a/o],translate:[i.xmin,i.ymax]},{},t);let s="";for(let e=0;e<t.rings.length;e++){const o=t.rings[e];for(let t=0;t<o.length;t++){const e=o[t][0],i=o[t][1];let n="";0===t?(n=`M${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n):t===o.length-1?(n=`l${e.toString()} ${i.toString()} Z`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}if("polyline"===t.type){const i=t.extent,n=0===i.width?1:i.width,l=0===i.height?1:i.height;t=a({originPosition:"upperLeft",scale:[n/e,l/o],translate:[i.xmin,i.ymax]},{},t);let s="";for(let e=0;e<t.paths.length;e++){const o=t.paths[e];for(let t=0;t<o.length;t++){const e=o[t][0],i=o[t][1];let n="";0===t?(n=`M${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${i.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}return""}function j(t,e){const o=C.getContext("2d"),i=[];e&&(e.weight&&i.push(e.weight),e.size&&i.push(e.size+"px"),e.family&&i.push(e.family)),o.font=i.join(" ");const{width:n,actualBoundingBoxLeft:l,actualBoundingBoxRight:a,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=o.measureText(t);return{width:Math.ceil(Math.max(n,l+a)),height:Math.ceil(s+r),x:Math.floor(l),y:Math.floor((s-r)/2)}}function B(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function E(t,e){const o=e.fill,i=t.color;if("pattern"===o?.type&&i&&t.type!==f){const t=await c(o.src,i.toCss(!0));o.src=t,e.fill=o}}async function P(t,e,o,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await i(t.font)}catch{}const{width:l,height:a}=B(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:i,height:s,x:r,y:h}=j(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});o[0]=l??i,o[1]=a??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));o[1]=o[0]*e+o[1]*i}}}function U(t,e,o,i,l){if(null!=t.haloColor&&null!=t.haloSize){l.masking??=o.map(()=>[]);const a=n(t.haloSize);i[0]+=a,i[1]+=a,o.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*a,join:"round",cap:"round"}}]),l.masking.unshift([{shape:{type:"rect",x:0,y:0,width:i[0]+2*d,height:i[1]+2*d},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(i[0]+=2*d,i[1]+=2*d,o.unshift([{shape:{type:"rect",x:0,y:0,width:i[0],height:i[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),l.masking?.unshift([]))}function F(t,e){return t>e?"dark":"light"}function A(t,e){const o="number"==typeof e?.size?e?.size:null,i=null!=o?n(o):null,l=null!=e?.maxSize?n(e.maxSize):null;let a="angle"in t?t.angle:null;null!=e?.rotation&&(a=(a??0)+e.rotation);const c=s(t);let p=r(t);"dark"!==D(t,245)||e?.ignoreWhiteSymbols||(p={width:.75,...p,color:"#bdc3c7"});let u=null;const d={shape:null,fill:c,stroke:p,offset:[0,0]};p?.width&&(p.width=Math.min(p.width,k));const L=p?.width||0;let C=null!=e?.size&&(null==e?.scale||e?.scale),E=0,P=0,U=!1;switch(t.type){case x:{const o=t.style,{width:s,height:r}=B(e);let h=s===r&&null!=s?s:null!=i?i:Math.min(n(t.size),l||S);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),l||S);h=e>s&&e>r?Math.min(s,r):e}switch(E=h,P=h,o){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},C||(E+=L,P+=L);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*P]},{command:"L",values:[E,.5*P]},{command:"M",values:[.5*E,0]},{command:"L",values:[.5*E,P]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*P]},{command:"L",values:[.5*E,0]},{command:"L",values:[E,.5*P]},{command:"L",values:[.5*E,P]},{command:"Z",values:[]}]},C||(E+=L,P+=L);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[E,0]},{command:"L",values:[E,P]},{command:"L",values:[0,P]},{command:"Z",values:[]}]},C||(E+=L,P+=L),a&&(U=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*E,0]},{command:"L",values:[E,P]},{command:"L",values:[0,P]},{command:"Z",values:[]}]},C||(E+=L,P+=L),a&&(U=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[E,P]},{command:"M",values:[E,0]},{command:"L",values:[0,P]}]},a&&(U=!0);break;case"path":d.shape={type:"path",path:t.path||""},C||(E+=L,P+=L),a&&(U=!0),C=!0}break}case w:{const{width:t,height:o}=B(e),n=h(p).reduce((t,e)=>t+e,0),l=n&&Math.ceil(z/n),a=o??i??L,s=t??(n*l||z);if(C=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){E=s,P=o??E;const t=1e3,i=.15*t;u=[E,P],P=u[0]>u[1]?t*u[1]/u[0]:t,E=u[0]>u[1]?t:t*u[0]/u[1],p?.width&&(p.width=p.width*t/(u[1]>u[0]?u[1]:u[0]),p.width>i&&(p.width=i)),d.shape={type:"path",path:$(e.geometry,E,P)}}else E=null!=e?.maxSize?Math.min(s,e.maxSize):s,P=a,p&&(p.width=a),d.shape={type:"path",path:[{command:"M",values:[a/2,P/2]},{command:"L",values:[E-a/2,P/2]}]};break}case f:case y:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:o,height:n}=B(e);E=!t&&o!==n||null==o?null!=i?i:M:o,P=!t&&o!==n||null==n?E:n,C||(E+=L,P+=L),C=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(u=[E,P],P=u[0]>u[1]?1e3*u[1]/u[0]:1e3,E=u[0]>u[1]?1e3:1e3*u[0]/u[1],d.shape={type:"path",path:$(e.geometry,E,P)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[E,0]},{command:"L",values:[E,P]},{command:"L",values:[0,P]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:m.fill[0];break}case g:{const o=Math.min(n(t.width),l||S),s=Math.min(n(t.height),l||S),{width:r,height:h}=B(e),c=r===h&&null!=r?r:null!=i?i:Math.max(o,s),m=t.width/t.height;E=m<=1?Math.ceil(c*m):c,P=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round(E/2),y:-Math.round(P/2),width:E,height:P,src:t.url||""},a&&(U=!0);break}case b:{const o=t,a=e?.overrideText||o.text||v,s=o.font,{width:r,height:h}=B(e),c=null!=h?h:null!=i?i:Math.min(n(s.size),l||S),{width:m,height:p}=j(a,{weight:s.weight,size:c,family:s.family}),u=/[\uE600-\uE6FF]/.test(a);E=r??(u?c:m),P=u?c:p;let f=.5*(u?c:p);u&&(f+=5),d.shape={type:"text",text:a,x:o.xoffset||0,y:o.yoffset||f,align:"middle",alignBaseline:o.verticalAlignment,decoration:s&&s.decoration,rotated:o.rotated,kerning:o.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[E,P],outputSize:u,renderOptions:{node:e?.node,scale:C,opacity:e?.opacity,rotations:[a],useRotationSize:U,cssEffectFilter:e?.cssEffectFilter,ariaLabel:e?.ariaLabel,clipBloomEffect:e?.clipBloomEffect}}}async function Z(t,e){const{shapeDescriptor:i,size:n,renderOptions:l,outputSize:a}=A(t,e);if(!i.shape)throw new o("symbolPreview: renderPreviewHTML2D","symbol not supported.");await E(t,i),await P(t,i,n,e);const s=[[i]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...i,offset:[-t,0],fill:p(i.fill,-.3)}]),s.push([{...i,offset:[t,0],fill:p(i.fill,.3)}]),n[0]+=2*t,l.scale=!1}"text"===t.type&&U(t,i,s,n,l);const r=u(s,n,l);if(a&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",a[0].toString()),t.setAttribute("height",a[1].toString()),a.length>2&&(t.style.setProperty("padding-left",a[2]?.toString()+"px"),t.style.setProperty("padding-right",a[2]?.toString()+"px"),t.style.setProperty("padding-top",a[3]?.toString()+"px"),t.style.setProperty("padding-bottom",a[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function D(o,i=L){const n=s(o),l=r(o),a=!n||"type"in n?null:new t(n),h=l?.color?new t(l?.color):null,c=a?F(e(a),i):null,m=h?F(e(h),i):null;return m?c?c===m?c:i>=L?"light":"dark":m:c}export{D as getContrastingBackgroundTheme,A as getRenderSymbolParameters,Z as previewSymbol2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{id as t}from"../../kernel.js";import e from"../../request.js";import{toHSV as i,toRGB as r}from"../../core/colorUtils.js";import n from"../../core/Error.js";import has from"../../core/has.js";import"../../libs/maquette/projection.js";import{createProjector as o}from"../../libs/maquette/projector.js";import{renderSVG as a}from"./svgUtils.js";import{getCSSFilterFromEffectList as c}from"./utils.js";const s=o();function h(t,e){s.append(t,e),s.detach(e)}function l(t,e,i){const r=Math.ceil(e[0]),n=Math.ceil(e[1]);if(!t.some(t=>!!t.length))return null;const o=i?.node||document.createElement("div");null!=i.opacity&&(o.style.opacity=i.opacity.toString()),null!=i.effectView&&(o.style.filter=c(i.effectView));return h(o,()=>a(t,r,n,i)),o}function m(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=document.createElement("canvas");i.width=t,i.height=e,i.style.width=t+"px",i.style.height=e+"px";const r=i.getContext("2d");return r.clearRect(0,0,t,e),r}function g(t,i,r){return t?e(t,{responseType:"image"}).then(t=>{const e=t.data,n=e.width,o=e.height,a=n/o;let c=i;if(r){const t=Math.max(n,o);c=Math.min(c,t)}return{image:e,width:a<=1?Math.ceil(c*a):c,height:a<=1?c:Math.ceil(c/a)}}):Promise.reject(new n("renderUtils: imageDataSize","href not provided."))}function u(t,e){return!(!t||"ignore"===e)&&("multiply"!==e||255!==t.r||255!==t.g||255!==t.b||1!==t.a)}function f(t,e,n,o,a){switch(a){case"multiply":t[e]*=n[0],t[e+1]*=n[1],t[e+2]*=n[2],t[e+3]*=n[3];break;default:{const a=i({r:t[e],g:t[e+1],b:t[e+2]});a.h=o.h,a.s=o.s,a.v=a.v/100*o.v;const c=r(a);t[e]=c.r,t[e+1]=c.g,t[e+2]=c.b,t[e+3]*=n[3];break}}}function d(e,r,n,o,a){return g(e,r,a).then(a=>{const c=a.width??r,s=a.height??r;if(a.image&&u(n,o)){let t=a.image.width,r=a.image.height;has("edge")&&/\.svg$/i.test(e)&&(t-=1,r-=1);const h=m(c,s);h.drawImage(a.image,0,0,t,r,0,0,c,s);const l=h.getImageData(0,0,c,s),g=[n.r/255,n.g/255,n.b/255,n.a],u=i(n);for(let e=0;e<l.data.length;e+=4)f(l.data,e,g,u,o);h.putImageData(l,0,0),e=h.canvas.toDataURL("image/png")}else{const i=t?.findCredential(e);if(i?.token){const t=e.includes("?")?"&":"?";e=`${e}${t}token=${i.token}`}}return{url:e,width:c,height:s}}).catch(()=>({url:e,width:r,height:r}))}export{h as renderOnce,l as renderSymbol,d as tintImageWithColor};
5
+ import{id as t}from"../../kernel.js";import e from"../../request.js";import{toHSV as i,toRGB as r}from"../../core/colorUtils.js";import n from"../../core/Error.js";import has from"../../core/has.js";import"../../libs/maquette/projection.js";import{createProjector as o}from"../../libs/maquette/projector.js";import{renderSVG as a}from"./svgUtils.js";const c=o();function s(t,e){c.append(t,e),c.detach(e)}function l(t,e,i){const r=Math.ceil(e[0]),n=Math.ceil(e[1]);if(!t.some(t=>!!t.length))return null;const o=i?.node||document.createElement("div");null!=i.opacity&&(o.style.opacity=i.opacity.toString()),null!=i.cssEffectFilter&&(o.style.filter=i.cssEffectFilter);return s(o,()=>a(t,r,n,i)),o}function h(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=document.createElement("canvas");i.width=t,i.height=e,i.style.width=t+"px",i.style.height=e+"px";const r=i.getContext("2d");return r.clearRect(0,0,t,e),r}function m(t,i,r){return t?e(t,{responseType:"image"}).then(t=>{const e=t.data,n=e.width,o=e.height,a=n/o;let c=i;if(r){const t=Math.max(n,o);c=Math.min(c,t)}return{image:e,width:a<=1?Math.ceil(c*a):c,height:a<=1?c:Math.ceil(c/a)}}):Promise.reject(new n("renderUtils: imageDataSize","href not provided."))}function g(t,e){return!(!t||"ignore"===e)&&("multiply"!==e||255!==t.r||255!==t.g||255!==t.b||1!==t.a)}function u(t,e,n,o,a){switch(a){case"multiply":t[e]*=n[0],t[e+1]*=n[1],t[e+2]*=n[2],t[e+3]*=n[3];break;default:{const a=i({r:t[e],g:t[e+1],b:t[e+2]});a.h=o.h,a.s=o.s,a.v=a.v/100*o.v;const c=r(a);t[e]=c.r,t[e+1]=c.g,t[e+2]=c.b,t[e+3]*=n[3];break}}}function d(e,r,n,o,a){return m(e,r,a).then(a=>{const c=a.width??r,s=a.height??r;if(a.image&&g(n,o)){let t=a.image.width,r=a.image.height;has("edge")&&/\.svg$/i.test(e)&&(t-=1,r-=1);const l=h(c,s);l.drawImage(a.image,0,0,t,r,0,0,c,s);const m=l.getImageData(0,0,c,s),g=[n.r/255,n.g/255,n.b/255,n.a],d=i(n);for(let e=0;e<m.data.length;e+=4)u(m.data,e,g,d,o);l.putImageData(m,0,0),e=l.canvas.toDataURL("image/png")}else{const i=t?.findCredential(e);if(i?.token){const t=e.includes("?")?"&":"?";e=`${e}${t}token=${i.token}`}}return{url:e,width:c,height:s}}).catch(()=>({url:e,width:r,height:r}))}export{s as renderOnce,l as renderSymbol,d as tintImageWithColor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../Color.js";import has from"../../core/has.js";import{assertIsSome as e}from"../../core/maybe.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/mat2df32.js";import{multiply as r,scale as n,identity as o,translate as a,rotate as s}from"../../core/libs/gl-matrix-2/math/mat2d.js";import{getDashArray as l}from"./gfxUtils.js";import{nextBloomId as h,nextPatternId as f,nextLinearGradientId as c}from"./svgGlobalState.js";import"../../widgets/support/widgetUtils.js";import{tsx as u}from"../../widgets/support/jsxFactory.js";const d="http://www.w3.org/2000/svg",y=has("android"),p=has("chrome")||y&&y>=4?"auto":"optimizeLegibility",g={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},m=/([A-DF-Za-df-z])|([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let x={},w={};const k=Math.PI;function b(t,e){const i=t*(k/180);return Math.abs(e*Math.sin(i))+Math.abs(e*Math.cos(i))}function j(t){return t.map(t=>`${t.command} ${t.values.join(" ")}`).join(" ").trim()}function M(t,i,r,n,o){if(t){if("circle"===t.type)return u("circle",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",r:t.r,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-dashoffset":r.dashOffset,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("ellipse"===t.type)return u("ellipse",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",rx:t.rx,ry:t.ry,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("rect"===t.type)return u("rect",{fill:i,"fill-rule":"evenodd",height:t.height,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,width:t.width,x:t.x,y:t.y});if("image"===t.type)return u("image",{alt:o||"image",height:t.height,href:t.src,preserveAspectRatio:"none",width:t.width,x:t.x,y:t.y});if("path"===t.type){const e="string"!=typeof t.path?j(t.path):t.path;return u("path",{d:e,fill:i,"fill-rule":"evenodd",stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width})}if("text"===t.type)return e(n),u("text",{"dominant-baseline":n.dominantBaseline,fill:i,"fill-rule":"evenodd","font-family":n.font.family,"font-size":n.font.size,"font-style":n.font.style,"font-variant":n.font.variant,"font-weight":n.font.weight,kerning:n.kerning,rotate:n.rotate,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,"text-anchor":n.align,"text-decoration":n.decoration,"text-rendering":p,x:t.x,y:t.y},t.text)}return null}function v(e){if(!e)return{fill:"none",pattern:null,linearGradient:null};if(!("type"in e))return{fill:new t(e).toString(),pattern:null,linearGradient:null};if("pattern"===e.type){const t=`patternId-${f()}`;return{fill:`url(#${t})`,pattern:{id:t,x:e.x,y:e.y,width:e.width,height:e.height,image:{x:0,y:0,width:e.width,height:e.height,href:e.src}},linearGradient:null}}const i=`linearGradientId-${c()}`;return{fill:`url(#${i})`,pattern:null,linearGradient:{id:i,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stops:e.colors.map(e=>({offset:e.offset,color:e.color&&new t(e.color).toString()}))}}}function S(e){const i={color:"none",width:1,cap:"butt",join:"4",dashArray:"none",dashOffset:"0"};return e&&(null!=e.width&&(i.width=e.width),e.cap&&(i.cap=e.cap),e.join&&(i.join=e.join.toString()),e.color&&(i.color=new t(e.color).toString()),e.dashArray&&(i.dashArray=e.dashArray),e.dashoffset&&(i.dashOffset=e.dashoffset),e.style&&!e.dashArray&&(i.dashArray=l(e).join(",")||"none")),i}function $(t,i){const r={align:null,decoration:null,kerning:null,rotate:null,font:{style:null,variant:null,weight:null,size:null,family:null}};if(t){const n=t.alignBaseline,o="baseline"===n?"auto":"top"===n?"text-top":"bottom"===n?"hanging":n;r.align=t.align,r.dominantBaseline=o,r.decoration=t.decoration,r.kerning=t.kerning?"auto":"0",r.rotate=t.rotated?"90":"0",e(i),r.font.style=i.style||"normal",r.font.variant=i.variant||"normal",r.font.weight=i.weight||"normal",r.font.size=i.size&&i.size.toString()||"10pt",r.font.family=i.family||"serif"}return r}function A(t){const{pattern:e,linearGradient:i}=t;if(e)return u("pattern",{height:e.height,id:e.id,patternUnits:"userSpaceOnUse",width:e.width,x:e.x,y:e.y},u("image",{height:e.image.height,href:e.image.href,width:e.image.width,x:e.image.x,y:e.image.y}));if(i){const t=i.stops.map((t,e)=>u("stop",{key:`${e}-stop`,offset:t.offset,"stop-color":t.color}));return u("linearGradient",{gradientUnits:"userSpaceOnUse",id:i.id,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2},t)}return null}function G(t,e){if(!t||0===t.length)return null;const i=[];for(const r of t){const{shape:t,fill:e,stroke:n,font:o}=r,a=v(e),s=S(n),l="text"===t.type?$(t,o):null,h=M(t,a.fill,s,l);h&&i.push(h)}return u("mask",{id:e,maskUnits:"userSpaceOnUse"},u("g",null,i))}function N(t,e,i){return a(t,o(t),[e,i])}function z(t,e,i,r,a){return n(t,o(t),[e,i]),t[4]=t[4]*e-r*e+r,t[5]=t[5]*i-a*i+a,t}function B(t,e,i,r){const n=e%360*Math.PI/180;s(t,o(t),n);const a=Math.cos(n),l=Math.sin(n),h=t[4],f=t[5];return t[4]=h*a-f*l+r*l-i*a+i,t[5]=f*a+h*l-i*l-r*a+r,t}function I(t,e){x&&"left"in x?(null!=x.left&&x.left>t&&(x.left=t),(null==x.right||x.right<t)&&(x.right=t),(null==x.top||x.top>e)&&(x.top=e),(null==x.bottom||x.bottom<e)&&(x.bottom=e)):x={left:t,bottom:e,right:t,top:e}}function U(t){const e=t.args,i=e.length;let r;switch(t.action){case"M":case"L":case"C":case"S":case"Q":case"T":for(r=0;r<i;r+=2)I(e[r],e[r+1]);w.x=e[i-2],w.y=e[i-1];break;case"H":for(r=0;r<i;++r)I(e[r],w.y);w.x=e[i-1];break;case"V":for(r=0;r<i;++r)I(w.x,e[r]);w.y=e[i-1];break;case"m":{let t=0;"x"in w||(I(w.x=e[0],w.y=e[1]),t=2);for(r=t;r<i;r+=2)I(w.x+=e[r],w.y+=e[r+1]);break}case"l":case"t":for(r=0;r<i;r+=2)I(w.x+=e[r],w.y+=e[r+1]);break;case"h":for(r=0;r<i;++r)I(w.x+=e[r],w.y);break;case"v":for(r=0;r<i;++r)I(w.x,w.y+=e[r]);break;case"c":for(r=0;r<i;r+=6)I(w.x+e[r],w.y+e[r+1]),I(w.x+e[r+2],w.y+e[r+3]),I(w.x+=e[r+4],w.y+=e[r+5]);break;case"s":case"q":for(r=0;r<i;r+=4)I(w.x+e[r],w.y+e[r+1]),I(w.x+=e[r+2],w.y+=e[r+3]);break;case"A":for(r=0;r<i;r+=7)I(e[r+5],e[r+6]);w.x=e[i-2],w.y=e[i-1];break;case"a":for(r=0;r<i;r+=7)I(w.x+=e[r+5],w.y+=e[r+6])}}function F(t,e,i){const r=g[t.toLowerCase()];let n;"number"==typeof r&&(r?e.length>=r&&(n={action:t,args:e.slice(0,e.length-e.length%r)},i.push(n),U(n)):(n={action:t,args:[]},i.push(n),U(n)))}function O(t){const e=("string"!=typeof t.path?j(t.path):t.path).match(m),i=[];if(x={},w={},!e)return null;let r="",n=[];const o=e.length;for(let s=0;s<o;++s){const t=e[s],o=parseFloat(t);isNaN(o)?(r&&F(r,n,i),n=[],r=t):n.push(o)}F(r,n,i);const a={x:0,y:0,width:0,height:0};return x&&"left"in x&&(a.x=x.left,a.y=x.top,a.width=x.right-x.left,a.height=x.bottom-x.top),a}function E(t){const e={x:0,y:0,width:0,height:0};if("circle"===t.type)e.x=t.cx-t.r,e.y=t.cy-t.r,e.width=2*t.r,e.height=2*t.r;else if("ellipse"===t.type)e.x=t.cx-t.rx,e.y=t.cy-t.ry,e.width=2*t.rx,e.height=2*t.ry;else if("image"===t.type||"rect"===t.type)e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height;else if("path"===t.type){const i=O(t);e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height}return e}function T(t){const e={x:0,y:0,width:0,height:0};let i=null,r=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(const o of t)i?(i.x=Math.min(i.x,o.x),i.y=Math.min(i.y,o.y),r=Math.max(r,o.x+o.width),n=Math.max(n,o.y+o.height)):(i=e,i.x=o.x,i.y=o.y,r=o.x+o.width,n=o.y+o.height);return i&&(i.width=r-i.x,i.height=n-i.y),i}function L(t,e,n,o,a,s,l,h,f){let c=(l&&s?b(s,e):e)/2,u=(l&&s?b(s,n):n)/2;if(f){const t=f[0],e=f[1];c=(l&&s?b(s,t):t)/2,u=(l&&s?b(s,e):e)/2}const d=t.width+o,y=t.height+o,p=i(),g=i();let m=!1;if(a&&0!==d&&0!==y){const t=e!==n?e/n:d/y,i=e>n?e:n;let o=1,a=1;isNaN(i)||(t>1?(o=i/d,a=i/t/y):(a=i/y,o=i*t/d)),r(g,g,z(p,o,a,c,u)),m=!0}const x=t.x+(d-o)/2,w=t.y+(y-o)/2;if(r(g,g,N(p,c-x,u-w)),!m&&(d>e||y>n)){const t=d/e>y/n,i=(t?e:n)/(t?d:y);r(g,g,z(p,i,i,x,w))}return h&&r(g,g,N(p,h[0],h[1])),s&&r(g,g,B(p,s,x,w)),`matrix(${g[0]},${g[1]},${g[2]},${g[3]},${g[4]},${g[5]})`}function R(t,e,i){const r=t?.effects.find(t=>"bloom"===t.type);if(!r)return null;const{strength:n,radius:o}=r,a=n>0?o:0,s=(n+a)*e,l=4*n+1;return u("filter",{filterUnits:"userSpaceOnUse",height:"300%",id:`bloom${i}`,width:"300%",x:"-100%",y:"-100%"},u("feMorphology",{in:"SourceGraphic",operator:"dilate",radius:(n+.5*a)*(5**(e/100)*(.4+e/100)),result:"dilate"}),u("feGaussianBlur",{in:"dilate",result:"blur",stdDeviation:s/25}),u("feGaussianBlur",{in:"blur",result:"intensityBlur",stdDeviation:s/50}),u("feComponentTransfer",{in:"SourceGraphic",result:"intensityBrightness"},u("feFuncR",{slope:l,type:"linear"}),u("feFuncG",{slope:l,type:"linear"}),u("feFuncB",{slope:l,type:"linear"})),u("feMerge",null,u("feMergeNode",{in:"intensityBlur"}),u("feMergeNode",{in:"intensityBrightness"}),u("feGaussianBlur",{stdDeviation:n/10})))}function V(t,i,r,n={}){const o=[],a=[],s=h(),l=R(n.effectView,i,s);let f=null;if(l){const t=n.effectView?.effects.find(t=>"bloom"===t.type),e=n.clipBloomEffect||!t.strength?0:(t.strength+t.radius/2)/3,o=i+i*e,a=r+r*e;f=[Math.max(o,10),Math.max(a,10)]}let c=i,y=r;if(n.useRotationSize)for(let e=0;e<t.length;e++){const t=n.rotations?.[e]??0;c=Math.max(b(t,i),c),y=Math.max(b(t,r),y)}for(let e=0;e<t.length;e++){const s=t[e],l=[],h=[];let d=0,p=0,g=0;for(const t of s){const{shape:e,fill:i,stroke:r,font:a,offset:s}=t;n.ignoreStrokeWidth||"text"===e.type||(d+=r?.width||0);const f=v(i),c=S(r),u="text"===e.type?$(e,a):null;o.push(A(f)),l.push(M(e,f.fill,c,u,n.ariaLabel)),h.push(E(e)),s&&(p+=s[0],g+=s[1])}const m=n.rotations?.[e]??0;n.useRotationSize&&(p+=(c-b(m,i))/2,g+=(y-b(m,r))/2);const x=L(T(h),i,r,d,n.scale??!1,m,n.useRotationSize??!1,[p,g],f);let w=null;if(n.masking){const t=`mask-${e}`,i=n.masking[e];o.push(G(i,t)),w=`url(#${t})`}a.push(w?u("g",{mask:w},u("g",{transform:x},l)):u("g",{transform:x},l))}l&&(e(f),c=f[0],y=f[1]);const p="display: block;";return u("svg",{"aria-label":n.ariaLabel,focusable:!1,height:y,role:"img",style:p,width:c,xmlns:d},l,u("defs",null,o),l?u("g",{filter:`url(#bloom${s})`},a):a)}export{T as computeBBox,v as generateFillAttributes,S as generateStrokeAttributes,$ as generateTextAttributes,E as getBoundingBox,L as getTransformMatrix,A as renderDef,V as renderSVG,M as renderShape};
5
+ import t from"../../Color.js";import has from"../../core/has.js";import{assertIsSome as e}from"../../core/maybe.js";import{pt2px as i,toPt as r}from"../../core/screenUtils.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat2df32.js";import{multiply as o,scale as s,identity as a,translate as l,rotate as h}from"../../core/libs/gl-matrix-2/math/mat2d.js";import{getDashArray as c}from"./gfxUtils.js";import{nextBloomId as f,nextPatternId as u,nextLinearGradientId as d}from"./svgGlobalState.js";import"../../widgets/support/widgetUtils.js";import{tsx as y}from"../../widgets/support/jsxFactory.js";const p="http://www.w3.org/2000/svg",g=has("android"),m=has("chrome")||g&&g>=4?"auto":"optimizeLegibility",x={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},w=/([A-DF-Za-df-z])|([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let k={},b={};const j=Math.PI;function M(t,e){const i=t*(j/180);return Math.abs(e*Math.sin(i))+Math.abs(e*Math.cos(i))}function v(t){return t.map(t=>`${t.command} ${t.values.join(" ")}`).join(" ").trim()}function S(t,i,r,n,o){if(t){if("circle"===t.type)return y("circle",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",r:t.r,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-dashoffset":r.dashOffset,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("ellipse"===t.type)return y("ellipse",{cx:t.cx,cy:t.cy,fill:i,"fill-rule":"evenodd",rx:t.rx,ry:t.ry,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width});if("rect"===t.type)return y("rect",{fill:i,"fill-rule":"evenodd",height:t.height,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,width:t.width,x:t.x,y:t.y});if("image"===t.type)return y("image",{alt:o||"image",height:t.height,href:t.src,preserveAspectRatio:"none",width:t.width,x:t.x,y:t.y});if("path"===t.type){const e="string"!=typeof t.path?v(t.path):t.path;return y("path",{d:e,fill:i,"fill-rule":"evenodd",stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width})}if("text"===t.type)return e(n),y("text",{"dominant-baseline":n.dominantBaseline,fill:i,"fill-rule":"evenodd","font-family":n.font.family,"font-size":n.font.size,"font-style":n.font.style,"font-variant":n.font.variant,"font-weight":n.font.weight,kerning:n.kerning,rotate:n.rotate,stroke:r.color,"stroke-dasharray":r.dashArray,"stroke-linecap":r.cap,"stroke-linejoin":r.join,"stroke-miterlimit":"4","stroke-width":r.width,"text-anchor":n.align,"text-decoration":n.decoration,"text-rendering":m,x:t.x,y:t.y},t.text)}return null}function $(e){if(!e)return{fill:"none",pattern:null,linearGradient:null};if(!("type"in e))return{fill:new t(e).toString(),pattern:null,linearGradient:null};if("pattern"===e.type){const t=`patternId-${u()}`;return{fill:`url(#${t})`,pattern:{id:t,x:e.x,y:e.y,width:e.width,height:e.height,image:{x:0,y:0,width:e.width,height:e.height,href:e.src}},linearGradient:null}}const i=`linearGradientId-${d()}`;return{fill:`url(#${i})`,pattern:null,linearGradient:{id:i,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stops:e.colors.map(e=>({offset:e.offset,color:e.color&&new t(e.color).toString()}))}}}function A(e){const i={color:"none",width:1,cap:"butt",join:"4",dashArray:"none",dashOffset:"0"};return e&&(null!=e.width&&(i.width=e.width),e.cap&&(i.cap=e.cap),e.join&&(i.join=e.join.toString()),e.color&&(i.color=new t(e.color).toString()),e.dashArray&&(i.dashArray=e.dashArray),e.dashoffset&&(i.dashOffset=e.dashoffset),e.style&&!e.dashArray&&(i.dashArray=c(e).join(",")||"none")),i}function G(t,i){const r={align:null,decoration:null,kerning:null,rotate:null,font:{style:null,variant:null,weight:null,size:null,family:null}};if(t){const n=t.alignBaseline,o="baseline"===n?"auto":"top"===n?"text-top":"bottom"===n?"hanging":n;r.align=t.align,r.dominantBaseline=o,r.decoration=t.decoration,r.kerning=t.kerning?"auto":"0",r.rotate=t.rotated?"90":"0",e(i),r.font.style=i.style||"normal",r.font.variant=i.variant||"normal",r.font.weight=i.weight||"normal",r.font.size=i.size&&i.size.toString()||"10pt",r.font.family=i.family||"serif"}return r}function N(t){const{pattern:e,linearGradient:i}=t;if(e)return y("pattern",{height:e.height,id:e.id,patternUnits:"userSpaceOnUse",width:e.width,x:e.x,y:e.y},y("image",{height:e.image.height,href:e.image.href,width:e.image.width,x:e.image.x,y:e.image.y}));if(i){const t=i.stops.map((t,e)=>y("stop",{key:`${e}-stop`,offset:t.offset,"stop-color":t.color}));return y("linearGradient",{gradientUnits:"userSpaceOnUse",id:i.id,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2},t)}return null}function z(t,e){if(!t||0===t.length)return null;const i=[];for(const r of t){const{shape:t,fill:e,stroke:n,font:o}=r,s=$(e),a=A(n),l="text"===t.type?G(t,o):null,h=S(t,s.fill,a,l);h&&i.push(h)}return y("mask",{id:e,maskUnits:"userSpaceOnUse"},y("g",null,i))}function B(t,e,i){return l(t,a(t),[e,i])}function I(t,e,i,r,n){return s(t,a(t),[e,i]),t[4]=t[4]*e-r*e+r,t[5]=t[5]*i-n*i+n,t}function U(t,e,i,r){const n=e%360*Math.PI/180;h(t,a(t),n);const o=Math.cos(n),s=Math.sin(n),l=t[4],c=t[5];return t[4]=l*o-c*s+r*s-i*o+i,t[5]=c*o+l*s-i*s-r*o+r,t}function F(t,e){k&&"left"in k?(null!=k.left&&k.left>t&&(k.left=t),(null==k.right||k.right<t)&&(k.right=t),(null==k.top||k.top>e)&&(k.top=e),(null==k.bottom||k.bottom<e)&&(k.bottom=e)):k={left:t,bottom:e,right:t,top:e}}function E(t){const e=t.args,i=e.length;let r;switch(t.action){case"M":case"L":case"C":case"S":case"Q":case"T":for(r=0;r<i;r+=2)F(e[r],e[r+1]);b.x=e[i-2],b.y=e[i-1];break;case"H":for(r=0;r<i;++r)F(e[r],b.y);b.x=e[i-1];break;case"V":for(r=0;r<i;++r)F(b.x,e[r]);b.y=e[i-1];break;case"m":{let t=0;"x"in b||(F(b.x=e[0],b.y=e[1]),t=2);for(r=t;r<i;r+=2)F(b.x+=e[r],b.y+=e[r+1]);break}case"l":case"t":for(r=0;r<i;r+=2)F(b.x+=e[r],b.y+=e[r+1]);break;case"h":for(r=0;r<i;++r)F(b.x+=e[r],b.y);break;case"v":for(r=0;r<i;++r)F(b.x,b.y+=e[r]);break;case"c":for(r=0;r<i;r+=6)F(b.x+e[r],b.y+e[r+1]),F(b.x+e[r+2],b.y+e[r+3]),F(b.x+=e[r+4],b.y+=e[r+5]);break;case"s":case"q":for(r=0;r<i;r+=4)F(b.x+e[r],b.y+e[r+1]),F(b.x+=e[r+2],b.y+=e[r+3]);break;case"A":for(r=0;r<i;r+=7)F(e[r+5],e[r+6]);b.x=e[i-2],b.y=e[i-1];break;case"a":for(r=0;r<i;r+=7)F(b.x+=e[r+5],b.y+=e[r+6])}}function O(t,e,i){const r=x[t.toLowerCase()];let n;"number"==typeof r&&(r?e.length>=r&&(n={action:t,args:e.slice(0,e.length-e.length%r)},i.push(n),E(n)):(n={action:t,args:[]},i.push(n),E(n)))}function T(t){const e=("string"!=typeof t.path?v(t.path):t.path).match(w),i=[];if(k={},b={},!e)return null;let r="",n=[];const o=e.length;for(let a=0;a<o;++a){const t=e[a],o=parseFloat(t);isNaN(o)?(r&&O(r,n,i),n=[],r=t):n.push(o)}O(r,n,i);const s={x:0,y:0,width:0,height:0};return k&&"left"in k&&(s.x=k.left,s.y=k.top,s.width=k.right-k.left,s.height=k.bottom-k.top),s}function L(t){const e={x:0,y:0,width:0,height:0};if("circle"===t.type)e.x=t.cx-t.r,e.y=t.cy-t.r,e.width=2*t.r,e.height=2*t.r;else if("ellipse"===t.type)e.x=t.cx-t.rx,e.y=t.cy-t.ry,e.width=2*t.rx,e.height=2*t.ry;else if("image"===t.type||"rect"===t.type)e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height;else if("path"===t.type){const i=T(t);e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height}return e}function R(t){const e={x:0,y:0,width:0,height:0};let i=null,r=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(const o of t)i?(i.x=Math.min(i.x,o.x),i.y=Math.min(i.y,o.y),r=Math.max(r,o.x+o.width),n=Math.max(n,o.y+o.height)):(i=e,i.x=o.x,i.y=o.y,r=o.x+o.width,n=o.y+o.height);return i&&(i.width=r-i.x,i.height=n-i.y),i}function C(t,e,i,r,s,a,l,h,c){let f=(l&&a?M(a,e):e)/2,u=(l&&a?M(a,i):i)/2;if(c){const t=c[0],e=c[1];f=(l&&a?M(a,t):t)/2,u=(l&&a?M(a,e):e)/2}const d=t.width+r,y=t.height+r,p=n(),g=n();let m=!1;if(s&&0!==d&&0!==y){const t=e!==i?e/i:d/y,r=e>i?e:i;let n=1,s=1;isNaN(r)||(t>1?(n=r/d,s=r/t/y):(s=r/y,n=r*t/d)),o(g,g,I(p,n,s,f,u)),m=!0}const x=t.x+(d-r)/2,w=t.y+(y-r)/2;if(o(g,g,B(p,f-x,u-w)),!m&&(d>e||y>i)){const t=d/e>y/i,r=(t?e:i)/(t?d:y);o(g,g,I(p,r,r,x,w))}return h&&o(g,g,B(p,h[0],h[1])),a&&o(g,g,U(p,a,x,w)),`matrix(${g[0]},${g[1]},${g[2]},${g[3]},${g[4]},${g[5]})`}function D(t){const e=t?.match(/bloom\(\s*([^\s]+)\s+([^\s]+)\s+([^\s]+)\s*\)/i);if(!e)return null;const[,n,o,s]=e;return{strength:Number(n),radius:i(r(o)),threshold:Number(s)}}function V(t,e,i){const r=D(t);if(!r)return null;const{strength:n,radius:o}=r,s=n>0?o:0,a=(n+s)*e,l=4*n+1;return y("filter",{filterUnits:"userSpaceOnUse",height:"300%",id:`bloom${i}`,width:"300%",x:"-100%",y:"-100%"},y("feMorphology",{in:"SourceGraphic",operator:"dilate",radius:(n+.5*s)*(5**(e/100)*(.4+e/100)),result:"dilate"}),y("feGaussianBlur",{in:"dilate",result:"blur",stdDeviation:a/25}),y("feGaussianBlur",{in:"blur",result:"intensityBlur",stdDeviation:a/50}),y("feComponentTransfer",{in:"SourceGraphic",result:"intensityBrightness"},y("feFuncR",{slope:l,type:"linear"}),y("feFuncG",{slope:l,type:"linear"}),y("feFuncB",{slope:l,type:"linear"})),y("feMerge",null,y("feMergeNode",{in:"intensityBlur"}),y("feMergeNode",{in:"intensityBrightness"}),y("feGaussianBlur",{stdDeviation:n/10})))}function q(t,i,r,n={}){const o=[],s=[],a=f(),l=V(n.cssEffectFilter,i,a);let h=null;if(l){const t=D(n.cssEffectFilter),e=n.clipBloomEffect||!t?.strength?0:(t.strength+t.radius/2)/3,o=i+i*e,s=r+r*e;h=[Math.max(o,10),Math.max(s,10)]}let c=i,u=r;if(n.useRotationSize)for(let e=0;e<t.length;e++){const t=n.rotations?.[e]??0;c=Math.max(M(t,i),c),u=Math.max(M(t,r),u)}for(let e=0;e<t.length;e++){const a=t[e],l=[],f=[];let d=0,p=0,g=0;for(const t of a){const{shape:e,fill:i,stroke:r,font:s,offset:a}=t;n.ignoreStrokeWidth||"text"===e.type||(d+=r?.width||0);const h=$(i),c=A(r),u="text"===e.type?G(e,s):null;o.push(N(h)),l.push(S(e,h.fill,c,u,n.ariaLabel)),f.push(L(e)),a&&(p+=a[0],g+=a[1])}const m=n.rotations?.[e]??0;n.useRotationSize&&(p+=(c-M(m,i))/2,g+=(u-M(m,r))/2);const x=C(R(f),i,r,d,n.scale??!1,m,n.useRotationSize??!1,[p,g],h);let w=null;if(n.masking){const t=`mask-${e}`,i=n.masking[e];o.push(z(i,t)),w=`url(#${t})`}s.push(w?y("g",{mask:w},y("g",{transform:x},l)):y("g",{transform:x},l))}l&&(e(h),c=h[0],u=h[1]);const d="display: block;";return y("svg",{"aria-label":n.ariaLabel,focusable:!1,height:u,role:"img",style:d,width:c,xmlns:p},l,y("defs",null,o),l?y("g",{filter:`url(#bloom${a})`},s):s)}export{R as computeBBox,$ as generateFillAttributes,A as generateStrokeAttributes,G as generateTextAttributes,L as getBoundingBox,C as getTransformMatrix,N as renderDef,q as renderSVG,S as renderShape};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{px2pt as e}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as t}from"../../layers/support/layerUtils.js";import{loadArcade as l}from"../../support/loadArcade.js";import{getStroke as a}from"./gfxUtils.js";import{renderSymbol as i,renderOnce as r}from"./renderUtils.js";import{isSymbol3D as s}from"./typeUtils.js";import{applyColorToSymbol as o,applySizesToSymbol as n,applyRotationToSymbol as c,getCSSFilterFromEffectList as u,getColorFromSymbol as f,applyOpacityToColor as p}from"./utils.js";import{renderRelationshipRamp as y}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as h}from"../../widgets/Legend/support/relationshipRampUtils.js";let d=null;const m=[255,255,255];function b(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function g(e,t,l){const{backgroundColor:a,outline:i,dotSize:r}=e,s=l?.swatchSize||22,o=.8,n=Math.round(s*s/Math.max(r,.5)**2*o),c=window.devicePixelRatio,u=document.createElement("canvas"),f=s*c;u.width=f,u.height=f,u.style.width=u.width/c+"px",u.style.height=u.height/c+"px";const p=u.getContext("2d");if(a&&(p.fillStyle=a.toCss(!0),p.fillRect(0,0,f,f),p.fill()),p.fillStyle=t?.toCss(!0)??"",d&&d.length/2===n)for(let h=0;h<2*n;h+=2){const e=d[h],t=d[h+1];p.fillRect(e,t,r*c,r*c),p.fill()}else{d=[];for(let e=0;e<2*n;e+=2){const e=b(0,f),t=b(0,f);d.push(e,t),p.fillRect(e,t,r*c,r*c),p.fill()}}i&&(i.color&&(p.strokeStyle=i.color.toCss(!0)),p.lineWidth=i.width,p.strokeRect(0,0,f,f));const y=new Image(s,s);return y.src=u.toDataURL(),y.ariaLabel=l?.ariaLabel??null,y.alt=l?.ariaLabel??"",y}function w(e,t={}){const l=t.radius||40,r=2*Math.PI*l,s=e.length,o=r/s,n=[],c=a(t.outline);null!=c?.width&&(c.width*=2),(c||t.backgroundColor)&&n.push({shape:{type:"circle",cx:l,cy:l,r:l},fill:t.backgroundColor,stroke:c,offset:[0,0]});const u=t.values,f=u&&u.length===s&&100===u.reduce((e,t)=>e+t,0),p=[0];for(let a=0;a<s;a++){let t=null;f&&(t=u[a]*r/100,p.push(t+p[a])),n.push({shape:{type:"circle",cx:l,cy:l,r:l/2},fill:[0,0,0,0],stroke:{width:l,dashArray:`${(t??o)/2} ${r}`,dashoffset:"-"+(f?p[a]/2:a*(o/2)),color:e[a]},offset:[0,0]})}let y=null;const h=2*l+(c?.width||0),d=t.holePercentage;if(d){c&&n.push({shape:{type:"circle",cx:l,cy:l,r:l*d},fill:null,stroke:c,offset:[0,0]});const e=h/2;y=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:m,stroke:c?{...c,color:m}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:l*d},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return i([n],[h,h],{effectView:t.effectList,ignoreStrokeWidth:!0,masking:y,rotations:[-90],ariaLabel:t.ariaLabel})}function S(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:i}=l,s=h({focus:a,numClasses:i,infos:e.uniqueValueInfos}),o=t?.node||document.createElement("div");return r(o,()=>y(s,t.id||"relationship",{opacity:t.opacity||1,effectList:t.effectList,ariaLabel:t.ariaLabel})),o}function v(e,t={}){const l=24,a=75,i="horizontal"===t.align,r=i?a:l,s=i?l:a,o=t.width??r,n=t.height??s,c=t.gradient??!0,u=window.devicePixelRatio,f=o*u,p=n*u,y=document.createElement("canvas");y.width=f,y.height=p,y.ariaLabel=t.ariaLabel??null,y.style.width=`${o}px`,y.style.height=`${n}px`;const h=y.getContext("2d"),d=i?f:0,m=i?0:p;if(c){const t=h.createLinearGradient(0,0,d,m),l=e.length,a=1===l?0:1/(l-1);e.forEach((e,l)=>t.addColorStop(l*a,e.toString())),h.fillStyle=t,h.fillRect(0,0,f,p)}else{const t=i?f/e.length:f,l=i?p:p/e.length;let a=0,r=0;for(const s of e)h.fillStyle=s.toString(),h.fillRect(a,r,t,l),a=i?a+t:0,r=i?0:r+l}const b=document.createElement("div");return b.style.width=`${o}px`,b.style.height=`${n}px`,V(b,t?.effectList),b.appendChild(y),b}function V(e,t){if(!t)return;e.style.filter=u(t);const l=t.effects;if(l)for(const a of l)if("drop-shadow"===a?.type){a.offsetX<0?e.style.marginLeft=`${Math.abs(a.offsetX)}px`:e.style.marginRight=`${a.offsetX}px`;break}}async function k(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,k,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function L(e){return e&&"opacity"in e?e.opacity*L(e.parent):1}async function x(e,t){if(!e)return;const a=e.sourceLayer,i=(null!=t&&t.useSourceLayer?a:e.layer)??a,r=t?.ignoreOpacity?1:L(i);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):e.symbol.clone();return o(l,null,{add:r}),l}const s=t?.renderer??j(i);let u=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!u)return;if(u="web-style"===u.type?await u.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):u.clone(),!(s&&"visualVariables"in s&&s.visualVariables?.length&&C(u)))return o(u,null,{add:r}),u;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await l(),t=e}const{getColor:f,getOpacity:p,getAllSizes:y,getRotationAngle:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),d=[],m=[],b=[],g=[];for(const l of s.visualVariables)switch(l.type){case"color":d.push(l);break;case"opacity":m.push(l);break;case"rotation":g.push(l);break;case"size":l.target||b.push(l)}const w=!!d.length&&d[d.length-1],S=w?f(w,e,t):null,v=!!t?.ignoreOpacity,V=!!m.length&&m[m.length-1],k=V?p(V,e,t):null;if(o(u,S,v?void 0:{override:k,add:r}),b.length&&!0!==t?.ignoreSizeVariables){const l=y(b,e,t);await n(u,l)}if(!0!==t?.ignoreRotationVariables)for(const l of g)c(u,h(l,e,t),l.axis);return u}async function R(e,t){if(!e)return;const{layer:a,sourceLayer:i}=e,r=L(a??i);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):e.symbol.clone();return f(l,r)}const s=t?.renderer??j(a)??j(i);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):void 0;if(!o)return;o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):o.clone();const n=f(o,void 0);if(!s||!("visualVariables"in s)||"visualVariables"in s&&!s.visualVariables||"visualVariables"in s&&!s.visualVariables?.length||!C(o))return n?p(n,r):void 0;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await l(),t=e}const{getColor:c,getOpacity:u}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),y=[],h=[];if(s.visualVariables)for(const l of s.visualVariables)switch(l.type){case"color":y.push(l);break;case"opacity":h.push(l)}const d=y.length>0?y[y.length-1]:null,m=(d?c(d,e,t):void 0)??n,b=h.length>0?h[h.length-1]:null,g=b?u(b,e,t):null;return null!=m&&null!=g&&(m.a=g),m?p(m,r):null}function C(e){return!s(e)||"water"!==e.symbolLayers.at(0)?.type}function j(e){if(e)return"renderer"in e?e.renderer:void 0}async function F(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,r=l?.renderer??j(a)??j(i);if(!r)return null;if("visualVariables"in r&&r.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:s}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getDateFormatOptions:o}=await import("../../widgets/Legend/support/utils.js");let n=null;for(const c of r.visualVariables){const u=t?o(a,c,t.timeZone):null;let f=null;switch(c.type){case"color":f=await i(c,null,u);break;case"opacity":f=await i(c);break;case"size":c.target||(f=await s(r,c,null,l?.scale||t?.scale,t,u))}if(f?.length){const t=f.find((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===f?.length-1?a<=t.value:t.value===a});if(t){n=t.label;break}}}if(n)return n}switch(r.type){case"class-breaks":{const t="getClassBreakInfo"in r?await r.getClassBreakInfo(e,l):null;return t?.label??(t&&r.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in r?await r.getUniqueValueInfo(e,l):null;return t?.label}}return null}async function I(l,a){l?.layer&&t(l.layer)&&((l=l.cloneShallow()).layer=l.layer.findSublayerForFeature(l)??null);const i=null===l?a?.fallbackSymbol??null:await x(l,{ignoreGraphicSymbol:!!l.layer,ignoreOpacity:a?.ignoreOpacity??!0,ignoreRotationVariables:a?.ignoreRotationVariables??!0,ignoreSizeVariables:a?.ignoreSizeVariables??!0})??a?.fallbackSymbol??null;if(!i)return null;const r=await k(i,{geometry:a.useGeometryForShape?l?.geometry??null:null,useMarkerSymbolSize:!1!==a.useMarkerSymbolSize,size:{width:e(a.widthInPixels??16),height:e(a.heightInPixels??16)},..."cim"===i?.type?{cimOptions:{feature:{attributes:l?.attributes??{}}}}:{}});if(!r)return null;return"element"===(a?.format??"element")?r:r.outerHTML}export{R as getDisplayedColor,x as getDisplayedSymbol,F as getLegendLabel,I as previewGraphic,v as renderColorRampPreviewHTML,g as renderDotDensityPreviewHTML,w as renderPieChartPreviewHTML,k as renderPreviewHTML,S as renderRelationshipRampPreviewHTML};
5
+ import"../../core/has.js";import{pt2px as e,toPt as t,px2pt as l}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as a}from"../../layers/support/layerUtils.js";import{loadArcade as i}from"../../support/loadArcade.js";import{getStroke as r}from"./gfxUtils.js";import{renderSymbol as s,renderOnce as o}from"./renderUtils.js";import{isSymbol3D as n}from"./typeUtils.js";import{applyColorToSymbol as c,applySizesToSymbol as u,applyRotationToSymbol as p,getColorFromSymbol as f,applyOpacityToColor as y}from"./utils.js";import{renderRelationshipRamp as h}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as d}from"../../widgets/Legend/support/relationshipRampUtils.js";let m=null;const b=[255,255,255];function g(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function w(e,t,l){const{backgroundColor:a,outline:i,dotSize:r}=e,s=l?.swatchSize||22,o=.8,n=Math.round(s*s/Math.max(r,.5)**2*o),c=window.devicePixelRatio,u=document.createElement("canvas"),p=s*c;u.width=p,u.height=p,u.style.width=u.width/c+"px",u.style.height=u.height/c+"px";const f=u.getContext("2d");if(a&&(f.fillStyle=a.toCss(!0),f.fillRect(0,0,p,p),f.fill()),f.fillStyle=t?.toCss(!0)??"",m&&m.length/2===n)for(let h=0;h<2*n;h+=2){const e=m[h],t=m[h+1];f.fillRect(e,t,r*c,r*c),f.fill()}else{m=[];for(let e=0;e<2*n;e+=2){const e=g(0,p),t=g(0,p);m.push(e,t),f.fillRect(e,t,r*c,r*c),f.fill()}}i&&(i.color&&(f.strokeStyle=i.color.toCss(!0)),f.lineWidth=i.width,f.strokeRect(0,0,p,p));const y=new Image(s,s);return y.src=u.toDataURL(),y.ariaLabel=l?.ariaLabel??null,y.alt=l?.ariaLabel??"",y}function S(e,t={}){const l=t.radius||40,a=2*Math.PI*l,i=e.length,o=a/i,n=[],c=r(t.outline);null!=c?.width&&(c.width*=2),(c||t.backgroundColor)&&n.push({shape:{type:"circle",cx:l,cy:l,r:l},fill:t.backgroundColor,stroke:c,offset:[0,0]});const u=t.values,p=u&&u.length===i&&100===u.reduce((e,t)=>e+t,0),f=[0];for(let r=0;r<i;r++){let t=null;p&&(t=u[r]*a/100,f.push(t+f[r])),n.push({shape:{type:"circle",cx:l,cy:l,r:l/2},fill:[0,0,0,0],stroke:{width:l,dashArray:`${(t??o)/2} ${a}`,dashoffset:"-"+(p?f[r]/2:r*(o/2)),color:e[r]},offset:[0,0]})}let y=null;const h=2*l+(c?.width||0),d=t.holePercentage;if(d){c&&n.push({shape:{type:"circle",cx:l,cy:l,r:l*d},fill:null,stroke:c,offset:[0,0]});const e=h/2;y=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:b,stroke:c?{...c,color:b}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:l*d},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return s([n],[h,h],{cssEffectFilter:t.cssEffectFilter,ignoreStrokeWidth:!0,masking:y,rotations:[-90],ariaLabel:t.ariaLabel})}function v(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:i}=l,r=d({focus:a,numClasses:i,infos:e.uniqueValueInfos}),s=t?.node||document.createElement("div");return o(s,()=>h(r,t.id||"relationship",{opacity:t.opacity||1,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel})),s}function V(e,t={}){const l=24,a=75,i="horizontal"===t.align,r=i?a:l,s=i?l:a,o=t.width??r,n=t.height??s,c=t.gradient??!0,u=window.devicePixelRatio,p=o*u,f=n*u,y=document.createElement("canvas");y.width=p,y.height=f,y.ariaLabel=t.ariaLabel??null,y.style.width=`${o}px`,y.style.height=`${n}px`;const h=y.getContext("2d"),d=i?p:0,m=i?0:f;if(c){const t=h.createLinearGradient(0,0,d,m),l=e.length,a=1===l?0:1/(l-1);e.forEach((e,l)=>t.addColorStop(l*a,e.toString())),h.fillStyle=t,h.fillRect(0,0,p,f)}else{const t=i?p/e.length:p,l=i?f:f/e.length;let a=0,r=0;for(const s of e)h.fillStyle=s.toString(),h.fillRect(a,r,t,l),a=i?a+t:0,r=i?0:r+l}const b=document.createElement("div");return b.style.width=`${o}px`,b.style.height=`${n}px`,x(b,t?.cssEffectFilter),b.appendChild(y),b}function k(e){const t=e.match(/drop-shadow\(\s*([^\s]+)\s+[^\s]+\s+[^\s]+\s+.+?\)/);return t?t[1]:null}function x(l,a){if(!a)return;l.style.filter=a;const i=k(a);if(i){const a=e(t(i));a<0?l.style.marginLeft=`${Math.abs(a)}px`:l.style.marginRight=`${a}px`}}async function L(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,L,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function R(e){return e&&"opacity"in e?e.opacity*R(e.parent):1}async function C(e,t){if(!e)return;const l=e.sourceLayer,a=(null!=t&&t.useSourceLayer?l:e.layer)??l,r=t?.ignoreOpacity?1:R(a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):e.symbol.clone();return c(l,null,{add:r}),l}const s=t?.renderer??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!o)return;if(o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables?.length&&j(o)))return c(o,null,{add:r}),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:n,getOpacity:f,getAllSizes:y,getRotationAngle:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),d=[],m=[],b=[],g=[];for(const i of s.visualVariables)switch(i.type){case"color":d.push(i);break;case"opacity":m.push(i);break;case"rotation":g.push(i);break;case"size":i.target||b.push(i)}const w=!!d.length&&d[d.length-1],S=w?n(w,e,t):null,v=!!t?.ignoreOpacity,V=!!m.length&&m[m.length-1],k=V?f(V,e,t):null;if(c(o,S,v?void 0:{override:k,add:r}),b.length&&!0!==t?.ignoreSizeVariables){const l=y(b,e,t);await u(o,l)}if(!0!==t?.ignoreRotationVariables)for(const i of g)p(o,h(i,e,t),i.axis);return o}async function F(e,t){if(!e)return;const{layer:l,sourceLayer:a}=e,r=R(l??a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):e.symbol.clone();return f(l,r)}const s=t?.renderer??I(l)??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):void 0;if(!o)return;o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):o.clone();const n=f(o,void 0);if(!s||!("visualVariables"in s)||"visualVariables"in s&&!s.visualVariables||"visualVariables"in s&&!s.visualVariables?.length||!j(o))return n?y(n,r):void 0;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:c,getOpacity:u}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),p=[],h=[];if(s.visualVariables)for(const i of s.visualVariables)switch(i.type){case"color":p.push(i);break;case"opacity":h.push(i)}const d=p.length>0?p[p.length-1]:null,m=(d?c(d,e,t):void 0)??n,b=h.length>0?h[h.length-1]:null,g=b?u(b,e,t):null;return null!=m&&null!=g&&(m.a=g),m?y(m,r):null}function j(e){return!n(e)||"water"!==e.symbolLayers.at(0)?.type}function I(e){if(e)return"renderer"in e?e.renderer:void 0}async function U(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,r=l?.renderer??I(a)??I(i);if(!r)return null;if("visualVariables"in r&&r.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:s}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getDateFormatOptions:o}=await import("../../widgets/Legend/support/utils.js");let n=null;for(const c of r.visualVariables){const u=t?o(a,c,t.timeZone):null;let p=null;switch(c.type){case"color":p=await i(c,null,u);break;case"opacity":p=await i(c);break;case"size":c.target||(p=await s(r,c,null,l?.scale||t?.scale,t,u))}if(p?.length){const t=p.find((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===p?.length-1?a<=t.value:t.value===a});if(t){n=t.label;break}}}if(n)return n}switch(r.type){case"class-breaks":{const t="getClassBreakInfo"in r?await r.getClassBreakInfo(e,l):null;return t?.label??(t&&r.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in r?await r.getUniqueValueInfo(e,l):null;return t?.label}}return null}async function z(e,t){e?.layer&&a(e.layer)&&((e=e.cloneShallow()).layer=e.layer.findSublayerForFeature(e)??null);const i=null===e?t?.fallbackSymbol??null:await C(e,{ignoreGraphicSymbol:!!e.layer,ignoreOpacity:t?.ignoreOpacity??!0,ignoreRotationVariables:t?.ignoreRotationVariables??!0,ignoreSizeVariables:t?.ignoreSizeVariables??!0})??t?.fallbackSymbol??null;if(!i)return null;const r=await L(i,{geometry:t.useGeometryForShape?e?.geometry??null:null,useMarkerSymbolSize:!1!==t.useMarkerSymbolSize,size:{width:l(t.widthInPixels??16),height:l(t.heightInPixels??16)},..."cim"===i?.type?{cimOptions:{feature:{attributes:e?.attributes??{}}}}:{}});if(!r)return null;return"element"===(t?.format??"element")?r:r.outerHTML}export{F as getDisplayedColor,C as getDisplayedSymbol,U as getLegendLabel,z as previewGraphic,V as renderColorRampPreviewHTML,w as renderDotDensityPreviewHTML,S as renderPieChartPreviewHTML,L as renderPreviewHTML,v as renderRelationshipRampPreviewHTML};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import"../../core/has.js";import{px2pt as r}from"../../core/screenUtils.js";import{ONES as o}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as n}from"../../layers/effects/jsonUtils.js";import{getCIMSymbolColor as l}from"./cimSymbolUtils.js";import{getStroke as i}from"./gfxUtils.js";import{Symbol3DMaterial as c}from"./Symbol3DMaterial.js";import{isSymbol3D as u,isSymbol2D as s}from"./typeUtils.js";function a(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function f(e){if(!e)return 0;if(u(e)){const t=a(e);return null!=t?t:0}return r(i(e)?.width)}function m(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.color}function y(t){if(!t)return null;if(u(t))return m(t);const r=i(t)?.color;return r?new e(r):null}function p(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some(e=>"object"===e.type);case"line-3d":return e.symbolLayers.some(e=>"path"===e.type);case"polygon-3d":return e.symbolLayers.some(e=>"object"===e.type||"extrude"===e.type);default:return!1}}function h(e){return e.resource?.href??""}function d(t,r){if(!t)return null;let o=null;return u(t)?o=b(t):s(t)&&(o="cim"===t.type?l(t):t.color?new e(t.color):null),o?w(o,r):null}function b(t){const r=t.symbolLayers;if(!r)return null;let o=null;return r.forEach(e=>{"object"===e.type&&e.resource?.href||(o="water"===e.type?e.color:e.material?e.material.color:null)}),o?new e(o):null}function w(t,r){if(null==r||null==t)return t;const o=t.toRgba();return o[3]=o[3]*r,new e(o)}function j(t,r,o){const n=t.symbolLayers;if(!n)return;const l=(t,n=!1)=>{let l=r??t??null;return null!=o?.override&&(!l&&n&&(l=new e([255,255,255])),l&&(l.a=o.override)),w(l,o?.add)};n.forEach(e=>{if("water"===e.type)return void(e.color=w(e.color,o?.add));const t=null!=e.material?e.material.color:null,r=l(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new c({color:r}):e.material.color=r,"outline"in e&&e.outline?.color&&null!=o?.add&&(e.outline.color=w(e.outline.color,o.add)),"marker"in e&&null!=e.marker&&(e.marker.color=l(e.marker.color))})}function k(e,t,r){t=t??e.color,null!=r?.override&&t&&(t.a=r.override),t&&(e.color=w(t,r?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=w(e.outline.color,r?.add))}function g(t,r,o){t&&(r||null!=o)&&(r&&(r=new e(r)),u(t)?j(t,r,o):s(t)&&k(t,r,o))}async function L(e,r){const o=e.symbolLayers;o&&await t(o,async e=>v(e,r))}async function v(e,t){switch(e.type){case"extrude":S(e,t);break;case"icon":case"line":case"text":z(e,t);break;case"path":E(e,t);break;case"object":await U(e,t)}}function z(e,t){const r=x(t);null!=r&&(e.size=r)}function x(e){for(const t of e)if("number"==typeof t)return t;return null}function S(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}async function U(e,t){const{resourceSize:r,symbolSize:o}=await R(e),n=O(t,r,o);null!=n&&(e.width=C(t[0],o[0],r[0],n),e.depth=C(t[1],o[1],r[1],n),e.height=C(t[2],o[2],r[2],n))}function E(e,t){const r=O(t,o,[e.width,void 0,e.height]);null!=r&&(e.width=C(t[0],e.width,1,r),e.height=C(t[2],e.height,1,r))}function O(e,t,r){for(let o=0;o<3;o++){const n=e[o];switch(n){case"symbol-value":{const e=r[o];return null!=e?e/t[o]:1}case"proportional":break;default:if(n&&t[o])return n/t[o]}}return null}async function R(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),r=await t(e,10),{width:o,height:n,depth:l}=e,i=[o,l,n];let c=1;for(let u=0;u<3;u++){const e=i[u];if(null!=e){c=e/r[u];break}}for(let u=0;u<3;u++)null==i[u]&&(i[u]=r[u]*c);return{resourceSize:r,symbolSize:i}}function C(e,t,r,o){switch(e){case"proportional":return r*o;case"symbol-value":return null!=t?t:r;default:return e}}function D(e,t){const r=x(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}async function J(e,t){if(e&&t)return u(e)?L(e,t):void(s(e)&&D(e,t))}function M(e,t,r){if(e&&null!=t)if(u(e)){const o=e.symbolLayers;o&&o.forEach(e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else s(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle+=t))}function N(e){if(!e)return null;const t=e.effects.filter(e=>"bloom"!==e.type).map(e=>e.toJSON());return n(t)}function q(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some(e=>"extrude"===e.type)}export{g as applyColorToSymbol,w as applyOpacityToColor,M as applyRotationToSymbol,J as applySizesToSymbol,N as getCSSFilterFromEffectList,d as getColorFromSymbol,h as getIconHref,y as getSymbolOutlineColor,f as getSymbolOutlineSize,p as isVolumetricSymbol,q as symbolHasExtrudeSymbolLayer};
5
+ import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import"../../core/has.js";import{px2pt as r}from"../../core/screenUtils.js";import{ONES as o}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as n}from"../../layers/effects/jsonUtils.js";import{getCIMSymbolColor as l}from"./cimSymbolUtils.js";import{getStroke as i}from"./gfxUtils.js";import{Symbol3DMaterial as c}from"./Symbol3DMaterial.js";import{isSymbol3D as u,isSymbol2D as s}from"./typeUtils.js";function a(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function f(e){if(!e)return 0;if(u(e)){const t=a(e);return null!=t?t:0}return r(i(e)?.width)}function m(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.color}function y(t){if(!t)return null;if(u(t))return m(t);const r=i(t)?.color;return r?new e(r):null}function p(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some(e=>"object"===e.type);case"line-3d":return e.symbolLayers.some(e=>"path"===e.type);case"polygon-3d":return e.symbolLayers.some(e=>"object"===e.type||"extrude"===e.type);default:return!1}}function h(e){return e.resource?.href??""}function d(t,r){if(!t)return null;let o=null;return u(t)?o=b(t):s(t)&&(o="cim"===t.type?l(t):t.color?new e(t.color):null),o?w(o,r):null}function b(t){const r=t.symbolLayers;if(!r)return null;let o=null;return r.forEach(e=>{"object"===e.type&&e.resource?.href||(o="water"===e.type?e.color:e.material?e.material.color:null)}),o?new e(o):null}function w(t,r){if(null==r||null==t)return t;const o=t.toRgba();return o[3]=o[3]*r,new e(o)}function j(t,r,o){const n=t.symbolLayers;if(!n)return;const l=(t,n=!1)=>{let l=r??t??null;return null!=o?.override&&(!l&&n&&(l=new e([255,255,255])),l&&(l.a=o.override)),w(l,o?.add)};n.forEach(e=>{if("water"===e.type)return void(e.color=w(e.color,o?.add));const t=null!=e.material?e.material.color:null,r=l(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new c({color:r}):e.material.color=r,"outline"in e&&e.outline?.color&&null!=o?.add&&(e.outline.color=w(e.outline.color,o.add)),"marker"in e&&null!=e.marker&&(e.marker.color=l(e.marker.color))})}function k(e,t,r){t=t??e.color,null!=r?.override&&t&&(t.a=r.override),t&&(e.color=w(t,r?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=w(e.outline.color,r?.add))}function g(t,r,o){t&&(r||null!=o)&&(r&&(r=new e(r)),u(t)?j(t,r,o):s(t)&&k(t,r,o))}async function L(e,r){const o=e.symbolLayers;o&&await t(o,async e=>v(e,r))}async function v(e,t){switch(e.type){case"extrude":S(e,t);break;case"icon":case"line":case"text":z(e,t);break;case"path":E(e,t);break;case"object":await U(e,t)}}function z(e,t){const r=x(t);null!=r&&(e.size=r)}function x(e){for(const t of e)if("number"==typeof t)return t;return null}function S(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}async function U(e,t){const{resourceSize:r,symbolSize:o}=await R(e),n=O(t,r,o);null!=n&&(e.width=C(t[0],o[0],r[0],n),e.depth=C(t[1],o[1],r[1],n),e.height=C(t[2],o[2],r[2],n))}function E(e,t){const r=O(t,o,[e.width,void 0,e.height]);null!=r&&(e.width=C(t[0],e.width,1,r),e.height=C(t[2],e.height,1,r))}function O(e,t,r){for(let o=0;o<3;o++){const n=e[o];switch(n){case"symbol-value":{const e=r[o];return null!=e?e/t[o]:1}case"proportional":break;default:if(n&&t[o])return n/t[o]}}return null}async function R(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),r=await t(e,10),{width:o,height:n,depth:l}=e,i=[o,l,n];let c=1;for(let u=0;u<3;u++){const e=i[u];if(null!=e){c=e/r[u];break}}for(let u=0;u<3;u++)null==i[u]&&(i[u]=r[u]*c);return{resourceSize:r,symbolSize:i}}function C(e,t,r,o){switch(e){case"proportional":return r*o;case"symbol-value":return null!=t?t:r;default:return e}}function D(e,t){const r=x(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}async function J(e,t){if(e&&t)return u(e)?L(e,t):void(s(e)&&D(e,t))}function M(e,t,r){if(e&&null!=t)if(u(e)){const o=e.symbolLayers;o&&o.forEach(e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else s(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle+=t))}function N(e,t){if(!e)return null;const r=(t?e.effects:e.effects.filter(e=>"bloom"!==e.type)).map(e=>e.toJSON());return n(r)}function q(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some(e=>"extrude"===e.type)}export{g as applyColorToSymbol,w as applyOpacityToColor,M as applyRotationToSymbol,J as applySizesToSymbol,N as getCSSFilterFromEffectList,d as getColorFromSymbol,h as getIconHref,y as getSymbolOutlineColor,f as getSymbolOutlineSize,p as isVolumetricSymbol,q as symbolHasExtrudeSymbolLayer};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as s}from"../../../../core/asyncUtils.js";import{abortMaybe as o,removeMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as r}from"../../../../core/promiseUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{connectVisualization as l}from"../../../analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js";import{highlightsSupported as n}from"../../../support/layerViewUtils.js";let p=class extends t{constructor(i){super(i),this._highlightTask=null,this._highlightHandle=null}initialize(){this.addHandles(l({analysisViewData:this.analysisViewData,onRemove:()=>this._remove(),onShowSketchedGraphic:()=>this._remove(),onHighlight:(i,t)=>this._highlight(i,t)}))}destroy(){this._remove()}get updating(){return null!=this._highlightTask&&!this._highlightTask.finished}_remove(){this._highlightTask=o(this._highlightTask),this._highlightHandle=e(this._highlightHandle)}_highlight(i,t){this._remove(),t&&"building-component"!==t.type&&"subtype-sublayer"!==t.type&&(this._highlightTask=s(async s=>{const o=await this.view.whenLayerView(t);r(s),n(o)&&(this._highlightHandle=o.highlight(i))}))}};i([h({constructOnly:!0})],p.prototype,"view",void 0),i([h({constructOnly:!0})],p.prototype,"analysisViewData",void 0),i([h()],p.prototype,"updating",null),p=i([a("esri.views.2d.analysis.ElevationProfile.ElevationProfileInputVisualization2D")],p);export{p as ElevationProfileInputVisualization2D};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import r from"../../../../core/Accessor.js";import{getContrast as o}from"../../../../core/colorUtils.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{throttle as a}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import n from"../../../../layers/GraphicsLayer.js";import c from"../../../../symbols/CIMSymbol.js";import{getConfig as m}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as y}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{createLineGeometry as d}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let h=class extends r{constructor(e){super(e),this._graphic=new t,this._layer=new n({listMode:"hide",internal:!0}),this._updateGeometryThrottled=a(e=>{if(!e)return void(this._layer.visible=!1);const t=this.view.map?.layers;t&&!t.includes(this._layer)&&t.add(this._layer),this._layer.visible=!0,this._graphic.geometry=d(e.samples,e.spatialReference)},m().profileLinesUpdateThrottleMillis)}initialize(){this._layer.add(this._graphic),this.addHandles([i(()=>y(this.analysisViewData.analysis.input),()=>{this._layer.visible=!1},s),i(()=>this._colorUpdateParameters,e=>this._updateColor(e),s),i(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),s),this._updateGeometryThrottled])}destroy(){this.view.map?.remove(this._layer),this._layer.destroy(),this._graphic.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){const{results:e,visible:t}=this.analysisViewData;return t?e.find(e=>e.available&&e.computation.profileLine.viewOptions.lineVisible):null}get _geometryUpdateParameters(){const e=this._result;return 1!==e?.progress?null:{samples:e.samples,spatialReference:this.view.spatialReference}}get _colorUpdateParameters(){const e=this._result?.computation.profileLine.color;return e?{color:e.toArray(),contrastColor:o(e).toArray()}:null}_updateColor(e){e&&(this._graphic.symbol=new c({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,10],lineDashEnding:"HalfPattern",controlPointEnding:"HalfPattern"}],capStyle:"Butt",width:1.5,color:e.color},{type:"CIMSolidStroke",capStyle:"Butt",width:2,color:e.contrastColor}]}}}))}};e([l({constructOnly:!0})],h.prototype,"view",void 0),e([l({constructOnly:!0})],h.prototype,"analysisViewData",void 0),e([l()],h.prototype,"updating",null),e([l()],h.prototype,"_result",null),e([l()],h.prototype,"_geometryUpdateParameters",null),e([l()],h.prototype,"_colorUpdateParameters",null),h=e([p("esri.views.2d.analysis.ElevationProfile.ElevationProfileLineVisualization2D")],h);export{h as ElevationProfileLineVisualization2D};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileInputVisualization2D as a}from"./ElevationProfileInputVisualization2D.js";import{ElevationProfileLineVisualization2D as e}from"./ElevationProfileLineVisualization2D.js";import{ElevationProfileHoveredPointsVisualization as r}from"../../../analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js";let n=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new r({view:i,analysisViewData:o}),this._inputVisualization=new a({view:i,analysisViewData:o}),this._lineVisualization=new e({view:i,analysisViewData:o})}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._lineVisualization.destroy()}get updating(){return this._hoveredPointsVisualization.updating||this._inputVisualization.updating||this._lineVisualization.updating}};i([t()],n.prototype,"view",void 0),i([t()],n.prototype,"analysisViewData",void 0),i([t()],n.prototype,"updating",null),n=i([s("esri.views.2d.analysis.ElevationProfile.ElevationProfileVisualization2D")],n);export{n as ElevationProfileVisualization2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView2D as s}from"./AnalysisView2D.js";let o=class extends s{constructor(e){super(e),this.type="elevation-profile-view-2d",this.analysis=null}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return!1}get visible(){return super.visible}set visible(e){super.visible=e}};e([r({readOnly:!0})],o.prototype,"type",void 0),e([r({constructOnly:!0,nonNullable:!0})],o.prototype,"analysis",void 0),e([r({readOnly:!0})],o.prototype,"updating",null),o=e([t("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],o);const i=o;export{i as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView2D as r}from"./AnalysisView2D.js";import{ElevationProfileVisualization2D as s}from"./ElevationProfile/ElevationProfileVisualization2D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as n}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends r{constructor(t){super(t),this.type="elevation-profile-view-2d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:o}=this;this._controller=new l({analysis:t,analysisViewData:this,view:o,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":throw new e("elevation-profile-analysis-view-2d:unsupported","The scene profile line type is not supported in 2D views.")}}}}),this._visualization=new s({view:o,analysisViewData:this}),this._sketchTool=new c({view:o,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualization.destroy(),this._sketchTool?.destroy()}get units(){return this._controller.units}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return!0===this._controller.updating||!0===this._visualization.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([o({readOnly:!0})],u.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([o({readOnly:!0})],u.prototype,"units",null),t([o()],u.prototype,"hoveredPosition",void 0),t([o()],u.prototype,"hoveredPoints",null),t([o({readOnly:!0})],u.prototype,"progress",null),t([o({readOnly:!0})],u.prototype,"results",null),t([o({readOnly:!0})],u.prototype,"statistics",null),t([o({readOnly:!0})],u.prototype,"updating",null),t([o()],u.prototype,"sketchGraphic",null),t([o()],u.prototype,"toolState",null),t([o()],u.prototype,"_controller",void 0),t([o()],u.prototype,"_visualization",void 0),t([o()],u.prototype,"_sketchTool",void 0),u=t([i("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],u);const h=u;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../core/mathUtils.js";import{meterIn as n}from"../../../../renderers/support/lengthUtils.js";const e=Math.PI;function r(t,n){switch(n.transformationType){case"additive":return a(t,n);case"constant":return s(n,t);case"clamped-linear":return u(t,n);case"proportional":return o(t,n);case"stops":return c(t,n);case"real-world-size":return l(t,n);case"identity":return t;case"unknown":return null}}function i(t,n){return"number"==typeof t?t:r(n,t)}function a(t,n){return t+(i(n.minSize,t)||n.minDataValue)}function s(t,n){const e=t.stops;let r=e?.length&&e[0].size;return null==r&&(r=t.minSize),i(r,n)}function u(t,n){const e=n.minDataValue,r=n.maxDataValue,a=(t-e)/(r-e),s=i(n.minSize,t),u=i(n.maxSize,t);return t<=e?s:t>=r?u:s+a*(u-s)}function o(n,e){const r=n/e.minDataValue,a=i(e.minSize,n),s=i(e.maxSize,n);let u=null;return u=r*a,t(u,a,s)}function c(t,n){const[e,r,a]=m(t,n.cache.ipData);if(e===r)return i(n.stops[e].size,t);{const s=i(n.stops[e].size,t);return s+(i(n.stops[r].size,t)-s)*a}}function l(r,a){const s=n[a.valueUnit],u=i(a.minSize,r),o=i(a.maxSize,r),{valueRepresentation:c}=a;let l=null;return l="area"===c?2*Math.sqrt(r/e)/s:"radius"===c||"distance"===c?2*r/s:r/s,t(l,u,o)}function m(t,n){if(!n)return;let e=0,r=n.length-1;return n.some((n,i)=>t<n?(r=i,!0):(e=i,!1)),[e,r,(t-n[e])/(n[r]-n[e])]}export{r as getSizeForValueSimple};
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{meterIn as n}from"../../../../renderers/support/lengthUtils.js";const e=Math.PI;function r(t,n){switch(n.transformationType){case"additive":return a(t,n);case"constant":return s(n,t);case"clamped-linear":return u(t,n);case"proportional":return o(t,n);case"stops":return c(t,n);case"real-world-size":return l(t,n);case"identity":return t;case"unknown":return null}}function i(t,n){return"number"==typeof t?t:r(n,t)}function a(t,n){return t+(i(n.minSize,t)||n.minDataValue)}function s(t,n){const e=t.stops;let r=e?.length&&e[0].size;return null==r&&(r=t.minSize),i(r,n)}function u(t,n){const e=n.minDataValue,r=n.maxDataValue,a=(t-e)/(r-e),s=i(n.minSize,t),u=i(n.maxSize,t);return t<=e?s:t>=r?u:s+a*(u-s)}function o(n,e){const r=n/e.minDataValue,a=i(e.minSize,n),s=i(e.maxSize,n);let u=null;return u=r*a,t(u,a,s)}function c(t,n){const[e,r,a]=m(t,n.cache.ipData);if(e===r)return i(n.stops[e].size,t);{const s=i(n.stops[e].size,t);return s+(i(n.stops[r].size,t)-s)*a}}function l(t,r){const i=n[r.valueUnit],{valueRepresentation:a}=r;let s=null;return s="area"===a?2*Math.sqrt(t/e)/i:"radius"===a||"distance"===a?2*t/i:t/i,s}function m(t,n){if(!n)return;let e=0,r=n.length-1;return n.some((n,i)=>t<n?(r=i,!0):(e=i,!1)),[e,r,(t-n[e])/(n[r]-n[e])]}export{r as getSizeForValueSimple};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as e}from"../../../../core/asyncUtils.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import{abortMaybe as r,removeMaybe as l}from"../../../../core/maybe.js";import{throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as h}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{getGraphicEffectiveElevationInfo as m}from"../../../../support/elevationInfoUtils.js";import{Settings as p}from"../../interactive/editingTools/settings.js";import{OutlineVisualElement as g}from"../../interactive/visualElements/OutlineVisualElement.js";import{GraphicState as u}from"../../layers/graphics/GraphicState.js";import{getInputGeometry as d,isValidInputPath as v}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{connectVisualization as f}from"../../../analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js";import{highlightsSupported as y}from"../../../support/layerViewUtils.js";let _=class extends t{constructor(i){super(i),this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null}initialize(){this._settings=new p({getTheme:()=>this.view.effectiveTheme}),this.addHandles(f({analysisViewData:this.analysisViewData,onRemove:()=>this._remove(),onShowSketchedGraphic:i=>this._showSketchedGraphic(i),onHighlight:(i,t)=>this._highlight(i,t)}))}destroy(){this._remove()}get updating(){return null!=this._highlightTask&&!this._highlightTask.finished}_remove(){this._highlightTask=r(this._highlightTask),this._highlightHandle=l(this._highlightHandle),this._visualElementHandle=l(this._visualElementHandle)}_highlight(i,t){this._remove(),t&&"building-component"!==t.type&&"subtype-sublayer"!==t.type&&(this._highlightTask=e(async e=>{const s=await this.view.whenLayerView(t);a(e),y(s)&&(this._highlightHandle=s.highlight(i))}))}_showSketchedGraphic(i){this._remove();const{view:t}=this,e=new g({view:t,geometry:j(i),attached:!1,elevationInfo:m(i),renderOccluded:8,isDecoration:!0}),r=new u({graphic:i}),l=[h(()=>r.isDraped,i=>{e.isDraped=i}),r.on("changed",()=>{e.geometry=j(i)}),t.trackGraphicState(r),t.maskOccludee(i),s(e)];this._settings.visualElements.lineObjects.outline.apply(e),e.attached=!0,this._visualElementHandle=o(l)}};function j(i){const t=d(i);return v(t)?t:null}i([n({constructOnly:!0})],_.prototype,"view",void 0),i([n({constructOnly:!0})],_.prototype,"analysisViewData",void 0),i([n()],_.prototype,"updating",null),_=i([c("esri.views.3d.analysis.ElevationProfile.ElevationProfileInputVisualization3D")],_);export{_ as ElevationProfileInputVisualization3D};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as u}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as c}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{createLineGeometry as f}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let v=class extends i{constructor(e){super(e),this._updateGeometryThrottled=r(e=>{e&&(this._visualElement.visible=!0,this._visualElement.geometry=f(e.samples,e.spatialReference))},u().profileLinesUpdateThrottleMillis)}initialize(){this._visualElement=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0}),this.addHandles([s(()=>({color:this.getResult()?.computation.profileLine.color,visible:this._effectiveVisible}),({color:e,visible:i})=>{e&&(this._visualElement.color=p(t.toUnitRGBA(e))),this._visualElement.visible=i,i||(this._visualElement.geometry=null)},o),s(()=>c(this.analysisViewData.analysis.input),()=>{this._visualElement.visible=!1,this._visualElement.geometry=null},o),s(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),o),this._updateGeometryThrottled])}destroy(){this._visualElement.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.getResult()}get _effectiveVisible(){const{analysisViewData:e,_result:t}=this;return e.visible&&null!=t&&t.available&&t.computation.profileLine.viewOptions.lineVisible}get _geometryUpdateParameters(){if(!this._effectiveVisible)return null;const e=this._result;return 1!==e?.progress?null:{samples:e.samples,spatialReference:this.view.spatialReference}}};e([l()],v.prototype,"view",void 0),e([l()],v.prototype,"analysisViewData",void 0),e([l()],v.prototype,"getResult",void 0),e([l()],v.prototype,"updating",null),e([l()],v.prototype,"_result",null),e([l()],v.prototype,"_effectiveVisible",null),e([l()],v.prototype,"_geometryUpdateParameters",null),v=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineVisualization3D")],v);export{v as ElevationProfileLineVisualization3D};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{mapCollection as t}from"../../../../core/mapCollectionUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileInputVisualization3D as e}from"./ElevationProfileInputVisualization3D.js";import{ElevationProfileLineVisualization3D as r}from"./ElevationProfileLineVisualization3D.js";import{ElevationProfileHoveredPointsVisualization as n}from"../../../analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js";let l=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new n({view:i,analysisViewData:o}),this._inputVisualization=new e({view:i,analysisViewData:o}),this._lineVisualizations=t(()=>this.analysisViewData.analysis.profiles,t=>new r({view:i,analysisViewData:o,getResult:()=>o.results.find(i=>i.computation.profileLine===t)}))}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._lineVisualizations.destroy()}get updating(){return this._inputVisualization.updating||this._lineVisualizations.some(i=>i.updating)}};i([s()],l.prototype,"view",void 0),i([s()],l.prototype,"analysisViewData",void 0),i([s()],l.prototype,"updating",null),l=i([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization3D")],l);export{l as ElevationProfileVisualization3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as i}from"./AnalysisView3D.js";import{ElevationProfileSceneLineComputation as r}from"./ElevationProfile/ElevationProfileSceneLineComputation.js";import{ElevationProfileVisualization as s}from"./ElevationProfile/ElevationProfileVisualization.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as n}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends i{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new r(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new c({view:e,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualization.destroy(),this._sketchTool?.destroy()}get units(){return this._controller.units}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return!0===this._controller.updating||!0===this._visualization.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([e({readOnly:!0})],u.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([e({readOnly:!0})],u.prototype,"units",null),t([e()],u.prototype,"hoveredPosition",void 0),t([e()],u.prototype,"hoveredPoints",null),t([e({readOnly:!0})],u.prototype,"progress",null),t([e({readOnly:!0})],u.prototype,"results",null),t([e({readOnly:!0})],u.prototype,"statistics",null),t([e({readOnly:!0})],u.prototype,"updating",null),t([e()],u.prototype,"sketchGraphic",null),t([e()],u.prototype,"toolState",null),t([e()],u.prototype,"_controller",void 0),t([e()],u.prototype,"_visualization",void 0),t([e()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],u);const h=u;export{h as default};
5
+ import{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as i}from"./AnalysisView3D.js";import{ElevationProfileSceneLineComputation as r}from"./ElevationProfile/ElevationProfileSceneLineComputation.js";import{ElevationProfileVisualization3D as s}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as n}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends i{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new r(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new c({view:e,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualization.destroy(),this._sketchTool?.destroy()}get units(){return this._controller.units}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return!0===this._controller.updating||!0===this._visualization.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([e({readOnly:!0})],u.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([e({readOnly:!0})],u.prototype,"units",null),t([e()],u.prototype,"hoveredPosition",void 0),t([e()],u.prototype,"hoveredPoints",null),t([e({readOnly:!0})],u.prototype,"progress",null),t([e({readOnly:!0})],u.prototype,"results",null),t([e({readOnly:!0})],u.prototype,"statistics",null),t([e({readOnly:!0})],u.prototype,"updating",null),t([e()],u.prototype,"sketchGraphic",null),t([e()],u.prototype,"toolState",null),t([e()],u.prototype,"_controller",void 0),t([e()],u.prototype,"_visualization",void 0),t([e()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],u);const h=u;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import o from"../../../../core/Accessor.js";import{equals as t}from"../../../../core/arrayUtils.js";import{clone as s}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{G as n}from"../../../../chunks/vec32.js";import{clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as a}from"../../../../geometry/support/ray.js";var m;let y=m=class extends o{constructor(r){super(r)}clone(){return new m({type:this.type,id:s(this.id),mapPoint:s(this.mapPoint),renderPoint:c(this.renderPoint),normal:s(this.normal),ray:s(this.ray),graphic:this.graphic})}equals(r){return this.type===r.type&&this.id===r.id&&i(this.mapPoint,r.mapPoint)&&n(this.renderPoint,r.renderPoint)&&t(this.normal,r.normal)&&a(this.ray,r.ray)&&this.graphic===r.graphic}};r([e()],y.prototype,"type",void 0),r([e({constructOnly:!0})],y.prototype,"id",void 0),r([e({constructOnly:!0})],y.prototype,"mapPoint",void 0),r([e({constructOnly:!0})],y.prototype,"renderPoint",void 0),r([e({constructOnly:!0})],y.prototype,"normal",void 0),r([e({constructOnly:!0})],y.prototype,"graphic",void 0),r([e({constructOnly:!0})],y.prototype,"ray",void 0),y=m=r([p("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],y);export{y as LineOfSightIntersectionResult};
5
+ import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{equalsMaybe as s}from"../../../../core/maybe.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{G as c}from"../../../../chunks/vec32.js";import{equals as n}from"../../../../geometry/support/ray.js";let p=class extends o{constructor(t){super(t)}clone(){return this}equals(t){return this.context?.type===t.context?.type&&(!this.context||!t.context||this.context.equals(t.context))&&this.id===t.id&&s(this.mapPoint,t.mapPoint)&&c(this.renderPoint,t.renderPoint)&&r(this.normal,t.normal)&&n(this.ray,t.ray)}};t([e({constructOnly:!0})],p.prototype,"context",void 0),t([e({constructOnly:!0})],p.prototype,"id",void 0),t([e({constructOnly:!0})],p.prototype,"mapPoint",void 0),t([e({constructOnly:!0})],p.prototype,"renderPoint",void 0),t([e({constructOnly:!0})],p.prototype,"normal",void 0),t([e({constructOnly:!0})],p.prototype,"ray",void 0),p=t([i("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],p);class a{constructor(t){this.graphic=t,this.type="graphic"}equals(t){return t.type===this.type&&this.graphic===t.graphic}}class y{constructor(){this.type="ground"}equals(t){return t.type===this.type}}const u=new y;export{a as LineOfSightIntersectionContextGraphic,p as LineOfSightIntersectionResult,u as lineOfSightIntersectionContextGround};