@arcgis/core 5.1.0-next.20 → 5.1.0-next.22

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 (356) hide show
  1. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -0
  2. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -0
  3. package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +1 -0
  4. package/analysis/VolumeMeasurementAnalysis.d.ts +3 -2
  5. package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +45 -15
  6. package/applications/Components/QuantityFormatter.d.ts +11 -11
  7. package/applications/Components/SelectionOperation.d.ts +11 -11
  8. package/applications/Components/SketchTooltipControls.d.ts +9 -9
  9. package/applications/Components/actionUtils.d.ts +2 -1
  10. package/applications/Components/analysisUtils.d.ts +27 -26
  11. package/applications/Components/applySetUtils.d.ts +40 -40
  12. package/applications/Components/arcadeEditorUtils.d.ts +3 -3
  13. package/applications/Components/arcadeFeatureUtils.d.ts +12 -12
  14. package/applications/Components/baUtils.d.ts +8 -8
  15. package/applications/Components/basemapUtils.d.ts +2 -2
  16. package/applications/Components/clipboard.d.ts +14 -14
  17. package/applications/Components/drawUtils.d.ts +3 -3
  18. package/applications/Components/editUtils.d.ts +14 -14
  19. package/applications/Components/featureUtils.d.ts +10 -10
  20. package/applications/Components/fieldFormatUtils.d.ts +2 -2
  21. package/applications/Components/fontUtils.d.ts +2 -2
  22. package/applications/Components/formatUtils.d.ts +2 -2
  23. package/applications/Components/getDefaultUnits.d.ts +2 -2
  24. package/applications/Components/gfxUtils.d.ts +5 -1
  25. package/applications/Components/imageryUtils.d.ts +35 -35
  26. package/applications/Components/layerOriginUtils.d.ts +5 -5
  27. package/applications/Components/layersEffectsJsonUtils.d.ts +2 -2
  28. package/applications/Components/previewSymbol2D.d.ts +2 -2
  29. package/applications/Components/rasterFunctionEditorUtils.d.ts +40 -40
  30. package/applications/Components/reactiveUtils.d.ts +14 -13
  31. package/applications/Components/sanitizerUtils.d.ts +2 -2
  32. package/applications/Components/stringUtils.d.ts +5 -5
  33. package/applications/Components/styleUtils.d.ts +2 -2
  34. package/applications/Components/svgUtils.d.ts +4 -4
  35. package/applications/Components/symbolUtils.d.ts +47 -11
  36. package/applications/Components/templateUtils.d.ts +73 -17
  37. package/applications/Components/templateUtils.js +1 -1
  38. package/applications/Components/testUtils.d.ts +3 -3
  39. package/applications/Components/unitUtils.d.ts +1 -1
  40. package/applications/Components/viewUtils.d.ts +2 -2
  41. package/applications/Components/webStyleSymbolUtils.d.ts +2 -2
  42. package/applications/Excalibur/imageryLayerUtils.d.ts +3 -3
  43. package/applications/Excalibur/videoViewUtils.d.ts +8 -8
  44. package/applications/Excalibur/widgetUtils.d.ts +2 -2
  45. package/applications/ExperienceBuilder/sketchUtils.d.ts +7 -7
  46. package/applications/KnowledgeStudio/dataModelVisualization.d.ts +20 -8
  47. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +21 -21
  48. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +35 -35
  49. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +9 -9
  50. package/applications/KnowledgeStudio/reshape.d.ts +40 -40
  51. package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +11 -11
  52. package/applications/MapViewer/layerUtils.d.ts +2 -2
  53. package/applications/MapViewer/mediaUtils.d.ts +13 -13
  54. package/applications/MapViewer/templateUtils.d.ts +20 -20
  55. package/applications/PortalApp/layerUtils.d.ts +2 -2
  56. package/applications/SceneViewer/colorUtils.d.ts +2 -2
  57. package/applications/SceneViewer/devEnvironmentUtils.d.ts +4 -3
  58. package/applications/SceneViewer/layerUtils.d.ts +3 -3
  59. package/applications/SceneViewer/sceneViewerUtils.d.ts +34 -34
  60. package/applications/SceneViewer/symbolUtils.d.ts +2 -2
  61. package/applications/Urban/LineImagePattern3D.d.ts +3 -2
  62. package/applications/Urban/imagePatternUtils.d.ts +4 -4
  63. package/applications/Urban/meshUtils.d.ts +2 -2
  64. package/applications/WebEditor/sketchUtils.d.ts +8 -8
  65. package/assets/esri/core/workers/RemoteClient.js +1 -1
  66. package/assets/esri/core/workers/chunks/03d11c7056fea763cbac.js +1 -0
  67. package/assets/esri/core/workers/chunks/05e5b9082c0a396df7e5.js +1 -0
  68. package/assets/esri/core/workers/chunks/08445fcba84ed7c23b3f.js +1 -0
  69. package/assets/esri/core/workers/chunks/0c706cdff6eac940eaab.js +1 -0
  70. package/assets/esri/core/workers/chunks/10a8612e7b2c74a8ce9a.js +1 -0
  71. package/assets/esri/core/workers/chunks/{df321c37b61099f6e4c2.js → 11058e660139c427c3e7.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{2ddb8bb00b3af83ebd7c.js → 14792047c5519dd89828.js} +1 -1
  73. package/assets/esri/core/workers/chunks/1a1e57267306c07e5bdb.js +1 -0
  74. package/assets/esri/core/workers/chunks/1bb5aa1e3693e0c68b18.js +1 -0
  75. package/assets/esri/core/workers/chunks/1cd091fa567fc4026356.js +1 -0
  76. package/assets/esri/core/workers/chunks/1dcd057695f8db79eca2.js +1 -0
  77. package/assets/esri/core/workers/chunks/{3ed7f19f77a11fa4d047.js → 2063b49607a03f7718ee.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{74a6d840813ac29b0bda.js → 209acb3ad16c99bb506c.js} +1 -1
  79. package/assets/esri/core/workers/chunks/21decfc1e477fb769204.js +1 -0
  80. package/assets/esri/core/workers/chunks/21e04705cad9fef1b01b.js +1 -0
  81. package/assets/esri/core/workers/chunks/23cb0611abe1031c513c.js +1 -0
  82. package/assets/esri/core/workers/chunks/285f3b07de852bfc1604.js +1 -0
  83. package/assets/esri/core/workers/chunks/2c61a53962093a331225.js +1 -0
  84. package/assets/esri/core/workers/chunks/2ecfd6edab796194bf88.js +1 -0
  85. package/assets/esri/core/workers/chunks/2f23af31b1190754ce13.js +1 -0
  86. package/assets/esri/core/workers/chunks/31eb59eae4c89b76e302.js +1 -0
  87. package/assets/esri/core/workers/chunks/3e61e7805dc6ff284831.js +1 -0
  88. package/assets/esri/core/workers/chunks/4150774059d67a8def74.js +1 -0
  89. package/assets/esri/core/workers/chunks/416c57df61fbd193078b.js +1 -0
  90. package/assets/esri/core/workers/chunks/46d28a0c20263012faff.js +1 -0
  91. package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js → 4754610760f3f634adf9.js} +2 -2
  92. package/assets/esri/core/workers/chunks/{f5cebeaad3e7d87d7997.js → 4fc6dd1423075e145b29.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js → 527547fa10d52cb3a7b1.js} +2 -2
  94. package/assets/esri/core/workers/chunks/5480d4cc342a2669a8ab.js +1 -0
  95. package/assets/esri/core/workers/chunks/{e8495c655a0a4f534636.js → 551fee27bf3abf0c41fd.js} +1 -1
  96. package/assets/esri/core/workers/chunks/568d32ceee1409809e5a.js +1 -0
  97. package/assets/esri/core/workers/chunks/576995021660e8b34705.js +1 -0
  98. package/assets/esri/core/workers/chunks/57e375d8a8db9fa57193.js +1 -0
  99. package/assets/esri/core/workers/chunks/5cbc12545f42a32fb960.js +1 -0
  100. package/assets/esri/core/workers/chunks/61ebbae0773fccc1f2bf.js +1 -0
  101. package/assets/esri/core/workers/chunks/63c297b6b7438f49e7ee.js +1 -0
  102. package/assets/esri/core/workers/chunks/6b56c8ba978ec6edd6b8.js +1 -0
  103. package/assets/esri/core/workers/chunks/{53f8c1d56ef3b24d2226.js → 6c853fd89f0e9f102c6e.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{946698d9cefffdb63082.js → 6e32e7b2ea2ea1a1fc04.js} +1 -1
  105. package/assets/esri/core/workers/chunks/6f12854c5846edfe3239.js +1 -0
  106. package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js → 7189e03cc24f5c10865a.js} +2 -2
  107. package/assets/esri/core/workers/chunks/7b59ddad3c73f5f44b4d.js +1 -0
  108. package/assets/esri/core/workers/chunks/7c417d2bf432e4055b3d.js +30 -0
  109. package/assets/esri/core/workers/chunks/8021cb732f8136d87048.js +1 -0
  110. package/assets/esri/core/workers/chunks/84124c1a41a96192f81c.js +1 -0
  111. package/assets/esri/core/workers/chunks/845bbd82ddacbb62ad28.js +1 -0
  112. package/assets/esri/core/workers/chunks/868c8a152cb1452b9a94.js +1 -0
  113. package/assets/esri/core/workers/chunks/879ce85c50b0348056b2.js +1 -0
  114. package/assets/esri/core/workers/chunks/87a7d405a0b9a541d7f2.js +1 -0
  115. package/assets/esri/core/workers/chunks/9522430d34d29c1ffb1a.js +1 -0
  116. package/assets/esri/core/workers/chunks/9647f3983f955da21093.js +1 -0
  117. package/assets/esri/core/workers/chunks/9694b4b85168a38ca24b.js +1 -0
  118. package/assets/esri/core/workers/chunks/{83d913dab3c2b0d6a7cc.js → 9736299a4ac0e21f08a7.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{e7bee85f28d7ec03825a.js → 973e3743cb7fdaa27f80.js} +1 -1
  120. package/assets/esri/core/workers/chunks/9b2d0d36ee6c04c347df.js +1 -0
  121. package/assets/esri/core/workers/chunks/{2662750d5761ed2d0eb7.js → 9e7eea56e96f012f9ff4.js} +1 -1
  122. package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js → a35d1be700ebd3109397.js} +2 -2
  123. package/assets/esri/core/workers/chunks/a4919dd9963f853a0077.js +1 -0
  124. package/assets/esri/core/workers/chunks/a4a4ce33de6432ba4dc3.js +1 -0
  125. package/assets/esri/core/workers/chunks/{aece665144aed2065ffc.js → a78ac951c00f090d9024.js} +1 -1
  126. package/assets/esri/core/workers/chunks/a7dbd38bc216713044fc.js +1 -0
  127. package/assets/esri/core/workers/chunks/{0debabe324c873066885.js → aa3bdfd00f666c6cc521.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{db5bbc240a1b8cd5af52.js → abc2471cfa9430ca5645.js} +1 -1
  129. package/assets/esri/core/workers/chunks/b2a67fe89f6505498bc3.js +1 -0
  130. package/assets/esri/core/workers/chunks/{b8b2f160518e3a225d99.js → b364ec104dd59faa41b6.js} +1 -1
  131. package/assets/esri/core/workers/chunks/b4254fcb2051c873f2ba.js +1 -0
  132. package/assets/esri/core/workers/chunks/{a53fa34681efff8fc024.js → b859d98fa1c39f8e4099.js} +1 -1
  133. package/assets/esri/core/workers/chunks/c09bc36347e8eb9fff00.js +1 -0
  134. package/assets/esri/core/workers/chunks/c2cda93905f0a49a6931.js +1 -0
  135. package/assets/esri/core/workers/chunks/c3e4f8664988e50bda55.js +1 -0
  136. package/assets/esri/core/workers/chunks/{3d0aa5f2db79c022243e.js → c794f7be868e53ca4a8c.js} +1 -1
  137. package/assets/esri/core/workers/chunks/cada79c174027f7a0df8.js +1 -0
  138. package/assets/esri/core/workers/chunks/cf100c80b75ba74b479c.js +1 -0
  139. package/assets/esri/core/workers/chunks/d10c65cde3565d399275.js +1 -0
  140. package/assets/esri/core/workers/chunks/d44217de4c73475f9c66.js +1 -0
  141. package/assets/esri/core/workers/chunks/d587b7842091affdaac3.js +1 -0
  142. package/assets/esri/core/workers/chunks/d70678598f4080adfb39.js +1 -0
  143. package/assets/esri/core/workers/chunks/dad9c25f1b7cacf7b052.js +1 -0
  144. package/assets/esri/core/workers/chunks/{0facd2c143a04cc7c4ff.js → deee88e3f1641c6ef5db.js} +1 -1
  145. package/assets/esri/core/workers/chunks/e063cce778944fe97dd3.js +1 -0
  146. package/assets/esri/core/workers/chunks/e37e7ae2de974cef9a90.js +1 -0
  147. package/assets/esri/core/workers/chunks/e44ed205f74df34adb8b.js +1 -0
  148. package/assets/esri/core/workers/chunks/e6220c1fa887e21ffbbd.js +1 -0
  149. package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js → eaeb95be8d4032513247.js} +2 -2
  150. package/assets/esri/core/workers/chunks/{93515f52d9b5fa12bd04.js → eb4934d3a3b82316c7c6.js} +1 -1
  151. package/assets/esri/core/workers/chunks/{23c856265dd24ce54fdb.js → f1c1f7583fa13dff9b5c.js} +1 -1
  152. package/assets/esri/core/workers/chunks/f27bbb4e26297d3c68de.js +1 -0
  153. package/assets/esri/core/workers/chunks/f4480636a910eaa4c531.js +1 -0
  154. package/assets/esri/core/workers/chunks/{5b991b0d4ca257291cb0.js → f5c5a9e771074f780fc8.js} +1 -1
  155. package/assets/esri/core/workers/chunks/f82a95c46f0d579d5bf5.js +1 -0
  156. package/assets/esri/core/workers/chunks/fb3a42cdd0d3105ec551.js +1 -0
  157. package/chunks/Clouds.glsl.js +1 -1
  158. package/config.js +1 -1
  159. package/core/MultiOriginJSONSupport.d.ts +1 -1
  160. package/core/ReadOnlyMultiOriginJSONSupport.d.ts +5 -4
  161. package/geometry/FlatGeometry.js +1 -1
  162. package/geometry/support/curves/curveUtils.js +1 -1
  163. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  164. package/graphic/graphicOriginUtils.js +1 -1
  165. package/kernel.js +1 -1
  166. package/layers/FeatureLayer.d.ts +7 -9
  167. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  168. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  169. package/layers/WMTSLayer.js +1 -1
  170. package/layers/graphics/data/QueryEngineResult.js +1 -1
  171. package/layers/graphics/editingSupport.js +1 -1
  172. package/layers/raster/datasets/MRFRaster.js +1 -1
  173. package/layers/support/SceneModification.js +1 -1
  174. package/layers/support/Sublayer.d.ts +3 -0
  175. package/package.json +2 -2
  176. package/renderers/VectorFieldRenderer.js +1 -1
  177. package/renderers/support/DictionaryControlString.js +1 -1
  178. package/renderers/support/DictionaryLoader.js +1 -1
  179. package/rest/featureService/FeatureService.js +1 -1
  180. package/smartMapping/support/utils.js +1 -1
  181. package/support/revision.js +1 -1
  182. package/symbols/cim/CIMSymbolHelper.js +1 -1
  183. package/symbols/cim/GeometryWalker.js +1 -1
  184. package/symbols/cim/SDFHelper.js +1 -1
  185. package/symbols/cim/animationUtils.js +1 -1
  186. package/symbols/cim/cimAnalyzer.js +1 -1
  187. package/symbols/cim/effects/EffectDashes.js +1 -1
  188. package/symbols/cim/effects/EffectDonut.js +1 -1
  189. package/symbols/cim/effects/EffectOffset.js +1 -1
  190. package/symbols/cim/effects/EffectWave.js +1 -1
  191. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  192. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  193. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  194. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  195. package/symbols/cim/rasterizingUtils.js +1 -1
  196. package/symbols/cim/types.d.ts +220 -117
  197. package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
  198. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -0
  199. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +1 -0
  200. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -0
  201. package/views/3d/environment/CloudsRenderer.js +1 -1
  202. package/views/3d/environment/Fog.js +1 -1
  203. package/views/3d/environment/FogTechnique.js +1 -1
  204. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  205. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  206. package/views/3d/layers/Lyr3DWorker.js +1 -1
  207. package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
  208. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  209. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  210. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  211. package/views/3d/layers/support/patternUtils.js +1 -1
  212. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  213. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  214. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  215. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  216. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  217. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  218. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  219. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  220. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  221. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  222. package/views/3d/webgl-engine/lib/Material.js +1 -1
  223. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  224. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  225. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  226. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  227. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  228. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  229. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  230. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  231. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  232. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  233. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  234. package/views/3d/webgl-engine/materials/renderers/IndexBufferCache.js +2 -0
  235. package/views/3d/webgl-engine/materials/renderers/IndexLayout.js +2 -0
  236. package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
  237. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  238. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  239. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  240. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  241. package/views/SelectionManager.d.ts +9 -9
  242. package/views/SelectionManager.js +1 -1
  243. package/views/View.d.ts +13 -2
  244. package/views/draw/support/Reshape.js +1 -1
  245. package/views/draw/support/reshapeUtils.js +1 -1
  246. package/views/draw/support/types.d.ts +8 -1
  247. package/views/interactive/support/utils.js +1 -1
  248. package/views/layers/FeatureLikeLayerView.d.ts +24 -24
  249. package/views/webgl/BufferObject.js +1 -1
  250. package/widgets/Attribution/AttributionViewModel.d.ts +3 -1
  251. package/widgets/Attribution/AttributionViewModel.js +1 -1
  252. package/widgets/Attribution.d.ts +1 -1
  253. package/widgets/Attribution.js +1 -1
  254. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  255. package/widgets/Editor/EditorViewModel.d.ts +2 -22
  256. package/widgets/Editor/EditorViewModel.js +1 -1
  257. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  258. package/widgets/Editor/UpdateWorkflow.js +1 -1
  259. package/widgets/Editor/Workflow.js +1 -1
  260. package/widgets/Editor/support/SketchController.js +1 -1
  261. package/widgets/Editor/workflowUtils.js +1 -1
  262. package/widgets/Editor.d.ts +10 -15
  263. package/widgets/Editor.js +1 -1
  264. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +0 -15
  265. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  266. package/widgets/FeatureTable/support/types.d.ts +0 -1
  267. package/widgets/FeatureTable.d.ts +1 -19
  268. package/widgets/FeatureTable.js +1 -1
  269. package/widgets/FeatureTemplates.d.ts +1 -1
  270. package/widgets/FeatureTemplates.js +1 -1
  271. package/widgets/HistogramRangeSlider.d.ts +1 -1
  272. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  273. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  274. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  275. package/widgets/PanoramicVideoViewer.js +1 -1
  276. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  277. package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
  278. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  279. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  280. package/widgets/PanoramicViewer/utils.js +1 -1
  281. package/widgets/Sketch/SketchViewModel.d.ts +4 -22
  282. package/widgets/Sketch/SketchViewModel.js +1 -1
  283. package/widgets/Sketch/support/PluginManager.js +1 -1
  284. package/widgets/Sketch/support/sketchUtils.js +1 -1
  285. package/widgets/Sketch.d.ts +10 -17
  286. package/widgets/Sketch.js +1 -1
  287. package/assets/esri/core/workers/chunks/026c00ee272c64e53daf.js +0 -1
  288. package/assets/esri/core/workers/chunks/0883c4e63424d6746ada.js +0 -1
  289. package/assets/esri/core/workers/chunks/0987cb20148f65222b44.js +0 -1
  290. package/assets/esri/core/workers/chunks/0a1f88cf16bcbb53b371.js +0 -1
  291. package/assets/esri/core/workers/chunks/0bb3beedae1b73beb1fc.js +0 -1
  292. package/assets/esri/core/workers/chunks/0ca405ca26676137a4be.js +0 -1
  293. package/assets/esri/core/workers/chunks/0ce968c89c35535da63e.js +0 -1
  294. package/assets/esri/core/workers/chunks/0d56e3b3265a4470aaa6.js +0 -1
  295. package/assets/esri/core/workers/chunks/144c719d5ba9e3a30961.js +0 -1
  296. package/assets/esri/core/workers/chunks/1503ca177e2466ec0e87.js +0 -1
  297. package/assets/esri/core/workers/chunks/1597d7b380d510ff5252.js +0 -1
  298. package/assets/esri/core/workers/chunks/1880c3b293cdfa804625.js +0 -1
  299. package/assets/esri/core/workers/chunks/1bea32b02d35ddb9b118.js +0 -1
  300. package/assets/esri/core/workers/chunks/1d78ec98eef7fef08f86.js +0 -1
  301. package/assets/esri/core/workers/chunks/1e6271524602e159dbad.js +0 -1
  302. package/assets/esri/core/workers/chunks/1f96d597ba736e088168.js +0 -1
  303. package/assets/esri/core/workers/chunks/26e41b08efe77d247409.js +0 -1
  304. package/assets/esri/core/workers/chunks/297b58f29c496923e1f3.js +0 -1
  305. package/assets/esri/core/workers/chunks/2a2a9fa62969644ea200.js +0 -1
  306. package/assets/esri/core/workers/chunks/2b296378d21e4e3c11d4.js +0 -1
  307. package/assets/esri/core/workers/chunks/2cbcf34cf896a438999b.js +0 -1
  308. package/assets/esri/core/workers/chunks/394b645d51e7bf799382.js +0 -1
  309. package/assets/esri/core/workers/chunks/50ab9a3f8bbb268fae59.js +0 -1
  310. package/assets/esri/core/workers/chunks/5a8b3e5977c233d5c9d0.js +0 -1
  311. package/assets/esri/core/workers/chunks/5b2dd164dd84fd1ca4f7.js +0 -1
  312. package/assets/esri/core/workers/chunks/62c228ca16fdc7a2c695.js +0 -1
  313. package/assets/esri/core/workers/chunks/639202a461b17840a13f.js +0 -1
  314. package/assets/esri/core/workers/chunks/693d269637135047a0c4.js +0 -1
  315. package/assets/esri/core/workers/chunks/6a14ec2d2de6778a4e7a.js +0 -1
  316. package/assets/esri/core/workers/chunks/6d3467997b5d01630b08.js +0 -1
  317. package/assets/esri/core/workers/chunks/6dfcb0c804e63e87e311.js +0 -1
  318. package/assets/esri/core/workers/chunks/778ab9e4c3928b0d7d74.js +0 -1
  319. package/assets/esri/core/workers/chunks/8012fdc49a7a10982f78.js +0 -1
  320. package/assets/esri/core/workers/chunks/85e0fd618625a639387f.js +0 -1
  321. package/assets/esri/core/workers/chunks/86465d4bb185d7460087.js +0 -1
  322. package/assets/esri/core/workers/chunks/87e7378b242debbfd575.js +0 -1
  323. package/assets/esri/core/workers/chunks/90b19e60c056f32623e7.js +0 -1
  324. package/assets/esri/core/workers/chunks/9461f7225c42cf15a114.js +0 -1
  325. package/assets/esri/core/workers/chunks/978649cb6df99ee728be.js +0 -1
  326. package/assets/esri/core/workers/chunks/9f5f4da954228d876219.js +0 -1
  327. package/assets/esri/core/workers/chunks/a2323c957c8b2fe225b4.js +0 -1
  328. package/assets/esri/core/workers/chunks/a36a33f43610c3cd985b.js +0 -1
  329. package/assets/esri/core/workers/chunks/a381932eef77f4d80292.js +0 -1
  330. package/assets/esri/core/workers/chunks/b089947c9a492c96ca27.js +0 -1
  331. package/assets/esri/core/workers/chunks/b6e4c35b76379088035c.js +0 -1
  332. package/assets/esri/core/workers/chunks/bbf2afa05314e267893f.js +0 -1
  333. package/assets/esri/core/workers/chunks/bd2f577cae61facdde4a.js +0 -1
  334. package/assets/esri/core/workers/chunks/bf2bfc0d78be8c185d58.js +0 -1
  335. package/assets/esri/core/workers/chunks/c4a78ab84186c7be599a.js +0 -1
  336. package/assets/esri/core/workers/chunks/c6e0ada6f2ad74fddfec.js +0 -1
  337. package/assets/esri/core/workers/chunks/c9d600dc6b6b5aafff1c.js +0 -1
  338. package/assets/esri/core/workers/chunks/ca33847a997ccfe8ddc2.js +0 -1
  339. package/assets/esri/core/workers/chunks/cca19c9564be2d02a277.js +0 -1
  340. package/assets/esri/core/workers/chunks/ccc2f2b3db008d8a495f.js +0 -1
  341. package/assets/esri/core/workers/chunks/d9f900975ac915a0f24f.js +0 -1
  342. package/assets/esri/core/workers/chunks/dcc8363faa22e6211351.js +0 -1
  343. package/assets/esri/core/workers/chunks/dd5d66f067e2386e0514.js +0 -1
  344. package/assets/esri/core/workers/chunks/e081d6f21a2c01ccaf61.js +0 -1
  345. package/assets/esri/core/workers/chunks/eb4ffb72c9360062141c.js +0 -1
  346. package/assets/esri/core/workers/chunks/ebae903845643d60b44a.js +0 -1
  347. package/assets/esri/core/workers/chunks/ebb0372e8da0f75c09dd.js +0 -1
  348. package/assets/esri/core/workers/chunks/f349f64f683620bdf9b5.js +0 -30
  349. package/assets/esri/core/workers/chunks/f6fb87092bdf6bbf0769.js +0 -1
  350. package/assets/esri/core/workers/chunks/f76c2b09e6ba9d107898.js +0 -1
  351. package/assets/esri/core/workers/chunks/fcf962f3dec6b5440983.js +0 -1
  352. /package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js.LICENSE.txt → 4754610760f3f634adf9.js.LICENSE.txt} +0 -0
  353. /package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js.LICENSE.txt → 527547fa10d52cb3a7b1.js.LICENSE.txt} +0 -0
  354. /package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js.LICENSE.txt → 7189e03cc24f5c10865a.js.LICENSE.txt} +0 -0
  355. /package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js.LICENSE.txt → a35d1be700ebd3109397.js.LICENSE.txt} +0 -0
  356. /package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js.LICENSE.txt → eaeb95be8d4032513247.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../core/Logger.js";import{animationDebugFlags as n}from"./animationDebugFlags.js";import{defaultCIMValues as e}from"./defaultCIMValues.js";import{getExtent as o}from"./SDFHelper.js";import{getProcessParam as i,hasProcessParam as r,getSize as a,getValue as s}from"./utils.js";function l(t,n,e){return{transform:b(t,n,e.transform),fromColor:T(t,n,e.fromColor),toColor:I(t,n,e.toColor),colorMix:k(t,n,e.colorMix),toOpacity:O(t,n,e.toOpacity),opacityMix:x(t,n,e.opacityMix),shift:D(t,n,e.shift),hasAnimations:e.hasAnimations||m(n),hasShiftAnimation:e.hasShiftAnimation||c(n),hasMotionAnimations:e.hasMotionAnimations||f(n)}}function m(t){return!!t.animations&&t.animations.length>0}function c(t){return!!t.animations&&t.animations.some(t=>"CIMSymbolAnimationMoveAlongLine"===t.type)}const p=new Set(["CIMSymbolAnimationOffset","CIMSymbolAnimationRotation","CIMSymbolAnimationSize","CIMSymbolAnimationScale"]);function f(t){return!!t.animations&&t.animations.some(t=>p.has(t.type))}function y(t){return!n.forceStaticPath&&(n.forceAnimatedPath||t.hasAnimations)}function u(n,e,o){if("CIMCharacterMarker"===e.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const r=i(n,e,"OffsetX"),a=i(n,e,"OffsetY");if("CIMPictureMarker"===e.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:j([r,a]),rotation:j(0),scale:j(i(n,e,"Size")),parent:o.transform}};const s=e.frame,l=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:j([r,a]),rotation:j(0),scale:j({type:"Process",op:"Divide",left:i(n,e,"Size"),right:l}),parent:o.transform}}}function d(t,n){let e=0,o=0;const i="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(e=-t.anchorPoint.x,o=-t.anchorPoint.y),{...n,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:j([e,o]),rotation:j(0),scale:j(1),parent:n.transform}}}function C(t,n){return"Absolute"===t.anchorPointUnits?n:d(t,n)}function S(t,n){return"Absolute"!==t.anchorPointUnits?n:d(t,n)}function M(t,n,e){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:j([n,e]),rotation:j(0),scale:j(1),parent:t.transform}}}function A(t,n){const e=n?.5*-(n.xmin+n.xmax):0,i=n?.5*-(n.ymin+n.ymax):0;let r=0,a=0;if("x"in t&&"y"in t)r=t.x+e,a=t.y+i;else{const n=o(t);if(n){r=(n[0]+n[2])/2+e,a=(n[1]+n[3])/2+i}}return[r,a]}function h(t,n){switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,n,"Rotation")}return 0}function g(t,n){switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,n,"RotateClockwise")}return 0}function P(t,n){switch(n.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return i(t,n,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return i(t,n,"TintColor")}return[1,1,1,1]}function b(t,n,e){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:w(t,n),rotation:z(t,n),scale:R(t,n),parent:e}}function T(t,n,e){return{type:"AnimatedColor",color:j(P(t,n)),opacity:j(1),parent:e,applyToChildren:!1}}function I(t,n,e){const{animations:o}=n;let r,a=v(e);if(a)r=[1,1,1,1];else{r=P(t,n);const e=o?.find(t=>"CIMSymbolAnimationColor"===t.type);e&&(r=i(t,e,"ToColor"),a="Override"===e.colorMode)}return{type:"AnimatedColor",color:j(r),opacity:j(1),parent:e,applyToChildren:a}}function k(t,n,e){const{animations:o}=n,i=o?.find(t=>"CIMSymbolAnimationColor"===t.type);return i?{type:"AnimatedColor",color:j([1,1,1,1]),opacity:{from:0,to:1,timing:L(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:e}function v(t){return"object"==typeof t&&"applyToChildren"in t&&t.applyToChildren}function O(t,n,e){const{animations:o}=n;let r=j(1);const a=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);if(a){r=j({type:"Process",op:"Transparency",value:i(t,a,"ToTransparency")})}return{type:"AnimatedColor",color:j([1,1,1,1]),opacity:r,parent:e,applyToChildren:!1}}function x(t,n,e){const{animations:o}=n,i=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);return i?{type:"AnimatedColor",color:j([1,1,1,1]),opacity:{from:0,to:1,timing:L(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:e}function D(t,n,e){const{animations:o}=n,a=o?.find(t=>"CIMSymbolAnimationMoveAlongLine"===t.type);if(!a)return e;let s,l;const m=L(t,a.animatedSymbolProperties),c=r(t,a,"DistanceAlong"),p=r(t,a,"Speed"),f=c&&i(t,a,"DistanceAlong"),y=p&&i(t,a,"Speed"),u=!0===a.continuous;if(!1!==f)s={type:"Process",op:"Divide",left:f,right:100},l=!0;else if(!1!==y)s={type:"Process",op:"Multiply",left:y,right:m.duration},l=!1;else{if(!u)throw new Error("Either distanceAlong, speed or continuous must be specified.");s=1,l=!0}return{type:"AnimatedShift",multiplyByLineLength:l,shift:{from:0,to:s,timing:m},parent:e}}function L(t,n){if(!n)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0};const o=i(t,n,"Duration");let r;if(i(t,n,"RandomizeStartTime")){r={type:"Process",op:"Random",min:0,max:o,seed:i(t,n,"RandomizeStartSeed")}}else r=i(t,n,"StartTimeOffset");const a=i(t,n,"RepeatDelay"),l=i(t,n,"PlayAnimation"),m=i(t,n,"ReverseAnimation"),c=s(n.repeatType,e.CIMAnimatedSymbolProperties.repeattype);return{duration:o,startTimeOffset:r,repeatDelay:a,timeOriginSelector:"None"===c?"Local":"Global",repeatType:c,easing:s(n.easing,e.CIMAnimatedSymbolProperties.easing),playAnimation:l,reverseAnimation:m}}function R(t,n){const{animations:e}=n;let o;o="CIMPictureMarker"===n.type||"CIMVectorMarker"===n.type?i(t,n,"Size"):"CIMSolidStroke"===n.type||"CIMPictureStroke"===n.type?i(t,n,"Width"):a(n)||10;const r=e?.find(t=>"CIMSymbolAnimationScale"===t.type);if(!r){const n=e?.find(t=>"CIMSymbolAnimationSize"===t.type);if(!n)return j(1);return{from:1,to:{type:"Process",op:"Divide",left:i(t,n,"ToSize"),right:o},timing:L(t,n.animatedSymbolProperties)}}return{from:1,to:i(t,r,"ScaleFactor"),timing:L(t,r.animatedSymbolProperties)}}function w(t,n){const{animations:e}=n,o=e?.find(t=>"CIMSymbolAnimationOffset"===t.type);if(!o)return j([0,0]);return{from:[0,0],to:[i(t,o,"OffsetX"),i(t,o,"OffsetY")],timing:L(t,o.animatedSymbolProperties)}}function z(t,n){const{animations:e}=n,o=g(t,n),r={type:"Process",op:"Divide",left:h(t,n),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},a=e?.find(t=>"CIMSymbolAnimationRotation"===t.type);if(!a)return j(r);const s={type:"Process",op:"Add",left:i(t,a,"ToRotation"),right:{type:"Process",op:"Divide",left:r,right:-1}};return{from:r,to:{type:"Process",op:"Add",left:r,right:{type:"Process",op:"Cond",condition:i(t,a,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:L(t,a.animatedSymbolProperties)}}function j(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0}}}function F(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const n in t)if(F(t[n]))return!0;return!1}export{F as checkForAnimations,l as getAnimationParams,A as getFrameTranslation,j as getStaticParam,S as handleAbsoluteAnchor,d as handleAnchor,u as handleMarker,C as handleRelativeAnchor,y as shouldUseAnimatedPath,M as translate};
2
+ import t from"../../core/Logger.js";import{animationDebugFlags as n}from"./animationDebugFlags.js";import{defaultCIMValues as e}from"./defaultCIMValues.js";import{getExtent as o}from"./SDFHelper.js";import{getProcessParam as i,hasProcessParam as r,getSize as a,getValue as s}from"./utils.js";function l(t,n,e){return{transform:b(t,n,e.transform),fromColor:T(t,n,e.fromColor),toColor:I(t,n,e.toColor),colorMix:k(t,n,e.colorMix),toOpacity:O(t,n,e.toOpacity),opacityMix:x(t,n,e.opacityMix),shift:D(t,n,e.shift),hasAnimations:e.hasAnimations||c(n),hasShiftAnimation:e.hasShiftAnimation||m(n),hasMotionAnimations:e.hasMotionAnimations||f(n)}}function c(t){return"animations"in t&&!!t.animations&&t.animations.length>0}function m(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>"CIMSymbolAnimationMoveAlongLine"===t.type)}const p=new Set(["CIMSymbolAnimationOffset","CIMSymbolAnimationRotation","CIMSymbolAnimationSize","CIMSymbolAnimationScale"]);function f(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>p.has(t.type))}function y(t){return!n.forceStaticPath&&(n.forceAnimatedPath||t.hasAnimations)}function u(n,e,o){if("CIMCharacterMarker"===e.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const r=i(n,e,"OffsetX"),a=i(n,e,"OffsetY");if("CIMPictureMarker"===e.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:F([r,a]),rotation:F(0),scale:F(i(n,e,"Size")),parent:o.transform}};const s=e.frame,l=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:F([r,a]),rotation:F(0),scale:F({type:"Process",op:"Divide",left:i(n,e,"Size"),right:l}),parent:o.transform}}}function d(t,n){let e=0,o=0;const i="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(e=-t.anchorPoint.x,o=-t.anchorPoint.y),{...n,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:F([e,o]),rotation:F(0),scale:F(1),parent:n.transform}}}function C(t,n){return"Absolute"===t.anchorPointUnits?n:d(t,n)}function S(t,n){return"Absolute"!==t.anchorPointUnits?n:d(t,n)}function M(t,n,e){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:F([n,e]),rotation:F(0),scale:F(1),parent:t.transform}}}function A(t,n){const e=n?.5*-(n.xmin+n.xmax):0,i=n?.5*-(n.ymin+n.ymax):0;let r=0,a=0;if("x"in t&&"y"in t)r=t.x+e,a=t.y+i;else{const n=o(t);if(n){r=(n[0]+n[2])/2+e,a=(n[1]+n[3])/2+i}}return[r,a]}function h(t,n){switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,n,"Rotation")}return 0}function g(t,n){switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,n,"RotateClockwise")}return 0}function P(t,n){switch(n.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return i(t,n,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return i(t,n,"TintColor")}return[1,1,1,1]}function b(t,n,e){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:z(t,n),rotation:j(t,n),scale:R(t,n),parent:e}}function T(t,n,e){return{type:"AnimatedColor",color:F(P(t,n)),opacity:F(1),parent:e,applyToChildren:!1}}function I(t,n,e){const o=w(n);let r,a=v(e);if(a)r=[1,1,1,1];else{r=P(t,n);const e=o?.find(t=>"CIMSymbolAnimationColor"===t.type);e&&(r=i(t,e,"ToColor"),a="Override"===e.colorMode)}return{type:"AnimatedColor",color:F(r),opacity:F(1),parent:e,applyToChildren:a}}function k(t,n,e){const o=w(n),i=o?.find(t=>"CIMSymbolAnimationColor"===t.type);return i?{type:"AnimatedColor",color:F([1,1,1,1]),opacity:{from:0,to:1,timing:L(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:e}function v(t){return"object"==typeof t&&"applyToChildren"in t&&t.applyToChildren}function O(t,n,e){const o=w(n);let r=F(1);const a=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);if(a){r=F({type:"Process",op:"Transparency",value:i(t,a,"ToTransparency")})}return{type:"AnimatedColor",color:F([1,1,1,1]),opacity:r,parent:e,applyToChildren:!1}}function x(t,n,e){const o=w(n),i=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);return i?{type:"AnimatedColor",color:F([1,1,1,1]),opacity:{from:0,to:1,timing:L(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:e}function D(t,n,e){const o=w(n),a=o?.find(t=>"CIMSymbolAnimationMoveAlongLine"===t.type);if(!a)return e;let s,l;const c=L(t,a.animatedSymbolProperties),m=r(t,a,"DistanceAlong"),p=r(t,a,"Speed"),f=m&&i(t,a,"DistanceAlong"),y=p&&i(t,a,"Speed"),u=!0===a.continuous;if(!1!==f)s={type:"Process",op:"Divide",left:f,right:100},l=!0;else if(!1!==y)s={type:"Process",op:"Multiply",left:y,right:c.duration},l=!1;else{if(!u)throw new Error("Either distanceAlong, speed or continuous must be specified.");s=1,l=!0}return{type:"AnimatedShift",multiplyByLineLength:l,shift:{from:0,to:s,timing:c},parent:e}}function L(t,n){if(!n)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0};const o=i(t,n,"Duration");let r;if(i(t,n,"RandomizeStartTime")){r={type:"Process",op:"Random",min:0,max:o,seed:i(t,n,"RandomizeStartSeed")}}else r=i(t,n,"StartTimeOffset");const a=i(t,n,"RepeatDelay"),l=i(t,n,"PlayAnimation"),c=i(t,n,"ReverseAnimation"),m=s(n.repeatType,e.CIMAnimatedSymbolProperties.repeattype);return{duration:o,startTimeOffset:r,repeatDelay:a,timeOriginSelector:"None"===m?"Local":"Global",repeatType:m,easing:s(n.easing,e.CIMAnimatedSymbolProperties.easing),playAnimation:l,reverseAnimation:c}}function R(t,n){const e=w(n);let o;o="CIMPictureMarker"===n.type||"CIMVectorMarker"===n.type?i(t,n,"Size"):"CIMSolidStroke"===n.type||"CIMPictureStroke"===n.type?i(t,n,"Width"):a(n)||10;const r=e?.find(t=>"CIMSymbolAnimationScale"===t.type);if(!r){const n=e?.find(t=>"CIMSymbolAnimationSize"===t.type);if(!n)return F(1);return{from:1,to:{type:"Process",op:"Divide",left:i(t,n,"ToSize"),right:o},timing:L(t,n.animatedSymbolProperties)}}return{from:1,to:i(t,r,"ScaleFactor"),timing:L(t,r.animatedSymbolProperties)}}function w(t){return"animations"in t&&t.animations||[]}function z(t,n){const e=w(n),o=e?.find(t=>"CIMSymbolAnimationOffset"===t.type);if(!o)return F([0,0]);return{from:[0,0],to:[i(t,o,"OffsetX"),i(t,o,"OffsetY")],timing:L(t,o.animatedSymbolProperties)}}function j(t,n){const e=w(n),o=g(t,n),r={type:"Process",op:"Divide",left:h(t,n),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},a=e?.find(t=>"CIMSymbolAnimationRotation"===t.type);if(!a)return F(r);const s={type:"Process",op:"Add",left:i(t,a,"ToRotation"),right:{type:"Process",op:"Divide",left:r,right:-1}};return{from:r,to:{type:"Process",op:"Add",left:r,right:{type:"Process",op:"Cond",condition:i(t,a,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:L(t,a.animatedSymbolProperties)}}function F(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0}}}function V(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const n in t)if(V(t[n]))return!0;return!1}export{V as checkForAnimations,l as getAnimationParams,A as getFrameTranslation,F as getStaticParam,S as handleAbsoluteAnchor,d as handleAnchor,u as handleMarker,C as handleRelativeAnchor,y as shouldUseAnimatedPath,M as translate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{checkForAnimations as l,getAnimationParams as n,handleAbsoluteAnchor as p,handleMarker as m,handleRelativeAnchor as c,getFrameTranslation as d,translate as y,getStaticParam as f,shouldUseAnimatedPath as h}from"./animationUtils.js";import{forEachSymbolLayer as u,CIMSymbolHelper as v}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as O}from"./constants.js";import{defaultCIMValues as g}from"./defaultCIMValues.js";import{fitVectorMarker as S}from"./fitVectorMarker.js";import{OverrideHelper as _}from"./OverrideHelper.js";import{getExtent as M,getSDFMetrics as k,getSDFDimensions as C}from"./SDFHelper.js";import{CIMSymbolUnits as b}from"./types.js";import{colorToArray as x,normalizeAlpha as P,getSize as z,isCIMMarkerStrokePlacement as I,hasStrokeLayer as E,getTintColor as L,getNumericValue as V,normalizePrimitiveOverrideProps as N,getDefaultCIMValue as R,getEnum as A,getFillColor as T,getStrokeColor as w,fromCIMFontDecoration as G,fromCIMFontStyle as F,getStrokeWidth as X,fromCIMVerticalAlignment as j,fromCIMHorizontalAlignment as W,getTextCasing as Y,isValidCIMValue as D,uncapitalize as U}from"./utils.js";import{EffectHelper as H}from"./effects/EffectHelper.js";import{rasterizedVectorMarkerMinSize as J,randomInsidePolygonTextureSize as B}from"../../views/2d/engine/webgl/definitions.js";const q=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function K(e){const t=e.markerPlacement;return t&&t.angleToLine?1:0}class Q{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,r,i){if(this._cimLayers=i??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(const t of this._primitiveOverrides){const r=t.valueExpressionInfo;if(r)this._setPoMap(t.primitiveName,t.propertyName,r);else if(null!=t.value){let r=t.value;t.propertyName.includes("Color")&&(e(r)&&(r=x(r)),r=P(r)),this._setPoMap(t.primitiveName,t.propertyName,r)}}}return this._analyzeSymbol(t.symbol,r),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;for(let l=0;l<r.length;l++){const e=r[l];"CIMVectorMarker"===e.type&&(r[l]=S(e))}const i=e.effects;let o=0;const a=z(e)??0;if("CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=1),oe(r,i))return this._analyzeCompositeOutlineFill(r,i,a);let s={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],shift:[1,1,1,1],hasAnimations:l(e),hasShiftAnimation:!1,hasMotionAnimations:!1};s=n(this._poMap,e,s);const p="CIMPolygonSymbol"===e.type;let m=r.length;for(;m--;){const l=r[m];if(!l||!1===l.enable)continue;let n;i?.length&&(n=[...i]);const c=l.effects;c?.length&&(i?n.push(...c):n=[...c]);let d=null;if(n){d=[];for(const e of n){const t=_.findEffectOverrides(e,this._primitiveOverrides);t&&d.push(t)}}const y=[];switch(_.findApplicableOverrides(l,this._primitiveOverrides,y),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,d,s,E(r));break;case"CIMPictureFill":this._analyzePictureFill(l,d,s);break;case"CIMHatchFill":this._analyzeHatchFill(l,d,s);break;case"CIMGradientFill":this._analyzeGradientFill(l,d);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,d,p,a,s);break;case"CIMPictureStroke":this._analyzePictureStroke(l,d,p,a,s);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,d,p,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=K(l));const r=[],i=l.primitiveName;i&&r.push(i);const n=p&&I(l.markerPlacement);this._analyzeMarker(l,d,null,r,o,a,t,[],s,!1,n);break}default:q().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t,r,i){const{primitiveName:o,type:a}=e,s=P(e.color),l=n(this._poMap,e,r);if(!i&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.effect.type)){const r=this._getValueOrOverrideExpression(a,o,"Color",s);return void this._cimLayers.push({type:"outlineFill",colorLocked:!!e.colorLocked,color:r,effects:t,outlineColor:r,outlineColorLocked:!!e.colorLocked,...O,outlineEffects:t})}this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(a,o,"Color",s),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1,animationParams:se(l)})}_analyzePictureFill(e,t,r){const{primitiveName:i,type:o}=e,a=L(e),s=V(e.height,g.CIMPictureFill.height);let l=V(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height),l/=r*(s/t)}const p={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(i,o)},m=n(this._poMap,e,r);this._cimLayers.push({type:"fill",spriteRasterizationParam:p,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,i,"TintColor",a),height:this._getValueOrOverrideExpression(o,i,"Height",s),scaleX:this._getValueOrOverrideExpression(o,i,"ScaleX",l),angle:this._getValueOrOverrideExpression(o,i,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(o,i,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(o,i,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1,animationParams:se(m)})}_analyzeHatchFill(e,t,r){const{primitiveName:i,type:o}=e,a=n(this._poMap,e,r),s=this._analyzeMaterialOverrides(i,["Rotation","OffsetX","OffsetY"]),l=N(s);let p=[255,255,255,1],m=!1;if(e.lineSymbol?.symbolLayers)for(const n of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==n.type)continue;const e=n.primitiveName??i;m||!e||n.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(p=P(n.color),p=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(o,e,"Color",p),m=!0);const t=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(t){let r=null,i=null;"number"==typeof t?r=t:i=t.valueExpressionInfo;let a=l.find(e=>"strokeWidth"===e.propertyName);a?a.propertyName="width":(a={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:i,value:r,defaultValue:R(o,"width")},l.push(a))}}const c={type:"sprite-rasterization-param",resource:e,overrides:l};this._cimLayers.push({type:"fill",spriteRasterizationParam:c,colorLocked:!!e.colorLocked,effects:t,color:p,height:this._getValueOrOverrideExpression(o,i,"Separation",V(e.separation,g.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(o,i,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(o,i,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(o,i,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!m,animationParams:se(a)})}_analyzeGradientFill(e,t){const{angle:r,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,gradientType:s,interval:l,primitiveName:n,type:p}=e,m=g.CIMGradientFill,c=e.colorRamp;this._cimLayers.push({type:"gradientFill",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(n,p)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(p,n,"GradientMethod",i??"Linear"),angle:this._getValueOrOverrideExpression(p,n,"Angle",V(r,m.angle)),gradientType:this._getValueOrOverrideExpression(p,n,"GradientType",s??m.gradientType),interval:this._getValueOrOverrideExpression(p,n,"Interval",V(l,"CIMFixedColorRamp"===c.type?c.colors.length:m.interval)),gradientSize:this._getValueOrOverrideExpression(p,n,"GradientSize",V(o,m.gradientSize)),gradientSizeUnits:"Absolute"===a?b.Absolute:"Relative"===a?b.Relative:m.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,r){const i=e.find(e=>"CIMSolidFill"===e.type),o=e.find(e=>"CIMSolidStroke"===e.type);if(null==i||null==o)return;const a=[...t??[],...i.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),s=[...t??[],...o.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),l=V(o.width,g.CIMSolidStroke.width),n=A(o.capStyle,g.CIMSolidStroke.capstyle),p=A(o.joinStyle,g.CIMSolidStroke.joinstyle),m=o.miterLimit;this._cimLayers.push({type:"outlineFill",colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,"Color",P(i.color)),effects:a,outlineColorLocked:!!o.colorLocked,outlineColor:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Color",P(o.color)),outlineWidth:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Width",l),cap:this._getValueOrOverrideExpression(o.type,o.primitiveName,"CapStyle",n),join:this._getValueOrOverrideExpression(o.type,o.primitiveName,"JoinStyle",p),miterLimit:m&&this._getValueOrOverrideExpression(o.type,o.primitiveName,"MiterLimit",m),referenceWidth:r,outlineEffects:s})}_analyzeSolidStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=P(e.color),p=V(e.width,g.CIMSolidStroke.width),m=A(e.capStyle,g.CIMSolidStroke.capstyle),c=A(e.joinStyle,g.CIMSolidStroke.joinstyle),d=e.miterLimit;let y,f,h,u,v=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(v=this._getPrimitiveMaterialOverrides(a,s)),t&&Array.isArray(t)&&t.length>0){const e=t[t.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&(y=e.dashTemplate,f=e.scaleDash,h=e.offsetAlongLine,u=e.primitiveName,(t=[...t]).pop())}null!=u&&v.push(...this._getPrimitiveMaterialOverrides(u,s).filter(e=>"dashTemplate"===e.propertyName));const O=void 0!==y?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:y,primitiveName:u},overrides:v}:null,S=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:O,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"Color",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",m),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",c),miterLimit:d&&this._getValueOrOverrideExpression(s,a,"MiterLimit",d),referenceWidth:i,zOrder:$(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(u,"DashTemplate")??y,offsetAlongLine:this._getValueOrOverrideExpression(s,u,"OffsetAlongLine",h??0),scaleDash:f,sampleAlphaOnly:!0,animationParams:se(S)})}_analyzePictureStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=L(e),p=V(e.width,g.CIMPictureStroke.width),m=A(e.capStyle,g.CIMPictureStroke.capstyle),c=A(e.joinStyle,g.CIMPictureStroke.joinstyle),d=e.miterLimit,y={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,s)},f=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:y,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"TintColor",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",m),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",c),miterLimit:d&&this._getValueOrOverrideExpression(s,a,"MiterLimit",d),referenceWidth:i,zOrder:$(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1,animationParams:se(f)})}_analyzeGradientStroke(e,t,r,i){const{gradientMethod:o,gradientSize:a,gradientSizeUnits:s,gradientType:l,interval:n,primitiveName:p,type:m}=e,c=g.CIMGradientStroke,d=V(e.width,c.width),y=A(e.capStyle,c.capstyle),f=A(e.joinStyle,c.joinstyle),h=e.miterLimit,u=e.colorRamp;this._cimLayers.push({type:"gradientStroke",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(p,m)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(m,p,"Width",d),cap:this._getValueOrOverrideExpression(m,p,"CapStyle",y),join:this._getValueOrOverrideExpression(m,p,"JoinStyle",f),miterLimit:h&&this._getValueOrOverrideExpression(m,p,"MiterLimit",h),referenceWidth:i,isOutline:r,gradientMethod:this._getValueOrOverrideExpression(m,p,"GradientMethod",o??c.gradientMethod),gradientType:this._getValueOrOverrideExpression(m,p,"GradientType",l??c.gradientType),interval:this._getValueOrOverrideExpression(m,p,"Interval",V(n,"CIMFixedColorRamp"===u.type?u.colors.length:c.interval)),gradientSize:this._getValueOrOverrideExpression(m,p,"GradientSize",V(a,c.gradientSize)),gradientSizeUnits:"Absolute"===s?b.Absolute:"Relative"===s?b.Relative:c.gradientSizeUnits})}_analyzeMarker(e,t,r,i,o,a,s,l,d,y=!1,f=!1){y||=!!e.colorLocked;let h=d;if(h=p(e,h),h=m(this._poMap,e,h),h=c(e,h),h=n(this._poMap,e,h),this._analyzeMarkerInsidePolygon(e,t,y,h))return;const u=V(e.size,g.CIMVectorMarker.size),v=V(e.rotation),O=V(e.offsetX),S=V(e.offsetY),{primitiveName:_,type:M}=e,k=this._getValueOrOverrideExpression(M,_,"Size",u),C=this._getValueOrOverrideExpression(M,_,"Rotation",v),b=this._getValueOrOverrideExpression(M,_,"OffsetX",O),x=this._getValueOrOverrideExpression(M,_,"OffsetY",S);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,i,o,a,k,C,b,x,l,h,y,f);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,i,o,a,k,C,b,x,l,h,s,y,f)}}_analyzeMarkerInsidePolygon(e,t,r,i){const{markerPlacement:o,type:s}=e;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type||i.hasMotionAnimations)return!1;if("CIMVectorMarker"===s||"CIMPictureMarker"===s){const r=e.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;const i=o.primitiveName;if(i&&this._analyzePrimitiveOverrides([i],t,null,null))return!1;if("CIMVectorMarker"===s){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const l=Math.abs(o.stepX),n=Math.abs(o.stepY);if(0===l||0===n)return!0;let p,m;if("Random"===o.gridType){const e=a(B),t=Math.max(Math.floor(e/l),1);p=n*Math.max(Math.floor(e/n),1);m=t*l/p}else o.shiftOddRows?(p=2*n,m=l/n*.5):(p=n,m=l/n);const c=L(e),d="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:d,colorLocked:r,effects:t,color:c,height:p,scaleX:m,angle:o.gridAngle,offsetX:V(o.offsetX),offsetY:V(o.offsetY),applyRandomOffset:"Random"===o.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0,animationParams:se(i)}),!0}_analyzePictureMarker(e,t,i,o,a,l,n,p,m,c,d,y,f,h){const{animatedSymbolProperties:u,primitiveName:v,type:O}=e;let g=V(e.scaleX,1);const S=L(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const _=this._createGIFAnimatedSymbolPropertiesOverrideExpression(u),M=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height);g/=r*(V(e.size)/t)}const k=[...o];let C;e.primitiveName&&k.push(e.primitiveName),u||_?C={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=r(e),C.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(k,O)};_&&b.overrides.push(..._.overrides);const x=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:f,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(O,v,"ScaleX",g),rotation:p,offsetX:m,offsetY:c,transform:{type:"cim-marker-transform-param",params:d},color:this._getValueOrOverrideExpression(O,v,"TintColor",S),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:h,markerPlacement:i,animationParams:se(y),baseSize:x})}_analyzeVectorMarker(e,t,r,i,o,a,s,l,p,m,c,h,u,v,O){const g=e.markerGraphics;if(!g)return;const S=e.frame;let _=0;_=S?S.ymax-S.ymin:a;const M=!!e.scaleSymbolsProportionally;if(_){const t={offsetX:p,offsetY:m,rotation:l,size:s,frameHeight:_,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:M};c=[...c,t]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const k of g)if(k){const s=k.symbol;if(!s)continue;const l=k.primitiveName;l&&i.push(l);let p,m=h;if(("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&S){let t=0,r=0;const i=k.geometry;"x"in i&&"y"in i&&(t+=i.x-.5*(S.xmin+S.xmax),r+=i.y-.5*(S.ymin+S.ymax));const o=e.anchorPoint;let a=!1;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,r-=o.y,a=!0):S&&(t-=(S.xmax-S.xmin)*o.x,r-=(S.ymax-S.ymin)*o.y));const s={offsetX:t,offsetY:r,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:M};p=[...c,s]}const g=k.geometry,[C,b]=d(g,S);switch(0===C&&0===b||(m=y(m,C,b)),"CIMPointSymbol"===s.type&&(m=n(this._poMap,s,m)),s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":u||re(s)?(m={...m,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:f([0,0]),rotation:f(0),scale:f(_),parent:h.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,r,k,i,o,a,p??c,m,_,v,O)):this._analyzeMultiLayerGraphic(e,t,r,k,i,o,a,p??c,m,_,v,O);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,k,i,o,a,p??c,v)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,t,r,i,o,a,s,l,n,p,m,c){const d=i.symbol,y=d.symbolLayers;if(y){if(!te(y)||h(n))return ie(y)?(u(d,e=>{e.colorLocked&&(m=!0)}),void this._analyzeMultiLayerGraphicNonSDF(e,t,r,i,o,a,s,l,n,p,m,c)):void this._analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,n,p,m,c);this._analyzeCompositeMarkerGraphic(e,t,r,i,y,a,s,l,p,m,c)}}_analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,p,m,c,d){const y=i.symbol,f=y.symbolLayers;if(!f)return;const h=H.applyEffects(y.effects,i.geometry);if(!h)return;let u=f.length;for(;u--;){const y=f[u];if(!y||!1===y.enable)continue;const v=y.primitiveName;switch(v&&o.push(v),y.type){case"CIMSolidFill":case"CIMSolidStroke":{const o=H.applyEffects(y.effects,h),f=M(o);if(!f)continue;const u="Relative"!==e.anchorPointUnits,O="CIMSolidStroke"===y.type?y.width:0,{frameSizeRatio:S,anchorX:_,anchorY:b,widthRatio:x,sdfPaddingRatio:z,sdfTextureSize:I}=k(f,e.frame,e.size,e.anchorPoint,u,O,e.scaleSymbolsProportionally),E="CIMSolidFill"===y.type,L={type:"sdf",geometry:o,sdfPaddingRatio:z,asFill:E,sdfTextureSize:I},{path:N}=y,R=E?P(T(y)):null==N?P(w(y)):[0,0,0,0],A=E?[0,0,0,0]:P(w(y));if(!E&&!O)break;const G=i.primitiveName;let F=null;E&&!y.colorLocked&&(F=this._maybeGetValueOrOverrideExpression(G,"FillColor"));let X=null;E||y.colorLocked||(X=this._maybeGetValueOrOverrideExpression(G,"StrokeColor"));const j=F??this._getValueOrOverrideExpression(y.type,v,"Color",R),W=X??this._getValueOrOverrideExpression(y.type,v,"Color",A),Y=this._maybeGetValueOrOverrideExpression(G,"StrokeWidth")??this._getValueOrOverrideExpression(y.type,v,"Width",O),D=N?{type:"sprite-rasterization-param",resource:{type:"path",path:N,asFill:E},overrides:[]}:{type:"sprite-rasterization-param",resource:L,overrides:[]},U=n(this._poMap,y,p),J=V(e.size,g.CIMVectorMarker.size),B=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",J);this._cimLayers.push({type:"marker",spriteRasterizationParam:D,colorLocked:!!y.colorLocked||!!c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:_,y:b},isAbsoluteAnchorPoint:u,size:m,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:m,widthRatio:x,rotateClockwise:!1,referenceSize:s,sizeRatio:S,color:j,outlineColor:W,outlineWidth:Y,isOutline:d,markerPlacement:r,animationParams:se(U),isStroke:"CIMSolidFill"!==y.type,baseSize:B,...C(o,I,z)});break}case"CIMPictureMarker":case"CIMVectorMarker":if(y.markerPlacement){q().error("Error analyzing CIM, got unexpected marker placement");break}this._analyzeMarker(y,t,r,o,a,s,!1,l,p,c,d)}v&&o.pop()}}_analyzeTextGraphic(e,r,i,o,a,s,l,n){const p=[];_.findApplicableOverrides(i,this._primitiveOverrides,p);const m=i.geometry;if(!("x"in m)||!("y"in m))return;const c=i.symbol,d=G(c),y=F(c.fontStyleName),f=t(c.fontFamilyName);c.font={family:f,decoration:d,...y};const h=V(c.height,g.CIMTextSymbol.height),u=V(c.angle),v=V(c.offsetX),O=V(c.offsetY),{haloSymbol:S}=c,M=V(c.haloSize,0);let k=[0,0,0,0];if(S?.symbolLayers?.length){const e=S.symbolLayers;for(const t of e)if(t.color){k=this._getValueOrOverrideExpression(c?.haloSymbol?.type??"CIMPolygonSymbol",t.primitiveName,"Color",P(t.color));break}}const C=i.primitiveName;let b=[0,0,0,1],x=[0,0,0,0],z=0,I=!1;if(c.symbol?.symbolLayers)for(const t of c.symbol.symbolLayers){const e=t.primitiveName;if("CIMSolidStroke"===t.type)x=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Color",P(t.color)),z=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Width",X(t)??0);else if("CIMSolidFill"===t.type){const r=P(t.color);I=I??!!t.colorLocked,b=this._getValueOrOverrideExpression("CIMSolidFill",e??C,"Color",r)}}let E=null,L=null,N=null,R=null,A=null;C&&(E=this._maybeGetValueOrOverrideExpression(C,"TextSize"),L=this._maybeGetValueOrOverrideExpression(C,"TextAngle"),N=this._maybeGetValueOrOverrideExpression(C,"TextOffsetX"),R=this._maybeGetValueOrOverrideExpression(C,"TextOffsetY"),I||(A=this._maybeGetValueOrOverrideExpression(C,"FillColor")));const T=A??b;let w=null,Y=null,D=0;if("CIMBackgroundCallout"===c.callout?.type){const e=c.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?w=P(e.color):"CIMSolidStroke"===e.type&&(Y=P(e.color),D=V(e.width,g.CIMSolidStroke.width))}}const U=this._getValueOrOverrideExpression(c.type,i.primitiveName,"TextString",i.textString??"");if(null==U)return;const{fontStyleName:H}=c,J=f+(H?"-"+H.toLowerCase():"-regular"),B=this._getMaterialOverrides(o,c.type);B.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,c.type)),this._collectDictionaryTemplateOverrides(B,i);const q={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:c.font,symbol:c,primitiveName:i.primitiveName},overrides:B};this._cimLayers.push({type:"text",lineWidth:c.lineWidth,textRasterizationParam:q,colorLocked:!!n||!!I,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:J,decoration:d,haloSize:M,haloColor:k,weight:y.weight,style:y.style,size:E??h,angle:L??u,offsetX:N??v,offsetY:R??O,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:W(c.horizontalAlignment),verticalAlignment:j(c.verticalAlignment),text:U,color:T,outlineColor:x,outlineSize:z,backgroundColor:w,borderLineColor:Y,borderLineWidth:D,referenceSize:s,sizeRatio:1,markerPlacement:r})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){const r=Y(t.symbol);e.push({propertyName:"textString",defaultValue:"",valueExpressionInfo:{type:"dictionary-template",textCase:r,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,r,i,a,s,l,n,p,m,c,d){const y=Z(e,i),f=e.primitiveName,h=this._analyzeMaterialOverrides(f,["Rotation","OffsetX","OffsetY"]),u=N(h),[O,S,_]=v.getTextureAnchor(y,this._resourceManager,J),M=this._getMaterialOverrides(a,e.type);M.push(...u);const k={type:"sprite-rasterization-param",resource:{...y,avoidSDFRasterization:!0},overrides:M},C=V(e.size,g.CIMVectorMarker.size),b=this._getValueOrOverrideExpression(e.type,f,"Size",C);this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:O,y:S},isAbsoluteAnchorPoint:!1,size:m,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:n},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:m,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:_/o(e.size),isOutline:d,markerPlacement:r,animationParams:se(p),baseSize:b})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:ae(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:ae(t)}}_analyzeCompositeMarkerGraphic(e,t,r,i,o,a,s,l,n,p,m){const c=i.geometry,d=o[0],y=o[1],f=M(c);if(!f)return;const h="Relative"!==e.anchorPointUnits,u=V(d.width,g.CIMSolidStroke.width),{frameSizeRatio:v,anchorX:O,anchorY:S,widthRatio:_,sdfPaddingRatio:C,sdfTextureSize:b}=k(f,e.frame,e.size,e.anchorPoint,h,u,e.scaleSymbolsProportionally),{path:x}=y,z=y.primitiveName,I=d.primitiveName,E=i.primitiveName;let L=null;y.colorLocked||p||(L=this._maybeGetValueOrOverrideExpression(E,"FillColor"));const N=L??this._getValueOrOverrideExpression(y.type,z,"Color",P(y.color));let R=null;d.colorLocked||p||(R=this._maybeGetValueOrOverrideExpression(E,"StrokeColor"));const A=R??this._getValueOrOverrideExpression(d.type,I,"Color",P(d.color)),T=this._maybeGetValueOrOverrideExpression(E,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,I,"Width",u),w={type:"sprite-rasterization-param",resource:x?{type:"path",path:x,asFill:!0}:{type:"sdf",geometry:c,sdfTextureSize:b,sdfPaddingRatio:C,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:w,colorLocked:p,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:O,y:S},isAbsoluteAnchorPoint:h,size:n,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:n,widthRatio:_,rotateClockwise:!1,referenceSize:s,sizeRatio:v,color:N,outlineColor:A,outlineWidth:T,isOutline:m,markerPlacement:r})}_setPoMap(e,t,r){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,i,o=!0){if(o&&!D(i)&&(i=R(e,r.toLowerCase())),null==t)return i;const a=this._poMap[t];if(null==a)return i;const s=a[r];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,r,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const i of e)r.push(...this._getPrimitiveMaterialOverrides(i,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=N(this._primitiveOverrides.filter(t=>t.primitiveName===e));return r.forEach(e=>e.defaultValue=R(t,e.propertyName.toLowerCase())),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(r=>r.primitiveName!==e||!t.includes(r.propertyName))}}function Z(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function $(e){if(e?.startsWith("Level_")){const t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function ee(e,t){if(!t||0===t.length)return e;const i=r(e);return _.applyOverrides(i,t),i}const te=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function re(e){const t=e.symbolLayers;if(!t)return!1;const r=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectDashes"===e.type&&null!=e.dashTemplate)),i=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectAddControlPoints"===e.type));return!!r||!!i}function ie(e){return e.some(e=>"CIMSolidFill"!==e.type&&"CIMSolidStroke"!==e.type&&("CIMVectorMarker"!==e.type&&"CIMPictureMarker"!==e.type||null!=e.markerPlacement))}function oe(e,t){if(t?.some(e=>"CIMGeometricEffectRadial"===e.type)&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.type)&&2===e.length){const t=e.find(e=>"CIMSolidFill"===e.type),r=e.find(e=>"CIMSolidStroke"===e.type),i=r?.effects?.some(e=>"CIMGeometricEffectDashes"===e.type);if(null!=t&&null!=r&&!i)return!0}return!1}function ae(e){return r(e).map(e=>({...e,propertyName:U(e.propertyName)}))}function se(e){return h(e)?{type:"animation-params",params:e}:null}export{Q as CIMAnalyzer,ee as analyzeCIMResource};
2
+ import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{checkForAnimations as l,getAnimationParams as n,handleAbsoluteAnchor as p,handleMarker as m,handleRelativeAnchor as c,getFrameTranslation as d,translate as y,getStaticParam as f,shouldUseAnimatedPath as h}from"./animationUtils.js";import{forEachSymbolLayer as u,CIMSymbolHelper as v}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as O}from"./constants.js";import{defaultCIMValues as g}from"./defaultCIMValues.js";import{fitVectorMarker as S}from"./fitVectorMarker.js";import{OverrideHelper as _}from"./OverrideHelper.js";import{getExtent as M,getSDFMetrics as k,getSDFDimensions as C}from"./SDFHelper.js";import{CIMSymbolUnits as b}from"./types.js";import{colorToArray as x,normalizeAlpha as P,getSize as z,isCIMMarkerStrokePlacement as I,hasStrokeLayer as E,getTintColor as L,getNumericValue as V,normalizePrimitiveOverrideProps as N,getDefaultCIMValue as R,getEnum as A,getFillColor as T,getStrokeColor as w,fromCIMFontDecoration as G,fromCIMFontStyle as F,getStrokeWidth as X,fromCIMVerticalAlignment as j,fromCIMHorizontalAlignment as W,getTextCasing as Y,isValidCIMValue as D,uncapitalize as U}from"./utils.js";import{EffectHelper as H}from"./effects/EffectHelper.js";import{rasterizedVectorMarkerMinSize as J,randomInsidePolygonTextureSize as B}from"../../views/2d/engine/webgl/definitions.js";const q=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function K(e){const t=e.markerPlacement;return t&&t.angleToLine?1:0}class Q{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,r,i){if(this._cimLayers=i??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(const t of this._primitiveOverrides){const r=t.valueExpressionInfo;if(r)this._setPoMap(t.primitiveName,t.propertyName,r);else if(null!=t.value){let r=t.value;t.propertyName.includes("Color")&&(e(r)&&(r=x(r)),r=P(r)),this._setPoMap(t.primitiveName,t.propertyName,r)}}}return this._analyzeSymbol(t.symbol,r),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;for(let l=0;l<r.length;l++){const e=r[l];"CIMVectorMarker"===e.type&&(r[l]=S(e))}const i=e.effects;let o=0;const a=z(e)??0;if("CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=1),oe(r,i))return this._analyzeCompositeOutlineFill(r,i,a);let s={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],shift:[1,1,1,1],hasAnimations:l(e),hasShiftAnimation:!1,hasMotionAnimations:!1};s=n(this._poMap,e,s);const p="CIMPolygonSymbol"===e.type;let m=r.length;for(;m--;){const l=r[m];if(!l||!1===l.enable)continue;let n;i?.length&&(n=[...i]);const c=l.effects;c?.length&&(i?n.push(...c):n=[...c]);let d=null;if(n){d=[];for(const e of n){const t=_.findEffectOverrides(e,this._primitiveOverrides);t&&d.push(t)}}const y=[];switch(_.findApplicableOverrides(l,this._primitiveOverrides,y),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,d,s,E(r));break;case"CIMPictureFill":this._analyzePictureFill(l,d,s);break;case"CIMHatchFill":this._analyzeHatchFill(l,d,s);break;case"CIMGradientFill":this._analyzeGradientFill(l,d);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,d,p,a,s);break;case"CIMPictureStroke":this._analyzePictureStroke(l,d,p,a,s);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,d,p,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=K(l));const r=[],i=l.primitiveName;i&&r.push(i);const n=p&&I(l.markerPlacement);this._analyzeMarker(l,d,null,r,o,a,t,[],s,!1,n);break}default:q().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t,r,i){const{primitiveName:o,type:a}=e,s=P(e.color),l=n(this._poMap,e,r);if(!i&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.effect.type)){const r=this._getValueOrOverrideExpression(a,o,"Color",s);return void this._cimLayers.push({type:"outlineFill",colorLocked:!!e.colorLocked,color:r,effects:t,outlineColor:r,outlineColorLocked:!!e.colorLocked,...O,outlineEffects:t})}this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(a,o,"Color",s),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1,animationParams:se(l)})}_analyzePictureFill(e,t,r){const{primitiveName:i,type:o}=e,a=L(e),s=V(e.height,g.CIMPictureFill.height);let l=V(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height),l/=r*(s/t)}const p={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(i,o)},m=n(this._poMap,e,r);this._cimLayers.push({type:"fill",spriteRasterizationParam:p,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,i,"TintColor",a),height:this._getValueOrOverrideExpression(o,i,"Height",s),scaleX:this._getValueOrOverrideExpression(o,i,"ScaleX",l),angle:this._getValueOrOverrideExpression(o,i,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(o,i,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(o,i,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1,animationParams:se(m)})}_analyzeHatchFill(e,t,r){const{primitiveName:i,type:o}=e,a=n(this._poMap,e,r),s=this._analyzeMaterialOverrides(i,["Rotation","OffsetX","OffsetY"]),l=N(s);let p=[255,255,255,1],m=!1;if(e.lineSymbol?.symbolLayers)for(const n of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==n.type)continue;const e=n.primitiveName??i;m||!e||n.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(p=P(n.color),p=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(o,e,"Color",p),m=!0);const t=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(t){let r=null,i=null;"number"==typeof t?r=t:i=t.valueExpressionInfo;let a=l.find(e=>"strokeWidth"===e.propertyName);a?a.propertyName="width":(a={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:i,value:r,defaultValue:R(o,"width")},l.push(a))}}const c={type:"sprite-rasterization-param",resource:e,overrides:l};this._cimLayers.push({type:"fill",spriteRasterizationParam:c,colorLocked:!!e.colorLocked,effects:t,color:p,height:this._getValueOrOverrideExpression(o,i,"Separation",V(e.separation,g.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(o,i,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(o,i,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(o,i,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!m,animationParams:se(a)})}_analyzeGradientFill(e,t){const{angle:r,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,gradientType:s,interval:l,primitiveName:n,type:p}=e,m=g.CIMGradientFill,c=e.colorRamp;this._cimLayers.push({type:"gradientFill",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(n,p)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(p,n,"GradientMethod",i??"Linear"),angle:this._getValueOrOverrideExpression(p,n,"Angle",V(r,m.angle)),gradientType:this._getValueOrOverrideExpression(p,n,"GradientType",s??m.gradientType),interval:this._getValueOrOverrideExpression(p,n,"Interval",V(l,"CIMFixedColorRamp"===c.type?c.colors.length:m.interval)),gradientSize:this._getValueOrOverrideExpression(p,n,"GradientSize",V(o,m.gradientSize)),gradientSizeUnits:"Absolute"===a?b.Absolute:"Relative"===a?b.Relative:m.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,r){const i=e.find(e=>"CIMSolidFill"===e.type),o=e.find(e=>"CIMSolidStroke"===e.type);if(null==i||null==o)return;const a=[...t??[],...i.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),s=[...t??[],...o.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),l=V(o.width,g.CIMSolidStroke.width),n=A(o.capStyle,g.CIMSolidStroke.capstyle),p=A(o.joinStyle,g.CIMSolidStroke.joinstyle),m=o.miterLimit;this._cimLayers.push({type:"outlineFill",colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,"Color",P(i.color)),effects:a,outlineColorLocked:!!o.colorLocked,outlineColor:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Color",P(o.color)),outlineWidth:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Width",l),cap:this._getValueOrOverrideExpression(o.type,o.primitiveName,"CapStyle",n),join:this._getValueOrOverrideExpression(o.type,o.primitiveName,"JoinStyle",p),miterLimit:m&&this._getValueOrOverrideExpression(o.type,o.primitiveName,"MiterLimit",m),referenceWidth:r,outlineEffects:s})}_analyzeSolidStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=P(e.color),p=V(e.width,g.CIMSolidStroke.width),m=A(e.capStyle,g.CIMSolidStroke.capstyle),c=A(e.joinStyle,g.CIMSolidStroke.joinstyle),d=e.miterLimit;let y,f,h,u,v=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(v=this._getPrimitiveMaterialOverrides(a,s)),t&&Array.isArray(t)&&t.length>0){const e=t[t.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&(y=e.dashTemplate,f=e.scaleDash,h=e.offsetAlongLine,u=e.primitiveName,(t=[...t]).pop())}null!=u&&v.push(...this._getPrimitiveMaterialOverrides(u,s).filter(e=>"dashTemplate"===e.propertyName));const O=void 0!==y?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:y,primitiveName:u},overrides:v}:null,S=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:O,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"Color",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",m),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",c),miterLimit:d&&this._getValueOrOverrideExpression(s,a,"MiterLimit",d),referenceWidth:i,zOrder:$(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(u,"DashTemplate")??y,offsetAlongLine:this._getValueOrOverrideExpression(s,u,"OffsetAlongLine",h??0),scaleDash:f,sampleAlphaOnly:!0,animationParams:se(S)})}_analyzePictureStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=L(e),p=V(e.width,g.CIMPictureStroke.width),m=A(e.capStyle,g.CIMPictureStroke.capstyle),c=A(e.joinStyle,g.CIMPictureStroke.joinstyle),d=e.miterLimit,y={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,s)},f=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:y,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"TintColor",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",m),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",c),miterLimit:d&&this._getValueOrOverrideExpression(s,a,"MiterLimit",d),referenceWidth:i,zOrder:$(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1,animationParams:se(f)})}_analyzeGradientStroke(e,t,r,i){const{gradientMethod:o,gradientSize:a,gradientSizeUnits:s,gradientType:l,interval:n,primitiveName:p,type:m}=e,c=g.CIMGradientStroke,d=V(e.width,c.width),y=A(e.capStyle,c.capstyle),f=A(e.joinStyle,c.joinstyle),h=e.miterLimit,u=e.colorRamp;this._cimLayers.push({type:"gradientStroke",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(p,m)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(m,p,"Width",d),cap:this._getValueOrOverrideExpression(m,p,"CapStyle",y),join:this._getValueOrOverrideExpression(m,p,"JoinStyle",f),miterLimit:h&&this._getValueOrOverrideExpression(m,p,"MiterLimit",h),referenceWidth:i,isOutline:r,gradientMethod:this._getValueOrOverrideExpression(m,p,"GradientMethod",o??c.gradientMethod),gradientType:this._getValueOrOverrideExpression(m,p,"GradientType",l??c.gradientType),interval:this._getValueOrOverrideExpression(m,p,"Interval",V(n,"CIMFixedColorRamp"===u.type?u.colors.length:c.interval)),gradientSize:this._getValueOrOverrideExpression(m,p,"GradientSize",V(a,c.gradientSize)),gradientSizeUnits:"Absolute"===s?b.Absolute:"Relative"===s?b.Relative:c.gradientSizeUnits})}_analyzeMarker(e,t,r,i,o,a,s,l,d,y=!1,f=!1){y||=!!e.colorLocked;let h=d;if(h=p(e,h),h=m(this._poMap,e,h),h=c(e,h),h=n(this._poMap,e,h),this._analyzeMarkerInsidePolygon(e,t,y,h))return;const u=V(e.size,g.CIMVectorMarker.size),v=V(e.rotation),O=V(e.offsetX),S=V(e.offsetY),{primitiveName:_,type:M}=e,k=this._getValueOrOverrideExpression(M,_,"Size",u),C=this._getValueOrOverrideExpression(M,_,"Rotation",v),b=this._getValueOrOverrideExpression(M,_,"OffsetX",O),x=this._getValueOrOverrideExpression(M,_,"OffsetY",S);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,i,o,a,k,C,b,x,l,h,y,f);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,i,o,a,k,C,b,x,l,h,s,y,f)}}_analyzeMarkerInsidePolygon(e,t,r,i){const{markerPlacement:o,type:s}=e;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type||i.hasMotionAnimations)return!1;if("CIMVectorMarker"===s||"CIMPictureMarker"===s){const r=e.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;const i=o.primitiveName;if(i&&this._analyzePrimitiveOverrides([i],t,null,null))return!1;if("CIMVectorMarker"===s){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const l=Math.abs(o.stepX),n=Math.abs(o.stepY);if(0===l||0===n)return!0;let p,m;if("Random"===o.gridType){const e=a(B),t=Math.max(Math.floor(e/l),1);p=n*Math.max(Math.floor(e/n),1);m=t*l/p}else o.shiftOddRows?(p=2*n,m=l/n*.5):(p=n,m=l/n);const c=L(e),d="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:d,colorLocked:r,effects:t,color:c,height:p,scaleX:m,angle:o.gridAngle??0,offsetX:V(o.offsetX),offsetY:V(o.offsetY),applyRandomOffset:"Random"===o.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0,animationParams:se(i)}),!0}_analyzePictureMarker(e,t,i,o,a,l,n,p,m,c,d,y,f,h){const{animatedSymbolProperties:u,primitiveName:v,type:O}=e;let g=V(e.scaleX,1);const S=L(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const _=this._createGIFAnimatedSymbolPropertiesOverrideExpression(u),M=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height);g/=r*(V(e.size)/t)}const k=[...o];let C;e.primitiveName&&k.push(e.primitiveName),u||_?C={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=r(e),C.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(k,O)};_&&b.overrides.push(..._.overrides);const x=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:f,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(O,v,"ScaleX",g),rotation:p,offsetX:m,offsetY:c,transform:{type:"cim-marker-transform-param",params:d},color:this._getValueOrOverrideExpression(O,v,"TintColor",S),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:h,markerPlacement:i,animationParams:se(y),baseSize:x})}_analyzeVectorMarker(e,t,r,i,o,a,s,l,p,m,c,h,u,v,O){const g=e.markerGraphics;if(!g)return;const S=e.frame;let _=0;_=S?S.ymax-S.ymin:a;const M=!!e.scaleSymbolsProportionally;if(_){const t={offsetX:p,offsetY:m,rotation:l,size:s,frameHeight:_,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:M};c=[...c,t]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const k of g)if(k){const s=k.symbol;if(!s)continue;const l=k.primitiveName;l&&i.push(l);let p,m=h;if(("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&S){let t=0,r=0;const i=k.geometry;"x"in i&&"y"in i&&(t+=i.x-.5*(S.xmin+S.xmax),r+=i.y-.5*(S.ymin+S.ymax));const o=e.anchorPoint;let a=!1;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,r-=o.y,a=!0):S&&(t-=(S.xmax-S.xmin)*o.x,r-=(S.ymax-S.ymin)*o.y));const s={offsetX:t,offsetY:r,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:M};p=[...c,s]}const g=k.geometry,[C,b]=d(g,S);switch(0===C&&0===b||(m=y(m,C,b)),"CIMPointSymbol"===s.type&&(m=n(this._poMap,s,m)),s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":u||re(s)?(m={...m,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:f([0,0]),rotation:f(0),scale:f(_),parent:h.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,r,k,i,o,a,p??c,m,_,v,O)):this._analyzeMultiLayerGraphic(e,t,r,k,i,o,a,p??c,m,_,v,O);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,k,i,o,a,p??c,v)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,t,r,i,o,a,s,l,n,p,m,c){const d=i.symbol,y=d.symbolLayers;if(y){if(!te(y)||h(n))return ie(y)?(u(d,e=>{e.colorLocked&&(m=!0)}),void this._analyzeMultiLayerGraphicNonSDF(e,t,r,i,o,a,s,l,n,p,m,c)):void this._analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,n,p,m,c);this._analyzeCompositeMarkerGraphic(e,t,r,i,y,a,s,l,p,m,c)}}_analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,p,m,c,d){const y=i.symbol,f=y.symbolLayers;if(!f)return;const h=H.applyEffects(y.effects,i.geometry);if(!h)return;let u=f.length;for(;u--;){const y=f[u];if(!y||!1===y.enable)continue;const v=y.primitiveName;switch(v&&o.push(v),y.type){case"CIMSolidFill":case"CIMSolidStroke":{const o=H.applyEffects(y.effects,h),f=M(o);if(!f)continue;const u="Relative"!==e.anchorPointUnits,O="CIMSolidStroke"===y.type?y.width:0,{frameSizeRatio:S,anchorX:_,anchorY:b,widthRatio:x,sdfPaddingRatio:z,sdfTextureSize:I}=k(f,e.frame,e.size,e.anchorPoint,u,O,e.scaleSymbolsProportionally),E="CIMSolidFill"===y.type,L={type:"sdf",geometry:o,sdfPaddingRatio:z,asFill:E,sdfTextureSize:I},{path:N}=y,R=E?P(T(y)):null==N?P(w(y)):[0,0,0,0],A=E?[0,0,0,0]:P(w(y));if(!E&&!O)break;const G=i.primitiveName;let F=null;E&&!y.colorLocked&&(F=this._maybeGetValueOrOverrideExpression(G,"FillColor"));let X=null;E||y.colorLocked||(X=this._maybeGetValueOrOverrideExpression(G,"StrokeColor"));const j=F??this._getValueOrOverrideExpression(y.type,v,"Color",R),W=X??this._getValueOrOverrideExpression(y.type,v,"Color",A),Y=this._maybeGetValueOrOverrideExpression(G,"StrokeWidth")??this._getValueOrOverrideExpression(y.type,v,"Width",O),D=N?{type:"sprite-rasterization-param",resource:{type:"path",path:N,asFill:E},overrides:[]}:{type:"sprite-rasterization-param",resource:L,overrides:[]},U=n(this._poMap,y,p),J=V(e.size,g.CIMVectorMarker.size),B=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",J);this._cimLayers.push({type:"marker",spriteRasterizationParam:D,colorLocked:!!y.colorLocked||!!c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:_,y:b},isAbsoluteAnchorPoint:u,size:m,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:m,widthRatio:x,rotateClockwise:!1,referenceSize:s,sizeRatio:S,color:j,outlineColor:W,outlineWidth:Y,isOutline:d,markerPlacement:r,animationParams:se(U),isStroke:"CIMSolidFill"!==y.type,baseSize:B,...C(o,I,z)});break}case"CIMPictureMarker":case"CIMVectorMarker":if(y.markerPlacement){q().error("Error analyzing CIM, got unexpected marker placement");break}this._analyzeMarker(y,t,r,o,a,s,!1,l,p,c,d)}v&&o.pop()}}_analyzeTextGraphic(e,r,i,o,a,s,l,n){const p=[];_.findApplicableOverrides(i,this._primitiveOverrides,p);const m=i.geometry;if(!("x"in m)||!("y"in m))return;const c=i.symbol,d=G(c),y=F(c.fontStyleName),f=t(c.fontFamilyName);c.font={family:f,decoration:d,...y};const h=V(c.height,g.CIMTextSymbol.height),u=V(c.angle),v=V(c.offsetX),O=V(c.offsetY),{haloSymbol:S}=c,M=V(c.haloSize,0);let k=[0,0,0,0];if(S?.symbolLayers?.length){const e=S.symbolLayers;for(const t of e)if(t.color){k=this._getValueOrOverrideExpression(c?.haloSymbol?.type??"CIMPolygonSymbol",t.primitiveName,"Color",P(t.color));break}}const C=i.primitiveName;let b=[0,0,0,1],x=[0,0,0,0],z=0,I=!1;if(c.symbol?.symbolLayers)for(const t of c.symbol.symbolLayers){const e=t.primitiveName;if("CIMSolidStroke"===t.type)x=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Color",P(t.color)),z=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Width",X(t)??0);else if("CIMSolidFill"===t.type){const r=P(t.color);I=I??!!t.colorLocked,b=this._getValueOrOverrideExpression("CIMSolidFill",e??C,"Color",r)}}let E=null,L=null,N=null,R=null,A=null;C&&(E=this._maybeGetValueOrOverrideExpression(C,"TextSize"),L=this._maybeGetValueOrOverrideExpression(C,"TextAngle"),N=this._maybeGetValueOrOverrideExpression(C,"TextOffsetX"),R=this._maybeGetValueOrOverrideExpression(C,"TextOffsetY"),I||(A=this._maybeGetValueOrOverrideExpression(C,"FillColor")));const T=A??b;let w=null,Y=null,D=0;if("CIMBackgroundCallout"===c.callout?.type){const e=c.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?w=P(e.color):"CIMSolidStroke"===e.type&&(Y=P(e.color),D=V(e.width,g.CIMSolidStroke.width))}}const U=this._getValueOrOverrideExpression(c.type,i.primitiveName,"TextString",i.textString??"");if(null==U)return;const{fontStyleName:H}=c,J=f+(H?"-"+H.toLowerCase():"-regular"),B=this._getMaterialOverrides(o,c.type);B.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,c.type)),this._collectDictionaryTemplateOverrides(B,i);const q={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:c.font,symbol:c,primitiveName:i.primitiveName},overrides:B};this._cimLayers.push({type:"text",lineWidth:c.lineWidth,textRasterizationParam:q,colorLocked:!!n||!!I,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:J,decoration:d,haloSize:M,haloColor:k,weight:y.weight,style:y.style,size:E??h,angle:L??u,offsetX:N??v,offsetY:R??O,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:W(c.horizontalAlignment),verticalAlignment:j(c.verticalAlignment),text:U,color:T,outlineColor:x,outlineSize:z,backgroundColor:w,borderLineColor:Y,borderLineWidth:D,referenceSize:s,sizeRatio:1,markerPlacement:r})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){const r=Y(t.symbol);e.push({propertyName:"textString",defaultValue:"",valueExpressionInfo:{type:"dictionary-template",textCase:r,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,r,i,a,s,l,n,p,m,c,d){const y=Z(e,i),f=e.primitiveName,h=this._analyzeMaterialOverrides(f,["Rotation","OffsetX","OffsetY"]),u=N(h),[O,S,_]=v.getTextureAnchor(y,this._resourceManager,J),M=this._getMaterialOverrides(a,e.type);M.push(...u);const k={type:"sprite-rasterization-param",resource:{...y,avoidSDFRasterization:!0},overrides:M},C=V(e.size,g.CIMVectorMarker.size),b=this._getValueOrOverrideExpression(e.type,f,"Size",C);this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:O,y:S},isAbsoluteAnchorPoint:!1,size:m,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:n},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:m,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:_/o(e.size),isOutline:d,markerPlacement:r,animationParams:se(p),baseSize:b})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:ae(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:ae(t)}}_analyzeCompositeMarkerGraphic(e,t,r,i,o,a,s,l,n,p,m){const c=i.geometry,d=o[0],y=o[1],f=M(c);if(!f)return;const h="Relative"!==e.anchorPointUnits,u=V(d.width,g.CIMSolidStroke.width),{frameSizeRatio:v,anchorX:O,anchorY:S,widthRatio:_,sdfPaddingRatio:C,sdfTextureSize:b}=k(f,e.frame,e.size,e.anchorPoint,h,u,e.scaleSymbolsProportionally),{path:x}=y,z=y.primitiveName,I=d.primitiveName,E=i.primitiveName;let L=null;y.colorLocked||p||(L=this._maybeGetValueOrOverrideExpression(E,"FillColor"));const N=L??this._getValueOrOverrideExpression(y.type,z,"Color",P(y.color));let R=null;d.colorLocked||p||(R=this._maybeGetValueOrOverrideExpression(E,"StrokeColor"));const A=R??this._getValueOrOverrideExpression(d.type,I,"Color",P(d.color)),T=this._maybeGetValueOrOverrideExpression(E,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,I,"Width",u),w={type:"sprite-rasterization-param",resource:x?{type:"path",path:x,asFill:!0}:{type:"sdf",geometry:c,sdfTextureSize:b,sdfPaddingRatio:C,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:w,colorLocked:p,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:O,y:S},isAbsoluteAnchorPoint:h,size:n,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:n,widthRatio:_,rotateClockwise:!1,referenceSize:s,sizeRatio:v,color:N,outlineColor:A,outlineWidth:T,isOutline:m,markerPlacement:r})}_setPoMap(e,t,r){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,i,o=!0){if(o&&!D(i)&&(i=R(e,r.toLowerCase())),null==t)return i;const a=this._poMap[t];if(null==a)return i;const s=a[r];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,r,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const i of e)r.push(...this._getPrimitiveMaterialOverrides(i,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=N(this._primitiveOverrides.filter(t=>t.primitiveName===e));return r.forEach(e=>e.defaultValue=R(t,e.propertyName.toLowerCase())),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(r=>r.primitiveName!==e||!t.includes(r.propertyName))}}function Z(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function $(e){if(e?.startsWith("Level_")){const t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function ee(e,t){if(!t||0===t.length)return e;const i=r(e);return _.applyOverrides(i,t),i}const te=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function re(e){const t=e.symbolLayers;if(!t)return!1;const r=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectDashes"===e.type&&null!=e.dashTemplate)),i=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectAddControlPoints"===e.type));return!!r||!!i}function ie(e){return e.some(e=>"CIMSolidFill"!==e.type&&"CIMSolidStroke"!==e.type&&("CIMVectorMarker"!==e.type&&"CIMPictureMarker"!==e.type||null!=e.markerPlacement))}function oe(e,t){if(t?.some(e=>"CIMGeometricEffectRadial"===e.type)&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.type)&&2===e.length){const t=e.find(e=>"CIMSolidFill"===e.type),r=e.find(e=>"CIMSolidStroke"===e.type),i=r?.effects?.some(e=>"CIMGeometricEffectDashes"===e.type);if(null!=t&&null!=r&&!i)return!0}return!1}function ae(e){return r(e).map(e=>({...e,propertyName:U(e.propertyName)}))}function se(e){return h(e)?{type:"animation-params",params:e}:null}export{Q as CIMAnalyzer,ee as analyzeCIMResource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as s}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as r}from"../GeometryWalker.js";import{normalizeDashEffectTemplate as a}from"../utils.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new h(t,e,s)}}class h extends s{constructor(t,e,s){super(t,!0,!0),this._firstCurve=null,this._walker=new i,this._walker.updateTolerance(s),this._endings=e.lineDashEnding,this._customDashPos=-(e.offsetAlongLine??0)*s,this._offsetAtEnd=(e.customEndingOffset??0)*s;let n=a(e).dashTemplate;null==n&&(n=[]),n.length%2&&(n=[...n,...n]),this._pattern=new r,this._pattern.init(n,!0),this._pattern.scale(s)}processPath(s){if(0===this._pattern.length()){this.iteratePath=!1;const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this.iteratePath){let i=!0;switch(this._endings){case"HalfPattern":case"HalfGap":default:this._pattern.extPtGap=0;break;case"FullPattern":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case"FullGap":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case"NoConstraint":this.isClosed||(i=!1);break;case"Custom":this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const r=s.pathLength();if(this._pattern.isEmpty()||r<.1*this._pattern.length()){const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this._walker.init(s,this._pattern,i)){const i=e(s);return t.fromJSONCIM({paths:[i]})}}let i;if(this.iteratePath)i=this._pattern.nextValue();else{let t;switch(this._endings){case"HalfPattern":default:t=.5*this._pattern.firstValue();break;case"HalfGap":t=.5*-this._pattern.lastValue();break;case"FullGap":t=-this._pattern.lastValue();break;case"FullPattern":t=0;break;case"NoConstraint":case"Custom":t=-this._customDashPos}let e=t/this._pattern.length();e-=Math.floor(e),t=e*this._pattern.length(),this._pattern.reset(),i=this._pattern.nextValue();let s=!1;for(;t>=i;)t-=i,i=this._pattern.nextValue(),s=!s;i-=t,s?(this._walker.nextPosition(i),i=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(i),i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue())}let r=this._walker.nextCurve(i);if(r)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)r.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else i=this._pattern.nextValue(),!this._walker.nextPosition(i)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null;return r?.reset(),r}}export{n as EffectDashes};
2
+ import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as s}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as r}from"../GeometryWalker.js";import{normalizeDashEffectTemplate as a}from"../utils.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new h(t,e,s)}}class h extends s{constructor(t,e,s){super(t,!0,!0),this._firstCurve=null,this._walker=new i,this._walker.updateTolerance(s),this._endings=e.lineDashEnding??"NoConstraint",this._customDashPos=-(e.offsetAlongLine??0)*s,this._offsetAtEnd=(e.customEndingOffset??0)*s;let n=a(e).dashTemplate;null==n&&(n=[]),n.length%2&&(n=[...n,...n]);let h=0;for(;h<n.length&&0===n[h];)h++;let l=0;const u=[];for(let i=h;i<n.length;i++)0===n[i]?l++:0===l?u.push(n[i]):1&l?(u[u.length-1]+=n[i],l=0):(u.push(n[i]),l=0);n=u,n.length<=1?n=0===n.length||h%2==0?[]:[-1]:n.length%2==1?h%2==1?n.unshift(0):n.push(0):h%2==1&&(n.unshift(0),n.push(0)),this._pattern=new r,this._pattern.init(n,!1),this._pattern.scale(s)}processPath(s){if(this._pattern.size()%2==1)return null;if(0===this._pattern.length()){this.iteratePath=!1;const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this.iteratePath){let i=!0;switch(this._endings){case"HalfPattern":case"HalfGap":default:this._pattern.extPtGap=0;break;case"FullPattern":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case"FullGap":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case"NoConstraint":this.isClosed||(i=!1);break;case"Custom":this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const r=s.pathLength();if(this._pattern.isEmpty()||r<.1*this._pattern.length()){const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this._walker.init(s,this._pattern,i)){const i=e(s);return t.fromJSONCIM({paths:[i]})}}let i;if(this.iteratePath)i=this._pattern.nextValue();else{let t;switch(this._endings){case"HalfPattern":default:t=.5*this._pattern.firstValue();break;case"HalfGap":t=.5*-this._pattern.lastValue();break;case"FullGap":t=-this._pattern.lastValue();break;case"FullPattern":t=0;break;case"NoConstraint":case"Custom":t=-this._customDashPos}let e=t/this._pattern.length();e-=Math.floor(e),t=e*this._pattern.length(),this._pattern.reset(),i=this._pattern.nextValue();let s=!1;for(;t>=i;)t-=i,i=this._pattern.nextValue(),s=!s;i-=t,s?(this._walker.nextPosition(i),i=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(i),i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue())}0===i&&(i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue());let r=this._walker.nextCurve(i);if(r)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)r.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else i=this._pattern.nextValue(),!this._walker.nextPosition(i)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null;return r?.reset(),r}}export{n as EffectDashes};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e,n,s,h){return new r(t,i,e,n,s,h)}}class r{constructor(t,i,e,n,s,r){this._preventClipping=r,this._inputGeometries=t,this._tileKey=n,this._maxInflateSize=s*e,this._width=(void 0!==i.width?i.width:2)*e,i.method,this._option=i.option}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const t=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const h={...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},o=t.execute(h,-this._width);if(o)for(const i of o.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
2
+ import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e,n,s,h){return new r(t,i,e,n,s,h)}}class r{constructor(t,i,e,n,s,r){this._preventClipping=r,this._inputGeometries=t,this._tileKey=n,this._maxInflateSize=s*e,this._width=(void 0!==i.width?i.width:2)*e,i.method,this._option=i.option??"Accurate"}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const t=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const h={...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},o=t.execute(h,-this._width);if(o)for(const i of o.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectPath as t}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as s}from"../../../geometry/support/jsonTypeUtils.js";import{clipCursorToTileExtent as i,lazyOffsetOperator as o,lazyGraphicBufferOperator as n}from"../CIMEffects.js";import{CurveHelper as f,pixelTolerance as m}from"../CurveHelper.js";const a=10;class l{static{this.instance=null}static local(){return null===l.instance&&(l.instance=new l),l.instance}execute(e,t,r,s,i,o){return new h(e,t,r,s,i,o)}}class h{constructor(e,t,r,s,i,o){this._preventClipping=o,this._inputGeometries=e,this._tileKey=s,this._curveHelper=new f,this._offset=(t.offset??1)*r,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(i*r),a),this._option=t.option,this._offsetFlattenError=m*r}next(){let f;for(;f=this._inputGeometries.next();){if(0===this._offset)return f.clone();if("esriGeometryEnvelope"===f.geometryType){if("Rounded"===this._method&&this._offset>0){const r=t(f),s=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(s){const t=e.createEmptyOptimizedCIM(f.geometryType);return t.pushPath(s),t}return null}const r=f.asJSON();if(s(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return e.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const m=!this._preventClipping&&this._tileKey?i(f,this._maxInflateSize,!0):f.clone();if(!m)continue;const a=o.module,l=n.module,h={...m.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}};let c,p=u(this._method);return"esriGeometryPolygon"===f.geometryType&&this._offset>0?("square"===p&&(p="bevel"),c=l.executeMany([h],[this._offset],p,"round")[0]):c=a.execute(h,-this._offset,{joins:p,flattenError:this._offsetFlattenError,miterLimit:4}),c?e.fromJSONCIM(c):null}return null}}function u(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{l as EffectOffset};
2
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectPath as t}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as s}from"../../../geometry/support/jsonTypeUtils.js";import{clipCursorToTileExtent as i,lazyOffsetOperator as o,lazyGraphicBufferOperator as n}from"../CIMEffects.js";import{CurveHelper as f,pixelTolerance as m}from"../CurveHelper.js";const a=10;class l{static{this.instance=null}static local(){return null===l.instance&&(l.instance=new l),l.instance}execute(e,t,r,s,i,o){return new h(e,t,r,s,i,o)}}class h{constructor(e,t,r,s,i,o){this._preventClipping=o,this._inputGeometries=e,this._tileKey=s,this._curveHelper=new f,this._offset=(t.offset??1)*r,this._method=t.method??"Square",this._maxInflateSize=Math.max(Math.abs(i*r),a),this._option=t.option||"Fast",this._offsetFlattenError=m*r}next(){let f;for(;f=this._inputGeometries.next();){if(0===this._offset)return f.clone();if("esriGeometryEnvelope"===f.geometryType){if("Rounded"===this._method&&this._offset>0){const r=t(f),s=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(s){const t=e.createEmptyOptimizedCIM(f.geometryType);return t.pushPath(s),t}return null}const r=f.asJSON();if(s(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return e.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const m=!this._preventClipping&&this._tileKey?i(f,this._maxInflateSize,!0):f.clone();if(!m)continue;const a=o.module,l=n.module,h={...m.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}};let c,p=u(this._method);return"esriGeometryPolygon"===f.geometryType&&this._offset>0?("square"===p&&(p="bevel"),c=l.executeMany([h],[this._offset],p,"round")[0]):c=a.execute(h,-this._offset,{joins:p,flattenError:this._offsetFlattenError,miterLimit:4}),c?e.fromJSONCIM(c):null}return null}}function u(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{l as EffectOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{DashPattern as e,GeometryWalker as i,Pos as s}from"../GeometryWalker.js";class h{static{this.instance=null}static local(){return null===h.instance&&(h.instance=new h),h.instance}execute(t,e,i){return new n(t,e,i)}}class n{constructor(t,s,h){this._inputGeometries=t,this._height=(void 0!==s.amplitude?s.amplitude:2)*h,this._period=(void 0!==s.period?s.period:3)*h,this._style=s.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new e,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new i,this._walker.updateTolerance(h)}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._height||0===this._period)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(e){const i=t.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){i.startPath();const t=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case"Sinus":default:this._constructCurve(i,t,!1);break;case"Square":this._constructSquare(i,t);break;case"Triangle":this._constructTriangle(i,t);break;case"Random":this._constructCurve(i,t,!0)}else for(;e.nextPoint();)i.pushXY(e.x,e.y)}return i}_constructCurve(t,e,i){let h=Math.round(e/this._period);0===h&&(h=1);const n=h*16+1,r=e/h,a=this._period/16,o=1/n,p=2*Math.PI*e/r,_=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),l=2*Math.PI*Math.random(),u=.75-Math.random()/2,d=.75-Math.random()/2,g=new s;this._walker.curPointAndAngle(g),t.pushPoint(g.pt);let w=0;for(;;){if(!this._walker.nextPointAndAngle(a,g)){t.pushPoint(this._walker.getPathEnd());break}{const e=w;let s;if(w+=o,i){const t=this._height/2*(1+.3*Math.sin(u*p*e+_));s=t*Math.sin(p*e+c),s+=t*Math.sin(d*p*e+l),s/=2}else s=.5*this._height*Math.sin(.5*p*e);t.pushXY(g.pt[0]-s*g.sa,g.pt[1]+s*g.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(h.pt[0]-this._height/2*h.sa,h.pt[1]+this._height/2*h.ca),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period/2,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(this._walker.nextPosition(this._period/2)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca)),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}}export{h as EffectWave};
2
+ import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{DashPattern as e,GeometryWalker as i,Pos as s}from"../GeometryWalker.js";class h{static{this.instance=null}static local(){return null===h.instance&&(h.instance=new h),h.instance}execute(t,e,i){return new n(t,e,i)}}class n{constructor(t,s,h){this._inputGeometries=t,this._height=(void 0!==s.amplitude?s.amplitude:2)*h,this._period=(void 0!==s.period?s.period:3)*h,this._style=s.waveform??"Sinus",this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new e,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new i,this._walker.updateTolerance(h)}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._height||0===this._period)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(e){const i=t.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){i.startPath();const t=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case"Sinus":default:this._constructCurve(i,t,!1);break;case"Square":this._constructSquare(i,t);break;case"Triangle":this._constructTriangle(i,t);break;case"Random":this._constructCurve(i,t,!0)}else for(;e.nextPoint();)i.pushXY(e.x,e.y)}return i}_constructCurve(t,e,i){let h=Math.round(e/this._period);0===h&&(h=1);const n=h*16+1,r=e/h,a=this._period/16,o=1/n,p=2*Math.PI*e/r,_=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),l=.75-Math.random()/2,d=.75-Math.random()/2,g=new s;this._walker.curPointAndAngle(g),t.pushPoint(g.pt);let w=0;for(;;){if(!this._walker.nextPointAndAngle(a,g)){t.pushPoint(this._walker.getPathEnd());break}{const e=w;let s;if(w+=o,i){const t=this._height/2*(1+.3*Math.sin(l*p*e+_));s=t*Math.sin(p*e+u),s+=t*Math.sin(d*p*e+c),s/=2}else s=.5*this._height*Math.sin(.5*p*e);t.pushXY(g.pt[0]-s*g.sa,g.pt[1]+s*g.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(h.pt[0]-this._height/2*h.sa,h.pt[1]+this._height/2*h.ca),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period/2,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(this._walker.nextPosition(this._period/2)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca)),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}}export{h as EffectWave};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new a(t,e,s)}}class a extends t{constructor(t,i,n){super(t),this._geometryWalker=new e,this._geometryWalker.updateTolerance(n),this._angleToLine=i.angleToLine??!0,this._keepUpright=i.keepUpright??!1,this._offset=(i.offset?i.offset:0)*n,this._originalEndings=i.endings,this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*n,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*n,this._pattern=new s,this._pattern.init(i.placementTemplate,!1),this._pattern.scale(n),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{"WithFullGap"===this._originalEndings&&this.isClosed?this._endings="WithMarkers":this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case"NoConstraint":s=-this._position,s=this._adjustPosition(s),i=!1;break;case"WithHalfGap":default:s=-this._pattern.lastValue()/2;break;case"WithFullGap":s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case"WithMarkers":s=0;break;case"Custom":s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let n=0;for(;s>n;)s-=n,n=this._pattern.nextValue();n-=s,e=n,this.iteratePath=!0}const s=new i;return this._geometryWalker.nextPointAndAngle(e,s)?"WithFullGap"===this._endings&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):"WithMarkers"===this._endings&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}export{n as PlacementAlongLineSameSize};
2
+ import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new a(t,e,s)}}class a extends t{constructor(t,i,n){super(t),this._geometryWalker=new e,this._geometryWalker.updateTolerance(n),this._angleToLine=i.angleToLine??!0,this._keepUpright=i.keepUpright??!1,this._offset=(i.offset?i.offset:0)*n,this._originalEndings=i.endings??"WithHalfGap",this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*n,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*n,this._pattern=new s,this._pattern.init(i.placementTemplate),this._pattern.scale(n),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{"WithFullGap"===this._originalEndings&&this.isClosed?this._endings="WithMarkers":this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case"NoConstraint":s=-this._position,s=this._adjustPosition(s),i=!1;break;case"WithHalfGap":default:s=-this._pattern.lastValue()/2;break;case"WithFullGap":s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case"WithMarkers":s=0;break;case"Custom":s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let n=0;for(;s>n;)s-=n,n=this._pattern.nextValue();n-=s,e=n,this.iteratePath=!0}const s=new i;return this._geometryWalker.nextPointAndAngle(e,s)?"WithFullGap"===this._endings&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):"WithMarkers"===this._endings&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}export{n as PlacementAlongLineSameSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s){return new i(t,e,s)}}class i extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._keepUpright=s.keepUpright??!1,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement,this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case"Both":default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case"JustBegin":e=this._atExtremities(t,this._position,!0);break;case"JustEnd":e=this._atExtremities(t,this._position,!1);case"None":}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[r,n]=[0,0],[a,o]=[t.x,t.y];const h=[0,0];for(;s?t.nextPoint():t.prevPoint();){r=a,n=o,a=t.x,o=t.y;const s=this._curveHelper.getLength(r,n,a,o);if(i+s>e){const t=(e-i)/s,[l,c]=this._curveHelper.getAngleCS(h,r,n,a,o,t),p=this._curveHelper.getCoord2D(r,n,a,o,t);return this.internalPlacement.setTranslate(p[0]-this._offset*c,p[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(-l,-c),this.internalPlacement}i+=s}}return null}}export{s as PlacementAtExtremities};
2
+ import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s){return new i(t,e,s)}}class i extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._keepUpright=s.keepUpright??!1,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement??"Both",this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case"Both":default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case"JustBegin":e=this._atExtremities(t,this._position,!0);break;case"JustEnd":e=this._atExtremities(t,this._position,!1);case"None":}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[r,n]=[0,0],[a,o]=[t.x,t.y];const h=[0,0];for(;s?t.nextPoint():t.prevPoint();){r=a,n=o,a=t.x,o=t.y;const s=this._curveHelper.getLength(r,n,a,o);if(i+s>e){const t=(e-i)/s,[l,c]=this._curveHelper.getAngleCS(h,r,n,a,o,t),p=this._curveHelper.getCoord2D(r,n,a,o,t);return this.internalPlacement.setTranslate(p[0]-this._offset*c,p[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(-l,-c),this.internalPlacement}i+=s}}return null}}export{s as PlacementAtExtremities};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s){return new h(t,i,s)}}class h extends t{constructor(t,e,n){super(t),this._walker=new i,this._walker.updateTolerance(n),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._keepUpright=e.keepUpright??!1,this._offset=void 0!==e.offset?e.offset*n:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*n:0,this._endGap=void 0!==e.endPosition?e.endPosition*n:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new s,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let i;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;i=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,e=this._beginGap+s;i=e-this._prevPos,this._prevPos=e,this.iteratePath=!0}const s=new e;if(!this._walker.nextPointAndAngle(i,s,1))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const n=this._isFirst&&this._flipFirst;let h,r;return this._angleToLine?(h=s.ca,r=s.sa):(h=1,r=0),n&&(h=-h,r=-r),this.internalPlacement.setRotateCS(h,r),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}export{n as PlacementAtRatioPositions};
2
+ import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s){return new h(t,i,s)}}class h extends t{constructor(t,e,n){super(t),this._walker=new i,this._walker.updateTolerance(n),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._keepUpright=e.keepUpright??!1,this._offset=void 0!==e.offset?e.offset*n:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*n:0,this._endGap=void 0!==e.endPosition?e.endPosition*n:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new s,this._pattern.init(e.positionArray,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let i;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;i=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,e=this._beginGap+s;i=e-this._prevPos,this._prevPos=e,this.iteratePath=!0}const s=new e;if(!this._walker.nextPointAndAngle(i,s,1))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const n=this._isFirst&&this._flipFirst;let h,r;return this._angleToLine?(h=s.ca,r=s.sa):(h=1,r=0),n&&(h=-h,r=-r),this.internalPlacement.setRotateCS(h,r),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}export{n as PlacementAtRatioPositions};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n){return new s(t,e,n)}}class s extends t{constructor(t,i,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===i.angleToLine||i.angleToLine,this._keepUpright=i.keepUpright??!1,this._offset=void 0!==i.offset?i.offset*s:0,this._relativeTo=i.relativeTo,this._position=void 0!==i.startPointOffset?i.startPointOffset*s:0,this._epsilon=n*s}processPath(t){const e=this._position;if("SegmentMidpoint"===this._relativeTo){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];const r=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const o=this._curveHelper.getLength(e,n,i,s);if(o<this._epsilon){e=i,n=s;continue}const a=.5+this._position/o,[l,h]=this._curveHelper.getAngleCS(r,e,n,i,s,a),c=this._curveHelper.getCoord2D(e,n,i,s,a);return this.internalPlacement.setTranslate(c[0]-this._offset*h,c[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,h),this.internalPlacement}}return this.iteratePath=!1,null}const n="LineEnd"===this._relativeTo;return this.onLine(t,e,n)}onLine(t,e,n){let i,s=!1;switch(this._relativeTo){case"LineMiddle":default:t.seekPathStart(),i=t.pathLength()/2+e;break;case"LineBeginning":i=e;break;case"LineEnd":i=e,s=!0}n?t.seekPathEnd():t.seekPathStart();let r=0;if(n?t.prevPoint():t.nextPoint()){let[e,o]=[t.x,t.y],[a,l]=[0,0];const h=[0,0];for(;n?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const n=this._curveHelper.getLength(e,o,a,l);if(r+n>i){const t=(i-r)/n,[c,f]=this._curveHelper.getAngleCS(h,e,o,a,l,t),p=this._curveHelper.getCoord2D(e,o,a,l,t),u=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(p[0]-u*f,p[1]+u*c),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-c,-f):this.internalPlacement.setRotateCS(c,f)),this.internalPlacement}e=a,o=l,r+=n}}return null}}export{i as PlacementOnLine};
2
+ import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n){return new s(t,e,n)}}class s extends t{constructor(t,i,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===i.angleToLine||i.angleToLine,this._keepUpright=i.keepUpright??!1,this._offset=void 0!==i.offset?i.offset*s:0,this._relativeTo=i.relativeTo??"LineMiddle",this._position=void 0!==i.startPointOffset?i.startPointOffset*s:0,this._epsilon=n*s}processPath(t){const e=this._position;if("SegmentMidpoint"===this._relativeTo){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];const r=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const o=this._curveHelper.getLength(e,n,i,s);if(o<this._epsilon){e=i,n=s;continue}const a=.5+this._position/o,[l,h]=this._curveHelper.getAngleCS(r,e,n,i,s,a),c=this._curveHelper.getCoord2D(e,n,i,s,a);return this.internalPlacement.setTranslate(c[0]-this._offset*h,c[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,h),this.internalPlacement}}return this.iteratePath=!1,null}const n="LineEnd"===this._relativeTo;return this.onLine(t,e,n)}onLine(t,e,n){let i,s=!1;switch(this._relativeTo){case"LineMiddle":default:t.seekPathStart(),i=t.pathLength()/2+e;break;case"LineBeginning":i=e;break;case"LineEnd":i=e,s=!0}n?t.seekPathEnd():t.seekPathStart();let r=0;if(n?t.prevPoint():t.nextPoint()){let[e,o]=[t.x,t.y],[a,l]=[0,0];const h=[0,0];for(;n?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const n=this._curveHelper.getLength(e,o,a,l);if(r+n>i){const t=(i-r)/n,[c,f]=this._curveHelper.getAngleCS(h,e,o,a,l,t),p=this._curveHelper.getCoord2D(e,o,a,l,t),u=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(p[0]-u*f,p[1]+u*c),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-c,-f):this.internalPlacement.setRotateCS(c,f)),this.internalPlacement}e=a,o=l,r+=n}}return null}}export{i as PlacementOnLine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{packFloatRGBA as t}from"../../core/floatRGBA.js";import o from"../../core/Logger.js";import{nextPowerOfTwo as e}from"../../core/mathUtils.js";import{dashSdfRasterizationScale as n,dashSdfDistanceNormalization as r,dashRadius as a}from"./constants.js";import{defaultCIMValues as l}from"./defaultCIMValues.js";import{gradientTextureExternalPadding as s}from"../../views/2d/engine/webgl/definitions.js";const i=()=>o.getLogger("esri.symbols.cim.rasterizingUtils"),c=32,h=t=>"vertical"===t||"horizontal"===t||"cross"===t||"esriSFSCross"===t||"esriSFSVertical"===t||"esriSFSHorizontal"===t;function f(t,o,n){const r=o.style,a=e(Math.ceil(n)),l=h(r)?8*a:16*a,s=2*a;t.width=l,t.height=l;const i=t.getContext("2d");i.strokeStyle="#ffffff",i.lineWidth=a,i.beginPath(),"vertical"!==r&&"cross"!==r&&"esriSFSCross"!==r&&"esriSFSVertical"!==r||(i.moveTo(l/2,-s),i.lineTo(l/2,l+s)),"horizontal"!==r&&"cross"!==r&&"esriSFSCross"!==r&&"esriSFSHorizontal"!==r||(i.moveTo(-s,l/2),i.lineTo(l+s,l/2)),"backward-diagonal"!==r&&"diagonal-cross"!==r&&"esriSFSDiagonalCross"!==r&&"esriSFSBackwardDiagonal"!==r||(i.moveTo(-s,-s),i.lineTo(l+s,l+s),i.moveTo(l-s,-s),i.lineTo(l+s,s),i.moveTo(-s,l-s),i.lineTo(s,l+s)),"forward-diagonal"!==r&&"diagonal-cross"!==r&&"esriSFSForwardDiagonal"!==r&&"esriSFSDiagonalCross"!==r||(i.moveTo(l+s,-s),i.lineTo(-s,l+s),i.moveTo(s,-s),i.lineTo(-s,s),i.moveTo(l+s,l-s),i.lineTo(l-s,l+s)),i.stroke();const c=i.getImageData(0,0,t.width,t.height),f=new Uint8Array(c.data);let u;for(let e=0;e<f.length;e+=4)u=f[e+3]/255,f[e]=f[e]*u,f[e+1]=f[e+1]*u,f[e+2]=f[e+2]*u;return[f,t.width,t.height,a]}function u(o){o.length%2==1&&(o=[...o,...o]);let e=0,a=o.length-1;for(;e<o.length&&0===o[e];)e++;for(;a>=0&&0===o[a];)a--;let l=0;const s=[];for(let t=e;t<=a;t++)0===o[t]?l++:0===l?s.push(o[t]):1&l?(s[s.length-1]+=o[t],l=0):(s.push(o[t]),l=0);if(l=e+o.length-1-a,(o=s).length<=1)return 0===o.length||e%2==0?[new Uint8Array,0,1]:[new Uint8Array([255,255,255,255]),1,1];const i=o.reduce((t,o)=>t+o,0),c=Math.round(i*n),h=1,f=c*h,u=new Float32Array(f);let m=0,g=0,d=.5,p=e%2==0;const C=o.length>1&&l%2==1;for(let t=0;t<o.length;t++){for(m=g,g+=o[t]*n,0===t&&C&&(m-=o[o.length-1]*n),t===o.length-1&&C&&(g+=o[0]*n);d<=g&&d-.5<f;){const t=d-.5,o=Math.min(Math.abs(d-m),Math.abs(d-g));u[t]=p?-o:o,d++}p=!p}const M=u.length,x=new Uint8Array(4*M);for(let w=0;w<M;++w){const o=u[w]/n;t(o/r*.5+.5,x,4*w)}return[x,c,h]}function m(o,e){null==o&&(o=[]);const n="Butt"===e,r="Square"===e,l=!n&&!r;o.length%2==1&&(o=[...o,...o]);const s=a,i=2*s;let c=0;for(const t of o)c+=t;const h=Math.round(c*s),f=new Float32Array(h*i),u=.5*s;let m=0,g=0,d=.5,p=!0;for(const t of o){for(m=g,g+=t*s;d<=g;){let t=.5;for(;t<i;){const o=(t-.5)*h+d-.5,e=l?(t-s)*(t-s):Math.abs(t-s);f[o]=p?n?Math.max(Math.max(m+u-d,e),Math.max(d-g+u,e)):e:l?Math.min((d-m)*(d-m)+e,(d-g)*(d-g)+e):r?Math.min(Math.max(d-m,e),Math.max(g-d,e)):Math.min(Math.max(d-m+u,e),Math.max(g+u-d,e)),t++}d++}p=!p}const C=f.length,M=new Uint8Array(4*C);for(let a=0;a<C;++a){const o=(l?Math.sqrt(f[a]):f[a])/s;t(o,M,4*a)}return[M,h,i]}function g(t,o){const{colorRamp:e,gradientType:n}=o,r="CIMFixedColorRamp"===e.type,a=o.interval||l.CIMGradientFill.interval;let s=C(e);return r&&(s=M(s,a)),"Discrete"===n||r?w(t,s,a):x(t,s)}let d;function p(t,o){const{colorRamp:e,gradientType:n}=o,r=C(e),a="CIMFixedColorRamp"===e.type;if("Continuous"===n&&!a)return y(t,r);const s=o.interval??l.CIMGradientFill.interval;if(a){return y(t,M(r,s))}const i=[];d??=document.createElement("canvas"),S(d,r,s,1,0);const c=d.getContext("2d").getImageData(0,0,s,1).data;for(let l=0,h=0;l<s;l++,h=4*l){const t=[c[h+0],c[h+1],c[h+2],c[h+3]];i.push({offset:l/s,color:t}),i.push({offset:(l+1)/s,color:t})}return y(t,i)}function C(t){const o=[];switch(t.type){case"CIMPolarContinuousColorRamp":case"CIMLinearContinuousColorRamp":{"CIMPolarContinuousColorRamp"===t.type&&i().warnOnce("CIMPolarContinuousColorRamp is currently unsupported. Falling back to CIMLinearContinuousColorRamp.");const e=t;o.push({offset:0,color:[e.fromColor[0],e.fromColor[1],e.fromColor[2],e.fromColor[3]/255]}),o.push({offset:1,color:[e.toColor[0],e.toColor[1],e.toColor[2],e.toColor[3]/255]});break}case"CIMFixedColorRamp":{const e=t,n=1/(e.colors.length-1);let r=0;for(const t of e.colors)o.push({offset:r,color:[t[0],t[1],t[2],t[3]/255]}),r+=n;break}case"CIMMultipartColorRamp":{const e=t,n=e.weights.reduce((t,o)=>t+o,0);let r=0;for(let t=0;t<e.colorRamps.length;t++){const a=e.colorRamps[t],l=e.weights[t],s=C(a);for(const t of s)o.push({offset:(r+t.offset*l)/n,color:t.color});r+=l}break}default:i().error(`Color ramp "${t.type}" currently unsupported.`)}return o}function M(t,o){const e=[],n=(t.length-1)/(o-1);for(let r=0;r<o;r++){const a=t[Math.round(r*n)].color;e.push({offset:r/o,color:a}),e.push({offset:(r+1)/o,color:a})}return e}function x(t,o){return S(t,o,c,1,s),F(t)}function w(t,o,e){return S(t,o,e,1,s),F(t)}function y(t,o,e=0){for(const{offset:n,color:r}of o)t.addColorStop(Math.min(Math.max(n,e),1-e),`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${r[3]})`)}function S(t,o,e,n,r){const a=e+2*r;t.width=a,t.height=n;const l=(r+1)/a,s=t.getContext("2d",{willReadFrequently:!0});if(o.length>0){const t=s.createLinearGradient(0,0,a,n);y(t,o,l),s.fillStyle=t}else s.fillStyle="rgba(128, 128, 128, 1)";s.fillRect(0,0,a,n)}function F(t){const{width:o,height:e}=t,n=t.getContext("2d").getImageData(0,0,o,e),r=new Uint8Array(n.data);for(let a=0;a<r.length;a+=4){const t=r[a+3]/255;r[a]*=t,r[a+1]*=t,r[a+2]*=t}return[r,o,e]}function v(t){const o=t[0]?.[0]?.[0]??0,e=t[0]?.[0]?.[1]??0,n={ymin:e,xmin:o,ymax:e,xmax:o,width:0,height:0};for(let r=0;r<t.length;r++){const o=t[r];for(let t=0;t<o.length;t++){const e=o[t][0],r=o[t][1];e<n.xmin&&(n.xmin=e),e>n.xmax&&(n.xmax=e),r<n.ymin&&(n.ymin=r),r>n.ymax&&(n.ymax=r)}}return n.width=Math.abs(n.xmax-n.xmin),n.height=Math.abs(n.ymax-n.ymin),n}function T(t,o){const e=v(t),n=0===e.width?1:e.width,r=0===e.height?1:e.height,a=[];for(let l=0;l<t.length;l++){const s=t[l],i=[];for(let t=0;t<s.length;t++){let a=Math.round(s[t][0]-e.xmin),l=Math.round(s[t][1]-e.ymin);if(a=o.xmin+a*o.width/n,l=o.ymin+l*o.height/r,isNaN(a)||isNaN(l))throw new Error("Scaled shape has NaN values");i.push([a,l])}a.push(i)}return a}function R(t,o,e){const n=[];for(let r=0;r<t.length;r++){const a=t[r],l=[];for(let t=0;t<a.length;t++){const n=a[t][0]+o,r=a[t][1]+e;if(isNaN(n)||isNaN(r))throw new Error("Scaled shape has NaN values");l.push([n,r])}n.push(l)}return n}export{p as addColorStops,m as rasterizeDash,u as rasterizeDash1D,f as rasterizeFillStyle,g as rasterizeGradient,T as scale,R as translate};
2
+ import{packFloatRGBA as t}from"../../core/floatRGBA.js";import o from"../../core/Logger.js";import{nextPowerOfTwo as e}from"../../core/mathUtils.js";import{dashSdfRasterizationScale as n,dashSdfDistanceNormalization as r,dashRadius as a}from"./constants.js";import{defaultCIMValues as l}from"./defaultCIMValues.js";import{gradientTextureExternalPadding as s}from"../../views/2d/engine/webgl/definitions.js";const i=()=>o.getLogger("esri.symbols.cim.rasterizingUtils"),c=32,h=t=>"vertical"===t||"horizontal"===t||"cross"===t||"esriSFSCross"===t||"esriSFSVertical"===t||"esriSFSHorizontal"===t;function f(t,o,n){const r=o.style,a=e(Math.ceil(n)),l=h(r)?8*a:16*a,s=2*a;t.width=l,t.height=l;const i=t.getContext("2d");i.strokeStyle="#ffffff",i.lineWidth=a,i.beginPath(),"vertical"!==r&&"cross"!==r&&"esriSFSCross"!==r&&"esriSFSVertical"!==r||(i.moveTo(l/2,-s),i.lineTo(l/2,l+s)),"horizontal"!==r&&"cross"!==r&&"esriSFSCross"!==r&&"esriSFSHorizontal"!==r||(i.moveTo(-s,l/2),i.lineTo(l+s,l/2)),"backward-diagonal"!==r&&"diagonal-cross"!==r&&"esriSFSDiagonalCross"!==r&&"esriSFSBackwardDiagonal"!==r||(i.moveTo(-s,-s),i.lineTo(l+s,l+s),i.moveTo(l-s,-s),i.lineTo(l+s,s),i.moveTo(-s,l-s),i.lineTo(s,l+s)),"forward-diagonal"!==r&&"diagonal-cross"!==r&&"esriSFSForwardDiagonal"!==r&&"esriSFSDiagonalCross"!==r||(i.moveTo(l+s,-s),i.lineTo(-s,l+s),i.moveTo(s,-s),i.lineTo(-s,s),i.moveTo(l+s,l-s),i.lineTo(l-s,l+s)),i.stroke();const c=i.getImageData(0,0,t.width,t.height),f=new Uint8Array(c.data);let u;for(let e=0;e<f.length;e+=4)u=f[e+3]/255,f[e]=f[e]*u,f[e+1]=f[e+1]*u,f[e+2]=f[e+2]*u;return[f,t.width,t.height,a]}function u(o){o.length%2==1&&(o=[...o,...o]);let e=0,a=o.length-1;for(;e<o.length&&0===o[e];)e++;for(;a>=0&&0===o[a];)a--;let l=0;const s=[];for(let t=e;t<=a;t++)0===o[t]?l++:0===l?s.push(o[t]):1&l?(s[s.length-1]+=o[t],l=0):(s.push(o[t]),l=0);if(l=e+o.length-1-a,(o=s).length<=1)return 0===o.length||e%2==0?[new Uint8Array,0,1]:[new Uint8Array([255,255,255,255]),1,1];const i=o.reduce((t,o)=>t+o,0),c=Math.round(i*n),h=1,f=c*h,u=new Float32Array(f);let m=0,g=0,d=.5,p=e%2==0;const C=l%2==1;for(let t=0;t<o.length;t++){for(m=g,g+=o[t]*n,0===t&&C&&(m-=o[o.length-1]*n),t===o.length-1&&C&&(g+=o[0]*n);d<=g&&d-.5<f;){const t=d-.5,o=Math.min(Math.abs(d-m),Math.abs(d-g));u[t]=p?-o:o,d++}p=!p}const M=u.length,x=new Uint8Array(4*M);for(let w=0;w<M;++w){const o=u[w]/n;t(o/r*.5+.5,x,4*w)}return[x,c,h]}function m(o,e){null==o&&(o=[]);const n="Butt"===e,r="Square"===e,l=!n&&!r;o.length%2==1&&(o=[...o,...o]);const s=a,i=2*s;let c=0;for(const t of o)c+=t;const h=Math.round(c*s),f=new Float32Array(h*i),u=.5*s;let m=0,g=0,d=.5,p=!0;for(const t of o){for(m=g,g+=t*s;d<=g;){let t=.5;for(;t<i;){const o=(t-.5)*h+d-.5,e=l?(t-s)*(t-s):Math.abs(t-s);f[o]=p?n?Math.max(Math.max(m+u-d,e),Math.max(d-g+u,e)):e:l?Math.min((d-m)*(d-m)+e,(d-g)*(d-g)+e):r?Math.min(Math.max(d-m,e),Math.max(g-d,e)):Math.min(Math.max(d-m+u,e),Math.max(g+u-d,e)),t++}d++}p=!p}const C=f.length,M=new Uint8Array(4*C);for(let a=0;a<C;++a){const o=(l?Math.sqrt(f[a]):f[a])/s;t(o,M,4*a)}return[M,h,i]}function g(t,o){const{colorRamp:e,gradientType:n}=o,r="CIMFixedColorRamp"===e.type,a=o.interval||l.CIMGradientFill.interval;let s=C(e);return r&&(s=M(s,a)),"Discrete"===n||r?w(t,s,a):x(t,s)}let d;function p(t,o){const{colorRamp:e,gradientType:n}=o,r=C(e),a="CIMFixedColorRamp"===e.type;if("Continuous"===n&&!a)return y(t,r);const s=o.interval??l.CIMGradientFill.interval;if(a){return y(t,M(r,s))}const i=[];d??=document.createElement("canvas"),S(d,r,s,1,0);const c=d.getContext("2d").getImageData(0,0,s,1).data;for(let l=0,h=0;l<s;l++,h=4*l){const t=[c[h+0],c[h+1],c[h+2],c[h+3]];i.push({offset:l/s,color:t}),i.push({offset:(l+1)/s,color:t})}return y(t,i)}function C(t){const o=[];switch(t.type){case"CIMPolarContinuousColorRamp":case"CIMLinearContinuousColorRamp":{"CIMPolarContinuousColorRamp"===t.type&&i().warnOnce("CIMPolarContinuousColorRamp is currently unsupported. Falling back to CIMLinearContinuousColorRamp.");const e=t;o.push({offset:0,color:[e.fromColor[0],e.fromColor[1],e.fromColor[2],e.fromColor[3]/255]}),o.push({offset:1,color:[e.toColor[0],e.toColor[1],e.toColor[2],e.toColor[3]/255]});break}case"CIMFixedColorRamp":{const e=t,n=1/(e.colors.length-1);let r=0;for(const t of e.colors)o.push({offset:r,color:[t[0],t[1],t[2],t[3]/255]}),r+=n;break}case"CIMMultipartColorRamp":{const e=t,n=e.weights.reduce((t,o)=>t+o,0);let r=0;for(let t=0;t<e.colorRamps.length;t++){const a=e.colorRamps[t],l=e.weights[t],s=C(a);for(const t of s)o.push({offset:(r+t.offset*l)/n,color:t.color});r+=l}break}default:i().error(`Color ramp "${t.type}" currently unsupported.`)}return o}function M(t,o){const e=[],n=(t.length-1)/(o-1);for(let r=0;r<o;r++){const a=t[Math.round(r*n)].color;e.push({offset:r/o,color:a}),e.push({offset:(r+1)/o,color:a})}return e}function x(t,o){return S(t,o,c,1,s),F(t)}function w(t,o,e){return S(t,o,e,1,s),F(t)}function y(t,o,e=0){for(const{offset:n,color:r}of o)t.addColorStop(Math.min(Math.max(n,e),1-e),`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${r[3]})`)}function S(t,o,e,n,r){const a=e+2*r;t.width=a,t.height=n;const l=(r+1)/a,s=t.getContext("2d",{willReadFrequently:!0});if(o.length>0){const t=s.createLinearGradient(0,0,a,n);y(t,o,l),s.fillStyle=t}else s.fillStyle="rgba(128, 128, 128, 1)";s.fillRect(0,0,a,n)}function F(t){const{width:o,height:e}=t,n=t.getContext("2d").getImageData(0,0,o,e),r=new Uint8Array(n.data);for(let a=0;a<r.length;a+=4){const t=r[a+3]/255;r[a]*=t,r[a+1]*=t,r[a+2]*=t}return[r,o,e]}function v(t){const o=t[0]?.[0]?.[0]??0,e=t[0]?.[0]?.[1]??0,n={ymin:e,xmin:o,ymax:e,xmax:o,width:0,height:0};for(let r=0;r<t.length;r++){const o=t[r];for(let t=0;t<o.length;t++){const e=o[t][0],r=o[t][1];e<n.xmin&&(n.xmin=e),e>n.xmax&&(n.xmax=e),r<n.ymin&&(n.ymin=r),r>n.ymax&&(n.ymax=r)}}return n.width=Math.abs(n.xmax-n.xmin),n.height=Math.abs(n.ymax-n.ymin),n}function T(t,o){const e=v(t),n=0===e.width?1:e.width,r=0===e.height?1:e.height,a=[];for(let l=0;l<t.length;l++){const s=t[l],i=[];for(let t=0;t<s.length;t++){let a=Math.round(s[t][0]-e.xmin),l=Math.round(s[t][1]-e.ymin);if(a=o.xmin+a*o.width/n,l=o.ymin+l*o.height/r,isNaN(a)||isNaN(l))throw new Error("Scaled shape has NaN values");i.push([a,l])}a.push(i)}return a}function R(t,o,e){const n=[];for(let r=0;r<t.length;r++){const a=t[r],l=[];for(let t=0;t<a.length;t++){const n=a[t][0]+o,r=a[t][1]+e;if(isNaN(n)||isNaN(r))throw new Error("Scaled shape has NaN values");l.push([n,r])}n.push(l)}return n}export{p as addColorStops,m as rasterizeDash,u as rasterizeDash1D,f as rasterizeFillStyle,g as rasterizeGradient,T as scale,R as translate};