@arcgis/core 5.0.0-next.10 → 5.0.0-next.12

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 (414) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  4. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  5. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  6. package/arcade/functions/geomasync.js +1 -1
  7. package/arcade/functions/geomsync.js +1 -1
  8. package/arcade/functions/knowledgegraph.js +1 -1
  9. package/arcade/geometry/nearestVertex.js +5 -0
  10. package/arcade/geometry/operators.js +1 -1
  11. package/arcade/geometry/operatorsWorker.js +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  17. package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
  19. package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
  20. package/assets/esri/core/workers/chunks/092d72caf3269e696d1c.js +1 -0
  21. package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
  27. package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
  28. package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
  29. package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
  30. package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
  31. package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
  32. package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
  33. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
  34. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
  35. package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
  36. package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
  37. package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
  38. package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
  39. package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
  40. package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
  41. package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
  43. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  44. package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
  45. package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
  46. package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
  47. package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
  48. package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  50. package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
  51. package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
  52. package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
  53. package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
  54. package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
  58. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
  59. package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
  60. package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
  61. package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
  64. package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
  66. package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
  67. package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
  69. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
  70. package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
  76. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
  77. package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
  78. package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
  79. package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
  80. package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
  81. package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
  82. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  83. package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
  84. package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
  87. package/assets/esri/core/workers/chunks/8cd03b54b2859b52fb81.js +1 -0
  88. package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
  89. package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
  90. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
  91. package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
  92. package/assets/esri/core/workers/chunks/9978ec6c67e87dc08a1d.js +1 -0
  93. package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
  94. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  95. package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
  99. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  100. package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
  102. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
  103. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  104. package/assets/esri/core/workers/chunks/b193de09e005b0976a6a.js +1 -0
  105. package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
  106. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
  108. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  109. package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
  110. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  111. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
  112. package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
  113. package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
  114. package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
  115. package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
  116. package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{4fb5f1c671892001a4fd.js → c9579d607e59bae214da.js} +1 -1
  118. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  119. package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
  120. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
  121. package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
  122. package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
  123. package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
  124. package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
  125. package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
  126. package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
  127. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
  128. package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
  129. package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
  130. package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
  132. package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
  133. package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
  134. package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
  135. package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
  136. package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
  139. package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
  140. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
  141. package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
  142. package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
  143. package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
  144. package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
  145. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  146. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  147. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  148. package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
  149. package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
  150. package/assets/esri/themes/dark/main.css +1 -1
  151. package/assets/esri/themes/light/main.css +1 -1
  152. package/assets/esri/themes/light/view.css +1 -1
  153. package/chunks/Envelope.js +1 -1
  154. package/chunks/Geometry.js +1 -1
  155. package/chunks/MultiPathImpl.js +1 -1
  156. package/chunks/Point2D.js +1 -1
  157. package/chunks/UnitFactory.js +1 -1
  158. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  159. package/chunks/arcgis-knowledge-client-core.js +1 -1
  160. package/chunks/containsOperator.js +1 -1
  161. package/chunks/densifyOperator.js +1 -1
  162. package/chunks/differenceOperator.js +1 -1
  163. package/chunks/intersectsOperator.js +1 -1
  164. package/chunks/persistableUrlUtils.js +1 -1
  165. package/config.js +1 -1
  166. package/core/XHRAdapter.js +1 -1
  167. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  168. package/core/quantityFormatUtils.js +1 -1
  169. package/core/unitFormatUtils.js +1 -1
  170. package/core/unitUtils.js +1 -1
  171. package/editing/fieldUtils.js +5 -0
  172. package/geometry/Extent.js +1 -1
  173. package/geometry/Geometry.js +1 -1
  174. package/geometry/Mesh.js +1 -1
  175. package/geometry/Point.js +1 -1
  176. package/geometry/SpatialReference.js +1 -1
  177. package/geometry/ellipsoidUtils.js +1 -1
  178. package/geometry/operators/support/jsonConverter.js +1 -1
  179. package/geometry/support/MeshTransform.js +1 -1
  180. package/geometry/support/axisAngleDegrees.js +1 -1
  181. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  182. package/geometry/support/meshUtils/rotate.js +1 -1
  183. package/geometry/support/meshUtils/scale.js +1 -1
  184. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  185. package/geometry/support/plane.js +1 -1
  186. package/geometry/support/polygonUtils.js +1 -1
  187. package/interfaces.d.ts +114 -11
  188. package/kernel.js +1 -1
  189. package/layers/KnowledgeGraphLayer.js +1 -1
  190. package/layers/Layer.js +1 -1
  191. package/layers/LinkChartLayer.js +1 -1
  192. package/layers/MapNotesLayer.js +1 -1
  193. package/layers/graphics/data/QueryEngine.js +1 -1
  194. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  195. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  196. package/layers/save/groupLayerUtils.js +1 -1
  197. package/layers/save/imageryUtils.js +1 -1
  198. package/layers/save/streamLayerUtils.js +1 -1
  199. package/layers/support/DateTimeFieldFormat.js +1 -1
  200. package/layers/support/FieldFormat.js +1 -1
  201. package/layers/support/LayerLoadContext.js +1 -1
  202. package/layers/support/NumberFieldFormat.js +1 -1
  203. package/layers/support/arcgisLayerUrl.js +1 -1
  204. package/layers/support/arcgisLayers.js +1 -1
  205. package/layers/support/fetchService.js +1 -1
  206. package/layers/support/fieldFormatUtils.js +1 -1
  207. package/layers/support/fieldUtils.js +1 -1
  208. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  209. package/layers/video/VideoCameraSensorModel.js +1 -1
  210. package/networks/support/UNTraceConfiguration.js +1 -1
  211. package/package.json +1 -1
  212. package/popup/ExpressionInfo.js +1 -1
  213. package/popup/FieldInfo.js +1 -1
  214. package/popup/content/AttachmentsContent.js +1 -1
  215. package/popup/content/BarChartMediaInfo.js +1 -1
  216. package/popup/content/ColumnChartMediaInfo.js +1 -1
  217. package/popup/content/Content.js +1 -1
  218. package/popup/content/CustomContent.js +1 -1
  219. package/popup/content/ExpressionContent.js +1 -1
  220. package/popup/content/FieldsContent.js +1 -1
  221. package/popup/content/ImageMediaInfo.js +1 -1
  222. package/popup/content/LineChartMediaInfo.js +1 -1
  223. package/popup/content/MediaContent.js +1 -1
  224. package/popup/content/PieChartMediaInfo.js +1 -1
  225. package/popup/content/RelationshipContent.js +1 -1
  226. package/popup/content/TextContent.js +1 -1
  227. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  228. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  229. package/popup/content/mixins/MediaInfo.js +1 -1
  230. package/popup/content.js +1 -1
  231. package/popup/support/FieldInfoFormat.js +1 -1
  232. package/portal/support/layersLoader.js +1 -1
  233. package/request/cors.js +5 -0
  234. package/request/loadImage.js +5 -0
  235. package/request/preferredHosts.js +5 -0
  236. package/request/process.js +5 -0
  237. package/request/queue.js +5 -0
  238. package/request/serviceJSON.js +5 -0
  239. package/request.js +1 -1
  240. package/rest/geometryService/utils.js +1 -1
  241. package/rest/knowledgeGraphService.d.ts +1 -0
  242. package/support/getDefaultUnitForView.js +1 -1
  243. package/support/popupUtils.js +1 -1
  244. package/support/revision.js +1 -1
  245. package/symbols/support/symbolUtils.js +1 -1
  246. package/time/TimeExtent.js +1 -1
  247. package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
  248. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
  249. package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
  250. package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
  251. package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
  252. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
  253. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
  254. package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
  255. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  256. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  257. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  258. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  259. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  260. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  261. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  262. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  263. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  264. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  265. package/views/3d/environment/CloudsRenderer.js +1 -1
  266. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  267. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  268. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  269. package/views/3d/layers/FlowSubView3D.js +1 -1
  270. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  271. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  272. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  273. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  274. package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
  275. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  276. package/views/3d/support/StreamTextureCollection.js +1 -1
  277. package/views/3d/support/flow/geometryUtils.js +1 -1
  278. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  279. package/views/3d/terrain/TerrainSurface.js +1 -1
  280. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  281. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  282. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  283. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  284. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  285. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  286. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  287. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  288. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  289. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  290. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  291. package/views/View2D.js +1 -1
  292. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  293. package/views/analysis/ElevationProfile/constants.js +1 -1
  294. package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
  295. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  296. package/views/draw/DrawOperation.js +1 -1
  297. package/views/draw/support/tooltipUtils.js +1 -1
  298. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  299. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  300. package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
  301. package/views/magnifier/resources.js +1 -1
  302. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  303. package/webdoc/support/webdocSaveUtils.js +1 -1
  304. package/widgets/BasemapLayerList.js +1 -1
  305. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  306. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  307. package/widgets/Editor/EditorViewModel.js +1 -1
  308. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  309. package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
  310. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  311. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  312. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  313. package/widgets/Editor/UpdateWorkflow.js +1 -1
  314. package/widgets/Editor/Workflow.js +1 -1
  315. package/widgets/Editor/components/FeatureList.js +1 -1
  316. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  317. package/widgets/Editor/components/Notices.js +1 -1
  318. package/widgets/Editor/components/PanelContent.js +1 -1
  319. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  320. package/widgets/Editor/css.js +1 -1
  321. package/widgets/Editor/support/EditorItem.js +1 -1
  322. package/widgets/Editor/support/SketchController.js +1 -1
  323. package/widgets/Editor/support/errors.js +1 -1
  324. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  325. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  326. package/widgets/Editor/workflowUtils.js +1 -1
  327. package/widgets/Editor.js +1 -1
  328. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  329. package/widgets/FeatureForm/FieldInput.js +1 -1
  330. package/widgets/FeatureForm.js +1 -1
  331. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  332. package/widgets/FeatureTable/FieldColumn.js +1 -1
  333. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  334. package/widgets/LayerList.js +1 -1
  335. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  336. package/widgets/Legend/support/utils.js +1 -1
  337. package/widgets/PanoramicVideoViewer.js +1 -1
  338. package/widgets/TimeSlider.js +1 -1
  339. package/widgets/support/FilterCondition.js +1 -1
  340. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
  341. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
  342. package/assets/esri/core/workers/chunks/066a0ea67688361e85a5.js +0 -1
  343. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
  344. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
  345. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
  346. package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
  347. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
  348. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
  349. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
  350. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
  351. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
  352. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
  353. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
  354. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
  355. package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
  356. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
  357. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
  358. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
  359. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
  360. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
  361. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
  362. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
  363. package/assets/esri/core/workers/chunks/57e04e2d8721bbdc029a.js +0 -1
  364. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
  365. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
  366. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
  367. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
  368. package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
  369. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
  370. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
  371. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
  372. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
  373. package/assets/esri/core/workers/chunks/8ce608013b353155ee5a.js +0 -1
  374. package/assets/esri/core/workers/chunks/8d9d3797c6d62fdfff9d.js +0 -1
  375. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
  376. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
  377. package/assets/esri/core/workers/chunks/9f21436016ff7a899e79.js +0 -1
  378. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
  379. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
  380. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
  381. package/assets/esri/core/workers/chunks/a5a67216e0d0cee95a55.js +0 -1
  382. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
  383. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
  384. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
  385. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
  386. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
  387. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
  388. package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
  389. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
  390. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
  391. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
  392. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
  393. package/assets/esri/core/workers/chunks/d48af7bc06b4bb176534.js +0 -1
  394. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
  395. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
  396. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
  397. package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
  398. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
  399. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
  400. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
  401. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
  402. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
  403. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
  404. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
  405. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
  406. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
  407. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
  408. package/processRequest.js +0 -5
  409. package/requestQueue.js +0 -5
  410. package/support/requestPresets.js +0 -5
  411. package/support/requestUtils.js +0 -5
  412. /package/{rest/support → request}/ImageWithType.js +0 -0
  413. /package/{requestConfig.js → request/config.js} +0 -0
  414. /package/{support/requestImageUtils.js → request/image.js} +0 -0
