@arcgis/core 4.34.0-next.74 → 4.34.0-next.75

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 (149) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/applications/Components/QuantityFormatter.js +1 -1
  3. package/arcade/Pixel.js +5 -0
  4. package/arcade/featureSetUtils.js +1 -1
  5. package/arcade/featureset/actions/GroupBy.js +1 -1
  6. package/arcade/featureset/actions/OrderBy.js +1 -1
  7. package/arcade/functions/featuresetbase.js +1 -1
  8. package/arcade/functions/featuresetstring.js +1 -1
  9. package/arcade/functions/fieldStats.js +1 -1
  10. package/arcade/functions/geometry.js +1 -1
  11. package/arcade/functions/maths.js +1 -1
  12. package/arcade/functions/string.js +1 -1
  13. package/arcade/languageUtils.js +1 -1
  14. package/arcade.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/009556f323e58271bc7a.js +1 -0
  17. package/assets/esri/core/workers/chunks/{11acefc48c0354e675df.js → 0309d008e50e55c7ff1d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{dd447dfc50ee7f511b84.js → 19c1f1431c0b2f4525a2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{7219ceab0b6fae2e69b6.js → 280af3640f8e93c1024e.js} +2 -2
  20. package/assets/esri/core/workers/chunks/{5a476e6743902e35f81a.js.LICENSE.txt → 280af3640f8e93c1024e.js.LICENSE.txt} +1 -1
  21. package/assets/esri/core/workers/chunks/{e3ad0a390387c5847aca.js → 356c96fad88558be9054.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{ada8e07ff12bc5d4a1d9.js → 37ff19a9c5c99bd4e7c7.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{d12f373fcf5848ddcd8a.js → 3f523bc8551e712c9bd4.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{5b7e5ec6aea1f7f9b005.js → 3fecfe4f8ca2a5fd7360.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{78b33c6d73824085c6d1.js → 48449abe795cb7a831eb.js} +1 -1
  26. package/assets/esri/core/workers/chunks/541bffd61006d0e36166.js +1 -0
  27. package/assets/esri/core/workers/chunks/{f4e9640306f64b1af7a3.js → 65ec21d29e8563fdbc55.js} +1 -1
  28. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  29. package/assets/esri/core/workers/chunks/{fb669a2e50ca7aacac25.js → 71fef0a33b7ed9456e47.js} +1 -1
  30. package/assets/esri/core/workers/chunks/7430c462c350fdd26349.js +1 -0
  31. package/assets/esri/core/workers/chunks/{ff3fe5c97a98c8cab4ac.js → 7a23b127f551bf13ef54.js} +2 -2
  32. package/assets/esri/core/workers/chunks/{ff3fe5c97a98c8cab4ac.js.LICENSE.txt → 7a23b127f551bf13ef54.js.LICENSE.txt} +1 -1
  33. package/assets/esri/core/workers/chunks/{9c00c2263e52ad51c2a2.js → 8e428b0f33ef4688415e.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{d682dd49bb9ee7f48f93.js → 9304c3cdf732745577fd.js} +1 -1
  35. package/assets/esri/core/workers/chunks/93b2e0a300b2758a1ca4.js +1 -0
  36. package/assets/esri/core/workers/chunks/{8d642b34d40edfe02d8e.js → 9c64b78c5c9b35b31d98.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{8d642b34d40edfe02d8e.js.LICENSE.txt → 9c64b78c5c9b35b31d98.js.LICENSE.txt} +1 -1
  38. package/assets/esri/core/workers/chunks/{6dc62c170e9583222df2.js → a25b75de1bca1dd21941.js} +1 -1
  39. package/assets/esri/core/workers/chunks/a6533bab3b2fbc1e2a47.js +1 -0
  40. package/assets/esri/core/workers/chunks/{5c53deb45bc142219c76.js → b15ff6c9ef2de8a49853.js} +2 -2
  41. package/assets/esri/core/workers/chunks/{5c53deb45bc142219c76.js.LICENSE.txt → b15ff6c9ef2de8a49853.js.LICENSE.txt} +1 -1
  42. package/assets/esri/core/workers/chunks/bccecd678faff927ac76.js +1 -0
  43. package/assets/esri/core/workers/chunks/{ce1f4508487298ab57b6.js → bd2dc1282c49125ede89.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{f542bdc994a5ea3aa9d1.js → c38360d912f256519e06.js} +1 -1
  45. package/assets/esri/core/workers/chunks/cd1869e183001266c4c1.js +2 -0
  46. package/assets/esri/core/workers/chunks/{626c18c1bbc50b3b16b2.js.LICENSE.txt → cd1869e183001266c4c1.js.LICENSE.txt} +1 -1
  47. package/assets/esri/core/workers/chunks/{90321feb56f3a84f6e58.js → d153b29c542c37ae1636.js} +2 -2
  48. package/assets/esri/core/workers/chunks/{90321feb56f3a84f6e58.js.LICENSE.txt → d153b29c542c37ae1636.js.LICENSE.txt} +1 -1
  49. package/assets/esri/core/workers/chunks/d55c55d39a253630d228.js +1 -0
  50. package/assets/esri/core/workers/chunks/{49f7a5523462aebf90fc.js → d66cdb9bb494da19696b.js} +2 -2
  51. package/assets/esri/core/workers/chunks/{49f7a5523462aebf90fc.js.LICENSE.txt → d66cdb9bb494da19696b.js.LICENSE.txt} +1 -1
  52. package/assets/esri/core/workers/chunks/ed773dab5965e42a2879.js +2 -0
  53. package/assets/esri/core/workers/chunks/{7219ceab0b6fae2e69b6.js.LICENSE.txt → ed773dab5965e42a2879.js.LICENSE.txt} +1 -1
  54. package/assets/esri/images/portal/xrexperience16.png +0 -0
  55. package/chunks/Fog.glsl.js +6 -6
  56. package/chunks/GlowComposition.glsl.js +31 -12
  57. package/chunks/LineMarker.glsl.js +37 -36
  58. package/chunks/RibbonLine.glsl.js +83 -83
  59. package/chunks/array.js +1 -1
  60. package/chunks/languageUtils.js +1 -1
  61. package/config.js +1 -1
  62. package/core/quantityFormatUtils.js +1 -1
  63. package/core/unitFormatUtils.js +1 -1
  64. package/core/unitUtils.js +1 -1
  65. package/form/FormTemplate.js +1 -1
  66. package/geometry/support/curves/circleUtils.js +1 -1
  67. package/geometry/support/curves/circularArcUtils.js +1 -1
  68. package/geometry/support/curves/closestPointOnCurve.js +1 -1
  69. package/geometry/support/curves/curveExtent.js +1 -1
  70. package/geometry/support/curves/lineUtils.js +5 -0
  71. package/interfaces.d.ts +270 -18
  72. package/kernel.js +1 -1
  73. package/layers/ImageryLayer.js +1 -1
  74. package/layers/ImageryTileLayer.js +1 -1
  75. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  76. package/layers/support/fieldUtils.js +1 -1
  77. package/package.json +2 -2
  78. package/portal/PortalItem.js +1 -1
  79. package/renderers/ClassBreaksRenderer.js +1 -1
  80. package/renderers/DictionaryRenderer.js +1 -1
  81. package/renderers/DotDensityRenderer.js +1 -1
  82. package/renderers/HeatmapRenderer.js +1 -1
  83. package/renderers/PieChartRenderer.js +1 -1
  84. package/renderers/UniqueValueRenderer.js +1 -1
  85. package/renderers/mixins/VisualVariablesMixin.js +1 -1
  86. package/support/arcadeUtils.js +1 -1
  87. package/support/loadArcade.js +1 -1
  88. package/support/revision.js +1 -1
  89. package/symbols/CIMSymbol.js +1 -1
  90. package/symbols/support/FeatureExpressionInfo.js +1 -1
  91. package/views/2d/layers/LayerView2D.js +1 -1
  92. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  93. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  94. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  95. package/views/3d/analysis/Slice/ResizeManipulator.js +1 -1
  96. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  97. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  98. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  99. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  100. package/views/3d/environment/Fog.js +1 -1
  101. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  102. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  103. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  104. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  105. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  106. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  107. package/views/3d/layers/FlowSubView3D.js +1 -1
  108. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  109. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  110. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  111. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  112. package/views/3d/state/SurfaceCollisionConstraint.js +1 -1
  113. package/views/3d/state/ViewStateManager.js +1 -1
  114. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
  115. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  116. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  117. package/views/3d/support/flow/FlowWorker.js +1 -1
  118. package/views/3d/support/flow/geometryUtils.js +1 -1
  119. package/views/3d/support/flow/loadUtils.js +1 -1
  120. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +23 -13
  121. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +36 -23
  122. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +11 -11
  123. package/views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js +5 -0
  124. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  125. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
  126. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  127. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  128. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  129. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  130. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  131. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  132. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  133. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  134. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  135. package/views/GroundView.js +1 -1
  136. package/views/interactive/snapping/allLayerSnapping.js +1 -1
  137. package/views/layers/ImageryLayerView.js +1 -1
  138. package/views/support/LayerViewManager.js +1 -1
  139. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  140. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  141. package/assets/esri/core/workers/chunks/5a476e6743902e35f81a.js +0 -2
  142. package/assets/esri/core/workers/chunks/5a95688651d7e8b7101d.js +0 -1
  143. package/assets/esri/core/workers/chunks/626c18c1bbc50b3b16b2.js +0 -2
  144. package/assets/esri/core/workers/chunks/6da298da2ec09cced0b5.js +0 -1
  145. package/assets/esri/core/workers/chunks/8b1d2bbb2b2eb1830921.js +0 -1
  146. package/assets/esri/core/workers/chunks/a2f4b6d8da93f106852c.js +0 -1
  147. package/assets/esri/core/workers/chunks/d305ca524837c5dc81c8.js +0 -1
  148. package/assets/esri/core/workers/chunks/e6f2ac738df16fb5e13a.js +0 -1
  149. package/assets/esri/core/workers/chunks/e8d25d4ca9b335883f34.js +0 -1
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{SliceDraw as e}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{ObjectAndLayerIdColor as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{RibbonVertexPosition as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{LineStipple as n,computePixelSize as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{PiUtils as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{terrainDepthTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as d,addPixelRatio as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float4BindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Float4BindUniform.js";import{Float4PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as f}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as h,If as D}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as S}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{AnimatedLine as u}from"../views/3d/webgl-engine/shaders/AnimatedLine.glsl.js";import{outputColorHighlightOID as x}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as L}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as w}from"../webscene/support/AlphaCutoff.js";const b=1;function y(y){const j=new L,{attributes:C,varyings:P,vertex:F,fragment:z}=j,{applyMarkerOffset:A,draped:R,output:W,capType:V,stippleEnabled:T,falloffEnabled:E,roundJoins:O,wireframe:_,innerColorEnabled:M,hasAnimation:N}=y;z.include(a),j.include(t,y),j.include(n,y),j.include(i,y),j.include(s,y),j.include(u,y);const $=A&&!R;$&&(F.uniforms.add(new g("markerScale",e=>e.markerScale)),j.include(o,{space:2})),d(F,y),F.uniforms.add(new S("inverseProjectionMatrix",e=>e.camera.inverseProjectionMatrix),new c("nearFar",e=>e.camera.nearFar),new g("miterLimit",e=>"miter"!==e.join?0:e.miterLimit),new m("viewport",e=>e.camera.fullViewport)),F.constants.add("LARGE_HALF_FLOAT","float",65500),C.add("position","vec3"),C.add("previousDelta","vec4"),C.add("nextDelta","vec4"),C.add("lineParameters","vec2"),C.add("u0","float"),P.add("vColor","vec4"),P.add("vpos","vec3",{invariant:!0}),P.add("vLineDistance","float"),P.add("vLineWidth","float");const k=T;k&&P.add("vLineSizeInv","float");const B=2===V,I=T&&B,H=E||I;H&&P.add("vLineDistanceNorm","float"),B&&(P.add("vSegmentSDF","float"),P.add("vReverseSegmentSDF","float")),F.code.add(h`vec2 perpendicular(vec2 v) {
5
+ import{SliceDraw as e}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{ObjectAndLayerIdColor as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{RibbonVertexPosition as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{LineStipple as n,computePixelSize as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js";import{MarkerSizing as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{PiUtils as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{terrainDepthTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{NoPerspectiveWrite as d,NoPerspectiveRead as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js";import{addProjViewLocalOrigin as c,addPixelRatio as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2BindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float4BindUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Float4BindUniform.js";import{Float4PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as D}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as h}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as S,If as x}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{AnimatedLine as L}from"../views/3d/webgl-engine/shaders/AnimatedLine.glsl.js";import{outputColorHighlightOID as w}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as b}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as P}from"../webscene/support/AlphaCutoff.js";const y=1;function j(j){const C=new b,{attributes:z,varyings:W,vertex:R,fragment:F}=C,{applyMarkerOffset:A,draped:T,output:V,capType:E,stippleEnabled:O,falloffEnabled:M,roundJoins:N,wireframe:$,innerColorEnabled:_,hasAnimation:k}=j;F.include(a),C.include(t,j),C.include(n,j),C.include(i,j),C.include(s,j),C.include(L,j);const B=A&&!T;B&&(R.uniforms.add(new h("markerScale",e=>e.markerScale)),C.include(o,{space:2})),c(R,j),R.uniforms.add(new u("inverseProjectionMatrix",e=>e.camera.inverseProjectionMatrix),new v("nearFar",e=>e.camera.nearFar),new h("miterLimit",e=>"miter"!==e.join?0:e.miterLimit),new f("viewport",e=>e.camera.fullViewport)),R.constants.add("LARGE_HALF_FLOAT","float",65500),z.add("position","vec3"),z.add("previousDelta","vec4"),z.add("nextDelta","vec4"),z.add("lineParameters","vec2"),z.add("u0","float"),W.add("vColor","vec4"),W.add("vpos","vec3",{invariant:!0}),W.add("vLineDistance","float"),W.add("vLineWidth","float");const H=O;H&&W.add("vLineSizeInv","float");const I=2===E,J=O&&I,U=M||J;U&&W.add("vLineDistanceNorm","float"),I&&(W.add("vSegmentSDF","float"),W.add("vReverseSegmentSDF","float")),R.code.add(S`vec2 perpendicular(vec2 v) {
6
6
  return vec2(v.y, -v.x);
7
7
  }
8
8
  float interp(float ncp, vec4 a, vec4 b) {
@@ -13,22 +13,22 @@ float s = sin(a);
13
13
  float c = cos(a);
14
14
  mat2 m = mat2(c, -s, s, c);
15
15
  return m * v;
16
- }`),F.code.add(h`vec4 projectAndScale(vec4 pos) {
16
+ }`),R.code.add(S`vec4 projectAndScale(vec4 pos) {
17
17
  vec4 posNdc = proj * pos;
18
18
  posNdc.xy *= viewport.zw / posNdc.w;
19
19
  return posNdc;
20
- }`),F.code.add(h`void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next, in bool isStartVertex) {
20
+ }`),R.code.add(S`void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next, in bool isStartVertex, out vec4 clippedPos) {
21
21
  float vnp = nearFar[0] * 0.99;
22
- if(pos.z > -nearFar[0]) {
22
+ if (pos.z > -nearFar[0]) {
23
23
  if (!isStartVertex) {
24
- if(prev.z < -nearFar[0]) {
24
+ if (prev.z < -nearFar[0]) {
25
25
  pos = mix(prev, pos, interp(vnp, prev, pos));
26
26
  next = pos;
27
27
  } else {
28
28
  pos = vec4(0.0, 0.0, 0.0, 1.0);
29
29
  }
30
30
  } else {
31
- if(next.z < -nearFar[0]) {
31
+ if (next.z < -nearFar[0]) {
32
32
  pos = mix(pos, next, interp(vnp, pos, next));
33
33
  prev = pos;
34
34
  } else {
@@ -44,26 +44,36 @@ next = mix(next, pos, interp(vnp, next, pos));
44
44
  }
45
45
  }
46
46
  forwardViewPosDepth(pos.xyz);
47
+ clippedPos = pos;
47
48
  pos = projectAndScale(pos);
48
49
  next = projectAndScale(next);
49
50
  prev = projectAndScale(prev);
50
- }`),p(F),F.constants.add("aaWidth","float",T?0:1).main.add(h`
51
- // unpack values from vertex type
52
- bool isStartVertex = abs(abs(lineParameters.y)-3.0) == 1.0;
53
- vec3 prevPosition = position + previousDelta.xyz * previousDelta.w;
54
- vec3 nextPosition = position + nextDelta.xyz * nextDelta.w;
55
-
56
- float coverage = 1.0;
57
-
58
- // Check for special value of lineParameters.y which is used by the Renderer when graphics are removed before the
59
- // VBO is recompacted. If this is the case, then we just project outside of clip space.
60
- if (lineParameters.y == 0.0) {
61
- // Project out of clip space
62
- gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
63
- }
64
- else {
65
- bool isJoin = abs(lineParameters.y) < 3.0;
66
- float lineSize = getSize();
51
+ }`),m(R),R.constants.add("aaWidth","float",O?0:1).main.add(S`bool isStartVertex = abs(abs(lineParameters.y) - 3.0) == 1.0;
52
+ vec3 prevPosition = position + previousDelta.xyz * previousDelta.w;
53
+ vec3 nextPosition = position + nextDelta.xyz * nextDelta.w;
54
+ float coverage = 1.0;
55
+ if (lineParameters.y == 0.0) {
56
+ gl_Position = vec4(1e038, 1e038, 1e038, 1.0);
57
+ }
58
+ else {
59
+ vec4 pos = view * vec4(position, 1.0);
60
+ vec4 prev = view * vec4(prevPosition, 1.0);
61
+ vec4 next = view * vec4(nextPosition, 1.0);
62
+ bool isJoin = abs(lineParameters.y) < 3.0;`),B&&R.main.add(S`vec4 other = isStartVertex ? next : prev;
63
+ bool markersHidden = areWorldMarkersHidden(pos.xyz, other.xyz);
64
+ if (!isJoin && !markersHidden) {
65
+ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
66
+ }`),C.include(d),R.main.add(S`
67
+ vec4 clippedPos;
68
+ clipAndTransform(pos, prev, next, isStartVertex, clippedPos);
69
+
70
+ vec2 left = (pos.xy - prev.xy);
71
+ vec2 right = (next.xy - pos.xy);
72
+
73
+ float leftLen = length(left);
74
+ float rightLen = length(right);
75
+
76
+ float lineSize = getSize(clippedPos.xyz);
67
77
 
68
78
  if (lineSize < 1.0) {
69
79
  coverage = lineSize; // convert sub-pixel coverage to alpha
@@ -72,26 +82,14 @@ prev = projectAndScale(prev);
72
82
  lineSize += aaWidth;
73
83
 
74
84
  float lineWidth = lineSize * pixelRatio;
75
- vLineWidth = lineWidth;
76
- ${k?h`vLineSizeInv = 1.0 / lineSize;`:""}
77
-
78
- vec4 pos = view * vec4(position, 1.0);
79
- vec4 prev = view * vec4(prevPosition, 1.0);
80
- vec4 next = view * vec4(nextPosition, 1.0);
81
- `),$&&F.main.add(h`vec4 other = isStartVertex ? next : prev;
82
- bool markersHidden = areWorldMarkersHidden(pos, other);
83
- if(!isJoin && !markersHidden) {
84
- pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos) * 0.5;
85
- }`),F.main.add(h`clipAndTransform(pos, prev, next, isStartVertex);
86
- vec2 left = (pos.xy - prev.xy);
87
- vec2 right = (next.xy - pos.xy);
88
- float leftLen = length(left);
89
- float rightLen = length(right);`);(T||B)&&F.main.add(h`
85
+ vLineWidth = noPerspectiveWrite(lineWidth, pos.w);
86
+ ${H?S`vLineSizeInv = noPerspectiveWrite(1.0 / lineSize, pos.w);`:""}
87
+ `);(O||I)&&R.main.add(S`
90
88
  float isEndVertex = float(!isStartVertex);
91
89
  vec2 segmentOrigin = mix(pos.xy, prev.xy, isEndVertex);
92
90
  vec2 segment = mix(right, left, isEndVertex);
93
- ${B?h`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""}
94
- `),F.main.add(h`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0);
91
+ ${I?S`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""}
92
+ `),R.main.add(S`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0);
95
93
  right = (rightLen > 0.001) ? right/rightLen : vec2(0.0, 0.0);
96
94
  vec2 capDisplacementDir = vec2(0, 0);
97
95
  vec2 joinDisplacementDir = vec2(0, 0);
@@ -108,18 +106,18 @@ displacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));
108
106
  }
109
107
  }
110
108
  float subdivisionFactor = lineParameters.x;
111
- if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),O?F.main.add(h`
109
+ if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),N?R.main.add(S`
112
110
  vec2 startDir = leftLen < 0.001 ? right : left;
113
111
  startDir = perpendicular(startDir);
114
112
 
115
113
  vec2 endDir = rightLen < 0.001 ? left : right;
116
114
  endDir = perpendicular(endDir);
117
115
 
118
- float factor = ${T?h`min(1.0, subdivisionFactor * ${h.float((b+2)/(b+1))})`:h`subdivisionFactor`};
116
+ float factor = ${O?S`min(1.0, subdivisionFactor * ${S.float((y+2)/(y+1))})`:S`subdivisionFactor`};
119
117
 
120
118
  float rotationAngle = acos(clamp(dot(startDir, endDir), -1.0, 1.0));
121
119
  joinDisplacementDir = rotate(startDir, -sign(lineParameters.y) * factor * rotationAngle);
122
- `):F.main.add(h`if (leftLen < 0.001) {
120
+ `):R.main.add(S`if (leftLen < 0.001) {
123
121
  joinDisplacementDir = right;
124
122
  }
125
123
  else if (rightLen < 0.001) {
@@ -128,7 +126,7 @@ joinDisplacementDir = left;
128
126
  else {
129
127
  joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? right : left;
130
128
  }
131
- joinDisplacementDir = perpendicular(joinDisplacementDir);`);const J=0!==V;return F.main.add(h`
129
+ joinDisplacementDir = perpendicular(joinDisplacementDir);`);const G=0!==E;return R.main.add(S`
132
130
  displacementLen = lineWidth;
133
131
  }
134
132
  } else {
@@ -136,27 +134,27 @@ joinDisplacementDir = perpendicular(joinDisplacementDir);`);const J=0!==V;return
136
134
  joinDisplacementDir = isStartVertex ? right : left;
137
135
  joinDisplacementDir = perpendicular(joinDisplacementDir);
138
136
 
139
- ${J?h`capDisplacementDir = isStartVertex ? -right : left;`:""}
137
+ ${G?S`capDisplacementDir = isStartVertex ? -right : left;`:""}
140
138
  }
141
- `),F.main.add(h`
139
+ `),R.main.add(S`
142
140
  // Displacement (in pixels) caused by join/or cap
143
141
  vec2 dpos = joinDisplacementDir * sign(lineParameters.y) * displacementLen + capDisplacementDir * displacementLen;
144
- float lineDistNorm = sign(lineParameters.y) * pos.w;
142
+ float lineDistNorm = noPerspectiveWrite(sign(lineParameters.y), pos.w);
145
143
 
146
- vLineDistance = lineWidth * lineDistNorm;
147
- ${H?h`vLineDistanceNorm = lineDistNorm;`:""}
144
+ vLineDistance = lineWidth * lineDistNorm;
145
+ ${U?S`vLineDistanceNorm = lineDistNorm;`:""}
148
146
 
149
147
  pos.xy += dpos;
150
- `),B&&F.main.add(h`vec2 segmentDir = normalize(segment);
151
- vSegmentSDF = (isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin, segmentDir) * pos.w) ;
152
- vReverseSegmentSDF = (isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir) * pos.w);`),T&&(R?F.uniforms.add(new f("worldToScreenRatio",e=>1/e.screenToPCSRatio)):F.main.add(h`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
153
- float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),F.main.add(h`float segmentLengthScreenDouble = length(segment);
148
+ `),I&&R.main.add(S`vec2 segmentDir = normalize(segment);
149
+ vSegmentSDF = noPerspectiveWrite((isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin, segmentDir)), pos.w);
150
+ vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir)), pos.w);`),O&&(T?R.uniforms.add(new D("worldToScreenRatio",e=>1/e.screenToPCSRatio)):R.main.add(S`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
151
+ float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),R.main.add(S`float segmentLengthScreenDouble = length(segment);
154
152
  float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
155
153
  float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);
156
154
  float segmentLengthRender = length(mix(nextPosition - position, position - prevPosition, isEndVertex));
157
- vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),R?F.main.add(h`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
158
- float startPseudoScreen = u0 * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):F.main.add(h`float startPseudoScreen = mix(u0, u0 - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
159
- float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),F.uniforms.add(new g("stipplePatternPixelSize",e=>r(e))),F.main.add(h`float patternLength = lineSize * stipplePatternPixelSize;
155
+ vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),T?R.main.add(S`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
156
+ float startPseudoScreen = u0 * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):R.main.add(S`float startPseudoScreen = mix(u0, u0 - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
157
+ float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),R.uniforms.add(new h("stipplePatternPixelSize",e=>r(e))),R.main.add(S`float patternLength = lineSize * stipplePatternPixelSize;
160
158
  vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
161
159
  vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex);
162
160
  if (segmentLengthScreenDouble >= 0.001) {
@@ -164,60 +162,62 @@ vec2 stippleDisplacement = pos.xy - segmentOrigin;
164
162
  float stippleDisplacementFactor = dot(segment, stippleDisplacement) / (segmentLengthScreenDouble * segmentLengthScreenDouble);
165
163
  vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x);
166
164
  }
167
- vStippleDistanceLimits *= pos.w;
168
- vStippleDistance *= pos.w;
165
+ vStippleDistanceLimits = noPerspectiveWrite(vStippleDistanceLimits, pos.w);
166
+ vStippleDistance = noPerspectiveWrite(vStippleDistance, pos.w);
169
167
  vStippleDistanceLimits = isJoin ?
170
168
  vStippleDistanceLimits :
171
169
  isStartVertex ?
172
170
  vec2(-1e34, vStippleDistanceLimits.y) :
173
- vec2(vStippleDistanceLimits.x, 1e34);`)),F.main.add(h`
171
+ vec2(vStippleDistanceLimits.x, 1e34);`)),R.main.add(S`
174
172
  // Convert back into NDC
175
173
  pos.xy = (pos.xy / viewport.zw) * pos.w;
176
174
 
177
175
  vColor = getColor();
178
- vColor.a *= coverage;
176
+ vColor.a = noPerspectiveWrite(vColor.a * coverage, pos.w);
179
177
 
180
- ${_&&!R?"pos.z -= 0.001 * pos.w;":""}
178
+ ${$&&!T?"pos.z -= 0.001 * pos.w;":""}
181
179
 
182
180
  // transform final position to camera space for slicing
183
181
  vpos = (inverseProjectionMatrix * pos).xyz;
184
182
  gl_Position = pos;
185
183
  forwardObjectAndLayerIdColor();
186
- }`),j.fragment.include(e,y),j.include(x,y),z.include(l),z.main.add(h`discardBySlice(vpos);
187
- discardByTerrainDepth();`),_?z.main.add(h`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(B&&z.main.add(h`
188
- float sdf = min(vSegmentSDF, vReverseSegmentSDF);
189
- vec2 fragmentPosition = vec2(
190
- min(sdf, 0.0),
191
- vLineDistance
192
- ) * gl_FragCoord.w;
184
+ }`),C.fragment.include(e,j),C.include(w,j),F.include(l),F.main.add(S`discardBySlice(vpos);
185
+ discardByTerrainDepth();`),C.include(p),F.main.add(S`
186
+ float lineWidth = noPerspectiveRead(vLineWidth);
187
+ float lineDistance = noPerspectiveRead(vLineDistance);
188
+ ${x(U,S`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
189
+ `),$?F.main.add(S`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(I&&F.main.add(S`
190
+ float sdf = noPerspectiveRead(min(vSegmentSDF, vReverseSegmentSDF));
191
+ vec2 fragmentPosition = vec2(min(sdf, 0.0), lineDistance);
193
192
 
194
193
  float fragmentRadius = length(fragmentPosition);
195
- float fragmentCapSDF = (fragmentRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
194
+ float fragmentCapSDF = (fragmentRadius - lineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
196
195
  float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
197
196
 
198
- if (capCoverage < ${h.float(w)}) {
197
+ if (capCoverage < ${S.float(P)}) {
199
198
  discard;
200
199
  }
201
- `),I?z.main.add(h`
200
+ `),J?F.main.add(S`
202
201
  vec2 stipplePosition = vec2(
203
202
  min(getStippleSDF() * 2.0 - 1.0, 0.0),
204
- vLineDistanceNorm * gl_FragCoord.w
203
+ lineDistanceNorm
205
204
  );
206
- float stippleRadius = length(stipplePosition * vLineWidth);
207
- float stippleCapSDF = (stippleRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
205
+ float stippleRadius = length(stipplePosition * lineWidth);
206
+ float stippleCapSDF = (stippleRadius - lineWidth) * 0.5; // Divide by 2 to transform from double pixel scale
208
207
  float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
209
- float stippleAlpha = step(${h.float(w)}, stippleCoverage);
210
- `):z.main.add(h`float stippleAlpha = getStippleAlpha();`),10!==W&&z.main.add(h`discardByStippleAlpha(stippleAlpha, ${h.float(w)});`),z.uniforms.add(new v("intrinsicColor",e=>e.color)).main.add(h`vec4 color = intrinsicColor * vColor;`),M&&z.uniforms.add(new v("innerColor",e=>e.innerColor??e.color),new g("innerWidth",(e,i)=>e.innerWidth*i.camera.pixelRatio)).main.add(h`float distToInner = abs(vLineDistance * gl_FragCoord.w) - innerWidth;
208
+ float stippleAlpha = step(${S.float(P)}, stippleCoverage);
209
+ `):F.main.add(S`float stippleAlpha = getStippleAlpha(lineWidth);`),10!==V&&F.main.add(S`discardByStippleAlpha(stippleAlpha, ${S.float(P)});`),C.include(p),F.uniforms.add(new g("intrinsicColor",e=>e.color)).main.add(S`vec4 color = intrinsicColor * vColor;
210
+ color.a = noPerspectiveRead(color.a);`),_&&F.uniforms.add(new g("innerColor",e=>e.innerColor??e.color),new h("innerWidth",(e,i)=>e.innerWidth*i.camera.pixelRatio)).main.add(S`float distToInner = abs(lineDistance) - innerWidth;
211
211
  float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
212
212
  float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
213
- color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),z.main.add(h`vec4 finalColor = blendStipple(color, stippleAlpha);`),E&&(z.uniforms.add(new g("falloff",e=>e.falloff)),z.main.add(h`finalColor.a *= pow(max(0.0, 1.0 - abs(vLineDistanceNorm * gl_FragCoord.w)), falloff);`)),T||z.main.add(h`float featherStartDistance = max(vLineWidth - 2.0, 0.0);
214
- float value = abs(vLineDistance) * gl_FragCoord.w;
215
- float feather = (value - featherStartDistance) / (vLineWidth - featherStartDistance);
216
- finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`),N&&z.main.add(h`
213
+ color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),F.main.add(S`vec4 finalColor = blendStipple(color, stippleAlpha);`),M&&(F.uniforms.add(new h("falloff",e=>e.falloff)),F.main.add(S`finalColor.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),O||F.main.add(S`float featherStartDistance = max(lineWidth - 2.0, 0.0);
214
+ float value = abs(lineDistance);
215
+ float feather = (value - featherStartDistance) / (lineWidth - featherStartDistance);
216
+ finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`),k&&F.main.add(S`
217
217
  finalColor = animate(finalColor);
218
218
 
219
- ${D(10!==W,h`
220
- if (finalColor.a <= ${h.float(w)}) {
219
+ ${x(10!==V,S`
220
+ if (finalColor.a <= ${S.float(P)}) {
221
221
  discard;
222
222
  }`)}
223
- `)),z.main.add(h`outputColorHighlightOID(finalColor, vpos, finalColor.rgb);`),j}const j=Object.freeze(Object.defineProperty({__proto__:null,build:y,ribbonlineNumRoundJoinSubdivisions:b},Symbol.toStringTag,{value:"Module"}));export{j as R,y as b,b as r};
223
+ `)),F.main.add(S`outputColorHighlightOID(finalColor, vpos, finalColor.rgb);`),C}const C=Object.freeze(Object.defineProperty({__proto__:null,build:j,ribbonlineNumRoundJoinSubdivisions:y},Symbol.toStringTag,{value:"Module"}));export{C as R,j as b,y as r};
package/chunks/array.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{deepClone as n}from"../arcade/deepClone.js";import{ArcadeExecutionError as t}from"../arcade/executionError.js";import r from"../arcade/ImmutableArray.js";import{B as e,J as o,j as i,s as u,v as a,n as s,u as c,x as l,i as f,M as d}from"./languageUtils.js";import{isPromiseLike as h}from"../core/promiseUtils.js";import{isArray as w,isBoolean as g,isInteger as m}from"../support/guards.js";function F(F){function p(n,e,o){if(n instanceof r)return n.toArray();if(w(n))return n;throw new t(e,"InvalidParameter",o)}function y(n,t){const r=n.length,e=Math.floor(r/2);return 0===r?[]:1===r?[n[0]]:v(y(n.slice(0,e),t),y(n.slice(e,r),t),t)}function v(n,t,r){const e=[];for(;n.length>0||t.length>0;)if(n.length>0&&t.length>0){let o=r(n[0],t[0]);isNaN(o)&&(o=0),o<=0?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1))}else n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}async function P(n,t){const r=n.length,e=Math.floor(r/2);if(0===r)return[];if(1===r)return[n[0]];const o=[await P(n.slice(0,e),t),await P(n.slice(e,r),t)];return I(o[0],o[1],t,[])}async function I(n,t,r,e){const o=e;if(n.length>0||t.length>0){if(n.length>0&&t.length>0){let i=await r(n[0],t[0]);return isNaN(i)&&(i=1),i<=0?(o.push(n[0]),n=n.slice(1)):(o.push(t[0]),t=t.slice(1)),I(n,t,r,e)}return n.length>0?(o.push(n[0]),I(n=n.slice(1),t,r,e)):(o.push(t[0]),I(n,t=t.slice(1),r,e))}return e}function N(n,r,o,u){e(o,1,2,n,r);let s=o[0];if(i(s)&&(s=s.toArray()),!1===w(s))throw new t(n,"InvalidParameter",r);if(o.length>1){if(!1===f(o[1]))throw new t(n,"InvalidParameter",r);let e=s;const i=o[1].createFunction(n);return u?P(e,i):(e=y(e,(n,t)=>i(n,t)),e)}let l=s;if(0===l.length)return[];const h={};for(let t=0;t<l.length;t++){const n=d(l[t]);""!==n&&(h[n]=!0)}if(!0===h.Array||!0===h.Dictionary||!0===h.Feature||!0===h.Voxel||!0===h.Point||!0===h.Polygon||!0===h.Polyline||!0===h.Multipoint||!0===h.Extent||!0===h.Function)return l.slice();let g=0,m="";for(const t in h)g++,m=t;return l=g>1||"String"===m?y(l,(n,t)=>{if(null==n||n===a)return null==t||t===a?0:1;if(null==t||t===a)return-1;const r=c(n),e=c(t);return r<e?-1:r===e?0:1}):"Number"===m?y(l,(n,t)=>n-t):"Boolean"===m?y(l,(n,t)=>n===t?0:t?-1:1):"Date"===m?y(l,(n,t)=>n.toNumber()-t.toNumber()):l.slice(),l}F.functions.array=function(r,a){return F.standardFunction(r,a,(s,c,l)=>{if(e(l,0,2,r,a),0===l.length)return[];if(1===l.length&&null===l[0])return[];if(w(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].slice()}if(i(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].toArray().slice()}const f=u(l[0]);if(isNaN(f)||!1===m(f))throw new t(r,"InvalidParameter",a);const d=o(l[1],null),h=new Array(f);return h.fill(d),h})},F.functions.front=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(0)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][0]}throw new t(n,"InvalidParameter",r)})},F.functions.back=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(a[0].length()-1)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][a[0].length-1]}throw new t(n,"InvalidParameter",r)})},F.functions.push=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,2,n,r),w(u[0]))return u[0][u[0].length]=u[1],u[0].length;throw new t(n,"InvalidParameter",r)})},F.functions.pop=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,1,n,r),w(u[0])){if(u[0].length<=0)throw new t(n,"OutOfBounds",r);const e=u[0][u[0].length-1];return u[0].length=u[0].length-1,e}throw new t(n,"InvalidParameter",r)})},F.functions.erase=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,2,2,n,r),w(l[0])){let e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[0];if(o.length<=0)throw new t(n,"OutOfBounds",r);if(e<0&&(e=o.length+e),e<0)throw new t(n,"OutOfBounds",r);if(e>=o.length)throw new t(n,"OutOfBounds",r);return o.splice(e,1),a}if(s(l[0]))return l[0].eraseField(c(l[1])),a;throw new t(n,"InvalidParameter",r)})},F.functions.insert=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,3,3,n,r),w(l[0])){const e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[2],i=l[0];if(e>i.length)throw new t(n,"OutOfBounds",r);if(e<0&&e<-1*i.length)throw new t(n,"OutOfBounds",r);return e===i.length?(i[e]=o,a):(i.splice(e,0,o),a)}if(s(l[0]))return l[0].setField(c(l[1]),l[2]),a;throw new t(n,"InvalidParameter",r)})},F.functions.getkeys=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].keys();throw new t(n,"InvalidParameter",r)})},F.functions.getvalues=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].values();throw new t(n,"InvalidParameter",r)})},F.functions.resize=function(n,r){return F.standardFunction(n,r,(i,s,c)=>{if(e(c,2,3,n,r),w(c[0])){const e=u(c[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(e<0)throw new t(n,"InvalidParameter",r);const i=o(c[2],null),s=c[0];if(s.length>=e)return s.length=e,a;const l=s.length;s.length=e;for(let n=l;n<s.length;n++)s[n]=i;return a}throw new t(n,"InvalidParameter",r)})},F.functions.includes=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,2,2,n,r),w(a[0])){const n=a[1];return!!a[0].some(t=>l(t,n))}if(i(a[0])){const n=a[1];return!!a[0].toArray().some(t=>l(t,n))}throw new t(n,"InvalidParameter",r)})},F.functions.slice=function(n,r){return F.standardFunction(n,r,(a,s,c)=>{if(e(c,1,3,n,r),w(c[0])){const e=u(o(c[1],0)),i=u(o(c[2],c[0].length));if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);return c[0].slice(e,i)}if(i(c[0])){const e=c[0],i=u(o(c[1],0)),a=u(o(c[2],e.length()));if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);if(isNaN(a)||!1===m(a))throw new t(n,"InvalidParameter",r);return e.toArray().slice(i,a)}throw new t(n,"InvalidParameter",r)})},F.functions.splice=function(n,t){return F.standardFunction(n,t,(n,t,r)=>{const e=[];for(let o=0;o<r.length;o++)w(r[o])?e.push(...r[o]):i(r[o])?e.push(...r[o].toArray()):e.push(r[o]);return e})},F.functions.top=function(n,r){return F.standardFunction(n,r,(o,a,s)=>{if(e(s,2,2,n,r),w(s[0]))return u(s[1])>=s[0].length?s[0].slice():s[0].slice(0,u(s[1]));if(i(s[0]))return u(s[1])>=s[0].length()?s[0].slice():s[0].slice(0,u(s[1]));throw new t(n,"InvalidParameter",r)})},F.functions.first=function(n,t){return F.standardFunction(n,t,(r,o,u)=>(e(u,1,1,n,t),w(u[0])?0===u[0].length?null:u[0][0]:i(u[0])?0===u[0].length()?null:u[0].get(0):null))},"sync"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunction(n,t,(t,r,e)=>N(n,r,e,!1))},F.functions.any=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=i(n);if(g(t)&&!0===t)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0!==i(n))return!1}return!0})},F.functions.none=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0===i(n))return!1}return!0})},F.functions.reduce=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,3,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);return 2===o.length?0===u.length?null:u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null}):u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null},o[2])})},F.functions.map=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=i(n);void 0!==t&&t!==a?s.push(t):s.push(null)}return s})},F.functions.filter=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){!0===i(n)&&a.push(n)}return a})}),"async"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,e)=>N(n,r,e,!0))},F.functions.any=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,g(r)&&!0===r)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0!==r)return!1}return!0})},F.functions.none=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0===r)return!1}return!0})},F.functions.filter=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,!0===r&&a.push(n)}return a})},F.functions.reduce=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,i)=>{e(i,2,3,n,r);const u=i[1].createFunction(n),s=p(i[0],n,r);let c;if(i.length>2){const n=o(i[2],null);c=s.reduce(async(n,t)=>{let r=await n;return void 0!==r&&r!==a||(r=null),u(r,t)},Promise.resolve(n))}else{if(0===s.length)return null;c=s.reduce(async(n,t,r)=>{if(r<=1)return u(n,t);let e=await n;return void 0!==e&&e!==a||(e=null),u(e,t)})}return c.then(n=>void 0!==n&&n!==a?n:null)})},F.functions.map=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,void 0!==r&&r!==a?s.push(r):s.push(null)}return s})})}const p=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:F},Symbol.toStringTag,{value:"Module"}));export{p as A,F as r};
5
+ import{deepClone as n}from"../arcade/deepClone.js";import{ArcadeExecutionError as t}from"../arcade/executionError.js";import r from"../arcade/ImmutableArray.js";import{B as e,J as o,j as i,s as u,v as a,n as s,u as c,x as l,i as f,M as d}from"./languageUtils.js";import{isPromiseLike as h}from"../core/promiseUtils.js";import{isArray as w,isBoolean as g,isInteger as m}from"../support/guards.js";function F(F){function p(n,e,o){if(n instanceof r)return n.toArray();if(w(n))return n;throw new t(e,"InvalidParameter",o)}function y(n,t){const r=n.length,e=Math.floor(r/2);return 0===r?[]:1===r?[n[0]]:v(y(n.slice(0,e),t),y(n.slice(e,r),t),t)}function v(n,t,r){const e=[];for(;n.length>0||t.length>0;)if(n.length>0&&t.length>0){let o=r(n[0],t[0]);isNaN(o)&&(o=0),o<=0?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1))}else n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}async function P(n,t){const r=n.length,e=Math.floor(r/2);if(0===r)return[];if(1===r)return[n[0]];const o=[await P(n.slice(0,e),t),await P(n.slice(e,r),t)];return I(o[0],o[1],t,[])}async function I(n,t,r,e){const o=e;if(n.length>0||t.length>0){if(n.length>0&&t.length>0){let i=await r(n[0],t[0]);return isNaN(i)&&(i=1),i<=0?(o.push(n[0]),n=n.slice(1)):(o.push(t[0]),t=t.slice(1)),I(n,t,r,e)}return n.length>0?(o.push(n[0]),I(n=n.slice(1),t,r,e)):(o.push(t[0]),I(n,t=t.slice(1),r,e))}return e}function N(n,r,o,u){e(o,1,2,n,r);let s=o[0];if(i(s)&&(s=s.toArray()),!1===w(s))throw new t(n,"InvalidParameter",r);if(o.length>1){if(!1===f(o[1]))throw new t(n,"InvalidParameter",r);let e=s;const i=o[1].createFunction(n);return u?P(e,i):(e=y(e,(n,t)=>i(n,t)),e)}let l=s;if(0===l.length)return[];const h={};for(let t=0;t<l.length;t++){const n=d(l[t]);""!==n&&(h[n]=!0)}if(!0===h.Array||!0===h.Dictionary||!0===h.Feature||!0===h.Voxel||!0===h.Pixel||!0===h.Point||!0===h.Polygon||!0===h.Polyline||!0===h.Multipoint||!0===h.Extent||!0===h.Function)return l.slice();let g=0,m="";for(const t in h)g++,m=t;return l=g>1||"String"===m?y(l,(n,t)=>{if(null==n||n===a)return null==t||t===a?0:1;if(null==t||t===a)return-1;const r=c(n),e=c(t);return r<e?-1:r===e?0:1}):"Number"===m?y(l,(n,t)=>n-t):"Boolean"===m?y(l,(n,t)=>n===t?0:t?-1:1):"Date"===m?y(l,(n,t)=>n.toNumber()-t.toNumber()):l.slice(),l}F.functions.array=function(r,a){return F.standardFunction(r,a,(s,c,l)=>{if(e(l,0,2,r,a),0===l.length)return[];if(1===l.length&&null===l[0])return[];if(w(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].slice()}if(i(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].toArray().slice()}const f=u(l[0]);if(isNaN(f)||!1===m(f))throw new t(r,"InvalidParameter",a);const d=o(l[1],null),h=new Array(f);return h.fill(d),h})},F.functions.front=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(0)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][0]}throw new t(n,"InvalidParameter",r)})},F.functions.back=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(a[0].length()-1)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][a[0].length-1]}throw new t(n,"InvalidParameter",r)})},F.functions.push=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,2,n,r),w(u[0]))return u[0][u[0].length]=u[1],u[0].length;throw new t(n,"InvalidParameter",r)})},F.functions.pop=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,1,n,r),w(u[0])){if(u[0].length<=0)throw new t(n,"OutOfBounds",r);const e=u[0][u[0].length-1];return u[0].length=u[0].length-1,e}throw new t(n,"InvalidParameter",r)})},F.functions.erase=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,2,2,n,r),w(l[0])){let e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[0];if(o.length<=0)throw new t(n,"OutOfBounds",r);if(e<0&&(e=o.length+e),e<0)throw new t(n,"OutOfBounds",r);if(e>=o.length)throw new t(n,"OutOfBounds",r);return o.splice(e,1),a}if(s(l[0]))return l[0].eraseField(c(l[1])),a;throw new t(n,"InvalidParameter",r)})},F.functions.insert=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,3,3,n,r),w(l[0])){const e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[2],i=l[0];if(e>i.length)throw new t(n,"OutOfBounds",r);if(e<0&&e<-1*i.length)throw new t(n,"OutOfBounds",r);return e===i.length?(i[e]=o,a):(i.splice(e,0,o),a)}if(s(l[0]))return l[0].setField(c(l[1]),l[2]),a;throw new t(n,"InvalidParameter",r)})},F.functions.getkeys=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].keys();throw new t(n,"InvalidParameter",r)})},F.functions.getvalues=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].values();throw new t(n,"InvalidParameter",r)})},F.functions.resize=function(n,r){return F.standardFunction(n,r,(i,s,c)=>{if(e(c,2,3,n,r),w(c[0])){const e=u(c[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(e<0)throw new t(n,"InvalidParameter",r);const i=o(c[2],null),s=c[0];if(s.length>=e)return s.length=e,a;const l=s.length;s.length=e;for(let n=l;n<s.length;n++)s[n]=i;return a}throw new t(n,"InvalidParameter",r)})},F.functions.includes=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,2,2,n,r),w(a[0])){const n=a[1];return!!a[0].some(t=>l(t,n))}if(i(a[0])){const n=a[1];return!!a[0].toArray().some(t=>l(t,n))}throw new t(n,"InvalidParameter",r)})},F.functions.slice=function(n,r){return F.standardFunction(n,r,(a,s,c)=>{if(e(c,1,3,n,r),w(c[0])){const e=u(o(c[1],0)),i=u(o(c[2],c[0].length));if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);return c[0].slice(e,i)}if(i(c[0])){const e=c[0],i=u(o(c[1],0)),a=u(o(c[2],e.length()));if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);if(isNaN(a)||!1===m(a))throw new t(n,"InvalidParameter",r);return e.toArray().slice(i,a)}throw new t(n,"InvalidParameter",r)})},F.functions.splice=function(n,t){return F.standardFunction(n,t,(n,t,r)=>{const e=[];for(let o=0;o<r.length;o++)w(r[o])?e.push(...r[o]):i(r[o])?e.push(...r[o].toArray()):e.push(r[o]);return e})},F.functions.top=function(n,r){return F.standardFunction(n,r,(o,a,s)=>{if(e(s,2,2,n,r),w(s[0]))return u(s[1])>=s[0].length?s[0].slice():s[0].slice(0,u(s[1]));if(i(s[0]))return u(s[1])>=s[0].length()?s[0].slice():s[0].slice(0,u(s[1]));throw new t(n,"InvalidParameter",r)})},F.functions.first=function(n,t){return F.standardFunction(n,t,(r,o,u)=>(e(u,1,1,n,t),w(u[0])?0===u[0].length?null:u[0][0]:i(u[0])?0===u[0].length()?null:u[0].get(0):null))},"sync"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunction(n,t,(t,r,e)=>N(n,r,e,!1))},F.functions.any=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=i(n);if(g(t)&&!0===t)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0!==i(n))return!1}return!0})},F.functions.none=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0===i(n))return!1}return!0})},F.functions.reduce=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,3,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);return 2===o.length?0===u.length?null:u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null}):u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null},o[2])})},F.functions.map=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=i(n);void 0!==t&&t!==a?s.push(t):s.push(null)}return s})},F.functions.filter=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){!0===i(n)&&a.push(n)}return a})}),"async"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,e)=>N(n,r,e,!0))},F.functions.any=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,g(r)&&!0===r)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0!==r)return!1}return!0})},F.functions.none=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0===r)return!1}return!0})},F.functions.filter=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,!0===r&&a.push(n)}return a})},F.functions.reduce=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,i)=>{e(i,2,3,n,r);const u=i[1].createFunction(n),s=p(i[0],n,r);let c;if(i.length>2){const n=o(i[2],null);c=s.reduce(async(n,t)=>{let r=await n;return void 0!==r&&r!==a||(r=null),u(r,t)},Promise.resolve(n))}else{if(0===s.length)return null;c=s.reduce(async(n,t,r)=>{if(r<=1)return u(n,t);let e=await n;return void 0!==e&&e!==a||(e=null),u(e,t)})}return c.then(n=>void 0!==n&&n!==a?n:null)})},F.functions.map=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,void 0!==r&&r!==a?s.push(r):s.push(null)}return s})})}const p=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:F},Symbol.toStringTag,{value:"Module"}));export{p as A,F as r};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../config.js";import{version as t}from"../kernel.js";import{ArcadeDate as n,createDateTimeZone as r}from"../arcade/ArcadeDate.js";import{ArcadeModule as i}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as o}from"../arcade/executionError.js";import{ArcadeFunction as a}from"../arcade/FunctionWrapper.js";import u from"../arcade/ImmutableArray.js";import s from"../arcade/ImmutablePathArray.js";import l from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as f,layerGeometryEsriRestConstants as c}from"../arcade/featureset/support/shared.js";import{format as m,parse as d}from"../core/number.js";import{DateOnly as y}from"../core/sql/DateOnly.js";import{TimeOnly as p}from"../core/sql/TimeOnly.js";import g from"../geometry/Extent.js";import h from"../geometry/Geometry.js";import b from"../geometry/Multipoint.js";import N from"../geometry/Point.js";import S from"../geometry/Polygon.js";import Z from"../geometry/Polyline.js";import T from"../geometry/SpatialReference.js";import{isClockwise as A}from"../geometry/support/coordsUtils.js";import{fromJSON as k}from"../geometry/support/jsonUtils.js";import{getLocale as j}from"../intl/locale.js";import{isBoolean as D,isNumber as O,isString as C,isArray as x,isDate as F,isGraphic as w,isInteger as J}from"../support/guards.js";import{DateTime as M}from"luxon";class R{constructor(e){this.value=e}}class v{constructor(e){this.value=e}}const _={type:"VOID"},I=Symbol("BREAK"),P=Symbol("CONTINUE");function Y(e,t,n){return""===t||null==t||t===n||t===n?e:e=e.split(t).join(n)}function L(e){return e instanceof a}function G(e){return e instanceof i}function V(e){return!!C(e)||(!!O(e)||(!!te(e)||(!!ne(e)||(!!re(e)||(!!D(e)||(null===e||(e===_||"number"==typeof e)))))))}function z(e,t){return void 0===e?t:e}function q(e){return null==e?"":x(e)||ee(e)?"Array":te(e)?"Date":re(e)?"Time":ne(e)?"DateOnly":C(e)?"String":D(e)?"Boolean":O(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":X(e)?"KnowledgeGraph":e instanceof i?"Module":H(e)?"Feature":e instanceof N?"Point":e instanceof S?"Polygon":e instanceof Z?"Polyline":e instanceof b?"Multipoint":e instanceof g?"Extent":L(e)?"Function":$(e)?"FeatureSet":Q(e)?"FeatureSetCollection":W(e)?"Voxel":e===_?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function E(e){return e===_}function U(e){return e instanceof h}function H(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function W(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function $(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function B(e){return"esri.arcade.Dictionary"===e?.declaredClass}function K(e){return B(e)||H(e)||W(e)}function Q(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function X(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function ee(e){return e instanceof u}function te(e){return e instanceof n}function ne(e){return e instanceof y}function re(e){return e instanceof p}function ie(e){return null!=e&&"object"==typeof e}function oe(e,t,n,r,i){if(e.length<t||e.length>n)throw new o(r,"WrongNumberOfParameters",i)}function ae(e){return e<0?-Math.round(-e):Math.round(e)}function ue(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=Y(t,"‰",""),t=Y(t,"¤",""),m(e,{pattern:t}))}function se(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(le(t),{locale:j(),numberingSystem:"latn"})}function le(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let n="";const r=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(r)||[])switch(i){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?n+=`'${i.slice(1,-1)}'`:n+=`'${i}'`}return n}function fe(e,t,n){switch(n){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function ce(e,t,r){if(null===e){if(null===t||t===_)return fe(null,null,r);if(O(t))return fe(0,t,r);if(C(t))return fe(0,be(t),r);if(D(t))return fe(0,be(t),r);if(te(t))return fe(0,t.toNumber(),r);if(re(t))return fe(e,t.toNumber(),r);if(ne(t))return fe(e,t.toNumber(),r)}if(e===_){if(null===t||t===_)return fe(null,null,r);if(O(t))return fe(0,t,r);if(C(t))return fe(0,be(t),r);if(D(t))return fe(0,be(t),r);if(te(t))return fe(0,t.toNumber(),r);if(re(t))return fe(e,t.toNumber(),r);if(ne(t))return fe(e,t.toNumber(),r)}else if(O(e)){if(O(t))return fe(e,t,r);if(D(t))return fe(e,be(t),r);if(null===t||t===_)return fe(e,0,r);if(C(t))return fe(e,be(t),r);if(te(t))return fe(e,t.toNumber(),r);if(re(t))return fe(e,t.toNumber(),r);if(ne(t))return fe(e,t.toNumber(),r)}else if(C(e)){if(C(t))return fe(ye(e),ye(t),r);if(te(t))return fe(be(e),t.toNumber(),r);if(re(t))return fe(be(e),t.toNumber(),r);if(ne(t))return fe(be(e),t.toNumber(),r);if(O(t))return fe(be(e),t,r);if(null===t||t===_)return fe(be(e),0,r);if(D(t))return fe(be(e),be(t),r)}else if(te(e)){if(te(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=n.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=n.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),fe(e.toNumber(),t.toNumber(),r);if(null===t||t===_)return fe(e.toNumber(),0,r);if(O(t))return fe(e.toNumber(),t,r);if(D(t))return fe(e.toNumber(),be(t),r);if(C(t))return fe(e.toNumber(),be(t),r);if(re(t))throw new o(null,"CannotCompareDateAndTime",null);if(ne(t))return fe(e.toNumber(),t.toNumber(),r)}else if(D(e)){if(D(t))return fe(e,t,r);if(O(t))return fe(be(e),be(t),r);if(te(t))return fe(be(e),t.toNumber(),r);if(re(t))return fe(be(e),t.toNumber(),r);if(ne(t))return fe(be(e),t.toNumber(),r);if(null===t||t===_)return fe(be(e),0,r);if(C(t))return fe(be(e),be(t),r)}else if(ne(e)){if(te(t))return fe(e.toNumber(),t.toNumber(),r);if(null===t||t===_)return fe(e.toNumber(),0,r);if(O(t))return fe(e.toNumber(),t,r);if(D(t))return fe(e.toNumber(),be(t),r);if(C(t))return fe(e.toNumber(),be(t),r);if(re(t))throw new o(null,"CannotCompareDateAndTime",null);if(ne(t))return fe(e.toNumber(),t.toNumber(),r)}else if(re(e)){if(te(t))throw new o(null,"CannotCompareDateAndTime",null);if(null===t||t===_)return fe(e.toNumber(),0,r);if(O(t))return fe(e.toNumber(),t,r);if(D(t))return fe(e.toNumber(),be(t),r);if(C(t))return fe(e.toNumber(),be(t),r);if(re(t))return fe(e.toNumber(),t.toNumber(),r);if(ne(t))throw new o(null,"CannotCompareDateAndTime",null)}return!!me(e,t)&&("<="===r||">="===r)}function me(e,t){if(e===t)return!0;if(null===e&&t===_||null===t&&e===_)return!0;if(te(e)&&te(t))return e.equals(t);if(re(e)&&re(t))return e.equals(t);if(ne(e)&&ne(t))return e.equals(t);if(e instanceof s)return e.equalityTest(t);if(e instanceof l)return e.equalityTest(t);if(e instanceof N&&t instanceof N){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(null!=n)return n===r}if(ie(e)&&ie(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function de(e,{useNumbersForDates:t}){let n="";for(const r in e){""!==n&&(n+=",");const i=e[r];null==i?n+=JSON.stringify(r)+":null":D(i)||O(i)||C(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):U(i)?n+=JSON.stringify(r)+":"+ge(i):re(i)||ne(i)?n+=`${JSON.stringify(r)}:${JSON.stringify(i.toString())}`:ee(i)||Array.isArray(i)?n+=JSON.stringify(r)+":"+ge(i,null,t):te(i)?n+=t?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(n+=JSON.stringify(r)+":"+i.castToText(t))}return"{"+n+"}"}function ye(e,t){if(C(e))return e;if(null===e)return"";if(O(e))return ue(e,t);if(D(e))return e.toString();if(te(e))return se(e,t);if(re(e))return e.toFormat(t);if(ne(e))return e.toFormat(t);if(e instanceof h)return JSON.stringify(e.toJSON());if(x(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=he(e[n]);return"["+t.join(",")+"]"}if(e instanceof u){const t=[];for(let n=0;n<e.length();n++)t[n]=he(e.get(n));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():L(e)?"object, Function":e===_?"":G(e)?"object, Module":""}function pe(e){const t=[];if(e instanceof u){for(let n=0;n<e.length();n++)t[n]=be(e.get(n));return t}if(!x(e))return null;for(let n=0;n<e.length;n++)t[n]=be(e[n]);return t}function ge(e,t,n=!1){if(C(e))return e;if(null===e)return"";if(O(e))return ue(e,t);if(D(e))return e.toString();if(te(e))return se(e,t);if(re(e))return e.toFormat(t);if(ne(e))return e.toFormat(t);if(e instanceof h)return e instanceof g?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+xe(e.spatialReference)+"}":xe(e.toJSON(),(e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0);if(x(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=he(e[r],n);return"["+t.join(",")+"]"}if(e instanceof u){const t=[];for(let r=0;r<e.length();r++)t[r]=he(e.get(r),n);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(n):L(e)?"object, Function":e===_?"":G(e)?"object, Module":""}function he(e,t=!1){if(null===e)return"null";if(D(e)||C(e))return JSON.stringify(e);if(O(e))return e.toString();if(e instanceof h)return ge(e,null,t);if(e instanceof u)return ge(e,null,t);if(Array.isArray(e))return ge(e,null,t);if(te(e))return t?JSON.stringify(e.getTime()):JSON.stringify(se(e,""));if(re(e))return JSON.stringify(e.toString());if(ne(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===_)return"null";return"null"}function be(e,t){return O(e)?e:null===e||""===e?0:te(e)||ne(e)||re(e)?NaN:D(e)?e?1:0:x(e)||""===e||void 0===e?NaN:void 0!==t&&C(e)?(t=Y(t,"‰",""),t=Y(t,"¤",""),d(e,{pattern:t})):e===_?0:Number(e)}function Ne(e,t){if(te(e))return e;if(C(e)){const r=Se(e,t);if(r)return n.dateTimeToArcadeDate(r)}return null}function Se(e,t){const n=/ (\d\d)/,i=r(t);let o=M.fromISO(e,{zone:i});return o.isValid||n.test(e)&&(e=e.replace(n,"T$1"),o=M.fromISO(e,{zone:t}),o.isValid)?o:null}function Ze(e){return D(e)?e:C(e)?"true"===(e=e.toLowerCase()):!!O(e)&&(0!==e&&!isNaN(e))}function Te(e,t){const n=JSON.parse(e);return n&&!n.spatialReference&&(n.spatialReference=t),k(n)}function Ae(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function ke(e){if(null===e)return null;if(e instanceof N)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof S){if(0===(e.curveRings??e.rings).length)return null;for(const t of e.curveRings??e.rings)if(t.length>0)return e;return null}if(e instanceof Z){if(0===(e.curvePaths??e.paths).length)return null;for(const t of e.curvePaths??e.paths)if(t.length>0)return e;return null}return e instanceof b?0===e.points.length?null:e:e instanceof g?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function je(e,t){if(!e)return t;if(!e.domain)return t;let n=null,r=null;if(te(t))n=t.toNumber();else if(ne(t))n=t.toString();else if(re(t))n=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)n=ye(t);else{if(null==t)return null;if(""===t)return t;n=be(t)}for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.code===n&&(r=t)}return null===r?ye(t):r.name}function De(e,t){if(!e)return t;if(!e.domain)return t;let n=null;const r=ye(t);for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.name===r&&(n=t)}return null===n?t:n.code}function Oe(e,t,n=null,r=null){if(!t)return null;if(!t.fields)return null;let i,a,u=null;for(let o=0;o<t.fields.length;o++){const n=t.fields[o];n.name.toLowerCase()===e.toString().toLowerCase()&&(u=n)}if(null===u)throw new o(null,"FieldNotFound",null,{key:e});let s=t.typeIdField,l="id",f=t.types;if(t.subtypeField&&(s=t.subtypeField,l="code",f=t.subtypes??[]),null===r&&n&&s)r=n.hasField(s)?n.field(s):null;else if(s&&null!==r){let e=!1;for(const t of f||[])if(r===t[l]){e=!0;break}if(!e)for(const t of f||[])if(r===t.name){r=t[l],e=!0;break}e||(r=null,n&&s&&(r=n.hasField(s)?n.field(s):null))}return null!=r&&f.some(e=>e[l]===r&&(i=e.domains?.[u.name],i&&"inherited"===i.type&&(i=Ce(u.name,t),a=!0),!0)),a||i||(i=Ce(e,t)),{field:u,domain:i}}function Ce(e,t){let n;return t.fields.some(t=>(t.name.toLowerCase()===e.toLowerCase()&&(n=t.domain),!!n)),n}function xe(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(i=t.cmp,function(e){return function(t,n){const r={key:t,value:e[t]},o={key:n,value:e[n]};return i(r,o)}});var i;const o=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,a;if(Array.isArray(t)){for(a="[",i=0;i<t.length;i++)i&&(a+=","),a+=e(t[i])||"null";return a+"]"}if(null===t)return"null";if(o.includes(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const u=o.push(t)-1,s=Object.keys(t).sort(r?.(t));for(a="",i=0;i<s.length;i++){const n=s[i],r=e(t[n]);r&&(a&&(a+=","),a+=JSON.stringify(n)+":"+r)}return o.splice(u,1),"{"+a+"}"}(e)}function Fe(e){if(null===e)return null;const t=[];for(const n of e)H(n)?t.push(n.geometry()):t.push(n);return t}function we(e,t){if(!(t instanceof N))throw new o(null,"InvalidParameter",null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function Je(e,t){if(x(e)||ee(e)){let n=!1,r=!1,i=[],a=t;if(x(e)){for(const t of e)we(i,t);i.length>0&&(a=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof l)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,a=e.get(0).spatialReference);else{if(!ee(e))throw new o(null,"InvalidParameter",null);for(const t of e.toArray())we(i,t);i.length>0&&(a=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}if(0===i.length)return null;return A(i)||(i=i.slice().reverse()),new S({rings:[i],spatialReference:a,hasZ:n,hasM:r})}return e}function Me(e,t){if(x(e)||ee(e)){let n=!1,r=!1,i=[],o=t;if(x(e)){for(const t of e)we(i,t);i.length>0&&(o=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof l)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())we(i,t);i.length>0&&(o=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new Z({paths:[i],spatialReference:o,hasZ:n,hasM:r})}return e}function Re(e,t){if(x(e)||ee(e)){let n=!1,r=!1,i=[],o=t;if(x(e)){for(const t of e)we(i,t);i.length>0&&(o=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof l)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(ee(e)){for(const t of e.toArray())we(i,t);i.length>0&&(o=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new b({points:i,spatialReference:o,hasZ:n,hasM:r})}return e}function ve(e,t=!0){if(null==e)return[];if(x(e)){const n=[];for(const r of e){const e=ye(r);(t||""!==e)&&n.push(e)}return n}if(ee(e)){const n=[];for(let r=0;r<e.length();r++){const i=ye(e.get(r));(t||""!==i)&&n.push(i)}return n}if(V(e)){const n=ye(e);if(t||""!==n)return[n]}return[]}let _e=0;function Ie(e){return _e++,_e%100==0?(_e=0,new Promise(t=>{setTimeout(()=>{t(e)},0)})):e}function Pe(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Ye(e,t=null){return null==e?null:D(e)||O(e)||C(e)?e:e instanceof h?!0===t?.keepGeometryType?e:e.toJSON():e instanceof u?e.toArray().map(e=>Ye(e,t)):Array.isArray(e)?e.map(e=>Ye(e,t)):F(e)?e:te(e)?e.toJSDate():re(e)?e.toString():ne(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Le(e,t,n,r,i){const o=await Ge(e,t,n);i[r]=o}async function Ge(e,t=null,n=null){if(e instanceof u&&(e=e.toArray()),null==e)return null;if(V(e)||e instanceof h||F(e)||te(e))return Ye(e,n);if(Array.isArray(e)){const r=[],i=[];for(const o of e)null===o||V(o)||o instanceof h||F(o)||te(o)?i.push(Ye(o,n)):(i.push(null),r.push(Le(o,t,n,i.length-1,i)));return r.length>0&&await Promise.all(r),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,n):null}function Ve(e){return ze(e)?e.parent:e}function ze(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function qe(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Ee(e,t,n){const r=Ve(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return Oe(t,r,e,n)}function Ue(e){const t=Ve(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(e=>({name:e.name,code:e.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(e=>({name:e.name,code:e.id})):[]}:null:null}function He(e,t,n,r){const i=Ve(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const o=Oe(t,i,e,r);if(void 0===n)try{n=e.field(t)}catch(a){return null}return je(o,n)}function We(e,t,n,r){const i=Ve(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===n){try{n=e.field(t)}catch(o){return null}return n}return De(Oe(t,i,e,r),n)}function $e(e){return e?.timeZone??"system"}function Be(e){const t=Ve(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const n=[];for(const r of t.fields)n.push(f(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===c[t.geometryType]?"":c[t.geometryType],fields:n}}function Ke(r,i){const o=n.systemTimeZoneCanonicalName;return"system"===r&&(r=o),{version:Qe,engineVersion:t,timeZone:r,userTimeZone:o,spatialReference:i instanceof T?i.toJSON():i,application:e.applicationName??"",engine:"web",locale:j()}}const Qe="1.32",Xe=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:v,ReturnResult:R,absRound:ae,arcadeVersion:Qe,autoCastArrayOfPointsToMultiPoint:Re,autoCastArrayOfPointsToPolygon:Je,autoCastArrayOfPointsToPolyline:Me,autoCastFeatureToGeometry:Fe,binaryOperator:Pe,breakResult:I,castAsJson:Ye,castAsJsonAsync:Ge,castRecordToText:de,continueResult:P,defaultExecutingContext:Ke,defaultTimeZone:$e,defaultUndefined:z,equalityTest:me,featureDomainCodeLookup:We,featureDomainValueLookup:He,featureFullDomain:Ee,featureSchema:Be,featureSubtypes:Ue,fixNullGeometry:ke,fixSpatialReference:Ae,formatDate:se,formatNumber:ue,getDomain:Oe,getDomainCode:De,getDomainValue:je,getType:q,greaterThanLessThan:ce,isArray:x,isBoolean:D,isDate:te,isDateOnly:ne,isDictionary:B,isDictionaryLike:K,isFeature:H,isFeatureSet:$,isFeatureSetCollection:Q,isFunctionParameter:L,isGeometry:U,isGraphic:w,isImmutableArray:ee,isInteger:J,isJsDate:F,isKnowledgeGraph:X,isModule:G,isNumber:O,isObject:ie,isSimpleType:V,isString:C,isSubtypeGrouplayer:qe,isSubtypeSublayer:ze,isTime:re,isVoid:E,isVoxel:W,multiReplace:Y,parseGeometryFromJson:Te,pcCheck:oe,stableStringify:xe,standardiseDateFormat:le,tick:Ie,toBoolean:Ze,toDate:Ne,toNumber:be,toNumberArray:pe,toString:ye,toStringArray:ve,toStringExplicit:ge,voidOperation:_},Symbol.toStringTag,{value:"Module"}));export{ze as $,P as A,oe as B,Fe as C,Ae as D,Je as E,Me as F,Re as G,Ze as H,v as I,z as J,$e as K,ve as L,q as M,Ne as N,le as O,ae as P,Ee as Q,R,We as S,He as T,Be as U,Ue as V,ke as W,W as X,Y,Ke as Z,pe as _,Ye as a,Ie as a0,Oe as a1,je as a2,De as a3,G as a4,ie as a5,ue as a6,se as a7,Te as a8,xe as a9,qe as aa,Qe as ab,Ge as b,de as c,V as d,te as e,ne as f,re as g,U as h,L as i,ee as j,H as k,Q as l,$ as m,B as n,X as o,Xe as p,E as q,K as r,be as s,ge as t,ye as u,_ as v,ce as w,me as x,Pe as y,I as z};
5
+ import e from"../config.js";import{version as t}from"../kernel.js";import{ArcadeDate as n,createDateTimeZone as r}from"../arcade/ArcadeDate.js";import{ArcadeModule as i}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as a}from"../arcade/executionError.js";import{ArcadeFunction as o}from"../arcade/FunctionWrapper.js";import u from"../arcade/ImmutableArray.js";import s from"../arcade/ImmutablePathArray.js";import l from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as f,layerGeometryEsriRestConstants as c}from"../arcade/featureset/support/shared.js";import{format as m,parse as d}from"../core/number.js";import{DateOnly as y}from"../core/sql/DateOnly.js";import{TimeOnly as p}from"../core/sql/TimeOnly.js";import g from"../geometry/Extent.js";import h from"../geometry/Geometry.js";import b from"../geometry/Multipoint.js";import N from"../geometry/Point.js";import S from"../geometry/Polygon.js";import Z from"../geometry/Polyline.js";import T from"../geometry/SpatialReference.js";import{isClockwise as A}from"../geometry/support/coordsUtils.js";import{fromJSON as k}from"../geometry/support/jsonUtils.js";import{getLocale as D}from"../intl/locale.js";import{isBoolean as j,isNumber as x,isString as O,isArray as C,isDate as F,isGraphic as w,isInteger as J}from"../support/guards.js";import{DateTime as M}from"luxon";class R{constructor(e){this.value=e}}class v{constructor(e){this.value=e}}const P={type:"VOID"},_=Symbol("BREAK"),I=Symbol("CONTINUE");function Y(e,t,n){return""===t||null==t||t===n||t===n?e:e=e.split(t).join(n)}function L(e){return e instanceof o}function G(e){return e instanceof i}function V(e){return!!O(e)||(!!x(e)||(!!ne(e)||(!!re(e)||(!!ie(e)||(!!j(e)||(null===e||e===P))))))}function z(e,t){return void 0===e?t:e}function q(e){return null==e?"":C(e)||te(e)?"Array":ne(e)?"Date":ie(e)?"Time":re(e)?"DateOnly":O(e)?"String":j(e)?"Boolean":x(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":ee(e)?"KnowledgeGraph":e instanceof i?"Module":H(e)?"Feature":e instanceof N?"Point":e instanceof S?"Polygon":e instanceof Z?"Polyline":e instanceof b?"Multipoint":e instanceof g?"Extent":L(e)?"Function":B(e)?"FeatureSet":X(e)?"FeatureSetCollection":W(e)?"Voxel":$(e)?"Pixel":e===P?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function E(e){return e===P}function U(e){return e instanceof h}function H(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function W(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function $(e){return"esri.arcade.Pixel"===e?.arcadeDeclaredClass}function B(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function K(e){return"esri.arcade.Dictionary"===e?.declaredClass}function Q(e){return K(e)||H(e)||W(e)||$(e)}function X(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function ee(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function te(e){return e instanceof u}function ne(e){return e instanceof n}function re(e){return e instanceof y}function ie(e){return e instanceof p}function ae(e){return null!=e&&"object"==typeof e}function oe(e,t,n,r,i){if(e.length<t||e.length>n)throw new a(r,"WrongNumberOfParameters",i)}function ue(e){return e<0?-Math.round(-e):Math.round(e)}function se(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=Y(t,"‰",""),t=Y(t,"¤",""),m(e,{pattern:t}))}function le(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(fe(t),{locale:D(),numberingSystem:"latn"})}function fe(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let n="";const r=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(r)||[])switch(i){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?n+=`'${i.slice(1,-1)}'`:n+=`'${i}'`}return n}function ce(e,t,n){switch(n){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function me(e,t,r){if(null===e){if(null===t||t===P)return ce(null,null,r);if(x(t))return ce(0,t,r);if(O(t))return ce(0,Ne(t),r);if(j(t))return ce(0,Ne(t),r);if(ne(t))return ce(0,t.toNumber(),r);if(ie(t))return ce(e,t.toNumber(),r);if(re(t))return ce(e,t.toNumber(),r)}if(e===P){if(null===t||t===P)return ce(null,null,r);if(x(t))return ce(0,t,r);if(O(t))return ce(0,Ne(t),r);if(j(t))return ce(0,Ne(t),r);if(ne(t))return ce(0,t.toNumber(),r);if(ie(t))return ce(e,t.toNumber(),r);if(re(t))return ce(e,t.toNumber(),r)}else if(x(e)){if(x(t))return ce(e,t,r);if(j(t))return ce(e,Ne(t),r);if(null===t||t===P)return ce(e,0,r);if(O(t))return ce(e,Ne(t),r);if(ne(t))return ce(e,t.toNumber(),r);if(ie(t))return ce(e,t.toNumber(),r);if(re(t))return ce(e,t.toNumber(),r)}else if(O(e)){if(O(t))return ce(pe(e),pe(t),r);if(ne(t))return ce(Ne(e),t.toNumber(),r);if(ie(t))return ce(Ne(e),t.toNumber(),r);if(re(t))return ce(Ne(e),t.toNumber(),r);if(x(t))return ce(Ne(e),t,r);if(null===t||t===P)return ce(Ne(e),0,r);if(j(t))return ce(Ne(e),Ne(t),r)}else if(ne(e)){if(ne(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=n.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=n.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),ce(e.toNumber(),t.toNumber(),r);if(null===t||t===P)return ce(e.toNumber(),0,r);if(x(t))return ce(e.toNumber(),t,r);if(j(t))return ce(e.toNumber(),Ne(t),r);if(O(t))return ce(e.toNumber(),Ne(t),r);if(ie(t))throw new a(null,"CannotCompareDateAndTime",null);if(re(t))return ce(e.toNumber(),t.toNumber(),r)}else if(j(e)){if(j(t))return ce(e,t,r);if(x(t))return ce(Ne(e),Ne(t),r);if(ne(t))return ce(Ne(e),t.toNumber(),r);if(ie(t))return ce(Ne(e),t.toNumber(),r);if(re(t))return ce(Ne(e),t.toNumber(),r);if(null===t||t===P)return ce(Ne(e),0,r);if(O(t))return ce(Ne(e),Ne(t),r)}else if(re(e)){if(ne(t))return ce(e.toNumber(),t.toNumber(),r);if(null===t||t===P)return ce(e.toNumber(),0,r);if(x(t))return ce(e.toNumber(),t,r);if(j(t))return ce(e.toNumber(),Ne(t),r);if(O(t))return ce(e.toNumber(),Ne(t),r);if(ie(t))throw new a(null,"CannotCompareDateAndTime",null);if(re(t))return ce(e.toNumber(),t.toNumber(),r)}else if(ie(e)){if(ne(t))throw new a(null,"CannotCompareDateAndTime",null);if(null===t||t===P)return ce(e.toNumber(),0,r);if(x(t))return ce(e.toNumber(),t,r);if(j(t))return ce(e.toNumber(),Ne(t),r);if(O(t))return ce(e.toNumber(),Ne(t),r);if(ie(t))return ce(e.toNumber(),t.toNumber(),r);if(re(t))throw new a(null,"CannotCompareDateAndTime",null)}return!!de(e,t)&&("<="===r||">="===r)}function de(e,t){if(e===t)return!0;if(null===e&&t===P||null===t&&e===P)return!0;if(ne(e)&&ne(t))return e.equals(t);if(ie(e)&&ie(t))return e.equals(t);if(re(e)&&re(t))return e.equals(t);if(e instanceof s)return e.equalityTest(t);if(e instanceof l)return e.equalityTest(t);if(e instanceof N&&t instanceof N){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(null!=n)return n===r}if(ae(e)&&ae(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function ye(e,{useNumbersForDates:t}){let n="";for(const r in e){""!==n&&(n+=",");const i=e[r];null==i?n+=JSON.stringify(r)+":null":j(i)||x(i)||O(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):U(i)?n+=JSON.stringify(r)+":"+he(i):ie(i)||re(i)?n+=`${JSON.stringify(r)}:${JSON.stringify(i.toString())}`:te(i)||Array.isArray(i)?n+=JSON.stringify(r)+":"+he(i,null,t):ne(i)?n+=t?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(n+=JSON.stringify(r)+":"+i.castToText(t))}return"{"+n+"}"}function pe(e,t){if(O(e))return e;if(null===e)return"";if(x(e))return se(e,t);if(j(e))return e.toString();if(ne(e))return le(e,t);if(ie(e))return e.toFormat(t);if(re(e))return e.toFormat(t);if(e instanceof h)return JSON.stringify(e.toJSON());if(C(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=be(e[n]);return"["+t.join(",")+"]"}if(e instanceof u){const t=[];for(let n=0;n<e.length();n++)t[n]=be(e.get(n));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():L(e)?"object, Function":e===P?"":G(e)?"object, Module":""}function ge(e){const t=[];if(e instanceof u){for(let n=0;n<e.length();n++)t[n]=Ne(e.get(n));return t}if(!C(e))return null;for(let n=0;n<e.length;n++)t[n]=Ne(e[n]);return t}function he(e,t,n=!1){if(O(e))return e;if(null===e)return"";if(x(e))return se(e,t);if(j(e))return e.toString();if(ne(e))return le(e,t);if(ie(e))return e.toFormat(t);if(re(e))return e.toFormat(t);if(e instanceof h)return e instanceof g?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+Fe(e.spatialReference)+"}":Fe(e.toJSON(),(e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0);if(C(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=be(e[r],n);return"["+t.join(",")+"]"}if(e instanceof u){const t=[];for(let r=0;r<e.length();r++)t[r]=be(e.get(r),n);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(n):L(e)?"object, Function":e===P?"":G(e)?"object, Module":""}function be(e,t=!1){if(null===e)return"null";if(j(e)||O(e))return JSON.stringify(e);if(x(e))return e.toString();if(e instanceof h)return he(e,null,t);if(e instanceof u)return he(e,null,t);if(Array.isArray(e))return he(e,null,t);if(ne(e))return t?JSON.stringify(e.getTime()):JSON.stringify(le(e,""));if(ie(e))return JSON.stringify(e.toString());if(re(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===P)return"null";return"null"}function Ne(e,t){return x(e)?e:null===e||""===e?0:ne(e)||re(e)||ie(e)?NaN:j(e)?e?1:0:C(e)||""===e||void 0===e?NaN:void 0!==t&&O(e)?(t=Y(t,"‰",""),t=Y(t,"¤",""),d(e,{pattern:t})):e===P?0:Number(e)}function Se(e,t){if(ne(e))return e;if(O(e)){const r=Ze(e,t);if(r)return n.dateTimeToArcadeDate(r)}return null}function Ze(e,t){const n=/ (\d\d)/,i=r(t);let a=M.fromISO(e,{zone:i});return a.isValid||n.test(e)&&(e=e.replace(n,"T$1"),a=M.fromISO(e,{zone:t}),a.isValid)?a:null}function Te(e){return j(e)?e:O(e)?"true"===(e=e.toLowerCase()):!!x(e)&&(0!==e&&!isNaN(e))}function Ae(e,t){const n=JSON.parse(e);return n&&!n.spatialReference&&(n.spatialReference=t),k(n)}function ke(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function De(e){if(null===e)return null;if(e instanceof N)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof S){if(0===(e.curveRings??e.rings).length)return null;for(const t of e.curveRings??e.rings)if(t.length>0)return e;return null}if(e instanceof Z){if(0===(e.curvePaths??e.paths).length)return null;for(const t of e.curvePaths??e.paths)if(t.length>0)return e;return null}return e instanceof b?0===e.points.length?null:e:e instanceof g?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function je(e,t){if(!e)return t;if(!e.domain)return t;let n=null,r=null;if(ne(t))n=t.toNumber();else if(re(t))n=t.toString();else if(ie(t))n=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)n=pe(t);else{if(null==t)return null;if(""===t)return t;n=Ne(t)}for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.code===n&&(r=t)}return null===r?pe(t):r.name}function xe(e,t){if(!e)return t;if(!e.domain)return t;let n=null;const r=pe(t);for(let i=0;i<e.domain.codedValues.length;i++){const t=e.domain.codedValues[i];t.name===r&&(n=t)}return null===n?t:n.code}function Oe(e,t,n=null,r=null){if(!t)return null;if(!t.fields)return null;let i,o,u=null;for(let a=0;a<t.fields.length;a++){const n=t.fields[a];n.name.toLowerCase()===e.toString().toLowerCase()&&(u=n)}if(null===u)throw new a(null,"FieldNotFound",null,{key:e});let s=t.typeIdField,l="id",f=t.types;if(t.subtypeField&&(s=t.subtypeField,l="code",f=t.subtypes??[]),null===r&&n&&s)r=n.hasField(s)?n.field(s):null;else if(s&&null!==r){let e=!1;for(const t of f||[])if(r===t[l]){e=!0;break}if(!e)for(const t of f||[])if(r===t.name){r=t[l],e=!0;break}e||(r=null,n&&s&&(r=n.hasField(s)?n.field(s):null))}return null!=r&&f.some(e=>e[l]===r&&(i=e.domains?.[u.name],i&&"inherited"===i.type&&(i=Ce(u.name,t),o=!0),!0)),o||i||(i=Ce(e,t)),{field:u,domain:i}}function Ce(e,t){let n;return t.fields.some(t=>(t.name.toLowerCase()===e.toLowerCase()&&(n=t.domain),!!n)),n}function Fe(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(i=t.cmp,function(e){return function(t,n){const r={key:t,value:e[t]},a={key:n,value:e[n]};return i(r,a)}});var i;const a=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(a.includes(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const u=a.push(t)-1,s=Object.keys(t).sort(r?.(t));for(o="",i=0;i<s.length;i++){const n=s[i],r=e(t[n]);r&&(o&&(o+=","),o+=JSON.stringify(n)+":"+r)}return a.splice(u,1),"{"+o+"}"}(e)}function we(e){if(null===e)return null;const t=[];for(const n of e)H(n)?t.push(n.geometry()):t.push(n);return t}function Je(e,t){if(!(t instanceof N))throw new a(null,"InvalidParameter",null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function Me(e,t){if(C(e)||te(e)){let n=!1,r=!1,i=[],o=t;if(C(e)){for(const t of e)Je(i,t);i.length>0&&(o=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof l)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else{if(!te(e))throw new a(null,"InvalidParameter",null);for(const t of e.toArray())Je(i,t);i.length>0&&(o=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}if(0===i.length)return null;return A(i)||(i=i.slice().reverse()),new S({rings:[i],spatialReference:o,hasZ:n,hasM:r})}return e}function Re(e,t){if(C(e)||te(e)){let n=!1,r=!1,i=[],a=t;if(C(e)){for(const t of e)Je(i,t);i.length>0&&(a=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof l)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,a=e.get(0).spatialReference);else if(te(e)){for(const t of e.toArray())Je(i,t);i.length>0&&(a=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new Z({paths:[i],spatialReference:a,hasZ:n,hasM:r})}return e}function ve(e,t){if(C(e)||te(e)){let n=!1,r=!1,i=[],a=t;if(C(e)){for(const t of e)Je(i,t);i.length>0&&(a=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof l)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,a=e.get(0).spatialReference);else if(te(e)){for(const t of e.toArray())Je(i,t);i.length>0&&(a=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new b({points:i,spatialReference:a,hasZ:n,hasM:r})}return e}function Pe(e,t=!0){if(null==e)return[];if(C(e)){const n=[];for(const r of e){const e=pe(r);(t||""!==e)&&n.push(e)}return n}if(te(e)){const n=[];for(let r=0;r<e.length();r++){const i=pe(e.get(r));(t||""!==i)&&n.push(i)}return n}if(V(e)){const n=pe(e);if(t||""!==n)return[n]}return[]}let _e=0;function Ie(e){return _e++,_e%100==0?(_e=0,new Promise(t=>{setTimeout(()=>{t(e)},0)})):e}function Ye(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function Le(e,t=null){return null==e?null:j(e)||x(e)||O(e)?e:e instanceof h?!0===t?.keepGeometryType?e:e.toJSON():e instanceof u?e.toArray().map(e=>Le(e,t)):Array.isArray(e)?e.map(e=>Le(e,t)):F(e)?e:ne(e)?e.toJSDate():ie(e)?e.toString():re(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ge(e,t,n,r,i){const a=await Ve(e,t,n);i[r]=a}async function Ve(e,t=null,n=null){if(e instanceof u&&(e=e.toArray()),null==e)return null;if(V(e)||e instanceof h||F(e)||ne(e))return Le(e,n);if(Array.isArray(e)){const r=[],i=[];for(const a of e)null===a||V(a)||a instanceof h||F(a)||ne(a)?i.push(Le(a,n)):(i.push(null),r.push(Ge(a,t,n,i.length-1,i)));return r.length>0&&await Promise.all(r),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,n):null}function ze(e){return qe(e)?e.parent:e}function qe(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function Ee(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Ue(e,t,n){const r=ze(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return Oe(t,r,e,n)}function He(e){const t=ze(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(e=>({name:e.name,code:e.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(e=>({name:e.name,code:e.id})):[]}:null:null}function We(e,t,n,r){const i=ze(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const a=Oe(t,i,e,r);if(void 0===n)try{n=e.field(t)}catch(o){return null}return je(a,n)}function $e(e,t,n,r){const i=ze(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===n){try{n=e.field(t)}catch(a){return null}return n}return xe(Oe(t,i,e,r),n)}function Be(e){return e?.timeZone??"system"}function Ke(e){const t=ze(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const n=[];for(const r of t.fields)n.push(f(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===c[t.geometryType]?"":c[t.geometryType],fields:n}}function Qe(r,i){const a=n.systemTimeZoneCanonicalName;return"system"===r&&(r=a),{version:Xe,engineVersion:t,timeZone:r,userTimeZone:a,spatialReference:i instanceof T?i.toJSON():i,application:e.applicationName??"",engine:"web",locale:D()}}const Xe="1.32",et=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:v,ReturnResult:R,absRound:ue,arcadeVersion:Xe,autoCastArrayOfPointsToMultiPoint:ve,autoCastArrayOfPointsToPolygon:Me,autoCastArrayOfPointsToPolyline:Re,autoCastFeatureToGeometry:we,binaryOperator:Ye,breakResult:_,castAsJson:Le,castAsJsonAsync:Ve,castRecordToText:ye,continueResult:I,defaultExecutingContext:Qe,defaultTimeZone:Be,defaultUndefined:z,equalityTest:de,featureDomainCodeLookup:$e,featureDomainValueLookup:We,featureFullDomain:Ue,featureSchema:Ke,featureSubtypes:He,fixNullGeometry:De,fixSpatialReference:ke,formatDate:le,formatNumber:se,getDomain:Oe,getDomainCode:xe,getDomainValue:je,getType:q,greaterThanLessThan:me,isArray:C,isBoolean:j,isDate:ne,isDateOnly:re,isDictionary:K,isDictionaryLike:Q,isFeature:H,isFeatureSet:B,isFeatureSetCollection:X,isFunctionParameter:L,isGeometry:U,isGraphic:w,isImmutableArray:te,isInteger:J,isJsDate:F,isKnowledgeGraph:ee,isModule:G,isNumber:x,isObject:ae,isPixel:$,isSimpleType:V,isString:O,isSubtypeGrouplayer:Ee,isSubtypeSublayer:qe,isTime:ie,isVoid:E,isVoxel:W,multiReplace:Y,parseGeometryFromJson:Ae,pcCheck:oe,stableStringify:Fe,standardiseDateFormat:fe,tick:Ie,toBoolean:Te,toDate:Se,toNumber:Ne,toNumberArray:ge,toString:pe,toStringArray:Pe,toStringExplicit:he,voidOperation:P},Symbol.toStringTag,{value:"Module"}));export{ge as $,I as A,oe as B,we as C,ke as D,Me as E,Re as F,ve as G,Te as H,v as I,z as J,Be as K,Pe as L,q as M,Se as N,fe as O,ue as P,Ue as Q,R,$e as S,We as T,Ke as U,He as V,De as W,W as X,$ as Y,Y as Z,Qe as _,Le as a,qe as a0,Ie as a1,Oe as a2,je as a3,xe as a4,G as a5,ae as a6,se as a7,le as a8,Ae as a9,Fe as aa,Ee as ab,Xe as ac,Ve as b,ye as c,V as d,ne as e,re as f,ie as g,U as h,L as i,te as j,H as k,X as l,B as m,K as n,ee as o,et as p,E as q,Q as r,Ne as s,he as t,pe as u,P as v,me as w,de as x,Ye as y,_ as z};
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/4.34/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="4.34.0-next.74";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="4.34.0-next.75";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalDegrees as t}from"./Cyclical.js";import{toUnit as r}from"./quantityUtils.js";import{formatAngleDegrees as e,formatDecimal as a,formatMetricLength as n,formatImperialLength as i,formatImperialVerticalLength as u,formatMetricVerticalLength as c,formatMetricArea as o,formatImperialArea as l,formatRelativeDecimal as f,formatMetricRelativeLength as m,formatMetricRelativeVerticalLength as b,formatImperialRelativeLength as s,formatImperialRelativeVerticalLength as v,formatDMS as p,formatRelativeAngleDegrees as h}from"./unitFormatUtils.js";function g(t,e,n,i=2,u="abbr"){return a(t,r(e,n).value,n,i,u)}function L(t,e,a,n=2,i="abbr"){return f(t,r(e,a).value,a,n,i)}function d(t,r,e=2,a="abbr"){return n(t,r.value,r.unit,e,a)}function M(t,r,e=2,a="abbr"){return m(t,r.value,r.unit,e,a)}function w(t,r,e=2,a="abbr"){return c(t,r.value,r.unit,e,a)}function I(t,r,e=2,a="abbr"){return b(t,r.value,r.unit,e,a)}function R(t,r,e=2,a="abbr"){return o(t,r.value,r.unit,e,a)}function y(t,r,e=2,a="abbr"){return i(t,r.value,r.unit,e,a)}function V(t,r,e=2,a="abbr"){return s(t,r.value,r.unit,e,a)}function j(t,r,e=2,a="abbr"){return u(t,r.value,r.unit,e,a)}function D(t,r,e=2,a="abbr"){return v(t,r.value,r.unit,e,a)}function A(t,r,e=2,a="abbr"){return l(t,r.value,r.unit,e,a)}function T(t){return p(t.value,t.unit)}function U(r,a,n,i=t,u=!0){return e(r.value,r.unit,r.rotationType,a,n,i,u)}function q(t,r,e){return h(t.value,t.unit,t.rotationType,r,e??void 0)}function x(t,r,e,a,n="abbr"){switch(a=a??2,e){case"imperial":return y(t,r,a,n);case"metric":return d(t,r,a,n);default:return g(t,r,e,a,n)}}function C(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return V(t,r,a,n);case"metric":return M(t,r,a,n);default:return L(t,r,e,a,n)}}function F(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return j(t,r,a,n);case"metric":return w(t,r,a,n);default:return g(t,r,e,a,n)}}function S(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return D(t,r,a,n);case"metric":return I(t,r,a,n);default:return L(t,r,e,a,n)}}function k(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return A(t,r,a,n);case"metric":return R(t,r,a,n);default:return g(t,r,e,a,n)}}export{U as formatAngle,k as formatArea,T as formatDMS,g as formatDecimal,A as formatImperialArea,y as formatImperialLength,V as formatImperialRelativeLength,D as formatImperialRelativeVerticalLength,j as formatImperialVerticalLength,x as formatLength,R as formatMetricArea,d as formatMetricLength,M as formatMetricRelativeLength,I as formatMetricRelativeVerticalLength,w as formatMetricVerticalLength,q as formatRelativeAngle,L as formatRelativeDecimal,C as formatRelativeLength,S as formatRelativeVerticalLength,F as formatVerticalLength};
5
+ import{cyclicalDegrees as r}from"./Cyclical.js";import{toUnit as t}from"./quantityUtils.js";import{formatAngleDegrees as e,formatDecimal as a,formatMetricLength as n,formatImperialLength as u,formatImperialVerticalLength as i,formatMetricVerticalLength as c,formatMetricArea as o,formatImperialArea as l,formatMetricVolume as f,formatImperialVolume as m,formatRelativeDecimal as b,formatMetricRelativeLength as s,formatMetricRelativeVerticalLength as v,formatImperialRelativeLength as p,formatImperialRelativeVerticalLength as h,formatDMS as g,formatRelativeAngleDegrees as L}from"./unitFormatUtils.js";function d(r,e,n,u=2,i="abbr"){return a(r,t(e,n).value,n,u,i)}function M(r,e,a,n=2,u="abbr"){return b(r,t(e,a).value,a,n,u)}function w(r,t,e=2,a="abbr"){return n(r,t.value,t.unit,e,a)}function I(r,t,e=2,a="abbr"){return s(r,t.value,t.unit,e,a)}function V(r,t,e=2,a="abbr"){return c(r,t.value,t.unit,e,a)}function R(r,t,e=2,a="abbr"){return v(r,t.value,t.unit,e,a)}function y(r,t,e=2,a="abbr"){return o(r,t.value,t.unit,e,a)}function j(r,t,e=2,a="abbr"){return f(r,t.value,t.unit,e,a)}function D(r,t,e=2,a="abbr"){return u(r,t.value,t.unit,e,a)}function A(r,t,e=2,a="abbr"){return p(r,t.value,t.unit,e,a)}function T(r,t,e=2,a="abbr"){return i(r,t.value,t.unit,e,a)}function U(r,t,e=2,a="abbr"){return h(r,t.value,t.unit,e,a)}function q(r,t,e=2,a="abbr"){return l(r,t.value,t.unit,e,a)}function x(r,t,e=2,a="abbr"){return m(r,t.value,t.unit,e,a)}function C(r){return g(r.value,r.unit)}function F(t,a,n,u=r,i=!0){return e(t.value,t.unit,t.rotationType,a,n,u,i)}function S(r,t,e){return L(r.value,r.unit,r.rotationType,t,e??void 0)}function k(r,t,e,a,n="abbr"){switch(a=a??2,e){case"imperial":return D(r,t,a,n);case"metric":return w(r,t,a,n);default:return d(r,t,e,a,n)}}function z(r,t,e,a=2,n="abbr"){switch(e){case"imperial":return A(r,t,a,n);case"metric":return I(r,t,a,n);default:return M(r,t,e,a,n)}}function B(r,t,e,a=2,n="abbr"){switch(e){case"imperial":return T(r,t,a,n);case"metric":return V(r,t,a,n);default:return d(r,t,e,a,n)}}function E(r,t,e,a=2,n="abbr"){switch(e){case"imperial":return U(r,t,a,n);case"metric":return R(r,t,a,n);default:return M(r,t,e,a,n)}}function G(r,t,e,a=2,n="abbr"){switch(e){case"imperial":return q(r,t,a,n);case"metric":return y(r,t,a,n);default:return d(r,t,e,a,n)}}function H(r,t,e,a=2,n="abbr"){switch(e){case"imperial":return x(r,t,a,n);case"metric":return j(r,t,a,n);default:return d(r,t,e,a,n)}}export{F as formatAngle,G as formatArea,C as formatDMS,d as formatDecimal,q as formatImperialArea,D as formatImperialLength,A as formatImperialRelativeLength,U as formatImperialRelativeVerticalLength,T as formatImperialVerticalLength,x as formatImperialVolume,k as formatLength,y as formatMetricArea,w as formatMetricLength,I as formatMetricRelativeLength,R as formatMetricRelativeVerticalLength,V as formatMetricVerticalLength,j as formatMetricVolume,S as formatRelativeAngle,M as formatRelativeDecimal,z as formatRelativeLength,E as formatRelativeVerticalLength,B as formatVerticalLength,H as formatVolume};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalDegrees as t}from"./Cyclical.js";import{clamp as n}from"./mathUtils.js";import{convertRotationType as i}from"./quantityUtils.js";import{replace as r}from"./string.js";import{convertUnit as o,adaptiveMetricLengthUnit as e,adaptiveImperialLengthUnit as u,adaptiveImperialVerticalLengthUnit as s,adaptiveMetricVerticalLengthUnit as c,adaptiveImperialAreaUnit as a,adaptiveMetricAreaUnit as m}from"./unitUtils.js";import{formatNumber as f}from"../intl/number.js";function l(t,n,i){return t.units[n][i]}function b(t,n,i,r=2,o="abbr"){return`${f(n,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:n>0?"never":"exceptZero"})} ${l(t,i,o)}`}function g(t,n,i,r=2,o="abbr"){return`${f(n,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:"exceptZero"})} ${l(t,i,o)}`}function p(t,n,i,r=2,u="abbr"){const s=e(n,i);return b(t,o(n,i,s),s,r,u)}function D(t,n,i,r=2,u="abbr"){const s=e(n,i);return g(t,o(n,i,s),s,r,u)}function x(t,n,i,r=2,e="abbr"){const u=c(n,i);return b(t,o(n,i,u),u,r,e)}function F(t,n,i,r=2,e="abbr"){const u=c(n,i);return g(t,o(n,i,u),u,r,e)}function y(t,n,i,r=2,e="abbr"){const s=u(n,i);return b(t,o(n,i,s),s,r,e)}function d(t,n,i,r=2,e="abbr"){const s=u(n,i);return g(t,o(n,i,s),s,r,e)}function h(t,n,i,r=2,e="abbr"){const u=s(n,i);return b(t,o(n,i,u),u,r,e)}function M(t,n,i,r=2,e="abbr"){const u=s(n,i);return g(t,o(n,i,u),u,r,e)}function $(t,n,i,r=2,e="abbr"){const u=m(n,i);return b(t,o(n,i,u),u,r,e)}function j(t,n,i,r=2,e="abbr"){const u=a(n,i);return b(t,o(n,i,u),u,r,e)}function B(t,n,i=2){let r=o(t,n,"degrees"),e=r-Math.floor(r);r-=e,e*=60;let u=e-Math.floor(e);return e-=u,u*=60,`${r.toFixed()}° ${e.toFixed()}' ${u.toFixed(i)}"`}const w=(t,n)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:n,minimumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"});function U(n,r,e,u,s,c=t,a=!0){let m=c.normalize(i(o(n,r,"degrees"),e,u),0,a);const l=w(m,s??2);return m=v(m,l),f(m,l)}function Z(t,n,i,r,e=2){i!==r&&(t=-t);const u={style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:e,minimumFractionDigits:e,signDisplay:"exceptZero"};let s=o(t,n,"degrees")%360;return s=v(s,u),f(s,u)}const S=new Map;function v(t,n){const i=JSON.stringify(n);let r=S.get(i);return r||(r=new Intl.NumberFormat("en-US",n),S.set(i,r)),/^[-+]?360\.?0*°?$/.test(r.format(t))?0:t}const z=["B","kB","MB","GB","TB"];function N(t,i){let o=0===(i=Math.round(i))?0:Math.floor(Math.log(i)/Math.log(1024));o=n(o,0,z.length-1);const e=f(i/1024**o,{maximumFractionDigits:2});return r(t.units.bytes[z[o]],{fileSize:e})}export{U as formatAngleDegrees,B as formatDMS,b as formatDecimal,N as formatFileSize,j as formatImperialArea,y as formatImperialLength,d as formatImperialRelativeLength,M as formatImperialRelativeVerticalLength,h as formatImperialVerticalLength,$ as formatMetricArea,p as formatMetricLength,D as formatMetricRelativeLength,F as formatMetricRelativeVerticalLength,x as formatMetricVerticalLength,Z as formatRelativeAngleDegrees,g as formatRelativeDecimal,l as unitName};
5
+ import{cyclicalDegrees as t}from"./Cyclical.js";import{clamp as n}from"./mathUtils.js";import{convertRotationType as r}from"./quantityUtils.js";import{replace as i}from"./string.js";import{convertUnit as o,adaptiveMetricLengthUnit as e,adaptiveImperialLengthUnit as u,adaptiveImperialVerticalLengthUnit as s,adaptiveMetricVerticalLengthUnit as c,adaptiveImperialAreaUnit as a,adaptiveMetricAreaUnit as m,adaptiveMetricVolumeUnit as f,adaptiveImperialVolumeUnit as b}from"./unitUtils.js";import{formatNumber as l}from"../intl/number.js";function g(t,n,r){return t.units[n][r]}function p(t,n,r,i=2,o="abbr"){return`${l(n,{minimumFractionDigits:i,maximumFractionDigits:i,signDisplay:n>0?"never":"exceptZero"})} ${g(t,r,o)}`}function D(t,n,r,i=2,o="abbr"){return`${l(n,{minimumFractionDigits:i,maximumFractionDigits:i,signDisplay:"exceptZero"})} ${g(t,r,o)}`}function x(t,n,r,i=2,u="abbr"){const s=e(n,r);return p(t,o(n,r,s),s,i,u)}function F(t,n,r,i=2,u="abbr"){const s=e(n,r);return D(t,o(n,r,s),s,i,u)}function y(t,n,r,i=2,e="abbr"){const u=c(n,r);return p(t,o(n,r,u),u,i,e)}function d(t,n,r,i=2,e="abbr"){const u=c(n,r);return D(t,o(n,r,u),u,i,e)}function h(t,n,r,i=2,e="abbr"){const s=u(n,r);return p(t,o(n,r,s),s,i,e)}function M(t,n,r,i=2,e="abbr"){const s=u(n,r);return D(t,o(n,r,s),s,i,e)}function $(t,n,r,i=2,e="abbr"){const u=s(n,r);return p(t,o(n,r,u),u,i,e)}function j(t,n,r,i=2,e="abbr"){const u=s(n,r);return D(t,o(n,r,u),u,i,e)}function B(t,n,r,i=2,e="abbr"){const u=m(n,r);return p(t,o(n,r,u),u,i,e)}function w(t,n,r,i=2,e="abbr"){const u=a(n,r);return p(t,o(n,r,u),u,i,e)}function U(t,n,r,i=2,e="abbr"){const u=f(n,r);return p(t,o(n,r,u),u,i,e)}function Z(t,n,r,i=2,e="abbr"){const u=b(n,r);return p(t,o(n,r,u),u,i,e)}function S(t,n,r=2){let i=o(t,n,"degrees"),e=i-Math.floor(i);i-=e,e*=60;let u=e-Math.floor(e);return e-=u,u*=60,`${i.toFixed()}° ${e.toFixed()}' ${u.toFixed(r)}"`}const v=(t,n)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:n,minimumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"});function z(n,i,e,u,s,c=t,a=!0){let m=c.normalize(r(o(n,i,"degrees"),e,u),0,a);const f=v(m,s??2);return m=q(m,f),l(m,f)}function N(t,n,r,i,e=2){r!==i&&(t=-t);const u={style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:e,minimumFractionDigits:e,signDisplay:"exceptZero"};let s=o(t,n,"degrees")%360;return s=q(s,u),l(s,u)}const k=new Map;function q(t,n){const r=JSON.stringify(n);let i=k.get(r);return i||(i=new Intl.NumberFormat("en-US",n),k.set(r,i)),/^[-+]?360\.?0*°?$/.test(i.format(t))?0:t}const C=["B","kB","MB","GB","TB"];function G(t,r){let o=0===(r=Math.round(r))?0:Math.floor(Math.log(r)/Math.log(1024));o=n(o,0,C.length-1);const e=l(r/1024**o,{maximumFractionDigits:2});return i(t.units.bytes[C[o]],{fileSize:e})}export{z as formatAngleDegrees,S as formatDMS,p as formatDecimal,G as formatFileSize,w as formatImperialArea,h as formatImperialLength,M as formatImperialRelativeLength,j as formatImperialRelativeVerticalLength,$ as formatImperialVerticalLength,Z as formatImperialVolume,B as formatMetricArea,x as formatMetricLength,F as formatMetricRelativeLength,d as formatMetricRelativeVerticalLength,y as formatMetricVerticalLength,U as formatMetricVolume,N as formatRelativeAngleDegrees,D as formatRelativeDecimal,g as unitName};