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

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 (266) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +3 -0
  2. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -0
  3. package/analysis/ElevationProfileAnalysis.d.ts +5 -0
  4. package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
  5. package/analysis/ShadowCast/TotalDurationOptions.d.ts +13 -4
  6. package/analysis/ShadowCastAnalysis.d.ts +8 -5
  7. package/arcade/Dictionary.js +1 -1
  8. package/arcade/Feature.js +1 -1
  9. package/arcade/Pixel.js +1 -1
  10. package/arcade/Voxel.js +1 -1
  11. package/arcade/arcade.js +1 -1
  12. package/arcade/arcadeAsyncRuntime.js +1 -1
  13. package/arcade/arcadeCompiler.js +1 -1
  14. package/arcade/arcadeEnvironment.js +1 -1
  15. package/arcade/arcadeRuntime.js +1 -1
  16. package/arcade/compilerUtils.js +1 -1
  17. package/arcade/containerUtils.js +1 -1
  18. package/arcade/debug.js +1 -1
  19. package/arcade/enum.js +1 -1
  20. package/arcade/executionError.js +1 -1
  21. package/arcade/functions/convertdirection.js +1 -1
  22. package/arcade/functions/date.js +1 -1
  23. package/arcade/functions/feature.js +1 -1
  24. package/arcade/functions/featuresetbase.js +1 -1
  25. package/arcade/functions/featuresetgeom.js +1 -1
  26. package/arcade/functions/featuresetstats.js +1 -1
  27. package/arcade/functions/featuresetstring.js +1 -1
  28. package/arcade/functions/geomasync.js +1 -1
  29. package/arcade/functions/geometry.js +1 -1
  30. package/arcade/functions/geomsync.js +1 -1
  31. package/arcade/functions/knowledgegraph.js +1 -1
  32. package/arcade/functions/maths.js +1 -1
  33. package/arcade/functions/stats.js +1 -1
  34. package/arcade/functions/string.js +1 -1
  35. package/arcade/functions/track.js +1 -1
  36. package/arcade/geometry/constructors.js +1 -1
  37. package/arcade/geometry/functions.js +1 -1
  38. package/arcade/geometry/unitConversion.js +1 -1
  39. package/arcade.js +1 -1
  40. package/assets/components/assets/icon/returnToDefault16.json +1 -0
  41. package/assets/components/assets/icon/returnToDefault24.json +1 -0
  42. package/assets/components/assets/icon/returnToDefault32.json +1 -0
  43. package/assets/components/assets/icon/reviewMap16.json +1 -0
  44. package/assets/components/assets/icon/reviewMap24.json +1 -0
  45. package/assets/components/assets/icon/reviewMap32.json +1 -0
  46. package/assets/esri/core/workers/RemoteClient.js +1 -1
  47. package/assets/esri/core/workers/chunks/03babc21d1781142a974.js +1 -0
  48. package/assets/esri/core/workers/chunks/08efd64acdfe46985293.js +1 -0
  49. package/assets/esri/core/workers/chunks/0b76534b60014d74ecb9.js +1 -0
  50. package/assets/esri/core/workers/chunks/{622bdd1b9d5d292ec12b.js → 0e6a388d51d9dbae46ba.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{34e026549ba2822b8ebd.js → 13d43a0683c42b94feb6.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4f9ea7544b2d0e88a05c.js → 13f0e08de2dfab07d212.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{35bbd63319d8aa9f31cc.js → 169c9eb6cd000e067c4b.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{d4014213c476bf8099af.js → 18c4207b1cb0777560ba.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{58c15c42e6a618386a2f.js → 1c8c8050d60205cf2156.js} +1 -1
  56. package/assets/esri/core/workers/chunks/1f537c05c2f643acb5e7.js +1 -0
  57. package/assets/esri/core/workers/chunks/241aeff6afd074ce105b.js +1 -0
  58. package/assets/esri/core/workers/chunks/{ddebc1dc10a2d207389f.js → 282f3d364411efac7b80.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{d6d5ee9d0d998d730f81.js → 2bd334f9ab89334df713.js} +1 -1
  60. package/assets/esri/core/workers/chunks/340c68d09d2e8bef6727.js +2 -0
  61. package/assets/esri/core/workers/chunks/{17604cbd4d24158e2c16.js → 3835097520296b0517af.js} +1 -1
  62. package/assets/esri/core/workers/chunks/481dc7503587972a6bd2.js +2 -0
  63. package/assets/esri/core/workers/chunks/{9f4a9b193485f88d4461.js → 4afe76de6e82e86fe697.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{ac408c62565e2c8b5975.js → 4c5cdd2712c938fafc5d.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{ece30bfd5c49b8d99752.js → 5e5c7cc74ff1c9603aff.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{502c3da8c49bf885f51d.js → 63ea9035dcf9ce45560c.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{33ec193e6d7a0cb9d8dd.js → 6b66a6f69aa03338c346.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{56b6b68d9459b1edea43.js → 6c97b5bc408f051606d2.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{94eab215bab3e4e0e5b5.js → 711d1873c760313e287f.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{4e13d639419ac64f7563.js → 7c077e1a63ab97bf3e87.js} +1 -1
  71. package/assets/esri/core/workers/chunks/86f2de7dda7992ae706c.js +1 -0
  72. package/assets/esri/core/workers/chunks/{a29cd1f5c7bb4f6a5a4f.js → 8d4881c879c86b353e08.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{6e21675bbd7a44070771.js → 8ff83c59462dea6e3427.js} +1 -1
  74. package/assets/esri/core/workers/chunks/979bab62cad788180770.js +1 -0
  75. package/assets/esri/core/workers/chunks/9890c85a238879490926.js +1 -0
  76. package/assets/esri/core/workers/chunks/9ebc461529d5286fa2c2.js +2 -0
  77. package/assets/esri/core/workers/chunks/a95398214e530f896a2d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{fc1fe1f58a65a1694c09.js → b02a68bbab07557cf02d.js} +1 -1
  79. package/assets/esri/core/workers/chunks/ba31616de9d73d83d867.js +1 -0
  80. package/assets/esri/core/workers/chunks/c7662455252b48531da1.js +1 -0
  81. package/assets/esri/core/workers/chunks/ca92176d5348e2c533d7.js +1 -0
  82. package/assets/esri/core/workers/chunks/cd5206e19d86c60e3cf0.js +1 -0
  83. package/assets/esri/core/workers/chunks/{bfb417d72d0c90e116fe.js → cedf3e316d6f89cf7005.js} +1 -1
  84. package/assets/esri/core/workers/chunks/d02aa7438f46c1c2167a.js +2 -0
  85. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +1 -0
  86. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +1 -0
  87. package/assets/esri/core/workers/chunks/e0036fa0324a96a88248.js +1 -0
  88. package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js → e5854a3f69dffaf9464d.js} +2 -2
  89. package/assets/esri/core/workers/chunks/ed939fd5d3827a3f70e0.js +1 -0
  90. package/assets/esri/core/workers/chunks/fe8334352d256d691a95.js +1 -0
  91. package/assets/esri/themes/dark/main.css +1 -1
  92. package/assets/esri/themes/light/main.css +1 -1
  93. package/assets/esri/themes/light/view.css +1 -1
  94. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  95. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  96. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  99. package/chunks/aiServices.js +1 -1
  100. package/chunks/arcade.js +1 -1
  101. package/chunks/array.js +1 -1
  102. package/chunks/languageUtils.js +1 -1
  103. package/config.js +1 -1
  104. package/identity/IdentityModal.js +1 -1
  105. package/kernel.js +1 -1
  106. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  107. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  108. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  109. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  110. package/layers/support/SceneModification.js +1 -1
  111. package/layers/support/SceneModifications.js +1 -1
  112. package/layers/support/parquetUtils.js +1 -1
  113. package/package.json +2 -2
  114. package/renderers/ClassBreaksRenderer.js +1 -1
  115. package/renderers/UniqueValueRenderer.js +1 -1
  116. package/rest/support/TranslateContent.js +1 -1
  117. package/rest/support/TranslateParameters.js +1 -1
  118. package/rest/support/TranslateResult.js +1 -1
  119. package/rest/translate.js +1 -1
  120. package/rest/utils.js +1 -1
  121. package/support/arcadeUtils.js +1 -1
  122. package/support/revision.js +1 -1
  123. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  124. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  125. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  126. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  127. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  128. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  129. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  130. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  131. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  132. package/views/3d/state/utils/navigationUtils.js +1 -1
  133. package/views/3d/support/QualityProfile.js +1 -1
  134. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  135. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  136. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  137. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  138. package/views/3d/webgl-engine/lib/PathEvaluator.js +2 -0
  139. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  140. package/views/3d/webgl-engine/lib/PathFrame2D.js +2 -0
  141. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  142. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  143. package/views/3d/webgl-engine/lib/PathVertexInfo.js +2 -0
  144. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  145. package/views/DOMContainer.d.ts +2 -0
  146. package/views/LinkChartView.d.ts +47 -0
  147. package/views/MapView.d.ts +1 -85
  148. package/views/VideoView.d.ts +8 -1
  149. package/views/View2D.d.ts +78 -2
  150. package/views/draw/support/Reshape.js +1 -1
  151. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  152. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  153. package/views/types.d.ts +2 -3
  154. package/views/ui/DefaultUI.d.ts +1 -0
  155. package/widgets/Attachments.js +1 -1
  156. package/widgets/BasemapGallery.js +1 -1
  157. package/widgets/BasemapLayerList.js +1 -1
  158. package/widgets/BasemapToggle.js +1 -1
  159. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  160. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  161. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  162. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  163. package/widgets/BatchAttributeForm.js +1 -1
  164. package/widgets/Bookmarks.js +1 -1
  165. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  166. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  167. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  168. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  169. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  170. package/widgets/CatalogLayerList.js +1 -1
  171. package/widgets/Compass.js +1 -1
  172. package/widgets/CoordinateConversion.js +1 -1
  173. package/widgets/Daylight.js +1 -1
  174. package/widgets/DirectionalPad.js +1 -1
  175. package/widgets/Directions.js +1 -1
  176. package/widgets/Editor/components/FeatureList.js +1 -1
  177. package/widgets/Editor/components/FooterActions.js +1 -1
  178. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  179. package/widgets/Editor/components/Prompt.js +1 -1
  180. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  181. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  182. package/widgets/ElevationProfile.js +1 -1
  183. package/widgets/Expand.js +1 -1
  184. package/widgets/Feature/FeatureMedia.js +1 -1
  185. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  186. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  187. package/widgets/FeatureForm.js +1 -1
  188. package/widgets/FeatureTable.js +1 -1
  189. package/widgets/Features/FeaturesDrillIn.js +1 -1
  190. package/widgets/Features.js +1 -1
  191. package/widgets/FloorFilter.js +1 -1
  192. package/widgets/FovOverlay.js +1 -1
  193. package/widgets/Fullscreen.js +1 -1
  194. package/widgets/Home.js +1 -1
  195. package/widgets/LayerList/LayerListItem.js +1 -1
  196. package/widgets/LayerList.js +1 -1
  197. package/widgets/Locate.js +1 -1
  198. package/widgets/NavigationToggle.js +1 -1
  199. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  200. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  201. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  202. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  203. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  204. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  205. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  206. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  207. package/widgets/OrientedImageryViewer.js +1 -1
  208. package/widgets/PanoramicVideoViewer.js +1 -1
  209. package/widgets/Print.js +1 -1
  210. package/widgets/Search.js +1 -1
  211. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  212. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  213. package/widgets/Sketch.js +1 -1
  214. package/widgets/Slice.js +1 -1
  215. package/widgets/Slider.js +1 -1
  216. package/widgets/Swipe.js +1 -1
  217. package/widgets/TableList.js +1 -1
  218. package/widgets/TimeSlider.js +1 -1
  219. package/widgets/TimeZoneLabel.js +1 -1
  220. package/widgets/Track.js +1 -1
  221. package/widgets/UtilityNetworkAssociations.js +1 -1
  222. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  223. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  224. package/widgets/UtilityNetworkTrace.js +1 -1
  225. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  226. package/widgets/ValuePicker.js +1 -1
  227. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  228. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  229. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  230. package/widgets/Weather.js +1 -1
  231. package/widgets/Zoom.js +1 -1
  232. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  233. package/widgets/support/ColorPicker.js +1 -1
  234. package/widgets/support/ContingentValuesManager.js +1 -1
  235. package/widgets/support/FilterBuilder.js +1 -1
  236. package/widgets/support/GridControls.js +1 -1
  237. package/widgets/support/ItemList.js +1 -1
  238. package/widgets/support/LabeledSwitch.js +1 -1
  239. package/widgets/support/SelectionList.js +1 -1
  240. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +0 -2
  241. package/assets/esri/core/workers/chunks/286bf3be9f524bde9529.js +0 -1
  242. package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +0 -1
  243. package/assets/esri/core/workers/chunks/41a95ad470ec42ecd5a2.js +0 -1
  244. package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +0 -1
  245. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +0 -2
  246. package/assets/esri/core/workers/chunks/56d9d3f108ff6e719dd4.js +0 -1
  247. package/assets/esri/core/workers/chunks/5c44638670e40e092ce3.js +0 -1
  248. package/assets/esri/core/workers/chunks/63934843c9f4ef779a07.js +0 -1
  249. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +0 -2
  250. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +0 -1
  251. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +0 -1
  252. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +0 -1
  253. package/assets/esri/core/workers/chunks/9da2f2b67837b491cfa3.js +0 -1
  254. package/assets/esri/core/workers/chunks/a913a1c83a667ed0e711.js +0 -1
  255. package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +0 -2
  256. package/assets/esri/core/workers/chunks/bc249bb667f0564ad093.js +0 -1
  257. package/assets/esri/core/workers/chunks/c8b96104641cb4afd4df.js +0 -1
  258. package/assets/esri/core/workers/chunks/cdb48d198145493f76f3.js +0 -1
  259. package/assets/esri/core/workers/chunks/e2bb95d601789bbda73b.js +0 -1
  260. package/assets/esri/core/workers/chunks/f1bb426400dac02880f1.js +0 -1
  261. package/assets/esri/core/workers/chunks/f3f984c62311c20a9db8.js +0 -1
  262. /package/assets/esri/core/workers/chunks/{69c9eb93553b006b640d.js.LICENSE.txt → 340c68d09d2e8bef6727.js.LICENSE.txt} +0 -0
  263. /package/assets/esri/core/workers/chunks/{549d348ca181d06aefb7.js.LICENSE.txt → 481dc7503587972a6bd2.js.LICENSE.txt} +0 -0
  264. /package/assets/esri/core/workers/chunks/{1d1929f98d941179be29.js.LICENSE.txt → 9ebc461529d5286fa2c2.js.LICENSE.txt} +0 -0
  265. /package/assets/esri/core/workers/chunks/{b69d1d528e271568cbd8.js.LICENSE.txt → d02aa7438f46c1c2167a.js.LICENSE.txt} +0 -0
  266. /package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js.LICENSE.txt → e5854a3f69dffaf9464d.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"shadowDuration":"Total time in shadow: {duration}","sunlightDuration":"Total time in sunlight: {duration}"}
1
+ {"shadowDuration":"Total time in shadow: {duration}","sunlightDuration":"Total time in sunlight: {duration}","shadowDurationMoreThanUpTo":"Total time in shadow: {minDuration} - {maxDuration}","sunlightDurationLessThan":"Total time in sunlight: <{duration}","sunlightDurationAtLeastLessThan":"Total time in sunlight: {minDuration} - {maxDuration}"}
@@ -1 +1 @@
1
- {"shadowDuration":"الوقت الإجمالي في الظل: {duration}","sunlightDuration":"إجمالي الوقت في ضوء الشمس: {duration}"}
1
+ {"shadowDuration":"الوقت الإجمالي في الظل: {duration}","sunlightDuration":"إجمالي الوقت في ضوء الشمس: {duration}","shadowDurationMoreThanUpTo":"الوقت الإجمالي في الظل: {minDuration} - {maxDuration}","sunlightDurationLessThan":"إجمالي الوقت في ضوء الشمس: أقل من {duration}","sunlightDurationAtLeastLessThan":"إجمالي الوقت في ضوء الشمس: {minDuration} - {maxDuration}"}
@@ -1 +1 @@
1
- {"shadowDuration":"Total time in shadow: {duration}","sunlightDuration":"Total time in sunlight: {duration}"}
1
+ {"shadowDuration":"Total time in shadow: {duration}","sunlightDuration":"Total time in sunlight: {duration}","shadowDurationMoreThanUpTo":"Total time in shadow: {minDuration} - {maxDuration}","sunlightDurationLessThan":"Total time in sunlight: <{duration}","sunlightDurationAtLeastLessThan":"Total time in sunlight: {minDuration} - {maxDuration}"}
@@ -1 +1 @@
1
- {"attachments":{"addFile":"Add file","attachmentNumberedLabel":"Attachment {index}","attach":"Attach","attachmentsEditingDisabled":"Attachments editing is disabled.","attachmentsLimitReached":"Attachments limit reached","attachmentMustBeShorterThan":"Attachment must be shorter than {maxDuration}","attachmentsMustBeShorterThan":"Attachments must be shorter than {maxDuration}","attachmentMustBeSmallerThan":"Attachment must be smaller than {maxSize}","attachmentsMustBeSmallerThan":"Attachments must be smaller than {maxSize}","durationInSecond":"{count} second","durationInSeconds":"{count} seconds","capture":"Capture","captureMethodNotSupported":"Capture method is not supported","count":"Count: {count}","deleted":"Deleted","download":"Download","dragAndDropFile":"Drag and drop file.","fileExceedsMaximumSize":"File exceeds the maximum size","fileName":"File name","fileSelected":"File selected","fileToBeReplaced":"File to be replaced","imageResizedToMeetRequirements":"Image has been resized to meet requirements","maximize":"Maximize","maximumNumberReachedRemoveToContinue":"Maximum number reached. Remove attachments to continue.","maxAttachments":"Maximum attachments: {count}","noAttachments":"No attachments","noPreviewAvailable":"No preview available","remove":"Remove","replace":"Replace","searchAttachments":"Search attachments","replaceFile":"Replace file","selectFile":"Select file","size":"Size","type":"Type","unableToAddAttachment":"Unable to add attachment","unableToAddAttachments":"Unable to add attachments","unsupportedDevice":"Unsupported device","unsupportedDeviceCaptureMessage":"This device does not support the required capture method.","viewAll":"View all","youCanAddUpToOneAttachment":"You can add up to 1 attachment","youCanAddUpToAttachments":"You can add up to {count} attachments"},"unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","otherOptionLabel":"Other","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","footerButtons":{"add":"Add","delete":"Delete","discard":"Discard","done":"Done","replace":"Replace","reset":"Reset","update":"Update"},"footerNotices":{"deleteDisabledMinimumAttachments":"Delete disabled. This feature requires a minimum number of attachments."},"formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","deselectAllLabel":"Deselect all","selectAllLabel":"Select all","showAllOptions":"Show all options","titles":{"addAttachments":"Add attachments","attachments":"Attachments","editFeature":"Edit feature","editFeatures":"Edit features","editAttachment":"Edit attachment","replaceAttachment":"Replace attachment"},"unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooFewSelectedChoices":"Select at least {min} of the options","tooManySelectedChoices":"Select no more than {max} of the options","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
1
+ {"attachments":{"addFile":"Add file","attachmentNumberedLabel":"Attachment {index}","attach":"Attach","attachmentsEditingDisabled":"Attachments editing is disabled.","attachmentsLimitReached":"Attachments limit reached","attachmentMustBeShorterThan":"Attachment must be shorter than {maxDuration}","attachmentsMustBeShorterThan":"Attachments must be shorter than {maxDuration}","attachmentMustBeSmallerThan":"Attachment must be smaller than {maxSize}","attachmentsMustBeSmallerThan":"Attachments must be smaller than {maxSize}","durationInSecond":"{count} second","durationInSeconds":"{count} seconds","capture":"Capture","captureMethodNotSupported":"Capture method is not supported","count":"Count: {count}","deleted":"Deleted","download":"Download","dragAndDropFile":"Drag and drop file.","fileExceedsMaximumSize":"File exceeds the maximum size","fileName":"File name","fileSelected":"File selected","fileToBeReplaced":"File to be replaced","imageResizedToMeetRequirements":"Image has been resized to meet requirements","maximize":"Maximize","maximumNumberReachedRemoveToContinue":"Maximum number reached. Remove attachments to continue.","maxAttachments":"Maximum attachments: {count}","noAttachments":"No attachments","noPreviewAvailable":"No preview available","remove":"Remove","replace":"Replace","searchAttachments":"Search attachments","replaceFile":"Replace file","selectFile":"Select file","size":"Size","type":"Type","unableToAddAttachment":"Unable to add attachment","unableToAddAttachments":"Unable to add attachments","unsupportedDevice":"Unsupported device","unsupportedDeviceCaptureMessage":"This device does not support the required capture method.","viewAll":"View all","youCanAddUpToOneAttachment":"You can add up to 1 attachment","youCanAddUpToAttachments":"You can add up to {count} attachments"},"unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","otherOptionLabel":"Other","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","footerButtons":{"add":"Add","delete":"Delete","discard":"Discard","done":"Done","replace":"Replace","reset":"Reset","update":"Update"},"footerNotices":{"deleteDisabledMinimumAttachments":"Delete disabled. This feature requires a minimum number of attachments."},"formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"other":"Other","recommended":"Recommended","requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","deselectAllLabel":"Deselect all","selectAllLabel":"Select all","showAllOptions":"Show all options","titles":{"addAttachments":"Add attachments","attachments":"Attachments","editFeature":"Edit feature","editFeatures":"Edit features","editAttachment":"Edit attachment","replaceAttachment":"Replace attachment"},"unsupported":"Unsupported","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooFewSelectedChoices":"Select at least {min} of the options","tooManySelectedChoices":"Select no more than {max} of the options","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
@@ -1 +1 @@
1
- {"attachments":{"addFile":"Add file","attachmentNumberedLabel":"Attachment {index}","attach":"Attach","attachmentsEditingDisabled":"Attachments editing is disabled.","attachmentsLimitReached":"Attachments limit reached","attachmentMustBeShorterThan":"Attachment must be shorter than {maxDuration}","attachmentsMustBeShorterThan":"Attachments must be shorter than {maxDuration}","attachmentMustBeSmallerThan":"Attachment must be smaller than {maxSize}","attachmentsMustBeSmallerThan":"Attachments must be smaller than {maxSize}","durationInSecond":"{count} second","durationInSeconds":"{count} seconds","capture":"Capture","captureMethodNotSupported":"Capture method is not supported","count":"Count: {count}","deleted":"Deleted","download":"Download","dragAndDropFile":"Drag and drop file.","fileExceedsMaximumSize":"File exceeds the maximum size","fileName":"File name","fileSelected":"File selected","fileToBeReplaced":"File to be replaced","imageResizedToMeetRequirements":"Image has been resized to meet requirements","maximize":"Maximize","maximumNumberReachedRemoveToContinue":"Maximum number reached. Remove attachments to continue.","maxAttachments":"Maximum attachments: {count}","noAttachments":"No attachments","noPreviewAvailable":"No preview available","remove":"Remove","replace":"Replace","searchAttachments":"Search attachments","replaceFile":"Replace file","selectFile":"Select file","size":"Size","type":"Type","unableToAddAttachment":"Unable to add attachment","unableToAddAttachments":"Unable to add attachments","unsupportedDevice":"Unsupported device","unsupportedDeviceCaptureMessage":"This device does not support the required capture method.","viewAll":"View all","youCanAddUpToOneAttachment":"You can add up to 1 attachment","youCanAddUpToAttachments":"You can add up to {count} attachments"},"unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","otherOptionLabel":"Other","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","footerButtons":{"add":"Add","delete":"Delete","discard":"Discard","done":"Done","replace":"Replace","reset":"Reset","update":"Update"},"footerNotices":{"deleteDisabledMinimumAttachments":"Delete disabled. This feature requires a minimum number of attachments."},"formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","deselectAllLabel":"Deselect all","selectAllLabel":"Select all","showAllOptions":"Show all options","titles":{"addAttachments":"Add attachments","attachments":"Attachments","editFeature":"Edit feature","editFeatures":"Edit features","editAttachment":"Edit attachment","replaceAttachment":"Replace attachment"},"unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooFewSelectedChoices":"Select at least {min} of the options","tooManySelectedChoices":"Select no more than {max} of the options","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
1
+ {"attachments":{"addFile":"Add file","attachmentNumberedLabel":"Attachment {index}","attach":"Attach","attachmentsEditingDisabled":"Attachments editing is disabled.","attachmentsLimitReached":"Attachments limit reached","attachmentMustBeShorterThan":"Attachment must be shorter than {maxDuration}","attachmentsMustBeShorterThan":"Attachments must be shorter than {maxDuration}","attachmentMustBeSmallerThan":"Attachment must be smaller than {maxSize}","attachmentsMustBeSmallerThan":"Attachments must be smaller than {maxSize}","durationInSecond":"{count} second","durationInSeconds":"{count} seconds","capture":"Capture","captureMethodNotSupported":"Capture method is not supported","count":"Count: {count}","deleted":"Deleted","download":"Download","dragAndDropFile":"Drag and drop file.","fileExceedsMaximumSize":"File exceeds the maximum size","fileName":"File name","fileSelected":"File selected","fileToBeReplaced":"File to be replaced","imageResizedToMeetRequirements":"Image has been resized to meet requirements","maximize":"Maximize","maximumNumberReachedRemoveToContinue":"Maximum number reached. Remove attachments to continue.","maxAttachments":"Maximum attachments: {count}","noAttachments":"No attachments","noPreviewAvailable":"No preview available","remove":"Remove","replace":"Replace","searchAttachments":"Search attachments","replaceFile":"Replace file","selectFile":"Select file","size":"Size","type":"Type","unableToAddAttachment":"Unable to add attachment","unableToAddAttachments":"Unable to add attachments","unsupportedDevice":"Unsupported device","unsupportedDeviceCaptureMessage":"This device does not support the required capture method.","viewAll":"View all","youCanAddUpToOneAttachment":"You can add up to 1 attachment","youCanAddUpToAttachments":"You can add up to {count} attachments"},"unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","otherOptionLabel":"Other","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","footerButtons":{"add":"Add","delete":"Delete","discard":"Discard","done":"Done","replace":"Replace","reset":"Reset","update":"Update"},"footerNotices":{"deleteDisabledMinimumAttachments":"Delete disabled. This feature requires a minimum number of attachments."},"formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"other":"Other","recommended":"Recommended","requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","deselectAllLabel":"Deselect all","selectAllLabel":"Select all","showAllOptions":"Show all options","titles":{"addAttachments":"Add attachments","attachments":"Attachments","editFeature":"Edit feature","editFeatures":"Edit features","editAttachment":"Edit attachment","replaceAttachment":"Replace attachment"},"unsupported":"Unsupported","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooFewSelectedChoices":"Select at least {min} of the options","tooManySelectedChoices":"Select no more than {max} of the options","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{toSymbolId as t}from"../arcade/arcadeEnvironment.js";import e from"../arcade/Dictionary.js";import{ArcadeExecutionError as s}from"../arcade/executionError.js";import{a3 as r,P as n,ac as o}from"./languageUtils.js";import{getDefaultPortal as a}from"../arcade/portalUtils.js";import i from"../core/Error.js";import c from"../core/Logger.js";import{getOrCreateMapValue as l}from"../core/MapUtils.js";import{translate as u}from"../rest/translate.js";import h from"../rest/support/TranslateContent.js";import m from"../rest/support/TranslateParameters.js";import f from"../rest/support/TranslateResult.js";import{isString as p,isArray as d}from"../support/guards.js";class _{constructor(t,e){this.portal=t,this._debugLog=e}async translate(t){this.portal.loaded||await this.portal.load();const e=this.portal.helperServices?.aiUtilityServices;if(null==e)return{success:!1};const s=e.url+e.translateUtility;try{t.requestSource??="arcade";return{success:!0,results:(await u(s,t,{authMode:"no-prompt"})).map(t=>t.toJSON())}}catch(r){return null!=this._debugLog&&(r instanceof Error||r instanceof i)&&this._debugLog(`TranslateText error: ${r.message}`),c.getLogger("esri.arcade.functions.aiServices").error(r),{success:!1}}}}class g{constructor(t,e,s){this._parameters=t,this._maxTotalContentSize=e,this._maxContentsLength=s,this._requests=[],this._normalizedContents=new Map,this._contentsTotalSize=0}tryAdd(t){const e=new Set(t.filter(t=>!this._normalizedContents.has(t.text)).map(t=>t.text));if(this._requests.length+e.size>this._maxContentsLength)return null;let s=0;for(const n of e)s+=n.length;if((s+this._contentsTotalSize)*(this._parameters.to.length??1)>this._maxTotalContentSize)return null;const r=this._requests.length;for(const{key:n,text:o}of t)l(this._normalizedContents,o,()=>[]).push({batchIdx:r,key:n});return this._requests.push(t),this._contentsTotalSize+=s,r}async send(t){const e=[],s=[];let r=0;for(const[i,c]of this._normalizedContents)e.push(new h({key:String(r++),text:i})),s.push(c);const n=new m(this._parameters);n.contents=e;const o=await t.translate(n);if(!o.success)return Array.from(this._requests,()=>o);const a=Array.from(this._requests,()=>({success:!0,results:[]}));for(const i of o.results){const t=Number(i.key);for(const e of s[t])a[e.batchIdx].results.push({...i,key:e.key})}return a}}function y(t){const e=[...new Set(t.to)].sort(),s=t.from??null,r=t.portalUrl,n=t.translator,o=t.apiKey??null;return JSON.stringify([e,s,r,n,o])}async function w(t,e,s){try{return(await t.yieldFor(s))[e]}catch{return{success:!1}}}class x{constructor(t,e,{maxTotalContentSize:s=5e4,maxContentsLength:r=1e3}={}){this._executor=t,this._service=e,this._openBatches=new Map,this._maxTotalContentSize=s,this._maxContentsLength=r}create(t){return{translate:async e=>{const s=y(e),{contents:r,to:n,from:o,translator:a,portalUrl:i,apiKey:c}=e;if(null==n)return{success:!1};if(null==r||r.every(t=>0===t.text.length))return{success:!1};const l=this._openBatches.get(s);if(null!=l){const e=l.data.tryAdd(r);if(null!=e)return await w(t,e,l);l.send()}const u=new g({to:n,from:o,translator:a,portalUrl:i,apiKey:c},this._maxTotalContentSize,this._maxContentsLength),h=u.tryAdd(r);if(null!=h){const e=this._executor.openBatch(u,{open:t=>{this._openBatches.set(s,t)},execute:t=>t.send(this._service),close:t=>{this._openBatches.get(s)===t&&this._openBatches.delete(s)}});return await w(t,h,e)}return await this._service.translate(e)}}}}function S(i){"async"===i.mode&&(i.functions[t("TranslateText")]=function(t,c){return i.standardFunctionAsync(t,c,async(t,i,c)=>{if(r(c,2,3,t,i),!p(c[0])&&!d(c[0])&&!n(c[0]))throw new s(t,"InvalidParameter",i);const l=o(c[0]);if(!p(c[1])&&!d(c[1])&&!n(c[1]))throw new s(t,"InvalidParameter",i);const u=o(c[1]);let g=null;if(c.length>=3){if(!p(c[2]))throw new s(t,"InvalidParameter",i);g=c[2]}const w=l.map((t,e)=>new h({key:String(e),text:t})),x=a(t),S=new m({to:u,contents:w,from:g,portalUrl:x.restUrl.replace(/\/sharing\/rest$/,"")}),T=new Map;let v=null;if(null!=t.lrucache){const e=t.lrucache;v??=y(S),S.contents=S.contents?.filter(t=>{const s=e.getCachedTranslation(v,t.text);return null==s||(T.set(t.key,{...s,key:t.key,text:t.text}),!1)})}if(S.contents?.length){const r=t.services?.translation??new _(x,t.console),n=await r.translate(S);if(!n.success)return new e({__proto__:null,success:!1});for(const e of n.results){const r=S.contents?.find(t=>t.key===e.key)?.text;if(null==r)throw new s(null,"NeverReach",null);T.set(e.key,e),null!=t.lrucache&&(v??=y(S),t.lrucache.setCachedTranslation(v,r,{detectedLanguage:e.detectedLanguage,translation:e.translation}))}}const C=Array.from(w,r=>{const n=f.fromJSON(T.get(r.key));if(null==n)throw new s(null,"NeverReach",null);return n.text=r.text,e.convertJsonToArcade(n.toJSON(),t.timeZone??"system",!0)});return new e({__proto__:null,success:!0,results:C})})})}const T=Object.freeze(Object.defineProperty({__proto__:null,BatchTranslationServiceFactory:x,PortalTranslationService:_,getTranslateParametersKey:y,registerFunctions:S},Symbol.toStringTag,{value:"Module"}));export{T as A,x as B,_ as P,y as g,S as r};
2
+ import{toSymbolId as t}from"../arcade/arcadeEnvironment.js";import e from"../arcade/Dictionary.js";import{ArcadeExecutionError as r}from"../arcade/executionError.js";import{a3 as s,P as n,ac as o}from"./languageUtils.js";import{getDefaultPortal as a}from"../arcade/portalUtils.js";import i from"../core/Error.js";import u from"../core/Logger.js";import{getOrCreateMapValue as l}from"../core/MapUtils.js";import{translate as c}from"../rest/translate.js";import{TranslateContent as h}from"../rest/support/TranslateContent.js";import{TranslateParameters as p}from"../rest/support/TranslateParameters.js";import{TranslateResult as f}from"../rest/support/TranslateResult.js";import{isString as m,isArray as _}from"../support/guards.js";class d{constructor(t,e){this.portal=t,this._debugLog=e}async translate(t){this.portal.loaded||await this.portal.load();const e=this.portal.helperServices?.aiUtilityServices;if(null==e)return{success:!1};const r=e.api?.text_translate;if(null==r)return{success:!1};const s=e.url+r;try{t.requestSource??="arcade";return{success:!0,results:(await c(s,t,{authMode:"no-prompt"})).map(t=>t.toJSON())}}catch(n){return null!=this._debugLog&&(n instanceof Error||n instanceof i)&&this._debugLog(`TranslateText error: ${n.message}`),u.getLogger("esri.arcade.functions.aiServices").error(n),{success:!1}}}}class g{constructor(t,e,r){this._parameters=t,this._maxTotalContentSize=e,this._maxContentsLength=r,this._requests=[],this._normalizedContents=new Map,this._contentsTotalSize=0}tryAdd(t){const e=new Set(t.filter(t=>!this._normalizedContents.has(t.text)).map(t=>t.text));if(this._requests.length+e.size>this._maxContentsLength)return null;let r=0;for(const n of e)r+=n.length;if((r+this._contentsTotalSize)*(this._parameters.outputCultures.length??1)>this._maxTotalContentSize)return null;const s=this._requests.length;for(const{key:n,text:o}of t)l(this._normalizedContents,o,()=>[]).push({batchIdx:s,key:n});return this._requests.push(t),this._contentsTotalSize+=r,s}async send(t){const e=[],r=[];let s=0;for(const[i,u]of this._normalizedContents)e.push(new h({key:String(s++),text:i})),r.push(u);const n=new p(this._parameters);n.input=e;const o=await t.translate(n);if(!o.success)return Array.from(this._requests,()=>o);const a=Array.from(this._requests,()=>({success:!0,results:[]}));for(const i of o.results){const t=Number(i.key);for(const e of r[t])a[e.batchIdx].results.push({...i,key:e.key})}return a}}function y(t){const e=[...new Set(t.outputCultures)].sort(),r=t.inputCulture??null,s=t.portalUrl,n=t.provider;return JSON.stringify([e,r,s,n])}async function w(t,e,r){try{return(await t.yieldFor(r))[e]}catch{return{success:!1}}}class x{constructor(t,e,{maxTotalContentSize:r=5e4,maxContentsLength:s=1e3}={}){this._executor=t,this._service=e,this._openBatches=new Map,this._maxTotalContentSize=r,this._maxContentsLength=s}create(t){return{translate:async e=>{const r=y(e),{input:s,outputCultures:n,inputCulture:o,provider:a,portalUrl:i}=e;if(null==n)return{success:!1};if(null==s||s.every(t=>0===t.text.length))return{success:!1};const u=this._openBatches.get(r);if(null!=u){const e=u.data.tryAdd(s);if(null!=e)return await w(t,e,u);u.send()}const l=new g({outputCultures:n,inputCulture:o,provider:a,portalUrl:i},this._maxTotalContentSize,this._maxContentsLength),c=l.tryAdd(s);if(null!=c){const e=this._executor.openBatch(l,{open:t=>{this._openBatches.set(r,t)},execute:t=>t.send(this._service),close:t=>{this._openBatches.get(r)===t&&this._openBatches.delete(r)}});return await w(t,c,e)}return await this._service.translate(e)}}}}function C(i){"async"===i.mode&&(i.functions[t("TranslateText")]=function(t,u){return i.standardFunctionAsync(t,u,async(t,i,u)=>{if(s(u,2,3,i),!m(u[0])&&!_(u[0])&&!n(u[0]))throw new r("InvalidParameter",i);const l=o(u[0]);if(!m(u[1])&&!_(u[1])&&!n(u[1]))throw new r("InvalidParameter",i);const c=o(u[1]);let g=null;if(u.length>=3){if(!m(u[2]))throw new r("InvalidParameter",i);g=u[2]}const w=l.map((t,e)=>new h({key:String(e),text:t})),x=a(t),C=new p({outputCultures:c,input:w,inputCulture:g,portalUrl:x.restUrl.replace(/\/sharing\/rest$/,"")}),S=new Map;let T;if(null!=t.lrucache){const e=t.lrucache;T??=y(C),C.input=C.input?.filter(t=>{const r=e.getCachedTranslation(T,t.text);return null==r||(S.set(t.key,{...r,key:t.key}),!1)})}if(C.input?.length){const s=t.services?.translation??new d(x,t.console),n=await s.translate(C);if(!n.success)return new e({__proto__:null,success:!1});for(const e of n.results){const s=C.input?.find(t=>t.key===e.key)?.text;if(null==s)throw new r("NeverReach",null);S.set(e.key,e),null!=t.lrucache&&(T??=y(C),t.lrucache.setCachedTranslation(T,s,{detectedLanguage:e.detectedLanguage,translations:e.translations}))}}const v=Array.from(w,t=>{const s=f.fromJSON(S.get(t.key));if(null==s)throw new r("NeverReach",null);const n=Object.create(null);for(const e of s.translations)n[e.to]=e.text;return new e({__proto__:null,key:s.key,text:t.text,detectedLanguage:new e({__proto__:null,language:s.detectedLanguage,score:s.detectedLanguageScore}),translation:new e(n)})});return new e({__proto__:null,success:!0,results:v})})})}const S=Object.freeze(Object.defineProperty({__proto__:null,BatchTranslationServiceFactory:x,PortalTranslationService:d,getTranslateParametersKey:y,registerFunctions:C},Symbol.toStringTag,{value:"Module"}));export{S as A,x as B,d as P,y as g,C as r};
package/chunks/arcade.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{compileScript as e,enableAsyncSupport as r,extend as t}from"../arcade/arcadeCompiler.js";import{toSymbolId as n}from"../arcade/arcadeEnvironment.js";import{ArcadeModuleResolver as s}from"../arcade/ArcadeModuleResolver.js";import{prepareScript as a,executeScript as o,extend as c}from"../arcade/arcadeRuntime.js";import{ArcadeExecutionError as i}from"../arcade/executionError.js";import{parseScript as u}from"../arcade/parser.js";import{findExpectedFieldLiterals as l,findLiteralMemberAccesses as p,findModuleImports as d,referencesFunction as f,referencesMember as m,findScriptDependencies as y,findFunctionCalls as S}from"../arcade/treeAnalysis.js";import{loadOperators as w}from"../arcade/functions/geomsync.js";import{loadOperators as b}from"../arcade/functions/track.js";import has from"../core/has.js";import{assertIsSome as A}from"../core/maybe.js";const h=new Set(["feature","angle","bearing","centroid","envelopeintersects","extent","geometry","ringisclockwise","trackgeometrywindow"]),k=new Set(["TrackAccelerationAt","TrackAccelerationWindow","TrackCurrentAcceleration","TrackCurrentDistance","TrackCurrentSpeed","TrackDistanceAt","TrackDistanceWindow","TrackSpeedAt","TrackSpeedWindow"].map(e=>n(e))),T=new Set([...k,"TrackCurrentTime","TrackDuration","TrackFieldWindow","TrackGeometryWindow","TrackIndex","TrackStartTime","TrackWindow"].map(e=>n(e)));let j=!1,g=!1,x=null,v=[],F=!1;function M(r,t){if(!0===t.useAsync||!0===r.isAsync||null!=t.breakpoints)return G(r,t);if(has("esri-csp-restrictions"))return a(r,t);try{return e(r,t)}catch(n){if("esri.arcade.arcadeuncompilableerror"===n.declaredRootClass)return a(r,t);throw n}}function G(r,t){if(null===x)throw new i(null,"AsyncNotEnabled",null);if(null!=t.breakpoints||has("esri-csp-restrictions"))return x.prepareScript(r,t);try{return e(r,t,!0)}catch(n){if("esri.arcade.arcadeuncompilableerror"===n.declaredRootClass)return x.prepareScript(r,t);throw n}}function C(e){c(e),t(e,"sync"),null===x?v.push(e):(t(e,"async"),x.extend(e))}function E(e,r=[]){return u(e,r)}function I(e,r,t=[]){return D(u(e,t),r)}function D(e,r){if(!0===r.useAsync||!0===e.isAsync){if(null===x)throw new i(null,"AsyncNotEnabled",null);return x.executeScript(e,r)}return o(e,r)}function U(e,r){return m(e,r)}function W(e,r){return f(e,r)}function _(e,r=!1){return void 0===r&&(r=!1),p(e).map(({varId:e,memberId:r})=>`${e}.${r}`)}function R(e){return l(e)}function O(e,r=[]){return void 0===e.usesGeometry&&y(e,r),!0===e.usesGeometry}let P=null;function z(){return P||(P=L(),P)}async function L(){return await w(),g=!0,!0}let $=null;function N(){return null!==$||($=q()),$}async function q(){await r(),x=await import("../arcade/arcadeAsyncRuntime.js");for(const e of v)x.extend(e),t(e,"async");return v=null,!0}function B(){return j}function V(){return!!x}function H(){return g}let J,K=null;function Q(){return K||(K=X(),K)}async function X(){await N();const[e,r,n,s,a,o]=await Promise.all([import("../arcade/featureSetUtils.js"),import("../arcade/functions/featuresetbase.js"),import("../arcade/functions/featuresetgeom.js"),import("../arcade/functions/featuresetstats.js"),import("../arcade/functions/featuresetstring.js"),import("../arcade/functions/knowledgegraph.js")]);return ie=e,x.extend([r,n,s,a,o]),t([r,n,s,a,o],"async"),j=!0,!0}function Y(){return J??=b().then(()=>{F=!0})}function Z(e,r=[]){return void 0===e.usesFeatureSet&&y(e,r),!0===e.usesFeatureSet}function ee(e,r=[]){return void 0===e.isAsync&&y(e,r),!0===e.isAsync}function re(e,r){if(r){for(const t of r)if(U(e,t))return!0;return!1}return!1}async function te(e,r,t=[],n=!1,s=null){return ne(new Set,e,r,t,n,s)}async function ne(e,r,t,n=[],s=!1,a=null){const o="string"==typeof r?E(r):r,c=[];return o&&(!1===H()&&(O(o)||s)&&c.push(z()),!1===V()&&(!0===o.isAsync||t)&&c.push(N()),!1===B()&&(Z(o)||re(o,n))&&c.push(Q()),F||le(o)&&c.push(Y())),c.length&&await Promise.all(c),await ae(e,o,a,t,s),!0}function se(e,r=[]){return void 0===e.usesModules&&y(e,r),!0===e.usesModules}async function ae(e,r,t=null,n=!1,a=!1){const o=d(r);null===t&&o.length>0&&(t=s.getDefault()),r.loadedModules={};for(const s of o){A(t);const o=t.normalizeModuleUri(s.source);if(e.has(o.uri))throw new i(null,"CircularModules",null);e.add(o.uri);const c=await t.fetchModule(o);await ne(e,c,n,[],a,t),e.delete(o.uri),c.isAsync&&(r.isAsync=!0),c.usesFeatureSet&&(r.usesFeatureSet=!0),c.usesGeometry&&(r.usesGeometry=!0),r.loadedModules[s.libname]={uri:o.uri,script:c}}}function oe(e){if(O(e))return!0;const r=S(e);let t=!1;for(let n=0;n<r.length;n++)if(h.has(r[n])){t=!0;break}return t}function ce(e,r){const t=null==r?null:new Set(r.map(e=>e.toLowerCase()));return p(e).some(({varId:e,memberId:r})=>"$view"===e&&(null==t||t.has(r)))}let ie=null;function ue(){return ie}function le(e){return S(e).some(e=>k.has(e))}function pe(e){return S(e).some(e=>T.has(e))}const de=Object.freeze(Object.defineProperty({__proto__:null,_loadScriptDependenciesImpl:ne,compileScript:M,enableAsyncSupport:N,enableAsyncSupportImpl:q,enableFeatureSetSupport:Q,enableFeatureSetSupportImpl:X,enableGeometrySupport:z,enableGeometrySupportImpl:L,executeScript:D,extend:C,extractExpectedFieldLiterals:R,extractFieldLiterals:_,featureSetUtils:ue,isAsyncEnabled:V,isFeatureSetSupportEnabled:B,isGeometryEnabled:H,loadDependentModules:ae,loadScriptDependencies:te,loadTrackGeometryOperators:Y,parseAndExecuteScript:I,parseScript:E,referencesFunction:W,referencesMember:U,scriptIsAsync:ee,scriptTouchesGeometry:oe,scriptUsesFeatureSet:Z,scriptUsesGeometryEngine:O,scriptUsesModules:se,scriptUsesTrack:pe,scriptUsesViewProperties:ce},Symbol.toStringTag,{value:"Module"}));export{O as A,se as B,pe as C,ce as D,ne as _,de as a,q as b,M as c,Q as d,N as e,X as f,z as g,L as h,D as i,C as j,R as k,_ as l,ue as m,V as n,B as o,H as p,ae as q,te as r,Y as s,I as t,E as u,W as v,U as w,ee as x,oe as y,Z as z};
2
+ import{compileScript as e,enableAsyncSupport as r,extend as t}from"../arcade/arcadeCompiler.js";import{toSymbolId as n}from"../arcade/arcadeEnvironment.js";import{ArcadeModuleResolver as s}from"../arcade/ArcadeModuleResolver.js";import{prepareScript as a,executeScript as o,extend as c}from"../arcade/arcadeRuntime.js";import{wrapDebugValue as i}from"../arcade/debug.js";import{ArcadeExecutionError as u}from"../arcade/executionError.js";import{parseScript as l}from"../arcade/parser.js";import{findExpectedFieldLiterals as p,findLiteralMemberAccesses as d,findModuleImports as f,referencesFunction as m,referencesMember as y,findScriptDependencies as S,findFunctionCalls as w}from"../arcade/treeAnalysis.js";import{loadOperators as b}from"../arcade/functions/geomsync.js";import{loadOperators as A}from"../arcade/functions/track.js";import has from"../core/has.js";import{assertIsSome as h}from"../core/maybe.js";const k=new Set(["feature","angle","bearing","centroid","envelopeintersects","extent","geometry","ringisclockwise","trackgeometrywindow"]),T=new Set(["TrackAccelerationAt","TrackAccelerationWindow","TrackCurrentAcceleration","TrackCurrentDistance","TrackCurrentSpeed","TrackDistanceAt","TrackDistanceWindow","TrackSpeedAt","TrackSpeedWindow"].map(e=>n(e))),j=new Set([...T,"TrackCurrentTime","TrackDuration","TrackFieldWindow","TrackGeometryWindow","TrackIndex","TrackStartTime","TrackWindow"].map(e=>n(e)));let g=!1,x=!1,v=null,F=[],M=!1;function E(r,t){if(!0===t.useAsync||!0===r.isAsync||null!=t.breakpoints)return C(r,t);if(has("esri-csp-restrictions"))return a(r,t);try{return e(r,t)}catch(n){if("esri.arcade.arcadeuncompilableerror"===n.declaredRootClass)return a(r,t);throw n}}function G(e,r){if(!0===r.useAsync||!0===e.isAsync||null!=r.breakpoints){if(null==v)throw new u("AsyncNotEnabled",null);const t=v.prepareScript(e,r);return async e=>i(await t(e),{defaultTimeZone:e.timeZone??"system"})}const t=a(e,r);return e=>i(t(e),{defaultTimeZone:e.timeZone??"system"})}function C(r,t){if(null===v)throw new u("AsyncNotEnabled",null);if(null!=t.breakpoints||has("esri-csp-restrictions"))return v.prepareScript(r,t);try{return e(r,t,!0)}catch(n){if("esri.arcade.arcadeuncompilableerror"===n.declaredRootClass)return v.prepareScript(r,t);throw n}}function D(e){c(e),t(e,"sync"),null===v?F.push(e):(t(e,"async"),v.extend(e))}function I(e,r=[]){return l(e,r)}function U(e,r,t=[]){return W(l(e,t),r)}function W(e,r){if(!0===r.useAsync||!0===e.isAsync){if(null===v)throw new u("AsyncNotEnabled",null);return v.executeScript(e,r)}return o(e,r)}function _(e,r){return y(e,r)}function R(e,r){return m(e,r)}function O(e,r=!1){return void 0===r&&(r=!1),d(e).map(({varId:e,memberId:r})=>`${e}.${r}`)}function P(e){return p(e)}function Z(e,r=[]){return void 0===e.usesGeometry&&S(e,r),!0===e.usesGeometry}let z=null;function L(){return z||(z=N(),z)}async function N(){return await b(),x=!0,!0}let $=null;function q(){return null!==$||($=B()),$}async function B(){await r(),v=await import("../arcade/arcadeAsyncRuntime.js");for(const e of F)v.extend(e),t(e,"async");return F=null,!0}function V(){return g}function H(){return!!v}function J(){return x}let K,Q=null;function X(){return Q||(Q=Y(),Q)}async function Y(){await q();const[e,r,n,s,a,o]=await Promise.all([import("../arcade/featureSetUtils.js"),import("../arcade/functions/featuresetbase.js"),import("../arcade/functions/featuresetgeom.js"),import("../arcade/functions/featuresetstats.js"),import("../arcade/functions/featuresetstring.js"),import("../arcade/functions/knowledgegraph.js")]);return le=e,v.extend([r,n,s,a,o]),t([r,n,s,a,o],"async"),g=!0,!0}function ee(){return K??=A().then(()=>{M=!0})}function re(e,r=[]){return void 0===e.usesFeatureSet&&S(e,r),!0===e.usesFeatureSet}function te(e,r=[]){return void 0===e.isAsync&&S(e,r),!0===e.isAsync}function ne(e,r){if(r){for(const t of r)if(_(e,t))return!0;return!1}return!1}async function se(e,r,t=[],n=!1,s=null){return ae(new Set,e,r,t,n,s)}async function ae(e,r,t,n=[],s=!1,a=null){const o="string"==typeof r?I(r):r,c=[];return o&&(!1===J()&&(Z(o)||s)&&c.push(L()),!1===H()&&(!0===o.isAsync||t)&&c.push(q()),!1===V()&&(re(o)||ne(o,n))&&c.push(X()),M||de(o)&&c.push(ee())),c.length&&await Promise.all(c),await ce(e,o,a,t,s),!0}function oe(e,r=[]){return void 0===e.usesModules&&S(e,r),!0===e.usesModules}async function ce(e,r,t=null,n=!1,a=!1){const o=f(r);null===t&&o.length>0&&(t=s.getDefault()),r.loadedModules={};for(const s of o){h(t);const o=t.normalizeModuleUri(s.source);if(e.has(o.uri))throw new u("CircularModules",null);e.add(o.uri);const c=await t.fetchModule(o);await ae(e,c,n,[],a,t),e.delete(o.uri),c.isAsync&&(r.isAsync=!0),c.usesFeatureSet&&(r.usesFeatureSet=!0),c.usesGeometry&&(r.usesGeometry=!0),r.loadedModules[s.libname]={uri:o.uri,script:c}}}function ie(e){if(Z(e))return!0;const r=w(e);let t=!1;for(let n=0;n<r.length;n++)if(k.has(r[n])){t=!0;break}return t}function ue(e,r){const t=null==r?null:new Set(r.map(e=>e.toLowerCase()));return d(e).some(({varId:e,memberId:r})=>"$view"===e&&(null==t||t.has(r)))}let le=null;function pe(){return le}function de(e){return w(e).some(e=>T.has(e))}function fe(e){return w(e).some(e=>j.has(e))}const me=Object.freeze(Object.defineProperty({__proto__:null,_loadScriptDependenciesImpl:ae,compileDebugScript:G,compileScript:E,enableAsyncSupport:q,enableAsyncSupportImpl:B,enableFeatureSetSupport:X,enableFeatureSetSupportImpl:Y,enableGeometrySupport:L,enableGeometrySupportImpl:N,executeScript:W,extend:D,extractExpectedFieldLiterals:P,extractFieldLiterals:O,featureSetUtils:pe,isAsyncEnabled:H,isFeatureSetSupportEnabled:V,isGeometryEnabled:J,loadDependentModules:ce,loadScriptDependencies:se,loadTrackGeometryOperators:ee,parseAndExecuteScript:U,parseScript:I,referencesFunction:R,referencesMember:_,scriptIsAsync:te,scriptTouchesGeometry:ie,scriptUsesFeatureSet:re,scriptUsesGeometryEngine:Z,scriptUsesModules:oe,scriptUsesTrack:fe,scriptUsesViewProperties:ue},Symbol.toStringTag,{value:"Module"}));export{re as A,Z as B,oe as C,fe as D,ue as E,ae as _,me as a,E as b,G as c,B as d,q as e,X as f,Y as g,L as h,N as i,W as j,D as k,P as l,O as m,pe as n,H as o,V as p,J as q,ce as r,se as s,ee as t,U as u,I as v,R as w,_ as x,te as y,ie as z};
package/chunks/array.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{deepClone as n}from"../arcade/deepClone.js";import{ArcadeExecutionError as t}from"../arcade/executionError.js";import r from"../arcade/ImmutableArray.js";import{a3 as e,n as o,P as i,a9 as u,ae as a,G as c,ab as s,o as l,N as f,_ as d,B as h}from"./languageUtils.js";import{isPromiseLike as w}from"../core/promiseUtils.js";import{isArray as g,isBoolean as m,isInteger as F}from"../support/guards.js";function p(p){function v(n,e,o){if(n instanceof r)return n.toArray();if(g(n))return n;throw new t(e,"InvalidParameter",o)}function y(n){const t=u(n);return Number.isNaN(t)||t<=0}function P(n,t){const r=n.length;if(r<=1)return n.slice();const e=Math.floor(r/2);return N(P(n.slice(0,e),t),P(n.slice(e,r),t),t)}function N(n,t,r){const e=[];for(;n.length>0||t.length>0;)n.length>0&&t.length>0?y(r(n[0],t[0]))?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1)):n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}async function I(n,t){const r=n.length;if(r<=1)return n.slice();const e=Math.floor(r/2);return O(await I(n.slice(0,e),t),await I(n.slice(e,r),t),t)}async function O(n,t,r){const e=[];for(;n.length>0||t.length>0;)n.length>0&&t.length>0?y(await r(n[0],t[0]))?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1)):n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}function A(n){if(n.length<=1)return n.slice();let t;for(t=0;t<n.length;t++){const r=n[t];if(null!=r&&!d(r))break}if(t>=n.length)return n.slice();let r=0!==t;const e=h(n[t]);let o=!0;for(t+=1;t<n.length;t++){const i=h(n[t]);if(""!==i){switch(i!==e&&(o=!1),i){case"String":case"Number":case"Boolean":case"Date":case"DateOnly":case"Time":continue}return n.slice()}r=!0}let i=function(n,t){const r=s(n),e=s(t);return r<e?-1:r===e?0:1};if(o&&("String"===e?i=function(n,t){return n<t?-1:n===t?0:1}:"Number"===e?i=function(n,t){return n<t?-1:n>t?1:Object.is(n,t)?0:Number.isNaN(n)?1:Number.isNaN(t)||Object.is(n,-0)?-1:1}:"Boolean"===e?i=function(n,t){return n===t?0:t?-1:1}:"Date"===e&&(i=function(n,t){return n.toNumber()-t.toNumber()})),r){const n=i;i=function(t,r){return null==t||d(t)?null==r||d(r)?0:1:null==r||d(r)?-1:n(t,r)}}return n.toSorted(i)}p.functions.array=function(r,a){return p.standardFunction(r,a,(c,s,l)=>{if(e(l,0,2,r,a),0===l.length)return[];if(1===l.length&&null===l[0])return[];if(g(l[0])){if(2===l.length&&!1===m(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].slice()}if(i(l[0])){if(2===l.length&&!1===m(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].toArray().slice()}const f=u(l[0]);if(isNaN(f)||!1===F(f))throw new t(r,"InvalidParameter",a);const d=o(l[1],null),h=new Array(f);return h.fill(d),h})},p.functions.front=function(n,r){return p.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(0)}if(g(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][0]}throw new t(n,"InvalidParameter",r)})},p.functions.back=function(n,r){return p.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(a[0].length()-1)}if(g(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][a[0].length-1]}throw new t(n,"InvalidParameter",r)})},p.functions.push=function(n,r){return p.standardFunction(n,r,(o,i,u)=>{if(e(u,1,2,n,r),g(u[0]))return u[0][u[0].length]=u[1],u[0].length;throw new t(n,"InvalidParameter",r)})},p.functions.pop=function(n,r){return p.standardFunction(n,r,(o,i,u)=>{if(e(u,1,1,n,r),g(u[0])){if(u[0].length<=0)throw new t(n,"OutOfBounds",r);const e=u[0][u[0].length-1];return u[0].length=u[0].length-1,e}throw new t(n,"InvalidParameter",r)})},p.functions.erase=function(n,r){return p.standardFunction(n,r,(o,i,l)=>{if(e(l,2,2,n,r),g(l[0])){let e=u(l[1]);if(isNaN(e)||!1===F(e))throw new t(n,"InvalidParameter",r);const o=l[0];if(o.length<=0)throw new t(n,"OutOfBounds",r);if(e<0&&(e=o.length+e),e<0)throw new t(n,"OutOfBounds",r);if(e>=o.length)throw new t(n,"OutOfBounds",r);return o.splice(e,1),a}if(c(l[0]))return l[0].eraseField(s(l[1])),a;throw new t(n,"InvalidParameter",r)})},p.functions.insert=function(n,r){return p.standardFunction(n,r,(o,i,l)=>{if(e(l,3,3,n,r),g(l[0])){const e=u(l[1]);if(isNaN(e)||!1===F(e))throw new t(n,"InvalidParameter",r);const o=l[2],i=l[0];if(e>i.length)throw new t(n,"OutOfBounds",r);if(e<0&&e<-1*i.length)throw new t(n,"OutOfBounds",r);return e===i.length?(i[e]=o,a):(i.splice(e,0,o),a)}if(c(l[0]))return l[0].setField(s(l[1]),l[2]),a;throw new t(n,"InvalidParameter",r)})},p.functions.getkeys=function(n,r){return p.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(c(o[0]))return o[0].keys();throw new t(n,"InvalidParameter",r)})},p.functions.getvalues=function(n,r){return p.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(c(o[0]))return o[0].values();throw new t(n,"InvalidParameter",r)})},p.functions.resize=function(n,r){return p.standardFunction(n,r,(i,c,s)=>{if(e(s,2,3,n,r),g(s[0])){const e=u(s[1]);if(isNaN(e)||!1===F(e))throw new t(n,"InvalidParameter",r);if(e<0)throw new t(n,"InvalidParameter",r);const i=o(s[2],null),c=s[0];if(c.length>=e)return c.length=e,a;const l=c.length;c.length=e;for(let n=l;n<c.length;n++)c[n]=i;return a}throw new t(n,"InvalidParameter",r)})},p.functions.includes=function(n,r){return p.standardFunction(n,r,(o,u,a)=>{if(e(a,2,2,n,r),g(a[0])){const n=a[1];return!!a[0].some(t=>l(t,n))}if(i(a[0])){const n=a[1];return!!a[0].toArray().some(t=>l(t,n))}throw new t(n,"InvalidParameter",r)})},p.functions.slice=function(n,r){return p.standardFunction(n,r,(a,c,s)=>{if(e(s,1,3,n,r),g(s[0])){const e=u(o(s[1],0)),i=u(o(s[2],s[0].length));if(isNaN(e)||!1===F(e))throw new t(n,"InvalidParameter",r);if(isNaN(i)||!1===F(i))throw new t(n,"InvalidParameter",r);return s[0].slice(e,i)}if(i(s[0])){const e=s[0],i=u(o(s[1],0)),a=u(o(s[2],e.length()));if(isNaN(i)||!1===F(i))throw new t(n,"InvalidParameter",r);if(isNaN(a)||!1===F(a))throw new t(n,"InvalidParameter",r);return e.toArray().slice(i,a)}throw new t(n,"InvalidParameter",r)})},p.functions.splice=function(n,t){return p.standardFunction(n,t,(n,t,r)=>{const e=[];for(let o=0;o<r.length;o++)g(r[o])?e.push(...r[o]):i(r[o])?e.push(...r[o].toArray()):e.push(r[o]);return e})},p.functions.top=function(n,r){return p.standardFunction(n,r,(o,a,c)=>{if(e(c,2,2,n,r),g(c[0]))return u(c[1])>=c[0].length?c[0].slice():c[0].slice(0,u(c[1]));if(i(c[0]))return u(c[1])>=c[0].length()?c[0].slice():c[0].slice(0,u(c[1]));throw new t(n,"InvalidParameter",r)})},p.functions.first=function(n,t){return p.standardFunction(n,t,(r,o,u)=>(e(u,1,1,n,t),g(u[0])?0===u[0].length?null:u[0][0]:i(u[0])?0===u[0].length()?null:u[0].get(0):null))},"sync"===p.mode&&(p.functions.sort=function(n,r){return p.standardFunction(n,r,(r,o,u)=>{let a;if(e(u,1,2,n,o),g(u[0]))a=u[0];else{if(!i(u[0]))throw new t(n,"InvalidParameter",o);a=u[0].toArray()}if(u.length>1){if(!f(u[1]))throw new t(n,"InvalidParameter",o);return P(a,u[1].createFunction(n))}return A(a)})},p.functions.any=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r);for(const n of u){const t=i(n);if(m(t)&&!0===t)return!0}return!1})},p.functions.all=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r);for(const n of u){if(!0!==i(n))return!1}return!0})},p.functions.none=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r);for(const n of u){if(!0===i(n))return!1}return!0})},p.functions.reduce=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,3,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r);return 2===o.length?0===u.length?null:u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null}):u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null},o[2])})},p.functions.map=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r),c=[];for(const n of u){const t=i(n);void 0!==t&&t!==a?c.push(t):c.push(null)}return c})},p.functions.filter=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r),a=[];for(const n of u){!0===i(n)&&a.push(n)}return a})}),"async"===p.mode&&(p.functions.sort=function(n,r){return p.standardFunctionAsync(n,r,async(r,o,u)=>{let a;if(e(u,1,2,n,o),g(u[0]))a=u[0];else{if(!i(u[0]))throw new t(n,"InvalidParameter",o);a=u[0].toArray()}if(u.length>1){if(!f(u[1]))throw new t(n,"InvalidParameter",o);return I(a,u[1].createFunction(n))}return A(a)})},p.functions.any=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=w(r)?await t:t,m(r)&&!0===r)return!0}return!1})},p.functions.all=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=w(r)?await t:t,!0!==r)return!1}return!0})},p.functions.none=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=w(r)?await t:t,!0===r)return!1}return!0})},p.functions.filter=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r),a=[];for(const n of u){const t=await i(n);let r=null;r=w(r)?await t:t,!0===r&&a.push(n)}return a})},p.functions.reduce=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,i)=>{e(i,2,3,n,r);const u=i[1].createFunction(n),c=v(i[0],n,r);let s;if(i.length>2){const n=o(i[2],null);s=c.reduce(async(n,t)=>{let r=await n;return void 0!==r&&r!==a||(r=null),u(r,t)},Promise.resolve(n))}else{if(0===c.length)return null;s=c.reduce(async(n,t,r)=>{if(r<=1)return u(n,t);let e=await n;return void 0!==e&&e!==a||(e=null),u(e,t)})}return s.then(n=>void 0!==n&&n!==a?n:null)})},p.functions.map=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=v(o[0],n,r),c=[];for(const n of u){const t=await i(n);let r=null;r=w(r)?await t:t,void 0!==r&&r!==a?c.push(r):c.push(null)}return c})})}const v=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:p},Symbol.toStringTag,{value:"Module"}));export{v as A,p as r};
2
+ import{deepClone as n}from"../arcade/deepClone.js";import{ArcadeExecutionError as t}from"../arcade/executionError.js";import r from"../arcade/ImmutableArray.js";import{a3 as e,n as o,P as i,a9 as u,ae as a,G as c,ab as s,o as l,N as f,_ as d,B as h}from"./languageUtils.js";import{isPromiseLike as w}from"../core/promiseUtils.js";import{isArray as g,isBoolean as m,isInteger as F}from"../support/guards.js";function p(p){function v(n,e){if(n instanceof r)return n.toArray();if(g(n))return n;throw new t("InvalidParameter",e)}function y(n){const t=u(n);return Number.isNaN(t)||t<=0}function P(n,t){const r=n.length;if(r<=1)return n.slice();const e=Math.floor(r/2);return N(P(n.slice(0,e),t),P(n.slice(e,r),t),t)}function N(n,t,r){const e=[];for(;n.length>0||t.length>0;)n.length>0&&t.length>0?y(r(n[0],t[0]))?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1)):n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}async function I(n,t){const r=n.length;if(r<=1)return n.slice();const e=Math.floor(r/2);return O(await I(n.slice(0,e),t),await I(n.slice(e,r),t),t)}async function O(n,t,r){const e=[];for(;n.length>0||t.length>0;)n.length>0&&t.length>0?y(await r(n[0],t[0]))?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1)):n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}function A(n){if(n.length<=1)return n.slice();let t;for(t=0;t<n.length;t++){const r=n[t];if(null!=r&&!d(r))break}if(t>=n.length)return n.slice();let r=0!==t;const e=h(n[t]);let o=!0;for(t+=1;t<n.length;t++){const i=h(n[t]);if(""!==i){switch(i!==e&&(o=!1),i){case"String":case"Number":case"Boolean":case"Date":case"DateOnly":case"Time":continue}return n.slice()}r=!0}let i=function(n,t){const r=s(n),e=s(t);return r<e?-1:r===e?0:1};if(o&&("String"===e?i=function(n,t){return n<t?-1:n===t?0:1}:"Number"===e?i=function(n,t){return n<t?-1:n>t?1:Object.is(n,t)?0:Number.isNaN(n)?1:Number.isNaN(t)||Object.is(n,-0)?-1:1}:"Boolean"===e?i=function(n,t){return n===t?0:t?-1:1}:"Date"===e&&(i=function(n,t){return n.toNumber()-t.toNumber()})),r){const n=i;i=function(t,r){return null==t||d(t)?null==r||d(r)?0:1:null==r||d(r)?-1:n(t,r)}}return n.toSorted(i)}p.functions.array=function(r,a){return p.standardFunction(r,a,(r,c,s)=>{if(e(s,0,2,a),0===s.length)return[];if(1===s.length&&null===s[0])return[];if(g(s[0])){if(2===s.length&&!1===m(s[1]))throw new t("InvalidParameter",a);return!0===o(s[1],!1)?n(s[0]):s[0].slice()}if(i(s[0])){if(2===s.length&&!1===m(s[1]))throw new t("InvalidParameter",a);return!0===o(s[1],!1)?n(s[0]):s[0].toArray().slice()}const l=u(s[0]);if(isNaN(l)||!1===F(l))throw new t("InvalidParameter",a);const f=o(s[1],null),d=new Array(l);return d.fill(f),d})},p.functions.front=function(n,r){return p.standardFunction(n,r,(n,o,u)=>{if(e(u,1,1,r),i(u[0])){if(u[0].length()<=0)throw new t("OutOfBounds",r);return u[0].get(0)}if(g(u[0])){if(u[0].length<=0)throw new t("OutOfBounds",r);return u[0][0]}throw new t("InvalidParameter",r)})},p.functions.back=function(n,r){return p.standardFunction(n,r,(n,o,u)=>{if(e(u,1,1,r),i(u[0])){if(u[0].length()<=0)throw new t("OutOfBounds",r);return u[0].get(u[0].length()-1)}if(g(u[0])){if(u[0].length<=0)throw new t("OutOfBounds",r);return u[0][u[0].length-1]}throw new t("InvalidParameter",r)})},p.functions.push=function(n,r){return p.standardFunction(n,r,(n,o,i)=>{if(e(i,1,2,r),g(i[0]))return i[0][i[0].length]=i[1],i[0].length;throw new t("InvalidParameter",r)})},p.functions.pop=function(n,r){return p.standardFunction(n,r,(n,o,i)=>{if(e(i,1,1,r),g(i[0])){if(i[0].length<=0)throw new t("OutOfBounds",r);const n=i[0][i[0].length-1];return i[0].length=i[0].length-1,n}throw new t("InvalidParameter",r)})},p.functions.erase=function(n,r){return p.standardFunction(n,r,(n,o,i)=>{if(e(i,2,2,r),g(i[0])){let n=u(i[1]);if(isNaN(n)||!1===F(n))throw new t("InvalidParameter",r);const e=i[0];if(e.length<=0)throw new t("OutOfBounds",r);if(n<0&&(n=e.length+n),n<0)throw new t("OutOfBounds",r);if(n>=e.length)throw new t("OutOfBounds",r);return e.splice(n,1),a}if(c(i[0]))return i[0].eraseField(s(i[1])),a;throw new t("InvalidParameter",r)})},p.functions.insert=function(n,r){return p.standardFunction(n,r,(n,o,i)=>{if(e(i,3,3,r),g(i[0])){const n=u(i[1]);if(isNaN(n)||!1===F(n))throw new t("InvalidParameter",r);const e=i[2],o=i[0];if(n>o.length)throw new t("OutOfBounds",r);if(n<0&&n<-1*o.length)throw new t("OutOfBounds",r);return n===o.length?(o[n]=e,a):(o.splice(n,0,e),a)}if(c(i[0]))return i[0].setField(s(i[1]),i[2]),a;throw new t("InvalidParameter",r)})},p.functions.getkeys=function(n,r){return p.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,r),null==o[0])return[];if(c(o[0]))return o[0].keys();throw new t("InvalidParameter",r)})},p.functions.getvalues=function(n,r){return p.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,r),null==o[0])return[];if(c(o[0]))return o[0].values();throw new t("InvalidParameter",r)})},p.functions.resize=function(n,r){return p.standardFunction(n,r,(n,i,c)=>{if(e(c,2,3,r),g(c[0])){const n=u(c[1]);if(isNaN(n)||!1===F(n))throw new t("InvalidParameter",r);if(n<0)throw new t("InvalidParameter",r);const e=o(c[2],null),i=c[0];if(i.length>=n)return i.length=n,a;const s=i.length;i.length=n;for(let t=s;t<i.length;t++)i[t]=e;return a}throw new t("InvalidParameter",r)})},p.functions.includes=function(n,r){return p.standardFunction(n,r,(n,o,u)=>{if(e(u,2,2,r),g(u[0])){const n=u[1];return!!u[0].some(t=>l(t,n))}if(i(u[0])){const n=u[1];return!!u[0].toArray().some(t=>l(t,n))}throw new t("InvalidParameter",r)})},p.functions.slice=function(n,r){return p.standardFunction(n,r,(n,a,c)=>{if(e(c,1,3,r),g(c[0])){const n=u(o(c[1],0)),e=u(o(c[2],c[0].length));if(isNaN(n)||!1===F(n))throw new t("InvalidParameter",r);if(isNaN(e)||!1===F(e))throw new t("InvalidParameter",r);return c[0].slice(n,e)}if(i(c[0])){const n=c[0],e=u(o(c[1],0)),i=u(o(c[2],n.length()));if(isNaN(e)||!1===F(e))throw new t("InvalidParameter",r);if(isNaN(i)||!1===F(i))throw new t("InvalidParameter",r);return n.toArray().slice(e,i)}throw new t("InvalidParameter",r)})},p.functions.splice=function(n,t){return p.standardFunction(n,t,(n,t,r)=>{const e=[];for(let o=0;o<r.length;o++)g(r[o])?e.push(...r[o]):i(r[o])?e.push(...r[o].toArray()):e.push(r[o]);return e})},p.functions.top=function(n,r){return p.standardFunction(n,r,(n,o,a)=>{if(e(a,2,2,r),g(a[0]))return u(a[1])>=a[0].length?a[0].slice():a[0].slice(0,u(a[1]));if(i(a[0]))return u(a[1])>=a[0].length()?a[0].slice():a[0].slice(0,u(a[1]));throw new t("InvalidParameter",r)})},p.functions.first=function(n,t){return p.standardFunction(n,t,(n,r,o)=>(e(o,1,1,t),g(o[0])?0===o[0].length?null:o[0][0]:i(o[0])?0===o[0].length()?null:o[0].get(0):null))},"sync"===p.mode&&(p.functions.sort=function(n,r){return p.standardFunction(n,r,(r,o,u)=>{let a;if(e(u,1,2,o),g(u[0]))a=u[0];else{if(!i(u[0]))throw new t("InvalidParameter",o);a=u[0].toArray()}if(u.length>1){if(!f(u[1]))throw new t("InvalidParameter",o);return P(a,u[1].createFunction(n))}return A(a)})},p.functions.any=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r);for(const n of u){const t=i(n);if(m(t)&&!0===t)return!0}return!1})},p.functions.all=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r);for(const n of u){if(!0!==i(n))return!1}return!0})},p.functions.none=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r);for(const n of u){if(!0===i(n))return!1}return!0})},p.functions.reduce=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,3,r);const i=o[1].createFunction(n),u=v(o[0],r);return 2===o.length?0===u.length?null:u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null}):u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null},o[2])})},p.functions.map=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r),c=[];for(const n of u){const t=i(n);void 0!==t&&t!==a?c.push(t):c.push(null)}return c})},p.functions.filter=function(n,t){return p.standardFunction(n,t,(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r),a=[];for(const n of u){!0===i(n)&&a.push(n)}return a})}),"async"===p.mode&&(p.functions.sort=function(n,r){return p.standardFunctionAsync(n,r,async(r,o,u)=>{let a;if(e(u,1,2,o),g(u[0]))a=u[0];else{if(!i(u[0]))throw new t("InvalidParameter",o);a=u[0].toArray()}if(u.length>1){if(!f(u[1]))throw new t("InvalidParameter",o);return I(a,u[1].createFunction(n))}return A(a)})},p.functions.any=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r);for(const n of u){const t=await i(n);let r=null;if(r=w(r)?await t:t,m(r)&&!0===r)return!0}return!1})},p.functions.all=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r);for(const n of u){const t=await i(n);let r=null;if(r=w(r)?await t:t,!0!==r)return!1}return!0})},p.functions.none=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r);for(const n of u){const t=await i(n);let r=null;if(r=w(r)?await t:t,!0===r)return!1}return!0})},p.functions.filter=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r),a=[];for(const n of u){const t=await i(n);let r=null;r=w(r)?await t:t,!0===r&&a.push(n)}return a})},p.functions.reduce=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,i)=>{e(i,2,3,r);const u=i[1].createFunction(n),c=v(i[0],r);let s;if(i.length>2){const n=o(i[2],null);s=c.reduce(async(n,t)=>{let r=await n;return void 0!==r&&r!==a||(r=null),u(r,t)},Promise.resolve(n))}else{if(0===c.length)return null;s=c.reduce(async(n,t,r)=>{if(r<=1)return u(n,t);let e=await n;return void 0!==e&&e!==a||(e=null),u(e,t)})}return s.then(n=>void 0!==n&&n!==a?n:null)})},p.functions.map=function(n,t){return p.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,r);const i=o[1].createFunction(n),u=v(o[0],r),c=[];for(const n of u){const t=await i(n);let r=null;r=w(r)?await t:t,void 0!==r&&r!==a?c.push(r):c.push(null)}return c})})}const v=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:p},Symbol.toStringTag,{value:"Module"}));export{v as A,p as r};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{ArcadeDate as e,createDateTimeZone as t}from"../arcade/ArcadeDate.js";import{ArcadeModule as r}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as n}from"../arcade/executionError.js";import{ArcadeFunction as i}from"../arcade/FunctionWrapper.js";import a from"../arcade/ImmutableArray.js";import o from"../arcade/ImmutablePathArray.js";import u from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as s,layerGeometryEsriRestConstants as l}from"../arcade/featureset/support/shared.js";import{format as f,parse as c}from"../core/number.js";import{DateOnly as m}from"../core/sql/DateOnly.js";import{TimeOnly as d}from"../core/sql/TimeOnly.js";import y from"../geometry/Extent.js";import p from"../geometry/Geometry.js";import g from"../geometry/Multipoint.js";import h from"../geometry/Point.js";import b from"../geometry/Polygon.js";import N from"../geometry/Polyline.js";import{isClockwise as S}from"../geometry/support/coordsUtils.js";import{fromJSON as Z}from"../geometry/support/jsonUtils.js";import{getLocale as T}from"../intl/locale.js";import{isBoolean as A,isNumber as k,isString as D,isDate as C,isArray as O,isInteger as j}from"../support/guards.js";import{DateTime as x}from"luxon";import{isGraphic as F}from"../support/graphicInstanceUtils.js";class w{constructor(e){this.value=e}}class J{constructor(e){this.value=e}}const M={type:"VOID"},R=Symbol("BREAK"),P=Symbol("CONTINUE");function v(e,t,r){return""===t||null==t||t===r||t===r?e:e=e.split(t).join(r)}function I(e){return e instanceof i}function _(e){return e instanceof r}function Y(e){return!!D(e)||(!!k(e)||(!!te(e)||(!!re(e)||(!!ne(e)||(!!A(e)||(null===e||e===M))))))}function L(e,t){return void 0===e?t:e}function G(e){return null==e?"":O(e)||ee(e)?"Array":te(e)?"Date":ne(e)?"Time":re(e)?"DateOnly":D(e)?"String":A(e)?"Boolean":k(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":X(e)?"KnowledgeGraph":e instanceof r?"Module":q(e)?"Feature":e instanceof h?"Point":e instanceof b?"Polygon":e instanceof N?"Polyline":e instanceof g?"Multipoint":e instanceof y?"Extent":I(e)?"Function":H(e)?"FeatureSet":Q(e)?"FeatureSetCollection":E(e)?"Voxel":U(e)?"Pixel":e===M?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function V(e){return e===M}function z(e){return e instanceof p}function q(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function E(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function U(e){return"esri.arcade.Pixel"===e?.arcadeDeclaredClass}function H(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function W(e){return"esri.arcade.Dictionary"===e?.declaredClass}function $(e){return"esri.arcade.Portal"===e?.declaredClass}function B(e){return"esri.arcade.Attachment"===e?.declaredClass}function K(e){return W(e)||q(e)||E(e)||U(e)}function Q(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function X(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function ee(e){return e instanceof a}function te(t){return t instanceof e}function re(e){return e instanceof m}function ne(e){return e instanceof d}function ie(e){return null!=e&&"object"==typeof e}function ae(e,t,r,i,a){if(e.length<t||e.length>r)throw new n(i,"WrongNumberOfParameters",a)}function oe(e){return null==e||V(e)||""===e}function ue(e){return e<0?-Math.round(-e):Math.round(e)}function se(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=v(t,"‰",""),t=v(t,"¤",""),f(e,{pattern:t}))}function le(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(fe(t),{locale:T(),numberingSystem:"latn"})}function fe(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(n)||[])switch(i){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?r+=`'${i.slice(1,-1)}'`:r+=`'${i}'`}return r}function ce(e,t,r){switch(r){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function me(t,r,i){if(null===t){if(null===r||r===M)return ce(null,null,i);if(k(r))return ce(0,r,i);if(D(r))return ce(0,Ne(r),i);if(A(r))return ce(0,Ne(r),i);if(te(r))return ce(0,r.toNumber(),i);if(ne(r))return ce(t,r.toNumber(),i);if(re(r))return ce(t,r.toNumber(),i)}if(t===M){if(null===r||r===M)return ce(null,null,i);if(k(r))return ce(0,r,i);if(D(r))return ce(0,Ne(r),i);if(A(r))return ce(0,Ne(r),i);if(te(r))return ce(0,r.toNumber(),i);if(ne(r))return ce(t,r.toNumber(),i);if(re(r))return ce(t,r.toNumber(),i)}else if(k(t)){if(k(r))return ce(t,r,i);if(A(r))return ce(t,Ne(r),i);if(null===r||r===M)return ce(t,0,i);if(D(r))return ce(t,Ne(r),i);if(te(r))return ce(t,r.toNumber(),i);if(ne(r))return ce(t,r.toNumber(),i);if(re(r))return ce(t,r.toNumber(),i)}else if(D(t)){if(D(r))return ce(pe(t),pe(r),i);if(te(r))return ce(Ne(t),r.toNumber(),i);if(ne(r))return ce(Ne(t),r.toNumber(),i);if(re(r))return ce(Ne(t),r.toNumber(),i);if(k(r))return ce(Ne(t),r,i);if(null===r||r===M)return ce(Ne(t),0,i);if(A(r))return ce(Ne(t),Ne(r),i)}else if(te(t)){if(te(r))return t.timeZone!==r.timeZone&&(t.isUnknownTimeZone?t=e.arcadeDateAndZoneToArcadeDate(t,r.timeZone):r.isUnknownTimeZone&&(r=e.arcadeDateAndZoneToArcadeDate(r,t.timeZone))),ce(t.toNumber(),r.toNumber(),i);if(null===r||r===M)return ce(t.toNumber(),0,i);if(k(r))return ce(t.toNumber(),r,i);if(A(r))return ce(t.toNumber(),Ne(r),i);if(D(r))return ce(t.toNumber(),Ne(r),i);if(ne(r))throw new n(null,"CannotCompareDateAndTime",null);if(re(r))return ce(t.toNumber(),r.toNumber(),i)}else if(A(t)){if(A(r))return ce(t,r,i);if(k(r))return ce(Ne(t),Ne(r),i);if(te(r))return ce(Ne(t),r.toNumber(),i);if(ne(r))return ce(Ne(t),r.toNumber(),i);if(re(r))return ce(Ne(t),r.toNumber(),i);if(null===r||r===M)return ce(Ne(t),0,i);if(D(r))return ce(Ne(t),Ne(r),i)}else if(re(t)){if(te(r))return ce(t.toNumber(),r.toNumber(),i);if(null===r||r===M)return ce(t.toNumber(),0,i);if(k(r))return ce(t.toNumber(),r,i);if(A(r))return ce(t.toNumber(),Ne(r),i);if(D(r))return ce(t.toNumber(),Ne(r),i);if(ne(r))throw new n(null,"CannotCompareDateAndTime",null);if(re(r))return ce(t.toNumber(),r.toNumber(),i)}else if(ne(t)){if(te(r))throw new n(null,"CannotCompareDateAndTime",null);if(null===r||r===M)return ce(t.toNumber(),0,i);if(k(r))return ce(t.toNumber(),r,i);if(A(r))return ce(t.toNumber(),Ne(r),i);if(D(r))return ce(t.toNumber(),Ne(r),i);if(ne(r))return ce(t.toNumber(),r.toNumber(),i);if(re(r))throw new n(null,"CannotCompareDateAndTime",null)}return!!de(t,r)&&("<="===i||">="===i)}function de(e,t){if(e===t)return!0;if(null===e&&t===M||null===t&&e===M)return!0;if(te(e)&&te(t))return e.equals(t);if(ne(e)&&ne(t))return e.equals(t);if(re(e)&&re(t))return e.equals(t);if(e instanceof o)return e.equalityTest(t);if(e instanceof u)return e.equalityTest(t);if(e instanceof h&&t instanceof h){const r=e.cache._arcadeCacheId,n=t.cache._arcadeCacheId;if(null!=r)return r===n}if(ie(e)&&ie(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function ye(e,{useNumbersForDates:t}){let r="";for(const n in e){""!==r&&(r+=",");const i=e[n];null==i?r+=JSON.stringify(n)+":null":A(i)||k(i)||D(i)?r+=JSON.stringify(n)+":"+JSON.stringify(i):z(i)?r+=JSON.stringify(n)+":"+he(i):ne(i)||re(i)?r+=`${JSON.stringify(n)}:${JSON.stringify(i.toString())}`:ee(i)||Array.isArray(i)?r+=JSON.stringify(n)+":"+he(i,null,t):te(i)?r+=t?JSON.stringify(n)+":"+JSON.stringify(i.getTime()):JSON.stringify(n)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(r+=JSON.stringify(n)+":"+i.castToText(t))}return"{"+r+"}"}function pe(e,t){if(D(e))return e;if(null===e)return"";if(k(e))return se(e,t);if(A(e))return e.toString();if(te(e))return le(e,t);if(ne(e))return e.toFormat(t);if(re(e))return e.toFormat(t);if(e instanceof p)return JSON.stringify(e.toJSON());if(O(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=be(e[r]);return"["+t.join(",")+"]"}if(e instanceof a){const t=[];for(let r=0;r<e.length();r++)t[r]=be(e.get(r));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():I(e)?"object, Function":e===M?"":_(e)?"object, Module":""}function ge(e){const t=[];if(e instanceof a){for(let r=0;r<e.length();r++)t[r]=Ne(e.get(r));return t}if(!O(e))return null;for(let r=0;r<e.length;r++)t[r]=Ne(e[r]);return t}function he(e,t,r=!1){if(D(e))return e;if(null===e)return"";if(k(e))return se(e,t);if(A(e))return e.toString();if(te(e))return le(e,t);if(ne(e))return e.toFormat(t);if(re(e))return e.toFormat(t);if(e instanceof p)return e instanceof y?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+Fe(e.spatialReference)+"}":Fe(e.toJSON(),(e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0);if(O(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=be(e[n],r);return"["+t.join(",")+"]"}if(e instanceof a){const t=[];for(let n=0;n<e.length();n++)t[n]=be(e.get(n),r);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(r):I(e)?"object, Function":e===M?"":_(e)?"object, Module":""}function be(e,t=!1){if(null===e)return"null";if(A(e)||D(e))return JSON.stringify(e);if(k(e))return e.toString();if(e instanceof p)return he(e,null,t);if(e instanceof a)return he(e,null,t);if(Array.isArray(e))return he(e,null,t);if(te(e))return t?JSON.stringify(e.getTime()):JSON.stringify(le(e,""));if(ne(e))return JSON.stringify(e.toString());if(re(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===M)return"null";return"null"}function Ne(e,t){return k(e)?e:null===e||""===e?0:te(e)||re(e)||ne(e)?NaN:A(e)?e?1:0:O(e)||""===e||void 0===e?NaN:void 0!==t&&D(e)?(t=v(t,"‰",""),t=v(t,"¤",""),c(e,{pattern:t})):e===M?0:Number(e)}function Se(t,r){if(te(t))return t;if(D(t)){const n=Ze(t,r);if(n)return e.dateTimeToArcadeDate(n)}return null}function Ze(e,r){const n=/ (\d\d)/,i=t(r);let a=x.fromISO(e,{zone:i});return a.isValid||n.test(e)&&(e=e.replace(n,"T$1"),a=x.fromISO(e,{zone:r}),a.isValid)?a:null}function Te(e){return A(e)?e:D(e)?"true"===(e=e.toLowerCase()):!!k(e)&&(0!==e&&!isNaN(e))}function Ae(e,t){const r=JSON.parse(e);return r&&!r.spatialReference&&(r.spatialReference=t),Z(r)}function ke(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function De(e){if(null===e)return null;if(e instanceof h)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof b){if(0===(e.curveRings??e.rings).length)return null;for(const t of e.curveRings??e.rings)if(t.length>0)return e;return null}if(e instanceof N){if(0===(e.curvePaths??e.paths).length)return null;for(const t of e.curvePaths??e.paths)if(t.length>0)return e;return null}return e instanceof g?0===e.points.length?null:e:e instanceof y?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function Ce(e,t){if(!e)return t;if(!e.domain)return t;let r=null,n=null;if(te(t))r=t.toNumber();else if(re(t))r=t.toString();else if(ne(t))r=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)r=pe(t);else{if(null==t)return null;if(""===t)return t;r=Ne(t)}for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.code===r&&(n=t)}return null===n?pe(t):n.name}function Oe(e,t){if(!e)return t;if(!e.domain)return t;let r=null;const n=pe(t);for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.name===n&&(r=t)}return null===r?t:r.code}function je(e,t,r=null,i=null){if(!t)return null;if(!t.fields)return null;let a,o,u=null;for(let n=0;n<t.fields.length;n++){const r=t.fields[n];r.name.toLowerCase()===e.toString().toLowerCase()&&(u=r)}if(null===u)throw new n(null,"FieldNotFound",null,{key:e});let s=t.typeIdField,l="id",f=t.types;if(t.subtypeField&&(s=t.subtypeField,l="code",f=t.subtypes??[]),null===i&&r&&s)i=r.hasField(s)?r.field(s):null;else if(s&&null!==i){let e=!1;for(const t of f||[])if(i===t[l]){e=!0;break}if(!e)for(const t of f||[])if(i===t.name){i=t[l],e=!0;break}e||(i=null,r&&s&&(i=r.hasField(s)?r.field(s):null))}return null!=i&&f.some(e=>e[l]===i&&(a=e.domains?.[u.name],a&&"inherited"===a.type&&(a=xe(u.name,t),o=!0),!0)),o||a||(a=xe(e,t)),{field:u,domain:a}}function xe(e,t){let r;return t.fields.some(t=>(t.name.toLowerCase()===e.toLowerCase()&&(r=t.domain),!!r)),r}function Fe(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(i=t.cmp,function(e){return function(t,r){const n={key:t,value:e[t]},a={key:r,value:e[r]};return i(n,a)}});var i;const a=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(a.includes(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const u=a.push(t)-1,s=Object.keys(t).sort(n?.(t));for(o="",i=0;i<s.length;i++){const r=s[i],n=e(t[r]);n&&(o&&(o+=","),o+=JSON.stringify(r)+":"+n)}return a.splice(u,1),"{"+o+"}"}(e)}function we(e){if(null===e)return null;const t=[];for(const r of e)q(r)?t.push(r.geometry()):t.push(r);return t}function Je(e,t){if(!(t instanceof h))throw new n(null,"InvalidParameter",null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function Me(e,t){if(O(e)||ee(e)){let r=!1,i=!1,a=[],o=t;if(O(e)){for(const t of e)Je(a,t);a.length>0&&(o=e[0].spatialReference,r=e[0].hasZ,i=e[0].hasM)}else if(e instanceof u)a=e._elements,a.length>0&&(r=e._hasZ,i=e._hasM,o=e.get(0).spatialReference);else{if(!ee(e))throw new n(null,"InvalidParameter",null);for(const t of e.toArray())Je(a,t);a.length>0&&(o=e.get(0).spatialReference,r=!0===e.get(0).hasZ,i=!0===e.get(0).hasM)}if(0===a.length)return null;return S(a)||(a=a.slice().reverse()),new b({rings:[a],spatialReference:o,hasZ:r,hasM:i})}return e}function Re(e,t){if(O(e)||ee(e)){let r=!1,n=!1,i=[],a=t;if(O(e)){for(const t of e)Je(i,t);i.length>0&&(a=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof u)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,a=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())Je(i,t);i.length>0&&(a=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new N({paths:[i],spatialReference:a,hasZ:r,hasM:n})}return e}function Pe(e,t){if(O(e)||ee(e)){let r=!1,n=!1,i=[],a=t;if(O(e)){for(const t of e)Je(i,t);i.length>0&&(a=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof u)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,a=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())Je(i,t);i.length>0&&(a=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new g({points:i,spatialReference:a,hasZ:r,hasM:n})}return e}function ve(e,t=!0){if(null==e)return[];if(O(e)){const r=[];for(const n of e){const e=pe(n);(t||""!==e)&&r.push(e)}return r}if(ee(e)){const r=[];for(let n=0;n<e.length();n++){const i=pe(e.get(n));(t||""!==i)&&r.push(i)}return r}if(Y(e)){const r=pe(e);if(t||""!==r)return[r]}return[]}let Ie=0;function _e(){return Ie++,Ie%100==0?(Ie=0,new Promise(e=>{setTimeout(()=>{e()},0)})):Promise.resolve()}function Ye(e,t,r){switch(r){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Le(e,t=null){return null==e?null:A(e)||k(e)||D(e)?e:e instanceof p?!0===t?.keepGeometryType?e:e.toJSON():e instanceof a?e.toArray().map(e=>Le(e,t)):Array.isArray(e)?e.map(e=>Le(e,t)):C(e)?e:te(e)?e.toJSDate():ne(e)?e.toString():re(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ge(e,t,r,n,i){const a=await Ve(e,t,r);i[n]=a}async function Ve(e,t=null,r=null){if(e instanceof a&&(e=e.toArray()),null==e)return null;if(Y(e)||e instanceof p||C(e)||te(e))return Le(e,r);if(Array.isArray(e)){const n=[],i=[];for(const a of e)null===a||Y(a)||a instanceof p||C(a)||te(a)?i.push(Le(a,r)):(i.push(null),n.push(Ge(a,t,r,i.length-1,i)));return n.length>0&&await Promise.all(n),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,r):null}function ze(e){return qe(e)?e.parent:e}function qe(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function Ee(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Ue(e,t,r){const n=ze(e.fullSchema());if(null===n)return null;if(!n.fields)return null;return je(t,n,e,r)}function He(e){const t=ze(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(e=>({name:e.name,code:e.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(e=>({name:e.name,code:e.id})):[]}:null:null}function We(e,t,r,n){const i=ze(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const a=je(t,i,e,n);if(void 0===r)try{r=e.field(t)}catch(o){return null}return Ce(a,r)}function $e(e,t,r,n){const i=ze(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===r){try{r=e.field(t)}catch(a){return null}return r}return Oe(je(t,i,e,n),r)}function Be(e){return e?.timeZone??"system"}function Ke(e){const t=ze(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const r=[];for(const n of t.fields)r.push(s(n));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===l[t.geometryType]?"":l[t.geometryType],fields:r}}const Qe="1.35",Xe=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:J,ReturnResult:w,absRound:ue,arcadeVersion:Qe,autoCastArrayOfPointsToMultiPoint:Pe,autoCastArrayOfPointsToPolygon:Me,autoCastArrayOfPointsToPolyline:Re,autoCastFeatureToGeometry:we,binaryOperator:Ye,breakResult:R,castAsJson:Le,castAsJsonAsync:Ve,castRecordToText:ye,continueResult:P,defaultTimeZone:Be,defaultUndefined:L,equalityTest:de,featureDomainCodeLookup:$e,featureDomainValueLookup:We,featureFullDomain:Ue,featureSchema:Ke,featureSubtypes:He,fixNullGeometry:De,fixSpatialReference:ke,formatDate:le,formatNumber:se,getDomain:je,getDomainCode:Oe,getDomainValue:Ce,getType:G,greaterThanLessThan:me,isArray:O,isAttachment:B,isBoolean:A,isDate:te,isDateOnly:re,isDictionary:W,isDictionaryLike:K,isEmpty:oe,isFeature:q,isFeatureSet:H,isFeatureSetCollection:Q,isFunctionParameter:I,isGeometry:z,isGraphic:F,isImmutableArray:ee,isInteger:j,isJsDate:C,isKnowledgeGraph:X,isModule:_,isNumber:k,isObject:ie,isPixel:U,isPortal:$,isSimpleType:Y,isString:D,isSubtypeGrouplayer:Ee,isSubtypeSublayer:qe,isTime:ne,isVoid:V,isVoxel:E,multiReplace:v,parseGeometryFromJson:Ae,pcCheck:ae,stableStringify:Fe,standardiseDateFormat:fe,tick:_e,toBoolean:Te,toDate:Se,toNumber:Ne,toNumberArray:ge,toString:pe,toStringArray:ve,toStringExplicit:he,voidOperation:M},Symbol.toStringTag,{value:"Module"}));export{E as $,Ce as A,G as B,me as C,B as D,te as E,re as F,W as G,K as H,J as I,oe as J,q as K,H as L,Q as M,I as N,z as O,ee as P,X as Q,w as R,_ as S,ie as T,U,$ as V,Y as W,Ee as X,qe as Y,ne as Z,V as _,ue as a,Xe as a0,v as a1,Ae as a2,ae as a3,Fe as a4,fe as a5,_e as a6,Te as a7,Se as a8,Ne as a9,ge as aa,pe as ab,ve as ac,he as ad,M as ae,Qe as b,Pe as c,Me as d,Re as e,we as f,Ye as g,R as h,Le as i,Ve as j,ye as k,P as l,Be as m,L as n,de as o,$e as p,We as q,Ue as r,Ke as s,He as t,De as u,ke as v,le as w,se as x,je as y,Oe as z};
2
+ import{ArcadeDate as e,createDateTimeZone as t}from"../arcade/ArcadeDate.js";import{ArcadeModule as r}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as n}from"../arcade/executionError.js";import{ArcadeFunction as i}from"../arcade/FunctionWrapper.js";import a from"../arcade/ImmutableArray.js";import o from"../arcade/ImmutablePathArray.js";import u from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as s,layerGeometryEsriRestConstants as l}from"../arcade/featureset/support/shared.js";import{format as f,parse as c}from"../core/number.js";import{DateOnly as m}from"../core/sql/DateOnly.js";import{TimeOnly as d}from"../core/sql/TimeOnly.js";import y from"../geometry/Extent.js";import p from"../geometry/Geometry.js";import g from"../geometry/Multipoint.js";import h from"../geometry/Point.js";import b from"../geometry/Polygon.js";import N from"../geometry/Polyline.js";import{isClockwise as S}from"../geometry/support/coordsUtils.js";import{fromJSON as Z}from"../geometry/support/jsonUtils.js";import{getLocale as T}from"../intl/locale.js";import{isBoolean as A,isNumber as k,isString as D,isDate as C,isArray as O,isInteger as j}from"../support/guards.js";import{DateTime as x}from"luxon";import{isGraphic as F}from"../support/graphicInstanceUtils.js";class w{constructor(e){this.value=e}}class J{constructor(e){this.value=e}}const M={type:"VOID"},R=Symbol("BREAK"),P=Symbol("CONTINUE");function v(e,t,r){return""===t||null==t||t===r||t===r?e:e=e.split(t).join(r)}function I(e){return e instanceof i}function _(e){return e instanceof r}function Y(e){return!!D(e)||(!!k(e)||(!!te(e)||(!!re(e)||(!!ne(e)||(!!A(e)||(null===e||e===M))))))}function L(e,t){return void 0===e?t:e}function G(e){return null==e?"":O(e)||ee(e)?"Array":te(e)?"Date":ne(e)?"Time":re(e)?"DateOnly":D(e)?"String":A(e)?"Boolean":k(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":X(e)?"KnowledgeGraph":e instanceof r?"Module":q(e)?"Feature":e instanceof h?"Point":e instanceof b?"Polygon":e instanceof N?"Polyline":e instanceof g?"Multipoint":e instanceof y?"Extent":I(e)?"Function":H(e)?"FeatureSet":Q(e)?"FeatureSetCollection":E(e)?"Voxel":U(e)?"Pixel":e===M?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function V(e){return e===M}function z(e){return e instanceof p}function q(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function E(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function U(e){return"esri.arcade.Pixel"===e?.arcadeDeclaredClass}function H(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function W(e){return"esri.arcade.Dictionary"===e?.declaredClass}function $(e){return"esri.arcade.Portal"===e?.declaredClass}function B(e){return"esri.arcade.Attachment"===e?.declaredClass}function K(e){return W(e)||q(e)||E(e)||U(e)}function Q(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function X(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function ee(e){return e instanceof a}function te(t){return t instanceof e}function re(e){return e instanceof m}function ne(e){return e instanceof d}function ie(e){return null!=e&&"object"==typeof e}function ae(e,t,r,i){if(e.length<t||e.length>r)throw new n("WrongNumberOfParameters",i)}function oe(e){return null==e||V(e)||""===e}function ue(e){return e<0?-Math.round(-e):Math.round(e)}function se(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=v(t,"‰",""),t=v(t,"¤",""),f(e,{pattern:t}))}function le(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(fe(t),{locale:T(),numberingSystem:"latn"})}function fe(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(n)||[])switch(i){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?r+=`'${i.slice(1,-1)}'`:r+=`'${i}'`}return r}function ce(e,t,r){switch(r){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function me(t,r,i){if(null===t){if(null===r||r===M)return ce(null,null,i);if(k(r))return ce(0,r,i);if(D(r))return ce(0,Ne(r),i);if(A(r))return ce(0,Ne(r),i);if(te(r))return ce(0,r.toNumber(),i);if(ne(r))return ce(t,r.toNumber(),i);if(re(r))return ce(t,r.toNumber(),i)}if(t===M){if(null===r||r===M)return ce(null,null,i);if(k(r))return ce(0,r,i);if(D(r))return ce(0,Ne(r),i);if(A(r))return ce(0,Ne(r),i);if(te(r))return ce(0,r.toNumber(),i);if(ne(r))return ce(t,r.toNumber(),i);if(re(r))return ce(t,r.toNumber(),i)}else if(k(t)){if(k(r))return ce(t,r,i);if(A(r))return ce(t,Ne(r),i);if(null===r||r===M)return ce(t,0,i);if(D(r))return ce(t,Ne(r),i);if(te(r))return ce(t,r.toNumber(),i);if(ne(r))return ce(t,r.toNumber(),i);if(re(r))return ce(t,r.toNumber(),i)}else if(D(t)){if(D(r))return ce(pe(t),pe(r),i);if(te(r))return ce(Ne(t),r.toNumber(),i);if(ne(r))return ce(Ne(t),r.toNumber(),i);if(re(r))return ce(Ne(t),r.toNumber(),i);if(k(r))return ce(Ne(t),r,i);if(null===r||r===M)return ce(Ne(t),0,i);if(A(r))return ce(Ne(t),Ne(r),i)}else if(te(t)){if(te(r))return t.timeZone!==r.timeZone&&(t.isUnknownTimeZone?t=e.arcadeDateAndZoneToArcadeDate(t,r.timeZone):r.isUnknownTimeZone&&(r=e.arcadeDateAndZoneToArcadeDate(r,t.timeZone))),ce(t.toNumber(),r.toNumber(),i);if(null===r||r===M)return ce(t.toNumber(),0,i);if(k(r))return ce(t.toNumber(),r,i);if(A(r))return ce(t.toNumber(),Ne(r),i);if(D(r))return ce(t.toNumber(),Ne(r),i);if(ne(r))throw new n("CannotCompareDateAndTime",null);if(re(r))return ce(t.toNumber(),r.toNumber(),i)}else if(A(t)){if(A(r))return ce(t,r,i);if(k(r))return ce(Ne(t),Ne(r),i);if(te(r))return ce(Ne(t),r.toNumber(),i);if(ne(r))return ce(Ne(t),r.toNumber(),i);if(re(r))return ce(Ne(t),r.toNumber(),i);if(null===r||r===M)return ce(Ne(t),0,i);if(D(r))return ce(Ne(t),Ne(r),i)}else if(re(t)){if(te(r))return ce(t.toNumber(),r.toNumber(),i);if(null===r||r===M)return ce(t.toNumber(),0,i);if(k(r))return ce(t.toNumber(),r,i);if(A(r))return ce(t.toNumber(),Ne(r),i);if(D(r))return ce(t.toNumber(),Ne(r),i);if(ne(r))throw new n("CannotCompareDateAndTime",null);if(re(r))return ce(t.toNumber(),r.toNumber(),i)}else if(ne(t)){if(te(r))throw new n("CannotCompareDateAndTime",null);if(null===r||r===M)return ce(t.toNumber(),0,i);if(k(r))return ce(t.toNumber(),r,i);if(A(r))return ce(t.toNumber(),Ne(r),i);if(D(r))return ce(t.toNumber(),Ne(r),i);if(ne(r))return ce(t.toNumber(),r.toNumber(),i);if(re(r))throw new n("CannotCompareDateAndTime",null)}return!!de(t,r)&&("<="===i||">="===i)}function de(e,t){if(e===t)return!0;if(null===e&&t===M||null===t&&e===M)return!0;if(te(e)&&te(t))return e.equals(t);if(ne(e)&&ne(t))return e.equals(t);if(re(e)&&re(t))return e.equals(t);if(e instanceof o)return e.equalityTest(t);if(e instanceof u)return e.equalityTest(t);if(e instanceof h&&t instanceof h){const r=e.cache._arcadeCacheId,n=t.cache._arcadeCacheId;if(null!=r)return r===n}if(ie(e)&&ie(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function ye(e,{useNumbersForDates:t}){let r="";for(const n in e){""!==r&&(r+=",");const i=e[n];null==i?r+=JSON.stringify(n)+":null":A(i)||k(i)||D(i)?r+=JSON.stringify(n)+":"+JSON.stringify(i):z(i)?r+=JSON.stringify(n)+":"+he(i):ne(i)||re(i)?r+=`${JSON.stringify(n)}:${JSON.stringify(i.toString())}`:ee(i)||Array.isArray(i)?r+=JSON.stringify(n)+":"+he(i,null,t):te(i)?r+=t?JSON.stringify(n)+":"+JSON.stringify(i.getTime()):JSON.stringify(n)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(r+=JSON.stringify(n)+":"+i.castToText(t))}return"{"+r+"}"}function pe(e,t){if(D(e))return e;if(null===e)return"";if(k(e))return se(e,t);if(A(e))return e.toString();if(te(e))return le(e,t);if(ne(e))return e.toFormat(t);if(re(e))return e.toFormat(t);if(e instanceof p)return JSON.stringify(e.toJSON());if(O(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=be(e[r]);return"["+t.join(",")+"]"}if(e instanceof a){const t=[];for(let r=0;r<e.length();r++)t[r]=be(e.get(r));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():I(e)?"object, Function":e===M?"":_(e)?"object, Module":""}function ge(e){const t=[];if(e instanceof a){for(let r=0;r<e.length();r++)t[r]=Ne(e.get(r));return t}if(!O(e))return null;for(let r=0;r<e.length;r++)t[r]=Ne(e[r]);return t}function he(e,t,r=!1){if(D(e))return e;if(null===e)return"";if(k(e))return se(e,t);if(A(e))return e.toString();if(te(e))return le(e,t);if(ne(e))return e.toFormat(t);if(re(e))return e.toFormat(t);if(e instanceof p)return e instanceof y?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+Fe(e.spatialReference)+"}":Fe(e.toJSON(),(e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0);if(O(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=be(e[n],r);return"["+t.join(",")+"]"}if(e instanceof a){const t=[];for(let n=0;n<e.length();n++)t[n]=be(e.get(n),r);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(r):I(e)?"object, Function":e===M?"":_(e)?"object, Module":""}function be(e,t=!1){if(null===e)return"null";if(A(e)||D(e))return JSON.stringify(e);if(k(e))return e.toString();if(e instanceof p)return he(e,null,t);if(e instanceof a)return he(e,null,t);if(Array.isArray(e))return he(e,null,t);if(te(e))return t?JSON.stringify(e.getTime()):JSON.stringify(le(e,""));if(ne(e))return JSON.stringify(e.toString());if(re(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===M)return"null";return"null"}function Ne(e,t){return k(e)?e:null===e||""===e?0:te(e)||re(e)||ne(e)?NaN:A(e)?e?1:0:O(e)||""===e||void 0===e?NaN:void 0!==t&&D(e)?(t=v(t,"‰",""),t=v(t,"¤",""),c(e,{pattern:t})):e===M?0:Number(e)}function Se(t,r){if(te(t))return t;if(D(t)){const n=Ze(t,r);if(n)return e.dateTimeToArcadeDate(n)}return null}function Ze(e,r){const n=/ (\d\d)/,i=t(r);let a=x.fromISO(e,{zone:i});return a.isValid||n.test(e)&&(e=e.replace(n,"T$1"),a=x.fromISO(e,{zone:r}),a.isValid)?a:null}function Te(e){return A(e)?e:D(e)?"true"===(e=e.toLowerCase()):!!k(e)&&(0!==e&&!isNaN(e))}function Ae(e,t){const r=JSON.parse(e);return r&&!r.spatialReference&&(r.spatialReference=t),Z(r)}function ke(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function De(e){if(null===e)return null;if(e instanceof h)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof b){if(0===(e.curveRings??e.rings).length)return null;for(const t of e.curveRings??e.rings)if(t.length>0)return e;return null}if(e instanceof N){if(0===(e.curvePaths??e.paths).length)return null;for(const t of e.curvePaths??e.paths)if(t.length>0)return e;return null}return e instanceof g?0===e.points.length?null:e:e instanceof y?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function Ce(e,t){if(!e)return t;if(!e.domain)return t;let r=null,n=null;if(te(t))r=t.toNumber();else if(re(t))r=t.toString();else if(ne(t))r=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)r=pe(t);else{if(null==t)return null;if(""===t)return t;r=Ne(t)}for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.code===r&&(n=t)}return null===n?pe(t):n.name}function Oe(e,t){if(!e)return t;if(!e.domain)return t;let r=null;const n=pe(t);for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.name===n&&(r=t)}return null===r?t:r.code}function je(e,t,r=null,i=null){if(!t)return null;if(!t.fields)return null;let a,o,u=null;for(let n=0;n<t.fields.length;n++){const r=t.fields[n];r.name.toLowerCase()===e.toString().toLowerCase()&&(u=r)}if(null===u)throw new n("FieldNotFound",null,{key:e});let s=t.typeIdField,l="id",f=t.types;if(t.subtypeField&&(s=t.subtypeField,l="code",f=t.subtypes??[]),null===i&&r&&s)i=r.hasField(s)?r.field(s):null;else if(s&&null!==i){let e=!1;for(const t of f||[])if(i===t[l]){e=!0;break}if(!e)for(const t of f||[])if(i===t.name){i=t[l],e=!0;break}e||(i=null,r&&s&&(i=r.hasField(s)?r.field(s):null))}return null!=i&&f.some(e=>e[l]===i&&(a=e.domains?.[u.name],a&&"inherited"===a.type&&(a=xe(u.name,t),o=!0),!0)),o||a||(a=xe(e,t)),{field:u,domain:a}}function xe(e,t){let r;return t.fields.some(t=>(t.name.toLowerCase()===e.toLowerCase()&&(r=t.domain),!!r)),r}function Fe(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(i=t.cmp,function(e){return function(t,r){const n={key:t,value:e[t]},a={key:r,value:e[r]};return i(n,a)}});var i;const a=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(a.includes(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const u=a.push(t)-1,s=Object.keys(t).sort(n?.(t));for(o="",i=0;i<s.length;i++){const r=s[i],n=e(t[r]);n&&(o&&(o+=","),o+=JSON.stringify(r)+":"+n)}return a.splice(u,1),"{"+o+"}"}(e)}function we(e){if(null===e)return null;const t=[];for(const r of e)q(r)?t.push(r.geometry()):t.push(r);return t}function Je(e,t){if(!(t instanceof h))throw new n("InvalidParameter",null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function Me(e,t){if(O(e)||ee(e)){let r=!1,i=!1,a=[],o=t;if(O(e)){for(const t of e)Je(a,t);a.length>0&&(o=e[0].spatialReference,r=e[0].hasZ,i=e[0].hasM)}else if(e instanceof u)a=e._elements,a.length>0&&(r=e._hasZ,i=e._hasM,o=e.get(0).spatialReference);else{if(!ee(e))throw new n("InvalidParameter",null);for(const t of e.toArray())Je(a,t);a.length>0&&(o=e.get(0).spatialReference,r=!0===e.get(0).hasZ,i=!0===e.get(0).hasM)}if(0===a.length)return null;return S(a)||(a=a.slice().reverse()),new b({rings:[a],spatialReference:o,hasZ:r,hasM:i})}return e}function Re(e,t){if(O(e)||ee(e)){let r=!1,n=!1,i=[],a=t;if(O(e)){for(const t of e)Je(i,t);i.length>0&&(a=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof u)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,a=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())Je(i,t);i.length>0&&(a=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new N({paths:[i],spatialReference:a,hasZ:r,hasM:n})}return e}function Pe(e,t){if(O(e)||ee(e)){let r=!1,n=!1,i=[],a=t;if(O(e)){for(const t of e)Je(i,t);i.length>0&&(a=e[0].spatialReference,r=!0===e[0].hasZ,n=!0===e[0].hasM)}else if(e instanceof u)i=e._elements,i.length>0&&(r=e._hasZ,n=e._hasM,a=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())Je(i,t);i.length>0&&(a=e.get(0).spatialReference,r=!0===e.get(0).hasZ,n=!0===e.get(0).hasM)}return 0===i.length?null:new g({points:i,spatialReference:a,hasZ:r,hasM:n})}return e}function ve(e,t=!0){if(null==e)return[];if(O(e)){const r=[];for(const n of e){const e=pe(n);(t||""!==e)&&r.push(e)}return r}if(ee(e)){const r=[];for(let n=0;n<e.length();n++){const i=pe(e.get(n));(t||""!==i)&&r.push(i)}return r}if(Y(e)){const r=pe(e);if(t||""!==r)return[r]}return[]}let Ie=0;function _e(){return Ie++,Ie%100==0?(Ie=0,new Promise(e=>{setTimeout(()=>{e()},0)})):Promise.resolve()}function Ye(e,t,r){switch(r){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Le(e,t=null){return null==e?null:A(e)||k(e)||D(e)?e:e instanceof p?!0===t?.keepGeometryType?e:e.toJSON():e instanceof a?e.toArray().map(e=>Le(e,t)):Array.isArray(e)?e.map(e=>Le(e,t)):C(e)?e:te(e)?e.toJSDate():ne(e)?e.toString():re(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ge(e,t,r,n,i){const a=await Ve(e,t,r);i[n]=a}async function Ve(e,t=null,r=null){if(e instanceof a&&(e=e.toArray()),null==e)return null;if(Y(e)||e instanceof p||C(e)||te(e))return Le(e,r);if(Array.isArray(e)){const n=[],i=[];for(const a of e)null===a||Y(a)||a instanceof p||C(a)||te(a)?i.push(Le(a,r)):(i.push(null),n.push(Ge(a,t,r,i.length-1,i)));return n.length>0&&await Promise.all(n),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,r):null}function ze(e){return qe(e)?e.parent:e}function qe(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function Ee(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Ue(e,t,r){const n=ze(e.fullSchema());if(null===n)return null;if(!n.fields)return null;return je(t,n,e,r)}function He(e){const t=ze(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(e=>({name:e.name,code:e.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(e=>({name:e.name,code:e.id})):[]}:null:null}function We(e,t,r,n){const i=ze(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const a=je(t,i,e,n);if(void 0===r)try{r=e.field(t)}catch(o){return null}return Ce(a,r)}function $e(e,t,r,n){const i=ze(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===r){try{r=e.field(t)}catch(a){return null}return r}return Oe(je(t,i,e,n),r)}function Be(e){return e?.timeZone??"system"}function Ke(e){const t=ze(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const r=[];for(const n of t.fields)r.push(s(n));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===l[t.geometryType]?"":l[t.geometryType],fields:r}}const Qe="1.35",Xe=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:J,ReturnResult:w,absRound:ue,arcadeVersion:Qe,autoCastArrayOfPointsToMultiPoint:Pe,autoCastArrayOfPointsToPolygon:Me,autoCastArrayOfPointsToPolyline:Re,autoCastFeatureToGeometry:we,binaryOperator:Ye,breakResult:R,castAsJson:Le,castAsJsonAsync:Ve,castRecordToText:ye,continueResult:P,defaultTimeZone:Be,defaultUndefined:L,equalityTest:de,featureDomainCodeLookup:$e,featureDomainValueLookup:We,featureFullDomain:Ue,featureSchema:Ke,featureSubtypes:He,fixNullGeometry:De,fixSpatialReference:ke,formatDate:le,formatNumber:se,getDomain:je,getDomainCode:Oe,getDomainValue:Ce,getType:G,greaterThanLessThan:me,isArray:O,isAttachment:B,isBoolean:A,isDate:te,isDateOnly:re,isDictionary:W,isDictionaryLike:K,isEmpty:oe,isFeature:q,isFeatureSet:H,isFeatureSetCollection:Q,isFunctionParameter:I,isGeometry:z,isGraphic:F,isImmutableArray:ee,isInteger:j,isJsDate:C,isKnowledgeGraph:X,isModule:_,isNumber:k,isObject:ie,isPixel:U,isPortal:$,isSimpleType:Y,isString:D,isSubtypeGrouplayer:Ee,isSubtypeSublayer:qe,isTime:ne,isVoid:V,isVoxel:E,multiReplace:v,parseGeometryFromJson:Ae,pcCheck:ae,stableStringify:Fe,standardiseDateFormat:fe,tick:_e,toBoolean:Te,toDate:Se,toNumber:Ne,toNumberArray:ge,toString:pe,toStringArray:ve,toStringExplicit:he,voidOperation:M},Symbol.toStringTag,{value:"Module"}));export{E as $,Ce as A,G as B,me as C,B as D,te as E,re as F,W as G,K as H,J as I,oe as J,q as K,H as L,Q as M,I as N,z as O,ee as P,X as Q,w as R,_ as S,ie as T,U,$ as V,Y as W,Ee as X,qe as Y,ne as Z,V as _,ue as a,Xe as a0,v as a1,Ae as a2,ae as a3,Fe as a4,fe as a5,_e as a6,Te as a7,Se as a8,Ne as a9,ge as aa,pe as ab,ve as ac,he as ad,M as ae,Qe as b,Pe as c,Me as d,Re as e,we as f,Ye as g,R as h,Le as i,Ve as j,ye as k,P as l,Be as m,L as n,de as o,$e as p,We as q,Ue as r,Ke as s,He as t,De as u,ke as v,le as w,se as x,je as y,Oe as z};
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.111";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.112";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{substitute as e}from"../intl.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import{getCalciteModeClass as s}from"../support/modeUtils.js";import n from"../widgets/Widget.js";import{loadCalciteComponents as r}from"../widgets/support/componentsUtils.js";import{messageBundle as l,tsx as a}from"../widgets/support/widget.js";import{setFocus as c}from"../widgets/support/widgetUtils.js";const p="esri-identity-modal",d={base:p,info:`${p}__info`,notice:`${p}__notice`},u="ArcGIS Online";let m=class extends n{constructor(t,e){super(t,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return r({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:t,title:o,messages:i,signingIn:n,oAuthPrompt:r,server:l,resource:c,error:p}=this,{info:m,oAuthInfo:h,lblItem:g,invalidUser:b,noAuthService:v,lblUser:f,lblPwd:_,lblCancel:I,lblSigning:y,lblOk:w}=i;return a("div",{class:this.classes(d.base,s(this.container))},a("form",{bind:this,onsubmit:this._submit},a("calcite-dialog",{bind:this,heading:o,modal:!0,open:t,outsideCloseDisabled:!0,scale:"s",width:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},a("div",{class:d.info},e(r?h:m,{server:l&&/\.arcgis\.com/i.test(l)?u:l,resource:`(${c||g})`})),p?a("calcite-notice",{class:d.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},a("div",{slot:"message"},p.details?.httpStatus?b:v)):null,r?null:[a("calcite-label",null,f,a("calcite-input",{afterCreate:t=>this._usernameInputNode=t,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),a("calcite-label",null,_,a("calcite-input",{afterCreate:t=>this._passwordInputNode=t,bind:this,name:"password",required:!0,type:"password",value:""}))],a("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},I),a("calcite-button",{loading:!!n,slot:"footer-end",type:"submit"},n?y:w))))}_focusUsernameInput(){return c(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(t){t.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};t([o({readOnly:!0})],m.prototype,"container",void 0),t([o(),l("esri/t9n/common")],m.prototype,"commonMessages",void 0),t([o()],m.prototype,"error",void 0),t([o(),l("esri/identity/t9n/identity")],m.prototype,"messages",void 0),t([o()],m.prototype,"oAuthPrompt",void 0),t([o()],m.prototype,"open",void 0),t([o()],m.prototype,"signingIn",void 0),t([o()],m.prototype,"server",void 0),t([o({readOnly:!0})],m.prototype,"title",null),t([o()],m.prototype,"resource",void 0),m=t([i("esri.identity.IdentityModal")],m);const h=m;export{h as default};
2
+ import{__decorate as t}from"tslib";import{substitute as e}from"../intl.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import{getCalciteModeClass as s}from"../support/modeUtils.js";import n from"../widgets/Widget.js";import{loadCalciteComponents as r}from"../widgets/support/componentsUtils.js";import{messageBundle as l,tsx as a}from"../widgets/support/widget.js";import{setFocus as c}from"../widgets/support/widgetUtils.js";const p="esri-identity-modal",d={base:p,info:`${p}__info`,notice:`${p}__notice`},u="ArcGIS Online";let m=class extends n{constructor(t,e){super(t,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return r({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:t,title:o,messages:i,signingIn:n,oAuthPrompt:r,server:l,resource:c,error:p}=this,{info:m,oAuthInfo:h,lblItem:g,invalidUser:b,noAuthService:v,lblUser:f,lblPwd:_,lblCancel:I,lblSigning:y,lblOk:w}=i;return a("div",{class:this.classes(d.base,s(this.container))},a("form",{bind:this,onsubmit:this._submit},a("calcite-dialog",{bind:this,heading:o,modal:!0,open:t,outsideCloseDisabled:!0,scale:"s",width:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},a("div",{class:d.info},e(r?h:m,{server:l&&/\.arcgis\.com/i.test(l)?u:l,resource:`(${c||g})`})),p?a("calcite-notice",{class:d.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},a("div",{slot:"message"},p.details?.httpStatus?b:v)):null,r?null:[a("calcite-label",null,f,a("calcite-input",{afterCreate:t=>this._usernameInputNode=t,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),a("calcite-label",null,_,a("calcite-input",{afterCreate:t=>this._passwordInputNode=t,bind:this,name:"password",required:!0,type:"password",value:""}))],a("calcite-button",{appearance:"outline",bind:this,slot:"footer-end",type:"button",onclick:this._cancel},I),a("calcite-button",{loading:!!n,slot:"footer-end",type:"submit"},n?y:w))))}_focusUsernameInput(){return c(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(t){t.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};t([o({readOnly:!0})],m.prototype,"container",void 0),t([o(),l("esri/t9n/common")],m.prototype,"commonMessages",void 0),t([o()],m.prototype,"error",void 0),t([o(),l("esri/identity/t9n/identity")],m.prototype,"messages",void 0),t([o()],m.prototype,"oAuthPrompt",void 0),t([o()],m.prototype,"open",void 0),t([o()],m.prototype,"signingIn",void 0),t([o()],m.prototype,"server",void 0),t([o({readOnly:!0})],m.prototype,"title",null),t([o()],m.prototype,"resource",void 0),m=t([i("esri.identity.IdentityModal")],m);const h=m;export{h as default};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.111",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.112",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import r from"../core/Error.js";import has from"../core/has.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as l}from"../core/reactiveUtils.js";import{property as p,subclass as m}from"../core/accessorSupport/decorators.js";import{persistable as c}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import h from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as j,url as T}from"./support/commonProperties.js";import w from"./support/SceneModifications.js";import{default3DTilesSpatialReference as b,default3DTilesFullExtent as L,initFullExtent as x}from"./support/tiles3DUtils.js";import P from"../portal/Portal.js";import{logInvalidElevationInfoWarning as I,elevationModeRequiredMessage as k,featureExpressionUnsupportedMessage as R}from"../support/elevationInfoUtils.js";import{a as D}from"../chunks/persistableUrlUtils.js";import{isBasemap as U}from"../support/userTypeGuards/isBasemap.js";import{initialize as E,switchMeshModificationPolygonVCSSync as O}from"../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as M,fromWasmModification as q}from"../views/3d/layers/SceneLayerWorkerHandle.js";import{reader as A}from"../core/accessorSupport/decorators/reader.js";let G=class extends(y(S(_(v(s(g(f(o(h))))))))){readModifications(e,t,o){this._modificationsSource={url:D(e,o),context:o}}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,l))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=b,this.fullExtent=L,this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null,this.queryElevationCallback=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[r,i]of Object.entries(e)){if("uri"===r)try{const e=new URL("https://tmp"+i).searchParams.get("session");if(e)return e}catch(o){}"object"==typeof i&&null!==i&&t.push(i)}}return null}async requestRootAndSession(e){const o=(e,t)=>new r("3dtiles-init:"+e,t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((r,s)=>{this.url||s(o("url-missing","Layer url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,r)=>{if(this.replacesTerrain&&!this._key){const i=this.portalItem?.portal||this.parent?.portalItem?.portal||P.getDefault();i.signIn().then(()=>{i.g3dTilesEnabled?t(i.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>r(o("g3dtiles-key-error","Error fetching Google 3D Tiles key from portal"))):r(o("g3dTilesEnabled-false","Google 3D Tiles are not enabled on Portal "+i.url))},()=>r(o("sign-in-failed","Error signing in to Portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{try{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data))}catch(t){return void s(o("root-parse-failed","Error parsing root tile, details: "+t))}this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=x(this._rootTilesetJSON),r(),this._rootRequestPromise=null):s(o("root-is-null","Root tile is null."))},e=>{a(e),s(o("root-load-failed","Error loading root tile")),this._rootRequestPromise=null,i.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>s(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;if(this.isUsedAsGroundLayer&&!has("enable-feature:basemap-groundlayers"))throw new r("3dtiles-init:not-supported-in-groundlayers","Layer is not supported in basemap.");try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new r("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){a(o)}if(null!=this._modificationsSource){const t=await w.fromUrl(this._modificationsSource.url,this.spatialReference,e);if(t&&t.length>0){await E();try{const e=M(null,t.toArray(),this.spatialReference),o=O({modifications:e,inVCS:115700});o.success&&o.modifications&&q(o.modifications,t)}catch(s){i.getLogger(this).error("convert-mesh-modification-z-error","Error when converting:",s)}null!=this._modificationsSource&&this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}}await this.requestRootAndSession(t)}async beforeSave(){if(null==this._modificationsSource){const{modifications:e}=this;return void(e&&e.length>0&&await E())}await this.load().then(()=>{},()=>{})}get hasAttributionData(){return!1}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";I(i.getLogger(this),k(t,"absolute-height",e)),I(i.getLogger(this),R(t,e))}get replacesTerrain(){return!!has("enable-feature:basemap-groundlayers")&&this.hasGoogleUrl&&this.isUsedAsGroundLayer}get isUsedAsGroundLayer(){return U(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([p({type:["IntegratedMesh3DTilesLayer"]})],G.prototype,"operationalLayerType",void 0),e([p({type:w,clonable:e=>e?.clone()??null}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],G.prototype,"modifications",void 0),e([p({clonable:e=>e?{...e}:null})],G.prototype,"_modificationsSource",void 0),e([A(["web-scene","portal-item"],"modifications")],G.prototype,"readModifications",null),e([p({type:u})],G.prototype,"spatialReference",void 0),e([p({type:d})],G.prototype,"fullExtent",void 0),e([p(j)],G.prototype,"elevationInfo",null),e([p({type:["show","hide"]})],G.prototype,"listMode",void 0),e([p(T)],G.prototype,"url",void 0),e([p({readOnly:!0})],G.prototype,"type",void 0),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],G.prototype,"path",void 0),e([p({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],G.prototype,"minScale",void 0),e([p({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],G.prototype,"maxScale",void 0),e([p({readOnly:!0})],G.prototype,"hasAttributionData",null),e([p()],G.prototype,"replacesTerrain",null),e([p()],G.prototype,"isUsedAsGroundLayer",null),e([p()],G.prototype,"hasGoogleUrl",null),G=e([m("esri.layers.IntegratedMesh3DTilesLayer")],G);const N=G;export{N as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import{ClonableMixin as r}from"../core/Clonable.js";import i from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as n}from"../core/promiseUtils.js";import{on as a,sync as l}from"../core/reactiveUtils.js";import{property as p,subclass as c}from"../core/accessorSupport/decorators.js";import{persistable as m}from"../core/accessorSupport/decorators/persistable.js";import u from"../geometry/Extent.js";import d from"../geometry/SpatialReference.js";import h from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as j,url as T}from"./support/commonProperties.js";import x from"./support/SceneModifications.js";import{default3DTilesSpatialReference as w,default3DTilesFullExtent as b,initFullExtent as R,hasEsriCrs as L}from"./support/tiles3DUtils.js";import E from"../portal/Portal.js";import{logInvalidElevationInfoWarning as P,elevationModeRequiredMessage as k,featureExpressionUnsupportedMessage as I}from"../support/elevationInfoUtils.js";import{a as O}from"../chunks/persistableUrlUtils.js";import{isBasemap as D}from"../support/userTypeGuards/isBasemap.js";import{initialize as U,switchMeshModificationPolygonVCSSync as M}from"../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as C,fromWasmModification as G}from"../views/3d/layers/SceneLayerWorkerHandle.js";import{reader as N}from"../core/accessorSupport/decorators/reader.js";let q=class extends(y(S(_(v(s(g(f(r(h))))))))){readModifications(e,t,r){this._modificationsSource={url:O(e,r),context:r}}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,l))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=w,this.fullExtent=b,this.esriCrsSpatialReference=null,this.esriCrsFullExtent=null,this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null,this.queryElevationCallback=null}get supportedSpatialReferences(){return this.initialized&&this.esriCrsSpatialReference?[w,this.esriCrsSpatialReference]:[w]}get fullExtents(){return this.initialized&&this.esriCrsFullExtent?[b,this.esriCrsFullExtent]:[b]}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[i,o]of Object.entries(e)){if("uri"===i)try{const e=new URL("https://tmp"+o).searchParams.get("session");if(e)return e}catch(r){}"object"==typeof o&&null!==o&&t.push(o)}}return null}async requestRootAndSession(e){const r=(e,t)=>new i("3dtiles-init:"+e,t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((i,s)=>{this.url||s(r("url-missing","Layer url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,i)=>{if(this.replacesTerrain&&!this._key){const o=this.portalItem?.portal||this.parent?.portalItem?.portal||E.getDefault();o.signIn().then(()=>{o.g3dTilesEnabled?t(o.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>i(r("g3dtiles-key-error","Error fetching Google 3D Tiles key from portal"))):i(r("g3dTilesEnabled-false","Google 3D Tiles are not enabled on Portal "+o.url))},()=>i(r("sign-in-failed","Error signing in to Portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{try{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data))}catch(t){return void s(r("root-parse-failed","Error parsing root tile, details: "+t))}if(!this._rootTilesetJSON)return void s(r("root-is-null","Root tile is null."));this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=R(this._rootTilesetJSON);L(this._rootTilesetJSON)&&(this.esriCrsFullExtent=R(this._rootTilesetJSON,!0),this.esriCrsSpatialReference=this.esriCrsFullExtent.spatialReference,this.spatialReference=this.esriCrsSpatialReference),i(),this._rootRequestPromise=null},e=>{n(e),s(r("root-load-failed","Error loading root tile")),this._rootRequestPromise=null,o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>s(e))})),this._rootRequestPromise}_haveWGS84ZModifications(e){for(const t of e){if(!t.geometry?.spatialReference)return!0;if(115700===t.geometry?.spatialReference.vcsWkid&&4326===t.geometry?.spatialReference.wkid)return!0}return!1}async _doLoad(e){const t=null!=e?e.signal:null;if(this.isUsedAsGroundLayer&&!has("enable-feature:basemap-groundlayers"))throw new i("3dtiles-init:not-supported-in-groundlayers","Layer is not supported in basemap.");try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(r){n(r)}if(null!=this._modificationsSource){const t=await x.fromUrl(this._modificationsSource.url,this.spatialReference,e,!0);if(this._haveWGS84ZModifications(t)){await U();try{const e=C(null,t.toArray(),d.WGS84),r=M({modifications:e,inVCS:115700});r.success&&r.modifications&&G(r.modifications,t)}catch(s){o.getLogger(this).error("convert-mesh-modification-z-error","Error when converting:",s)}}this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this.requestRootAndSession(t)}async beforeSave(){if(null==this._modificationsSource){const{modifications:e}=this;return void(e&&e.length>0&&await U())}await this.load().then(()=>{},()=>{})}get hasAttributionData(){return!1}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";P(o.getLogger(this),k(t,"absolute-height",e)),P(o.getLogger(this),I(t,e))}get replacesTerrain(){return!!has("enable-feature:basemap-groundlayers")&&this.hasGoogleUrl&&this.isUsedAsGroundLayer}get isUsedAsGroundLayer(){return D(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([p({type:["IntegratedMesh3DTilesLayer"]})],q.prototype,"operationalLayerType",void 0),e([p({type:x,clonable:e=>e?.clone()??null}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],q.prototype,"modifications",void 0),e([p({clonable:e=>e?{...e}:null})],q.prototype,"_modificationsSource",void 0),e([N(["web-scene","portal-item"],"modifications")],q.prototype,"readModifications",null),e([p({type:d})],q.prototype,"spatialReference",void 0),e([p({type:u})],q.prototype,"fullExtent",void 0),e([p({readOnly:!0})],q.prototype,"supportedSpatialReferences",null),e([p({type:[u]})],q.prototype,"fullExtents",null),e([p(j)],q.prototype,"elevationInfo",null),e([p({type:["show","hide"]})],q.prototype,"listMode",void 0),e([p(T)],q.prototype,"url",void 0),e([p({readOnly:!0})],q.prototype,"type",void 0),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],q.prototype,"path",void 0),e([p({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],q.prototype,"minScale",void 0),e([p({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],q.prototype,"maxScale",void 0),e([p({readOnly:!0})],q.prototype,"hasAttributionData",null),e([p()],q.prototype,"replacesTerrain",null),e([p()],q.prototype,"isUsedAsGroundLayer",null),e([p()],q.prototype,"hasGoogleUrl",null),q=e([c("esri.layers.IntegratedMesh3DTilesLayer")],q);const A=q;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../request.js";import{has}from"../applications/Components/baUtils.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as w}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as f}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as b}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as R}from"../views/support/Scheduler.js";import{Yield as k}from"../views/support/Yield.js";const L=3857,C=32662,S=4326,W=5773;let j=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._haveAddedViewSRForNoOpPrj=!1,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get viewSR(){return this._viewSR}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(R.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._jobDataBufferPtr&&(this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0),this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),k}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=this._isUpdating(t);t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);t&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i),t.needFrame=!0,t.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();let d="global"===this.view.viewingMode?6:4;6===d?(this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W,this._viewSR.wkt=""):(this._viewSR.vcsWkid||(this._viewSR.vcsWkid=b(this.view.heightModelInfo)),this.view.renderSpatialReference?.isWebMercator?(this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this.view.renderSpatialReference?.wkid===C?(this._viewSR.wkid=this._viewSR.latestWkid=S,d=3,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this._viewSR.vcsWkid||this._viewSR.latestVcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=-1));const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new f(M(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0,t.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{o(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(n()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(e){const i=this._lyr3DMain;if(i){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:t,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:t,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};i.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;i.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let t=0,s=0;this._layers.forEach(e=>{t+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),t/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-t-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,t,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,i){for(;!i.done&&e.length>0;){e.shift()(this._lyr3DMain),i.madeProgress()}}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&!e.layerView.destroyed&&this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc)),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc));const{data:s}=i,r=e=>{const r=s.byteLength,a=this._ensureJobDataBuffer(r);new Uint8Array(e.HEAPU8.buffer,a,r).set(s),e.on_job_completed(t.jobId,i.jobDescJson,a,r)};this._pendingJobCompleted.push(r)}this._decrementJobCount(e,t)}_ensureJobDataBuffer(e){return e<=this._jobDataBufferCapacity&&this._jobDataBufferPtr||(this._jobDataBufferPtr&&this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=this._lyr3DMain._malloc(e),this._jobDataBufferCapacity=e),this._jobDataBufferPtr}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const o=this._getRequestPromises(e.urls,i,t,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const i of e)o.inputs.push(i);return this._workerHandle.invoke(o,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc))})}};try{const i=await this._getInitialPromise(e,n,d,s,o,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,d,s,o,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc)),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{if(this._lyr3DMain&&!t.layerView.destroyed){const{layerId:t,handle:s}=e;this._pendingRenderableCreated.push(e=>{const r=i(),{memUsageBytes:a}=r;e.on_renderable_created(!0,t,s,a,r.numGaussians??0)})}}).catch(i=>{if(l(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain&&!t.layerView.destroyed){const{layerId:i,handle:t}=e;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!1,i,t,0,0))}}).finally(()=>{this._decrementRenderableCount(t)}))}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:w};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:w,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=u(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=c.values[c[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),!this._haveAddedViewSRForNoOpPrj&&t.vcsWkid&&this._viewSR.vcsWkid&&-1!==this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&(this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d),this._haveAddedViewSRForNoOpPrj=!0)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:w})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],j.prototype,"view",void 0),e([h({readOnly:!0})],j.prototype,"isTerrainReady",null),j=e([_("esri.layers.Lyr3DWasmPerSceneView")],j);const V=j;export{V as default};
2
+ import{__decorate as e}from"tslib";import i from"../request.js";import{has}from"../applications/Components/baUtils.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as w}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as f}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as b}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as L}from"../views/support/Scheduler.js";import{Yield as R}from"../views/support/Yield.js";const k=3857,C=32662,S=4326,W=5773;let j=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._haveAddedViewSRForNoOpPrj=!1,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get viewSR(){return this._viewSR}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(L.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._jobDataBufferPtr&&(this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0),this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),R}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=this._isUpdating(t);t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);t&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i),t.needFrame=!0,t.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();let d="global"===this.view.viewingMode?6:4;6===d?(this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W,this._viewSR.wkt=""):(this._viewSR.vcsWkid||(this._viewSR.vcsWkid=b(this.view.heightModelInfo)),this.view.renderSpatialReference?.isWebMercator?(this._viewSR.wkid=this._viewSR.latestWkid=k,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this.view.renderSpatialReference?.wkid===C?(this._viewSR.wkid=this._viewSR.latestWkid=S,d=3,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this._viewSR.vcsWkid||this._viewSR.latestVcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=-1));const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new f(M(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0,t.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===k?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{o(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(n()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(e){const i=this._lyr3DMain;if(i){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:t,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:t,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};i.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;i.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let t=0,s=0;this._layers.forEach(e=>{t+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),t/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-t-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,t,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,i){for(;!i.done&&e.length>0;){e.shift()(this._lyr3DMain),i.madeProgress()}}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&!e.layerView.destroyed&&this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc)),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc));const{data:s}=i,r=e=>{const r=s.byteLength,a=this._ensureJobDataBuffer(r);new Uint8Array(e.HEAPU8.buffer,a,r).set(s),e.on_job_completed(t.jobId,i.jobDescJson,a,r)};this._pendingJobCompleted.push(r)}this._decrementJobCount(e,t)}_ensureJobDataBuffer(e){return e<=this._jobDataBufferCapacity&&this._jobDataBufferPtr||(this._jobDataBufferPtr&&this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=this._lyr3DMain._malloc(e),this._jobDataBufferCapacity=e),this._jobDataBufferPtr}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const o=this._getRequestPromises(e.urls,i,t,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const i of e)o.inputs.push(i);return this._workerHandle.invoke(o,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc))})}};try{const i=await this._getInitialPromise(e,n,d,s,o,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,d,s,o,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc)),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{if(this._lyr3DMain&&!t.layerView.destroyed){const{layerId:t,handle:s}=e;this._pendingRenderableCreated.push(e=>{const r=i(),{memUsageBytes:a}=r;e.on_renderable_created(!0,t,s,a,r.numGaussians??0)})}}).catch(i=>{if(l(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain&&!t.layerView.destroyed){const{layerId:i,handle:t}=e;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!1,i,t,0,0))}}).finally(()=>{this._decrementRenderableCount(t)}))}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_is3DTilesIMLayer(e){return"integrated-mesh-3dtiles"===e.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:w};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:w,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)||this._is3DTilesIMLayerView(e)&&this._is3DTilesIMLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=u(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=c.values[c[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),!this._haveAddedViewSRForNoOpPrj&&t.vcsWkid&&this._viewSR.vcsWkid&&-1!==this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&(this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d),this._haveAddedViewSRForNoOpPrj=!0)}this._isGaussianSplatLayerView(e)?h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o):this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")))}return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:w})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],j.prototype,"view",void 0),e([h({readOnly:!0})],j.prototype,"isTerrainReady",null),j=e([_("esri.layers.Lyr3DWasmPerSceneView")],j);const V=j;export{V as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const t={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:{envelope:!0,centroid:!0,convexHull:!0},supportsStatisticsAggregatedIds:!0,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsOutDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},s={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}};export{s as queryBinsCapabilities,t as queryCapabilities};
2
+ const t={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:{envelope:!0,centroid:!0,convexHull:!0},supportsStatisticsAggregatedIds:!0,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},s={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}};export{s as queryBinsCapabilities,t as queryCapabilities};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../request.js";import{FileProvider as e}from"./FileProvider.js";const s=100;class r extends e{constructor(t,e){super(e),this._schema=t}get _baseUrl(){return this._schema.itemCdnUrl??this._schema.itemUrl}async getFileList(){const t=await this._getResources();return Array.from(t.keys())}async getResource(t){const e=(await this._getResources()).get(t);if(!e)throw new Error(`Resource ${t} not found.`);return e}async fetchLength(t){return(await this.getResource(t)).size}async fetchRange(t,e,s,r){try{return await super.fetchRange(t,e,s,r)}catch{this._invalidate()}return super.fetchRange(t,e,s,r)}async _resolveFileUrl(t){return(await this.getResource(t)).signedUrl}_invalidate(){this._resources=null,this._itemData=null}async _getResources(){return this._resources||(this._resources=this._fetchResources()),await this._resources}async _getItemData(){return this._itemData||(this._itemData=this._fetchItemData()),await this._itemData}async _fetchItemData(){const{data:e}=await t(`${this._baseUrl}/data`);return e}async _fetchResources(){const e=this._getItemData(),r=new Map;let a=1;for(;-1!==a;){const i=await t(`${this._baseUrl}/resources`,{query:{f:"json",start:a,num:s}}),c=`${(await e).directory}/`;for(const t of i.data.resources)t.resource.startsWith(c)&&r.set(t.resource,t);a=i.data.nextStart}return r}}export{r as PortalParquetResourcesFileProvider};
2
+ import e from"../../../../request.js";import{FileProvider as t}from"./FileProvider.js";const r=100;class s extends t{constructor(e,t){super(t),this._schema=e}get _baseUrl(){return this._schema.itemCdnUrl??this._schema.itemUrl}async getFileList(){const e=await this._getResources();return Array.from(e.keys())}async getResource(e){const t=(await this._getResources()).get(e);if(!t)throw new Error(`Resource ${e} not found.`);return t}async fetchLength(e){return(await this.getResource(e)).size}async fetchRange(e,t,r,s){try{return await super.fetchRange(e,t,r,s)}catch{this._invalidate()}return super.fetchRange(e,t,r,s)}async _resolveFileUrl(e){return(await this.getResource(e)).signedUrl}_invalidate(){this._resources=null}async _getResources(){return this._resources||(this._resources=this._fetchResources()),await this._resources}async _fetchResources(){const t=new Map;let s=1;const n=o(this._schema.itemMetadata.url);for(;-1!==s;){const o=await e(`${this._baseUrl}/resources`,{query:{f:"json",start:s,num:r}});for(const e of o.data.resources)e.resource.startsWith(n)&&t.set(e.resource,e);s=o.data.nextStart}return t}}function o(e){const t=e.split("/").filter(Boolean),r=t.indexOf("resources");if(-1===r||r===t.length-1)throw new Error(`URL does not contain a resources directory name: ${e}`);return`${t.slice(r+1).map(e=>decodeURIComponent(e)).join("/")}/`}export{s as PortalParquetResourcesFileProvider};