@arcgis/core 4.33.0-next.20250514 → 4.33.0-next.20250516

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 (474) hide show
  1. package/Basemap.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Map.js +1 -1
  4. package/WebScene.js +1 -1
  5. package/applications/Components/SelectionOperation.js +1 -1
  6. package/applications/Components/baUtils.js +1 -1
  7. package/arcade/functions/featuresetbase.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/009730713ed9bc7c7388.js +1 -0
  10. package/assets/esri/core/workers/chunks/02853ab923245459b32e.js +1 -0
  11. package/assets/esri/core/workers/chunks/0624ae07d3af8d5f1ac8.js +1 -0
  12. package/assets/esri/core/workers/chunks/{6e8c6c9112ecb867b7be.js → 0817ddd885ce8b2459cb.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{69e8aabe5a1eb2d1e414.js → 0832bd5195b5791dd803.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0c50ee1f3cdd30d96479.js +1 -0
  15. package/assets/esri/core/workers/chunks/0d23610475c85385fbff.js +1 -0
  16. package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js → 0fd6d80393722132e044.js} +2 -2
  17. package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js.LICENSE.txt → 0fd6d80393722132e044.js.LICENSE.txt} +1 -1
  18. package/assets/esri/core/workers/chunks/1051a5a57b2fb843a555.js +1 -0
  19. package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +1 -0
  20. package/assets/esri/core/workers/chunks/19a58adc75a34f84b0ef.js +1 -0
  21. package/assets/esri/core/workers/chunks/{7e8f78b96d43c224c7b6.js → 19c50f052eba0553bf4d.js} +1 -1
  22. package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +1 -0
  23. package/assets/esri/core/workers/chunks/{339e7a900e2bba9d3647.js → 1f19bd3ef795c6765384.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +1 -0
  25. package/assets/esri/core/workers/chunks/234117cc5cb7c6863313.js +1 -0
  26. package/assets/esri/core/workers/chunks/{1c025beaaac5ec7c04fb.js → 2adf558cd8d8155d07d7.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{837f886f759fc6f0489d.js → 2b1486a466760d2152f5.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{47f64a340b5d56bf9e59.js → 2cf82d3645c75d311e99.js} +1 -1
  29. package/assets/esri/core/workers/chunks/320e821af81138fe12ac.js +1 -0
  30. package/assets/esri/core/workers/chunks/{f7ab3511f6627f467796.js → 377a7f0f7d304ff9fe5b.js} +1 -1
  31. package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +1 -0
  32. package/assets/esri/core/workers/chunks/{b3ca65d6112079fb1d00.js → 3ce5d7ad16e41eea05be.js} +1 -1
  33. package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +1 -0
  34. package/assets/esri/core/workers/chunks/{1e13e03aad422f9e871e.js → 47fe2379f2214bf50036.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{b8b5dfd2d73a8410fba2.js → 4954e0cf4a40e45d237f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/4a362a35bcdb8405a53a.js +1 -0
  37. package/assets/esri/core/workers/chunks/4f8ebd9f0758b801835c.js +1 -0
  38. package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +1 -0
  39. package/assets/esri/core/workers/chunks/523046e04679e301797d.js +1 -0
  40. package/assets/esri/core/workers/chunks/{736cb9f74bf050b70f4c.js → 52a3d0e041717da7697e.js} +1 -1
  41. package/assets/esri/core/workers/chunks/54ea93f416ab52b413c1.js +1 -0
  42. package/assets/esri/core/workers/chunks/554a8bf4626336e68798.js +1 -0
  43. package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +1 -0
  44. package/assets/esri/core/workers/chunks/{bbaadce582df7e20397b.js → 56d2a20c1b143697aa19.js} +1 -1
  45. package/assets/esri/core/workers/chunks/57211c35a9646f088d86.js +1 -0
  46. package/assets/esri/core/workers/chunks/58526def64536b6581ab.js +1 -0
  47. package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +1 -0
  48. package/assets/esri/core/workers/chunks/{9a641fb94819574e48f6.js → 5a73d8b7b01758ed4fdd.js} +1 -1
  49. package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +1 -0
  50. package/assets/esri/core/workers/chunks/{a0d2bd5d4ed3c90f6b1c.js → 5f766bcb751d66fbf1c8.js} +1 -1
  51. package/assets/esri/core/workers/chunks/609c7c9b7046b3a7acde.js +1 -0
  52. package/assets/esri/core/workers/chunks/{d21d9e8b8c8a2e0485d5.js → 612f6739c9399fbae4d0.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{30f3014c0ac6e2bc14bf.js → 622c0552ca3cd674d46c.js} +1 -1
  54. package/assets/esri/core/workers/chunks/6409160d226a0bea5ac6.js +1 -0
  55. package/assets/esri/core/workers/chunks/65fd971d0574d69cbc26.js +1 -0
  56. package/assets/esri/core/workers/chunks/6993a59cbb78bc26f029.js +1 -0
  57. package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +1 -0
  58. package/assets/esri/core/workers/chunks/6c37a5bd00d255d1337a.js +1 -0
  59. package/assets/esri/core/workers/chunks/6ce4327f63e6eb92bba8.js +1 -0
  60. package/assets/esri/core/workers/chunks/6f9b8df290b0ce09beae.js +1 -0
  61. package/assets/esri/core/workers/chunks/{e0247252c6a0f3340e33.js → 6fa1a5b7276a037dbd6a.js} +84 -106
  62. package/assets/esri/core/workers/chunks/7a9a0383f27f4967bcfa.js +1 -0
  63. package/assets/esri/core/workers/chunks/7c819b3e6d69c526f4b2.js +1 -0
  64. package/assets/esri/core/workers/chunks/7df147da40474b028705.js +1 -0
  65. package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js → 7e1dc8e5e18f18dd21e2.js} +2 -2
  66. package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js.LICENSE.txt → 7e1dc8e5e18f18dd21e2.js.LICENSE.txt} +1 -1
  67. package/assets/esri/core/workers/chunks/{e662c86b8bafc5512d3d.js → 847e88e1d6da1e74cdc8.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6f5ec9bf7cf8a36d8e8b.js → 87eca6de502d18d8b7eb.js} +1 -1
  69. package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +1 -0
  70. package/assets/esri/core/workers/chunks/{10e6dffa57aa1a626708.js → 8a6aac37b3133de74cce.js} +1 -1
  71. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  72. package/assets/esri/core/workers/chunks/91cd29f53f07bc38fe75.js +1 -0
  73. package/assets/esri/core/workers/chunks/{5583d18032ed8bc17c74.js → 938f1eebc48871be64e9.js} +1 -1
  74. package/assets/esri/core/workers/chunks/97c148adf0347c69a79c.js +1 -0
  75. package/assets/esri/core/workers/chunks/9839309d0cd804fe52c2.js +1 -0
  76. package/assets/esri/core/workers/chunks/{029a118e6dfb3f544a5c.js → 98ef17d15517368d2383.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{c10885b3a0739708e9e0.js → 9a06476b834584d00d5c.js} +1 -1
  78. package/assets/esri/core/workers/chunks/9c8224ca29475556e5ea.js +1 -0
  79. package/assets/esri/core/workers/chunks/{fd24dd602a3fed88d90e.js → 9d5eac3bd1526e2b33e3.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{38f5e6a202ce292edd9f.js → 9eb9c8db2510154c09cc.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +1 -0
  82. package/assets/esri/core/workers/chunks/{6e64ce0958c3432004b6.js → a70a86ba4e487f62f683.js} +2 -2
  83. package/assets/esri/core/workers/chunks/a937076d2f8c2b6a5d8a.js +1 -0
  84. package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js → ab9614555a15f04396f6.js} +2 -2
  85. package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js.LICENSE.txt → ab9614555a15f04396f6.js.LICENSE.txt} +1 -1
  86. package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +1 -0
  87. package/assets/esri/core/workers/chunks/{8e82acd1f730571680f4.js → aeb5bbe861f65544d504.js} +1 -1
  88. package/assets/esri/core/workers/chunks/b0522dffa5600345c07e.js +1 -0
  89. package/assets/esri/core/workers/chunks/{d1f7bfb8daf11ecada9f.js → b4273381dc069f4e1fa2.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{fb2e28e6a87956267d1c.js → b92a34f88569c481ed10.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{352b7dcd1633e0c98194.js → ba940ebdae84b174a7be.js} +1 -1
  92. package/assets/esri/core/workers/chunks/be2c8c0a8b2bce7979b6.js +1 -0
  93. package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +1 -0
  94. package/assets/esri/core/workers/chunks/c07c1bb7ae09136dc1f6.js +1 -0
  95. package/assets/esri/core/workers/chunks/c938f5d269ba202d10ef.js +1 -0
  96. package/assets/esri/core/workers/chunks/cbbca011f8b176d4b5db.js +1 -0
  97. package/assets/esri/core/workers/chunks/{c604fefedccfd4db9953.js → ce321fd8fc5551e190ec.js} +1 -1
  98. package/assets/esri/core/workers/chunks/ce53ddda04e09ba2f860.js +1 -0
  99. package/assets/esri/core/workers/chunks/d9a23fb0c6c936d5e8ec.js +1 -0
  100. package/assets/esri/core/workers/chunks/db3f710d770adf631b28.js +2 -0
  101. package/assets/esri/core/workers/chunks/{6394ab6f629aa90292e6.js.LICENSE.txt → db3f710d770adf631b28.js.LICENSE.txt} +1 -1
  102. package/assets/esri/core/workers/chunks/{6805e7b43d6ecf3ea93c.js → dcf5719f38ad40b92941.js} +1 -1
  103. package/assets/esri/core/workers/chunks/e2cada6644c49b1b6e79.js +1 -0
  104. package/assets/esri/core/workers/chunks/e2fb4bebce3aee406efa.js +1 -0
  105. package/assets/esri/core/workers/chunks/e3638f9d4c0fda238f4b.js +1 -0
  106. package/assets/esri/core/workers/chunks/e85f892ea44d67d53ff0.js +2 -0
  107. package/assets/esri/core/workers/chunks/{3596540ef49e5330ceb2.js.LICENSE.txt → e85f892ea44d67d53ff0.js.LICENSE.txt} +1 -1
  108. package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +1 -0
  109. package/assets/esri/core/workers/chunks/{a31658f544ac6e1801d6.js → ead5d4e271effc04def3.js} +1 -1
  110. package/assets/esri/core/workers/chunks/ece68a25651ef03fc95d.js +1 -0
  111. package/assets/esri/core/workers/chunks/f218a190015de1444018.js +1 -0
  112. package/assets/esri/core/workers/chunks/f229044615af3142bcb0.js +1 -0
  113. package/assets/esri/core/workers/chunks/f2692f25ef693cf12ce0.js +1 -0
  114. package/assets/esri/core/workers/chunks/f4c6ea630cecf0f260d7.js +2 -0
  115. package/assets/esri/core/workers/chunks/{e0dc8794343c2a949ffb.js.LICENSE.txt → f4c6ea630cecf0f260d7.js.LICENSE.txt} +1 -1
  116. package/assets/esri/core/workers/chunks/f718cb847c4eb1e43ad9.js +1 -0
  117. package/assets/esri/core/workers/chunks/faa40ef04604c7cce706.js +1 -0
  118. package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js → fbd2f45d5adce4ca323f.js} +2 -2
  119. package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js.LICENSE.txt → fbd2f45d5adce4ca323f.js.LICENSE.txt} +1 -1
  120. package/assets/esri/core/workers/chunks/{498886c321a2501658bc.js → ffaa977cd97a2b7190c5.js} +1 -1
  121. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  122. package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
  123. package/assets/esri/themes/base/widgets/_SearchResultRenderer.scss +5 -30
  124. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +5 -0
  125. package/assets/esri/themes/dark/main.css +1 -1
  126. package/assets/esri/themes/light/main.css +1 -1
  127. package/assets/esri/themes/light/view.css +1 -1
  128. package/assets/esri/widgets/Search/t9n/Search.json +1 -1
  129. package/assets/esri/widgets/Search/t9n/Search_en.json +1 -1
  130. package/chunks/Envelope.js +1 -1
  131. package/chunks/Jpg.js +1 -1
  132. package/chunks/LineSeries.js +1 -1
  133. package/chunks/ProjectionTransformation.js +1 -1
  134. package/chunks/QuadraticBezier.js +1 -1
  135. package/chunks/ShadowCastAccumulate.glsl.js +7 -5
  136. package/chunks/ShadowCastClear.glsl.js +5 -0
  137. package/chunks/ShadowCastVisualize.glsl.js +1 -1
  138. package/chunks/ShadowHighlight.glsl.js +8 -7
  139. package/chunks/Transformation2D.js +1 -1
  140. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  141. package/chunks/arcgis-knowledge-client-core.js +1 -1
  142. package/chunks/basis_encoder.js +1 -1
  143. package/chunks/basis_transcoder.js +1 -1
  144. package/chunks/bundle.js +1 -1
  145. package/chunks/chartUtilsAm5.js +1 -1
  146. package/chunks/dxt_encoder.js +1 -1
  147. package/chunks/geometryEngineBase.js +1 -1
  148. package/chunks/i3s.js +1 -1
  149. package/chunks/lclayout.js +1 -1
  150. package/chunks/libtess-asm.js +1 -1
  151. package/chunks/lyr3DMain.js +1 -1
  152. package/chunks/lyr3DWorker.js +1 -1
  153. package/chunks/vec4.js +1 -1
  154. package/chunks/vxlLayer.js +1 -1
  155. package/config.js +1 -1
  156. package/core/arrayUtils.js +1 -1
  157. package/core/image/apng.js +1 -1
  158. package/core/image/gif.js +1 -1
  159. package/core/mathUtils.js +1 -1
  160. package/core/workers/Connection.js +1 -1
  161. package/geometry/operators/densifyOperator.d.ts +0 -1
  162. package/geometry/operators/gx/operatorOffset.js +1 -1
  163. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  164. package/geometry/support/aaBoundingBox.js +1 -1
  165. package/geometry/support/meshProperties.js +1 -1
  166. package/geometry/support/normalizeUtilsSync.js +1 -1
  167. package/interfaces.d.ts +313 -163
  168. package/intl/date.js +1 -1
  169. package/intl/number.js +1 -1
  170. package/layers/BingMapsLayer.js +1 -1
  171. package/layers/graphics/OptimizedFeatureSet.js +1 -1
  172. package/layers/graphics/controllers/StreamController.js +1 -1
  173. package/layers/graphics/data/FeatureIdInfo.js +5 -0
  174. package/layers/graphics/data/QueryEngine.js +1 -1
  175. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  176. package/layers/graphics/data/createFeatureId.js +5 -0
  177. package/layers/graphics/featureConversionUtils.js +1 -1
  178. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  179. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  180. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  181. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  182. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  183. package/layers/ogc/ogcFeatureUtils.js +1 -1
  184. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  185. package/layers/orientedImagery/core/utils.js +1 -1
  186. package/layers/orientedImagery/queries.js +1 -1
  187. package/layers/orientedImagery/transformations/utils.js +1 -1
  188. package/layers/support/LercWorker.js +1 -1
  189. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  190. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  191. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  192. package/layers/support/wmsUtils.js +1 -1
  193. package/layers/video/VideoController.js +1 -1
  194. package/package.json +2 -2
  195. package/portal/Portal.js +1 -1
  196. package/request.js +1 -1
  197. package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
  198. package/rest/knowledgeGraph/GraphAddPropertyResult.js +5 -0
  199. package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
  200. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
  201. package/rest/knowledgeGraph/GraphDeletePropertyResult.js +5 -0
  202. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +5 -0
  203. package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +5 -0
  204. package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
  205. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
  206. package/rest/knowledgeGraphService.js +1 -1
  207. package/rest/networks/support/Association.js +1 -1
  208. package/rest/networks/support/NetworkElement.js +1 -1
  209. package/rest/networks/support/QueryAssociationsParameters.js +1 -1
  210. package/rest/networks/support/TelecomNetworkElement.js +1 -1
  211. package/rest/networks/support/TraceResult.js +1 -1
  212. package/rest/networks/unitIdentifiers/insertGap.js +5 -0
  213. package/rest/networks/unitIdentifiers/queryUnitIdentifiers.js +5 -0
  214. package/rest/networks/unitIdentifiers/reset.js +5 -0
  215. package/rest/networks/unitIdentifiers/resize.js +5 -0
  216. package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +5 -0
  217. package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParamters.js +5 -0
  218. package/rest/networks/unitIdentifiers/support/ResetParameters.js +5 -0
  219. package/rest/networks/unitIdentifiers/support/ResizeParameters.js +5 -0
  220. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +5 -0
  221. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  222. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  223. package/rest/query/operations/queryRelatedRecords.js +1 -1
  224. package/rest/utils.js +1 -1
  225. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  226. package/support/apiKeyUtils.js +1 -1
  227. package/support/basemapEnsureType.js +1 -1
  228. package/support/revision.js +1 -1
  229. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  230. package/unionTypes.d.ts +2 -0
  231. package/views/2d/engine/ManagedCanvas.js +1 -1
  232. package/views/2d/engine/Stage.js +1 -1
  233. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  234. package/views/2d/engine/webgl/TileContainer.js +1 -1
  235. package/views/2d/engine/webgl/grouping.js +1 -1
  236. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  237. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  238. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  239. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  240. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  241. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  242. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  243. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  244. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  245. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  246. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
  247. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  248. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  249. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  250. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  251. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  252. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  253. package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
  254. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  255. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  256. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  257. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  258. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  259. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  260. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  261. package/views/3d/FocusAreasView.js +1 -1
  262. package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
  263. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +4 -0
  264. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  265. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  266. package/views/3d/camera/constraintUtils/common.js +1 -1
  267. package/views/3d/interactive/Manipulator3D.js +1 -1
  268. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  269. package/views/3d/layers/ContentGeometryLayerView.js +5 -0
  270. package/views/3d/layers/DimensionLayerView3D.js +1 -1
  271. package/views/3d/layers/FlowSubView3D.js +1 -1
  272. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  273. package/views/3d/layers/I3SMeshView3D.js +1 -1
  274. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  275. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  276. package/views/3d/layers/RouteLayerView3D.js +1 -1
  277. package/views/3d/layers/ViewshedLayerView3D.js +1 -1
  278. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  279. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  280. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  281. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  282. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  283. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  284. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  285. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  286. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  287. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  288. package/views/3d/layers/graphics/Labeler.js +1 -1
  289. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  290. package/views/3d/layers/graphics/focusAreaStyle.js +5 -0
  291. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  292. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  293. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  294. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  295. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  296. package/views/3d/layers/i3s/PagedNodeIndex.js +1 -1
  297. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  298. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  299. package/views/3d/layers/support/LayerViewAnalysisViewManager.js +5 -0
  300. package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
  301. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  302. package/views/3d/terrain/PatchRenderData.js +1 -1
  303. package/views/3d/terrain/TerrainRenderer.js +1 -1
  304. package/views/3d/terrain/TerrainSurface.js +1 -1
  305. package/views/3d/terrain/TileAgent.js +1 -1
  306. package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRange.js +1 -1
  307. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  308. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +3 -3
  309. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +3 -25
  310. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +1 -1
  311. package/views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js +5 -0
  312. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  313. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +3 -3
  314. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  315. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  316. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  317. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  318. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  319. package/views/3d/webgl-engine/lib/Material.js +1 -1
  320. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  321. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  322. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  323. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  324. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  325. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  326. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  327. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  328. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  329. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  330. package/views/3d/webgl-engine/shaders/ShadowCastClear.glsl.js +5 -0
  331. package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +5 -0
  332. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  333. package/views/3d/webgl.js +1 -1
  334. package/views/FocusArea.js +1 -1
  335. package/views/FocusAreas.js +1 -1
  336. package/views/GroundView.js +1 -1
  337. package/views/SceneView.js +1 -1
  338. package/views/View.js +1 -1
  339. package/views/draw/support/Box.js +1 -1
  340. package/views/draw/support/GraphicMover.js +1 -1
  341. package/views/draw/support/Reshape.js +1 -1
  342. package/views/input/InputManager.js +1 -1
  343. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  344. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  345. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  346. package/views/layers/FeatureLayerView.js +1 -1
  347. package/views/support/LayerViewManager.js +1 -1
  348. package/views/webgl/RenderingContext.js +1 -1
  349. package/views/webgl/ShaderBuilder.js +1 -1
  350. package/views/webgl/Texture.js +1 -1
  351. package/views/webgl/TextureDescriptor.js +1 -1
  352. package/views/webgl/textureUtils.js +1 -1
  353. package/webscene/Slide.js +1 -1
  354. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  355. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  356. package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
  357. package/widgets/BatchAttributeForm.js +1 -1
  358. package/widgets/CoordinateConversion.js +1 -1
  359. package/widgets/Directions.js +1 -1
  360. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  361. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  362. package/widgets/Editor/EditorViewModel.js +1 -1
  363. package/widgets/Editor/UpdateFeaturesWorkflow.d.ts +4 -0
  364. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  365. package/widgets/Editor/UpdateFeaturesWorkflowData.d.ts +4 -0
  366. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  367. package/widgets/Editor/UpdateWorkflow.js +1 -1
  368. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  369. package/widgets/Editor/support/SketchController.js +1 -1
  370. package/widgets/Editor/workflowUtils.js +1 -1
  371. package/widgets/Editor.js +1 -1
  372. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  373. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  374. package/widgets/FeatureForm.js +1 -1
  375. package/widgets/LayerList/LayerListItem.js +1 -1
  376. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  377. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  378. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  379. package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
  380. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +5 -0
  381. package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
  382. package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
  383. package/widgets/OrientedImageryViewer/constants.js +1 -1
  384. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +5 -0
  385. package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +5 -0
  386. package/widgets/OrientedImageryViewer/navigation/errors.js +5 -0
  387. package/widgets/OrientedImageryViewer/navigation/queries.js +5 -0
  388. package/widgets/OrientedImageryViewer/navigation/utils.js +5 -0
  389. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  390. package/widgets/PanoramicViewer.js +1 -1
  391. package/widgets/Search/SearchResultRenderer.js +1 -1
  392. package/widgets/Search/SearchViewModel.js +1 -1
  393. package/widgets/Search/searchResultRendererCSS.js +1 -1
  394. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  395. package/widgets/Sketch/SketchViewModel.js +1 -1
  396. package/widgets/Sketch.js +1 -1
  397. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  398. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  399. package/widgets/support/SelectionList.js +1 -1
  400. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  401. package/widgets/support/SelectionToolbar.js +1 -1
  402. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  403. package/widgets/support/SnappingControls.js +1 -1
  404. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  405. package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
  406. package/assets/esri/core/workers/chunks/0516bd18334d3af6c555.js +0 -1
  407. package/assets/esri/core/workers/chunks/0d8a635c1f9aeaf7564c.js +0 -1
  408. package/assets/esri/core/workers/chunks/191a45a594ecaf7f1abb.js +0 -1
  409. package/assets/esri/core/workers/chunks/1abd026ed12c863e1d94.js +0 -1
  410. package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +0 -1
  411. package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +0 -1
  412. package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +0 -1
  413. package/assets/esri/core/workers/chunks/297d2c0a9d3f1e978318.js +0 -1
  414. package/assets/esri/core/workers/chunks/2e0af748eba93f3ea6cb.js +0 -1
  415. package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +0 -2
  416. package/assets/esri/core/workers/chunks/3604a77c93cf2927787b.js +0 -1
  417. package/assets/esri/core/workers/chunks/391b1c3e736a62befbaf.js +0 -1
  418. package/assets/esri/core/workers/chunks/40e556a0645af8658658.js +0 -1
  419. package/assets/esri/core/workers/chunks/4402336db7210cd583e0.js +0 -1
  420. package/assets/esri/core/workers/chunks/4899cdc8bb5085c356f9.js +0 -1
  421. package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +0 -1
  422. package/assets/esri/core/workers/chunks/4c8052e81916579841f4.js +0 -1
  423. package/assets/esri/core/workers/chunks/4c9aa1dafdc0d9537231.js +0 -1
  424. package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +0 -1
  425. package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +0 -1
  426. package/assets/esri/core/workers/chunks/566c2ce50af225e556ac.js +0 -1
  427. package/assets/esri/core/workers/chunks/5ddf463c85c33428e807.js +0 -1
  428. package/assets/esri/core/workers/chunks/61032b5050464cb48056.js +0 -1
  429. package/assets/esri/core/workers/chunks/6394ab6f629aa90292e6.js +0 -2
  430. package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +0 -1
  431. package/assets/esri/core/workers/chunks/64af433e88d4dd21a2ff.js +0 -1
  432. package/assets/esri/core/workers/chunks/6b42bcfbb60432e3ed1f.js +0 -1
  433. package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +0 -1
  434. package/assets/esri/core/workers/chunks/6e5d8a6b29c06a27998c.js +0 -1
  435. package/assets/esri/core/workers/chunks/6f506303017903b9a06f.js +0 -1
  436. package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +0 -1
  437. package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +0 -1
  438. package/assets/esri/core/workers/chunks/7c49a8877bd744daa3d5.js +0 -1
  439. package/assets/esri/core/workers/chunks/7ea5bbb52e84be9a608e.js +0 -1
  440. package/assets/esri/core/workers/chunks/82c395d8649096609a8a.js +0 -1
  441. package/assets/esri/core/workers/chunks/86138c297095af1ac604.js +0 -1
  442. package/assets/esri/core/workers/chunks/8c21cc9af4ce9652cc5c.js +0 -1
  443. package/assets/esri/core/workers/chunks/8e6301006abdf47cc88d.js +0 -1
  444. package/assets/esri/core/workers/chunks/90f93091fe088875f80f.js +0 -1
  445. package/assets/esri/core/workers/chunks/91a02ee91f61cf841111.js +0 -1
  446. package/assets/esri/core/workers/chunks/9baeb3b5733acdda4e7c.js +0 -1
  447. package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +0 -1
  448. package/assets/esri/core/workers/chunks/a1f27c4f4b5ef3e359f7.js +0 -1
  449. package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +0 -1
  450. package/assets/esri/core/workers/chunks/a9b1f4bf5eaa937943be.js +0 -1
  451. package/assets/esri/core/workers/chunks/b64f708f821dd2bb51cd.js +0 -1
  452. package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +0 -1
  453. package/assets/esri/core/workers/chunks/c1175477dfcdee90a453.js +0 -1
  454. package/assets/esri/core/workers/chunks/c4e2b75b9135920babc3.js +0 -1
  455. package/assets/esri/core/workers/chunks/cb80b7ddc9acf625d754.js +0 -1
  456. package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +0 -1
  457. package/assets/esri/core/workers/chunks/d52cf7b795ee52034f9e.js +0 -1
  458. package/assets/esri/core/workers/chunks/d971571a957de70d5a8d.js +0 -1
  459. package/assets/esri/core/workers/chunks/d9d9d4f99140e579eabb.js +0 -1
  460. package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +0 -1
  461. package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +0 -2
  462. package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +0 -1
  463. package/assets/esri/core/workers/chunks/e5608e5232e983531f72.js +0 -1
  464. package/assets/esri/core/workers/chunks/e613df03ceb39e29befa.js +0 -1
  465. package/assets/esri/core/workers/chunks/e697dd4508f02dcfe329.js +0 -1
  466. package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +0 -1
  467. package/assets/esri/core/workers/chunks/ec8e8048b3df2c92008d.js +0 -1
  468. package/assets/esri/core/workers/chunks/ed6d0fea159dea638c2f.js +0 -1
  469. package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +0 -1
  470. package/assets/esri/core/workers/chunks/f92d76b694ff0cdb212c.js +0 -1
  471. package/chunks/NetworkElement.js +0 -5
  472. package/views/FocusAreasUtils.js +0 -5
  473. package/views/analysis/DimensionAnalysisView.d.ts +0 -4
  474. package/views/analysis/DimensionAnalysisView.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../../core/compilerUtils.js";import{generateUID as e}from"../../../core/uid.js";import r from"../../../geometry/SpatialReference.js";import{getGeometryZScaler as s}from"../../../geometry/support/zscale.js";import{DehydratedFeatureSetClass as i,removeLargeStringAttributes as o,DehydratedFeatureClass as n}from"../../../layers/graphics/dehydratedFeatures.js";import{unquantizeOptimizedGeometry as a,convertToGeometry as h}from"../../../layers/graphics/featureConversionUtils.js";import l from"../../../layers/support/Field.js";function u(t,e){return e}function p(t,e,r,s){switch(r){case 0:return f(t,e+s,0);case 1:return"lowerLeft"===t.originPosition?f(t,e+s,1):y(t,e+s,1)}}function d(t,e,r,s){return 2===r?f(t,e,2):p(t,e,r,s)}function c(t,e,r,s){return 2===r?f(t,e,3):p(t,e,r,s)}function m(t,e,r,s){return 3===r?f(t,e,3):d(t,e,r,s)}function f({translate:t,scale:e},r,s){return t[s]+r*e[s]}function y({translate:t,scale:e},r,s){return t[s]-r*e[s]}class _{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=u,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new i}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=s(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(null!=e)for(const r of t.features)e(r.geometry)}createSpatialReference(){return new r}addField(t,e){t.fields.push(l.fromJSON(e));const r=t.fields.map((t=>t.name));this._attributesConstructor=function(){for(const t of r)this[t]=null}}addFeature(t,e){const r=this._options.maxStringAttributeLength,s=this._options.maxStringAttributeFields;o(e.attributes,s,r,(r=>{const s=e.attributes[t.objectIdFieldName];null!=s&&this._missingAttributes.push({objectId:s,attribute:r})})),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,i=this._transform?a(r.clone(),r,!1,!1,this._transform):r.clone(),o=h(i,s,!1,!1);switch(s){case"esriGeometryPoint":o.type="point";break;case"esriGeometryPolygon":o.type="polygon";break;case"esriGeometryPolyline":o.type="polyline";break;case"esriGeometryMultipoint":o.type="multipoint"}t.queryGeometryType=s,t.queryGeometry=o}prepareFeatures(e){switch(this._transform=e.transform??null,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"point":this.addCoordinate=(t,e,r)=>this.addCoordinatePoint(t,e,r),this.createGeometry=t=>this.createPointGeometry(t);break;case"polygon":this.addCoordinate=(t,e,r)=>this._addCoordinatePolygon(t,e,r),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"polyline":this.addCoordinate=(t,e,r)=>this._addCoordinatePolyline(t,e,r),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"multipoint":this.addCoordinate=(t,e,r)=>this._addCoordinateMultipoint(t,e,r),this.createGeometry=t=>this._createMultipointGeometry(t);break;case"mesh":case"extent":break;default:t(e.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new n(e(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce(((t,e)=>t+e),0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){0===this._lengths.length&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform?this._applyTransform(this._transform,e,r,0):e;if(null!=s)switch(r){case 0:t.x=s;break;case 1:t.y=s;break;case 2:t.hasZ?t.z=s:t.m=s;break;case 3:t.m=s}}_transformPathLikeValue(t,e){let r=0;return e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,r):t}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){0===r&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){0===r&&0==this._toAddInCurrentPath--&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),i=t[t.length-1],o=this._coordinateBuffer;if(o){if(0===r){const t=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;i.push(new Float64Array(o.buffer,t,this._vertexDimension))}o[this._coordinateBufferPtr++]=s}}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?m:e?d:r?c:p}}export{_ as DehydratedFeatureSetParserContext};
5
+ import{neverReached as t}from"../../../core/compilerUtils.js";import{generateUID as e}from"../../../core/uid.js";import r from"../../../geometry/SpatialReference.js";import{getGeometryZScaler as s}from"../../../geometry/support/zscale.js";import{DehydratedFeatureSetClass as i,removeLargeStringAttributes as o,DehydratedFeatureClass as n}from"../../../layers/graphics/dehydratedFeatures.js";import{unquantizeOptimizedGeometry as a,convertToGeometry as h}from"../../../layers/graphics/featureConversionUtils.js";import l from"../../../layers/support/Field.js";function u(t,e){return e}function p(t,e,r,s){switch(r){case 0:return f(t,e+s,0);case 1:return"lowerLeft"===t.originPosition?f(t,e+s,1):y(t,e+s,1)}}function d(t,e,r,s){return 2===r?f(t,e,2):p(t,e,r,s)}function c(t,e,r,s){return 2===r?f(t,e,3):p(t,e,r,s)}function m(t,e,r,s){return 3===r?f(t,e,3):d(t,e,r,s)}function f({translate:t,scale:e},r,s){return t[s]+r*e[s]}function y({translate:t,scale:e},r,s){return t[s]-r*e[s]}class _{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=u,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new i}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=s(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(null!=e)for(const r of t.features)e(r.geometry)}createSpatialReference(){return new r}addField(t,e){t.fields.push(l.fromJSON(e));const r=t.fields.map((t=>t.name));this._attributesConstructor=function(){for(const t of r)this[t]=null}}addFeature(t,e){const r=this._options.maxStringAttributeLength,s=this._options.maxStringAttributeFields;o(e.attributes,s,r,(r=>{const s=e.attributes[t.objectIdFieldName];null!=s&&this._missingAttributes.push({objectId:s,attribute:r})})),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,i=this._transform?a(r.clone(),r,!1,!1,this._transform):r.clone(),o=h(i,s,!1,!1);switch(s){case"esriGeometryPoint":o.type="point";break;case"esriGeometryPolygon":o.type="polygon";break;case"esriGeometryPolyline":o.type="polyline";break;case"esriGeometryMultipoint":o.type="multipoint"}t.queryGeometryType=s,t.queryGeometry=o}prepareFeatures(e){switch(this._transform=e.transform??null,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"point":this.addCoordinate=(t,e,r)=>this.addCoordinatePoint(t,e,r),this.createGeometry=t=>this.createPointGeometry(t);break;case"polygon":this.addCoordinate=(t,e,r)=>this._addCoordinatePolygon(t,e,r),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"polyline":this.addCoordinate=(t,e,r)=>this._addCoordinatePolyline(t,e,r),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"multipoint":this.addCoordinate=(t,e,r)=>this._addCoordinateMultipoint(t,e,r),this.createGeometry=t=>this._createMultipointGeometry(t);break;case"mesh":case"extent":break;default:t(e.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new n(e(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce(((t,e)=>t+e),0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){0===this._lengths.length&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform?this._applyTransform(this._transform,e,r,0):e;if(null!=s)switch(r){case 0:t.x=s;break;case 1:t.y=s;break;case 2:t.hasZ?t.z=s:t.m=s;break;case 3:t.m=s}}_transformPathLikeValue(t,e){let r=0;return e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,r):t}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){0===r&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){0===r&&0===this._toAddInCurrentPath--&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),i=t[t.length-1],o=this._coordinateBuffer;if(o){if(0===r){const t=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;i.push(new Float64Array(o.buffer,t,this._vertexDimension))}o[this._coordinateBufferPtr++]=s}}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?m:e?d:r?c:p}}export{_ as DehydratedFeatureSetParserContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{assertIsSome as e}from"../../../core/maybe.js";import{getGeometryZScaler as t}from"../../../geometry/support/zscale.js";import{unquantizeOptimizedGeometry as r,convertToGeometry as s}from"../../../layers/graphics/featureConversionUtils.js";function o(e,t){return t}function i(e,t,r,s){switch(r){case 0:return u(e,t+s,0);case 1:return"lowerLeft"===e.originPosition?u(e,t+s,1):l(e,t+s,1)}}function n(e,t,r,s){return 2===r?u(e,t,2):i(e,t,r,s)}function a(e,t,r,s){return 2===r?0===t?0:u(e,t,3):i(e,t,r,s)}function h(e,t,r,s){return 3===r?0===t?0:u(e,t,3):n(e,t,r,s)}function u({translate:e,scale:t},r,s){return e[s]+r*t[s]}function l({translate:e,scale:t},r,s){return e[s]-r*t[s]}class d{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=o,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const r=t(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=r)for(const t of e.features)r(t.geometry)}createSpatialReference(){return{}}addField(t,r){const s=t.fields;e(s),s.push(r);const o=s.map((e=>e.name));this._attributesConstructor=function(){for(const e of o)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._mValueOffset=null,this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:o,queryGeometryType:i}=t,n=this._transform?r(o.clone(),o,!1,!1,this._transform):o.clone(),a=s(n,i,!1,!1);e.queryGeometryType=i,e.queryGeometry={...a}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const s=this._transform;switch(t=this._applyTransform(s,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const s=this._transform;return null!==this._mValueOffset&&0===e&&t>0&&!(t%this._mValueOffset)?0:this._applyTransform(s,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const s=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(s)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(t,r),o=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),o.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?h:t?n:r?a:i}}export{d as JSONFeatureSetParserContext};
5
+ import{assertIsSome as e}from"../../../core/maybe.js";import{getGeometryZScaler as t}from"../../../geometry/support/zscale.js";import{unquantizeOptimizedGeometry as r,convertToGeometry as s}from"../../../layers/graphics/featureConversionUtils.js";function o(e,t){return t}function i(e,t,r,s){switch(r){case 0:return u(e,t+s,0);case 1:return"lowerLeft"===e.originPosition?u(e,t+s,1):l(e,t+s,1)}}function n(e,t,r,s){return 2===r?u(e,t,2):i(e,t,r,s)}function a(e,t,r,s){return 2===r?0===t?0:u(e,t,3):i(e,t,r,s)}function h(e,t,r,s){return 3===r?0===t?0:u(e,t,3):n(e,t,r,s)}function u({translate:e,scale:t},r,s){return e[s]+r*t[s]}function l({translate:e,scale:t},r,s){return e[s]-r*t[s]}class d{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=o,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const r=t(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=r)for(const t of e.features)r(t.geometry)}createSpatialReference(){return{}}addField(t,r){const s=t.fields;e(s),s.push(r);const o=s.map((e=>e.name));this._attributesConstructor=function(){for(const e of o)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._mValueOffset=null,this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:o,queryGeometryType:i}=t,n=this._transform?r(o.clone(),o,!1,!1,this._transform):o.clone(),a=s(n,i,!1,!1);e.queryGeometryType=i,e.queryGeometry={...a}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const s=this._transform;switch(t=this._applyTransform(s,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const s=this._transform;return null!==this._mValueOffset&&0===e&&t>0&&!(t%this._mValueOffset)?0:this._applyTransform(s,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const s=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(s)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0===this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(t,r),o=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),o.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?h:t?n:r?a:i}}export{d as JSONFeatureSetParserContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../request.js";import{srToRESTValue as t}from"../../../geometry/support/spatialReferenceUtils.js";import{mapParameters as o}from"../../operations/urlUtils.js";function r(e,o){const r=e.toJSON();return r.objectIds&&(r.objectIds=r.objectIds.join(",")),r.orderByFields&&(r.orderByFields=r.orderByFields.join(",")),r.outFields&&!o?.returnCountOnly?r.outFields.includes("*")?r.outFields="*":r.outFields=r.outFields.join(","):delete r.outFields,r.outSR&&(r.outSR=t(r.outSR)),r.dynamicDataSource&&(r.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r}async function s(e,t,o){const r=await a(e,t,o),s=r.data,n=s.geometryType,d=s.spatialReference,c={};for(const a of s.relatedRecordGroups){const e={fields:void 0,objectIdFieldName:void 0,geometryType:n,spatialReference:d,hasZ:!!s.hasZ,hasM:!!s.hasM,features:a.relatedRecords};if(null!=a.objectId)c[a.objectId]=e;else for(const t of Object.keys(a))"relatedRecords"!==t&&(c[a[t]]=e)}return{...r,data:c}}async function n(e,t,o){const r=await a(e,t,o,{returnCountOnly:!0}),s=r.data,n={};for(const a of s.relatedRecordGroups)null!=a.objectId&&(n[a.objectId]=a.count);return{...r,data:n}}async function a(t,s,n={},a){const d=o({...t.query,f:"json",...a,...r(s,a)});return e(t.path+"/queryRelatedRecords",{...n,query:{...n.query,...d}})}export{s as executeRelationshipQuery,n as executeRelationshipQueryForCount,r as toQueryStringParameters};
5
+ import e from"../../../request.js";import{srToRESTValue as t}from"../../../geometry/support/spatialReferenceUtils.js";import{mapParameters as o}from"../../operations/urlUtils.js";function r(e,o){const r=e.toJSON();return r.objectIds&&(r.objectIds=r.objectIds.join(",")),r.orderByFields&&(r.orderByFields=r.orderByFields.join(",")),r.outFields&&!o?.returnCountOnly?r.outFields.includes("*")?r.outFields="*":r.outFields=r.outFields.join(","):delete r.outFields,r.outSR&&(r.outSR=t(r.outSR)),r.dynamicDataSource&&(r.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r}async function s(e,t,o){const r=await a(e,t,o),s=r.data,n=s.geometryType,d=s.spatialReference,c={};for(const a of s.relatedRecordGroups){const e={fields:void 0,geometryType:n,spatialReference:d,hasZ:!!s.hasZ,hasM:!!s.hasM,features:a.relatedRecords};if(null!=a.objectId)c[a.objectId]=e;else for(const t of Object.keys(a))"relatedRecords"!==t&&(c[a[t]]=e)}return{...r,data:c}}async function n(e,t,o){const r=await a(e,t,o,{returnCountOnly:!0}),s=r.data,n={};for(const a of s.relatedRecordGroups)null!=a.objectId&&(n[a.objectId]=a.count);return{...r,data:n}}async function a(t,s,n={},a){const d=o({...t.query,f:"json",...a,...r(s,a)});return e(t.path+"/queryRelatedRecords",{...n,query:{...n.query,...d}})}export{s as executeRelationshipQuery,n as executeRelationshipQueryForCount,r as toQueryStringParameters};
package/rest/utils.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../config.js";import{id as n}from"../kernel.js";import{clone as r}from"../core/lang.js";import{urlToObject as e}from"../core/urlUtils.js";import{isApiKeyApplicable as i}from"../support/apiKeyUtils.js";function o(t,n){return n?{...n,query:{...t??{},...n.query}}:{query:t}}function s(t){return"string"==typeof t?e(t):r(t)}function f(t,n,r){const e={};for(const i in t){if("declaredClass"===i)continue;const o=t[i];if(null!=o&&"function"!=typeof o)if(Array.isArray(o))e[i]=o.map((t=>f(t)));else if("object"==typeof o)if(o.toJSON){const t=o.toJSON(r?.[i]);e[i]=n?t:JSON.stringify(t)}else e[i]=n?o:JSON.stringify(o);else e[i]=o}return e}function u(r,e){return r?i(r,e)?e||t.apiKey:n?.findCredential(r)?.token:null}async function c(r,e,i){const o=u(r,e);if(o)return o;!n&&t.request.useIdentity&&await import("../identity/IdentityManager.js");const s=await(n?.getCredential(r,i));return s?.token}export{o as asValidOptions,f as encode,u as findToken,c as getToken,s as parseUrl};
5
+ import t from"../config.js";import{id as n}from"../kernel.js";import{clone as r}from"../core/lang.js";import{urlToObject as e}from"../core/urlUtils.js";import{supportsApiKey as i,getApiKey as o}from"../support/apiKeyUtils.js";function s(t,n){return n?{...n,query:{...t??{},...n.query}}:{query:t}}function f(t){return"string"==typeof t?e(t):r(t)}function u(t,n,r){const e={};for(const i in t){if("declaredClass"===i)continue;const o=t[i];if(null!=o&&"function"!=typeof o)if(Array.isArray(o))e[i]=o.map((t=>u(t)));else if("object"==typeof o)if(o.toJSON){const t=o.toJSON(r?.[i]);e[i]=n?t:JSON.stringify(t)}else e[i]=n?o:JSON.stringify(o);else e[i]=o}return e}function c(t,r){return t?r&&i(t)?r:o(t)??n?.findCredential(t)?.token:null}async function a(r,e,i){const o=c(r,e);if(o)return o;!n&&t.request.useIdentity&&await import("../identity/IdentityManager.js");const s=await n.getCredential(r,i);return s?.token}export{s as asValidOptions,u as encode,c as findToken,a as getToken,f as parseUrl};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import c from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as f}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as v}from"../../statistics/support/WorkerClient.js";import{getFieldsList as q,isAnyDateField as V,fieldDelimiter as x}from"../utils.js";import _ from"./LayerAdapter.js";import{getHistogramAttributeDefinition as z,getAttributeBinsQuery as T,processQueryAttributeBinsResult as N}from"./support/histogramUtils.js";import{ensureFeaturesJSON as M,getSummaryStatsQuery as L,getSummaryStatisticsFromFeatureSet as E,getViewInfoParams as C,getMissingFields as j,updateQueryWithFeatureFilter as b,getUVQuery as k,getUniqueValuesFromFeatureSet as I,getBins as O,getDomainsForFields as Q,getPredominantCategoriesFromUVInfos as J}from"./support/utils.js";import{processSummaryStatisticsResult as B,createUVResult as P,resolveCBResult as U}from"../../../statistics/utils.js";import{loadArcade as A}from"../../../support/loadArcade.js";const $=5;let G=null,R=class extends _{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n((()=>!e.updating),t.signal);await s(i,5e3,t).catch((e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e}))}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?M(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?M(n.features):n.features}_fetchFeaturesForStats(e,t){return q({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression}).then((r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,signal:e.signal},t)))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=L(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=E(s,V(t)||y(t));return B(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:c}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=C(r),n.timeZone=r.timeZone,n.fieldInfos=c),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=[];if("intersects"===t?.spatialRelationship){const{intersect:a}=await import("../../../geometry/geometryEngineAsync.js"),i=null!=t.geometry?t.geometry:null;for(const t of e){const e=null!=t.geometry?t.geometry:null;if(e&&i){await a(e,i)&&r.push(t)}}}else r=e;return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,layerViewFunc:u,signal:m}=e;let p=e.returnGeometry;if(null==p&&l){if(!G){const{arcadeUtils:e}=await A();G=e}const e=G.hasGeometryOperations(l);e&&await G.enableGeometryOperations(),p=e}let y=null,c=null,f=null,d=null,h=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;y=await a.whenLayerView(e),c=null!=u&&u in y&&"function"==typeof y[u]}catch{c=!1}if(c)try{await this._waitForLayerViewUpdate(y);const e=await q({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l});j(this,e,y).length?c=!1:(f=this.layer.createQuery(),f.outFields=e,f.returnGeometry=!1,b(f,r)),y.suspended&&(c=!1)}catch{c=!1}return c||(d=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,valueExpression:l,normalizationField:n,returnGeometry:p,filter:r,view:a,signal:m},"json"),h=(await q({valueExpression:l})).map((e=>this.getField(e)?.toJSON())).filter(Boolean)),{layerView:y,query:f,featuresJSON:d,fieldInfos:h}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await I(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:x,view:e.view,signal:e.signal});return P(o,t,e.returnAllCodedValues,x)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:x,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=C(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then((e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}})),t.then((t=>O(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal)))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=z(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await T(e,this,u,l?.where);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const c=await n.queryAttributeBins(m,{signal:a});return N(c,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=z(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||$,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=U(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=C(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new c({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await Q(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n((()=>!o.updating),i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=f(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return J(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e,m=this.layer.createQuery(),p=1;if(m.outSpatialReference=i?.spatialReference,m.returnGeometry=!!n,m.outFields=o,b(m,l),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const y=await i.whenLayerView(this.layer);if(j(this,o,y).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(y,m,u,a),f=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,f,p)}load(e){const t=this.layer.load(e).then((async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=v.getInstance(),await this.workerClient.open(e.signal)}));return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],R.prototype,"adapterName",void 0),e([l({constructOnly:!0})],R.prototype,"layer",void 0),R=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],R);export{R as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import c from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as f}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as v}from"../../statistics/support/WorkerClient.js";import{getFieldsList as q,isAnyDateField as V,fieldDelimiter as x}from"../utils.js";import _ from"./LayerAdapter.js";import{getHistogramAttributeDefinition as z,getAttributeBinsQuery as T,processQueryAttributeBinsResult as N}from"./support/histogramUtils.js";import{ensureFeaturesJSON as M,getSummaryStatsQuery as L,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as E,getMissingFields as j,updateQueryWithFeatureFilter as b,getUVQuery as k,getUniqueValuesFromFeatureSet as I,getBins as O,getDomainsForFields as Q,getPredominantCategoriesFromUVInfos as J}from"./support/utils.js";import{processSummaryStatisticsResult as B,createUVResult as P,resolveCBResult as U}from"../../../statistics/utils.js";import{loadArcade as A}from"../../../support/loadArcade.js";const $=5;let G=null,R=class extends _{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n((()=>!e.updating),t.signal);await s(i,5e3,t).catch((e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e}))}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?M(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?M(n.features):n.features}_fetchFeaturesForStats(e,t){return q({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression}).then((r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,signal:e.signal},t)))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=L(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,V(t)||y(t));return B(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:c}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=E(r),n.timeZone=r.timeZone,n.fieldInfos=c),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const t=await import("../../../geometry/operators/intersectionOperator.js");r=e.filter((({geometry:e})=>!(!e||!t.execute(e,a))))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,layerViewFunc:u,signal:m}=e;let p=e.returnGeometry;if(null==p&&l){if(!G){const{arcadeUtils:e}=await A();G=e}const e=G.hasGeometryOperations(l);e&&await G.enableGeometryOperations(),p=e}let y=null,c=null,f=null,d=null,h=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;y=await a.whenLayerView(e),c=null!=u&&u in y&&"function"==typeof y[u]}catch{c=!1}if(c)try{await this._waitForLayerViewUpdate(y);const e=await q({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l});j(this,e,y).length?c=!1:(f=this.layer.createQuery(),f.outFields=e,f.returnGeometry=!1,b(f,r)),y.suspended&&(c=!1)}catch{c=!1}return c||(d=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,valueExpression:l,normalizationField:n,returnGeometry:p,filter:r,view:a,signal:m},"json"),h=(await q({valueExpression:l})).map((e=>this.getField(e)?.toJSON())).filter(Boolean)),{layerView:y,query:f,featuresJSON:d,fieldInfos:h}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await I(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:x,view:e.view,signal:e.signal});return P(o,t,e.returnAllCodedValues,x)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:x,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=E(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then((e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}})),t.then((t=>O(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal)))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=z(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await T(e,this,u,l?.where);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const c=await n.queryAttributeBins(m,{signal:a});return N(c,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=z(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||$,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=U(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=E(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new c({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await Q(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n((()=>!o.updating),i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=f(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return J(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e,m=this.layer.createQuery(),p=1;if(m.outSpatialReference=i?.spatialReference,m.returnGeometry=!!n,m.outFields=o,b(m,l),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const y=await i.whenLayerView(this.layer);if(j(this,o,y).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(y,m,u,a),f=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,f,p)}load(e){const t=this.layer.load(e).then((async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=v.getInstance(),await this.workerClient.open(e.signal)}));return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],R.prototype,"adapterName",void 0),e([l({constructOnly:!0})],R.prototype,"layer",void 0),R=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],R);export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../config.js";import{getOrigin as r}from"../core/urlUtils.js";const s=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function c(t){return!!t&&t.length>4&&t.startsWith("AAPK")}function i(t){const c=r(t,!0);return!!c&&(c.endsWith(".arcgis.com")&&!s.has(c)&&!t.endsWith("/sharing/rest/generateToken"))}function n(r,s){return!(!s&&!t.apiKey||!i(r))}export{c as isApiKey,n as isApiKeyApplicable,i as supportsApiKey};
5
+ import s from"../config.js";import{getOrigin as t}from"../core/urlUtils.js";const e=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function r(t){if(!a(t))return null;const e=s=>s instanceof RegExp?s.test(t):"string"==typeof s&&t.startsWith(s),r=s.apiKeys;if(Array.isArray(r.scopes))for(const s of r.scopes)if(Array.isArray(s.urls)){if(s.urls.some(e))return s.token}else if(e(s.urls))return s.token;return r.basemapStyles&&/^https?:\/\/(i?basemaps|basemapstyles)-api\.arcgis\.com\//i.test(t)?r.basemapStyles:s.apiKey&&/^https?:\/\/.+\.arcgis\.com(\/|$)/i.test(t)?s.apiKey:null}function i(){return null!=s.apiKey||null!=s.apiKeys.basemapStyles}function n(s,t){return t?a(s):null!=r(s)}function a(s){const r=t(s,!0);return!!r&&(!e.has(r)&&!s.endsWith("/sharing/rest/generateToken"))}export{r as getApiKey,i as hasBasemapStylesApiKey,n as isApiKeyApplicable,a as supportsApiKey};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Basemap.js";import r from"../config.js";import s from"../core/Collection.js";import o from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{ensureType as t}from"../core/accessorSupport/ensureType.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";import{layerDefinitionEquals as a,layerToDefinition as c}from"./basemapUtils.js";const f=()=>o.getLogger("esri.support.basemapUtils");function p(){return{}}function l(e){for(const r in e){const s=e[r];n(s),delete e[r]}}function m(s,o){let n;if("string"==typeof s){const t=s in i,a=!t&&s.includes("/");if(!t&&!a){if(r.apiKey)f().warn(`Unable to find basemap definition for: ${s}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(i).filter((([e,r])=>r.classic||r.is3d)).map((([e])=>`"${e}"`)).sort().join(", ");f().warn(`Unable to find basemap definition for: ${s}. Try one of these: ${e}`)}return null}o&&(n=o[s]),n||(n=t?e.fromId(s):new e({style:{id:s}}),o&&(o[s]=n))}else n=t(e,s);return n?.destroyed&&(f().warn("The provided basemap is already destroyed",{basemap:n}),n=null),n}function u(e,r=null){const s=m(e);if(!s)return null;const o=s.clone();return r&&(o.baseLayers=d(o.baseLayers,r.baseLayers),o.referenceLayers=d(o.referenceLayers,r.referenceLayers)),o}function d(e,r){const o=new s;return e.forEach((e=>{const s=r.find((r=>"scene"!==r.type&&a(c(e),c(r))))||e;o.includes(s)?o.push(e):o.push(s)})),o}export{m as basemapEnsureType,u as clonePreservingTiledLayers,p as createCache,l as destroyCache};
5
+ import e from"../Basemap.js";import r from"../core/Collection.js";import s from"../core/Logger.js";import{destroyMaybe as o}from"../core/maybe.js";import{ensureType as n}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";import{layerDefinitionEquals as a,layerToDefinition as c}from"./basemapUtils.js";const f=()=>s.getLogger("esri.support.basemapUtils");function p(){return{}}function l(e){for(const r in e){const s=e[r];o(s),delete e[r]}}function m(r,s){let o;if("string"==typeof r){const n=r in i,a=!n&&r.includes("/");if(!n&&!a){if(t())f().warn(`Unable to find basemap definition for: ${r}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(i).filter((([e,r])=>r.classic||r.is3d)).map((([e])=>`"${e}"`)).sort().join(", ");f().warn(`Unable to find basemap definition for: ${r}. Try one of these: ${e}`)}return null}s&&(o=s[r]),o||(o=n?e.fromId(r):new e({style:{id:r}}),s&&(s[r]=o))}else o=n(e,r);return o?.destroyed&&(f().warn("The provided basemap is already destroyed",{basemap:o}),o=null),o}function u(e,r=null){const s=m(e);if(!s)return null;const o=s.clone();return r&&(o.baseLayers=d(o.baseLayers,r.baseLayers),o.referenceLayers=d(o.referenceLayers,r.referenceLayers)),o}function d(e,s){const o=new r;return e.forEach((e=>{const r=s.find((r=>"scene"!==r.type&&a(c(e),c(r))))||e;o.includes(r)?o.push(e):o.push(r)})),o}export{m as basemapEnsureType,u as clonePreservingTiledLayers,p as createCache,l as destroyCache};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const e="20250514",c="61e9e7e1b36a140caac2fb8c4ddece5c32e5e4eb";export{e as buildDate,c as commitHash};
5
+ const c="20250516",b="96c09c507477bc31ad5b06a5db5e23218c24e5b2";export{c as buildDate,b as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as h}from"../CIMCursor.js";import{GeometricEffectControlMeasureLineRule as e}from"../enums.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(s,t,i,h,e){return new _(s,t,i)}}class _{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i,this._rule=t.rule??e.FullGeometry,this._defaultSize=this._defaultPointSize*i}next(){let i;for(;i=this._inputGeometries.next();){const h=this._processGeom(t(i));if(h?.length)return s.fromJSONCIM({paths:h})}return null}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return h(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,u=[];u.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),u.push(t),u.push(i),u.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(u)}_addBezier2(s,t,i,h,e){if(0==e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0==r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),u=this._mid(h,e),o=this._mid(_,c),a=this._mid(c,u),n=this._mid(o,a);this._addBezier3(s,t,_,o,n,r),this._addBezier3(s,n,a,u,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(r,e)));let o=this._dotProduct(_,this._sub(r,e));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=.5*u,n=this._leftPerp(_),p=[e[0]+_[0]*o,e[1]+_[1]*o],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*u,p[1]+l[0][1]*u]),s.push(h),s.push([p[0]-l[0][0]*u,p[1]-l[0][1]*u]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_processGeom(s){if(!s)return null;const t=[];for(const r of s){const s=r.length>1&&i(r)<this._defaultSize;if(!r||0===r.length||s)continue;const _=r.length;let c=r[0];switch(this._rule){case e.PerpendicularFromFirstSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,4),h=[];h.push(i),h.push(this._mid(c,s)),t.push(h);break}case e.ReversedFirstSegment:{const s=this._cp2(r,0,-1);t.push([s,c]);break}case e.PerpendicularToSecondSegment:{if(r.length<3)return[];const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=[];h.push(this._mid(s,i)),h.push(c),t.push(h);break}case e.SecondSegmentWithTicks:{if(r.length<3)return[];const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=this._sub(i,s);let e;e=this._crossProduct(h,this._sub(c,s))>0?this._rightPerp(h):this._leftPerp(h);const _=[];_.push([s[0]+(e[0]-h[0])/3,s[1]+(e[1]-h[1])/3]),_.push(s),_.push(i),_.push([i[0]+(e[0]+h[0])/3,i[1]+(e[1]+h[1])/3]),t.push(_);break}case e.DoublePerpendicular:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,3),h=this._mid(c,s),e=this._sub(h,i);this._normalize(e);const _=this._crossProduct(e,this._sub(c,i));this._leftPerpendicular(e);const u=[];u.push(c),u.push([i[0]+e[0]*_,i[1]+e[1]*_]),t.push(u);const o=[];o.push([i[0]-e[0]*_,i[1]-e[1]*_]),o.push(s),t.push(o);break}case e.OppositeToFirstSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,3),h=this._mid(c,s),e=this._sub(h,i);this._normalize(e);const _=this._crossProduct(e,this._sub(c,i));this._leftPerpendicular(e);const u=[];u.push([i[0]+e[0]*_,i[1]+e[1]*_]),u.push([i[0]-e[0]*_,i[1]-e[1]*_]),t.push(u);break}case e.TriplePerpendicular:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,4),h=this._mid(c,s),e=this._sub(h,i);this._normalize(e);const _=this._crossProduct(e,this._sub(c,i));this._leftPerpendicular(e);const u=[];u.push([i[0]+e[0]*_*.8,i[1]+e[1]*_*.8]),u.push([h[0]+.8*(c[0]-h[0]),h[1]+.8*(c[1]-h[1])]),t.push(u),t.push([i,h]);const o=[];o.push([i[0]-e[0]*_*.8,i[1]-e[1]*_*.8]),o.push([h[0]+.8*(s[0]-h[0]),h[1]+.8*(s[1]-h[1])]),t.push(o);break}case e.HalfCircleFirstSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,4),h=this._mid(c,s);let e=this._sub(s,c);const _=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),o=Math.sqrt((1+_)/2),a=Math.sqrt((1-_)/2),n=[];let p;this._crossProduct(e,this._sub(i,c))>0?(n.push(c),e=this._sub(c,h),p=s):(n.push(s),e=this._sub(s,h),p=c),this._rotateDirect(e,o,a),e[0]/=o,e[1]/=o;for(let t=1;t<=18;t++)n.push(this._add(h,e)),this._rotateDirect(e,_,u);n.push(p),t.push(n);break}case e.HalfCircleSecondSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,1,-1);let h=this._sub(c,s);this._normalize(h);const e=this._crossProduct(h,this._sub(i,s))/2;this._leftPerpendicular(h);const _=[s[0]+h[0]*e,s[1]+h[1]*e];h=this._sub(s,_);const u=Math.cos(Math.PI/18);let o=Math.sin(Math.PI/18);e>0&&(o=-o);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(h,u,o),a.push(this._add(_,h));t.push(a);break}case e.HalfCircleExtended:{const s=this._cp2(r,0,-2),i=this._cp3(r,s,1,-1);let h;if(_>=4)h=r[3];else{const t=this._sub(c,s);h=this._add(i,t)}const e=this._dist(s,i)/2/.75,u=this._sub(s,c);this._normalize(u,e);const o=this._sub(i,h);this._normalize(o,e);const a=[h,i];t.push(a);const n=[this._clone(i)];this._addBezier3(n,i,this._add(i,o),this._add(s,u),s,4),n.push(c),t.push(n);break}case e.OpenCircle:{const s=this._cp2(r,-2,0),i=this._sub(s,c),h=Math.cos(Math.PI/18),e=-Math.sin(Math.PI/18),_=[s];for(let t=1;t<=33;t++)this._rotateDirect(i,h,e),_.push(this._add(c,i));t.push(_);break}case e.CoverageEdgesWithTicks:{const s=this._cp2(r,0,-1);let i,h;if(_>=3)i=r[2];else{const t=this._sub(s,c),h=this._leftPerp(t);i=[c[0]+h[0]-.25*t[0],c[1]+h[1]-.25*t[1]]}if(_>=4)h=r[3];else{const t=this._mid(c,s),e=this._sub(c,s);this._normalize(e),this._leftPerpendicular(e);const r=this._crossProduct(e,this._sub(i,t));this._rightPerpendicular(e),h=[i[0]+e[0]*r*2,i[1]+e[1]*r*2]}const e=this._sub(s,c);let u,o;u=this._crossProduct(e,this._sub(i,c))>0?this._rightPerp(e):this._leftPerp(e),o=[],o.push(i),o.push(c),o.push([c[0]+(u[0]-e[0])/3,c[1]+(u[1]-e[1])/3]),t.push(o),u=this._crossProduct(e,this._sub(h,s))>0?this._rightPerp(e):this._leftPerp(e),o=[],o.push([s[0]+(u[0]+e[0])/3,s[1]+(u[1]+e[1])/3]),o.push(s),o.push(h),t.push(o);break}case e.GapExtentWithDoubleTicks:{const s=this._cp2(r,0,2),i=this._cp3(r,s,0,1);let h;if(_>=4)h=r[3];else{const t=this._sub(s,c);h=this._add(i,t)}this._addAngledTicks(t,c,s,this._mid(i,h)),this._addAngledTicks(t,i,h,this._mid(c,s));break}case e.GapExtentMidline:{const s=this._cp2(r,2,0),i=this._cp3(r,s,0,1);let h;if(_>=4)h=r[3];else{const t=this._sub(s,c);h=this._add(i,t)}const e=[];e.push(this._mid(c,i)),e.push(this._mid(s,h)),t.push(e);break}case e.Chevron:{const s=this._cp2(r,-1,-1);let i;if(_>=3)i=r[2];else{const t=this._sub(s,c);this._leftPerpendicular(t),i=this._add(c,t)}t.push([s,this._makeCtrlPt(c),i]);break}case e.PerpendicularWithArc:{const s=this._cp2(r,0,-2),i=this._cp3(r,s,.5,-1),h=this._sub(s,c),e=this._norm(h);h[0]/=e,h[1]/=e;const u=this._crossProduct(h,this._sub(i,c));let o=this._dotProduct(h,this._sub(i,c));o<.05*e?o=.05*e:o>.95*e&&(o=.95*e);const a=[c[0]+h[0]*o,c[1]+h[1]*o];let n=this._leftPerp(h),p=[];if(p.push([a[0]-n[0]*u,a[1]-n[1]*u]),p.push([a[0]+n[0]*u,a[1]+n[1]*u]),t.push(p),_>=4){const s=r[3];let i=this._dotProduct(h,this._sub(s,c));i<.1*e?i=.1*e:i>.9*e&&(i=.9*e);const _=[c[0]+h[0]*i,c[1]+h[1]*i],u=this._crossProduct(h,this._sub(s,c)),o=[];o.push([_[0]-n[0]*u,_[1]-n[1]*u]),o.push([_[0]+n[0]*u,_[1]+n[1]*u]),t.push(o)}const d=[s[0]+n[0]*u,s[1]+n[1]*u];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);u<0&&(b=-b),p=[c,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case e.ClosedHalfCircle:{const s=this._cp2(r,2,0),i=this._mid(c,s),h=this._sub(s,i),e=Math.cos(Math.PI/18),_=Math.sin(Math.PI/18),u=[c,s];for(let t=1;t<=18;t++)this._rotateDirect(h,e,_),u.push(this._add(i,h));t.push(u);break}case e.TripleParallelExtended:{const s=this._cp2(r,0,-2),i=this._cp3(r,s,1,-2),e=this._mid(c,s),_=this._sub(i,s);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(e,s)))/2,o=this._dist(s,i),a=[s,c];a.push([c[0]+_[0]*o*.5,c[1]+_[1]*o*.5]),t.push(a);const n=[];n.push([e[0]-_[0]*u,e[1]-_[1]*u]),n.push([e[0]+_[0]*o*.375,e[1]+_[1]*o*.375]),h(n[n.length-1],1),n.push([e[0]+_[0]*o*.75,e[1]+_[1]*o*.75]),t.push(n);const p=[s,i];t.push(p);break}case e.ParallelWithTicks:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(i,s);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h),this._addAngledTicks(t,c,s,i),this._addAngledTicks(t,this._mix(c,1,h,e),this._mix(s,1,h,e),this._mid(c,s));break}case e.Parallel:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._leftPerp(h),_=this._crossProduct(h,this._sub(i,c));let u=[c,s];t.push(u),u=[],u.push([c[0]+e[0]*_,c[1]+e[1]*_]),u.push([s[0]+e[0]*_,s[1]+e[1]*_]),t.push(u);break}case e.PerpendicularToFirstSegment:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._mid(c,s),e=this._sub(s,c);this._normalize(e);const _=this._crossProduct(e,this._sub(i,c));this._leftPerpendicular(e);const u=[];u.push([h[0]-e[0]*_*.25,h[1]-e[1]*_*.25]),u.push([h[0]+e[0]*_*1.25,h[1]+e[1]*_*1.25]),t.push(u);break}case e.ParallelOffset:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h);const _=[];_.push([c[0]-h[0]*e,c[1]-h[1]*e]),_.push([s[0]-h[0]*e,s[1]-h[1]*e]),t.push(_);const u=[];u.push([c[0]+h[0]*e,c[1]+h[1]*e]),u.push([s[0]+h[0]*e,s[1]+h[1]*e]),t.push(u);break}case e.OffsetOpposite:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h);const _=[];_.push([c[0]-h[0]*e,c[1]-h[1]*e]),_.push([s[0]-h[0]*e,s[1]-h[1]*e]),t.push(_);break}case e.OffsetSame:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h);const _=[];_.push([c[0]+h[0]*e,c[1]+h[1]*e]),_.push([s[0]+h[0]*e,s[1]+h[1]*e]),t.push(_);break}case e.CircleWithArc:{let s=this._cp2(r,3,0);const i=this._cp3(r,s,.5,-1);let e,u;if(_>=4)e=r[3],u=this._crossProduct(this._sub(e,s),this._sub(i,s))>0;else{e=s,u=this._crossProduct(this._sub(e,c),this._sub(i,c))>0;const t=24*this._geomUnitsPerPoint,h=this._sub(e,c);this._normalize(h,t);const r=Math.sqrt(2)/2;this._rotateDirect(h,r,u?r:-r),s=this._add(c,h)}const o=this._sub(s,c),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(o,a,n),p.push(this._add(c,o));this._add90DegArc(p,s,e,i,u),h(p[p.length-8],1),t.push(p);break}case e.DoubleJog:{let s,i=this._cp2(r,-3,1),h=this._cp3(r,i,-1,-.5);if(_>=4)s=r[3];else{const t=c;c=i,s=h;const e=this._dist(c,t),r=this._dist(s,t);let _=30*this._geomUnitsPerPoint;.5*e<_&&(_=.5*e),.5*r<_&&(_=.5*r),i=this._mix(c,_/e,t,(e-_)/e),h=this._mix(s,_/r,t,(r-_)/r)}const e=this._mid(c,i),u=this._mid(s,h),o=this._dist(c,i),a=this._dist(h,s);let n=Math.min(o,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(c,i);this._normalize(d,n),this._crossProduct(d,this._sub(s,i))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(i),l.push(this._add(e,d)),l.push(this._sub(e,d)),l.push(c),t.push(l),d=this._sub(s,h),this._normalize(d,n),this._crossProduct(d,this._sub(c,h))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(h),l.push(this._add(u,d)),l.push(this._sub(u,d)),l.push(s),t.push(l);break}case e.PerpendicularOffset:{const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(c,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const e=[h[0]/8,h[1]/8],_=this._sub(this._mid(s,i),e);t.push([_,c]);break}case e.LineExcludingLastSegment:{const s=this._arrowPath(r),i=[];let h=s.length-2;for(;h--;)i.push(s[h]);t.push(i);break}case e.MultivertexArrow:{const s=this._arrowPath(r),i=[];this._addArrow(i,s,!1),t.push(i);break}case e.CrossedArrow:{const s=this._arrowPath(r),i=[];this._addArrow(i,s,!0),t.push(i);break}case e.ChevronArrow:{const[s,i]=this._arrowLastSeg(r),h=10*this._geomUnitsPerPoint,e=this._sub(c,s),_=this._norm(e);this._normalize(e);const u=this._crossProduct(e,this._sub(i,s));let o=this._dotProduct(e,this._sub(i,s));o<.05*_?o=.05*_:o>.95*_-h&&(o=.95*_-h);const a=[s[0]+e[0]*o,s[1]+e[1]*o],n=this._leftPerp(e),p=[];p.push([a[0]+n[0]*u+e[0]*h,a[1]+n[1]*u+e[1]*h]),p.push(c),p.push([a[0]-n[0]*u+e[0]*h,a[1]-n[1]*u+e[1]*h]),t.push(p);break}case e.ChevronArrowOffset:{const[s,i]=this._arrowLastSeg(r),h=this._sub(c,s),e=this._norm(h);this._normalize(h);const _=this._crossProduct(h,this._sub(i,s));let u=this._dotProduct(h,this._sub(i,s));u<.05*e?u=.05*e:u>.95*e&&(u=.95*e);const o=[s[0]+h[0]*u,s[1]+h[1]*u];this._leftPerpendicular(h);const a=[];a.push([o[0]+h[0]*_*.5,o[1]+h[1]*_*.5]),a.push(this._mid(o,c)),a.push([o[0]-h[0]*_*.5,o[1]-h[1]*_*.5]),t.push(a);break}case e.PartialFirstSegment:{const[s,i]=this._arrowLastSeg(r),h=this._sub(c,s),e=this._norm(h);this._normalize(h);let _=this._dotProduct(h,this._sub(i,s));_<.05*e?_=.05*e:_>.95*e&&(_=.95*e);const u=[s[0]+h[0]*_,s[1]+h[1]*_];t.push([s,u]);break}case e.Arch:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,1),h=this._sub(c,s),e=this._mix(i,1,h,.55),_=this._mix(i,1,h,-.55),u=[c];this._addBezier2(u,c,e,i,4),this._addBezier2(u,i,_,s,4),t.push(u);break}case e.CurvedParallelTicks:{const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(c,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const e=[h[0]/8,h[1]/8],_=this._sub(this._mid(s,i),e),u=this._sub(this._mix(s,.75,i,.25),e),o=this._sub(this._mix(s,.25,i,.75),e),a=[s];this._addBezier2(a,s,u,_,3),this._addBezier2(a,_,o,i,3),t.push(a);for(let r=0;r<8;r++){const s=a[2*r+1],i=[this._clone(s)];i.push(this._add(s,[h[0]/4,h[1]/4])),t.push(i)}break}case e.Arc90Degrees:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,1),h=[s];this._add90DegArc(h,s,c,i),t.push(h);break}case e.TipWithPerpendicularAndTicks:{const[s,i]=this._arrowLastSeg(r),h=10*this._geomUnitsPerPoint,e=this._sub(c,s),_=this._norm(e);this._normalize(e);let u=this._crossProduct(e,this._sub(i,s)),o=this._dotProduct(e,this._sub(i,s));o<.05*_?o=.05*_:o>.95*_-h&&(o=.95*_-h);const a=this._leftPerp(e),n=[c[0]-e[0]*h,c[1]-e[1]*h],p=.5*Math.max(_-o-h,h);u=Math.abs(u);const d=[];d.push([n[0]+a[0]*(u+p)-e[0]*p,n[1]+a[1]*(u+p)-e[1]*p]),d.push([n[0]+a[0]*u,n[1]+a[1]*u]),d.push([n[0]-a[0]*u,n[1]-a[1]*u]),d.push([n[0]-a[0]*(u+p)-e[0]*p,n[1]-a[1]*(u+p)-e[1]*p]),t.push(d),t.push([n,c]);break}case e.ConcentricCircles:{const s=this._cp2(r,1,0),i=this._cp3(r,s,2,0),e=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18);let o=this._dist(s,c),a=[o,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(c,a)),this._rotateDirect(a,e,u);if(t.push(n),_>=4){n=[];const s=r[3];o=this._dist(s,c),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(c,a)),0===t&&(n.push(this._add(c,a)),h(n[1],1)),this._rotateDirect(a,e,u);t.push(n)}n=[],o=this._dist(i,c),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(c,a)),this._rotateDirect(a,e,u);t.push(n);break}case e.DoubleJogArrow:{c=this._arrowPath(r)[0];const[s,i]=this._arrowLastSeg(r),h=this._sub(c,s),e=this._norm(h);this._normalize(h);const _=Math.abs(this._crossProduct(h,this._sub(i,c)));let u=Math.abs(this._dotProduct(h,this._sub(i,c)));u<.05*e?u=.05*e:u>.95*e&&(u=.95*e);const o=Math.max(_,u),a=this._leftPerp(h);let n=[];const p=[c[0]-h[0]*u*.5+a[0]*_*.5,c[1]-h[1]*u*.5+a[1]*_*.5];n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),p[0]-=a[0]*o*.25,p[1]-=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=c[0]-h[0]*u*.5-a[0]*_*.5,p[1]=c[1]-h[1]*u*.5-a[1]*_*.5,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),p[0]+=a[0]*o*.25,p[1]+=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),t.push(n);break}case e.LinkedChevrons:{const s=this._cp2(r,-5,0),i=this._cp3(r,s,-.2,1),h=this._sub(c,s);this._normalize(h);const e=this._leftPerp(h),_=Math.abs(this._crossProduct(h,this._sub(i,s)));t.push([s,c]);const u=[];u.push([c[0]-h[0]*_+e[0]*_,c[1]-h[1]*_+e[1]*_]),u.push(c),u.push([c[0]-h[0]*_-e[0]*_,c[1]-h[1]*_-e[1]*_]),t.push(u),this._addDash(t,s,[-h[0]*_+e[0]*_,-h[1]*_+e[1]*_]),this._addDash(t,s,[-h[0]*_-e[0]*_,-h[1]*_-e[1]*_]);break}case e.SegmentThenHalfCircle:{const s=this._cp2(r,2,0),i=this._cp3(r,s,1.5,0);let h;h=_>=4?r[3]:this._cp3(r,s,1.25,-.5);const e=this._sub(s,c);this._normalize(e);const u=.5*this._dist(s,i),o=this._crossProduct(e,this._sub(h,c))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);o&&(n=-n);const p=[c,s];e[0]*=u,e[1]*=u;const d=this._add(s,e);e[0]=-e[0],e[1]=-e[1];for(let t=1;t<=18;t++)this._rotateDirect(e,a,n),p.push(this._add(d,e));t.push(p);break}case e.LineWithStraightTicks:{const s=this._cp2(r,-2,1),i=this._cp3(r,s,-1,-.5),h=this._sub(i,s);this._normalize(h);const e=this._dotProduct(h,this._sub(s,c)),_=this._dotProduct(h,this._sub(i,c));let u=[c];u.push([c[0]+h[0]*e,c[1]+h[1]*e]),u.push(s),t.push(u),u=[c],u.push([c[0]+h[0]*_,c[1]+h[1]*_]),u.push(i),t.push(u);break}case e.DoubleCurve:{const s=this._cp2(r,-5,-1),i=this._cp3(r,s,2,0),e=Math.atan2(1,5),_=Math.cos(e),u=Math.sin(e),o=this._sub(s,c),a=this._dist(c,s);this._normalize(o),this._rotateDirect(o,_,-u);const n=[c];n.push([c[0]+o[0]*a*.5,c[1]+o[1]*a*.5]),h(n[1],1),n.push([c[0]+o[0]*a*.8,c[1]+o[1]*a*.8]),this._addBezier2(n,n[2],[c[0]+o[0]*a,c[1]+o[1]*a],s,3);const p=this._sub(i,s),d=this._dist(s,i);this._normalize(p),this._rotateDirect(p,_,-u),this._addBezier2(n,s,[i[0]-p[0]*d,i[1]-p[1]*d],[i[0]-p[0]*d*.8,i[1]-p[1]*d*.8],3),n.push(i),t.push(n);break}case e.ParallelWithTicksByWidth:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,3),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h),e>0?(this._addAngledTicks(t,c,[c[0]+h[0]*e,c[1]+h[1]*e],s),this._addAngledTicks(t,s,[s[0]+h[0]*e,s[1]+h[1]*e],c)):(this._addAngledTicks(t,[c[0]+h[0]*e,c[1]+h[1]*e],c,s),this._addAngledTicks(t,[s[0]+h[0]*e,s[1]+h[1]*e],c,s));break}case e.EnclosingRoundedRectangle:{const s=this._cp2(r,3,-2),t=[Math.min(c[0],s[0]),Math.max(c[1],s[1])],i=[Math.max(c[0],s[0]),Math.min(c[1],s[1])],h=i[0]-t[0],e=t[1]-i[1],_=Math.min(h,e)/10,u=[];u.push([t[0]+_+.75*(h-2*_),t[1]]),u.push([i[0]-_,t[1]]),this._add90DegArc(u,[i[0]-_,t[1]],[i[0],t[1]-_],[i[0],t[1]]),u.push([i[0],i[1]+_]),this._add90DegArc(u,[i[0],i[1]+_],[i[0]-_,i[1]],i),u.push([t[0]+_,i[1]]),this._add90DegArc(u,[t[0]+_,i[1]],[t[0],i[1]+_],[t[0],i[1]]),u.push([t[0],t[1]-_]),this._add90DegArc(u,[t[0],t[1]-_],[t[0]+_,t[1]],t),u.push([t[0]+_+.75*(h-2*_),t[1]]);break}case e.FullGeometry:default:t.push(r)}}return t}}export{r as EffectControlMeasureLine};
5
+ import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as h}from"../CIMCursor.js";import{GeometricEffectControlMeasureLineRule as e}from"../enums.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(s,t,i,h,e){return new _(s,t,i)}}class _{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i,this._rule=t.rule??e.FullGeometry,this._defaultSize=this._defaultPointSize*i}next(){let i;for(;i=this._inputGeometries.next();){const h=this._processGeom(t(i));if(h?.length)return s.fromJSONCIM({paths:h})}return null}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return h(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,u=[];u.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),u.push(t),u.push(i),u.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(u)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),u=this._mid(h,e),o=this._mid(_,c),a=this._mid(c,u),n=this._mid(o,a);this._addBezier3(s,t,_,o,n,r),this._addBezier3(s,n,a,u,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(r,e)));let o=this._dotProduct(_,this._sub(r,e));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=.5*u,n=this._leftPerp(_),p=[e[0]+_[0]*o,e[1]+_[1]*o],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*u,p[1]+l[0][1]*u]),s.push(h),s.push([p[0]-l[0][0]*u,p[1]-l[0][1]*u]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_processGeom(s){if(!s)return null;const t=[];for(const r of s){const s=r.length>1&&i(r)<this._defaultSize;if(!r||0===r.length||s)continue;const _=r.length;let c=r[0];switch(this._rule){case e.PerpendicularFromFirstSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,4),h=[];h.push(i),h.push(this._mid(c,s)),t.push(h);break}case e.ReversedFirstSegment:{const s=this._cp2(r,0,-1);t.push([s,c]);break}case e.PerpendicularToSecondSegment:{if(r.length<3)return[];const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=[];h.push(this._mid(s,i)),h.push(c),t.push(h);break}case e.SecondSegmentWithTicks:{if(r.length<3)return[];const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=this._sub(i,s);let e;e=this._crossProduct(h,this._sub(c,s))>0?this._rightPerp(h):this._leftPerp(h);const _=[];_.push([s[0]+(e[0]-h[0])/3,s[1]+(e[1]-h[1])/3]),_.push(s),_.push(i),_.push([i[0]+(e[0]+h[0])/3,i[1]+(e[1]+h[1])/3]),t.push(_);break}case e.DoublePerpendicular:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,3),h=this._mid(c,s),e=this._sub(h,i);this._normalize(e);const _=this._crossProduct(e,this._sub(c,i));this._leftPerpendicular(e);const u=[];u.push(c),u.push([i[0]+e[0]*_,i[1]+e[1]*_]),t.push(u);const o=[];o.push([i[0]-e[0]*_,i[1]-e[1]*_]),o.push(s),t.push(o);break}case e.OppositeToFirstSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,3),h=this._mid(c,s),e=this._sub(h,i);this._normalize(e);const _=this._crossProduct(e,this._sub(c,i));this._leftPerpendicular(e);const u=[];u.push([i[0]+e[0]*_,i[1]+e[1]*_]),u.push([i[0]-e[0]*_,i[1]-e[1]*_]),t.push(u);break}case e.TriplePerpendicular:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,4),h=this._mid(c,s),e=this._sub(h,i);this._normalize(e);const _=this._crossProduct(e,this._sub(c,i));this._leftPerpendicular(e);const u=[];u.push([i[0]+e[0]*_*.8,i[1]+e[1]*_*.8]),u.push([h[0]+.8*(c[0]-h[0]),h[1]+.8*(c[1]-h[1])]),t.push(u),t.push([i,h]);const o=[];o.push([i[0]-e[0]*_*.8,i[1]-e[1]*_*.8]),o.push([h[0]+.8*(s[0]-h[0]),h[1]+.8*(s[1]-h[1])]),t.push(o);break}case e.HalfCircleFirstSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,4),h=this._mid(c,s);let e=this._sub(s,c);const _=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),o=Math.sqrt((1+_)/2),a=Math.sqrt((1-_)/2),n=[];let p;this._crossProduct(e,this._sub(i,c))>0?(n.push(c),e=this._sub(c,h),p=s):(n.push(s),e=this._sub(s,h),p=c),this._rotateDirect(e,o,a),e[0]/=o,e[1]/=o;for(let t=1;t<=18;t++)n.push(this._add(h,e)),this._rotateDirect(e,_,u);n.push(p),t.push(n);break}case e.HalfCircleSecondSegment:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,1,-1);let h=this._sub(c,s);this._normalize(h);const e=this._crossProduct(h,this._sub(i,s))/2;this._leftPerpendicular(h);const _=[s[0]+h[0]*e,s[1]+h[1]*e];h=this._sub(s,_);const u=Math.cos(Math.PI/18);let o=Math.sin(Math.PI/18);e>0&&(o=-o);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(h,u,o),a.push(this._add(_,h));t.push(a);break}case e.HalfCircleExtended:{const s=this._cp2(r,0,-2),i=this._cp3(r,s,1,-1);let h;if(_>=4)h=r[3];else{const t=this._sub(c,s);h=this._add(i,t)}const e=this._dist(s,i)/2/.75,u=this._sub(s,c);this._normalize(u,e);const o=this._sub(i,h);this._normalize(o,e);const a=[h,i];t.push(a);const n=[this._clone(i)];this._addBezier3(n,i,this._add(i,o),this._add(s,u),s,4),n.push(c),t.push(n);break}case e.OpenCircle:{const s=this._cp2(r,-2,0),i=this._sub(s,c),h=Math.cos(Math.PI/18),e=-Math.sin(Math.PI/18),_=[s];for(let t=1;t<=33;t++)this._rotateDirect(i,h,e),_.push(this._add(c,i));t.push(_);break}case e.CoverageEdgesWithTicks:{const s=this._cp2(r,0,-1);let i,h;if(_>=3)i=r[2];else{const t=this._sub(s,c),h=this._leftPerp(t);i=[c[0]+h[0]-.25*t[0],c[1]+h[1]-.25*t[1]]}if(_>=4)h=r[3];else{const t=this._mid(c,s),e=this._sub(c,s);this._normalize(e),this._leftPerpendicular(e);const r=this._crossProduct(e,this._sub(i,t));this._rightPerpendicular(e),h=[i[0]+e[0]*r*2,i[1]+e[1]*r*2]}const e=this._sub(s,c);let u,o;u=this._crossProduct(e,this._sub(i,c))>0?this._rightPerp(e):this._leftPerp(e),o=[],o.push(i),o.push(c),o.push([c[0]+(u[0]-e[0])/3,c[1]+(u[1]-e[1])/3]),t.push(o),u=this._crossProduct(e,this._sub(h,s))>0?this._rightPerp(e):this._leftPerp(e),o=[],o.push([s[0]+(u[0]+e[0])/3,s[1]+(u[1]+e[1])/3]),o.push(s),o.push(h),t.push(o);break}case e.GapExtentWithDoubleTicks:{const s=this._cp2(r,0,2),i=this._cp3(r,s,0,1);let h;if(_>=4)h=r[3];else{const t=this._sub(s,c);h=this._add(i,t)}this._addAngledTicks(t,c,s,this._mid(i,h)),this._addAngledTicks(t,i,h,this._mid(c,s));break}case e.GapExtentMidline:{const s=this._cp2(r,2,0),i=this._cp3(r,s,0,1);let h;if(_>=4)h=r[3];else{const t=this._sub(s,c);h=this._add(i,t)}const e=[];e.push(this._mid(c,i)),e.push(this._mid(s,h)),t.push(e);break}case e.Chevron:{const s=this._cp2(r,-1,-1);let i;if(_>=3)i=r[2];else{const t=this._sub(s,c);this._leftPerpendicular(t),i=this._add(c,t)}t.push([s,this._makeCtrlPt(c),i]);break}case e.PerpendicularWithArc:{const s=this._cp2(r,0,-2),i=this._cp3(r,s,.5,-1),h=this._sub(s,c),e=this._norm(h);h[0]/=e,h[1]/=e;const u=this._crossProduct(h,this._sub(i,c));let o=this._dotProduct(h,this._sub(i,c));o<.05*e?o=.05*e:o>.95*e&&(o=.95*e);const a=[c[0]+h[0]*o,c[1]+h[1]*o];let n=this._leftPerp(h),p=[];if(p.push([a[0]-n[0]*u,a[1]-n[1]*u]),p.push([a[0]+n[0]*u,a[1]+n[1]*u]),t.push(p),_>=4){const s=r[3];let i=this._dotProduct(h,this._sub(s,c));i<.1*e?i=.1*e:i>.9*e&&(i=.9*e);const _=[c[0]+h[0]*i,c[1]+h[1]*i],u=this._crossProduct(h,this._sub(s,c)),o=[];o.push([_[0]-n[0]*u,_[1]-n[1]*u]),o.push([_[0]+n[0]*u,_[1]+n[1]*u]),t.push(o)}const d=[s[0]+n[0]*u,s[1]+n[1]*u];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);u<0&&(b=-b),p=[c,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case e.ClosedHalfCircle:{const s=this._cp2(r,2,0),i=this._mid(c,s),h=this._sub(s,i),e=Math.cos(Math.PI/18),_=Math.sin(Math.PI/18),u=[c,s];for(let t=1;t<=18;t++)this._rotateDirect(h,e,_),u.push(this._add(i,h));t.push(u);break}case e.TripleParallelExtended:{const s=this._cp2(r,0,-2),i=this._cp3(r,s,1,-2),e=this._mid(c,s),_=this._sub(i,s);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(e,s)))/2,o=this._dist(s,i),a=[s,c];a.push([c[0]+_[0]*o*.5,c[1]+_[1]*o*.5]),t.push(a);const n=[];n.push([e[0]-_[0]*u,e[1]-_[1]*u]),n.push([e[0]+_[0]*o*.375,e[1]+_[1]*o*.375]),h(n[n.length-1],1),n.push([e[0]+_[0]*o*.75,e[1]+_[1]*o*.75]),t.push(n);const p=[s,i];t.push(p);break}case e.ParallelWithTicks:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(i,s);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h),this._addAngledTicks(t,c,s,i),this._addAngledTicks(t,this._mix(c,1,h,e),this._mix(s,1,h,e),this._mid(c,s));break}case e.Parallel:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._leftPerp(h),_=this._crossProduct(h,this._sub(i,c));let u=[c,s];t.push(u),u=[],u.push([c[0]+e[0]*_,c[1]+e[1]*_]),u.push([s[0]+e[0]*_,s[1]+e[1]*_]),t.push(u);break}case e.PerpendicularToFirstSegment:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._mid(c,s),e=this._sub(s,c);this._normalize(e);const _=this._crossProduct(e,this._sub(i,c));this._leftPerpendicular(e);const u=[];u.push([h[0]-e[0]*_*.25,h[1]-e[1]*_*.25]),u.push([h[0]+e[0]*_*1.25,h[1]+e[1]*_*1.25]),t.push(u);break}case e.ParallelOffset:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h);const _=[];_.push([c[0]-h[0]*e,c[1]-h[1]*e]),_.push([s[0]-h[0]*e,s[1]-h[1]*e]),t.push(_);const u=[];u.push([c[0]+h[0]*e,c[1]+h[1]*e]),u.push([s[0]+h[0]*e,s[1]+h[1]*e]),t.push(u);break}case e.OffsetOpposite:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h);const _=[];_.push([c[0]-h[0]*e,c[1]-h[1]*e]),_.push([s[0]-h[0]*e,s[1]-h[1]*e]),t.push(_);break}case e.OffsetSame:{const s=this._cp2(r,3,0),i=this._cp3(r,s,.5,-1),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h);const _=[];_.push([c[0]+h[0]*e,c[1]+h[1]*e]),_.push([s[0]+h[0]*e,s[1]+h[1]*e]),t.push(_);break}case e.CircleWithArc:{let s=this._cp2(r,3,0);const i=this._cp3(r,s,.5,-1);let e,u;if(_>=4)e=r[3],u=this._crossProduct(this._sub(e,s),this._sub(i,s))>0;else{e=s,u=this._crossProduct(this._sub(e,c),this._sub(i,c))>0;const t=24*this._geomUnitsPerPoint,h=this._sub(e,c);this._normalize(h,t);const r=Math.sqrt(2)/2;this._rotateDirect(h,r,u?r:-r),s=this._add(c,h)}const o=this._sub(s,c),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(o,a,n),p.push(this._add(c,o));this._add90DegArc(p,s,e,i,u),h(p[p.length-8],1),t.push(p);break}case e.DoubleJog:{let s,i=this._cp2(r,-3,1),h=this._cp3(r,i,-1,-.5);if(_>=4)s=r[3];else{const t=c;c=i,s=h;const e=this._dist(c,t),r=this._dist(s,t);let _=30*this._geomUnitsPerPoint;.5*e<_&&(_=.5*e),.5*r<_&&(_=.5*r),i=this._mix(c,_/e,t,(e-_)/e),h=this._mix(s,_/r,t,(r-_)/r)}const e=this._mid(c,i),u=this._mid(s,h),o=this._dist(c,i),a=this._dist(h,s);let n=Math.min(o,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(c,i);this._normalize(d,n),this._crossProduct(d,this._sub(s,i))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(i),l.push(this._add(e,d)),l.push(this._sub(e,d)),l.push(c),t.push(l),d=this._sub(s,h),this._normalize(d,n),this._crossProduct(d,this._sub(c,h))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(h),l.push(this._add(u,d)),l.push(this._sub(u,d)),l.push(s),t.push(l);break}case e.PerpendicularOffset:{const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(c,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const e=[h[0]/8,h[1]/8],_=this._sub(this._mid(s,i),e);t.push([_,c]);break}case e.LineExcludingLastSegment:{const s=this._arrowPath(r),i=[];let h=s.length-2;for(;h--;)i.push(s[h]);t.push(i);break}case e.MultivertexArrow:{const s=this._arrowPath(r),i=[];this._addArrow(i,s,!1),t.push(i);break}case e.CrossedArrow:{const s=this._arrowPath(r),i=[];this._addArrow(i,s,!0),t.push(i);break}case e.ChevronArrow:{const[s,i]=this._arrowLastSeg(r),h=10*this._geomUnitsPerPoint,e=this._sub(c,s),_=this._norm(e);this._normalize(e);const u=this._crossProduct(e,this._sub(i,s));let o=this._dotProduct(e,this._sub(i,s));o<.05*_?o=.05*_:o>.95*_-h&&(o=.95*_-h);const a=[s[0]+e[0]*o,s[1]+e[1]*o],n=this._leftPerp(e),p=[];p.push([a[0]+n[0]*u+e[0]*h,a[1]+n[1]*u+e[1]*h]),p.push(c),p.push([a[0]-n[0]*u+e[0]*h,a[1]-n[1]*u+e[1]*h]),t.push(p);break}case e.ChevronArrowOffset:{const[s,i]=this._arrowLastSeg(r),h=this._sub(c,s),e=this._norm(h);this._normalize(h);const _=this._crossProduct(h,this._sub(i,s));let u=this._dotProduct(h,this._sub(i,s));u<.05*e?u=.05*e:u>.95*e&&(u=.95*e);const o=[s[0]+h[0]*u,s[1]+h[1]*u];this._leftPerpendicular(h);const a=[];a.push([o[0]+h[0]*_*.5,o[1]+h[1]*_*.5]),a.push(this._mid(o,c)),a.push([o[0]-h[0]*_*.5,o[1]-h[1]*_*.5]),t.push(a);break}case e.PartialFirstSegment:{const[s,i]=this._arrowLastSeg(r),h=this._sub(c,s),e=this._norm(h);this._normalize(h);let _=this._dotProduct(h,this._sub(i,s));_<.05*e?_=.05*e:_>.95*e&&(_=.95*e);const u=[s[0]+h[0]*_,s[1]+h[1]*_];t.push([s,u]);break}case e.Arch:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,1),h=this._sub(c,s),e=this._mix(i,1,h,.55),_=this._mix(i,1,h,-.55),u=[c];this._addBezier2(u,c,e,i,4),this._addBezier2(u,i,_,s,4),t.push(u);break}case e.CurvedParallelTicks:{const s=this._cp2(r,-4,1),i=this._cp3(r,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(c,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const e=[h[0]/8,h[1]/8],_=this._sub(this._mid(s,i),e),u=this._sub(this._mix(s,.75,i,.25),e),o=this._sub(this._mix(s,.25,i,.75),e),a=[s];this._addBezier2(a,s,u,_,3),this._addBezier2(a,_,o,i,3),t.push(a);for(let r=0;r<8;r++){const s=a[2*r+1],i=[this._clone(s)];i.push(this._add(s,[h[0]/4,h[1]/4])),t.push(i)}break}case e.Arc90Degrees:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,1),h=[s];this._add90DegArc(h,s,c,i),t.push(h);break}case e.TipWithPerpendicularAndTicks:{const[s,i]=this._arrowLastSeg(r),h=10*this._geomUnitsPerPoint,e=this._sub(c,s),_=this._norm(e);this._normalize(e);let u=this._crossProduct(e,this._sub(i,s)),o=this._dotProduct(e,this._sub(i,s));o<.05*_?o=.05*_:o>.95*_-h&&(o=.95*_-h);const a=this._leftPerp(e),n=[c[0]-e[0]*h,c[1]-e[1]*h],p=.5*Math.max(_-o-h,h);u=Math.abs(u);const d=[];d.push([n[0]+a[0]*(u+p)-e[0]*p,n[1]+a[1]*(u+p)-e[1]*p]),d.push([n[0]+a[0]*u,n[1]+a[1]*u]),d.push([n[0]-a[0]*u,n[1]-a[1]*u]),d.push([n[0]-a[0]*(u+p)-e[0]*p,n[1]-a[1]*(u+p)-e[1]*p]),t.push(d),t.push([n,c]);break}case e.ConcentricCircles:{const s=this._cp2(r,1,0),i=this._cp3(r,s,2,0),e=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18);let o=this._dist(s,c),a=[o,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(c,a)),this._rotateDirect(a,e,u);if(t.push(n),_>=4){n=[];const s=r[3];o=this._dist(s,c),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(c,a)),0===t&&(n.push(this._add(c,a)),h(n[1],1)),this._rotateDirect(a,e,u);t.push(n)}n=[],o=this._dist(i,c),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(c,a)),this._rotateDirect(a,e,u);t.push(n);break}case e.DoubleJogArrow:{c=this._arrowPath(r)[0];const[s,i]=this._arrowLastSeg(r),h=this._sub(c,s),e=this._norm(h);this._normalize(h);const _=Math.abs(this._crossProduct(h,this._sub(i,c)));let u=Math.abs(this._dotProduct(h,this._sub(i,c)));u<.05*e?u=.05*e:u>.95*e&&(u=.95*e);const o=Math.max(_,u),a=this._leftPerp(h);let n=[];const p=[c[0]-h[0]*u*.5+a[0]*_*.5,c[1]-h[1]*u*.5+a[1]*_*.5];n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),p[0]-=a[0]*o*.25,p[1]-=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=c[0]-h[0]*u*.5-a[0]*_*.5,p[1]=c[1]-h[1]*u*.5-a[1]*_*.5,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),p[0]+=a[0]*o*.25,p[1]+=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),t.push(n);break}case e.LinkedChevrons:{const s=this._cp2(r,-5,0),i=this._cp3(r,s,-.2,1),h=this._sub(c,s);this._normalize(h);const e=this._leftPerp(h),_=Math.abs(this._crossProduct(h,this._sub(i,s)));t.push([s,c]);const u=[];u.push([c[0]-h[0]*_+e[0]*_,c[1]-h[1]*_+e[1]*_]),u.push(c),u.push([c[0]-h[0]*_-e[0]*_,c[1]-h[1]*_-e[1]*_]),t.push(u),this._addDash(t,s,[-h[0]*_+e[0]*_,-h[1]*_+e[1]*_]),this._addDash(t,s,[-h[0]*_-e[0]*_,-h[1]*_-e[1]*_]);break}case e.SegmentThenHalfCircle:{const s=this._cp2(r,2,0),i=this._cp3(r,s,1.5,0);let h;h=_>=4?r[3]:this._cp3(r,s,1.25,-.5);const e=this._sub(s,c);this._normalize(e);const u=.5*this._dist(s,i),o=this._crossProduct(e,this._sub(h,c))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);o&&(n=-n);const p=[c,s];e[0]*=u,e[1]*=u;const d=this._add(s,e);e[0]=-e[0],e[1]=-e[1];for(let t=1;t<=18;t++)this._rotateDirect(e,a,n),p.push(this._add(d,e));t.push(p);break}case e.LineWithStraightTicks:{const s=this._cp2(r,-2,1),i=this._cp3(r,s,-1,-.5),h=this._sub(i,s);this._normalize(h);const e=this._dotProduct(h,this._sub(s,c)),_=this._dotProduct(h,this._sub(i,c));let u=[c];u.push([c[0]+h[0]*e,c[1]+h[1]*e]),u.push(s),t.push(u),u=[c],u.push([c[0]+h[0]*_,c[1]+h[1]*_]),u.push(i),t.push(u);break}case e.DoubleCurve:{const s=this._cp2(r,-5,-1),i=this._cp3(r,s,2,0),e=Math.atan2(1,5),_=Math.cos(e),u=Math.sin(e),o=this._sub(s,c),a=this._dist(c,s);this._normalize(o),this._rotateDirect(o,_,-u);const n=[c];n.push([c[0]+o[0]*a*.5,c[1]+o[1]*a*.5]),h(n[1],1),n.push([c[0]+o[0]*a*.8,c[1]+o[1]*a*.8]),this._addBezier2(n,n[2],[c[0]+o[0]*a,c[1]+o[1]*a],s,3);const p=this._sub(i,s),d=this._dist(s,i);this._normalize(p),this._rotateDirect(p,_,-u),this._addBezier2(n,s,[i[0]-p[0]*d,i[1]-p[1]*d],[i[0]-p[0]*d*.8,i[1]-p[1]*d*.8],3),n.push(i),t.push(n);break}case e.ParallelWithTicksByWidth:{const s=this._cp2(r,0,-1),i=this._cp3(r,s,.5,3),h=this._sub(s,c);this._normalize(h);const e=this._crossProduct(h,this._sub(i,c));this._leftPerpendicular(h),e>0?(this._addAngledTicks(t,c,[c[0]+h[0]*e,c[1]+h[1]*e],s),this._addAngledTicks(t,s,[s[0]+h[0]*e,s[1]+h[1]*e],c)):(this._addAngledTicks(t,[c[0]+h[0]*e,c[1]+h[1]*e],c,s),this._addAngledTicks(t,[s[0]+h[0]*e,s[1]+h[1]*e],c,s));break}case e.EnclosingRoundedRectangle:{const s=this._cp2(r,3,-2),t=[Math.min(c[0],s[0]),Math.max(c[1],s[1])],i=[Math.max(c[0],s[0]),Math.min(c[1],s[1])],h=i[0]-t[0],e=t[1]-i[1],_=Math.min(h,e)/10,u=[];u.push([t[0]+_+.75*(h-2*_),t[1]]),u.push([i[0]-_,t[1]]),this._add90DegArc(u,[i[0]-_,t[1]],[i[0],t[1]-_],[i[0],t[1]]),u.push([i[0],i[1]+_]),this._add90DegArc(u,[i[0],i[1]+_],[i[0]-_,i[1]],i),u.push([t[0]+_,i[1]]),this._add90DegArc(u,[t[0]+_,i[1]],[t[0],i[1]+_],[t[0],i[1]]),u.push([t[0],t[1]-_]),this._add90DegArc(u,[t[0],t[1]-_],[t[0]+_,t[1]],t),u.push([t[0]+_+.75*(h-2*_),t[1]]);break}case e.FullGeometry:default:t.push(r)}}return t}}export{r as EffectControlMeasureLine};
package/unionTypes.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import "./interfaces";
2
2
 
3
+ export type AnalysisViewUnion = __esri.unionTypes.AnalysisViewUnion;
4
+ export type AnalysisUnion = __esri.unionTypes.AnalysisUnion;
3
5
  export type RendererWithVisualVariablesUnion = __esri.unionTypes.RendererWithVisualVariablesUnion;
4
6
  export type RendererUnion = __esri.unionTypes.RendererUnion;
5
7
  export type RasterRendererUnion = __esri.unionTypes.RasterRendererUnion;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Evented.js";import{on as t}from"../../../core/events.js";import{handlesGroup as a}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{deg2rad as r}from"../../../core/mathUtils.js";import{identity as s,scale as i,rotate as o,translate as n}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";class c{constructor(r){this.events=new e,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const s={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};r.appendChild(this._canvas);let i=this._canvas.getContext("webgl2",s);i||(i=this._canvas.getContext("webgl2",{...s,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=i,this._handles=a([t(this._canvas,"webglcontextlost",(e=>this.events.emit("webgl-context-lost",e)))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(e,t){if(this._hasMajorPerformanceCaveat||has("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=has("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,a,r,s,i,o]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${t}, ${a}, ${r}, ${s}, ${i}, ${o})`}}else t()}resize(e){const t=this._canvas,a=t.style,{state:{size:r},pixelRatio:s}=e,i=r[0],o=r[1],n=Math.round(i*s),h=Math.round(o*s);t.width===n&&t.height===h||(t.width=n,t.height=h),a.width=i+"px",a.height=o+"px"}_computeViewTransform(e,t){const[a,c]=e.center,[l,m]=t.center,[d,f]=e.toScreen([0,0],l,m),[_,p]=e.toScreen([0,0],a,c),v=_-d,g=p-f,w=e.scale/t.scale,u=t.rotation-e.rotation,C=h();return s(C),i(C,C,[w,w]),o(C,C,r(u)),n(C,C,[v,g]),C}}export{c as ManagedCanvas};
5
+ import e from"../../../core/Evented.js";import{on as t}from"../../../core/events.js";import{handlesGroup as a}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{identity as r,scale as i,rotate as o,translate as n}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";class c{constructor(s,r={}){this.events=new e,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=r.canvas??document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const i={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};s.contains(this._canvas)||s.appendChild(this._canvas);let o=this._canvas.getContext("webgl2",i);o||(o=this._canvas.getContext("webgl2",{...i,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=o,this._handles=a([t(this._canvas,"webglcontextlost",(e=>this.events.emit("webgl-context-lost",e)))])}destroy(){this._canvas.remove(),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(e,t){if(this._hasMajorPerformanceCaveat||has("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=has("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,a,s,r,i,o]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${t}, ${a}, ${s}, ${r}, ${i}, ${o})`}}else t()}resize(e){const t=this._canvas,a=t.style,{state:{size:s},pixelRatio:r}=e,i=s[0],o=s[1],n=Math.round(i*r),h=Math.round(o*r);t.width===n&&t.height===h||(t.width=n,t.height=h),a.width=i+"px",a.height=o+"px"}_computeViewTransform(e,t){const[a,c]=e.center,[l,m]=t.center,[f,d]=e.toScreen([0,0],l,m),[_,v]=e.toScreen([0,0],a,c),p=_-f,g=v-d,w=e.scale/t.scale,u=t.rotation-e.rotation,j=h();return r(j),i(j,j,[w,w]),o(j,j,s(u)),n(j,j,[p,g]),j}}export{c as ManagedCanvas};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as _}from"../support/Timeline.js";import{TextureWrapMode as b,SizedPixelFormat as w,SizedDepthStencilFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";const M=2e3;class O extends a{constructor(t,i){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new _,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=M,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH24_STENCIL8,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{O as Stage,M as extraRenderTime};
5
+ import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as _}from"../support/Timeline.js";import{TextureWrapMode as b,SizedPixelFormat as w,SizedDepthStencilFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";const M=2e3;class O extends a{constructor(t,i){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t,i),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new _,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=M,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH24_STENCIL8,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{O as Stage,M as extraRenderTime};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileCoordSize as i}from"./constants.js";import{BucketType as o}from"./enums.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as c}from"./RenderBucket.js";import{fadeDuration as d}from"./decluttering/config.js";import{TiledDisplayObject as u}from"../webgl/TiledDisplayObject.js";const y=null;class m extends u{constructor(e,t,s,r,a,o,h,n=null){super(e,t,s,r,a,o,i,i),this.styleRepository=h,this._memCache=n,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<d}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<d)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===o.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._memCache?.updateSize(this.key.id,this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(m._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0==--this._referenced&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get cachedMemory(){return this._usedMemory}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),i.type===o.SYMBOL&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._memCache?.updateSize(this.key.id,this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===o.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case o.FILL:s=new c(e,this.styleRepository);break;case o.LINE:s=new l(e,this.styleRepository);break;case o.SYMBOL:s=new n(e,this.styleRepository,this);break;case o.CIRCLE:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{m as VectorTile,y as tracer};
5
+ import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileCoordSize as i}from"./constants.js";import{BucketType as o}from"./enums.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as c}from"./RenderBucket.js";import{fadeDuration as d}from"./decluttering/config.js";import{TiledDisplayObject as u}from"../webgl/TiledDisplayObject.js";const y=null;class m extends u{constructor(e,t,s,r,a,o,h,n=null){super(e,t,s,r,a,o,i,i),this.styleRepository=h,this._memCache=n,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<d}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<d)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===o.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._memCache?.updateSize(this.key.id,this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(m._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0===--this._referenced&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get cachedMemory(){return this._usedMemory}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),i.type===o.SYMBOL&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._memCache?.updateSize(this.key.id,this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===o.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case o.FILL:s=new c(e,this.styleRepository);break;case o.LINE:s=new l(e,this.styleRepository);break;case o.SYMBOL:s=new n(e,this.styleRepository,this);break;case o.CIRCLE:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{m as VectorTile,y as tracer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{WGLDrawPhase as e}from"./enums.js";import r from"./WGLContainer.js";import s from"./brushes/WGLBrushStencil.js";import t from"./brushes/WGLBrushTileDebugInfo.js";const n=(e,r)=>e.key.level-r.key.level!=0?e.key.level-r.key.level:e.key.row-r.key.row!=0?e.key.row-r.key.row:e.key.col-r.key.col;class i extends r{constructor(e){super(),this.tileInfoView=e,this.sortFunction=n}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(r){const n=super.prepareRenderPasses(r);return n.push(r.registerRenderPass({name:"stencil",brushes:[s],drawPhase:e.DEBUG|e.MAP|e.HIGHLIGHT|e.LABEL,target:()=>this.getStencilTarget()})),has("esri-tiles-debug")&&n.push(r.registerRenderPass({name:"tileInfo",brushes:[t],drawPhase:e.DEBUG,target:()=>this.children})),n}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{i as default};
5
+ import has from"../../../../core/has.js";import{WGLDrawPhase as e}from"./enums.js";import r from"./WGLContainer.js";import s from"./brushes/WGLBrushStencil.js";import t from"./brushes/WGLBrushTileDebugInfo.js";const n=(e,r)=>e.key.level-r.key.level!==0?e.key.level-r.key.level:e.key.row-r.key.row!==0?e.key.row-r.key.row:e.key.col-r.key.col;class i extends r{constructor(e){super(),this.tileInfoView=e,this.sortFunction=n}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(r){const n=super.prepareRenderPasses(r);return n.push(r.registerRenderPass({name:"stencil",brushes:[s],drawPhase:e.DEBUG|e.MAP|e.HIGHLIGHT|e.LABEL,target:()=>this.getStencilTarget()})),has("esri-tiles-debug")&&n.push(r.registerRenderPass({name:"tileInfo",brushes:[t],drawPhase:e.DEBUG,target:()=>this.children})),n}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{numericHash as t}from"../../../../core/string.js";function e(e,o){let r;if("string"==typeof e)r=t(e+`-seed(${o})`);else{let t=12;r=e^o;do{r=107*(r>>8^r)+t|0}while(0!=--t)}return(1+r/(1<<31))/2}function o(t){return Math.floor(e(t,r)*n)}const r=53290320,n=10;export{e as getRandomValue,o as getStartGroup};
5
+ import{numericHash as t}from"../../../../core/string.js";function e(e,o){let r;if("string"==typeof e)r=t(e+`-seed(${o})`);else{let t=12;r=e^o;do{r=107*(r>>8^r)+t|0}while(0!==--t)}return(1+r/(1<<31))/2}function o(t){return Math.floor(e(t,r)*n)}const r=53290320,n=10;export{e as getRandomValue,o as getStartGroup};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlOr as v,sqlIn as _,sqlAnd as b}from"../../../core/sql.js";import{property as F}from"../../../core/accessorSupport/decorators/property.js";import{subclass as S}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import j from"../../../geometry/Extent.js";import I from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as U}from"../../../layers/graphics/featureConversionUtils.js";import x from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as E}from"../../../layers/support/featureLayerUtils.js";import{packFields as k}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as V}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import R from"../../../rest/support/AttributeBinsFeatureSet.js";import O from"../../../rest/support/AttributeBinsQuery.js";import Q from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import{FeatureContainer as D}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as P}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as M}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as H}from"./features/layerAdapters/FeatureLayerAdapter.js";import{InMemoryLayerAdapter as N}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as J}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as G}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as $}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as B}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as z}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as Z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as K}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as X}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as Y}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as ee}from"./support/handleNoEngineError.js";import{toJSONGeometryType as te}from"./support/util.js";import{FeatureTileSubscriptionManager as re}from"../tiling/FeatureTileSubscriptionManager.js";import se from"../../layers/FeatureLayerView.js";import ie from"../../layers/LayerView.js";import ae from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as oe}from"../../support/HighlightDefaults.js";function ne(e,t){const r=new Set;return e&&e.forEach((e=>r.add(e))),t&&t.forEach((e=>r.add(e))),r.has("*")?["*"]:Array.from(r)}const ue=4294967294;function le(e,t){return l(e.map((e=>w((()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t}),t))))}let he=class extends(se(ae(T(ie)))){constructor(){super(...arguments),this._commandsQueue=new Y({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new I}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await P(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?v(e,_(this.layer.objectIdField,this.highlightIds)):e}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map((({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r})))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new N(this.layer):new H(this.layer);case"geojson":case"csv":case"wfs":return new N(this.layer);case"parquet":return new B(this.layer);case"subtype-group":return new Z(this.layer);case"ogc-feature":return new G(this.layer);case"stream":return new z(this.layer);case"oriented-imagery":return new $(this.layer);case"knowledge-graph-sublayer":return new J(this.layer);case"catalog-footprint":return new M(this.layer);default:o(this.layer)}return null}get timeExtent(){return V(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const o=s?.filter(i);if(!o?.length)return u();const n=t?.name??oe;return this._addHighlights(o,n),u((()=>!this.destroyed&&this._removeHighlights(o,n)))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...l.map((t=>this._createGraphicHit(e,s.fromJSON(t)))),...n.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}async queryStatistics(){const e=await this.getWorker();return ee(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return ee(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return ee(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return ee(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return ee(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return ee(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return ee(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return ee(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return ee(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=Q.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await ee(r,{features:[]}),i=Q.fromJSON(s);return i.features.forEach((e=>this._setLayersForFeature(e))),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await ee(r,{features:[]}),i=q.fromJSON(s);return i.features.forEach((e=>this._setLayersForFeature(e))),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return ee(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return ee(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return ee(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return ee(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return ee(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return ee(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await ee(r,{count:0,extent:null});return{count:s.count,extent:j.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await ee(r,{features:[]});return R.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.subscriptionManager.update(e.targetState,this._lastTargetState),r=this.subscriptionManager.coverageSet;for(const s of this.featureContainer.tiles||[])s.isCoverage=r.has(s.id),s.neededForCoverage=t.has(s.id)||s.isCoverage;this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new D(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new re({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then((t=>t.pipeline.updateSubscriptions(e)))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([le([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],(()=>this._update())),w((()=>this.updateSuspended),(e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())})),w((()=>this.visible),(e=>{this.view.labelManager.requestUpdate()}))]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._editUpdatingHandles.addPromise(this._edit(e)))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map((t=>e.view.stage.painter.textureManager.rasterizeItem(t))))},fetchDictionary:e=>Promise.all(e.map((e=>this._fetchDictionaryRequest(e))))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map((e=>e.toJSON())));const i=r.visualVariableUniforms,a=te(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await K({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=O.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this.updateSuspended?(this.subscriptionManager.suspend(),Promise.resolve()):this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ue+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ue+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=te(this.layer.geometryType),i=this.layer.objectIdField,a=[];for(const o of e.added){const e=U(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=U(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find((e=>e.layerId===t.layerId));if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map((e=>e.current)),n=t.map((e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e)),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every((e=>this.view.spatialReference.equals(e.geometry?.spatialReference)))&&r.every((e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference)))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),E(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,r={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},s=await this._createViewSchemaConfig(),i={source:this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)},a=i.processor.mesh.factory.labels;a&&this.view.labelManager.setLabelSchemaStyles(a,this.featureContainer);const o=p(this._lastSchema?.source.mutable,i.source.mutable)||p(this._lastSchema?.processor,i.processor);if(!o)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=i,this._fields=null;const n=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${n}] FeatureLayerView2D._doUpdate`,{changes:o});const u=await this.getWorker();await u.pipeline.updateSchema(i,n),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender(),has("esri-2d-update-debug")&&console.debug(`Version[${n}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new X;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new X;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=ne(this._lastAvailableFields,e);return this._lastAvailableFields=t,k(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ce(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch((e=>{m(e)||h.getLogger(this).error(e)}));this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ce(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new x,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new x,i.where=b(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new x).toJSON(),u.hiddenIds=Array.from(s)),u}e([F()],he.prototype,"_commandsQueue",void 0),e([F()],he.prototype,"_sourceRefreshVersion",void 0),e([F()],he.prototype,"_displayRefreshVersion",void 0),e([F({readOnly:!0})],he.prototype,"_pipelineUpdating",void 0),e([F()],he.prototype,"_sourceUpdating",void 0),e([F({readOnly:!0})],he.prototype,"dataUpdating",null),e([F({readOnly:!0})],he.prototype,"effectiveDisplayFilterClause",null),e([F({readOnly:!0})],he.prototype,"hasAllFeatures",null),e([F({readOnly:!0})],he.prototype,"hasAllFeaturesInView",null),e([F({readOnly:!0})],he.prototype,"hasFullGeometries",null),e([F()],he.prototype,"featureEffectView",void 0),e([F()],he.prototype,"labelingCollisionInfos",null),e([F()],he.prototype,"layerAdapter",null),e([F({readOnly:!0})],he.prototype,"timeExtent",null),e([F()],he.prototype,"updating",void 0),he=e([S("esri.views.2d.layers.FeatureLayerView2D")],he);export{he as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlOr as v,sqlIn as _,sqlAnd as b}from"../../../core/sql.js";import{property as F}from"../../../core/accessorSupport/decorators/property.js";import{subclass as S}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import j from"../../../geometry/Extent.js";import U from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as I}from"../../../layers/graphics/featureConversionUtils.js";import x from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as E}from"../../../layers/support/featureLayerUtils.js";import{packFields as k}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as V}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import R from"../../../rest/support/AttributeBinsFeatureSet.js";import O from"../../../rest/support/AttributeBinsQuery.js";import Q from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import{FeatureContainer as D}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as P}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as M}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as H}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as N}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as J}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as G}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as $}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as B}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as z}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as Z}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as K}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as X}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as Y}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as ee}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as te}from"./support/handleNoEngineError.js";import{toJSONGeometryType as re}from"./support/util.js";import{FeatureTileSubscriptionManager as se}from"../tiling/FeatureTileSubscriptionManager.js";import ie from"../../layers/FeatureLayerView.js";import ae from"../../layers/LayerView.js";import oe from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as ne}from"../../support/HighlightDefaults.js";function ue(e,t){const r=new Set;return e&&e.forEach((e=>r.add(e))),t&&t.forEach((e=>r.add(e))),r.has("*")?["*"]:Array.from(r)}const le=4294967294;function he(e,t){return l(e.map((e=>w((()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t}),t))))}let ce=class extends(ie(oe(T(ae)))){constructor(){super(...arguments),this._commandsQueue=new ee({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new U}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await P(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?v(e,_(this.layer.objectIdField,this.highlightIds)):e}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map((({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r})))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new J(this.layer):new H(this.layer);case"geojson":case"csv":case"wfs":return new J(this.layer);case"parquet":return new z(this.layer);case"subtype-group":return new K(this.layer);case"ogc-feature":return new $(this.layer);case"stream":return new Z(this.layer);case"oriented-imagery":return new B(this.layer);case"knowledge-graph-sublayer":return new G(this.layer);case"catalog-footprint":return new M(this.layer);default:o(this.layer)}return null}get timeExtent(){return V(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const o=s?.filter(i);if(!o?.length)return u();const n=t?.name??ne;return this._addHighlights(o,n),u((()=>!this.destroyed&&this._removeHighlights(o,n)))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...l.map((t=>this._createGraphicHit(e,s.fromJSON(t)))),...n.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}async queryStatistics(){const e=await this.getWorker();return te(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return te(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return te(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return te(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return te(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return te(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return te(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return te(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return te(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=Q.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await te(r,{features:[]}),i=Q.fromJSON(s);return i.features.forEach((e=>this._setLayersForFeature(e))),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await te(r,{features:[]}),i=q.fromJSON(s);return i.features.forEach((e=>this._setLayersForFeature(e))),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return te(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return te(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return te(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return te(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return te(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return te(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await te(r,{count:0,extent:null});return{count:s.count,extent:j.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await te(r,{features:[]});return R.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.subscriptionManager.update(e.targetState,this._lastTargetState),r=this.subscriptionManager.coverageSet;for(const s of this.featureContainer.tiles||[])s.isCoverage=r.has(s.id),s.neededForCoverage=t.has(s.id)||s.isCoverage;this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new D(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new se({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then((t=>t.pipeline.updateSubscriptions(e)))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([he([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],(()=>this._update())),w((()=>this.updateSuspended),(e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())})),w((()=>this.visible),(e=>{this.view.labelManager.requestUpdate()}))]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._editUpdatingHandles.addPromise(this._edit(e)))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map((t=>e.view.stage.painter.textureManager.rasterizeItem(t))))},fetchDictionary:e=>Promise.all(e.map((e=>this._fetchDictionaryRequest(e))))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map((e=>e.toJSON())));const i=r.visualVariableUniforms,a=re(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await X({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=O.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this.updateSuspended?(this.subscriptionManager.suspend(),Promise.resolve()):this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%le+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%le+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=re(this.layer.geometryType),i=N(this.layer),a=[];for(const o of e.added){const e=I(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=I(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find((e=>e.layerId===t.layerId));if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map((e=>e.current)),n=t.map((e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e)),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every((e=>this.view.spatialReference.equals(e.geometry?.spatialReference)))&&r.every((e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference)))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),E(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,r={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},s=await this._createViewSchemaConfig(),i={source:this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)},a=i.processor.mesh.factory.labels;a&&this.view.labelManager.setLabelSchemaStyles(a,this.featureContainer);const o=p(this._lastSchema?.source.mutable,i.source.mutable)||p(this._lastSchema?.processor,i.processor);if(!o)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=i,this._fields=null;const n=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${n}] FeatureLayerView2D._doUpdate`,{changes:o});const u=await this.getWorker();await u.pipeline.updateSchema(i,n),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender(),has("esri-2d-update-debug")&&console.debug(`Version[${n}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new Y;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new Y;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=ue(this._lastAvailableFields,e);return this._lastAvailableFields=t,k(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[pe(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch((e=>{m(e)||h.getLogger(this).error(e)}));this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function pe(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new x,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new x,i.where=b(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new x).toJSON(),u.hiddenIds=Array.from(s)),u}e([F()],ce.prototype,"_commandsQueue",void 0),e([F()],ce.prototype,"_sourceRefreshVersion",void 0),e([F()],ce.prototype,"_displayRefreshVersion",void 0),e([F({readOnly:!0})],ce.prototype,"_pipelineUpdating",void 0),e([F()],ce.prototype,"_sourceUpdating",void 0),e([F({readOnly:!0})],ce.prototype,"dataUpdating",null),e([F({readOnly:!0})],ce.prototype,"effectiveDisplayFilterClause",null),e([F({readOnly:!0})],ce.prototype,"hasAllFeatures",null),e([F({readOnly:!0})],ce.prototype,"hasAllFeaturesInView",null),e([F({readOnly:!0})],ce.prototype,"hasFullGeometries",null),e([F()],ce.prototype,"featureEffectView",void 0),e([F()],ce.prototype,"labelingCollisionInfos",null),e([F()],ce.prototype,"layerAdapter",null),e([F({readOnly:!0})],ce.prototype,"timeExtent",null),e([F()],ce.prototype,"updating",void 0),ce=e([S("esri.views.2d.layers.FeatureLayerView2D")],ce);export{ce as default};