@arcgis/core 5.0.0-next.39 → 5.0.0-next.40

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 (174) hide show
  1. package/Basemap.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02d1c48e874dfd985bc4.js +1 -0
  4. package/assets/esri/core/workers/chunks/0429ca6ba562ae29897e.js +1 -0
  5. package/assets/esri/core/workers/chunks/{a6324f5f560ffadc6e5d.js → 061def9163a09c804b5c.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0e4d0213d568f50c231f.js +1 -0
  7. package/assets/esri/core/workers/chunks/{1de216d9850c39c1735d.js → 1357cc637524cd254974.js} +1 -1
  8. package/assets/esri/core/workers/chunks/13839d220e5c62404923.js +1 -0
  9. package/assets/esri/core/workers/chunks/1c0fb4795a52204882a8.js +1 -0
  10. package/assets/esri/core/workers/chunks/1e286fb7bb833f00dd88.js +1 -0
  11. package/assets/esri/core/workers/chunks/{52ecbaa2d32692d6d8df.js → 1f6ead46b723630db897.js} +1 -1
  12. package/assets/esri/core/workers/chunks/218b2b767b40d85fb713.js +1 -0
  13. package/assets/esri/core/workers/chunks/2c9865e34f32fb5683e5.js +1 -0
  14. package/assets/esri/core/workers/chunks/{48d1a443b324753921de.js → 2db7a7607657f1d669f7.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2f8cf7d9ff1f4de19a4c.js +1 -0
  16. package/assets/esri/core/workers/chunks/{6330d8767ba1d5329daa.js → 31b074ae2162a3508d2a.js} +1 -1
  17. package/assets/esri/core/workers/chunks/338570424337be05cef5.js +1 -0
  18. package/assets/esri/core/workers/chunks/{a59433c78ed01febca6d.js → 3767617c0dfc7d801441.js} +1 -1
  19. package/assets/esri/core/workers/chunks/3a16347e17312556e02c.js +1 -0
  20. package/assets/esri/core/workers/chunks/3ac8de121a07c70bae0f.js +1 -0
  21. package/assets/esri/core/workers/chunks/3f33708eb39c7169a226.js +1 -0
  22. package/assets/esri/core/workers/chunks/4278b35fb6fd578c403e.js +1 -0
  23. package/assets/esri/core/workers/chunks/{3f8849c49f0e3ce7eb6b.js → 44f036cc21e3a2308f69.js} +1 -1
  24. package/assets/esri/core/workers/chunks/46daa1ff5b412a97edc9.js +1 -0
  25. package/assets/esri/core/workers/chunks/{a5d25c71aa4dfaa878cf.js → 4c4a55be41ba105c091c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/537de53ef1e9101468f5.js +1 -0
  27. package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +1 -0
  28. package/assets/esri/core/workers/chunks/6e8c20ff1d28ef2fe72c.js +1 -0
  29. package/assets/esri/core/workers/chunks/75643711d9585ee26a15.js +1 -0
  30. package/assets/esri/core/workers/chunks/7ba13b52fce1060fbb2a.js +1 -0
  31. package/assets/esri/core/workers/chunks/800c91302eaad7f00877.js +1 -0
  32. package/assets/esri/core/workers/chunks/804958f3f4ff47a4eff5.js +1 -0
  33. package/assets/esri/core/workers/chunks/816227de5bd42b437df4.js +1 -0
  34. package/assets/esri/core/workers/chunks/926c2a0e21b7aa1a86e4.js +1 -0
  35. package/assets/esri/core/workers/chunks/933dce4d4ff8b90219c8.js +1 -0
  36. package/assets/esri/core/workers/chunks/93d11075f65a5b6625ea.js +1 -0
  37. package/assets/esri/core/workers/chunks/9c0efd06c9000ccbd62d.js +1 -0
  38. package/assets/esri/core/workers/chunks/9f1d3c0b53bef07e39bf.js +1 -0
  39. package/assets/esri/core/workers/chunks/9f2a8445a5848502c7e7.js +1 -0
  40. package/assets/esri/core/workers/chunks/9f6c63a580b28ab715bd.js +1 -0
  41. package/assets/esri/core/workers/chunks/a96742e678a506c461ab.js +1 -0
  42. package/assets/esri/core/workers/chunks/b7bcff9a64f41a0a0b6a.js +1 -0
  43. package/assets/esri/core/workers/chunks/c0b15510a8cab98df77f.js +1 -0
  44. package/assets/esri/core/workers/chunks/c367c7e553be3682f2db.js +1 -0
  45. package/assets/esri/core/workers/chunks/cfd2839e218610a222e5.js +1 -0
  46. package/assets/esri/core/workers/chunks/{014dbe6fa93a277b08f7.js → d0014b4a8c013f59b113.js} +1 -1
  47. package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +1 -0
  48. package/assets/esri/core/workers/chunks/d42273394f575e71dd55.js +1 -0
  49. package/assets/esri/core/workers/chunks/d723619579cc8f5ef2cd.js +1 -0
  50. package/assets/esri/core/workers/chunks/da1e61f355fb943085dc.js +1 -0
  51. package/assets/esri/core/workers/chunks/dddb6cb44cbe4dc1af97.js +1 -0
  52. package/assets/esri/core/workers/chunks/efc293c8bbc12156096d.js +1 -0
  53. package/assets/esri/core/workers/chunks/f65f1798f398bc549463.js +1 -0
  54. package/assets/esri/core/workers/chunks/f93f0586ce10cb5d98b3.js +1 -0
  55. package/assets/esri/core/workers/chunks/{06462b267ff8d5984882.js → fb9643b74cf35221ff98.js} +1 -1
  56. package/chunks/Envelope.js +1 -1
  57. package/chunks/GaussianSplat.glsl.js +2 -2
  58. package/chunks/MultiPathImpl.js +1 -1
  59. package/chunks/Point2D.js +1 -1
  60. package/chunks/UnitFactory.js +1 -1
  61. package/config.js +1 -1
  62. package/core/has.js +1 -1
  63. package/form/FormTemplate.js +1 -1
  64. package/form/elements/GroupElement.js +1 -1
  65. package/form/elements/inputs/attachments/AttachmentInput.js +1 -1
  66. package/geometry/FlatGeometry.js +5 -0
  67. package/geometry/operators/gx/operatorShapePreservingProject.js +1 -1
  68. package/geometry/operators/support/jsonConverter.js +1 -1
  69. package/geometry/support/aaBoundingBox.js +1 -1
  70. package/geometry/support/aaBoundingRect.js +1 -1
  71. package/geometry/support/boundsUtils.js +1 -1
  72. package/interfaces.d.ts +259 -7
  73. package/kernel.js +1 -1
  74. package/layers/BaseElevationLayer.js +1 -1
  75. package/layers/BaseTileLayer.js +1 -1
  76. package/layers/CSVLayer.js +1 -1
  77. package/layers/FeatureLayer.js +1 -1
  78. package/layers/GeoJSONLayer.js +1 -1
  79. package/layers/GroupLayer.js +1 -1
  80. package/layers/MapImageLayer.js +1 -1
  81. package/layers/MediaLayer.js +1 -1
  82. package/layers/OrientedImageryLayer.js +1 -1
  83. package/layers/ParquetLayer.js +1 -1
  84. package/layers/VectorTileLayer.js +1 -1
  85. package/layers/VideoLayer.js +1 -1
  86. package/layers/WMSLayer.js +1 -1
  87. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  88. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  89. package/layers/mixins/ArcGISImageService.js +1 -1
  90. package/layers/mixins/ImageryTileMixin.js +1 -1
  91. package/layers/mixins/PortalLayer.js +1 -1
  92. package/layers/mixins/TemporalLayer.js +1 -1
  93. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  94. package/layers/mixins/operationalLayers.js +1 -1
  95. package/layers/support/LocalMediaElementSource.js +1 -1
  96. package/layers/support/ParquetEncodingBase.js +1 -1
  97. package/layers/support/ParquetEncodingLocation.js +1 -1
  98. package/layers/support/ParquetEncodingWkb.js +1 -1
  99. package/layers/support/Sublayer.js +1 -1
  100. package/layers/support/WMSSublayer.js +1 -1
  101. package/layers/support/layersCreator.js +1 -1
  102. package/layers/support/lazyLayerLoader.js +1 -1
  103. package/layers/support/parquetUtils.js +1 -1
  104. package/libs/parquet/parquet.js +1 -1
  105. package/package.json +2 -2
  106. package/renderers/FlowRenderer.js +1 -1
  107. package/renderers/VectorFieldRenderer.js +1 -1
  108. package/renderers/visualVariables/support/ColorSizeStop.js +1 -1
  109. package/renderers/visualVariables/support/SizeStop.js +1 -1
  110. package/support/LayersMixin.js +1 -1
  111. package/support/TablesMixin.js +1 -1
  112. package/support/revision.js +1 -1
  113. package/symbols/edges/Edges3D.js +1 -1
  114. package/versionManagement/VersionManager.d.ts +4 -0
  115. package/versionManagement/VersionManager.js +5 -0
  116. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  117. package/views/2d/layers/LayerView2D.js +1 -1
  118. package/views/3d/GroundView3D.js +1 -1
  119. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  120. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  121. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  122. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  123. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  124. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  125. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  126. package/views/input/gamepad/GamepadInputDevice.js +1 -1
  127. package/views/layers/support/{Geometry.js → GeometryClipArea.js} +1 -1
  128. package/views/webgl/capabilities/Capabilities.js +1 -1
  129. package/views/webgl/capabilities/load.js +1 -1
  130. package/webdoc/support/writeUtils.js +1 -1
  131. package/widgets/FeatureTable/FieldColumn.js +1 -1
  132. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  133. package/assets/esri/core/workers/chunks/09ac2bbc7327e6e6b5a2.js +0 -1
  134. package/assets/esri/core/workers/chunks/1432e789aa4cba627337.js +0 -1
  135. package/assets/esri/core/workers/chunks/1a9ed3c59a9a8bafb251.js +0 -1
  136. package/assets/esri/core/workers/chunks/1c857191e5898aba50fe.js +0 -1
  137. package/assets/esri/core/workers/chunks/234ffd08c2be03a0b9fe.js +0 -1
  138. package/assets/esri/core/workers/chunks/2d0d8243ed0c21f8a498.js +0 -1
  139. package/assets/esri/core/workers/chunks/31675811cacdb6fd96cf.js +0 -1
  140. package/assets/esri/core/workers/chunks/39d2b540738431adec98.js +0 -1
  141. package/assets/esri/core/workers/chunks/48820e12d94eb49c0a65.js +0 -1
  142. package/assets/esri/core/workers/chunks/4c278fb2d51ca6226050.js +0 -1
  143. package/assets/esri/core/workers/chunks/4d6706d6dbe578653c28.js +0 -1
  144. package/assets/esri/core/workers/chunks/4ff40eea70d19c934504.js +0 -1
  145. package/assets/esri/core/workers/chunks/59ce992d3a5e7c32b9fb.js +0 -1
  146. package/assets/esri/core/workers/chunks/5e30acfda04f7fc2b676.js +0 -1
  147. package/assets/esri/core/workers/chunks/6052eccb9395c8efb295.js +0 -1
  148. package/assets/esri/core/workers/chunks/61369838aa337d0156c5.js +0 -1
  149. package/assets/esri/core/workers/chunks/690a40d2eef52bfc149f.js +0 -1
  150. package/assets/esri/core/workers/chunks/6b820f14c110d9da118e.js +0 -1
  151. package/assets/esri/core/workers/chunks/7fd2366ee1fc81fa8c56.js +0 -1
  152. package/assets/esri/core/workers/chunks/8d9e622cec13f5cea726.js +0 -1
  153. package/assets/esri/core/workers/chunks/9110287f272141f60c35.js +0 -1
  154. package/assets/esri/core/workers/chunks/98997841ec3955287ba2.js +0 -1
  155. package/assets/esri/core/workers/chunks/a716b8fdeda4e16f03ab.js +0 -1
  156. package/assets/esri/core/workers/chunks/a9577a700b6a7b69d6aa.js +0 -1
  157. package/assets/esri/core/workers/chunks/ad4fcb73cfe9a1e4b710.js +0 -1
  158. package/assets/esri/core/workers/chunks/aead7c9830fa310e5b53.js +0 -1
  159. package/assets/esri/core/workers/chunks/b48aceaeefa07214e430.js +0 -1
  160. package/assets/esri/core/workers/chunks/bcfa98b6866a96c194cb.js +0 -1
  161. package/assets/esri/core/workers/chunks/c052fb8c952cda0b5d13.js +0 -1
  162. package/assets/esri/core/workers/chunks/c0d6f8e55349f4f5cd58.js +0 -1
  163. package/assets/esri/core/workers/chunks/c1a4d1ec0125617374b4.js +0 -1
  164. package/assets/esri/core/workers/chunks/c582fb447c89d732cfff.js +0 -1
  165. package/assets/esri/core/workers/chunks/cb500d673ca7ec1ef945.js +0 -1
  166. package/assets/esri/core/workers/chunks/ce99abfdcd71ff9e4e36.js +0 -1
  167. package/assets/esri/core/workers/chunks/cf0e2c91b330b1d0ef77.js +0 -1
  168. package/assets/esri/core/workers/chunks/d764b6273974f4bca31b.js +0 -1
  169. package/assets/esri/core/workers/chunks/d87dc2eeffabd3507143.js +0 -1
  170. package/assets/esri/core/workers/chunks/dca6a61fd239cf1ff90c.js +0 -1
  171. package/assets/esri/core/workers/chunks/edc3d98f33d7bf959154.js +0 -1
  172. package/assets/esri/core/workers/chunks/f1381c5a2a1de1ef9139.js +0 -1
  173. package/assets/esri/core/workers/chunks/f6148611d883a59f8fb8.js +0 -1
  174. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +0 -5
package/config.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"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.39";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.40";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/core/has.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
- const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-fast-triangulation-enabled",!0),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",4),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:oit-ground",!1),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
5
+ const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-fast-triangulation-enabled",!0),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("parquetlayer-persistence-enabled",!1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",4),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:oit-ground",!1),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has 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 t}from"../core/JSONSupport.js";import{clone as s}from"../core/lang.js";import{addMaybe as r,addMany as o}from"../core/SetUtils.js";import{property as i,cast as n,subclass as l}from"../core/accessorSupport/decorators.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import m from"./ExpressionInfo.js";import d from"./elements/GroupElement.js";import{ensureType as f,fromJSON as a,toJSON as c,isTextElement as u,isGroupElement as h,isFieldElement as y,buildTypeMaps as x}from"./support/formUtils.js";import{collectArcadeFieldNames as E,collectFields as j,extractSubstitutionTemplatesFromString as w,collectField as v}from"../layers/support/fieldUtils.js";import{writer as S}from"../core/accessorSupport/decorators/writer.js";var I;const F=x(d);let b=I=class extends t{constructor(e){super(e),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(e){return f(e,F)}readElements(e,t){return a(t.formElements,F)}writeElements(e,t){t.formElements=c(e,F)}clone(){return new I({description:this.description,expressionInfos:s(this.expressionInfos),elements:s(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(e,t){const s=new Set,{description:r,elements:o,expressionInfos:i,title:n}=this;if(U(s,e,r),U(s,e,n),!o)return[];const l=k(o,i).map(t=>E(s,e,null,t));await Promise.all(l);for(const p of o)g(s,{fieldsIndex:e,relationships:t},p);return Array.from(s).sort()}};function g(e,t,s){const{fieldsIndex:r}=t;if(!r||r.fields.length!==e.size)switch(U(e,r,s.label),U(e,r,s.description),s.type){case"field":v(e,r,s.fieldName);break;case"group":s.elements.forEach(s=>g(e,t,s));break;case"relationship":if(t.relationships){const o=t.relationships.find(e=>e.id===s.relationshipId);o&&v(e,r,o.keyField)}j(e,r,s.orderByFields?.map(e=>e.field));break;case"text":U(e,r,s.text)}}function k(e,t){if(!t||0===t.length)return[];const s=H(e),r=[];for(const o of t)s.has(o.name)&&r.push(o.expression);return r}function H(e){const t=new Set;for(const s of e)if(r(t,s.visibilityExpression),!u(s))if(h(s))o(t,H(s.elements));else if(r(t,s.editableExpression),y(s)){const{requiredExpression:e,valueExpression:r}=s;o(t,[e,r])}return t}function U(e,t,s){j(e,t,w(s))}e([i({type:String,json:{write:!0}})],b.prototype,"description",void 0),e([i({json:{write:!0}})],b.prototype,"elements",void 0),e([n("elements")],b.prototype,"castElements",null),e([p("elements",["formElements"])],b.prototype,"readElements",null),e([S("elements")],b.prototype,"writeElements",null),e([i({type:[m],json:{write:!0}})],b.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],b.prototype,"title",void 0),b=I=e([l("esri.form.FormTemplate")],b);export{b as default};
5
+ import{__decorate as e}from"tslib";import{JSONSupport as t}from"../core/JSONSupport.js";import{clone as s}from"../core/lang.js";import{addMaybe as r,addMany as o}from"../core/SetUtils.js";import{property as i,cast as n,subclass as l}from"../core/accessorSupport/decorators.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import m from"./ExpressionInfo.js";import f from"./elements/GroupElement.js";import{ensureType as a,fromJSON as d,toJSON as c,isTextElement as u,isGroupElement as h,isFieldElement as y,buildTypeMaps as x}from"./support/formUtils.js";import{collectArcadeFieldNames as E,collectFields as j,extractSubstitutionTemplatesFromString as w,collectField as v}from"../layers/support/fieldUtils.js";import{writer as S}from"../core/accessorSupport/decorators/writer.js";var g;const I=x(f);let F=g=class extends t{constructor(e){super(e),this.description=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}get elements(){return this._get("elements")??null}set elements(e){this._set("elements",e)}castElements(e){return a(e,I)}readElements(e,t){return d(t.formElements,I)}writeElements(e,t){t.formElements=c(e,I)}clone(){return new g({description:this.description,expressionInfos:s(this.expressionInfos),elements:s(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(e,t){const s=new Set,{description:r,elements:o,expressionInfos:i,title:n}=this;if(U(s,e,r),U(s,e,n),!o)return[];const l=k(o,i).map(t=>E(s,e,null,t));await Promise.all(l);for(const p of o)b(s,{fieldsIndex:e,relationships:t},p);return Array.from(s).sort()}};function b(e,t,s){const{fieldsIndex:r}=t;if(!r||r.fields.length!==e.size)switch(U(e,r,s.label),U(e,r,s.description),s.type){case"field":v(e,r,s.fieldName);break;case"group":s.elements.forEach(s=>b(e,t,s));break;case"relationship":if(t.relationships){const o=t.relationships.find(e=>e.id===s.relationshipId);o&&v(e,r,o.keyField)}j(e,r,s.orderByFields?.map(e=>e.field));break;case"text":U(e,r,s.text)}}function k(e,t){if(!t||0===t.length)return[];const s=H(e),r=[];for(const o of t)s.has(o.name)&&r.push(o.expression);return r}function H(e){const t=new Set;for(const s of e)if(r(t,s.visibilityExpression),!u(s))if(h(s))o(t,H(s.elements));else if(r(t,s.editableExpression),y(s)){const{requiredExpression:e,valueExpression:r}=s;o(t,[e,r])}return t}function U(e,t,s){j(e,t,w(s))}e([i({type:String,json:{write:!0}})],F.prototype,"description",void 0),e([i({json:{write:!0}})],F.prototype,"elements",null),e([n("elements")],F.prototype,"castElements",null),e([p("elements",["formElements"])],F.prototype,"readElements",null),e([S("elements")],F.prototype,"writeElements",null),e([i({type:[m],json:{write:!0}})],F.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],F.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],F.prototype,"title",void 0),F=g=e([l("esri.form.FormTemplate")],F);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{__decorate as e}from"tslib";import{clone as t}from"../../core/lang.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";import{cast as s}from"../../core/accessorSupport/decorators/cast.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import l from"./Element.js";import{ensureType as n,buildTypeMaps as p,fromJSON as m,toJSON as a}from"../support/formUtils.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";var d;let u=d=class extends l{constructor(e){super(e),this.elements=null,this.initialState="expanded",this.type="group"}castElements(e){return n(e,f,!1)}readElements(e,t){return m(t.formElements,f,!1)}writeElements(e,t){t.formElements=a(e,f,!1)}clone(){return new d({description:this.description,elements:t(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([r({json:{write:!0}})],u.prototype,"elements",void 0),e([s("elements")],u.prototype,"castElements",null),e([c("elements",["formElements"])],u.prototype,"readElements",null),e([i("elements")],u.prototype,"writeElements",null),e([r({type:["collapsed","expanded"],json:{write:!0}})],u.prototype,"initialState",void 0),e([r({type:String,json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=d=e([o("esri.form.elements.GroupElement")],u);const f=p(u),E=u;export{E as default};
5
+ import{__decorate as e}from"tslib";import{clone as t}from"../../core/lang.js";import{property as r,subclass as s}from"../../core/accessorSupport/decorators.js";import{cast as o}from"../../core/accessorSupport/decorators/cast.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";import l from"./Element.js";import{ensureType as n,buildTypeMaps as p,fromJSON as m,toJSON as a}from"../support/formUtils.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";var d;let u=d=class extends l{constructor(e){super(e),this.initialState="expanded",this.type="group"}get elements(){return this._get("elements")??null}set elements(e){this._set("elements",e)}castElements(e){return n(e,f,!1)}readElements(e,t){return m(t.formElements,f,!1)}writeElements(e,t){t.formElements=a(e,f,!1)}clone(){return new d({description:this.description,elements:t(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([r({json:{write:!0}})],u.prototype,"elements",null),e([o("elements")],u.prototype,"castElements",null),e([c("elements",["formElements"])],u.prototype,"readElements",null),e([i("elements")],u.prototype,"writeElements",null),e([r({type:["collapsed","expanded"],json:{write:!0}})],u.prototype,"initialState",void 0),e([r({type:String,json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=d=e([s("esri.form.elements.GroupElement")],u);const f=p(u),E=u;export{E 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{property as e,cast as p,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{reader as o}from"../../../../core/accessorSupport/decorators/reader.js";import s from"./Input.js";import{ensureType as n,fromJSON as i,toJSON as a,buildTypeMaps as u}from"./support/inputs.js";import{writer as c}from"../../../../core/accessorSupport/decorators/writer.js";let y=class extends s{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact",this.inputTypes=null}castInputs(t){return n(t,m,!0)}readInputs(t,e){return i(e.inputTypes,m,!0)}writeInputs(t,e){e.inputTypes=a(t,m,!0)}};t([e({type:["attachment"],readOnly:!0,json:{write:!0}})],y.prototype,"type",void 0),t([e({type:["any","exact","exactOrNone"],json:{write:!0}})],y.prototype,"attachmentAssociationType",void 0),t([e({json:{write:{isRequired:!0}}})],y.prototype,"inputTypes",void 0),t([p("inputTypes")],y.prototype,"castInputs",null),t([o("inputTypes")],y.prototype,"readInputs",null),t([c("inputTypes")],y.prototype,"writeInputs",null),y=t([r("esri.form.elements.inputs.attachments.AttachmentInput")],y);const m=u(y),l=y;export{l as default};
5
+ import{__decorate as t}from"tslib";import{property as e,cast as p,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{reader as s}from"../../../../core/accessorSupport/decorators/reader.js";import o from"./Input.js";import{ensureType as n,fromJSON as i,toJSON as u,buildTypeMaps as a}from"./support/inputs.js";import{writer as c}from"../../../../core/accessorSupport/decorators/writer.js";let y=class extends o{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact"}get inputTypes(){return this._get("inputTypes")??null}set inputTypes(t){this._set("inputTypes",t)}castInputs(t){return n(t,m,!0)}readInputs(t,e){return i(e.inputTypes,m,!0)}writeInputs(t,e){e.inputTypes=u(t,m,!0)}};t([e({type:["attachment"],readOnly:!0,json:{write:!0}})],y.prototype,"type",void 0),t([e({type:["any","exact","exactOrNone"],json:{write:!0}})],y.prototype,"attachmentAssociationType",void 0),t([e({json:{write:{isRequired:!0}}})],y.prototype,"inputTypes",null),t([p("inputTypes")],y.prototype,"castInputs",null),t([s("inputTypes")],y.prototype,"readInputs",null),t([c("inputTypes")],y.prototype,"writeInputs",null),y=t([r("esri.form.elements.inputs.attachments.AttachmentInput")],y);const m=a(y),l=y;export{l as default};
@@ -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{__addDisposableResource as t,__disposeResources as e}from"tslib";import r from"./SpatialReference.js";import{empty as s,expandWithExtent as n}from"./support/aaBoundingBox.js";import{empty as i,expandExtentInPlace as a}from"./support/aaBoundingRect.js";import{isPoint as o,isMultipoint as h,isPolyline as u,isGeometryWithM as l,isGeometryWithZ as c}from"./support/jsonUtils.js";import{equals as f}from"./support/spatialReferenceUtils.js";import{interpolateCircle as g}from"./support/curves/circleUtils.js";import{deriveCircleFromCircularArc as m}from"./support/curves/circularArcUtils.js";import{curveExtent as p}from"./support/curves/curveExtent.js";import{getEndpoint as x,isCurvedGeometry as v,isEllipticArc7 as d,isCircularArc as y,isEllipticArc4 as C,isBezierCurve as M}from"./support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as E}from"./support/curves/ellipticArc4Utils.js";import{deriveEllipse as O,interpolateEllipse as S}from"./support/curves/ellipticArc7Utils.js";import Z from"../layers/graphics/OptimizedGeometry.js";class _{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:s,vertexZ:n,vertexM:i,partCount:a,partOffsets:o,partFlags:h,segmentFlags:u,segmentIndices:l,segmentParams:c,segmentCountArc:f,segmentCountBezier:g}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=s,this.vertexZ=n,this.vertexM=i,this.partCount=a,this.partOffsets=o,this.partFlags=h,this.segmentFlags=u,this.segmentIndices=l,this.segmentParams=c,this.segmentCountArc=f,this.segmentCountBezier=g}get segmentParamCount(){return z(4)*this.segmentCountArc+z(2)*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}get hasCurves(){return null!=this.segmentFlags}get isMultipart(){return"polyline"===this.type||"polygon"===this.type}toGeometryJSON(){const t=T(this),{vertexCount:e,partCount:r,hasZ:s,hasM:n}=this,i=L(this);if("point"===this.type){const[t,e]=this.vertexXY,r=this.vertexZ?.[0],s=this.vertexM?.[0];return{x:t,y:e,z:r,m:s,spatialReference:i}}let a=0;if("multipoint"===this.type){const r=[];for(;a<e;)r.push(t(a++));return{points:r,spatialReference:i,hasZ:s,hasM:n}}const o="polygon"===this.type;if(!this.hasCurves){const e=new Array;for(let s=0;s<r;++s){const r=this.partOffsets[s+1],n=new Array;for(;a<r;)n.push(t(a++));o&&n.length>0&&n.push(n[0]),e.push(n)}return o?{rings:e,hasZ:s,hasM:n,spatialReference:i}:{paths:e,hasZ:s,hasM:n,spatialReference:i}}const h=new Array;for(const{segments:u,startVertex:l}of this.parts){const t=[l];for(const{curve:e}of u)t.push(e);h.push(t)}return o?{rings:[],curveRings:h,hasZ:s,hasM:n,spatialReference:i}:{paths:[],curvePaths:h,hasZ:s,hasM:n,spatialReference:i}}toOptimizedGeometry(){const{vertexCount:t,vertexXY:e,vertexZ:r,vertexM:s,partOffsets:n,hasZ:i,hasM:a}=this,o=new Z([],[],i,a),h=Math.max(this.partCount,1),u="polygon"===this.type;let l=0;for(let c=0;c<h;++c){const h=n?.[c+1]??t,f=o.coords.length;for(let t=l;t<h;++t)o.coords.push(e[2*t],e[2*t+1]),i&&o.coords.push(r[t]),a&&o.coords.push(s[t]);if(u){const t=l;o.coords.push(e[2*t],e[2*t+1]),i&&o.coords.push(r[t]),a&&o.coords.push(s[t])}o.lengths.push((o.coords.length-f)/o.stride),l=h}return"point"===this.type&&(o.lengths.length=0),o}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:s,hasM:n,hasCurves:i,segmentCountArc:a,segmentCountBezier:o}=this,h=j(t,e,r,s,n,i,a,o);h.spatialReference=this.spatialReference;const{vertexXY:u,vertexZ:l,vertexM:c}=this;h.vertexXY.set(u.subarray(0,2*e),0),h.vertexZ?.set(l.subarray(0,e),0),h.vertexM?.set(c.subarray(0,e),0);const{partOffsets:f,partFlags:g}=this;h.partFlags?.set(g.subarray(0,r+1)),h.partOffsets?.set(f.subarray(0,r+1));const{segmentFlags:m,segmentIndices:p,segmentParams:x,segmentParamCount:v}=this;return h.segmentFlags?.set(m.subarray(0,e),0),h.segmentIndices?.set(p.subarray(0,e),0),h.segmentParams?.set(x.subarray(0,v),0),h}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!f(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves!==t.hasCurves||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let s=0;s<this.vertexCount;++s)if(r(this.vertexXY[2*s],t.vertexXY[2*s])||r(this.vertexXY[2*s+1],t.vertexXY[2*s+1]))return!1;if(this.hasZ)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexZ[s],t.vertexZ[s]))return!1;if(this.hasM)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexM[s],t.vertexM[s]))return!1;for(let s=0;s<this.partCount;++s)if(this.partFlags[s]!==t.partFlags[s]||this.partOffsets[s]!==t.partOffsets[s])return!1;if(this.hasCurves){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return new Y(this)}}class Y{constructor(t){this.geometry=t,this.value=new P(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class P{constructor(t){this.geometry=t,this.index=-1,this._readVertex=T(t),this._segments=new R(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class R{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new A(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class A{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=T(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],s=e[r++],n=e[r++],i=e[r++];return{b:[this.end,[t,s],[n,i]]}}const s=e[r++],n=e[r++],i=e[r++],a=e[r++],o=e[r++],h=e[r++];r++,r++;const u=e[r++],l=e[r++];if(!(4&s)&&1===i)return{c:[this.end,[u,l]]};const c=2&s?0:1,f=1&s?0:1;return{a:[this.end,[o,h],c,f,a,n,i]}}}function F(r){let s;const{hasCurves:n,vertexCount:a,vertexXY:o,vertexZ:h,vertexM:u}=r,l=L(r);if(n){const n={stack:[],error:void 0,hasError:!1};try{t(n,new N(r,["vertexZ","vertexM"]),!1);const e=i();for(const t of r.parts){let r=t.startVertex;for(const{curve:s}of t.segments)p(e,r,s),r=x(s)}const[a,o,h,u]=e;s={xmin:a,ymin:o,xmax:h,ymax:u,spatialReference:l}}catch(c){n.error=c,n.hasError=!0}finally{e(n)}}else{let t,e,r,n;t=e=1/0,r=n=-1/0;for(let s=0;s<a;++s){const i=o[2*s],a=o[2*s+1];t=Math.min(t,i),r=Math.max(r,i),e=Math.min(e,a),n=Math.max(n,a)}s={xmin:t,ymin:e,xmax:r,ymax:n,spatialReference:l}}if(h){let t=1/0,e=-1/0;for(const r of h)t=Math.min(t,r),e=Math.max(e,r);s.zmin=t,s.zmax=e}if(u){let t=1/0,e=-1/0;for(const r of u)t=Math.min(t,r),e=Math.max(e,r);s.mmin=t,s.mmax=e}return s}function V(r,s){const n={stack:[],error:void 0,hasError:!1};try{s??=i();t(n,new N(r,["vertexZ","vertexM","spatialReference"]),!1);return a(s,F(r)),s}catch(o){n.error=o,n.hasError=!0}finally{e(n)}}function w(r,i){const a={stack:[],error:void 0,hasError:!1};try{i??=s();t(a,new N(r,["vertexM","spatialReference"]),!1);return n(i,F(r)),i}catch(o){a.error=o,a.hasError=!0}finally{e(a)}}function X(t){let e,r,s;if(o(t)){s="point";const{x:n,y:i,z:a,m:o}=t,h=[n,i];null!=a&&h.push(a),null!=o&&h.push(o),r=[[h]],e=1}else h(t)?(s="multipoint",r=[t.points],e=t.points.length):u(t)?(s="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(s="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>t+e.length-k(e),0));const n=j(s,e,s.includes("point")?0:r.length,c(t),l(t),v(t));function i(t){n.vertexXY[2*f]=t[0],n.vertexXY[2*f+1]=t[1],n.hasZ&&(n.vertexZ[f]=t[2]),n.hasM&&(n.vertexM[f]=t[a]),++f}n.spatialReference=t.spatialReference??void 0;const a=n.hasZ?3:2;let f=0;if(!n.isMultipart){if(!n.hasZ&&!n.hasM){for(const[t,e]of r[0])n.vertexXY[2*f]=t,n.vertexXY[2*f+1]=e;return n}for(const t of r[0])i(t);return n}const p="polygon"===n.type;let Z=0;if(!n.hasCurves){for(const t of r){n.partOffsets[Z++]=f;let e=t.length;if(p&&(e-=k(t)),n.hasZ||n.hasM)for(let r=0;r<e;++r)i(t[r]);else for(let r=0;r<e;++r){const[e,s]=t[r];n.vertexXY[2*f]=e,n.vertexXY[2*f+1]=s}}return n.partOffsets[Z]=f,n}function _(t){const e=f-1;n.segmentFlags[e]=t;const r=z(t);n.segmentIndices[e]=0===r?U:Y,4===t?++n.segmentCountArc:2===t&&++n.segmentCountBezier;const s=Y+r;if(s<=(n.segmentParams?.length??0))return;let i=s*W;i=20*Math.ceil(i/20);const a=n.segmentParams;if(n.segmentParams=new Float64Array(i),null!=a)for(let o=0;o<a.length;++o)n.segmentParams[o]=a[o]}let Y=0;for(const o of r){n.partOffsets[Z++]=f,i(o[0]);let t=o.length;p&&(t-=k(o));for(let e=1;e<t;++e){const t=o[e];if(d(t)){_(4);const r=n.segmentParams,[s,[a,h],u,l,c,f,g]=t.a;let m=4;l||(m|=1),u||(m|=2);const p=O(x(o[e-1]),t),[v,d]=S(p,.5);r[Y++]=m,r[Y++]=f,r[Y++]=g,r[Y++]=c,r[Y++]=a,r[Y++]=h,r[Y++]=p.u2-p.u1,r[Y++]=p.u1,r[Y++]=v,r[Y++]=d,i(s);continue}if(y(t)||C(t)){_(4);const r=n.segmentParams,s=x(t),a=y(t)?m(x(o[e-1]),t):E(x(o[e-1]),t),{cx:h,cy:u,thetaStart:l,thetaEnd:c,radius:f}=a,p=Math.abs(c-l)<Math.PI,v=l>c;let d=C(t)?4:0;v||(d|=1),p||(d|=2);const[M,O]=y(t)?t.c[1]:g(a,.5);r[Y++]=d,r[Y++]=f,r[Y++]=1,r[Y++]=0,r[Y++]=h,r[Y++]=u,r[Y++]=c-l,r[Y++]=l,r[Y++]=M,r[Y++]=O,i(s);continue}if(M(t)){_(2);const e=n.segmentParams,[r,[s,a],[o,h]]=t.b;e[Y++]=s,e[Y++]=a,e[Y++]=o,e[Y++]=h,i(r);continue}_(1),i(t)}}return n.partOffsets[Z]=f,n}function b(t,{lengths:e,coords:r,hasZ:s,hasM:n},i){const a=t.includes("point")?0:e.length,o="polygon"===t,h="point"===t?1:e.reduce((t,e)=>t+e,0)-(o?a:0);s??=!1,n??=!1;const u=j(t,h,a,s,n,!1,0,0);if(u.spatialReference=i??void 0,!u.isMultipart){for(let t=0,e=0;t<h;++t)u.vertexXY[2*t]=r[e++],u.vertexXY[2*t+1]=r[e++],s&&(u.vertexZ[t]=r[e++]),n&&(u.vertexM[t]=r[e++]);return u}const l=2+Number(s)+Number(n);let c=0,f=0;u.partOffsets[0]=0;for(const g of e){const t=u.partOffsets[f],e=t+g-Number(o);u.partOffsets[++f]=e;for(let i=t;i<e;++i)u.vertexXY[2*i]=r[c++],u.vertexXY[2*i+1]=r[c++],s&&(u.vertexZ[i]=r[c++]),n&&(u.vertexM[i]=r[c++]);o&&(c+=l)}return u}function I(t,e){return"getSpatialReference"in t&&(e=B(t.getSpatialReference()),t=t.getGeometry()),new _({...t.toFlatGeometry(),spatialReference:e})}function B(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let s=t.getLatestID();(s<=0||s===r)&&(s=void 0);const n=t.getVCS();if(null==n)return{wkid:r,latestWkid:s,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let a=t.getLatestVerticalID();return(a<=0||a===i)&&(a=void 0),{wkid:r,wkt:e,latestWkid:s,vcsWkid:i,latestVcsWkid:a}}class N{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function L({spatialReference:t}){return t instanceof r?t.toJSON():t}function T({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?s=>[t[2*s],t[2*s+1],e[s],r[s]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function z(t){switch(t){case 1:return 0;case 4:return 10;case 2:return 4}}function k(t){if(t.length>0){const e=t[0],r=x(t.at(-1));return e.every((t,e)=>t===r[e])?1:0}return 0}function j(t,e,r,s,n,i,a,o){const h=null!=a&&null!=o;a??=0,o??=0;const u=new _({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:a,segmentCountBezier:o});let l=2*Float64Array.BYTES_PER_ELEMENT*e;s&&(l+=Float64Array.BYTES_PER_ELEMENT*e),n&&(l+=Float64Array.BYTES_PER_ELEMENT*e),u.isMultipart&&(l+=(r+1)*Int32Array.BYTES_PER_ELEMENT,l+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(l+=e*Int8Array.BYTES_PER_ELEMENT,l+=e*Int32Array.BYTES_PER_ELEMENT,h&&(l+=u.segmentParamCount*Float64Array.BYTES_PER_ELEMENT));const c=new ArrayBuffer(l);let f=0;if(u.vertexXY=new Float64Array(c,f,2*e),f+=u.vertexXY.byteLength,s&&(u.vertexZ=new Float64Array(c,f,e),f+=u.vertexZ.byteLength),n&&(u.vertexM=new Float64Array(c,f,e),f+=u.vertexM.byteLength),i&&(h&&(u.segmentParams=new Float64Array(c,f,u.segmentParamCount),f+=u.segmentParams.byteLength),u.segmentIndices=new Int32Array(c,f,e),u.segmentIndices.fill(U),f+=u.segmentIndices.byteLength),u.isMultipart&&(u.partOffsets=new Int32Array(c,f,r+1),f+=u.partOffsets.byteLength,u.partFlags=new Int8Array(c,f,r+1),f+=u.partFlags.byteLength),i&&(u.segmentFlags=new Int8Array(c,f,e),u.segmentFlags.fill(1),f+=u.segmentFlags.byteLength),"polygon"===u.type)for(let g=0;g<r;++g)u.partFlags[g]=1;return u}const W=1.61803,U=-1;export{_ as FlatGeometry,X as convertGeometryToFlat,I as convertGeometryxToFlat,b as convertOptimizedGeometryToFlat,w as getBoundingBox,V as getBoundingRect,F as getExtentJSON};
@@ -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{S as e}from"../../../chunks/SimpleGeometryCursor.js";import{l as n,i as r,p as t}from"../../../chunks/pe.js";let o,s;function u(){return!!o&&r()}async function c(){if(!u()){const[e,r,u]=await Promise.all([import("../../../chunks/OperatorShapePreservingProject.js"),import("../../../chunks/Envelope.js").then(e=>e.a7).then(({Envelope:e})=>e),import("../../../chunks/SpatialReference.js").then(({injectPe:e})=>e),n()]);o=new e.OperatorShapePreservingProject,s=r,u(t)}}function i(e,n,r,t){return o.execute(e,n,r,t,null)}function p(n,r,t,u){let c=null,i=new s;for(const e of n)e.queryEnvelope(i),c?c.merge(i):(c=i,i=new s);const p=o.executeMany(new e(n),c,r,t,u,null);return Array.from(p)}function a(){return o.supportsCurves()}export{i as execute,p as executeMany,u as isLoaded,c as load,a as supportsCurves};
5
+ import{S as e}from"../../../chunks/SimpleGeometryCursor.js";import{l as n,i as r,p as t}from"../../../chunks/pe.js";let o,s;function u(){return!!o&&r()}async function c(){if(!u()){const[e,r,u]=await Promise.all([import("../../../chunks/OperatorShapePreservingProject.js"),import("../../../chunks/Envelope.js").then(e=>e.a8).then(({Envelope:e})=>e),import("../../../chunks/SpatialReference.js").then(({injectPe:e})=>e),n()]);o=new e.OperatorShapePreservingProject,s=r,u(t)}}function i(e,n,r,t){return o.execute(e,n,r,t,null)}function p(n,r,t,u){let c=null,i=new s;for(const e of n)e.queryEnvelope(i),c?c.merge(i):(c=i,i=new s);const p=o.executeMany(new e(n),c,r,t,u,null);return Array.from(p)}function a(){return o.supportsCurves()}export{i as execute,p as executeMany,u as isLoaded,c as load,a as supportsCurves};
@@ -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,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){if(e.spatialReference instanceof W){const{wkt2:t}=e.spatialReference;e={...e,spatialReference:e.spatialReference.toJSON()},e.spatialReference.wkt2??=t}return Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){if(e instanceof W){const{wkt2:t}=e;e=e.toJSON(),e.wkt2??=t}const t=Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference();return 0!==t?.getCoordinateSystemType()?t:null}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{a2 as v,a5 as x,P as A,E as S,a0 as w,a1 as C,a6 as D,a7 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){if(e.spatialReference instanceof W){const{wkt2:t}=e.spatialReference;e={...e,spatialReference:e.spatialReference.toJSON()},e.spatialReference.wkt2??=t}return Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){if(e instanceof W){const{wkt2:t}=e;e=e.toJSON(),e.wkt2??=t}const t=Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference();return 0!==t?.getCoordinateSystemType()?t:null}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 n from"../Extent.js";import{create as t}from"./aaBoundingRect.js";import{newDoubleArray as r}from"./DoubleArray.js";function a(n){return n}function i(n=Q){return a([n[0],n[1],n[2],n[3],n[4],n[5]])}function u(n,t,r,a,u,e,m=i()){return m[0]=n,m[1]=t,m[2]=r,m[3]=a,m[4]=u,m[5]=e,m}function e(n,t=i()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.hasZ?n.zmin:-1/0,t[3]=n.xmax,t[4]=n.ymax,t[5]=n.hasZ?n.zmax:1/0,t}function m(n,t=i()){return o(n,0,n.length/3,t)}function o(n,t,r,a=i()){return k(a,L),N(a,n,t,r),a}function f(n,t=r(24)){const[a,i,u,e,m,o]=n;return t[0]=a,t[1]=i,t[2]=u,t[3]=a,t[4]=i,t[5]=o,t[6]=a,t[7]=m,t[8]=u,t[9]=a,t[10]=m,t[11]=o,t[12]=e,t[13]=i,t[14]=u,t[15]=e,t[16]=i,t[17]=o,t[18]=e,t[19]=m,t[20]=u,t[21]=e,t[22]=m,t[23]=o,t}function c(t,r){const a=isFinite(t[2])||isFinite(t[5]);return new n(a?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:r}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:r})}function h(n,t,r=i()){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=t[0],r[4]=t[1],r[5]=t[2],r}function M(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[3]),n[4]=Math.max(n[4],t[4]),n[5]=Math.max(n[5],t[5])}function x(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[3]=Math.max(n[3],t[2]),n[4]=Math.max(n[4],t[3])}function l(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[0]),n[4]=Math.max(n[4],t[1]),n[5]=Math.max(n[5],t[2])}function N(n,t,r=0,a=t.length/3){let i=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];for(let c=0;c<a;c++)i=Math.min(i,t[r+3*c]),u=Math.min(u,t[r+3*c+1]),e=Math.min(e,t[r+3*c+2]),m=Math.max(m,t[r+3*c]),o=Math.max(o,t[r+3*c+1]),f=Math.max(f,t[r+3*c+2]);n[0]=i,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function s(n,t,r,a){n[0]=Math.min(n[0],n[0]+t),n[3]=Math.max(n[3],n[3]+t),n[1]=Math.min(n[1],n[1]+r),n[4]=Math.max(n[4],n[4]+r),n[2]=Math.min(n[2],n[2]+a),n[5]=Math.max(n[5],n[5]+a)}function I(n,t,r){const a=t.length;let i=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];if(r)for(let c=0;c<a;c++){const n=t[c];i=Math.min(i,n[0]),u=Math.min(u,n[1]),e=Math.min(e,n[2]),m=Math.max(m,n[0]),o=Math.max(o,n[1]),f=Math.max(f,n[2])}else for(let c=0;c<a;c++){const n=t[c];i=Math.min(i,n[0]),u=Math.min(u,n[1]),m=Math.max(m,n[0]),o=Math.max(o,n[1])}n[0]=i,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function T(n){for(let t=0;t<6;t++)if(!isFinite(n[t]))return!1;return!0}function g(n){return n[0]>=n[3]?0:n[3]-n[0]}function y(n){return n[1]>=n[4]?0:n[4]-n[1]}function E(n){return n[2]>=n[5]?0:n[5]-n[2]}function F(n){const t=g(n),r=E(n),a=y(n);return Math.sqrt(t*t+r*r+a*a)}function b(n,t=[0,0,0]){return t[0]=n[0]+g(n)/2,t[1]=n[1]+y(n)/2,t[2]=n[2]+E(n)/2,t}function p(n,t=[0,0,0]){return t[0]=g(n),t[1]=y(n),t[2]=E(n),t}function z(n){return Math.max(g(n),E(n),y(n))}function V(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[0]<=n[3]&&t[1]<=n[4]&&t[2]<=n[5]}function Y(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[2]>=n[2]-r&&t[0]<=n[3]+r&&t[1]<=n[4]+r&&t[2]<=n[5]+r}function _(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[3]<=n[3]&&t[4]<=n[4]&&t[5]<=n[5]}function j(n,t){return Math.max(t[0],n[0])<=Math.min(t[3],n[3])&&Math.max(t[1],n[1])<=Math.min(t[4],n[4])&&Math.max(t[2],n[2])<=Math.min(t[5],n[5])}function A(n,t){return null==t||j(n,t)}function R(n,t,r){let a=0,i=1;for(let u=0;u<3;++u){const e=n[u],m=n[u+3],o=t[u],f=r[u],c=f<o,h=c?f:o,M=c?o:f,x=Math.max(e,h),l=Math.min(m,M);if(x>l)return!1;if(M===h)break;const N=M-h,s=(x-h)/N,I=(l-h)/N;if(a=Math.max(a,c?1-I:s),i=Math.min(i,c?1-s:I),a>i)return!1}return!0}function G(n,t,r,a,i=n){return i[0]=n[0]+t,i[1]=n[1]+r,i[2]=n[2]+a,i[3]=n[3]+t,i[4]=n[4]+r,i[5]=n[5]+a,i}function O(n,t,r=n){const a=n[0]+g(n)/2,i=n[1]+y(n)/2,u=n[2]+E(n)/2;return r[0]=a+(n[0]-a)*t,r[1]=i+(n[1]-i)*t,r[2]=u+(n[2]-u)*t,r[3]=a+(n[3]-a)*t,r[4]=i+(n[4]-i)*t,r[5]=u+(n[5]-u)*t,r}function P(n,t){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function S(n,t){return t[0]=n[3],t[1]=n[4],t[2]=n[5],t}function Z(n,t,r=n){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==n&&(r[3]=n[3],r[4]=n[4],r[5]=n[5]),r}function d(n,t,r=n){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==n&&(r[0]=n[0],r[1]=n[1],r[2]=n[2]),n}function k(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function q(n){return n?k(n,L):i(L)}function w(n,r=t()){return r[0]=n[0],r[1]=n[1],r[2]=n[3],r[3]=n[4],r}function B(n,t){return n[0]=t[0],n[1]=t[1],n[2]=Number.NEGATIVE_INFINITY,n[3]=t[2],n[4]=t[3],n[5]=Number.POSITIVE_INFINITY,n}function D(n,t,r,a,i){return n[0]=t,n[1]=r,n[2]=Number.NEGATIVE_INFINITY,n[3]=a,n[4]=i,n[5]=Number.POSITIVE_INFINITY,n}function v(n){return 6===n.length}function C(n){return 0===g(n)&&0===y(n)&&0===E(n)}function H(n,t,r){if(null==n||null==t)return n===t;if(!v(n)||!v(t))return!1;if(r){for(let a=0;a<n.length;a++)if(!r(n[a],t[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==t[a])return!1;return!0}function J(n,t,r,a,i,e){return u(n,t,r,a,i,e,W)}const K=a([-1/0,-1/0,-1/0,1/0,1/0,1/0]),L=a([1/0,1/0,1/0,-1/0,-1/0,-1/0]),Q=a([0,0,0,0,0,0]),U=a([NaN,NaN,NaN,NaN,NaN,NaN]),W=i();export{T as allFinite,b as center,_ as contains,V as containsPoint,Y as containsPointWithMargin,i as create,y as depth,F as diameter,q as empty,H as equals,M as expandWithAABB,N as expandWithBuffer,I as expandWithNestedArray,s as expandWithOffset,x as expandWithRect,l as expandWithVec3,m as fromBuffer,e as fromExtent,h as fromMinMax,B as fromRect,D as fromRectValues,o as fromSubBuffer,u as fromValues,S as getMax,P as getMin,E as height,j as intersects,A as intersectsClippingArea,R as intersectsSegment,v as is,C as isPoint,z as maximumDimension,U as nan,L as negativeInfinity,G as offset,K as positiveInfinity,O as scale,k as set,d as setMax,Z as setMin,p as size,f as toCorners,c as toExtent,w as toRect,g as width,J as wrap,Q as zero};
5
+ import n from"../Extent.js";import{create as t}from"./aaBoundingRect.js";import{newDoubleArray as r}from"./DoubleArray.js";function a(n){return n}function i(n=U){return a([n[0],n[1],n[2],n[3],n[4],n[5]])}function u(n,t,r,a,u,e,m=i()){return m[0]=n,m[1]=t,m[2]=r,m[3]=a,m[4]=u,m[5]=e,m}function e(n,t=i()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.hasZ?n.zmin:-1/0,t[3]=n.xmax,t[4]=n.ymax,t[5]=n.hasZ?n.zmax:1/0,t}function m(n,t=i()){return o(n,0,n.length/3,t)}function o(n,t,r,a=i()){return q(a,Q),N(a,n,t,r),a}function f(n,t=r(24)){const[a,i,u,e,m,o]=n;return t[0]=a,t[1]=i,t[2]=u,t[3]=a,t[4]=i,t[5]=o,t[6]=a,t[7]=m,t[8]=u,t[9]=a,t[10]=m,t[11]=o,t[12]=e,t[13]=i,t[14]=u,t[15]=e,t[16]=i,t[17]=o,t[18]=e,t[19]=m,t[20]=u,t[21]=e,t[22]=m,t[23]=o,t}function h(t,r){const a=isFinite(t[2])||isFinite(t[5]);return new n(a?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:r}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:r})}function c(n,t,r=i()){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=t[0],r[4]=t[1],r[5]=t[2],r}function M(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[3]),n[4]=Math.max(n[4],t[4]),n[5]=Math.max(n[5],t[5])}function x(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[3]=Math.max(n[3],t[2]),n[4]=Math.max(n[4],t[3])}function l(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[0]),n[4]=Math.max(n[4],t[1]),n[5]=Math.max(n[5],t[2])}function N(n,t,r=0,a=t.length/3){let i=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];for(let h=0;h<a;h++)i=Math.min(i,t[r+3*h]),u=Math.min(u,t[r+3*h+1]),e=Math.min(e,t[r+3*h+2]),m=Math.max(m,t[r+3*h]),o=Math.max(o,t[r+3*h+1]),f=Math.max(f,t[r+3*h+2]);n[0]=i,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function s(n,t,r,a){n[0]=Math.min(n[0],n[0]+t),n[3]=Math.max(n[3],n[3]+t),n[1]=Math.min(n[1],n[1]+r),n[4]=Math.max(n[4],n[4]+r),n[2]=Math.min(n[2],n[2]+a),n[5]=Math.max(n[5],n[5]+a)}function I(n,{xmin:t,ymin:r,zmin:a,xmax:i,ymax:u,zmax:e}){n[0]=Math.min(n[0],t),n[3]=Math.max(n[3],i),n[1]=Math.min(n[1],r),n[4]=Math.max(n[4],u),n[2]=Math.min(n[2],a??-1/0),n[5]=Math.max(n[5],e??1/0)}function y(n,t,r){const a=t.length;let i=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];if(r)for(let h=0;h<a;h++){const n=t[h];i=Math.min(i,n[0]),u=Math.min(u,n[1]),e=Math.min(e,n[2]),m=Math.max(m,n[0]),o=Math.max(o,n[1]),f=Math.max(f,n[2])}else for(let h=0;h<a;h++){const n=t[h];i=Math.min(i,n[0]),u=Math.min(u,n[1]),m=Math.max(m,n[0]),o=Math.max(o,n[1])}n[0]=i,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function T(n){for(let t=0;t<6;t++)if(!isFinite(n[t]))return!1;return!0}function g(n){return n[0]>=n[3]?0:n[3]-n[0]}function E(n){return n[1]>=n[4]?0:n[4]-n[1]}function F(n){return n[2]>=n[5]?0:n[5]-n[2]}function b(n){const t=g(n),r=F(n),a=E(n);return Math.sqrt(t*t+r*r+a*a)}function p(n,t=[0,0,0]){return t[0]=n[0]+g(n)/2,t[1]=n[1]+E(n)/2,t[2]=n[2]+F(n)/2,t}function z(n,t=[0,0,0]){return t[0]=g(n),t[1]=E(n),t[2]=F(n),t}function V(n){return Math.max(g(n),F(n),E(n))}function Y(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[0]<=n[3]&&t[1]<=n[4]&&t[2]<=n[5]}function _(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[2]>=n[2]-r&&t[0]<=n[3]+r&&t[1]<=n[4]+r&&t[2]<=n[5]+r}function j(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[3]<=n[3]&&t[4]<=n[4]&&t[5]<=n[5]}function A(n,t){return Math.max(t[0],n[0])<=Math.min(t[3],n[3])&&Math.max(t[1],n[1])<=Math.min(t[4],n[4])&&Math.max(t[2],n[2])<=Math.min(t[5],n[5])}function R(n,t){return null==t||A(n,t)}function G(n,t,r){let a=0,i=1;for(let u=0;u<3;++u){const e=n[u],m=n[u+3],o=t[u],f=r[u],h=f<o,c=h?f:o,M=h?o:f,x=Math.max(e,c),l=Math.min(m,M);if(x>l)return!1;if(M===c)break;const N=M-c,s=(x-c)/N,I=(l-c)/N;if(a=Math.max(a,h?1-I:s),i=Math.min(i,h?1-s:I),a>i)return!1}return!0}function O(n,t,r,a,i=n){return i[0]=n[0]+t,i[1]=n[1]+r,i[2]=n[2]+a,i[3]=n[3]+t,i[4]=n[4]+r,i[5]=n[5]+a,i}function P(n,t,r=n){const a=n[0]+g(n)/2,i=n[1]+E(n)/2,u=n[2]+F(n)/2;return r[0]=a+(n[0]-a)*t,r[1]=i+(n[1]-i)*t,r[2]=u+(n[2]-u)*t,r[3]=a+(n[3]-a)*t,r[4]=i+(n[4]-i)*t,r[5]=u+(n[5]-u)*t,r}function S(n,t){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Z(n,t){return t[0]=n[3],t[1]=n[4],t[2]=n[5],t}function d(n,t,r=n){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==n&&(r[3]=n[3],r[4]=n[4],r[5]=n[5]),r}function k(n,t,r=n){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==n&&(r[0]=n[0],r[1]=n[1],r[2]=n[2]),n}function q(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function w(n){return n?q(n,Q):i(Q)}function B(n,r=t()){return r[0]=n[0],r[1]=n[1],r[2]=n[3],r[3]=n[4],r}function D(n,t){return n[0]=t[0],n[1]=t[1],n[2]=Number.NEGATIVE_INFINITY,n[3]=t[2],n[4]=t[3],n[5]=Number.POSITIVE_INFINITY,n}function v(n,t,r,a,i){return n[0]=t,n[1]=r,n[2]=Number.NEGATIVE_INFINITY,n[3]=a,n[4]=i,n[5]=Number.POSITIVE_INFINITY,n}function C(n){return 6===n.length}function H(n){return 0===g(n)&&0===E(n)&&0===F(n)}function J(n,t,r){if(null==n||null==t)return n===t;if(!C(n)||!C(t))return!1;if(r){for(let a=0;a<n.length;a++)if(!r(n[a],t[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==t[a])return!1;return!0}function K(n,t,r,a,i,e){return u(n,t,r,a,i,e,X)}const L=a([-1/0,-1/0,-1/0,1/0,1/0,1/0]),Q=a([1/0,1/0,1/0,-1/0,-1/0,-1/0]),U=a([0,0,0,0,0,0]),W=a([NaN,NaN,NaN,NaN,NaN,NaN]),X=i();export{T as allFinite,p as center,j as contains,Y as containsPoint,_ as containsPointWithMargin,i as create,E as depth,b as diameter,w as empty,J as equals,M as expandWithAABB,N as expandWithBuffer,I as expandWithExtent,y as expandWithNestedArray,s as expandWithOffset,x as expandWithRect,l as expandWithVec3,m as fromBuffer,e as fromExtent,c as fromMinMax,D as fromRect,v as fromRectValues,o as fromSubBuffer,u as fromValues,Z as getMax,S as getMin,F as height,A as intersects,R as intersectsClippingArea,G as intersectsSegment,C as is,H as isPoint,V as maximumDimension,W as nan,Q as negativeInfinity,O as offset,L as positiveInfinity,P as scale,q as set,k as setMax,d as setMin,z as size,f as toCorners,h as toExtent,B as toRect,g as width,K as wrap,U as zero};
@@ -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"../../core/has.js";import{clamp as n,floatEqualUlp as t}from"../../core/mathUtils.js";import r from"../Extent.js";function u(n){return n}function i(n=V){return u([n[0],n[1],n[2],n[3]])}function a(n){return u([n[0],n[1],n[2],n[3]])}function e(n,t){return n!==t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]),n}function o(n,t,r,u,a=i()){return a[0]=n,a[1]=t,a[2]=r,a[3]=u,a}function c(n,t=i()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.xmax,t[3]=n.ymax,t}function f(n,t,u=new r){return u.xmin=n[0],u.ymin=n[1],u.xmax=n[2],u.ymax=n[3],u.spatialReference=t,u}function m(n,t){t[0]<n[0]&&(n[0]=t[0]),t[0]>n[2]&&(n[2]=t[0]),t[1]<n[1]&&(n[1]=t[1]),t[1]>n[3]&&(n[3]=t[1])}function h(n,t){t<n[0]&&(n[0]=t),t>n[2]&&(n[2]=t)}function M(n,t){t<n[1]&&(n[1]=t),t>n[3]&&(n[3]=t)}function x(n,t,r){if(null!=t)if("length"in t)N(t)?(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3])):2!==t.length&&3!==t.length||(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[0]),r[3]=Math.max(n[3],t[1]));else switch(t.type){case"extent":r[0]=Math.min(n[0],t.xmin),r[1]=Math.min(n[1],t.ymin),r[2]=Math.max(n[2],t.xmax),r[3]=Math.max(n[3],t.ymax);break;case"point":r[0]=Math.min(n[0],t.x),r[1]=Math.min(n[1],t.y),r[2]=Math.max(n[2],t.x),r[3]=Math.max(n[3],t.y)}else e(r,n)}function s(n,t,r=n){const u=t.length;let i=n[0],a=n[1],e=n[2],o=n[3];for(let c=0;c<u;c++){const n=t[c];i=Math.min(i,n[0]),a=Math.min(a,n[1]),e=Math.max(e,n[0]),o=Math.max(o,n[1])}return r[0]=i,r[1]=a,r[2]=e,r[3]=o,r}function l(n){for(let t=0;t<4;t++)if(!isFinite(n[t]))return!1;return!0}function y(n){return null==n||n[0]>=n[2]?0:n[2]-n[0]}function p(n){return null==n||n[1]>=n[3]?0:n[3]-n[1]}function b(n){return y(n)*p(n)}function g(n){return y(n)>0&&p(n)>0}function j(n,t=[0,0]){return t[0]=(n[0]+n[2])/2,t[1]=(n[1]+n[3])/2,t}function F(n){const t=y(n),r=p(n);return Math.sqrt(t*t+r*r)}function q(n,t){return v(n,t[0],t[1])}function w(n,t){const r=t.radius,u=.5*(n[0]+n[2]),i=Math.abs(t.center[0]-u),a=.5*(n[2]-n[0]);if(i>r+a)return!1;const e=.5*(n[1]+n[3]),o=.5*(n[3]-n[1]),c=Math.abs(t.center[1]-e);if(c>r+o)return!1;if(i<a||c<o)return!0;const f=i-a,m=c-o;return f*f+m*m<=r*r}function d(n,t,r){const u=n[0],i=n[1],a=n[2],e=n[3],{x:o,y:c}=t,{x:f,y:m}=r,h=(n,t)=>(m-c)*n+(o-f)*t+(f*c-o*m)<0,M=h(u,e),x=h(a,e),s=h(a,i),l=h(u,i);return!(M===x&&x===s&&s===l&&l===M||o<u&&f<u||o>a&&f>a||c>e&&m>e||c<i&&m<i)}function k(n,t){return!!n&&v(n,t.x,t.y)}function v(n,t,r){return t>=n[0]&&r>=n[1]&&t<=n[2]&&r<=n[3]}function E(n,t,r,u){return t>=n[0]-u&&r>=n[1]-u&&t<=n[2]+u&&r<=n[3]+u}function R(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[0]<=n[2]+r&&t[1]<=n[3]+r}function U(n,t){return Math.max(t[0],n[0])<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])<=Math.min(t[3],n[3])}function z(n,t,r){return Math.max(t[0],n[0])-r<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])-r<=Math.min(t[3],n[3])}function A(n,t){return t[0]>=n[0]&&t[2]<=n[2]&&t[1]>=n[1]&&t[3]<=n[3]}function B(n,t,r){return null==t?e(r,n):(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3]),r)}function C(t,r,u){if(null==r)return e(u,t);const i=r[0],a=r[1],o=r[2],c=r[3];return u[0]=n(t[0],i,o),u[1]=n(t[1],a,c),u[2]=n(t[2],i,o),u[3]=n(t[3],a,c),u}function D(n,t){const r=(n[0]+n[2])/2,u=(n[1]+n[3])/2,i=Math.max(Math.abs(t[0]-r)-y(n)/2,0),a=Math.max(Math.abs(t[1]-u)-p(n)/2,0);return Math.sqrt(i*i+a*a)}function G(n,t){t[0]=n[2]-n[0],t[1]=n[3]-n[1]}function H(n,t,r,u){return u??=n,u[0]=n[0]+t,u[1]=n[1]+r,u[2]=n[2]+t,u[3]=n[3]+r,u}function I(n,t,r=n){return r[0]=n[0]-t,r[1]=n[1]-t,r[2]=n[2]+t,r[3]=n[3]+t,r}function J(n,t,r=n){return r[0]=t[0],r[1]=t[1],r!==n&&(r[2]=n[2],r[3]=n[3]),r}function K(n,t,r=n){return r[2]=t[0],r[3]=t[1],r!==n&&(r[0]=n[0],r[1]=n[1]),n}function L(n){return n?e(n,T):i(T)}function N(n){return null!=n&&4===n.length}function O(n){return!(0!==y(n)&&isFinite(n[0])||0!==p(n)&&isFinite(n[1]))}function P(n,t){return N(n)&&N(t)?n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]:n===t}function Q(n,r,u){return null!=n&&null!=r&&n.every((n,i)=>t(n,r[i],u))}const S=u([-1/0,-1/0,1/0,1/0]),T=u([1/0,1/0,-1/0,-1/0]),V=u([0,0,0,0]),W=u([0,0,1,1]);function X(n,t,r){return null!=t&&(r?r.contains(n[0],n[2],t[0])&&r.contains(n[0],n[2],t[2])&&t[1]>n[1]&&t[3]<n[3]:A(n,t))}function Y(n,t,r){return null!=n&&(r?(r.contains(t[0],t[2],n[0])||r.contains(t[0],t[2],n[2])||r.contains(n[0],n[2],t[0]))&&!(n[1]>t[3]||n[3]<t[1]):U(n,t))}export{l as allFinite,Q as almostEquals,b as area,j as center,a as clone,A as contains,q as containsPoint,k as containsPointObject,R as containsPointWithMargin,v as containsXY,E as containsXYWithMargin,e as copy,i as create,F as diagonal,D as distance,L as empty,P as equals,x as expand,m as expandPointInPlace,s as expandWithNestedArray,h as expandXInPlace,M as expandYInPlace,c as fromExtent,o as fromValues,g as hasArea,p as height,C as intersection,U as intersects,d as intersectsSegment,w as intersectsSphere,z as intersectsWithMargin,N as is,O as isPoint,T as negativeInfinity,H as offset,I as pad,S as positiveInfinity,X as rectangleContainsRectangleCyclicalAware,Y as rectanglesIntersectCyclicalAware,K as setMax,J as setMin,G as size,f as toExtent,B as union,W as unit,y as width,V as zero};
5
+ import"../../core/has.js";import{clamp as n,floatEqualUlp as t}from"../../core/mathUtils.js";import r from"../Extent.js";function i(n){return n}function u(n=W){return i([n[0],n[1],n[2],n[3]])}function a(n){return i([n[0],n[1],n[2],n[3]])}function e(n,t){return n!==t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]),n}function o(n,t,r,i,a=u()){return a[0]=n,a[1]=t,a[2]=r,a[3]=i,a}function c(n,t=u()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.xmax,t[3]=n.ymax,t}function m(n,t,i=new r){return i.xmin=n[0],i.ymin=n[1],i.xmax=n[2],i.ymax=n[3],i.spatialReference=t,i}function f(n,t){t[0]<n[0]&&(n[0]=t[0]),t[0]>n[2]&&(n[2]=t[0]),t[1]<n[1]&&(n[1]=t[1]),t[1]>n[3]&&(n[3]=t[1])}function h(n,t){t<n[0]&&(n[0]=t),t>n[2]&&(n[2]=t)}function x(n,t){t<n[1]&&(n[1]=t),t>n[3]&&(n[3]=t)}function M(n,{xmin:t,ymin:r,xmax:i,ymax:u}){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],r),n[2]=Math.max(n[2],i),n[3]=Math.max(n[3],u)}function s(n,t,r){if(null!=t)if("length"in t)O(t)?(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3])):2!==t.length&&3!==t.length||(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[0]),r[3]=Math.max(n[3],t[1]));else switch(t.type){case"extent":r[0]=Math.min(n[0],t.xmin),r[1]=Math.min(n[1],t.ymin),r[2]=Math.max(n[2],t.xmax),r[3]=Math.max(n[3],t.ymax);break;case"point":r[0]=Math.min(n[0],t.x),r[1]=Math.min(n[1],t.y),r[2]=Math.max(n[2],t.x),r[3]=Math.max(n[3],t.y)}else e(r,n)}function l(n,t,r=n){const i=t.length;let u=n[0],a=n[1],e=n[2],o=n[3];for(let c=0;c<i;c++){const n=t[c];u=Math.min(u,n[0]),a=Math.min(a,n[1]),e=Math.max(e,n[0]),o=Math.max(o,n[1])}return r[0]=u,r[1]=a,r[2]=e,r[3]=o,r}function y(n){for(let t=0;t<4;t++)if(!isFinite(n[t]))return!1;return!0}function p(n){return null==n||n[0]>=n[2]?0:n[2]-n[0]}function b(n){return null==n||n[1]>=n[3]?0:n[3]-n[1]}function g(n){return p(n)*b(n)}function j(n){return p(n)>0&&b(n)>0}function F(n,t=[0,0]){return t[0]=(n[0]+n[2])/2,t[1]=(n[1]+n[3])/2,t}function q(n){const t=p(n),r=b(n);return Math.sqrt(t*t+r*r)}function w(n,t){return E(n,t[0],t[1])}function d(n,t){const r=t.radius,i=.5*(n[0]+n[2]),u=Math.abs(t.center[0]-i),a=.5*(n[2]-n[0]);if(u>r+a)return!1;const e=.5*(n[1]+n[3]),o=.5*(n[3]-n[1]),c=Math.abs(t.center[1]-e);if(c>r+o)return!1;if(u<a||c<o)return!0;const m=u-a,f=c-o;return m*m+f*f<=r*r}function k(n,t,r){const i=n[0],u=n[1],a=n[2],e=n[3],{x:o,y:c}=t,{x:m,y:f}=r,h=(n,t)=>(f-c)*n+(o-m)*t+(m*c-o*f)<0,x=h(i,e),M=h(a,e),s=h(a,u),l=h(i,u);return!(x===M&&M===s&&s===l&&l===x||o<i&&m<i||o>a&&m>a||c>e&&f>e||c<u&&f<u)}function v(n,t){return!!n&&E(n,t.x,t.y)}function E(n,t,r){return t>=n[0]&&r>=n[1]&&t<=n[2]&&r<=n[3]}function R(n,t,r,i){return t>=n[0]-i&&r>=n[1]-i&&t<=n[2]+i&&r<=n[3]+i}function U(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[0]<=n[2]+r&&t[1]<=n[3]+r}function z(n,t){return Math.max(t[0],n[0])<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])<=Math.min(t[3],n[3])}function A(n,t,r){return Math.max(t[0],n[0])-r<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])-r<=Math.min(t[3],n[3])}function B(n,t){return t[0]>=n[0]&&t[2]<=n[2]&&t[1]>=n[1]&&t[3]<=n[3]}function C(n,t,r){return null==t?e(r,n):(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3]),r)}function D(t,r,i){if(null==r)return e(i,t);const u=r[0],a=r[1],o=r[2],c=r[3];return i[0]=n(t[0],u,o),i[1]=n(t[1],a,c),i[2]=n(t[2],u,o),i[3]=n(t[3],a,c),i}function G(n,t){const r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,u=Math.max(Math.abs(t[0]-r)-p(n)/2,0),a=Math.max(Math.abs(t[1]-i)-b(n)/2,0);return Math.sqrt(u*u+a*a)}function H(n,t){t[0]=n[2]-n[0],t[1]=n[3]-n[1]}function I(n,t,r,i){return i??=n,i[0]=n[0]+t,i[1]=n[1]+r,i[2]=n[2]+t,i[3]=n[3]+r,i}function J(n,t,r=n){return r[0]=n[0]-t,r[1]=n[1]-t,r[2]=n[2]+t,r[3]=n[3]+t,r}function K(n,t,r=n){return r[0]=t[0],r[1]=t[1],r!==n&&(r[2]=n[2],r[3]=n[3]),r}function L(n,t,r=n){return r[2]=t[0],r[3]=t[1],r!==n&&(r[0]=n[0],r[1]=n[1]),n}function N(n){return n?e(n,V):u(V)}function O(n){return null!=n&&4===n.length}function P(n){return!(0!==p(n)&&isFinite(n[0])||0!==b(n)&&isFinite(n[1]))}function Q(n,t){return O(n)&&O(t)?n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]:n===t}function S(n,r,i){return null!=n&&null!=r&&n.every((n,u)=>t(n,r[u],i))}const T=i([-1/0,-1/0,1/0,1/0]),V=i([1/0,1/0,-1/0,-1/0]),W=i([0,0,0,0]),X=i([0,0,1,1]);function Y(n,t,r){return null!=t&&(r?r.contains(n[0],n[2],t[0])&&r.contains(n[0],n[2],t[2])&&t[1]>n[1]&&t[3]<n[3]:B(n,t))}function Z(n,t,r){return null!=n&&(r?(r.contains(t[0],t[2],n[0])||r.contains(t[0],t[2],n[2])||r.contains(n[0],n[2],t[0]))&&!(n[1]>t[3]||n[3]<t[1]):z(n,t))}export{y as allFinite,S as almostEquals,g as area,F as center,a as clone,B as contains,w as containsPoint,v as containsPointObject,U as containsPointWithMargin,E as containsXY,R as containsXYWithMargin,e as copy,u as create,q as diagonal,G as distance,N as empty,Q as equals,s as expand,M as expandExtentInPlace,f as expandPointInPlace,l as expandWithNestedArray,h as expandXInPlace,x as expandYInPlace,c as fromExtent,o as fromValues,j as hasArea,b as height,D as intersection,z as intersects,k as intersectsSegment,d as intersectsSphere,A as intersectsWithMargin,O as is,P as isPoint,V as negativeInfinity,I as offset,J as pad,T as positiveInfinity,Y as rectangleContainsRectangleCyclicalAware,Z as rectanglesIntersectCyclicalAware,L as setMax,K as setMin,H as size,m as toExtent,C as union,X as unit,p as width,W as zero};
@@ -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{fromValues as n,create as t}from"./aaBoundingRect.js";import{curveExtent as i}from"./curves/curveExtent.js";import{getEndpoint as r,isCoordinate as e}from"./curves/curveUtils.js";function o(n){return void 0!==n.xmin&&void 0!==n.ymin&&void 0!==n.xmax&&void 0!==n.ymax}function u(n){return void 0!==n.points}function c(n){return void 0!==n.x&&void 0!==n.y}function s(n){return void 0!==n.paths}function l(n){return void 0!==n.rings}function h(n){function t(t,i){return null==t?i:null==i?t:n(t,i)}return t}const m=h(Math.min),a=h(Math.max);function f(n,t){return s(t)?y(n,t.curvePaths??t.paths,!1,!1)??n:l(t)?y(n,t.curveRings??t.rings,!1,!1)??n:u(t)?p(n,t.points,!1,!1,!1,!1):o(t)?d(n,t):(c(t)&&(n[0]=t.x,n[1]=t.y,n[2]=t.x,n[3]=t.y),n)}function x(n){let i,r,e,o;for(n.reset(),i=e=1/0,r=o=-1/0;n.nextPath();){const t=g(n);i=Math.min(t[0],i),e=Math.min(t[1],e),r=Math.max(t[2],r),o=Math.max(t[3],o)}return t([i,e,r,o])}function g(n){let i,r,e,o;for(i=e=1/0,r=o=-1/0;n.nextPoint();)i=Math.min(n.x,i),e=Math.min(n.y,e),r=Math.max(n.x,r),o=Math.max(n.y,o);return t([i,e,r,o])}function v(n,t){return s(t)?y(n,t.curvePaths??t.paths,!0,!1)??n:l(t)?y(n,t.curveRings??t.rings,!0,!1)??n:u(t)?p(n,t.points,!0,!1,!0,!1):o(t)?d(n,t,!0,!1,!0,!1):(c(t)&&(n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.x,n[4]=t.y,n[5]=t.z),n)}function y(t,o,u,c){const s=u?3:2;if(!o.length||!o[0].length)return null;let l,h,f,x,[g,v]=r(o[0][0]),y=g,d=v;for(let p=0;p<o.length;p++){const t=o[p];for(let o=0;o<t.length;o++){const p=r(t[o]),[M,z]=p;if(g=m(g,M),v=m(v,z),y=a(y,M),d=a(d,z),u&&p.length>2){const n=p[2];l=m(l,n),h=a(h,n)}if(c&&p.length>s){const n=p[s];f=m(l,n),x=a(h,n)}const P=t[o];if(e(P)||o<1)continue;const j=r(t[o-1]),R=n(g,v,y,d);[g,v,y,d]=i(R,j,P)}}return u?c?(t[0]=g,t[1]=v,t[2]=l,t[3]=f,t[4]=y,t[5]=d,t[6]=h,t[7]=x,t.length=8,t):(t[0]=g,t[1]=v,t[2]=l,t[3]=y,t[4]=d,t[5]=h,t.length=6,t):c?(t[0]=g,t[1]=v,t[2]=f,t[3]=y,t[4]=d,t[5]=x,t.length=6,t):(t[0]=g,t[1]=v,t[2]=y,t[3]=d,t.length=4,t)}function d(n,t,i,r,e,o){const u=t.xmin,c=t.xmax,s=t.ymin,l=t.ymax;let h=t.zmin,m=t.zmax,a=t.mmin,f=t.mmax;return e?(h=h||0,m=m||0,o?(a=a||0,f=f||0,n[0]=u,n[1]=s,n[2]=h,n[3]=a,n[4]=c,n[5]=l,n[6]=m,n[7]=f,n):(n[0]=u,n[1]=s,n[2]=h,n[3]=c,n[4]=l,n[5]=m,n)):o?(a=a||0,f=f||0,n[0]=u,n[1]=s,n[2]=a,n[3]=c,n[4]=l,n[5]=f,n):(n[0]=u,n[1]=s,n[2]=c,n[3]=l,n)}function p(n,t,i,r,e,o){const u=i?3:2,c=r&&o,s=i&&e;if(!t.length||!t[0].length)return null;let l,h,f,x,[g,v]=t[0],[y,d]=t[0];for(let p=0;p<t.length;p++){const n=t[p],[i,r]=n;if(g=m(g,i),v=m(v,r),y=a(y,i),d=a(d,r),s&&n.length>2){const t=n[2];l=m(l,t),h=a(h,t)}if(c&&n.length>u){const t=n[u];f=m(l,t),x=a(h,t)}}return e?(l=l||0,h=h||0,o?(f=f||0,x=x||0,n[0]=g,n[1]=v,n[2]=l,n[3]=f,n[4]=y,n[5]=d,n[6]=h,n[7]=x,n):(n[0]=g,n[1]=v,n[2]=l,n[3]=y,n[4]=d,n[5]=h,n)):o?(f=f||0,x=x||0,n[0]=g,n[1]=v,n[2]=f,n[3]=y,n[4]=d,n[5]=x,n):(n[0]=g,n[1]=v,n[2]=y,n[3]=d,n)}export{f as getBoundsXY,v as getBoundsXYZ,x as getCursorBoundsXY,g as getCursorPathBounds,d as getExtentBounds,p as getPointsBounds,y as getRingsOrPathsBounds};
5
+ import{fromValues as n,create as t}from"./aaBoundingRect.js";import{curveExtent as i}from"./curves/curveExtent.js";import{getEndpoint as r,isCoordinate as e}from"./curves/curveUtils.js";function o(n){return void 0!==n.xmin&&void 0!==n.ymin&&void 0!==n.xmax&&void 0!==n.ymax}function u(n){return void 0!==n.points}function c(n){return void 0!==n.x&&void 0!==n.y}function s(n){return void 0!==n.paths}function l(n){return void 0!==n.rings}function h(n){function t(t,i){return null==t?i:null==i?t:n(t,i)}return t}const m=h(Math.min),a=h(Math.max);function f(n,t){return s(t)?y(n,t.curvePaths??t.paths,!1,!1)??n:l(t)?y(n,t.curveRings??t.rings,!1,!1)??n:u(t)?p(n,t.points,!1,!1,!1,!1):o(t)?d(n,t):(c(t)&&(n[0]=t.x,n[1]=t.y,n[2]=t.x,n[3]=t.y),n)}function x(n){let i,r,e,o;for(n.reset(),i=e=1/0,r=o=-1/0;n.nextPath();){const t=g(n);i=Math.min(t[0],i),e=Math.min(t[1],e),r=Math.max(t[2],r),o=Math.max(t[3],o)}return t([i,e,r,o])}function g(n){let i,r,e,o;for(i=e=1/0,r=o=-1/0;n.nextPoint();)i=Math.min(n.x,i),e=Math.min(n.y,e),r=Math.max(n.x,r),o=Math.max(n.y,o);return t([i,e,r,o])}function v(n,t){return s(t)?y(n,t.curvePaths??t.paths,!0,!1)??n:l(t)?y(n,t.curveRings??t.rings,!0,!1)??n:u(t)?p(n,t.points,!0,!1,!0,!1):o(t)?d(n,t,!0,!1,!0,!1):(c(t)&&(n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.x,n[4]=t.y,n[5]=t.z),n)}function y(t,o,u,c){const s=u?3:2;if(!o.length||!o[0].length)return null;let l,h,f,x,[g,v]=r(o[0][0]),y=g,d=v;for(let p=0;p<o.length;p++){const t=o[p];for(let o=0;o<t.length;o++){const p=r(t[o]),[M,z]=p;if(g=m(g,M),v=m(v,z),y=a(y,M),d=a(d,z),u&&p.length>2){const n=p[2];l=m(l,n),h=a(h,n)}if(c&&p.length>s){const n=p[s];f=m(f,n),x=a(x,n)}const P=t[o];if(e(P)||o<1)continue;const j=r(t[o-1]),R=n(g,v,y,d);[g,v,y,d]=i(R,j,P)}}return u?c?(t[0]=g,t[1]=v,t[2]=l,t[3]=f,t[4]=y,t[5]=d,t[6]=h,t[7]=x,t.length=8,t):(t[0]=g,t[1]=v,t[2]=l,t[3]=y,t[4]=d,t[5]=h,t.length=6,t):c?(t[0]=g,t[1]=v,t[2]=f,t[3]=y,t[4]=d,t[5]=x,t.length=6,t):(t[0]=g,t[1]=v,t[2]=y,t[3]=d,t.length=4,t)}function d(n,t,i,r,e,o){const u=t.xmin,c=t.xmax,s=t.ymin,l=t.ymax;let h=t.zmin,m=t.zmax,a=t.mmin,f=t.mmax;return e?(h=h||0,m=m||0,o?(a=a||0,f=f||0,n[0]=u,n[1]=s,n[2]=h,n[3]=a,n[4]=c,n[5]=l,n[6]=m,n[7]=f,n):(n[0]=u,n[1]=s,n[2]=h,n[3]=c,n[4]=l,n[5]=m,n)):o?(a=a||0,f=f||0,n[0]=u,n[1]=s,n[2]=a,n[3]=c,n[4]=l,n[5]=f,n):(n[0]=u,n[1]=s,n[2]=c,n[3]=l,n)}function p(n,t,i,r,e,o){const u=i?3:2,c=r&&o,s=i&&e;if(!t.length||!t[0].length)return null;let l,h,f,x,[g,v]=t[0],[y,d]=t[0];for(let p=0;p<t.length;p++){const n=t[p],[i,r]=n;if(g=m(g,i),v=m(v,r),y=a(y,i),d=a(d,r),s&&n.length>2){const t=n[2];l=m(l,t),h=a(h,t)}if(c&&n.length>u){const t=n[u];f=m(l,t),x=a(h,t)}}return e?(l=l||0,h=h||0,o?(f=f||0,x=x||0,n[0]=g,n[1]=v,n[2]=l,n[3]=f,n[4]=y,n[5]=d,n[6]=h,n[7]=x,n):(n[0]=g,n[1]=v,n[2]=l,n[3]=y,n[4]=d,n[5]=h,n)):o?(f=f||0,x=x||0,n[0]=g,n[1]=v,n[2]=f,n[3]=y,n[4]=d,n[5]=x,n):(n[0]=g,n[1]=v,n[2]=y,n[3]=d,n)}export{f as getBoundsXY,v as getBoundsXYZ,x as getCursorBoundsXY,g as getCursorPathBounds,d as getExtentBounds,p as getPointsBounds,y as getRingsOrPathsBounds};