package/core/unitUtils.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"./has.js";import{strict as e}from"./jsonMap.js";import{getReferenceEllipsoid as s}from"../geometry/ellipsoidUtils.js";import{earth as i,mars as n,moon as t}from"../geometry/support/Ellipsoid.js";import{isWKIDFromMars as a,isWKIDFromMoon as r,isGeographic as c,isEarth as u}from"../geometry/support/spatialReferenceUtils.js";import l from"../geometry/support/WKIDUnitConversion.js";const o=39.37,m=i.radius*Math.PI/200,f=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,d=l,U=/UNIT\[([^\]]+)]/i,b=new Set([4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104025,104026,104139,104140]),B=e()({millimeter:"millimeters",centimeter:"centimeters",meter:"meters",meter_german:"german-meters",kilometer:"kilometers",decimeter:"decimeters",micrometer:"micrometers",nanometer:"nanometers","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",fathom:"fathoms",nautical_mile:"nautical-miles",chain_us:"us-chains",link_us:"us-links",mile_us:"us-miles",yard_clarke:"clarke-yards",chain_clarke:"clarke-chains",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",link_sears:"sears-links",yard_benoit_1895_a:"benoit-1895-a-yards",foot_benoit_1895_a:"benoit-1895-a-feet",chain_benoit_1895_a:"benoit-1895-a-chains",link_benoit_1895_a:"benoit-1895-a-links",yard_benoit_1895_b:"benoit-1895-b-yards",foot_benoit_1895_b:"benoit-1895-b-feet",chain_benoit_1895_b:"benoit-1895-b-chains",link_benoit_1895_b:"benoit-1895-b-links",foot_1865:"1865-feet",foot_indian:"indian-feet",foot_indian_1937:"indian-1937-feet",foot_indian_1962:"indian-1962-feet",foot_indian_1975:"indian-1975-feet",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",yard_indian_1962:"indian-1962-yards",yard_indian_1975:"indian-1975-yards",statute_mile:"statute-miles",foot_gold_coast:"gold-coast-feet",foot_british_1936:"british-1936-feet",yard:"yards",chain:"chains",link:"links",yard_sears_1922_truncated:"sears-1922-truncated-yards",foot_sears_1922_truncated:"sears-1922-truncated-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains",link_sears_1922_truncated:"sears-1922-truncated-links",yard_us:"us-yards",inch:"inches",inch_us:"us-inches",rod:"rods",rod_us:"us-rods",nautical_mile_us:"us-nautical-miles",nautical_mile_uk:"uk-nautical-miles",smoot:"smoots",vara_tx:"tx-vara",point:"points"}),h=e=>e*e,_=e=>e*e*e,k={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},meters:{inBaseUnits:1},feet:{inBaseUnits:.3048},"us-feet":{inBaseUnits:.3048006096012192},"clarke-feet":{inBaseUnits:.3047972654},fathoms:{inBaseUnits:1.8288},"nautical-miles":{inBaseUnits:1852},"german-meters":{inBaseUnits:1.0000135965},"us-chains":{inBaseUnits:20.11684023368047},"us-links":{inBaseUnits:.2011684023368047},"us-miles":{inBaseUnits:1609.347218694438},kilometers:{inBaseUnits:1e3},"clarke-yards":{inBaseUnits:.9143917962},"clarke-chains":{inBaseUnits:20.1166195164},"clarke-links":{inBaseUnits:.201166195164},"sears-yards":{inBaseUnits:.9143984146160287},"sears-feet":{inBaseUnits:.3047994715386762},"sears-chains":{inBaseUnits:20.11676512155263},"sears-links":{inBaseUnits:.2011676512155263},"benoit-1895-a-yards":{inBaseUnits:.9143992},"benoit-1895-a-feet":{inBaseUnits:.3047997333333333},"benoit-1895-a-chains":{inBaseUnits:20.1167824},"benoit-1895-a-links":{inBaseUnits:.201167824},"benoit-1895-b-yards":{inBaseUnits:.9143992042898124},"benoit-1895-b-feet":{inBaseUnits:.3047997347632708},"benoit-1895-b-chains":{inBaseUnits:20.11678249437587},"benoit-1895-b-links":{inBaseUnits:.2011678249437587},"1865-feet":{inBaseUnits:.3048008333333334},"indian-feet":{inBaseUnits:.3047995102481469},"indian-1937-feet":{inBaseUnits:.30479841},"indian-1962-feet":{inBaseUnits:.3047996},"indian-1975-feet":{inBaseUnits:.3047995},"indian-yards":{inBaseUnits:.9143985307444408},"indian-1937-yards":{inBaseUnits:.91439523},"indian-1962-yards":{inBaseUnits:.9143988},"indian-1975-yards":{inBaseUnits:.9143985},miles:{inBaseUnits:1609.344},"statute-miles":{inBaseUnits:1609.344},"gold-coast-feet":{inBaseUnits:.3047997101815088},"british-1936-feet":{inBaseUnits:.3048007491},yards:{inBaseUnits:.9144},chains:{inBaseUnits:20.1168},links:{inBaseUnits:.201168},"sears-1922-truncated-yards":{inBaseUnits:.914398},"sears-1922-truncated-feet":{inBaseUnits:.3047993333333334},"sears-1922-truncated-chains":{inBaseUnits:20.116756},"sears-1922-truncated-links":{inBaseUnits:.20116756},"us-yards":{inBaseUnits:.9144018288036576},decimeters:{inBaseUnits:.1},inches:{inBaseUnits:.0254},"us-inches":{inBaseUnits:.0254000508001016},rods:{inBaseUnits:5.0292},"us-rods":{inBaseUnits:5.029210058420118},"us-nautical-miles":{inBaseUnits:1853.248},"uk-nautical-miles":{inBaseUnits:1853.184},smoots:{inBaseUnits:1.7018},"tx-vara":{inBaseUnits:.8466683600033867},points:{inBaseUnits:.0003527777777777778},micrometers:{inBaseUnits:1e-6},nanometers:{inBaseUnits:1e-9},"50-kilometers":{inBaseUnits:5e4},"150-kilometers":{inBaseUnits:15e4}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:h(.001)},"square-centimeters":{inBaseUnits:h(.01)},"square-decimeters":{inBaseUnits:h(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:h(1e3)},"square-inches":{inBaseUnits:h(.0254)},"square-feet":{inBaseUnits:h(.3048)},"square-yards":{inBaseUnits:h(.9144)},"square-miles":{inBaseUnits:h(1609.344)},"square-nautical-miles":{inBaseUnits:h(1852)},"square-us-feet":{inBaseUnits:h(1200/3937)},acres:{inBaseUnits:.0015625*h(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*_(.001)},"cubic-centimeters":{inBaseUnits:1e3*_(.01)},"cubic-decimeters":{inBaseUnits:1e3*_(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*_(1e3)},"cubic-inches":{inBaseUnits:1e3*_(.0254)},"cubic-feet":{inBaseUnits:1e3*_(.3048)},"cubic-yards":{inBaseUnits:1e3*_(.9144)},"cubic-miles":{inBaseUnits:1e3*_(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},y=(()=>{const e={};for(const s in k)for(const i in k[s].units)e[i]=s;return e})();function q(e,s,i){return e*k[i].units[s].inBaseUnits}function p(e,s,i){return e/k[i].units[s].inBaseUnits}const w=["inches","feet","yards","miles","nautical-miles","us-feet","millimeters","centimeters","decimeters","meters","kilometers"],g=["square-inches","square-feet","square-yards","square-miles","square-nautical-miles","square-us-feet","square-millimeters","square-centimeters","square-decimeters","square-meters","square-kilometers","acres","ares","hectares"],M=["cubic-inches","cubic-feet","cubic-yards","cubic-miles","liters","cubic-millimeters","cubic-centimeters","cubic-decimeters","cubic-meters","cubic-kilometers"],S=["metric","imperial"],D=[...S,...g],v=[...S,...w],C=[...S,...M],P=new Map([["meters","square-meters"],["feet","square-feet"],["us-feet","square-us-feet"]]);function x(e){return"imperial"===e||"metric"===e}function E(e){const s=y[e];if(!s)throw new Error("unknown type");return s}function I(e){return k[e].baseUnit}function j(e){return I(E(e))}function R(e,s=null){return s=s||E(e),k[s].baseUnit===e}function N(e,s,i){if(s===i)return e;const n=E(s);if(n!==E(i))throw new Error("incompatible units");const t=R(s,n)?e:q(e,s,n);return R(i,n)?t:p(t,i,n)}function O(e,s,i,n=!1){if(!n&&c(s))throw new Error("Unable to convert from an angular unit to a linear unit.");const t=oe(s);return t!==i&&(e=t?N(e,t,i):N(e*=ae(s),"meters",i)),e}function F(e,s,i,n=!1){if(!n&&c(i))throw new Error("Unable to convert from a linear unit to an angular unit.");const t=oe(i);return s!==t&&(e=t?N(e,s,t):N(e,s,"meters")/ae(i)),e}function J(e){switch(e){case"metric":return"meters";case"imperial":return"feet";default:return e}}function T(e){return J(e)}function K(e){switch(e){case"metric":return"square-meters";case"imperial":return"square-feet";default:return e}}function A(e){switch(e){case"metric":return"cubic-meters";case"imperial":return"cubic-feet";default:return e}}function G(e,s,i){switch(i){case"metric":return L(e,s);case"imperial":return W(e,s);default:return i}}function H(e,s,i){switch(i){case"metric":return Y(e,s);case"imperial":return $(e,s);default:return i}}function L(e,s){const i=N(e,s,"meters");return Math.abs(i)<3e3?"meters":"kilometers"}function Y(e,s){const i=N(e,s,"meters");return Math.abs(i)<1e5?"meters":"kilometers"}function W(e,s){const i=N(e,s,"feet");return Math.abs(i)<1e3?"feet":"miles"}function $(e,s){const i=N(e,s,"feet");return Math.abs(i)<1e5?"feet":"miles"}function z(e,s){const i=N(e,s,"square-meters");return Math.abs(i)<3e6?"square-meters":"square-kilometers"}function Q(e,s){const i=N(e,s,"square-feet");return Math.abs(i)<1e6?"square-feet":"square-miles"}function V(e,s,i){switch(i){case"metric":return z(e,s);case"imperial":return Q(e,s);default:return i}}function X(e,s){const i=N(e,s,"cubic-meters");return Math.abs(i)<3e8?"cubic-meters":"cubic-kilometers"}function Z(e,s){const i=N(e,s,"cubic-feet");return Math.abs(i)<1e8?"cubic-feet":"cubic-miles"}function ee(e,s,i){switch(i){case"metric":return X(e,s);case"imperial":return Z(e,s);default:return i}}function se(e,s,i){return N(e,s,"meters")/(i*Math.PI/180)}function ie(e){return B.fromJSON(e.toLowerCase())||null}function ne(e){if(null!=e&&!u(e))return 1;const s=ae(e);return s>1e5?1:s}function te(e){return ae(e)>=s(e).metersPerDegree?"meters":oe(e)}function ae(e,s=i.metersPerDegree){return re(e,!0)??s}function re(e,s=!1){const i=e?.wkid??null,c=e?.wkt2??e?.wkt??null;let u=null;if(i){if(a(i))return n.metersPerDegree;if(r(i))return t.metersPerDegree;u=d.values[d[i]],!u&&s&&b.has(i)&&(u=m)}else c&&(be(c)?u=ue(f.exec(c),u):Ue(c)&&(u=ue(U.exec(c),u)));return u}function ce(e){return c(e)?1:ae(e)}function ue(e,s){return e?.[1]?le(e[1]):s}function le(e){return parseFloat(e.split(",")[1])}function oe(e){const s=e?.wkid??null,i=e?.wkt2??e?.wkt??null;let n=null;if(s)n=d.units[d[s]];else if(i){const e=be(i)?f:Ue(i)?U:null;if(e){const s=e.exec(i);s?.[1]&&(n=he(s[1]))}}return null!=n?ie(n):null}function me(e){const s=oe(e);return null!=s&&v.includes(s)?s:null}function fe(e){const s=te(e);return null!=s&&v.includes(s)?s:null}function de(e){const s=oe(e);return null==s?null:P.get(s)}function Ue(e){return/^GEOCCS/i.test(e)}function be(e){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(e)}const Be=1e-7;function he(e){const s=/[\\"']([^\\"']+)/.exec(e);let i=s?.[1];if(!i||!ie(i)){const s=le(e);i=null;const n=d.values;for(let e=0;e<n.length;++e)if(Math.abs(s-n[e])<Be){i=d.units[e];break}}return i}function _e(e){const s=oe(e);if(null==s)return null;switch(s){case"feet":case"us-feet":case"clarke-feet":case"fathoms":case"nautical-miles":case"us-chains":case"us-links":case"us-miles":case"clarke-yards":case"clarke-chains":case"clarke-links":case"sears-yards":case"sears-feet":case"sears-chains":case"sears-links":case"benoit-1895-a-yards":case"benoit-1895-a-feet":case"benoit-1895-a-chains":case"benoit-1895-a-links":case"benoit-1895-b-yards":case"benoit-1895-b-feet":case"benoit-1895-b-chains":case"benoit-1895-b-links":case"1865-feet":case"indian-feet":case"indian-1937-feet":case"indian-1962-feet":case"indian-1975-feet":case"indian-yards":case"indian-1937-yards":case"indian-1962-yards":case"indian-1975-yards":case"statute-miles":case"gold-coast-feet":case"british-1936-feet":case"yards":case"chains":case"links":case"sears-1922-truncated-yards":case"sears-1922-truncated-feet":case"sears-1922-truncated-chains":case"sears-1922-truncated-links":case"us-yards":case"inches":case"us-inches":case"rods":case"us-rods":case"us-nautical-miles":case"uk-nautical-miles":case"smoots":case"tx-vara":case"points":return"imperial";case"millimeters":case"centimeters":case"meters":case"german-meters":case"kilometers":case"decimeters":case"micrometers":case"nanometers":case"50-kilometers":case"150-kilometers":return"metric"}return null}const ke={esriAcres:"acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-feet",esriSquareInches:"square-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-miles",esriSquareMillimeters:"square-millimeters",esriSquareUsFeet:"square-us-feet",esriSquareYards:"square-yards"},ye={esriCentimeters:"centimeters",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriYards:"yards"},qe={esriDUDecimalDegrees:"degrees",esriDURadians:"radians"},pe=e()(ke),we=e()(ye),ge=e()(qe);export{V as adaptiveAreaUnit,Q as adaptiveImperialAreaUnit,W as adaptiveImperialLengthUnit,$ as adaptiveImperialVerticalLengthUnit,Z as adaptiveImperialVolumeUnit,G as adaptiveLengthUnit,z as adaptiveMetricAreaUnit,L as adaptiveMetricLengthUnit,Y as adaptiveMetricVerticalLengthUnit,X as adaptiveMetricVolumeUnit,H as adaptiveVerticalLengthUnit,ee as adaptiveVolumeUnit,ge as angleUnitsJSONMap,de as areaUnitFromSpatialReference,pe as areaUnitsJSONMap,j as baseUnitForUnit,I as baseUnitForUnitType,O as convertFromSpatialReferenceUnit,F as convertToSpatialReferenceUnit,N as convertUnit,K as defaultAreaUnit,J as defaultLengthUnit,T as defaultVerticalLengthUnit,A as defaultVolumeUnit,_e as getDefaultUnitSystem,ce as getMetersPerCartesianUnitForSR,re as getMetersPerUnit,ae as getMetersPerUnitForSR,ne as getMetersPerVerticalUnitForSR,oe as getUnitString,te as getVerticalUnitStringForSR,b as gradGcsIds,o as inchesPerMeter,R as isBaseUnit,x as isMeasurementSystem,be as isProjectedWKT,se as lengthToDegrees,me as lengthUnitFromSpatialReference,w as lengthUnits,we as lengthUnitsJSONMap,D as measurementAreaUnits,v as measurementLengthUnits,C as measurementVolumeUnits,ie as unitFromRESTJSON,E as unitType,fe as verticalLengthUnitFromSpatialReference};
5
+ import"./has.js";import{strict as e}from"./jsonMap.js";import{getReferenceEllipsoid as s}from"../geometry/ellipsoidUtils.js";import{earth as i,mars as n,moon as t}from"../geometry/support/Ellipsoid.js";import{isGeographic as a,isWKIDFromMars as r,isWKIDFromMoon as c,isEarth as u}from"../geometry/support/spatialReferenceUtils.js";import l from"../geometry/support/WKIDUnitConversion.js";const o=39.37,m=i.radius*Math.PI/200,f=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,d=l,U=/UNIT\[([^\]]+)]/i,b=new Set([4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104025,104026,104139,104140]),B=e()({millimeter:"millimeters",centimeter:"centimeters",meter:"meters",meter_german:"german-meters",kilometer:"kilometers",decimeter:"decimeters",micrometer:"micrometers",nanometer:"nanometers","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",fathom:"fathoms",nautical_mile:"nautical-miles",chain_us:"us-chains",link_us:"us-links",mile_us:"us-miles",yard_clarke:"clarke-yards",chain_clarke:"clarke-chains",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",link_sears:"sears-links",yard_benoit_1895_a:"benoit-1895-a-yards",foot_benoit_1895_a:"benoit-1895-a-feet",chain_benoit_1895_a:"benoit-1895-a-chains",link_benoit_1895_a:"benoit-1895-a-links",yard_benoit_1895_b:"benoit-1895-b-yards",foot_benoit_1895_b:"benoit-1895-b-feet",chain_benoit_1895_b:"benoit-1895-b-chains",link_benoit_1895_b:"benoit-1895-b-links",foot_1865:"1865-feet",foot_indian:"indian-feet",foot_indian_1937:"indian-1937-feet",foot_indian_1962:"indian-1962-feet",foot_indian_1975:"indian-1975-feet",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",yard_indian_1962:"indian-1962-yards",yard_indian_1975:"indian-1975-yards",statute_mile:"statute-miles",foot_gold_coast:"gold-coast-feet",foot_british_1936:"british-1936-feet",yard:"yards",chain:"chains",link:"links",yard_sears_1922_truncated:"sears-1922-truncated-yards",foot_sears_1922_truncated:"sears-1922-truncated-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains",link_sears_1922_truncated:"sears-1922-truncated-links",yard_us:"us-yards",inch:"inches",inch_us:"us-inches",rod:"rods",rod_us:"us-rods",nautical_mile_us:"us-nautical-miles",nautical_mile_uk:"uk-nautical-miles",smoot:"smoots",vara_tx:"tx-vara",point:"points"}),h=e=>e*e,_=e=>e*e*e,k={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},meters:{inBaseUnits:1},feet:{inBaseUnits:.3048},"us-feet":{inBaseUnits:.3048006096012192},"clarke-feet":{inBaseUnits:.3047972654},fathoms:{inBaseUnits:1.8288},"nautical-miles":{inBaseUnits:1852},"german-meters":{inBaseUnits:1.0000135965},"us-chains":{inBaseUnits:20.11684023368047},"us-links":{inBaseUnits:.2011684023368047},"us-miles":{inBaseUnits:1609.347218694438},kilometers:{inBaseUnits:1e3},"clarke-yards":{inBaseUnits:.9143917962},"clarke-chains":{inBaseUnits:20.1166195164},"clarke-links":{inBaseUnits:.201166195164},"sears-yards":{inBaseUnits:.9143984146160287},"sears-feet":{inBaseUnits:.3047994715386762},"sears-chains":{inBaseUnits:20.11676512155263},"sears-links":{inBaseUnits:.2011676512155263},"benoit-1895-a-yards":{inBaseUnits:.9143992},"benoit-1895-a-feet":{inBaseUnits:.3047997333333333},"benoit-1895-a-chains":{inBaseUnits:20.1167824},"benoit-1895-a-links":{inBaseUnits:.201167824},"benoit-1895-b-yards":{inBaseUnits:.9143992042898124},"benoit-1895-b-feet":{inBaseUnits:.3047997347632708},"benoit-1895-b-chains":{inBaseUnits:20.11678249437587},"benoit-1895-b-links":{inBaseUnits:.2011678249437587},"1865-feet":{inBaseUnits:.3048008333333334},"indian-feet":{inBaseUnits:.3047995102481469},"indian-1937-feet":{inBaseUnits:.30479841},"indian-1962-feet":{inBaseUnits:.3047996},"indian-1975-feet":{inBaseUnits:.3047995},"indian-yards":{inBaseUnits:.9143985307444408},"indian-1937-yards":{inBaseUnits:.91439523},"indian-1962-yards":{inBaseUnits:.9143988},"indian-1975-yards":{inBaseUnits:.9143985},miles:{inBaseUnits:1609.344},"statute-miles":{inBaseUnits:1609.344},"gold-coast-feet":{inBaseUnits:.3047997101815088},"british-1936-feet":{inBaseUnits:.3048007491},yards:{inBaseUnits:.9144},chains:{inBaseUnits:20.1168},links:{inBaseUnits:.201168},"sears-1922-truncated-yards":{inBaseUnits:.914398},"sears-1922-truncated-feet":{inBaseUnits:.3047993333333334},"sears-1922-truncated-chains":{inBaseUnits:20.116756},"sears-1922-truncated-links":{inBaseUnits:.20116756},"us-yards":{inBaseUnits:.9144018288036576},decimeters:{inBaseUnits:.1},inches:{inBaseUnits:.0254},"us-inches":{inBaseUnits:.0254000508001016},rods:{inBaseUnits:5.0292},"us-rods":{inBaseUnits:5.029210058420118},"us-nautical-miles":{inBaseUnits:1853.248},"uk-nautical-miles":{inBaseUnits:1853.184},smoots:{inBaseUnits:1.7018},"tx-vara":{inBaseUnits:.8466683600033867},points:{inBaseUnits:.0003527777777777778},micrometers:{inBaseUnits:1e-6},nanometers:{inBaseUnits:1e-9},"50-kilometers":{inBaseUnits:5e4},"150-kilometers":{inBaseUnits:15e4}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:h(.001)},"square-centimeters":{inBaseUnits:h(.01)},"square-decimeters":{inBaseUnits:h(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:h(1e3)},"square-inches":{inBaseUnits:h(.0254)},"square-feet":{inBaseUnits:h(.3048)},"square-yards":{inBaseUnits:h(.9144)},"square-miles":{inBaseUnits:h(1609.344)},"square-nautical-miles":{inBaseUnits:h(1852)},"square-us-feet":{inBaseUnits:h(1200/3937)},acres:{inBaseUnits:.0015625*h(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*_(.001)},"cubic-centimeters":{inBaseUnits:1e3*_(.01)},"cubic-decimeters":{inBaseUnits:1e3*_(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*_(1e3)},"cubic-inches":{inBaseUnits:1e3*_(.0254)},"cubic-feet":{inBaseUnits:1e3*_(.3048)},"cubic-yards":{inBaseUnits:1e3*_(.9144)},"cubic-miles":{inBaseUnits:1e3*_(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},y=(()=>{const e={};for(const s in k)for(const i in k[s].units)e[i]=s;return e})();function q(e,s,i){return e*k[i].units[s].inBaseUnits}function p(e,s,i){return e/k[i].units[s].inBaseUnits}const w=["inches","feet","yards","miles","nautical-miles","us-feet","millimeters","centimeters","decimeters","meters","kilometers"],g=["square-inches","square-feet","square-yards","square-miles","square-nautical-miles","square-us-feet","square-millimeters","square-centimeters","square-decimeters","square-meters","square-kilometers","acres","ares","hectares"],M=["cubic-inches","cubic-feet","cubic-yards","cubic-miles","liters","cubic-millimeters","cubic-centimeters","cubic-decimeters","cubic-meters","cubic-kilometers"],S=["metric","imperial"],D=[...S,...g],v=[...S,...w],C=[...S,...M],P=new Map([["meters","square-meters"],["feet","square-feet"],["us-feet","square-us-feet"]]);function x(e){return"imperial"===e||"metric"===e}function E(e){const s=y[e];if(!s)throw new Error("unknown type");return s}function I(e){return k[e].baseUnit}function j(e){return I(E(e))}function R(e,s=null){return s=s||E(e),k[s].baseUnit===e}function N(e,s,i){if(s===i)return e;const n=E(s);if(n!==E(i))throw new Error("incompatible units");const t=R(s,n)?e:q(e,s,n);return R(i,n)?t:p(t,i,n)}function O(e,s,i,n=!1){if(!n&&a(s))throw new Error("Unable to convert from an angular unit to a linear unit.");const t=oe(s);return t!==i&&(e=t?N(e,t,i):N(e*=ae(s),"meters",i)),e}function F(e,s,i,n=!1){if(!n&&a(i))throw new Error("Unable to convert from a linear unit to an angular unit.");const t=oe(i);return s!==t&&(e=t?N(e,s,t):N(e,s,"meters")/ae(i)),e}function J(e){switch(e){case"metric":return"meters";case"imperial":return"feet";default:return e}}function T(e){return J(e)}function K(e){switch(e){case"metric":return"square-meters";case"imperial":return"square-feet";default:return e}}function A(e){switch(e){case"metric":return"cubic-meters";case"imperial":return"cubic-feet";default:return e}}function G(e,s,i){switch(i){case"metric":return L(e,s);case"imperial":return W(e,s);default:return i}}function H(e,s,i){switch(i){case"metric":return Y(e,s);case"imperial":return $(e,s);default:return i}}function L(e,s){const i=N(e,s,"meters");return Math.abs(i)<3e3?"meters":"kilometers"}function Y(e,s){const i=N(e,s,"meters");return Math.abs(i)<1e5?"meters":"kilometers"}function W(e,s){const i=N(e,s,"feet");return Math.abs(i)<1e3?"feet":"miles"}function $(e,s){const i=N(e,s,"feet");return Math.abs(i)<1e5?"feet":"miles"}function z(e,s){const i=N(e,s,"square-meters");return Math.abs(i)<3e6?"square-meters":"square-kilometers"}function Q(e,s){const i=N(e,s,"square-feet");return Math.abs(i)<1e6?"square-feet":"square-miles"}function V(e,s,i){switch(i){case"metric":return z(e,s);case"imperial":return Q(e,s);default:return i}}function X(e,s){const i=N(e,s,"cubic-meters");return Math.abs(i)<3e8?"cubic-meters":"cubic-kilometers"}function Z(e,s){const i=N(e,s,"cubic-feet");return Math.abs(i)<1e8?"cubic-feet":"cubic-miles"}function ee(e,s,i){switch(i){case"metric":return X(e,s);case"imperial":return Z(e,s);default:return i}}function se(e,s,i){return N(e,s,"meters")/(i*Math.PI/180)}function ie(e){return B.fromJSON(e.toLowerCase())||null}function ne(e){if(null!=e&&!u(e))return 1;const s=ae(e);return s>1e5?1:s}function te(e){return ae(e)>=s(e).metersPerDegree?"meters":oe(e)}function ae(e,s=i.metersPerDegree){return re(e,!0)??s}function re(e,s=!1){const i=e?.wkid??null,a=e?.wkt2??e?.wkt??null;let u=null;if(i){if(r(i))return n.metersPerDegree;if(c(i))return t.metersPerDegree;u=d.values[d[i]],!u&&s&&b.has(i)&&(u=m)}else a&&(be(a)?u=ue(f.exec(a),u):Ue(a)&&(u=ue(U.exec(a),u)));return u}function ce(e){return a(e)?1:ae(e)}function ue(e,s){return e?.[1]?le(e[1]):s}function le(e){return parseFloat(e.split(",")[1])}function oe(e){const s=e?.wkid??null,i=e?.wkt2??e?.wkt??null;let n=null;if(s)n=d.units[d[s]];else if(i){const e=be(i)?f:Ue(i)?U:null;if(e){const s=e.exec(i);s?.[1]&&(n=he(s[1]))}}return null!=n?ie(n):null}function me(e){const s=oe(e);return null!=s&&v.includes(s)?s:null}function fe(e){const s=te(e);return null!=s&&v.includes(s)?s:null}function de(e){const s=oe(e);return null==s?null:P.get(s)}function Ue(e){return/^GEOCCS/i.test(e)}function be(e){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(e)}const Be=1e-7;function he(e){const s=/[\\"']([^\\"']+)/.exec(e);let i=s?.[1];if(!i||!ie(i)){const s=le(e);i=null;const n=d.values;for(let e=0;e<n.length;++e)if(Math.abs(s-n[e])<Be){i=d.units[e];break}}return i}function _e(e){const s=oe(e);if(null==s)return null;switch(s){case"feet":case"us-feet":case"clarke-feet":case"fathoms":case"nautical-miles":case"us-chains":case"us-links":case"us-miles":case"clarke-yards":case"clarke-chains":case"clarke-links":case"sears-yards":case"sears-feet":case"sears-chains":case"sears-links":case"benoit-1895-a-yards":case"benoit-1895-a-feet":case"benoit-1895-a-chains":case"benoit-1895-a-links":case"benoit-1895-b-yards":case"benoit-1895-b-feet":case"benoit-1895-b-chains":case"benoit-1895-b-links":case"1865-feet":case"indian-feet":case"indian-1937-feet":case"indian-1962-feet":case"indian-1975-feet":case"indian-yards":case"indian-1937-yards":case"indian-1962-yards":case"indian-1975-yards":case"statute-miles":case"gold-coast-feet":case"british-1936-feet":case"yards":case"chains":case"links":case"sears-1922-truncated-yards":case"sears-1922-truncated-feet":case"sears-1922-truncated-chains":case"sears-1922-truncated-links":case"us-yards":case"inches":case"us-inches":case"rods":case"us-rods":case"us-nautical-miles":case"uk-nautical-miles":case"smoots":case"tx-vara":case"points":return"imperial";case"millimeters":case"centimeters":case"meters":case"german-meters":case"kilometers":case"decimeters":case"micrometers":case"nanometers":case"50-kilometers":case"150-kilometers":return"metric"}return null}const ke={esriAcres:"acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-feet",esriSquareInches:"square-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-miles",esriSquareMillimeters:"square-millimeters",esriSquareUsFeet:"square-us-feet",esriSquareYards:"square-yards"},ye={esriCentimeters:"centimeters",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriYards:"yards"},qe={esriDUDecimalDegrees:"degrees",esriDURadians:"radians"},pe=e()(ke),we=e()(ye),ge=e()(qe);export{V as adaptiveAreaUnit,Q as adaptiveImperialAreaUnit,W as adaptiveImperialLengthUnit,$ as adaptiveImperialVerticalLengthUnit,Z as adaptiveImperialVolumeUnit,G as adaptiveLengthUnit,z as adaptiveMetricAreaUnit,L as adaptiveMetricLengthUnit,Y as adaptiveMetricVerticalLengthUnit,X as adaptiveMetricVolumeUnit,H as adaptiveVerticalLengthUnit,ee as adaptiveVolumeUnit,ge as angleUnitsJSONMap,de as areaUnitFromSpatialReference,pe as areaUnitsJSONMap,j as baseUnitForUnit,I as baseUnitForUnitType,O as convertFromSpatialReferenceUnit,F as convertToSpatialReferenceUnit,N as convertUnit,K as defaultAreaUnit,J as defaultLengthUnit,T as defaultVerticalLengthUnit,A as defaultVolumeUnit,_e as getDefaultUnitSystem,ce as getMetersPerCartesianUnitForSR,re as getMetersPerUnit,ae as getMetersPerUnitForSR,ne as getMetersPerVerticalUnitForSR,oe as getUnitString,te as getVerticalUnitStringForSR,b as gradGcsIds,o as inchesPerMeter,R as isBaseUnit,x as isMeasurementSystem,be as isProjectedWKT,se as lengthToDegrees,me as lengthUnitFromSpatialReference,w as lengthUnits,we as lengthUnitsJSONMap,D as measurementAreaUnits,v as measurementLengthUnits,C as measurementVolumeUnits,ie as unitFromRESTJSON,E as unitType,fe as verticalLengthUnitFromSpatialReference};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{supportsFieldConfiguration as r}from"../layers/support/layerUtils.js";function e(e,t){return r(t)?t.getFieldAlias(e.name):e.alias}export{e as getEffectiveFieldAlias};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{replace as i}from"../core/string.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import n from"./Geometry.js";import m from"./Point.js";import r from"./SpatialReference.js";import{extentContainsPoint as a,extentContainsExtent as h}from"./support/contains.js";import{getFeatureExtentIntersector as o}from"./support/intersectsBase.js";import{equals as x,getInfo as l}from"./support/spatialReferenceUtils.js";import{canProject as p,geographicToWebMercator as c,webMercatorToGeographic as y}from"./support/webMercatorUtils.js";var u;function f(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}function d(t,i,e){return null==i?e:null==e?i:t(i,e)}let z=u=class extends n{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,i,e,s,n){return f(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:"object"==typeof t?(t.spatialReference=null==t.spatialReference?r.WGS84:t.spatialReference,t):{xmin:t,ymin:i,xmax:e,ymax:s,spatialReference:n??r.WGS84}}static fromPoint(t){return new u({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new m({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return null!=this.mmin&&null!=this.mmax}get hasZ(){return null!=this.zmin&&null!=this.zmax}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const i=this.center;return null!=t.z&&this.hasZ?this.offset(t.x-i.x,t.y-i.y,t.z-i.z):this.offset(t.x-i.x,t.y-i.y)}clone(){const t=new u;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,null!=this.zmin&&(t.zmin=this.zmin,t.zmax=this.zmax),null!=this.mmin&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0)),"point"===t.type?a(this,t):"extent"===t.type&&h(this,t)}equals(t){if(this===t)return!0;if(null==t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const i=.5*(1-t),e=this.width*i,s=this.height*i;if(this.xmin+=e,this.ymin+=s,this.xmax-=e,this.ymax-=s,this.hasZ){const t=(this.zmax-this.zmin)*i;this.zmin+=t,this.zmax-=t}if(this.hasM){const t=(this.mmax-this.mmin)*i;this.mmin+=t,this.mmax-=t}return this}intersects(t){if(null==t)return!1;"mesh"===t.type&&(t=t.extent);const i=this.spatialReference,e=t.spatialReference;i&&e&&!x(i,e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0));return o(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,i,e){return this.xmin+=t,this.ymin+=i,this.xmax+=t,this.ymax+=i,null!=e&&(this.zmin+=e,this.zmax+=e),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=d(Math.min,this.zmin,t.zmin),this.zmax=d(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=d(Math.min,this.mmin,t.mmin),this.mmax=d(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:null!=t&&this.intersects(t)?(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=d(Math.max,this.zmin,t.zmin),this.zmax=d(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=d(Math.max,this.mmin,t.mmin),this.mmax=d(Math.min,this.mmax,t.mmax)),this):null}toJSON(t){return this.write({},t)}_shiftCM(t=l(this.spatialReference)){if(!t||!this.spatialReference)return this;const e=this.spatialReference,s=this._getCM(t);if(s){const n=e.isWebMercator?y(s):s;this.xmin-=s.x,this.xmax-=s.x,e.isWebMercator||(n.x=M(n.x,t).x),this.spatialReference=new r(i((e.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:n.x}))}return this}_getCM(t){let i=null;const[e,s]=t.valid,n=this.xmin,m=this.xmax;return n>=e&&n<=s&&(m>=e&&m<=s)||(i=this.center),i}_normalize(t,i,e){const s=this.spatialReference;if(!s)return this;const n=e??l(s);if(null==n)return this;const m=this._getParts(n).map(t=>t.extent);if(m.length<2)return m[0]||this;if(m.length>2)return t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)return this._shiftCM(n);if(i)return m;let r=!0,a=!0;return m.forEach(t=>{t.hasZ||(r=!1),t.hasM||(a=!1)}),{rings:m.map(t=>{const i=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(r){const e=(t.zmax-t.zmin)/2;for(let t=0;t<i.length;t++)i[t].push(e)}if(a){const e=(t.mmax-t.mmin)/2;for(let t=0;t<i.length;t++)i[t].push(e)}return i}),hasZ:r,hasM:a,spatialReference:s}}_getParts(t){let i=this.cache._parts;if(!i){i=[];const{ymin:e,ymax:s,spatialReference:n}=this,m=this.width,r=this.xmin,a=this.xmax;let h;t=t||l(n);const[o,x]=t.valid;h=M(this.xmin,t);const p=h.x,c=h.frameId;h=M(this.xmax,t);const y=h.x,f=h.frameId,d=p===y&&m>0;if(m>2*x){const t=new u(r<a?p:y,e,x,s,n),m=new u(o,e,r<a?y:p,s,n),h=new u(0,e,x,s,n),l=new u(o,e,0,s,n),d=[],z=[];t.contains(h)&&d.push(c),t.contains(l)&&z.push(c),m.contains(h)&&d.push(f),m.contains(l)&&z.push(f);for(let i=c+1;i<f;i++)d.push(i),z.push(i);i.push({extent:t,frameIds:[c]},{extent:m,frameIds:[f]},{extent:h,frameIds:d},{extent:l,frameIds:z})}else p>y||d?i.push({extent:new u(p,e,x,s,n),frameIds:[c]},{extent:new u(o,e,y,s,n),frameIds:[f]}):i.push({extent:new u(p,e,y,s,n),frameIds:[c]});this.cache._parts=i}const e=this.hasZ,s=this.hasM;if(e||s){const t={};e&&(t.zmin=this.zmin,t.zmax=this.zmax),s&&(t.mmin=this.mmin,t.mmax=this.mmax);for(let e=0;e<i.length;e++)i[e].extent.set(t)}return i}};function M(t,i){const[e,s]=i.valid,n=2*s;let m,r=0;return t>s?(m=Math.ceil(Math.abs(t-s)/n),t-=m*n,r=m):t<e&&(m=Math.ceil(Math.abs(t-e)/n),t+=m*n,r=-m),{x:t,frameId:r}}t([e({readOnly:!0})],z.prototype,"cache",null),t([e({readOnly:!0})],z.prototype,"center",null),t([e({readOnly:!0})],z.prototype,"extent",null),t([e({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],z.prototype,"hasM",null),t([e({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],z.prototype,"hasZ",null),t([e({readOnly:!0})],z.prototype,"height",null),t([e({readOnly:!0})],z.prototype,"width",null),t([e({type:Number,json:{type:[Number,String],write:{enabled:!0,allowNull:!0}}})],z.prototype,"xmin",void 0),t([e({type:Number,json:{write:!0}})],z.prototype,"ymin",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],z.prototype,"mmin",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],z.prototype,"zmin",void 0),t([e({type:Number,json:{write:!0}})],z.prototype,"xmax",void 0),t([e({type:Number,json:{write:!0}})],z.prototype,"ymax",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],z.prototype,"mmax",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],z.prototype,"zmax",void 0),z=u=t([s("esri.geometry.Extent")],z),z.prototype.toJSON.isDefaultToJSON=!0;const w=z;export{w as default};
5
+ import{__decorate as t}from"tslib";import{replace as i}from"../core/string.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import n from"./Geometry.js";import m from"./Point.js";import r from"./SpatialReference.js";import{extentContainsPoint as a,extentContainsExtent as h}from"./support/contains.js";import{getFeatureExtentIntersector as o}from"./support/intersectsBase.js";import{equals as x,getInfo as l}from"./support/spatialReferenceUtils.js";import{canProject as p,geographicToWebMercator as c,webMercatorToGeographic as y}from"./support/webMercatorUtils.js";var u;function f(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}function d(t,i,e){return null==i?e:null==e?i:t(i,e)}let z=u=class extends n{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,i,e,s,n){return f(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:"object"==typeof t?(t.spatialReference=null==t.spatialReference?r.WGS84:t.spatialReference,t):{xmin:t,ymin:i,xmax:e,ymax:s,spatialReference:n??r.WGS84}}static fromPoint(t){return new u({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new m({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return null!=this.mmin&&null!=this.mmax}get hasZ(){return null!=this.zmin&&null!=this.zmax}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const i=this.center;return null!=t.z&&this.hasZ?this.offset(t.x-i.x,t.y-i.y,t.z-i.z):this.offset(t.x-i.x,t.y-i.y)}clone(){const t=new u;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,null!=this.zmin&&(t.zmin=this.zmin,t.zmax=this.zmax),null!=this.mmin&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0)),"point"===t.type?a(this,t):"extent"===t.type&&h(this,t)}equals(t){if(this===t)return!0;if(null==t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const i=.5*(1-t),e=this.width*i,s=this.height*i;if(this.xmin+=e,this.ymin+=s,this.xmax-=e,this.ymax-=s,this.hasZ){const t=(this.zmax-this.zmin)*i;this.zmin+=t,this.zmax-=t}if(this.hasM){const t=(this.mmax-this.mmin)*i;this.mmin+=t,this.mmax-=t}return this}intersects(t){if(null==t)return!1;"mesh"===t.type&&(t=t.extent);const i=this.spatialReference,e=t.spatialReference;i&&e&&!x(i,e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0));return o(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,i,e){return this.xmin+=t,this.ymin+=i,this.xmax+=t,this.ymax+=i,null!=e&&(this.zmin+=e,this.zmax+=e),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=d(Math.min,this.zmin,t.zmin),this.zmax=d(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=d(Math.min,this.mmin,t.mmin),this.mmax=d(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:null!=t&&this.intersects(t)?(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=d(Math.max,this.zmin,t.zmin),this.zmax=d(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=d(Math.max,this.mmin,t.mmin),this.mmax=d(Math.min,this.mmax,t.mmax)),this):null}toJSON(t){return this.write({},t)}_shiftCM(t=l(this.spatialReference)){if(!t||!this.spatialReference)return this;const e=this.spatialReference,s=this._getCM(t);if(s){const n=e.isWebMercator?y(s):s;this.xmin-=s.x,this.xmax-=s.x,e.isWebMercator||(n.x=M(n.x,t).x),this.spatialReference=new r(i((e.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:n.x}))}return this}_getCM(t){let i=null;const[e,s]=t.valid,n=this.xmin,m=this.xmax;return n>=e&&n<=s&&(m>=e&&m<=s)||(i=this.center),i}_normalize(t,i,e){const s=this.spatialReference;if(!s)return this;const n=e??l(s);if(null==n)return this;const m=this._getParts(n).map(t=>t.extent);if(m.length<2)return m[0]||this;if(m.length>2)return t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)return this._shiftCM(n);if(i)return m;let r=!0,a=!0;return m.forEach(t=>{t.hasZ||(r=!1),t.hasM||(a=!1)}),{rings:m.map(t=>{const i=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(r){const e=(t.zmax-t.zmin)/2;for(let t=0;t<i.length;t++)i[t].push(e)}if(a){const e=(t.mmax-t.mmin)/2;for(let t=0;t<i.length;t++)i[t].push(e)}return i}),hasZ:r,hasM:a,spatialReference:s}}_getParts(t){let i=this.cache._parts;if(!i){i=[];const{ymin:e,ymax:s,spatialReference:n}=this,m=this.width,r=this.xmin,a=this.xmax;let h;t=t||l(n);const[o,x]=t.valid;h=M(this.xmin,t);const p=h.x,c=h.frameId;h=M(this.xmax,t);const y=h.x,f=h.frameId,d=p===y&&m>0;if(m>2*x){const t=new u(r<a?p:y,e,x,s,n),m=new u(o,e,r<a?y:p,s,n),h=new u(0,e,x,s,n),l=new u(o,e,0,s,n),d=[],z=[];t.contains(h)&&d.push(c),t.contains(l)&&z.push(c),m.contains(h)&&d.push(f),m.contains(l)&&z.push(f);for(let i=c+1;i<f;i++)d.push(i),z.push(i);i.push({extent:t,frameIds:[c]},{extent:m,frameIds:[f]},{extent:h,frameIds:d},{extent:l,frameIds:z})}else p>y||d?i.push({extent:new u(p,e,x,s,n),frameIds:[c]},{extent:new u(o,e,y,s,n),frameIds:[f]}):i.push({extent:new u(p,e,y,s,n),frameIds:[c]});this.cache._parts=i}const e=this.hasZ,s=this.hasM;if(e||s){const t={};e&&(t.zmin=this.zmin,t.zmax=this.zmax),s&&(t.mmin=this.mmin,t.mmax=this.mmax);for(let e=0;e<i.length;e++)i[e].extent.set(t)}return i}};function M(t,i){const[e,s]=i.valid,n=2*s;let m,r=0;return t>s?(m=Math.ceil(Math.abs(t-s)/n),t-=m*n,r=m):t<e&&(m=Math.ceil(Math.abs(t-e)/n),t+=m*n,r=-m),{x:t,frameId:r}}t([e({readOnly:!0})],z.prototype,"cache",null),t([e({readOnly:!0})],z.prototype,"center",null),t([e({readOnly:!0})],z.prototype,"extent",null),t([e({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],z.prototype,"hasM",null),t([e({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],z.prototype,"hasZ",null),t([e({readOnly:!0})],z.prototype,"height",null),t([e({readOnly:!0})],z.prototype,"width",null),t([e({type:Number,json:{type:[Number,String],write:{enabled:!0,allowNull:!0}}})],z.prototype,"xmin",void 0),t([e({type:Number,json:{write:!0}})],z.prototype,"ymin",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],z.prototype,"mmin",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],z.prototype,"zmin",void 0),t([e({type:Number,json:{write:!0}})],z.prototype,"xmax",void 0),t([e({type:Number,json:{write:!0}})],z.prototype,"ymax",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],z.prototype,"mmax",void 0),t([e({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],z.prototype,"zmax",void 0),z=u=t([s("esri.geometry.Extent")],z),z.prototype.toJSON.isDefaultToJSON=!0;export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{JSONSupport as r}from"../core/JSONSupport.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import s from"./SpatialReference.js";let c=class extends r{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=s.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,r){if(e instanceof s)return e;if(null!=e){const t=new s;return t.read(e,r),t}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,r){this.cache[e]=r}};e([t()],c.prototype,"type",void 0),e([t({readOnly:!0})],c.prototype,"cache",null),e([t({readOnly:!0})],c.prototype,"extent",null),e([t({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],c.prototype,"hasM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],c.prototype,"hasZ",void 0),e([t({type:s,json:{write:!0},value:s.WGS84})],c.prototype,"spatialReference",void 0),e([o("spatialReference")],c.prototype,"readSpatialReference",null),c=e([a("esri.geometry.Geometry")],c);const p=c;export{p as default};
5
+ import{__decorate as e}from"tslib";import{JSONSupport as r}from"../core/JSONSupport.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import s from"./SpatialReference.js";let c=class extends r{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=s.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,r){if(e instanceof s)return e;if(null!=e){const t=new s;return t.read(e,r),t}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,r){this.cache[e]=r}};e([t()],c.prototype,"type",void 0),e([t({readOnly:!0})],c.prototype,"cache",null),e([t({readOnly:!0})],c.prototype,"extent",null),e([t({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],c.prototype,"hasM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],c.prototype,"hasZ",void 0),e([t({type:s,json:{write:!0},value:s.WGS84})],c.prototype,"spatialReference",void 0),e([o("spatialReference")],c.prototype,"readSpatialReference",null),c=e([a("esri.geometry.Geometry")],c);export{c as default};
package/geometry/Mesh.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import r from"../core/Error.js";import{LoadableMixin as o}from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{throwIfAborted as i,whenOrAbort as a}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{create as d,fromBuffer as g,zero as x}from"./support/aaBoundingBox.js";import{composeAxes as y,create as v}from"./support/axisAngleDegrees.js";import j from"./support/MeshComponent.js";import{componentNotFoundMessage as S,meshNotLoadedMessage as w,invalidLocationMessage as b,invalidPolygonMessage as L,InvalidLocationError as A}from"./support/meshErrors.js";import C from"./support/MeshGeoreferencedVertexSpace.js";import M from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as U}from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as P}from"./support/meshVertexSpaceUtils.js";import{triangulate as E}from"./support/triangulationUtils.js";import{centerAt as B}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as G}from"./support/meshUtils/extent.js";import{loadExternal as k}from"./support/meshUtils/loadExternal.js";import{addMeshMaterialCloneContext as I,addMeshTextureCloneContext as T,getMeshCloneContext as O}from"./support/meshUtils/meshCloneUtils.js";import{Metadata as z}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as V,createUnitSizeBox as D,extractSingleFaceOfBox as N,createUnitSizeSphere as Z,createUnitSizeCylinder as H,convertPlaneSizeParameter as K,createUnitSizePlane as W}from"./support/meshUtils/primitives.js";import{rotate as q}from"./support/meshUtils/rotate.js";import{scale as J}from"./support/meshUtils/scale.js";var Q;const X={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:C,local:M}};let Y=Q=class extends(t(o(n(h)))){constructor(e){super(e),this.components=null,this.vertexSpace=new C,this.transform=null,this.metadata=new z,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new U,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles(p(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,r=this;return G({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?d(x):g(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(j.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}s.getLogger(this).error("removeComponent()",S)}}rotate(e,t,r,o){return y(e,t,r,$),q(this,$,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(F(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(J(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(B(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(k(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone(I(T(e)))}cloneShallow(){return new Q({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return i(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(s.getLogger(this).error(e,w),!1)}static createBox(e,t){if(!(e instanceof u))return s.getLogger(this.prototype).error(".createBox()",b),null;const r=new Q(V(D(),e,t));return t?.imageFace&&"all"!==t.imageFace?N(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new Q(V(Z(t?.densificationFactor||0),e,t)):(s.getLogger(this.prototype).error(".createSphere()",b),null)}static createCylinder(e,t){return e instanceof u?new Q(V(H(t?.densificationFactor||0),e,t)):(s.getLogger(this.prototype).error(".createCylinder()",b),null)}static createPlane(e,t){if(!(e instanceof u))return s.getLogger(this.prototype).error(".createPlane()",b),null;const r=t?.facing??"up",o=K(r,t?.size);return new Q(V(W(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof f))return s.getLogger(this.prototype).error(".createFromPolygon()",L),null;const r=E(e);return new Q({vertexAttributes:new U({position:r.position}),components:[new j({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new C})}static async createFromGLTF(e,t,r){if(!(e instanceof u)){const e=new A;throw s.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await a(import("./support/meshUtils/loadGLTFMesh.js"),r);return new Q((await o(e,t,r)).mesh)}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new R,i=P(e,r),a=r?.unitConversionDisabled,p={source:t,extent:o,unitConversionDisabled:a},c=new z;return c.externalSources.push(p),new Q({metadata:c,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,t){const{spatialReference:o}=e,s=t?.transform?.clone()??new R,n=P(e,t),i=new Q({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new r("mesh-incomplete","Mesh resources are not complete"))),i}};e([c({type:[j],json:{write:!0}})],Y.prototype,"components",void 0),e([c({nonNullable:!0,types:X,constructOnly:!0,json:{write:!0},clonable:(e,t)=>O(t)?.vertexSpace??e.clone(t)})],Y.prototype,"vertexSpace",void 0),e([c({type:R,clonable:(e,t)=>{const r=O(t);return r&&"transform"in r?r.transform:e?.clone()??e},json:{write:!0}})],Y.prototype,"transform",void 0),e([c({constructOnly:!0,type:z,clonable:(e,t)=>O(t)?.metadata??e.clone()})],Y.prototype,"metadata",void 0),e([c()],Y.prototype,"hasExtent",null),e([c()],Y.prototype,"_transformedExtent",null),e([c()],Y.prototype,"_untransformedBounds",null),e([c()],Y.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],Y.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Y.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Y.prototype,"hasM",void 0),e([c({type:U,nonNullable:!0,json:{write:!0},clonable:(e,t)=>O(t)?.vertexAttributes??e.clone(t)})],Y.prototype,"vertexAttributes",void 0),Y=Q=e([l("esri.geometry.Mesh")],Y);const $=v();export{Y as default};
5
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import r from"../core/Error.js";import{LoadableMixin as o}from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{throwIfAborted as i,whenOrAbort as a}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{create as d,zero as g,fromBuffer as x}from"./support/aaBoundingBox.js";import{composeAxes as y,create as v}from"./support/axisAngleDegrees.js";import j from"./support/MeshComponent.js";import{componentNotFoundMessage as S,meshNotLoadedMessage as w,invalidLocationMessage as b,invalidPolygonMessage as L,InvalidLocationError as A}from"./support/meshErrors.js";import C from"./support/MeshGeoreferencedVertexSpace.js";import M from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as U}from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as P}from"./support/meshVertexSpaceUtils.js";import{triangulate as E}from"./support/triangulationUtils.js";import{centerAt as B}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as G}from"./support/meshUtils/extent.js";import{loadExternal as k}from"./support/meshUtils/loadExternal.js";import{addMeshMaterialCloneContext as I,addMeshTextureCloneContext as T,getMeshCloneContext as O}from"./support/meshUtils/meshCloneUtils.js";import{Metadata as z}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as V,createUnitSizeBox as D,extractSingleFaceOfBox as N,createUnitSizeSphere as Z,createUnitSizeCylinder as H,convertPlaneSizeParameter as K,createUnitSizePlane as W}from"./support/meshUtils/primitives.js";import{rotate as q}from"./support/meshUtils/rotate.js";import{scale as J}from"./support/meshUtils/scale.js";var Q;const X={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:C,local:M}};let Y=Q=class extends(t(o(n(h)))){constructor(e){super(e),this.components=null,this.vertexSpace=new C,this.transform=null,this.metadata=new z,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new U,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles(p(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,r=this;return G({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?d(g):x(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(j.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}s.getLogger(this).error("removeComponent()",S)}}rotate(e,t,r,o){return y(e,t,r,$),q(this,$,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(F(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(J(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(B(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(k(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone(I(T(e)))}cloneShallow(){return new Q({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return i(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(s.getLogger(this).error(e,w),!1)}static createBox(e,t){if(!(e instanceof u))return s.getLogger(this.prototype).error(".createBox()",b),null;const r=new Q(V(D(),e,t));return t?.imageFace&&"all"!==t.imageFace?N(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new Q(V(Z(t?.densificationFactor||0),e,t)):(s.getLogger(this.prototype).error(".createSphere()",b),null)}static createCylinder(e,t){return e instanceof u?new Q(V(H(t?.densificationFactor||0),e,t)):(s.getLogger(this.prototype).error(".createCylinder()",b),null)}static createPlane(e,t){if(!(e instanceof u))return s.getLogger(this.prototype).error(".createPlane()",b),null;const r=t?.facing??"up",o=K(r,t?.size);return new Q(V(W(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof f))return s.getLogger(this.prototype).error(".createFromPolygon()",L),null;const r=E(e);return new Q({vertexAttributes:new U({position:r.position}),components:[new j({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new C})}static async createFromGLTF(e,t,r){if(!(e instanceof u)){const e=new A;throw s.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await a(import("./support/meshUtils/loadGLTFMesh.js"),r);return new Q((await o(e,t,r)).mesh)}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new R,i=P(e,r),a=r?.unitConversionDisabled,p={source:t,extent:o,unitConversionDisabled:a},c=new z;return c.externalSources.push(p),new Q({metadata:c,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,t){const{spatialReference:o}=e,s=t?.transform?.clone()??new R,n=P(e,t),i=new Q({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new r("mesh-incomplete","Mesh resources are not complete"))),i}};e([c({type:[j],json:{write:!0}})],Y.prototype,"components",void 0),e([c({nonNullable:!0,types:X,constructOnly:!0,json:{write:!0},clonable:(e,t)=>O(t)?.vertexSpace??e.clone(t)})],Y.prototype,"vertexSpace",void 0),e([c({type:R,clonable:(e,t)=>{const r=O(t);return r&&"transform"in r?r.transform:e?.clone()??e},json:{write:!0}})],Y.prototype,"transform",void 0),e([c({constructOnly:!0,type:z,clonable:(e,t)=>O(t)?.metadata??e.clone()})],Y.prototype,"metadata",void 0),e([c()],Y.prototype,"hasExtent",null),e([c()],Y.prototype,"_transformedExtent",null),e([c()],Y.prototype,"_untransformedBounds",null),e([c()],Y.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],Y.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Y.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Y.prototype,"hasM",void 0),e([c({type:U,nonNullable:!0,json:{write:!0},clonable:(e,t)=>O(t)?.vertexAttributes??e.clone(t)})],Y.prototype,"vertexAttributes",void 0),Y=Q=e([l("esri.geometry.Mesh")],Y);const $=v();export{Y as default};
package/geometry/Point.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../core/Accessor.js";import r from"../core/Logger.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{cast as i}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../core/accessorSupport/decorators/writer.js";import{ensureNumber as n}from"../core/accessorSupport/ensureType.js";import p from"./Geometry.js";import u from"./SpatialReference.js";import{getLatitude as c,getLongitude as h,distance as d}from"./support/pointUtils.js";import{getInfo as m}from"./support/spatialReferenceUtils.js";import{lngLatToXY as y,xyToLngLat as f}from"./support/webMercatorUtils.js";var g;const w=[0,0];function x(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}let _=g=class extends p{static copy(t,r){r._set("x",t._get("x")),r._set("y",t._get("y")),r._set("z",t._get("z")),r._set("m",t._get("m"));const s=t._get("spatialReference");r._set("spatialReference",e.isFrozen(s)?s:s.clone())}constructor(...t){super(...t),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(t,e,s,i,o){let l;if(Array.isArray(t))l=t,o=e,t=l[0],e=l[1],s=l[2],i=l[3];else if(t&&"object"==typeof t){if(l=t,t=null!=l.x?l.x:l.longitude,e=null!=l.y?l.y:l.latitude,s=l.z,i=l.m,(o=l.spatialReference)&&"esri.geometry.SpatialReference"!==o.declaredClass&&(o=new u(o)),null!=l.longitude||null!=l.latitude)if(null==l.longitude)r.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(null==l.latitude)r.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!l.declaredClass&&o?.isWebMercator){const r=y(l.longitude,l.latitude,w);t=r[0],e=r[1]}}else x(s)?(o=s,s=null):x(i)&&(o=i,i=null);const a={x:t,y:e};return null==a.x&&null!=a.y?r.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):null==a.y&&null!=a.x&&r.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),null!=o&&(a.spatialReference=o),null!=s&&(a.z=s),null!=i&&(a.m=i),a}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return void 0!==this.m}set hasM(t){t!==(void 0!==this._get("m"))&&(this._set("m",t?0:void 0),this._set("hasM",t))}get hasZ(){return void 0!==this.z}set hasZ(t){t!==(void 0!==this._get("z"))&&(this._set("z",t?0:void 0),this._set("hasZ",t))}get latitude(){return c(this)}set latitude(t){const{spatialReference:e,x:r}=this;null!=t&&e&&(e.isWebMercator?this._set("y",y(r,t,w)[1]):e.isGeographic&&this._set("y",t),this._set("latitude",t))}get longitude(){return h(this)}set longitude(t){const{y:e,spatialReference:r}=this;null!=t&&r&&(r.isWebMercator?this._set("x",y(t,e,w)[0]):r.isGeographic&&this._set("x",t),this._set("longitude",t))}writeX(t,e,r){e[r]=isNaN(t)?"NaN":t}readX(t){return"string"==typeof t?NaN:t}clone(){const t=new g;return t.x=this.x,t.y=this.y,t.z=this.z,t.m=this.m,t.spatialReference=this.spatialReference,t}copy(t){return g.copy(t,this),this}equals(t){if(null==t)return!1;const{x:e,y:r,z:s,m:i,spatialReference:o}=this,{z:l,m:a}=t;let{x:n,y:p,spatialReference:u}=t;if(!o.equals(u))if(o.isWebMercator&&u.isWGS84)[n,p]=y(n,p),u=o;else{if(!o.isWGS84||!u.isWebMercator)return!1;[n,p]=f(n,p),u=o}return e===n&&r===p&&s===l&&i===a&&o.wkid===u.wkid}offset(t,e,r){return this.x+=t,this.y+=e,null!=r&&(this.z=(this.z??0)+r),this}normalize(){if(!this.spatialReference)return this;const t=m(this.spatialReference);if(!t)return this;let e=this.x;const[r,s]=t.valid,i=2*s;let o;return e>s?(o=Math.ceil(Math.abs(e-s)/i),e-=o*i):e<r&&(o=Math.ceil(Math.abs(e-r)/i),e+=o*i),this._set("x",e),this}distance(t){return d(this,t)}toArray(){const t=this.hasZ,e=this.hasM;return t&&e?[this.x,this.y,this.z,this.m]:t?[this.x,this.y,this.z]:e?[this.x,this.y,this.m]:[this.x,this.y]}toJSON(t){return this.write({},t)}};t([s({readOnly:!0})],_.prototype,"cache",null),t([s({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],_.prototype,"hasM",null),t([s({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],_.prototype,"hasZ",null),t([s({type:Number})],_.prototype,"latitude",null),t([s({type:Number})],_.prototype,"longitude",null),t([s({type:Number,json:{type:[Number,String],write:{isRequired:!0,allowNull:!0}}}),i(t=>isNaN(t)?t:n(t))],_.prototype,"x",void 0),t([a("x")],_.prototype,"writeX",null),t([o("x")],_.prototype,"readX",null),t([s({type:Number,json:{write:!0}})],_.prototype,"y",void 0),t([s({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],_.prototype,"z",void 0),t([s({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],_.prototype,"m",void 0),_=g=t([l("esri.geometry.Point")],_),_.prototype.toJSON.isDefaultToJSON=!0;const b=_;export{b as default};
5
+ import{__decorate as t}from"tslib";import e from"../core/Accessor.js";import r from"../core/Logger.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{cast as i}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../core/accessorSupport/decorators/writer.js";import{ensureNumber as n}from"../core/accessorSupport/ensureType.js";import p from"./Geometry.js";import u from"./SpatialReference.js";import{getLatitude as c,getLongitude as h,distance as d}from"./support/pointUtils.js";import{getInfo as m}from"./support/spatialReferenceUtils.js";import{lngLatToXY as y,xyToLngLat as f}from"./support/webMercatorUtils.js";var g;const w=[0,0];function x(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}let _=g=class extends p{static copy(t,r){r._set("x",t._get("x")),r._set("y",t._get("y")),r._set("z",t._get("z")),r._set("m",t._get("m"));const s=t._get("spatialReference");r._set("spatialReference",e.isFrozen(s)?s:s.clone())}constructor(...t){super(...t),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(t,e,s,i,o){let l;if(Array.isArray(t))l=t,o=e,t=l[0],e=l[1],s=l[2],i=l[3];else if(t&&"object"==typeof t){if(l=t,t=null!=l.x?l.x:l.longitude,e=null!=l.y?l.y:l.latitude,s=l.z,i=l.m,(o=l.spatialReference)&&"esri.geometry.SpatialReference"!==o.declaredClass&&(o=new u(o)),null!=l.longitude||null!=l.latitude)if(null==l.longitude)r.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(null==l.latitude)r.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!l.declaredClass&&o?.isWebMercator){const r=y(l.longitude,l.latitude,w);t=r[0],e=r[1]}}else x(s)?(o=s,s=null):x(i)&&(o=i,i=null);const a={x:t,y:e};return null==a.x&&null!=a.y?r.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):null==a.y&&null!=a.x&&r.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),null!=o&&(a.spatialReference=o),null!=s&&(a.z=s),null!=i&&(a.m=i),a}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return void 0!==this.m}set hasM(t){t!==(void 0!==this._get("m"))&&(this._set("m",t?0:void 0),this._set("hasM",t))}get hasZ(){return void 0!==this.z}set hasZ(t){t!==(void 0!==this._get("z"))&&(this._set("z",t?0:void 0),this._set("hasZ",t))}get latitude(){return c(this)}set latitude(t){const{spatialReference:e,x:r}=this;null!=t&&e&&(e.isWebMercator?this._set("y",y(r,t,w)[1]):e.isGeographic&&this._set("y",t),this._set("latitude",t))}get longitude(){return h(this)}set longitude(t){const{y:e,spatialReference:r}=this;null!=t&&r&&(r.isWebMercator?this._set("x",y(t,e,w)[0]):r.isGeographic&&this._set("x",t),this._set("longitude",t))}writeX(t,e,r){e[r]=isNaN(t)?"NaN":t}readX(t){return"string"==typeof t?NaN:t}clone(){const t=new g;return t.x=this.x,t.y=this.y,t.z=this.z,t.m=this.m,t.spatialReference=this.spatialReference,t}copy(t){return g.copy(t,this),this}equals(t){if(null==t)return!1;const{x:e,y:r,z:s,m:i,spatialReference:o}=this,{z:l,m:a}=t;let{x:n,y:p,spatialReference:u}=t;if(!o.equals(u))if(o.isWebMercator&&u.isWGS84)[n,p]=y(n,p),u=o;else{if(!o.isWGS84||!u.isWebMercator)return!1;[n,p]=f(n,p),u=o}return e===n&&r===p&&s===l&&i===a&&o.wkid===u.wkid}offset(t,e,r){return this.x+=t,this.y+=e,null!=r&&(this.z=(this.z??0)+r),this}normalize(){if(!this.spatialReference)return this;const t=m(this.spatialReference);if(!t)return this;let e=this.x;const[r,s]=t.valid,i=2*s;let o;return e>s?(o=Math.ceil(Math.abs(e-s)/i),e-=o*i):e<r&&(o=Math.ceil(Math.abs(e-r)/i),e+=o*i),this._set("x",e),this}distance(t){return d(this,t)}toArray(){const t=this.hasZ,e=this.hasM;return t&&e?[this.x,this.y,this.z,this.m]:t?[this.x,this.y,this.z]:e?[this.x,this.y,this.m]:[this.x,this.y]}toJSON(t){return this.write({},t)}};t([s({readOnly:!0})],_.prototype,"cache",null),t([s({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],_.prototype,"hasM",null),t([s({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],_.prototype,"hasZ",null),t([s({type:Number})],_.prototype,"latitude",null),t([s({type:Number})],_.prototype,"longitude",null),t([s({type:Number,json:{type:[Number,String],write:{isRequired:!0,allowNull:!0}}}),i(t=>isNaN(t)?t:n(t))],_.prototype,"x",void 0),t([a("x")],_.prototype,"writeX",null),t([o("x")],_.prototype,"readX",null),t([s({type:Number,json:{write:!0}})],_.prototype,"y",void 0),t([s({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],_.prototype,"z",void 0),t([s({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],_.prototype,"m",void 0),_=g=t([l("esri.geometry.Point")],_),_.prototype.toJSON.isDefaultToJSON=!0;export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../core/Accessor.js";import{JSONSupport as r}from"../core/JSONSupport.js";import{clone as i}from"../core/lang.js";import{getMetersPerUnitForSR as s,getUnitString as o}from"../core/unitUtils.js";import{Integer as n}from"../core/accessorSupport/ensureType.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import{isWGS84 as u,isWebMercator as c,isGeographic as d,isWrappable as m,wgs84 as w,webMercator as h,equals as y,plateCarree as k}from"./support/spatialReferenceUtils.js";var S;let f=class extends r{static{S=this}static{this.GCS_NAD_1927=null}static{this.WGS84=null}static{this.WebMercator=null}static{this.PlateCarree=null}static fromJSON(t){if(!t)return null;if(102100===t?.wkid)return S.WebMercator;if(4326===t?.wkid)return S.WGS84;const e=new S;return e.read(t),e}constructor(t){super(t),this.latestWkid=null,this.wkid=null,this.wkt=null,this.wkt2=null,this.vcsWkid=null,this.latestVcsWkid=null,this.imageCoordinateSystem=null}normalizeCtorArgs(t){if(t&&"object"==typeof t)return t;const e="string"==typeof t?"wkt":"wkid";return{[e]:t}}get isWGS84(){return u(this)}get isWebMercator(){return c(this)}get isGeographic(){return d(this)}get isWrappable(){return m(this)}get metersPerUnit(){return s(this)}get unit(){return o(this)||(this.isGeographic?"degrees":null)}writeWkt(t,e){this.wkid||(e.wkt=t)}clone(){if(this===S.WGS84)return new S(w);if(this===S.WebMercator)return new S(h);const t=new S;return null!=this.wkid?(t.wkid=this.wkid,null!=this.latestWkid&&(t.latestWkid=this.latestWkid),null!=this.vcsWkid&&(t.vcsWkid=this.vcsWkid),null!=this.latestVcsWkid&&(t.latestVcsWkid=this.latestVcsWkid)):(null!=this.wkt&&(t.wkt=this.wkt),null!=this.wkt2&&(t.wkt2=this.wkt2)),this.imageCoordinateSystem&&(t.imageCoordinateSystem=i(this.imageCoordinateSystem)),t}equals(t){if(null==t)return!1;if(this.imageCoordinateSystem||t.imageCoordinateSystem){if(null==this.imageCoordinateSystem||null==t.imageCoordinateSystem)return!1;const{id:e,referenceServiceName:r}=t.imageCoordinateSystem,{geodataXform:i}=t.imageCoordinateSystem,s=this.imageCoordinateSystem;return null==e||i?JSON.stringify(s)===JSON.stringify(t.imageCoordinateSystem):r?s.id===e&&s.referenceServiceName===r:s.id===e}return y(this,t)}toJSON(t){return this.write(void 0,t)}};t([l({readOnly:!0})],f.prototype,"isWGS84",null),t([l({readOnly:!0})],f.prototype,"isWebMercator",null),t([l({readOnly:!0})],f.prototype,"isGeographic",null),t([l({readOnly:!0})],f.prototype,"isWrappable",null),t([l({type:n,json:{write:!0}})],f.prototype,"latestWkid",void 0),t([l({readOnly:!0})],f.prototype,"metersPerUnit",null),t([l({readOnly:!0})],f.prototype,"unit",null),t([l({type:n,json:{write:!0,origins:{"web-scene":{write:{overridePolicy(){return{isRequired:null==this.wkt}}}}}}})],f.prototype,"wkid",void 0),t([l({type:String,json:{origins:{"web-scene":{write:{overridePolicy(){return{isRequired:null==this.wkid}}}}}}})],f.prototype,"wkt",void 0),t([p("wkt"),p("web-scene","wkt")],f.prototype,"writeWkt",null),t([l({type:String,json:{write:!1}})],f.prototype,"wkt2",void 0),t([l({type:n,json:{write:!0}})],f.prototype,"vcsWkid",void 0),t([l({type:n,json:{write:!0}})],f.prototype,"latestVcsWkid",void 0),t([l()],f.prototype,"imageCoordinateSystem",void 0),f=S=t([a("esri.geometry.SpatialReference")],f);const g=f;f.prototype.toJSON.isDefaultToJSON=!0,f.GCS_NAD_1927=e.freeze(new f({wkid:4267,wkt:'GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'})),f.WGS84=e.freeze(new f(w)),f.WebMercator=e.freeze(new f(h)),f.PlateCarree=e.freeze(new f(k));export{g as default};
5
+ import{__decorate as t}from"tslib";import e from"../core/Accessor.js";import{JSONSupport as r}from"../core/JSONSupport.js";import{clone as i}from"../core/lang.js";import{getMetersPerUnitForSR as s,getUnitString as o}from"../core/unitUtils.js";import{Integer as n}from"../core/accessorSupport/ensureType.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import{isWGS84 as u,isWebMercator as c,isGeographic as d,isWrappable as m,wgs84 as w,webMercator as h,equals as y,plateCarree as k}from"./support/spatialReferenceUtils.js";var S;let f=class extends r{static{S=this}static{this.GCS_NAD_1927=null}static{this.WGS84=null}static{this.WebMercator=null}static{this.PlateCarree=null}static fromJSON(t){if(!t)return null;if(102100===t?.wkid)return S.WebMercator;if(4326===t?.wkid)return S.WGS84;const e=new S;return e.read(t),e}constructor(t){super(t),this.latestWkid=null,this.wkid=null,this.wkt=null,this.wkt2=null,this.vcsWkid=null,this.latestVcsWkid=null,this.imageCoordinateSystem=null}normalizeCtorArgs(t){if(t&&"object"==typeof t)return t;const e="string"==typeof t?"wkt":"wkid";return{[e]:t}}get isWGS84(){return u(this)}get isWebMercator(){return c(this)}get isGeographic(){return d(this)}get isWrappable(){return m(this)}get metersPerUnit(){return s(this)}get unit(){return o(this)||(this.isGeographic?"degrees":null)}writeWkt(t,e){this.wkid||(e.wkt=t)}clone(){if(this===S.WGS84)return new S(w);if(this===S.WebMercator)return new S(h);const t=new S;return null!=this.wkid?(t.wkid=this.wkid,null!=this.latestWkid&&(t.latestWkid=this.latestWkid),null!=this.vcsWkid&&(t.vcsWkid=this.vcsWkid),null!=this.latestVcsWkid&&(t.latestVcsWkid=this.latestVcsWkid)):(null!=this.wkt&&(t.wkt=this.wkt),null!=this.wkt2&&(t.wkt2=this.wkt2)),this.imageCoordinateSystem&&(t.imageCoordinateSystem=i(this.imageCoordinateSystem)),t}equals(t){if(null==t)return!1;if(this.imageCoordinateSystem||t.imageCoordinateSystem){if(null==this.imageCoordinateSystem||null==t.imageCoordinateSystem)return!1;const{id:e,referenceServiceName:r}=t.imageCoordinateSystem,{geodataXform:i}=t.imageCoordinateSystem,s=this.imageCoordinateSystem;return null==e||i?JSON.stringify(s)===JSON.stringify(t.imageCoordinateSystem):r?s.id===e&&s.referenceServiceName===r:s.id===e}return y(this,t)}toJSON(t){return this.write(void 0,t)}};t([l({readOnly:!0})],f.prototype,"isWGS84",null),t([l({readOnly:!0})],f.prototype,"isWebMercator",null),t([l({readOnly:!0})],f.prototype,"isGeographic",null),t([l({readOnly:!0})],f.prototype,"isWrappable",null),t([l({type:n,json:{write:!0}})],f.prototype,"latestWkid",void 0),t([l({readOnly:!0})],f.prototype,"metersPerUnit",null),t([l({readOnly:!0})],f.prototype,"unit",null),t([l({type:n,json:{write:!0,origins:{"web-scene":{write:{overridePolicy(){return{isRequired:null==this.wkt}}}}}}})],f.prototype,"wkid",void 0),t([l({type:String,json:{origins:{"web-scene":{write:{overridePolicy(){return{isRequired:null==this.wkid}}}}}}})],f.prototype,"wkt",void 0),t([p("wkt"),p("web-scene","wkt")],f.prototype,"writeWkt",null),t([l({type:String,json:{write:!1}})],f.prototype,"wkt2",void 0),t([l({type:n,json:{write:!0}})],f.prototype,"vcsWkid",void 0),t([l({type:n,json:{write:!0}})],f.prototype,"latestVcsWkid",void 0),t([l()],f.prototype,"imageCoordinateSystem",void 0),f=S=t([a("esri.geometry.SpatialReference")],f),f.prototype.toJSON.isDefaultToJSON=!0,f.GCS_NAD_1927=e.freeze(new f({wkid:4267,wkt:'GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'})),f.WGS84=e.freeze(new f(w)),f.WebMercator=e.freeze(new f(h)),f.PlateCarree=e.freeze(new f(k));export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{earth as n,mars as t,moon as e}from"./support/Ellipsoid.js";import{isWKIDFromMars as r,isWKIDFromMoon as i,equals as c,isValid as o}from"./support/spatialReferenceUtils.js";function S(n){return{wkt:`GEOCCS["Spherical geocentric",\n DATUM["Not specified",\n SPHEROID["Sphere",${n.radius},0]],\n PRIMEM["Greenwich",0.0,\n AUTHORITY["EPSG","8901"]],\n UNIT["m",1.0],\n AXIS["Geocentric X",OTHER],\n AXIS["Geocentric Y",EAST],\n AXIS["Geocentric Z",NORTH]\n ]`}}const T=S(n),G=S(t),I=S(e),p={wkt:`GEOCCS["WGS 84",\n DATUM["WGS_1984",\n SPHEROID["WGS 84",${n.radius},298.257223563,\n AUTHORITY["EPSG","7030"]],\n AUTHORITY["EPSG","6326"]],\n PRIMEM["Greenwich",0,\n AUTHORITY["EPSG","8901"]],\n UNIT["m",1.0,\n AUTHORITY["EPSG","9001"]],\n AXIS["Geocentric X",OTHER],\n AXIS["Geocentric Y",OTHER],\n AXIS["Geocentric Z",NORTH],\n AUTHORITY["EPSG","4978"]\n]`},s=G.wkt.toUpperCase(),u=I.wkt.toUpperCase();function E(c){if(null!=c&&o(c)){const n=c.wkid,o=c.wkt2??c.wkt;if(r(n))return t;const S=o?.toUpperCase();if(o&&S===s)return t;if(i(n)||S&&S===u)return e}return n}const R=Math.cos(Math.PI/16/16);function A(c){return r(c)?t:i(c)?e:n}function O(n){return c(n,T)}function U(n){return O(n)||c(n,G)||c(n,I)}export{T as SphericalECEFSpatialReferenceLike,G as SphericalPCPFMarsLike,I as SphericalPCPFMoonLike,p as WGS84ECEFSpatialReferenceLike,E as getReferenceEllipsoid,A as getReferenceEllipsoidFromWKID,O as isSphericalECEF,U as isSphericalPCPF,R as radiusModifier};
5
+ import{mars as n,moon as t,earth as e}from"./support/Ellipsoid.js";import{equals as r,isValid as i,isWKIDFromMars as c,isWKIDFromMoon as o}from"./support/spatialReferenceUtils.js";function S(n){return{wkt:`GEOCCS["Spherical geocentric",\n DATUM["Not specified",\n SPHEROID["Sphere",${n.radius},0]],\n PRIMEM["Greenwich",0.0,\n AUTHORITY["EPSG","8901"]],\n UNIT["m",1.0],\n AXIS["Geocentric X",OTHER],\n AXIS["Geocentric Y",EAST],\n AXIS["Geocentric Z",NORTH]\n ]`}}const T=S(e),G=S(n),I=S(t),p={wkt:`GEOCCS["WGS 84",\n DATUM["WGS_1984",\n SPHEROID["WGS 84",${e.radius},298.257223563,\n AUTHORITY["EPSG","7030"]],\n AUTHORITY["EPSG","6326"]],\n PRIMEM["Greenwich",0,\n AUTHORITY["EPSG","8901"]],\n UNIT["m",1.0,\n AUTHORITY["EPSG","9001"]],\n AXIS["Geocentric X",OTHER],\n AXIS["Geocentric Y",OTHER],\n AXIS["Geocentric Z",NORTH],\n AUTHORITY["EPSG","4978"]\n]`},s=G.wkt.toUpperCase(),u=I.wkt.toUpperCase();function E(r){if(null!=r&&i(r)){const e=r.wkid,i=r.wkt2??r.wkt;if(c(e))return n;const S=i?.toUpperCase();if(i&&S===s)return n;if(o(e)||S&&S===u)return t}return e}const R=Math.cos(Math.PI/16/16);function A(r){return c(r)?n:o(r)?t:e}function O(n){return r(n,T)}function U(n){return O(n)||r(n,G)||r(n,I)}export{T as SphericalECEFSpatialReferenceLike,G as SphericalPCPFMarsLike,I as SphericalPCPFMoonLike,p as WGS84ECEFSpatialReferenceLike,E as getReferenceEllipsoid,A as getReferenceEllipsoidFromWKID,O as isSphericalECEF,U as isSphericalPCPF,R as radiusModifier};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{aJ as o,i as u,d as m,P as l,b as c,aK as d,m as _}from"../../../chunks/Point2D.js";import{q as h,b as f,p,aX as k,c as b,e as y,a as N,f as T,aY as g}from"../../../chunks/UnitFactory.js";import{a1 as v,a4 as x,P as A,E as S,$ as w,a0 as C,a5 as D,a6 as F,Y as j}from"../../../chunks/Envelope.js";import{a as O,P as z,S as I,M as E,N as P,a5 as B,a6 as R,a7 as V,a8 as M,a9 as U}from"../../../chunks/MultiPathImpl.js";import W from"../../SpatialReference.js";import"./initNoPeFactory.js";function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function Y(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:X}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:Y}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class G{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class q{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===q.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===q.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,G=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=H(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=$(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,B=ee(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,R=ee(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,V=ee(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=ee(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=te(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=ee(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=ee(i);continue}}else if("mmin"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=ee(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=ee(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=te(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=ee(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,L=ee(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,J=ee(i);continue}}else if("zmax"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=ee(i);continue}}else if("idmax"===u){if(!P&&(e===s.enumUnknown||e===s.enumEnvelope)){P=!0,ie=te(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ne(n,me)}else if(b||y||T||N||g){x(B,R)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new A({x:B,y:R});N&&e.setZ(V),T&&e.setM(M),g&&e.setID(U),ce=e}else if(w||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:Y,ymax:L});j&&O&&e.setInterval(1,0,G,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function J(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,R=0,V=0,M="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,R=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,V=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=J(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,Y=!0;if(0!==M.length&&(Y=!1,h(M)&&(X=f(M))),X||0===U.length||(Y=!1,h(U)&&(X=f(U))),!X&&w>0&&(Y=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(Y=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),Y&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),g&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(R,I),x&&_&&e.setMParams(V,E),X=T(X,e)}return X}function Z(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new z,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=l.getNAN(),P=m(O,Number.NaN),B=m(O,Number.NaN);let R=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),R=!0,r=1,({segFlag:T,toPointSz:z}=me(g,P,x,i));else{for(R=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ee(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(P[0],P[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(re(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(ie(A)),z>2?(h||(h=v(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(ie(A)),z>3?(f||(f=v(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(R){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function H(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ee(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(re(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(ie(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(ie(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function $(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ie(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ee(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function te(e){return e.currentInt32Value()}function ne(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===z.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===z.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function re(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ie(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function se(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function ae(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function oe(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ue(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function me(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=ee(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ee(i),o=i.nextToken(),k=ee(i),o=i.nextToken(),b=ee(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;le(e.get(),r,c,d,t,_,h)}else ce(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),de(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),_e(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;le(e.get(),r,c,N,t,-1,-1)}return a}function le(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,se(e,t,n,m,0)}function ce(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new q({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ae(e,t,n,c,0)}function de(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new q({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,oe(e,t,n,a,0)}function _e(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ue(e,t,n,m,0)}function he(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return fe(e,t,n,r,i);if(o===s.enumBezier)return pe(e,t,n,r,i);if(o===s.enumRationalBezier2)return ke(e,t,n,r,i);if(o===s.enumBezier2){const s=new P;return s.constructFromQuadraticSegment(e),pe(s,t,n,r,i)}a("")}function fe(e,t,r,i,s){n(!B(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return be(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s),ye(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ye(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=e;ye(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp[0].x,e.m_cp[0].y,r,i),ye(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function be(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ye(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ne{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Te(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Te(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:ge(!0,t,r,a);break;case s.enumPolyline:ge(!1,t,r,a);break;case s.enumMultiPoint:ve(t,r,a);break;case s.enumPoint:xe(t,r,a);break;case s.enumEnvelope:Ae(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),we(t,i,a)),a.endObject()}}function ge(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Ce(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,R=0;for(let t=m+1,r=m,V=s?n+1:n;t<V;t++,r++){const s=null!==T?31&T.read(r):1;let m,V;if(t<n?(m=p.read(2*t),V=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(R=y.read(t))):(m=D,V=F,P=j,B=O,R=z),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,V),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,n);he(N.get(),o,u,e,i)&&E++}else Ce(l,c,m,V,P,B,e,i);d&&(h.add(R),f[f.length-1]++),C++,_=m,x=V,A=P,S=B,w=R}I&&0===E||(C<2&&E<1&&(Ce(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Ce(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ve(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Ce(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Ae(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Se(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function we(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Se(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Ce(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const De={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Fe{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==De.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case De.s_doubleQuote:e+='"';break;case De.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case De.s_backslash:e+="\\";break;case De.s_forwardslash:e+="/";break;case De.s_b:e+="\b";break;case De.s_f:e+="\f";break;case De.s_n:e+="\n";break;case De.s_r:e+="\r";break;case De.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===De.s_asterisk?this.skipCStyleComments_():e===De.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===De.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===De.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===De.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==De.s_doubleQuote;){const n=e===De.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===De.s_doubleQuote||e===De.s_backslash||e===De.s_forwardslash||e===De.s_b||e===De.s_f||e===De.s_n||e===De.s_r||e===De.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===De.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||e>=De.s_a&&e<=De.s_f||e>=De.s_A&&e<=De.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===De.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===De.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==De.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==De.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=De.s_zero&&e<=De.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==De.s_plus&&e!==De.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===De.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=De.s_zero&&n<=De.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===De.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==De.s_e&&n!==De.s_E||this.exp_();else if(n===De.s_e||n===De.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===De.s_beginObject?this.valueStartObject_():e===De.s_beginArray?this.valueStartArray_():e===De.s_doubleQuote?this.valueString_():e===De.s_minus||e>=De.s_zero&&e<=De.s_zero+9?this.valueNumber_():e===De.s_n?this.valueNull_():e===De.s_t?this.valueTrue_():e===De.s_f?this.valueFalse_():e===De.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==De.s_beginObject&&e!==De.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class je{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Fe({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const Oe=new G,ze=new Ne,Ie=new je;function Ee(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Pe(e,t){const{includeGeometry:n=!0,includeSpatialReference:r=!0}=t??{};r&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const i=new L(e,{strict:!1});return i.nextToken(),Ie.execute(0,s.enumUnknown,i,n,r)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Re(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Re(e){return e.spatialReference instanceof W&&(e={...e,spatialReference:e.spatialReference.toJSON()}),Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){return e instanceof W&&(e=e.toJSON()),Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference()}function Ue(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Oe.reset(),ze.execute(0,e,t,Oe),Oe.getObject())}export{Be as fromGeometries,Re as fromGeometry,Ve as fromGeometryToGXGeometry,Me as fromSpatialReference,Ee as getSpatialReference,Ue as toGeometry};
5
+ import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{aJ as o,i as u,d as m,P as l,b as c,aK as d,m as _}from"../../../chunks/Point2D.js";import{q as h,b as f,p,aX as k,c as b,e as y,a as N,f as T,aY as g}from"../../../chunks/UnitFactory.js";import{a1 as v,a4 as x,P as A,E as S,$ as w,a0 as C,a5 as D,a6 as F,Y as j}from"../../../chunks/Envelope.js";import{a as O,P as z,S as I,M as E,J as P,a5 as B,a6 as R,a7 as V,a8 as M,a9 as U}from"../../../chunks/MultiPathImpl.js";import W from"../../SpatialReference.js";import"./initNoPeFactory.js";function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function Y(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:X}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:Y}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class G{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class q{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===q.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===q.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,G=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=H(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=$(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,B=ee(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,R=ee(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,V=ee(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=ee(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=te(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=ee(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=ee(i);continue}}else if("mmin"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=ee(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=ee(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=te(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=ee(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,L=ee(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,J=ee(i);continue}}else if("zmax"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=ee(i);continue}}else if("idmax"===u){if(!P&&(e===s.enumUnknown||e===s.enumEnvelope)){P=!0,ie=te(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ne(n,me)}else if(b||y||T||N||g){x(B,R)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new A({x:B,y:R});N&&e.setZ(V),T&&e.setM(M),g&&e.setID(U),ce=e}else if(w||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:Y,ymax:L});j&&O&&e.setInterval(1,0,G,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function J(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,R=0,V=0,M="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,R=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,V=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=J(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,Y=!0;if(0!==M.length&&(Y=!1,h(M)&&(X=f(M))),X||0===U.length||(Y=!1,h(U)&&(X=f(U))),!X&&w>0&&(Y=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(Y=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),Y&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),g&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(R,I),x&&_&&e.setMParams(V,E),X=T(X,e)}return X}function Z(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new z,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=l.getNAN(),P=m(O,Number.NaN),B=m(O,Number.NaN);let R=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),R=!0,r=1,({segFlag:T,toPointSz:z}=me(g,P,x,i));else{for(R=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ee(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(P[0],P[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(re(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(ie(A)),z>2?(h||(h=v(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(ie(A)),z>3?(f||(f=v(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(R){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function H(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ee(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(re(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(ie(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(ie(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function $(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ie(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ee(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function te(e){return e.currentInt32Value()}function ne(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===z.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===z.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function re(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ie(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function se(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function ae(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function oe(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ue(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function me(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=ee(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ee(i),o=i.nextToken(),k=ee(i),o=i.nextToken(),b=ee(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;le(e.get(),r,c,d,t,_,h)}else ce(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),de(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),_e(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;le(e.get(),r,c,N,t,-1,-1)}return a}function le(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,se(e,t,n,m,0)}function ce(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new q({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ae(e,t,n,c,0)}function de(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new q({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,oe(e,t,n,a,0)}function _e(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ue(e,t,n,m,0)}function he(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return fe(e,t,n,r,i);if(o===s.enumBezier)return pe(e,t,n,r,i);if(o===s.enumRationalBezier2)return ke(e,t,n,r,i);if(o===s.enumBezier2){const s=new P;return s.constructFromQuadraticSegment(e),pe(s,t,n,r,i)}a("")}function fe(e,t,r,i,s){n(!B(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return be(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s),ye(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ye(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=e;ye(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp[0].x,e.m_cp[0].y,r,i),ye(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function be(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ye(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ne{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Te(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Te(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:ge(!0,t,r,a);break;case s.enumPolyline:ge(!1,t,r,a);break;case s.enumMultiPoint:ve(t,r,a);break;case s.enumPoint:xe(t,r,a);break;case s.enumEnvelope:Ae(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),we(t,i,a)),a.endObject()}}function ge(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Ce(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,R=0;for(let t=m+1,r=m,V=s?n+1:n;t<V;t++,r++){const s=null!==T?31&T.read(r):1;let m,V;if(t<n?(m=p.read(2*t),V=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(R=y.read(t))):(m=D,V=F,P=j,B=O,R=z),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,V),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,n);he(N.get(),o,u,e,i)&&E++}else Ce(l,c,m,V,P,B,e,i);d&&(h.add(R),f[f.length-1]++),C++,_=m,x=V,A=P,S=B,w=R}I&&0===E||(C<2&&E<1&&(Ce(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Ce(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ve(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Ce(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Ae(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Se(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function we(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Se(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Ce(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const De={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Fe{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==De.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case De.s_doubleQuote:e+='"';break;case De.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case De.s_backslash:e+="\\";break;case De.s_forwardslash:e+="/";break;case De.s_b:e+="\b";break;case De.s_f:e+="\f";break;case De.s_n:e+="\n";break;case De.s_r:e+="\r";break;case De.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===De.s_asterisk?this.skipCStyleComments_():e===De.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===De.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===De.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===De.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==De.s_doubleQuote;){const n=e===De.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===De.s_doubleQuote||e===De.s_backslash||e===De.s_forwardslash||e===De.s_b||e===De.s_f||e===De.s_n||e===De.s_r||e===De.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===De.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||e>=De.s_a&&e<=De.s_f||e>=De.s_A&&e<=De.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===De.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===De.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==De.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==De.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=De.s_zero&&e<=De.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==De.s_plus&&e!==De.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===De.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=De.s_zero&&n<=De.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===De.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==De.s_e&&n!==De.s_E||this.exp_();else if(n===De.s_e||n===De.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===De.s_beginObject?this.valueStartObject_():e===De.s_beginArray?this.valueStartArray_():e===De.s_doubleQuote?this.valueString_():e===De.s_minus||e>=De.s_zero&&e<=De.s_zero+9?this.valueNumber_():e===De.s_n?this.valueNull_():e===De.s_t?this.valueTrue_():e===De.s_f?this.valueFalse_():e===De.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==De.s_beginObject&&e!==De.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class je{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Fe({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const Oe=new G,ze=new Ne,Ie=new je;function Ee(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Pe(e,t){const{includeGeometry:n=!0,includeSpatialReference:r=!0}=t??{};r&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const i=new L(e,{strict:!1});return i.nextToken(),Ie.execute(0,s.enumUnknown,i,n,r)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Re(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Re(e){return e.spatialReference instanceof W&&(e={...e,spatialReference:e.spatialReference.toJSON()}),Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){return e instanceof W&&(e=e.toJSON()),Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference()}function Ue(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Oe.reset(),ze.execute(0,e,t,Oe),Oe.getObject())}export{Be as fromGeometries,Re as fromGeometry,Ve as fromGeometryToGXGeometry,Me as fromSpatialReference,Ee as getSpatialReference,Ue as toGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{fromRotationTranslationScale as i,invert as a,exactEquals as l}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as p}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as c,fromArray as u,fromValues as f,clone as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{up as x,fromAxisAndAngle as g,angle as j,angleRad as b,axis as y}from"./axisAngleDegrees.js";let d=class extends(o(r)){constructor(t){super(t),this.translation=c(),this.rotationAxis=u(x),this.rotationAngle=0,this.scale=f(1,1,1)}get rotation(){return g(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=h(y(t)),this.rotationAngle=j(t)}get localMatrix(){const t=n();return p(A,y(this.rotation),b(this.rotation)),i(t,A,this.translation,this.scale),t}get localMatrixInverse(){return a(n(),this.localMatrix)}equals(t){return this===t||null!=t&&l(this.localMatrix,t.localMatrix)}};t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"translation",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAxis",void 0),t([e({type:Number,nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAngle",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"scale",void 0),t([e()],d.prototype,"rotation",null),t([e()],d.prototype,"localMatrix",null),t([e()],d.prototype,"localMatrixInverse",null),d=t([s("esri.geometry.support.MeshTransform")],d);const A=m();export{d as default};
5
+ import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{fromRotationTranslationScale as i,invert as a,exactEquals as l}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as p}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as c,fromArray as u,fromValues as f,clone as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromAxisAndAngle as x,angle as g,angleRad as j,axis as b,up as y}from"./axisAngleDegrees.js";let d=class extends(o(r)){constructor(t){super(t),this.translation=c(),this.rotationAxis=u(y),this.rotationAngle=0,this.scale=f(1,1,1)}get rotation(){return x(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=h(b(t)),this.rotationAngle=g(t)}get localMatrix(){const t=n();return p(A,b(this.rotation),j(this.rotation)),i(t,A,this.translation,this.scale),t}get localMatrixInverse(){return a(n(),this.localMatrix)}equals(t){return this===t||null!=t&&l(this.localMatrix,t.localMatrix)}};t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"translation",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAxis",void 0),t([e({type:Number,nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAngle",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"scale",void 0),t([e()],d.prototype,"rotation",null),t([e()],d.prototype,"localMatrix",null),t([e()],d.prototype,"localMatrixInverse",null),d=t([s("esri.geometry.support.MeshTransform")],d);const A=m();export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{rad2deg as r,deg2rad as t}from"../../core/mathUtils.js";import{getRotation as n}from"../../core/libs/gl-matrix-2/math/mat4.js";import{setAxisAngle as o,multiply as i,getAxisAngle as u}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{d as e,i as f,n as s,p as m}from"../../chunks/vec32.js";import{UNIT_X as a,UNIT_Y as l,UNIT_Z as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";function j(r=B){return[r[0],r[1],r[2],r[3]]}function x(r,t,n,o){return h(r,t,n,o,E)}function b(r,t){return h(r[0],r[1],r[2],t,E)}function g(r,t=j()){return h(r[0],r[1],r[2],r[3],t)}function h(r,t,n,o,i=j()){return i[0]=r,i[1]=t,i[2]=n,i[3]=o,i}function q(r,t,n=j()){return e(w(n),r),n[3]=t,n}function v(r,t,n){return f(n,r,t),s(n,n),n[3]=-m(r,t),n}function d(t,o=j()){const i=n(C,t);return A(o,r(u(o,i))),o}function k(t,n,c=j()){return o(C,w(t),z(t)),o(D,w(n),z(n)),i(C,D,C),A(c,r(u(w(c),C)))}function U(r,t,n,o=j()){return q(a,r,F),q(l,t,G),q(p,n,H),k(F,G,F),k(F,H,o),o}function w(r){return r}function y(r){return r[3]}function z(r){return t(r[3])}function A(r,t){return r[3]=t,r}const B=[0,0,1,0],C=c(),D=c(),E=j(),F=j(),G=j(),H=j();export{y as angle,z as angleRad,w as axis,k as compose,U as composeAxes,g as copy,j as create,q as fromAxisAndAngle,d as fromMatrix,v as fromPoints,h as fromValues,A as setAngle,B as up,x as wrap,b as wrapAxisAngle};
5
+ import{deg2rad as r,rad2deg as t}from"../../core/mathUtils.js";import{getRotation as n}from"../../core/libs/gl-matrix-2/math/mat4.js";import{setAxisAngle as o,multiply as i,getAxisAngle as u}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{d as e,i as f,n as s,p as m}from"../../chunks/vec32.js";import{UNIT_X as a,UNIT_Y as l,UNIT_Z as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";function j(r=B){return[r[0],r[1],r[2],r[3]]}function x(r,t,n,o){return h(r,t,n,o,E)}function b(r,t){return h(r[0],r[1],r[2],t,E)}function g(r,t=j()){return h(r[0],r[1],r[2],r[3],t)}function h(r,t,n,o,i=j()){return i[0]=r,i[1]=t,i[2]=n,i[3]=o,i}function q(r,t,n=j()){return e(w(n),r),n[3]=t,n}function v(r,t,n){return f(n,r,t),s(n,n),n[3]=-m(r,t),n}function d(r,o=j()){const i=n(C,r);return A(o,t(u(o,i))),o}function k(r,n,c=j()){return o(C,w(r),z(r)),o(D,w(n),z(n)),i(C,D,C),A(c,t(u(w(c),C)))}function U(r,t,n,o=j()){return q(a,r,F),q(l,t,G),q(p,n,H),k(F,G,F),k(F,H,o),o}function w(r){return r}function y(r){return r[3]}function z(t){return r(t[3])}function A(r,t){return r[3]=t,r}const B=[0,0,1,0],C=c(),D=c(),E=j(),F=j(),G=j(),H=j();export{y as angle,z as angleRad,w as axis,k as compose,U as composeAxes,g as copy,j as create,q as fromAxisAndAngle,d as fromMatrix,v as fromPoints,h as fromValues,A as setAngle,B as up,x as wrap,b as wrapAxisAngle};