@arcgis/core 6.0.0-next.27 → 6.0.0-next.28

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 (119) hide show
  1. package/Map.d.ts +6 -0
  2. package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
  3. package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{0bd04bcd4b2710838d48.js → 03f33cb78b5405ab7e23.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{7c75a8ee266c36baa902.js → 5eec1c1162779574f46e.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{9dd1fc56eb1ea6eb705e.js → 76e27e36050a3dd9d249.js} +1 -1
  8. package/assets/esri/core/workers/chunks/76f877e2d2493d56afab.js +1 -0
  9. package/assets/esri/core/workers/chunks/{00580a68835aac653038.js → 9c4961213ac6ec283dd9.js} +5 -5
  10. package/assets/esri/core/workers/chunks/{13c64087be3b2985a21b.js → dbda982485d3fe26c729.js} +1 -1
  11. package/assets/esri/core/workers/chunks/dc7aa0a1eb6c6e361f9f.js +1 -0
  12. package/chunks/BlendLayers.glsl.js +1 -1
  13. package/chunks/Component.glsl.js +9 -12
  14. package/chunks/GaussianSplat.glsl.js +65 -21
  15. package/chunks/GaussianSplatDepth.glsl.js +45 -4
  16. package/chunks/GaussianSplatShadow.glsl.js +73 -19
  17. package/chunks/GlobalIllumination.glsl.js +2 -17
  18. package/chunks/LineMarker.glsl.js +32 -31
  19. package/chunks/OITAddEmission.glsl.js +1 -1
  20. package/chunks/RasterColorizer.glsl.js +1 -1
  21. package/chunks/RibbonLine.glsl.js +34 -34
  22. package/chunks/Terrain.glsl.js +3 -4
  23. package/chunks/Water.glsl.js +22 -23
  24. package/config.js +1 -1
  25. package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
  26. package/geometry/operators/containsOperator.d.ts +1 -1
  27. package/geometry/operators/densifyOperator.d.ts +1 -1
  28. package/geometry/operators/differenceOperator.d.ts +6 -4
  29. package/geometry/operators/distanceOperator.d.ts +1 -1
  30. package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
  31. package/geometry/operators/graphicBufferOperator.d.ts +6 -6
  32. package/geometry/operators/integrateOperator.d.ts +2 -2
  33. package/geometry/operators/intersectsOperator.d.ts +3 -3
  34. package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
  35. package/geometry/operators/locateBetweenOperator.d.ts +2 -2
  36. package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
  37. package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
  38. package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
  39. package/geometry/operators/projectOperator.d.ts +2 -2
  40. package/geometry/operators/proximityOperator.d.ts +15 -15
  41. package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
  42. package/geometry/operators/simplifyOperator.d.ts +2 -2
  43. package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
  44. package/geometry/operators/support/Transformation.d.ts +8 -8
  45. package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
  46. package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
  47. package/geometry/operators/withinOperator.d.ts +3 -3
  48. package/kernel.js +1 -1
  49. package/layers/GeospatialPDFLayer.d.ts +2 -2
  50. package/layers/ParquetLayer.d.ts +1 -1
  51. package/package.json +2 -2
  52. package/popup/FeaturesModel.js +1 -1
  53. package/popup/support/featureUtils.js +1 -1
  54. package/rest/featureService/FeatureService.d.ts +0 -5
  55. package/rest/networks/support/TraceLocation.d.ts +2 -1
  56. package/rest/networks/support/TraceResult.d.ts +0 -4
  57. package/rest/support/OutDistance.d.ts +0 -1
  58. package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
  59. package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
  60. package/support/BasemapStyle.d.ts +2 -2
  61. package/symbols/cim/types.d.ts +7 -9
  62. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  63. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  64. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  65. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  66. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  67. package/views/3d/analysis/support/projectionUtils.js +1 -1
  68. package/views/3d/environment/SunLighting.d.ts +15 -2
  69. package/views/3d/environment/VirtualLighting.d.ts +15 -2
  70. package/views/3d/input/SceneInputManager.js +1 -1
  71. package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
  72. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  73. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  74. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  75. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  76. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  77. package/views/3d/navigation/Navigation3D.js +1 -1
  78. package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
  79. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  80. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  81. package/views/3d/terrain/BlendLayers.glsl.js +1 -1
  82. package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
  83. package/views/3d/terrain/TileCompositor.js +1 -1
  84. package/views/3d/terrain/TileRenderer.js +1 -1
  85. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
  86. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
  87. package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
  88. package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
  89. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
  90. package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
  91. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
  92. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  93. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  94. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  95. package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
  96. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +61 -108
  97. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  98. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  99. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  100. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  101. package/views/draw/DrawOperation.js +1 -1
  102. package/views/draw/DrawScreenTool.js +1 -1
  103. package/views/input/types.d.ts +2 -4
  104. package/views/interactive/options/LabelOptions.d.ts +5 -5
  105. package/views/interactive/options/SnappingOptions.d.ts +2 -2
  106. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +0 -1
  107. package/widgets/Editor/VisibleElements.d.ts +4 -0
  108. package/widgets/Editor.d.ts +2 -0
  109. package/widgets/FeatureTable.js +1 -1
  110. package/widgets/Features/FeaturesViewModel.js +1 -1
  111. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  112. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
  113. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  114. package/widgets/PanoramicViewer/utils.js +1 -1
  115. package/widgets/Search/LayerSearchSource.d.ts +1 -1
  116. package/widgets/Sketch/VisibleElements.d.ts +4 -0
  117. package/widgets/Sketch.d.ts +2 -0
  118. package/assets/esri/core/workers/chunks/c29091fe157564cffcf7.js +0 -1
  119. package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
@@ -7,7 +7,7 @@ export interface GeographicTransformationStepProperties extends Partial<Pick<Geo
7
7
  /**
8
8
  * Represents a step in the process of transforming coordinates from one geographic coordinate system to another.
9
9
  * A geographic transformation step can be constructed from a
10
- * well-known ID [(wkid)](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/GeographicTransformationStep/#wkid) or a well known text [(wkt)](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/GeographicTransformationStep/#wkt) that represents a geographic datum transformation.
10
+ * well-known ID [(wkid)](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/GeographicTransformationStep/#wkid) or well-known text [(wkt)](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/GeographicTransformationStep/#wkt) that represents a geographic datum transformation.
11
11
  *
12
12
  * @since 5.2
13
13
  * @since 4.32
@@ -34,7 +34,7 @@ export default class GeographicTransformationStep extends GeographicTransformati
34
34
  */
35
35
  accessor isUsable: boolean | null | undefined;
36
36
  /**
37
- * The well-known id (wkid) hat represents a known geographic transformation.
37
+ * The well-known ID (WKID) that represents a known geographic transformation.
38
38
  * See [Geographic datum transformations](https://pro.arcgis.com/en/pro-app/latest/help/mapping/properties/geographic-coordinate-system-transformation.htm)
39
39
  * for the list of supported equation-based geographic transformations.
40
40
  *
@@ -50,7 +50,7 @@ export default class GeographicTransformationStep extends GeographicTransformati
50
50
  *
51
51
  * @example
52
52
  * // Create a geographic transformation step for NAD_1927_To_WGS_1984_1
53
- * // using its well known text or wkt
53
+ * // using its well-known text (WKT)
54
54
  * let wkt = "GEOGTRAN[\"NAD_1927_To_WGS_1984_1\",GEOGCS[\"GCS_North_American_1927\",DATUM[\"D_North_American_1927\",SPHEROID[\"Clarke_1866\",6378206.4,294.9786982]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],METHOD[\"Geocentric_Translation\"],PARAMETER[\"X_Axis_Translation\",-3.0],PARAMETER[\"Y_Axis_Translation\",142.0],PARAMETER[\"Z_Axis_Translation\",183.0]]";
55
55
  *
56
56
  * let geoStep = new GeographicTransformationStep({ wkt });
@@ -37,13 +37,13 @@ export default class Transformation {
37
37
  * @param x1 - The x-coordinate of the second geometry.
38
38
  * @example
39
39
  * // Flip the x-coordinates of a geometry on the vertical axis
40
- * const transform = new Transformation();
41
- * transform.flipX(0, 10);
40
+ * const transformation = new Transformation();
41
+ * transformation.flipX(0, 10);
42
42
  * const result = affineTransformExecute(polygon, transform);
43
43
  *
44
44
  * // Flip the x-coordinates of a geometry on the vertical axis centered at the geometry's center
45
45
  * const centerX = polygon.extent.center.x;
46
- * transform.flipX(centerX, centerX);
46
+ * transformation.flipX(centerX, centerX);
47
47
  * const result = affineTransformExecute(polygon, transform);
48
48
  */
49
49
  flipX(x0: number, x1: number): this;
@@ -62,7 +62,7 @@ export default class Transformation {
62
62
  *
63
63
  * // Flip the y-coordinates of a geometry on the horizontal axis centered at the geometry's center
64
64
  * const centerY = polygon.extent.center.y;
65
- * transform.flipY(centerY, centerY);
65
+ * transformation.flipY(centerY, centerY);
66
66
  * const result = affineTransformExecute(polygon, transform);
67
67
  */
68
68
  flipY(y0: number, y1: number): this;
@@ -107,7 +107,7 @@ export default class Transformation {
107
107
  * @example
108
108
  * // Rotate a geometry
109
109
  * transformation.rotate(90, 0, 0);
110
- * const result = affineTransformExecute(polygon, transform);
110
+ * const result = affineTransformExecute(polygon, transformation);
111
111
  */
112
112
  rotate(angleInDegrees: number, rotationX?: number, rotationY?: number): this;
113
113
  /**
@@ -121,7 +121,7 @@ export default class Transformation {
121
121
  * @example
122
122
  * // Scale a geometry
123
123
  * transformation.scale(2, 2);
124
- * const result = affineTransformExecute(polygon, transform);
124
+ * const result = affineTransformExecute(polygon, transformation);
125
125
  */
126
126
  scale(x: number, y: number): this;
127
127
  /**
@@ -149,7 +149,7 @@ export default class Transformation {
149
149
  * @example
150
150
  * // Shear a geometry
151
151
  * transformation.shear(0.5, 0.5);
152
- * const result = affineTransformExecute(polygon, transform);
152
+ * const result = affineTransformExecute(polygon, transformation);
153
153
  */
154
154
  shear(proportionX: number, proportionY: number): this;
155
155
  /**
@@ -162,7 +162,7 @@ export default class Transformation {
162
162
  * @example
163
163
  * // Shift the coordinates of a geometry
164
164
  * transformation.shift(5, 2);
165
- * const result = affineTransformExecute(polygon, transform);
165
+ * const result = affineTransformExecute(polygon, transformation);
166
166
  */
167
167
  shift(x: number, y: number): this;
168
168
  }
@@ -79,7 +79,7 @@ export function load(): Promise<void>;
79
79
  * await geographicTransformationUtils.load();
80
80
  * }
81
81
  *
82
- * const geogtrans = projection.getTransformation(cs1, cs2, extent);
82
+ * const geogtrans = geographicTransformationUtils.getTransformation(cs1, cs2, extent);
83
83
  */
84
84
  export function getTransformation(inSpatialReference: SpatialReference, outSpatialReference: SpatialReference, areaOfInterestExtent?: Extent | null, returnUnusable?: boolean): GeographicTransformation | null | undefined;
85
85
 
@@ -96,7 +96,7 @@ export function getTransformation(inSpatialReference: SpatialReference, outSpati
96
96
  * >
97
97
  * > Grid-based datum transformations are not supported in the SDK.
98
98
  * > Geographic transformations are returned with their maximum number of [GeographicTransformation.steps](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/GeographicTransformation/#steps).
99
- * > Currently, number of steps is limited to 2.
99
+ * > Currently, the number of steps is limited to 2.
100
100
  *
101
101
  * @param inSpatialReference - The spatial reference that the geometries are currently using.
102
102
  * @param outSpatialReference - The spatial reference to which you are converting the geometries to.
@@ -128,7 +128,7 @@ export function getTransformation(inSpatialReference: SpatialReference, outSpati
128
128
  * await geographicTransformationUtils.load();
129
129
  * }
130
130
  *
131
- * const geogtrans = projection.getTransformations(cs1, cs2, extent);
131
+ * const geogtrans = geographicTransformationUtils.getTransformations(cs1, cs2, extent);
132
132
  * geogtrans.forEach((geogtran, index) => {
133
133
  * geogtran.steps.forEach((step, index) => {
134
134
  * console.log("step wkid: ", step.wkid);
@@ -17,7 +17,7 @@ import type { GeometryUnion, GeometryWithoutMeshUnion } from "../types.js";
17
17
  *
18
18
  * @param leftGeometry - The first geometry to be XOR'd.
19
19
  * @param rightGeometry - The second geometry to be XOR'd.
20
- * @returns Returns the symmetric difference of the two geometries. The result has the higher of dimensions of the two geometries.
20
+ * @returns Returns the symmetric difference of the two geometries. The result has the higher dimension of the two geometries.
21
21
  * @since 5.2
22
22
  * @example
23
23
  * // Calculate the symmetric difference of two polygons.
@@ -33,7 +33,7 @@ export function symmetricDifferenceExecute(leftGeometry: GeometryUnion, rightGeo
33
33
  * with [symmetricDifferenceExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/symmetricDifferenceOperator/#symmetricDifferenceExecute).
34
34
  * @param leftGeometry - The first geometry to be XOR'd.
35
35
  * @param rightGeometry - The second geometry to be XOR'd.
36
- * @returns Returns the symmetric difference of the two geometries. The result has the higher of dimensions of the two geometries.
36
+ * @returns Returns the symmetric difference of the two geometries. The result has the higher dimension of the two geometries.
37
37
  * @example
38
38
  * // Calculate the symmetric difference of two polygons.
39
39
  * const differencePolygon = symmetricDifferenceExecute(polygon1, polygon2);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Perform a relational operation to determine if one 2D geometry is within another 2D geometry. Geometry A is within geometry B, when A is the intersection of A and B.
2
+ * Perform a relational operation to determine if one 2D geometry is within another 2D geometry. Geometry A is within geometry B when A is the intersection of A and B.
3
3
  *
4
4
  * Geometry A can be non-simple geometry.
5
5
  *
@@ -37,7 +37,7 @@ export function accelerateGeometry(geometry: GeometryUnion): boolean;
37
37
  * @returns Returns `true` if `inner` is within `outer`.
38
38
  * @since 5.2
39
39
  * @example
40
- * Returns true if a geometry is completely within another
40
+ * // Returns true if a geometry is completely within another
41
41
  * const isWithin = withinExecute(polygon1, polygon2);
42
42
  */
43
43
  export function withinExecute(inner: GeometryUnion, outer: GeometryUnion): boolean;
@@ -52,7 +52,7 @@ export function withinExecute(inner: GeometryUnion, outer: GeometryUnion): boole
52
52
  * @param outer - The comparison geometry that is tested for the "contains" relationship with `inner`.
53
53
  * @returns Returns `true` if `inner` is within `outer`.
54
54
  * @example
55
- * Returns true if a geometry is completely within another
55
+ * // Returns true if a geometry is completely within another
56
56
  * const isWithin = withinExecute(polygon1, polygon2);
57
57
  */
58
58
  export function execute(inner: GeometryUnion, outer: GeometryUnion): boolean;
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.27`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.28`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
@@ -28,7 +28,7 @@ export interface GeospatialPDFLayerProperties extends LayerProperties, ScaleRang
28
28
  * The entire document is downloaded before rendering; large or complex PDFs can increase load time and memory usage.
29
29
  * The layer derives its [spatial reference](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/#spatialReference) and
30
30
  * [extent](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/#fullExtent) from the embedded georeferencing information.
31
- * The rendered imagery can be reprojected to the spatial reference of the view. In an scene, it is draped on the ground.
31
+ * The rendered imagery can be reprojected to the spatial reference of the view. In a scene, it is draped on the ground.
32
32
  *
33
33
  * Additionally the PDF defines the boundary of the georeferenced map within the page, called a *neatline*.
34
34
  * Set [clippedToNeatline](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/#clippedToNeatline) to `true` to hide content outside this boundary, such as page margins, legends, and titles.
@@ -44,7 +44,7 @@ export interface GeospatialPDFLayerProperties extends LayerProperties, ScaleRang
44
44
  * >
45
45
  * > - Documents that require a password to open are not supported.
46
46
  * > - Tile reprojection is limited: grid-based transformations are not supported. As a result, the layer may still display but appear shifted. See the [project operator's known limitations](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/).
47
- * > - To decode certain image types from PDF files, GeospatialPDFLayer is using WebAssembly features not available yet in Safari. As a result it uses a slower JavaScript fallback which impact the initial load of the layer.
47
+ * > - To decode certain image types from PDF files, GeospatialPDFLayer uses WebAssembly features not yet available in Safari. As a result, it uses a slower JavaScript fallback, which impacts the initial load of the layer.
48
48
  * > - Not supported by the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
49
49
  *
50
50
  * @beta
@@ -366,7 +366,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
366
366
  /** Describes the layer's supported capabilities. */
367
367
  get capabilities(): FeatureLayerCapabilities | null | undefined;
368
368
  /**
369
- * Array of Chart Items of type WebMapWebChart available on the parquet layer.
369
+ * Array of chart items of type WebMapWebChart available on the Parquet layer.
370
370
  *
371
371
  * @since 5.2
372
372
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.27",
3
+ "version": "6.0.0-next.28",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.21.5",
23
- "@arcgis/toolkit": "6.0.0-next.27",
23
+ "@arcgis/toolkit": "6.0.0-next.28",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
25
  "@esri/calcite-components": "^5.2.0",
26
26
  "@vaadin/grid": "~25.3.5",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Error.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as i}from"../core/maybe.js";import{debounce as a,logOnError as o,isAbortError as s}from"../core/promiseUtils.js";import{watch as c,when as l}from"../core/reactiveUtils.js";import{throttle as u}from"../core/throttle.js";import{property as d,subclass as f}from"../core/accessorSupport/decorators.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as y,createDefaultActions as b}from"./actions.js";import{getSelectedTarget as x}from"./actionUtils.js";import S from"./FeatureModel.js";import C from"./support/FeatureAbilities.js";import{getDisplayedSymbol as w}from"../symbols/support/symbolUtils.js";import{system as T}from"../time/constants.js";import{highlightsSupported as E}from"../views/support/layerViewUtils.js";import{GoTo as D}from"../widgets/support/GoTo.js";const O=Symbol(`feature-stream-flush`);let k=null;function A(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let j=class extends D(n){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new C,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new y,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureModels=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>!!this.view?.focusRegionVisible,()=>{this._initialDisplayMode===void 0&&this._syncSelectedFeatureIndex(this.features)}),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featuresPerPage,this.featureMenuOpen,this.open,this.initialDisplayMode,this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.defaultPopupTemplateEnabled,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],(e,t)=>this._updateFeatureModels(t?.[1]??-1),{initial:!0}),l(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._destroyFeatureModels(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new y;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??b()),e}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}get featurePage(){return this._get(`featurePage`)}set featurePage(e){e==null?this.featureCount||this._set(`featurePage`,null):!Number.isInteger(e)||e<1||e>Math.ceil(this.featureCount/this.featuresPerPage)||e!==1&&e!==(this.featurePage??0)+1||this._set(`featurePage`,e)}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._activeFeatureStream&&t.length&&this.featurePage!=null||(this.featurePage=t.length?1:null),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionVisible?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??T}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureModels.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,n){let{view:r}=this;if(!r||!e)throw new t(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:n?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:n?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;this.initialDisplayMode===`list`?n||(this.selectedFeatureIndex=-1):n&&t===-1?this.selectedFeatureIndex=0:n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,n=x(this);this._cancelCenterAtLocation();let i=new AbortController,{signal:a}=i;return this._centerAtLocationController=i,!n||!e?Promise.reject(new t(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:n,view:e})):this.callGoTo({target:{target:n,scale:e.scale},options:{signal:a}}).catch(e=>{s(e)||r.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await w(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry)}else if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureModels(){this.featureModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureModels`,[])}_reconcileFeatureModels(e,t){let n=[],r=new Map;if(this.featureModels.forEach((t,i)=>{let a=t?.graphic;if(!a||t.destroyed)t.destroy();else if(e[i]===a)n[i]=t;else{let e=r.get(a);e?e.push(t):r.set(a,[t])}}),!r.size)return n;for(let e of r.values())e.reverse();for(let t=0;t<e.length&&r.size;t++){if(n[t])continue;let i=e[t],a=r.get(i);a&&(n[t]=a.pop(),a.length||r.delete(i))}let i=this.selectedFeatureIndex,a=e[i],o=this.featureModels[t],s=null;for(let e of r.values())for(let t of e)t===o?s=t:t.destroy();return s&&(a&&!n[i]?(s.graphic=a,n[i]=s):s.destroy()),n}_updateFeatureModels(e){let{selectedFeature:t,features:n}=this;if(!n.length){this._destroyFeatureModels();return}let r={abilities:this.featureItemAbilities??this._defaultFeatureAbilities,actions:this.actions,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:this.includeDefaultActions,spatialReference:this.spatialReference,location:this.location,map:this.map,view:this.view,timeZone:this.timeZone},i=this._reconcileFeatureModels(n,e);i.forEach(e=>e.set(r));let a=e=>{let t=n[e];t&&!i[e]&&(i[e]=new S({...r,graphic:t}))};if(t&&a(this.selectedFeatureIndex),(this.featurePage??0)>1||this.open&&(this.featureMenuOpen||this.initialDisplayMode===`list`)){let e=Math.min((this.featurePage??0)*this.featuresPerPage,n.length);for(let t=0;t<e;t++)a(t)}this._set(`featureModels`,i)}_cancelCenterAtLocation(){this._centerAtLocationController=i(this._centerAtLocationController)}_cancelFeatureStream(){this.removeHandles(O);let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,i=n?.geometry?.type,a=this.location;if(i&&i!==`mesh`&&t&&a&&n){if(i===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry)}else try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),k??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=k;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){s(e)||r.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=i(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){let t=_(e),{layer:n}=e;return t&&`layer`in t&&t.layer?t.layer:t?.type===`map-notes`||t?.type===`sketch`||t?.type===`subtype-group`?t:n??t}_getHighlightLayerView(e,t){return t.type===`subtype-sublayer`&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,n){if(A(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=this._getHighlightLayerView(i,o);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!E(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){if(e!==this._activeFeatureStream)return;let n=[],r=u(()=>{let t=n;n=[],e===this._activeFeatureStream&&t.length&&this._addFeatures(t)},16);this.addHandles({remove:()=>{r.remove(),n=[]}},O);try{for await(let i of e){if(e!==this._activeFeatureStream)return;let a=!this._featureStreamHasYielded;a&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),a?(this._addFeatures([i]),e===this._activeFeatureStream&&(this._featureStreamHasYielded=!0)):(n.push(i),r())}}finally{this._activeFeatureStream===e&&r.forceUpdate(),this._activeFeatureStream===e&&(this.removeHandles(O),this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeatures(e){let{features:t}=this,n=new Set(t),r=e.filter(e=>!n.has(e)&&(n.add(e),!0));r.length&&(this.features=t.concat(r))}};e([d()],j.prototype,`_initialDisplayMode`,void 0),e([d()],j.prototype,`_activeFeatureStream`,void 0),e([d()],j.prototype,`_featureStreamHasYielded`,void 0),e([d({type:y})],j.prototype,`actions`,void 0),e([d({type:y,readOnly:!0})],j.prototype,`defaultActions`,null),e([d({readOnly:!0})],j.prototype,`active`,null),e([d()],j.prototype,`activeFeature`,void 0),e([d()],j.prototype,`aggregatedFeaturesEnabled`,void 0),e([d({value:null})],j.prototype,`content`,null),e([d({type:Boolean})],j.prototype,`defaultPopupTemplateEnabled`,void 0),e([d({readOnly:!0})],j.prototype,`diagnostics`,void 0),e([d({readOnly:!0})],j.prototype,`effectiveHeading`,null),e([d({readOnly:!0})],j.prototype,`featureCount`,null),e([d({value:null})],j.prototype,`featurePage`,null),e([d({value:[]})],j.prototype,`features`,null),e([d()],j.prototype,`featureStream`,null),e([d()],j.prototype,`featuresPerPage`,void 0),e([d()],j.prototype,`featureMenuOpen`,void 0),e([d({type:C})],j.prototype,`featureItemAbilities`,void 0),e([d({readOnly:!0})],j.prototype,`featureModels`,void 0),e([d()],j.prototype,`heading`,void 0),e([d()],j.prototype,`highlightEnabled`,void 0),e([d()],j.prototype,`includeDefaultActions`,void 0),e([d()],j.prototype,`initialDisplayMode`,null),e([d({type:p})],j.prototype,`location`,null),e([d()],j.prototype,`map`,null),e([d()],j.prototype,`open`,void 0),e([d({readOnly:!0})],j.prototype,`pendingLocation`,null),e([d({readOnly:!0})],j.prototype,`streamingFeatures`,null),e([d({value:null,readOnly:!0})],j.prototype,`selectedFeature`,null),e([d({value:-1})],j.prototype,`selectedFeatureIndex`,null),e([d({readOnly:!0})],j.prototype,`selectedFeatureItem`,null),e([d({type:h})],j.prototype,`spatialReference`,null),e([d({readOnly:!0})],j.prototype,`state`,null),e([d()],j.prototype,`timeZone`,null),e([d()],j.prototype,`updateLocationEnabled`,void 0),e([d()],j.prototype,`view`,void 0),e([d({readOnly:!0})],j.prototype,`waitingForContents`,null),e([d({readOnly:!0})],j.prototype,`waitingForResult`,null),e([d()],j.prototype,`zoomFactor`,void 0),j=e([f(`esri.popup.FeaturesModel`)],j);const M=j;export{M as default};
2
+ import{__decorate as e}from"tslib";import t from"../core/Error.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as i}from"../core/maybe.js";import{debounce as a,logOnError as o,isAbortError as s}from"../core/promiseUtils.js";import{watch as c,when as l}from"../core/reactiveUtils.js";import{throttle as u}from"../core/throttle.js";import{property as d,subclass as f}from"../core/accessorSupport/decorators.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as y,createDefaultActions as b}from"./actions.js";import{getSelectedTarget as x}from"./actionUtils.js";import S from"./FeatureModel.js";import C from"./support/FeatureAbilities.js";import{getHighlightLayer as w,getHighlightLayerView as T}from"./support/featureUtils.js";import{getDisplayedSymbol as E}from"../symbols/support/symbolUtils.js";import{system as D}from"../time/constants.js";import{highlightsSupported as O}from"../views/support/layerViewUtils.js";import{GoTo as k}from"../widgets/support/GoTo.js";const A=Symbol(`feature-stream-flush`);let j=null;function M(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let N=class extends k(n){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new C,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new y,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureModels=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>!!this.view?.focusRegionVisible,()=>{this._initialDisplayMode===void 0&&this._syncSelectedFeatureIndex(this.features)}),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featuresPerPage,this.featureMenuOpen,this.open,this.initialDisplayMode,this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.defaultPopupTemplateEnabled,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],(e,t)=>this._updateFeatureModels(t?.[1]??-1),{initial:!0}),l(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._destroyFeatureModels(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new y;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??b()),e}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}get featurePage(){return this._get(`featurePage`)}set featurePage(e){e==null?this.featureCount||this._set(`featurePage`,null):!Number.isInteger(e)||e<1||e>Math.ceil(this.featureCount/this.featuresPerPage)||e!==1&&e!==(this.featurePage??0)+1||this._set(`featurePage`,e)}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._activeFeatureStream&&t.length&&this.featurePage!=null||(this.featurePage=t.length?1:null),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionVisible?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??D}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureModels.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,n){let{view:r}=this;if(!r||!e)throw new t(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:n?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:n?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;this.initialDisplayMode===`list`?n||(this.selectedFeatureIndex=-1):n&&t===-1?this.selectedFeatureIndex=0:n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,n=x(this);this._cancelCenterAtLocation();let i=new AbortController,{signal:a}=i;return this._centerAtLocationController=i,!n||!e?Promise.reject(new t(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:n,view:e})):this.callGoTo({target:{target:n,scale:e.scale},options:{signal:a}}).catch(e=>{s(e)||r.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await E(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry)}else if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureModels(){this.featureModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureModels`,[])}_reconcileFeatureModels(e,t){let n=[],r=new Map;if(this.featureModels.forEach((t,i)=>{let a=t?.graphic;if(!a||t.destroyed)t.destroy();else if(e[i]===a)n[i]=t;else{let e=r.get(a);e?e.push(t):r.set(a,[t])}}),!r.size)return n;for(let e of r.values())e.reverse();for(let t=0;t<e.length&&r.size;t++){if(n[t])continue;let i=e[t],a=r.get(i);a&&(n[t]=a.pop(),a.length||r.delete(i))}let i=this.selectedFeatureIndex,a=e[i],o=this.featureModels[t],s=null;for(let e of r.values())for(let t of e)t===o?s=t:t.destroy();return s&&(a&&!n[i]?(s.graphic=a,n[i]=s):s.destroy()),n}_updateFeatureModels(e){let{selectedFeature:t,features:n}=this;if(!n.length){this._destroyFeatureModels();return}let r={abilities:this.featureItemAbilities??this._defaultFeatureAbilities,actions:this.actions,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:this.includeDefaultActions,spatialReference:this.spatialReference,location:this.location,map:this.map,view:this.view,timeZone:this.timeZone},i=this._reconcileFeatureModels(n,e);i.forEach(e=>e.set(r));let a=e=>{let t=n[e];t&&!i[e]&&(i[e]=new S({...r,graphic:t}))};if(t&&a(this.selectedFeatureIndex),(this.featurePage??0)>1||this.open&&(this.featureMenuOpen||this.initialDisplayMode===`list`)){let e=Math.min((this.featurePage??0)*this.featuresPerPage,n.length);for(let t=0;t<e;t++)a(t)}this._set(`featureModels`,i)}_cancelCenterAtLocation(){this._centerAtLocationController=i(this._centerAtLocationController)}_cancelFeatureStream(){this.removeHandles(A);let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,i=n?.geometry?.type,a=this.location;if(i&&i!==`mesh`&&t&&a&&n){if(i===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry)}else try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),j??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=j;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){s(e)||r.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=i(this._locationUpdateController)}_getHighlightLayer(e){return w(e,this.map)}_getHighlightTarget(e,t,n){if(M(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=T(i,o,this.map);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!O(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){if(e!==this._activeFeatureStream)return;let n=[],r=u(()=>{let t=n;n=[],e===this._activeFeatureStream&&t.length&&this._addFeatures(t)},16);this.addHandles({remove:()=>{r.remove(),n=[]}},A);try{for await(let i of e){if(e!==this._activeFeatureStream)return;let a=!this._featureStreamHasYielded;a&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),a?(this._addFeatures([i]),e===this._activeFeatureStream&&(this._featureStreamHasYielded=!0)):(n.push(i),r())}}finally{this._activeFeatureStream===e&&r.forceUpdate(),this._activeFeatureStream===e&&(this.removeHandles(A),this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeatures(e){let{features:t}=this,n=new Set(t),r=e.filter(e=>!n.has(e)&&(n.add(e),!0));r.length&&(this.features=t.concat(r))}};e([d()],N.prototype,`_initialDisplayMode`,void 0),e([d()],N.prototype,`_activeFeatureStream`,void 0),e([d()],N.prototype,`_featureStreamHasYielded`,void 0),e([d({type:y})],N.prototype,`actions`,void 0),e([d({type:y,readOnly:!0})],N.prototype,`defaultActions`,null),e([d({readOnly:!0})],N.prototype,`active`,null),e([d()],N.prototype,`activeFeature`,void 0),e([d()],N.prototype,`aggregatedFeaturesEnabled`,void 0),e([d({value:null})],N.prototype,`content`,null),e([d({type:Boolean})],N.prototype,`defaultPopupTemplateEnabled`,void 0),e([d({readOnly:!0})],N.prototype,`diagnostics`,void 0),e([d({readOnly:!0})],N.prototype,`effectiveHeading`,null),e([d({readOnly:!0})],N.prototype,`featureCount`,null),e([d({value:null})],N.prototype,`featurePage`,null),e([d({value:[]})],N.prototype,`features`,null),e([d()],N.prototype,`featureStream`,null),e([d()],N.prototype,`featuresPerPage`,void 0),e([d()],N.prototype,`featureMenuOpen`,void 0),e([d({type:C})],N.prototype,`featureItemAbilities`,void 0),e([d({readOnly:!0})],N.prototype,`featureModels`,void 0),e([d()],N.prototype,`heading`,void 0),e([d()],N.prototype,`highlightEnabled`,void 0),e([d()],N.prototype,`includeDefaultActions`,void 0),e([d()],N.prototype,`initialDisplayMode`,null),e([d({type:p})],N.prototype,`location`,null),e([d()],N.prototype,`map`,null),e([d()],N.prototype,`open`,void 0),e([d({readOnly:!0})],N.prototype,`pendingLocation`,null),e([d({readOnly:!0})],N.prototype,`streamingFeatures`,null),e([d({value:null,readOnly:!0})],N.prototype,`selectedFeature`,null),e([d({value:-1})],N.prototype,`selectedFeatureIndex`,null),e([d({readOnly:!0})],N.prototype,`selectedFeatureItem`,null),e([d({type:h})],N.prototype,`spatialReference`,null),e([d({readOnly:!0})],N.prototype,`state`,null),e([d()],N.prototype,`timeZone`,null),e([d()],N.prototype,`updateLocationEnabled`,void 0),e([d()],N.prototype,`view`,void 0),e([d({readOnly:!0})],N.prototype,`waitingForContents`,null),e([d({readOnly:!0})],N.prototype,`waitingForResult`,null),e([d()],N.prototype,`zoomFactor`,void 0),N=e([f(`esri.popup.FeaturesModel`)],N);const P=N;export{P as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Logger.js";import{replace as t}from"../../core/string.js";import{getGraphicLayer as n}from"../../graphic/graphicOriginUtils.js";import{formatDate as r,convertDateFormatToIntlOptions as i}from"../../intl/date.js";import{convertNumberFieldFormatToIntlOptions as a,convertNumberFormatToIntlOptions as o,formatNumber as s}from"../../intl/number.js";import{typesHaveUniqueIdsAndNames as c}from"../../layers/support/featureLayerUtils.js";import{fieldFormatFromFieldInfo as l}from"../../layers/support/fieldFormatUtils.js";import{isRasterPixelValueField as u,featureHasFields as d,isTimeOnlyField as f}from"../../layers/support/fieldUtils.js";import{getFieldConfigurationsContainer as p,getEffectiveLayerCapabilities as m}from"../../layers/support/layerUtils.js";import{formatAnyDate as h,isAnyDateField as g}from"../../smartMapping/support/utils.js";import{loadArcade as _}from"../../support/loadArcade.js";import{getTimeZoneFormattingOptions as v}from"../../time/timeZoneUtils.js";const y=()=>e.getLogger(`esri.popup.support.featureUtils`),b=/href=(""|'')/gi,ee=/(\{([^{\r\n]+)\})/g,te=/'/g,x=/^\s*expression\//i,ne=/(\n)/gi,re=/[\u00A0-\u9999<>&]/gim,ie=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ae=/^(?:mailto:|tel:)/,S=`relationships/`,C=i(`short-date-short-time`);function oe(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}const se=new Set([`building`,`knowledge-graph`,`link-chart`,`map-image`,`map-notes`,`subtype-group`,`tile`]);function ce(e){let t=e?.origin;return(t==null?void 0:se.has(t.type??``)?t.sublayer:t.layer)??e?.layer}async function le({type:e,value:t,event:n}){try{return typeof t==`function`?t(n):await t}catch(r){y().error(`error`,`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t});return}}function ue(e=``){if(e)return!ae.test(e.trim().toLowerCase())}function w(e){return e?x.test(e):!1}function T(e,t){if(!t||!w(t)||!e)return;let n=t.replace(x,``).toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function E(e){let{fieldInfo:t,graphic:n,layer:r}=e;return de({fieldInfo:t,graphic:n})?p(r,{graphic:n}):null}function de({fieldInfo:e,graphic:t}){return!!e?.fieldName&&!w(e.fieldName)&&!J(e.fieldName)&&!t?.popupTemplate}function fe({expressionInfos:e,fieldInfo:t,graphic:n,isContentFieldInfos:r,layer:i}){if(!t?.fieldName)return null;let a=T(e,t.fieldName);if(a)return a.title||null;let o=E({fieldInfo:t,graphic:n,layer:i});if(o){let e=o.getFieldAlias(t.fieldName);return r?t.label||e||t.fieldName:e||t.fieldName}return t.label||t.fieldName}function D(e){let{configurableFieldsContainer:t,fieldInfo:n,isContentFieldInfos:r}=e;if(!n?.fieldName)return null;let i=!t.popupTemplate&&!t.fieldConfigurations?l(n,t.getField(n.fieldName)):t.getFieldConfiguration(n.fieldName)?.fieldFormat;return r&&n.fieldFormat||i}function pe(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function me(e){return e.replaceAll(b,``)}function O(e,t){let n=k(t,e);return n?n.name:e}function he(e,t){return e&&e.map(e=>O(e,t))}function k(e,t){return!(e&&typeof e.getField==`function`)||!t?null:e.getField(t)??null}function A(e){return`${e}`.trim()}function ge({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?j({formattedAttributes:t,template:I(r,{...t,...i,...e},n),fieldInfoMap:a}):``}function j({formattedAttributes:e,template:n,fieldInfoMap:r}){return A(me(t(t(n,e=>pe(e,r)),e)))}function M(e,t,n=!1){let r=t[e];typeof r==`string`&&(t[e]=(n?encodeURIComponent(r):r).replaceAll(te,`%27`))}function N(e,t=!1){let n={...e};return Object.keys(n).forEach(e=>M(e,n,t)),n}function P(e,n,r){n=A(n);let i=n&&!n.startsWith(`{`);return t(e,N(r,i||!1))}function F(e,t){return e.replaceAll(ee,(e,n,r)=>{let i=k(t,r);return i?`{${i.name}}`:n})}function I(e,t,n){let r=F(e,n);return r&&r.replaceAll(ie,(e,n,r)=>P(e,n||r,t))}function L(e,t){let n=t?.fieldFormat?.type===`number`||t?.format&&t.format.dateFormat==null&&(t.format.places!=null||t.format.digitSeparator!=null);if(typeof e==`string`&&n){let t=Number(e);if(!isNaN(t))return t}return e}function R(e){return typeof e==`object`&&!!e&&`fieldsIndex`in e&&`geometryType`in e&&`getField`in e&&`load`in e&&`loaded`in e&&`objectIdField`in e&&`spatialReference`in e&&`type`in e&&(e.type===`feature`||e.type===`scene`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e}function z(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatureCount`in e&&`queryObjectIds`in e&&`queryRelatedFeatures`in e&&`queryRelatedFeaturesCount`in e&&`relationships`in e}function B(e){return R(e)&&z(e)}function _e(e){return e&&typeof e==`object`&&`createQuery`in e&&`getField`in e&&`queryFeatureCount`in e&&`queryFeatures`in e&&`queryObjectIds`in e&&`capabilities`in e&&`fields`in e&&`fieldsIndex`in e&&`type`in e&&(e.type===`feature`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e?e.type===`subtype-sublayer`&&`parent`in e&&e.parent&&typeof e.parent==`object`?`globalIdField`in e.parent:`globalIdField`in e:!1}function ve(e){return!e||typeof e!=`object`?!1:B(n(e))}function V(e,t){let{fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:c,layer:l,preventPlacesFormatting:d,timeZone:f}=t,p=U(n,r),m=E({fieldInfo:p,graphic:i,layer:l}),g=k(m||l,r),_=m?null:p?.format,v=m?D({configurableFieldsContainer:m,fieldInfo:p,isContentFieldInfos:c}):null,y=v?.type===`number`;if(p&&!u(r)){let t=g?.type,n=v?.type===`date-time`,r=_?.dateFormat;if(t===`date`||t===`date-only`||t===`time-only`||t===`timestamp-offset`||n||r)return h(e,{format:n?void 0:r,fieldFormat:n?v:void 0,fieldType:t,timeZoneOptions:{layerTimeZone:l&&`preferredTimeZone`in l?l.preferredTimeZone:null,viewTimeZone:f,datesInUnknownTimezone:l&&`datesInUnknownTimezone`in l?!!l.datesInUnknownTimezone:!1}})}if(typeof e==`string`&&u(r)&&_)return ye(e,_);if(e=L(e,{format:y?void 0:_,fieldFormat:y?v:void 0}),typeof e==`string`||e==null||_==null&&v==null)return G(e);let b=y?a(v):_?o(_):void 0;return d?s(e,{...b,minimumFractionDigits:0,maximumFractionDigits:20}):s(e,b)}function ye(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(`,`)?H(e,`,`,`, `,t):e.includes(`;`)?H(e,`;`,`; `,t):e.includes(` `)?H(e,` `,` `,t):s(Number(e),o(t))}function H(e,t,n,r){return e.trim().split(t).map(e=>s(Number(e),o(r))).join(n)}function U(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function be({fieldName:e,graphic:t,layer:n}){if(J(e)||!n||typeof n.getFeatureType!=`function`)return null;let{typeIdField:r}=n;if(!r||e!==r)return null;let i=n.getFeatureType(t);return i?i.name:null}function xe({fieldName:e,value:t,graphic:n,layer:r}){if(J(e)||!r||typeof r.getFieldDomain!=`function`)return null;let i=n&&r.getFieldDomain(e,{feature:n});return!i||i.type!==`coded-value`?null:i.getName(t)}function Se(e,t,n,i){let{creatorField:a,creationDateField:o,editorField:s,editDateField:c}=e;if(!t)return;let l=v(i&&`preferredTimeZone`in i?i.preferredTimeZone:null,i&&`datesInUnknownTimezone`in i?!!i.datesInUnknownTimezone:!1,n,C,`date`),u={...C,...l},d=t[c];if(typeof d==`number`){let e=t[s];return{type:`edit`,date:r(d,u),user:e}}let f=t[o];if(typeof f==`number`){let e=t[a];return{type:`create`,date:r(f,u),user:e}}return null}function W(e,t){let n=new Map;if(!e)return n;for(let r of e){if(!r.fieldName)continue;let e=O(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function Ce(e){let t=[];if(!e)return t;let{fieldInfos:n,content:r}=e;return n&&t.push(...n),!r||!Array.isArray(r)||r.forEach(e=>{if(e.type===`fields`){let n=e?.fieldInfos;n&&t.push(...n)}}),t}function we(e){return e.replaceAll(re,e=>`&#${e.charCodeAt(0)};`)}function G(e){return typeof e==`string`?e.replaceAll(ne,`<br class="esri-text-new-line" />`):e}function K(e){let{fieldInfoMap:t,fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s,value:l}=e;if(l==null)return``;let u=xe({fieldName:r,value:l,graphic:i,layer:o});if(u)return u;let d=o?.types&&c(o.types)?be({fieldName:r,graphic:i,layer:o}):null;if(d)return d;if(t.get(r.toLowerCase()))return V(l,{fieldInfos:n||Array.from(t.values()),fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s});let p=o?.fieldsIndex?.get(r);return p&&(g(p)||f(p))?h(l,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&`preferredTimeZone`in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:o&&`datesInUnknownTimezone`in o?!!o.datesInUnknownTimezone:!1}}):G(l)}function Te({attributes:e,fieldInfoMap:t,fieldInfos:n,graphic:r,isContentFieldInfos:i,layer:a,relatedInfos:o,timeZone:s}){let c={};return o?.forEach(e=>Ae({attributes:c,relatedInfo:e,fieldInfoMap:t,fieldInfos:n,layer:a,timeZone:s})),e&&Object.keys(e).forEach(o=>{let l=e[o];c[o]=K({fieldInfoMap:t,fieldInfos:n,fieldName:o,graphic:r,isContentFieldInfos:i,layer:a,timeZone:s,value:l})}),c}async function q(e,t){let{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:s}=e,c=a[0];if(typeof c!=`number`&&typeof c!=`string`){let e={layer:n,graphic:r,objectId:c,requiredFields:i};return y().warn(`Could not query required fields for the specified feature. The feature's ID is invalid.`,e),null}if(!m(n)?.operations?.supportsQuery){let e={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return y().warn(`The specified layer cannot be queried. The following fields will not be available.`,e),null}let l=n.createQuery();return l.objectIds=a,l.outFields=i?.length?i:[n.objectIdField],l.returnGeometry=!!o,l.returnZ=!!o,l.returnM=!!o,l.outSpatialReference=s,(await n.queryFeatures(l,t)).features[0]}async function Ee(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{hasGeometryFunctions:t}}=await _();return t(e)}async function De(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{requiresTrack:t}}=await _();return t(e)}async function Oe({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t||(typeof n.load==`function`&&await n.load(i),!e.attributes))return;let a=n.objectIdField,o=e.attributes[a];if(o==null)return;let s=[o],c=new Set(await t.getRequiredFields(n.fieldsIndex));n.timeInfo?.trackIdField!=null&&!c.has(n.timeInfo.trackIdField)&&await De(t)&&c.add(n.timeInfo.trackIdField);let l=d(e,c),u=l?[]:c.has(a)?[...c]:[...c,a],f=t.returnGeometry||await Ee(t);if(l&&!f)return;let p=await q({layer:n,graphic:e,outFields:u,objectIds:s,returnGeometry:f,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function J(e=``){return e?e.includes(S):!1}function ke(e){return e?`${S}${e.layerId}/${e.fieldName}`:``}function Y({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(s=>{let c=ke({layerId:n.relation.id.toString(),fieldName:s}),l=t.attributes[s];e[c]=K({fieldName:c,fieldInfos:r,fieldInfoMap:i,layer:a,value:l,graphic:t,timeZone:o})})}function Ae({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}const X=e=>{if(!e)return!1;let t=e.toUpperCase();return t.includes(`CURRENT_TIMESTAMP`)||t.includes(`CURRENT_DATE`)||t.includes(`CURRENT_TIME`)},Z=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||t===`attachments`)return;let i=n.where==null?null:n.where,a=n.geometry==null?null:n.geometry;e.capabilities.query.supportsCacheHint&&!X(r)&&!X(i)&&a?.type!==`extent`&&n.resultType!==`tile`&&(n.cacheHint=!0)},je=({query:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})},Me=({queryPayload:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})};function Ne(e,t,n){return!e||!t||!n?null:t.type===`sublayer`?$({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||$({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):$({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||$({layers:e.allTables,map:e,relatedLayer:t,relationship:n})}function Pe(e,t){return!e||!(`utilityNetworks`in e)||!t?null:e.utilityNetworks?.find(e=>e.isUtilityLayer(t))}function Q(e,t){return e?.allTables.find(e=>e.type===`feature`&&e.layerId===t.id&&e.url===t.layer?.url)}function $({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(let a of i){if(a.type===`map-image`){let n=$({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||$({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!B(a))continue;if(r.type===`sublayer`){if(a!==r&&a.id===n)return a.isTable?Q(e,a):a;continue}let i=r.type===`scene`&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if(a.type===`sublayer`){if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?Q(e,a):a}else if(a!==r&&a.url===i&&a.layerId===n)return a}return null}export{G as applyTextFormattingHTML,W as createFieldInfoMap,Ne as findRelatedLayer,Pe as findUtilityNetwork,F as fixTokens,Te as formatAttributes,Se as formatEditInfo,V as formatValueToFieldInfo,Ce as getAllFieldInfos,E as getConfigurableFieldsContainer,D as getFieldFormat,U as getFieldInfo,fe as getFieldInfoLabel,O as getFixedFieldName,he as getFixedFieldNames,ce as getPopupLayer,oe as getSourceLayer,le as graphicCallback,we as htmlEntities,_e as isAssociatedFeatureSupportedLayer,w as isExpressionField,R as isFeatureSupportedLayer,ve as isGraphicForRelatableFeatureSupportedLayer,B as isRelatableFeatureSupportedLayer,z as isRelatableLayer,J as isRelatedField,je as preLayerQueryCallback,Me as preRequestCallback,q as querySourceLayer,Oe as queryUpdatedFeature,ue as shouldOpenInNewTab,j as substituteAttributes,ge as substituteFieldsInLinksAndAttributes};
2
+ import e from"../../core/Logger.js";import{replace as t}from"../../core/string.js";import{getGraphicLayer as n}from"../../graphic/graphicOriginUtils.js";import{formatDate as r,convertDateFormatToIntlOptions as i}from"../../intl/date.js";import{convertNumberFieldFormatToIntlOptions as a,convertNumberFormatToIntlOptions as o,formatNumber as s}from"../../intl/number.js";import{typesHaveUniqueIdsAndNames as c}from"../../layers/support/featureLayerUtils.js";import{fieldFormatFromFieldInfo as l}from"../../layers/support/fieldFormatUtils.js";import{isRasterPixelValueField as u,featureHasFields as d,isTimeOnlyField as f}from"../../layers/support/fieldUtils.js";import{getFieldConfigurationsContainer as p,getEffectiveLayerCapabilities as m}from"../../layers/support/layerUtils.js";import{formatAnyDate as h,isAnyDateField as g}from"../../smartMapping/support/utils.js";import{loadArcade as _}from"../../support/loadArcade.js";import{getTimeZoneFormattingOptions as v}from"../../time/timeZoneUtils.js";const y=()=>e.getLogger(`esri.popup.support.featureUtils`),b=/href=(""|'')/gi,ee=/(\{([^{\r\n]+)\})/g,te=/'/g,x=/^\s*expression\//i,ne=/(\n)/gi,re=/[\u00A0-\u9999<>&]/gim,ie=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ae=/^(?:mailto:|tel:)/,S=`relationships/`,C=i(`short-date-short-time`);function oe(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}const se=new Set([`building`,`knowledge-graph`,`link-chart`,`map-image`,`map-notes`,`subtype-group`,`tile`]);function ce(e){let t=e?.origin;return(t==null?void 0:se.has(t.type??``)?t.sublayer:t.layer)??e?.layer}function le(e,t){let r=n(e);r&&`layer`in r&&r.layer&&(r=r.layer);let i=r?.type===`subtype-sublayer`?r.parent:r;return i&&t?.allLayers.includes(i)?r:e.layer??r}function ue(e,t,n){let r=t.type===`subtype-sublayer`&&t.parent&&n?.allLayers?.includes(t.parent)?t.parent:n?.allLayers?.includes(t)?t:null;return r?e.when().then(()=>e.whenLayerView(r)):null}async function w({type:e,value:t,event:n}){try{return typeof t==`function`?t(n):await t}catch(r){y().error(`error`,`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t});return}}function T(e=``){if(e)return!ae.test(e.trim().toLowerCase())}function E(e){return e?x.test(e):!1}function de(e,t){if(!t||!E(t)||!e)return;let n=t.replace(x,``).toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function D(e){let{fieldInfo:t,graphic:n,layer:r}=e;return fe({fieldInfo:t,graphic:n})?p(r,{graphic:n}):null}function fe({fieldInfo:e,graphic:t}){return!!e?.fieldName&&!E(e.fieldName)&&!J(e.fieldName)&&!t?.popupTemplate}function pe({expressionInfos:e,fieldInfo:t,graphic:n,isContentFieldInfos:r,layer:i}){if(!t?.fieldName)return null;let a=de(e,t.fieldName);if(a)return a.title||null;let o=D({fieldInfo:t,graphic:n,layer:i});if(o){let e=o.getFieldAlias(t.fieldName);return r?t.label||e||t.fieldName:e||t.fieldName}return t.label||t.fieldName}function O(e){let{configurableFieldsContainer:t,fieldInfo:n,isContentFieldInfos:r}=e;if(!n?.fieldName)return null;let i=!t.popupTemplate&&!t.fieldConfigurations?l(n,t.getField(n.fieldName)):t.getFieldConfiguration(n.fieldName)?.fieldFormat;return r&&n.fieldFormat||i}function me(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function he(e){return e.replaceAll(b,``)}function k(e,t){let n=A(t,e);return n?n.name:e}function ge(e,t){return e&&e.map(e=>k(e,t))}function A(e,t){return!(e&&typeof e.getField==`function`)||!t?null:e.getField(t)??null}function j(e){return`${e}`.trim()}function M({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?N({formattedAttributes:t,template:_e(r,{...t,...i,...e},n),fieldInfoMap:a}):``}function N({formattedAttributes:e,template:n,fieldInfoMap:r}){return j(he(t(t(n,e=>me(e,r)),e)))}function P(e,t,n=!1){let r=t[e];typeof r==`string`&&(t[e]=(n?encodeURIComponent(r):r).replaceAll(te,`%27`))}function F(e,t=!1){let n={...e};return Object.keys(n).forEach(e=>P(e,n,t)),n}function I(e,n,r){n=j(n);let i=n&&!n.startsWith(`{`);return t(e,F(r,i||!1))}function L(e,t){return e.replaceAll(ee,(e,n,r)=>{let i=A(t,r);return i?`{${i.name}}`:n})}function _e(e,t,n){let r=L(e,n);return r&&r.replaceAll(ie,(e,n,r)=>I(e,n||r,t))}function ve(e,t){let n=t?.fieldFormat?.type===`number`||t?.format&&t.format.dateFormat==null&&(t.format.places!=null||t.format.digitSeparator!=null);if(typeof e==`string`&&n){let t=Number(e);if(!isNaN(t))return t}return e}function R(e){return typeof e==`object`&&!!e&&`fieldsIndex`in e&&`geometryType`in e&&`getField`in e&&`load`in e&&`loaded`in e&&`objectIdField`in e&&`spatialReference`in e&&`type`in e&&(e.type===`feature`||e.type===`scene`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e}function z(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatureCount`in e&&`queryObjectIds`in e&&`queryRelatedFeatures`in e&&`queryRelatedFeaturesCount`in e&&`relationships`in e}function B(e){return R(e)&&z(e)}function ye(e){return e&&typeof e==`object`&&`createQuery`in e&&`getField`in e&&`queryFeatureCount`in e&&`queryFeatures`in e&&`queryObjectIds`in e&&`capabilities`in e&&`fields`in e&&`fieldsIndex`in e&&`type`in e&&(e.type===`feature`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e?e.type===`subtype-sublayer`&&`parent`in e&&e.parent&&typeof e.parent==`object`?`globalIdField`in e.parent:`globalIdField`in e:!1}function be(e){return!e||typeof e!=`object`?!1:B(n(e))}function V(e,t){let{fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:c,layer:l,preventPlacesFormatting:d,timeZone:f}=t,p=U(n,r),m=D({fieldInfo:p,graphic:i,layer:l}),g=A(m||l,r),_=m?null:p?.format,v=m?O({configurableFieldsContainer:m,fieldInfo:p,isContentFieldInfos:c}):null,y=v?.type===`number`;if(p&&!u(r)){let t=g?.type,n=v?.type===`date-time`,r=_?.dateFormat;if(t===`date`||t===`date-only`||t===`time-only`||t===`timestamp-offset`||n||r)return h(e,{format:n?void 0:r,fieldFormat:n?v:void 0,fieldType:t,timeZoneOptions:{layerTimeZone:l&&`preferredTimeZone`in l?l.preferredTimeZone:null,viewTimeZone:f,datesInUnknownTimezone:l&&`datesInUnknownTimezone`in l?!!l.datesInUnknownTimezone:!1}})}if(typeof e==`string`&&u(r)&&_)return xe(e,_);if(e=ve(e,{format:y?void 0:_,fieldFormat:y?v:void 0}),typeof e==`string`||e==null||_==null&&v==null)return G(e);let b=y?a(v):_?o(_):void 0;return d?s(e,{...b,minimumFractionDigits:0,maximumFractionDigits:20}):s(e,b)}function xe(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(`,`)?H(e,`,`,`, `,t):e.includes(`;`)?H(e,`;`,`; `,t):e.includes(` `)?H(e,` `,` `,t):s(Number(e),o(t))}function H(e,t,n,r){return e.trim().split(t).map(e=>s(Number(e),o(r))).join(n)}function U(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function Se({fieldName:e,graphic:t,layer:n}){if(J(e)||!n||typeof n.getFeatureType!=`function`)return null;let{typeIdField:r}=n;if(!r||e!==r)return null;let i=n.getFeatureType(t);return i?i.name:null}function W({fieldName:e,value:t,graphic:n,layer:r}){if(J(e)||!r||typeof r.getFieldDomain!=`function`)return null;let i=n&&r.getFieldDomain(e,{feature:n});return!i||i.type!==`coded-value`?null:i.getName(t)}function Ce(e,t,n,i){let{creatorField:a,creationDateField:o,editorField:s,editDateField:c}=e;if(!t)return;let l=v(i&&`preferredTimeZone`in i?i.preferredTimeZone:null,i&&`datesInUnknownTimezone`in i?!!i.datesInUnknownTimezone:!1,n,C,`date`),u={...C,...l},d=t[c];if(typeof d==`number`){let e=t[s];return{type:`edit`,date:r(d,u),user:e}}let f=t[o];if(typeof f==`number`){let e=t[a];return{type:`create`,date:r(f,u),user:e}}return null}function we(e,t){let n=new Map;if(!e)return n;for(let r of e){if(!r.fieldName)continue;let e=k(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function Te(e){let t=[];if(!e)return t;let{fieldInfos:n,content:r}=e;return n&&t.push(...n),!r||!Array.isArray(r)||r.forEach(e=>{if(e.type===`fields`){let n=e?.fieldInfos;n&&t.push(...n)}}),t}function Ee(e){return e.replaceAll(re,e=>`&#${e.charCodeAt(0)};`)}function G(e){return typeof e==`string`?e.replaceAll(ne,`<br class="esri-text-new-line" />`):e}function K(e){let{fieldInfoMap:t,fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s,value:l}=e;if(l==null)return``;let u=W({fieldName:r,value:l,graphic:i,layer:o});if(u)return u;let d=o?.types&&c(o.types)?Se({fieldName:r,graphic:i,layer:o}):null;if(d)return d;if(t.get(r.toLowerCase()))return V(l,{fieldInfos:n||Array.from(t.values()),fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s});let p=o?.fieldsIndex?.get(r);return p&&(g(p)||f(p))?h(l,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&`preferredTimeZone`in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:o&&`datesInUnknownTimezone`in o?!!o.datesInUnknownTimezone:!1}}):G(l)}function De({attributes:e,fieldInfoMap:t,fieldInfos:n,graphic:r,isContentFieldInfos:i,layer:a,relatedInfos:o,timeZone:s}){let c={};return o?.forEach(e=>Me({attributes:c,relatedInfo:e,fieldInfoMap:t,fieldInfos:n,layer:a,timeZone:s})),e&&Object.keys(e).forEach(o=>{let l=e[o];c[o]=K({fieldInfoMap:t,fieldInfos:n,fieldName:o,graphic:r,isContentFieldInfos:i,layer:a,timeZone:s,value:l})}),c}async function q(e,t){let{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:s}=e,c=a[0];if(typeof c!=`number`&&typeof c!=`string`){let e={layer:n,graphic:r,objectId:c,requiredFields:i};return y().warn(`Could not query required fields for the specified feature. The feature's ID is invalid.`,e),null}if(!m(n)?.operations?.supportsQuery){let e={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return y().warn(`The specified layer cannot be queried. The following fields will not be available.`,e),null}let l=n.createQuery();return l.objectIds=a,l.outFields=i?.length?i:[n.objectIdField],l.returnGeometry=!!o,l.returnZ=!!o,l.returnM=!!o,l.outSpatialReference=s,(await n.queryFeatures(l,t)).features[0]}async function Oe(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{hasGeometryFunctions:t}}=await _();return t(e)}async function ke(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{requiresTrack:t}}=await _();return t(e)}async function Ae({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t||(typeof n.load==`function`&&await n.load(i),!e.attributes))return;let a=n.objectIdField,o=e.attributes[a];if(o==null)return;let s=[o],c=new Set(await t.getRequiredFields(n.fieldsIndex));n.timeInfo?.trackIdField!=null&&!c.has(n.timeInfo.trackIdField)&&await ke(t)&&c.add(n.timeInfo.trackIdField);let l=d(e,c),u=l?[]:c.has(a)?[...c]:[...c,a],f=t.returnGeometry||await Oe(t);if(l&&!f)return;let p=await q({layer:n,graphic:e,outFields:u,objectIds:s,returnGeometry:f,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function J(e=``){return e?e.includes(S):!1}function je(e){return e?`${S}${e.layerId}/${e.fieldName}`:``}function Y({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(s=>{let c=je({layerId:n.relation.id.toString(),fieldName:s}),l=t.attributes[s];e[c]=K({fieldName:c,fieldInfos:r,fieldInfoMap:i,layer:a,value:l,graphic:t,timeZone:o})})}function Me({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}const X=e=>{if(!e)return!1;let t=e.toUpperCase();return t.includes(`CURRENT_TIMESTAMP`)||t.includes(`CURRENT_DATE`)||t.includes(`CURRENT_TIME`)},Z=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||t===`attachments`)return;let i=n.where==null?null:n.where,a=n.geometry==null?null:n.geometry;e.capabilities.query.supportsCacheHint&&!X(r)&&!X(i)&&a?.type!==`extent`&&n.resultType!==`tile`&&(n.cacheHint=!0)},Ne=({query:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})},Pe=({queryPayload:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})};function Fe(e,t,n){return!e||!t||!n?null:t.type===`sublayer`?$({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||$({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):$({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||$({layers:e.allTables,map:e,relatedLayer:t,relationship:n})}function Ie(e,t){return!e||!(`utilityNetworks`in e)||!t?null:e.utilityNetworks?.find(e=>e.isUtilityLayer(t))}function Q(e,t){return e?.allTables.find(e=>e.type===`feature`&&e.layerId===t.id&&e.url===t.layer?.url)}function $({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(let a of i){if(a.type===`map-image`){let n=$({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||$({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!B(a))continue;if(r.type===`sublayer`){if(a!==r&&a.id===n)return a.isTable?Q(e,a):a;continue}let i=r.type===`scene`&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if(a.type===`sublayer`){if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?Q(e,a):a}else if(a!==r&&a.url===i&&a.layerId===n)return a}return null}export{G as applyTextFormattingHTML,we as createFieldInfoMap,Fe as findRelatedLayer,Ie as findUtilityNetwork,L as fixTokens,De as formatAttributes,Ce as formatEditInfo,V as formatValueToFieldInfo,Te as getAllFieldInfos,D as getConfigurableFieldsContainer,O as getFieldFormat,U as getFieldInfo,pe as getFieldInfoLabel,k as getFixedFieldName,ge as getFixedFieldNames,le as getHighlightLayer,ue as getHighlightLayerView,ce as getPopupLayer,oe as getSourceLayer,w as graphicCallback,Ee as htmlEntities,ye as isAssociatedFeatureSupportedLayer,E as isExpressionField,R as isFeatureSupportedLayer,be as isGraphicForRelatableFeatureSupportedLayer,B as isRelatableFeatureSupportedLayer,z as isRelatableLayer,J as isRelatedField,Ne as preLayerQueryCallback,Pe as preRequestCallback,q as querySourceLayer,Ae as queryUpdatedFeature,T as shouldOpenInNewTab,N as substituteAttributes,M as substituteFieldsInLinksAndAttributes};
@@ -159,11 +159,6 @@ export default class FeatureService extends FeatureServiceSuperclass {
159
159
  * > Example: The service has a horizontal spatial reference with `feet` units, and `applyEdits()` is called with z-values based on `meter` units,
160
160
  * > then the method will automatically convert the z values from `meter` to `feet` units. `applyEdits()` will pass in a `sessionId` during an active edit session.
161
161
  *
162
- * > [!WARNING]
163
- * >
164
- * > The `deleteAssociations`, `combineGroupedObjects`, and `divideGroupedObjects` edits are in beta and are reserved for
165
- * > future use in a telecom domain network.
166
- *
167
162
  * @param edits - Object containing features and attachments to be added, updated or deleted.
168
163
  * @param options - Additional edit options to specify when editing features or attachments.
169
164
  * @returns Results returned from the [applyEdits()](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/FeatureService/#applyEdits) method. It contains features
@@ -67,9 +67,10 @@ export default class TraceLocation extends TraceLocationSuperclass {
67
67
  accessor percentAlong: number;
68
68
  /**
69
69
  * The terminal Id to place the starting location at. Applicable for junction/device sources only. Users can use `getTerminalConfiguration()` in [UtilityNetwork](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/) to get the terminal.
70
+ *
70
71
  * > [!NOTE]
71
72
  * >
72
- * > The telecom domain network no longer uses terminal IDs as of beta 2. However, as of beta 2, point features and junction objects used as a `TraceLocation` in a telecom domain network must specify `terminalId: 1`, else the trace location cannot be found.
73
+ * > Point features and junction objects used as a `TraceLocation` in a telecom domain network must specify `terminalId: 1`, or the trace location cannot be found.
73
74
  *
74
75
  * @see [Terminal](https://developers.arcgis.com/javascript/latest/references/core/networks/support/Terminal/)
75
76
  */
@@ -31,10 +31,6 @@ export default class TraceResult extends JSONSupport {
31
31
  /**
32
32
  * An array of network elements returned by the trace. The network element is a representation of how the network topology defines its graph.
33
33
  * This is returned only if the elements result type is defined in the trace configuration.
34
- * > [!WARNING]
35
- * >
36
- * > The elements property returning a [TelecomNetworkElement](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TelecomNetworkElement/) is in beta and is reserved for
37
- * > future use in a telecom domain network.
38
34
  *
39
35
  * @see [NetworkElement](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/NetworkElement/)
40
36
  * @see [TelecomNetworkElement](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/TelecomNetworkElement/)
@@ -45,7 +45,6 @@ export default class OutDistance extends OutDistanceSuperclass {
45
45
  * Indicates whether to return features sorted by distance.
46
46
  * The `"ascending"` option returns the nearest features first while the `"descending"` option returns farthest
47
47
  * features first, and null indicates there should be no distance-based ordering.
48
- * A `null` value indicates that there should be no distance-based ordering.
49
48
  *
50
49
  * @since 5.2
51
50
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"./histogram.js";import t from"./summaryStatisticsForTimeSeries.js";import{processTimeSeriesParams as n,combineHistograms as r}from"./support/timeSeriesUtils.js";async function i(i){let{statisticInputs:a,...o}=await n(i,`histogram-for-time-series`),s=o.minValue==null||o.maxValue==null?await t({...i,minValue:void 0,maxValue:void 0}):void 0,c=o.minValue??s?.min,l=o.maxValue??s?.max;if(c==null||l==null)return{bins:[],minValue:c,maxValue:l};let u=await Promise.all(a.map(t=>e({...o,...t,classificationMethod:`equal-interval`,minValue:c,maxValue:l})));return r(u)}export{i as default};
2
+ import{throwIfAborted as e}from"../../core/promiseUtils.js";import{getSourceLayer as t}from"../../layers/support/dataSeriesUtils.js";import n from"./histogram.js";import r from"./summaryStatisticsForTimeSeries.js";import{processTimeSeriesParams as i,combineHistograms as a}from"./support/timeSeriesUtils.js";import{createLayerAdapter as o,featureCapableLayerTypes as s}from"../support/adapters/support/layerUtils.js";async function c(c){let{statisticInputs:l,...u}=await i(c,`histogram-for-time-series`),d=u.minValue==null||u.maxValue==null?await r({...c,minValue:void 0,maxValue:void 0}):void 0,f=u.minValue??d?.min,p=u.maxValue??d?.max;if(f==null||p==null)return{bins:[],minValue:f,maxValue:p};let m=l.flatMap(e=>`field`in e?[e.field]:[]);if(!u.forBinning&&m.length>1&&m.length<=50&&m.length===l.length){let r=o(u.layer,s,u.forBinning);if(r){await r.load(u.signal==null?null:{signal:u.signal});let i=t(r),a=r.getField(m[0])?.type;if(r.supportsSQLExpression&&i?.capabilities?.operations?.supportsQueryPivot&&m.every(e=>r.getField(e)?.type===a))try{return await n({...u,fields:m,classificationMethod:`equal-interval`,minValue:f,maxValue:p})}catch{e(u.signal)}}}let h=await Promise.all(l.map(e=>n({...u,...e,classificationMethod:`equal-interval`,minValue:f,maxValue:p})));return a(h)}export{c as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"./summaryStatistics.js";import{processTimeSeriesParams as t,combineSummaryStatistics as n}from"./support/timeSeriesUtils.js";import{processSummaryStatisticsResult as r}from"../../statistics/utils.js";async function i(i){let{statisticInputs:a,...o}=await t(i,`summary-statistics-for-time-series`),s=await Promise.all(a.map(t=>e({...o,...t,outStatisticTypes:{exclude:[`median`]}})));return r(n(s),o.outStatisticTypes)}export{i as default};
2
+ import e from"./summaryStatistics.js";import{processTimeSeriesParams as t,combineSummaryStatistics as n}from"./support/timeSeriesUtils.js";import{createLayerAdapter as r,featureCapableLayerTypes as i}from"../support/adapters/support/layerUtils.js";import{processSummaryStatisticsResult as a}from"../../statistics/utils.js";async function o(o){let{statisticInputs:s,...c}=await t(o,`summary-statistics-for-time-series`),l=s.flatMap(e=>`field`in e?[e.field]:[]);if(!c.forBinning&&l.length>1&&l.length===s.length){let t=r(c.layer,i,c.forBinning);if(t){await t.load(c.signal==null?null:{signal:c.signal});let n=t.getField(l[0])?.type;if(l.every(e=>t.getField(e)?.type===n)){let t=await e({...c,fields:l,outStatisticTypes:{exclude:[`median`]}});return a(t,c.outStatisticTypes)}}}let u=await Promise.all(s.map(t=>e({...c,...t,outStatisticTypes:{exclude:[`median`]}})));return a(n(u),c.outStatisticTypes)}export{o as default};
@@ -16,8 +16,8 @@ export interface BasemapStyleProperties extends Partial<Pick<BasemapStyle, "apiK
16
16
  *
17
17
  * > [!CAUTION]
18
18
  * >
19
- * > Use of the basemap style service requires authentication via an [API key](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-apiKey) or [user authentication](https://developers.arcgis.com/javascript/latest/secure-resources/#user-authentication). To learn more about API keys,
20
- * > see the [API keys](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/api-keys/) section in the Esri Developer documentation.
19
+ * > Use of the basemap style service requires authentication via an [API key](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-apiKey) or [user authentication](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#user-authentication). To learn more about API keys,
20
+ * > see the [API key authentication](https://developers.arcgis.com/javascript/latest/authentication/access-tokens/#api-key-authentication) section.
21
21
  *
22
22
  * @since 4.28
23
23
  * @see [Basemap styles service (v2)](https://developers.arcgis.com/rest/basemap-styles/)
@@ -266,13 +266,13 @@ export interface CIMLineCallout extends CIMCallout {
266
266
  * Represents the leader line style for callouts. Line leaders will always be drawn with their own geometry.
267
267
  *
268
268
  * Supported values:
269
- * - `Base`: The line callout leader is a single line originating from the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the either top or bottom of the accent bar.
269
+ * - `Base`: The line callout leader is a single line originating from the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
270
270
  * - `MidPoint`: The line callout leader is a single line originating from the midpoint of the left or right side of the text box with the gap applied or from the midpoint of the accent bar if the callout has one.
271
271
  * - `ThreePoint`: The line callout leader is a 3-point line originating from the midpoint of the left or right side of the text box with the gap applied or the midpoint of the accent bar if the callout has one.
272
272
  * - `FourPoint`: The line callout leader is a 4-point line originating from the midpoint of the left or right side of the text box with the gap applied or the midpoint of the accent bar if the callout has one.
273
- * - `Underline`: The line callout draws a line that connects to the closest of the four corners of the text with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar. Additionally, either and underline or an "overline" is drawn along the closest side (bottom or top) of the text.
274
- * - `CircularCW`: The line callout leader is curved (clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the either top or bottom of the accent bar.
275
- * - `CircularCCW`: The line callout leader is curved (counter-clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at the either top or bottom of the accent bar.
273
+ * - `Underline`: The line callout draws a line that connects to the closest of the four corners of the text with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar. Additionally, either an underline or an "overline" is drawn along the closest side (bottom or top) of the text.
274
+ * - `CircularCW`: The line callout leader is curved (clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
275
+ * - `CircularCCW`: The line callout leader is curved (counter-clockwise) from the anchor point to the closest corner of the text box with the gap applied. If the callout has an accent bar it is connected to the closest point at either the top or bottom of the accent bar.
276
276
  *
277
277
  * @since 5.2
278
278
  */
@@ -343,7 +343,7 @@ export type LeaderLineStyle = "Base" | "MidPoint" | "ThreePoint" | "FourPoint" |
343
343
  * "accentBarSymbol": {
344
344
  * "type": "CIMLineSymbol",
345
345
  * "symbolLayers": [
346
- * * {
346
+ * {
347
347
  * "type": "CIMSolidStroke",
348
348
  * "enable": true,
349
349
  * "capStyle": "Round",
@@ -2693,7 +2693,6 @@ export interface CIMSymbolAnimationOffset extends CIMBaseAnimation {
2693
2693
  *
2694
2694
  * @since 5.1
2695
2695
  * @see [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine)
2696
- * @beta
2697
2696
  */
2698
2697
  export type MovementAlongLineType = "Distance" | "Speed";
2699
2698
 
@@ -2703,7 +2702,6 @@ export type MovementAlongLineType = "Distance" | "Speed";
2703
2702
  * The starting position of the marker(s) on the line geometry is determined by the [CIMMarkerPlacement](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMMarkerPlacement) properties of the symbol layer.
2704
2703
  *
2705
2704
  * @since 5.1
2706
- * @beta
2707
2705
  */
2708
2706
  export interface CIMSymbolAnimationMoveAlongLine extends CIMBaseAnimation {
2709
2707
  /**
@@ -2756,7 +2754,7 @@ export interface CIMSymbolAnimationMoveAlongLine extends CIMBaseAnimation {
2756
2754
  * [CIMSymbolAnimationTransparency](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationTransparency) | Represents a symbol animation that changes the transparency of a symbol.
2757
2755
  * [CIMSymbolAnimationRotation](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationRotation) | Represents a symbol animation that rotates a symbol to a given value.
2758
2756
  * [CIMSymbolAnimationOffset](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationOffset) | Represents a symbol animation that offsets a symbol to a given X or Y value.
2759
- * [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine) (beta) | Represents a symbol animation that moves a symbol along a line geometry.
2757
+ * [CIMSymbolAnimationMoveAlongLine](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMSymbolAnimationMoveAlongLine) | Represents a symbol animation that moves a symbol along a line geometry.
2760
2758
  *
2761
2759
  * > [!WARNING]
2762
2760
  * >
@@ -3025,7 +3023,7 @@ export interface CIMPointSymbolCallout extends CIMLineCallout {
3025
3023
  */
3026
3024
  pointSymbol: CIMPointSymbol;
3027
3025
  /**
3028
- * Defines how the background is scaled to fit the dimensions of the symbol.
3026
+ * Defines how the background is scaled to fit the dimensions of the text symbol.
3029
3027
  *
3030
3028
  * @since 5.2
3031
3029
  */
@@ -8,5 +8,5 @@ class e{generateSource(e){let t=[];for(let n=1;n<this.length;n++)t.push(`vec4 at
8
8
  cos1 * s1 * x2 - sin1 * s1 * y2 + x1,
9
9
  sin1 * s1 * x2 + cos1 * s1 * y2 + y1
10
10
  );
11
- `,`out0 = vec4(translation, rotation, scale);`]}encode(e){return[[this.opcode,0,0,0],[e.translation.from[0],e.translation.from[1],e.translation.to[0],e.translation.to[1]],[e.rotation.from,e.rotation.to,e.scale.from,e.scale.to],...p(e.translation.timing),...p(e.rotation.timing),...p(e.scale.timing),[+!!e.relativeTranslation,+!!e.absoluteScale,+!!e.selectGlobalRotation,0]]}}class h extends e{constructor(){super(...arguments),this.opcode=++t,this.length=7,this.ins=1,this.outs=1,this.microcode=[`float fromOpacity = atom0.y;`,`float toOpacity = atom0.z;`,`vec4 fromColor = atom1;`,`vec4 toColor = atom2;`,`float fColor;`,`{`,...c({duration:`atom3.x`,startTimeOffset:`atom3.y`,repeatDelay:`atom3.z`,timeOriginSelector:`atom3.w`,repeatType:`atom4.x`,easing:`atom4.y`,playAnimation:`atom4.z`,reverseAnimation:`atom4.w`,out:`fColor`}),`}`,`float fOpacity;`,`{`,...c({duration:`atom5.x`,startTimeOffset:`atom5.y`,repeatDelay:`atom5.z`,timeOriginSelector:`atom5.w`,repeatType:`atom6.x`,easing:`atom6.y`,playAnimation:`atom6.z`,reverseAnimation:`atom6.w`,out:`fOpacity`}),`}`,`vec4 aColor = mix(fromColor, toColor, fColor);`,`aColor.a *= mix(fromOpacity, toOpacity, fOpacity);`,`vec4 pColor = in0;`,`out0 = aColor * pColor;`]}encode(e){return[[this.opcode,e.opacity.from,e.opacity.to,0],[e.color.from[0],e.color.from[1],e.color.from[2],e.color.from[3]],[e.color.to[0],e.color.to[1],e.color.to[2],e.color.to[3]],...p(e.color.timing),...p(e.opacity.timing)]}}class g extends e{constructor(){super(...arguments),this.opcode=++t,this.length=4,this.ins=1,this.outs=1,this.microcode=[`float fromShift = atom0.y;`,`float toShift = atom0.z;`,`float duration = atom1.x;`,`bool multiplyToByLineLength = atom3.x == 1.0;`,`bool multiplyDurationByLineLength = atom3.y == 1.0;`,`bool continuous = atom3.z == 1.0;`,`toShift *= multiplyToByLineLength ? lineLength : 1.0;`,`duration *= multiplyDurationByLineLength ? lineLength : 1.0;`,`float fShift;`,`if (continuous) {`,...l({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`} else {`,...c({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,repeatType:`atom2.x`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`}`,`float aShift = mix(fromShift, toShift, fShift);`,`vec4 pShift = in0;`,`out0 = mod(aShift + pShift, lineLength);`]}encode(e){return[[this.opcode,e.shift.from,e.shift.to,0],...p(e.shift.timing),[+!!e.multiplyToByLineLength,+!!e.multiplyDurationByLineLength,+!!e.continuous,0]]}}const _={scalar:new r,vector3:new i,vector4:new a,animatedTransform:new m,animatedColor:new h,animatedShift:new g,ret:new n},v=4;function y(e){let t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`float lineLength = ${e.lineLength};`),t.push(`float globalRotation = ${e.globalRotation};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push(`int top = 0;`),t.push(`vec4 stack[4];`),t.push(`for (int counter = 0; counter < 40; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push(`pointer.x += 1.0;`),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push(`if (false) {`);for(let n in _){let r=_[n];t.push(`} else if (int(atom0.x) == ${r.opcode}) {`);for(let n of r.generateSource(e))t.push(n)}return t.push(`} // End if-else.`),t.push(`} // End for.`),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(`
11
+ `,`out0 = vec4(translation, rotation, scale);`]}encode(e){return[[this.opcode,0,0,0],[e.translation.from[0],e.translation.from[1],e.translation.to[0],e.translation.to[1]],[e.rotation.from,e.rotation.to,e.scale.from,e.scale.to],...p(e.translation.timing),...p(e.rotation.timing),...p(e.scale.timing),[+!!e.relativeTranslation,+!!e.absoluteScale,+!!e.selectGlobalRotation,0]]}}class h extends e{constructor(){super(...arguments),this.opcode=++t,this.length=7,this.ins=1,this.outs=1,this.microcode=[`float fromOpacity = atom0.y;`,`float toOpacity = atom0.z;`,`vec4 fromColor = atom1;`,`vec4 toColor = atom2;`,`float fColor;`,`{`,...c({duration:`atom3.x`,startTimeOffset:`atom3.y`,repeatDelay:`atom3.z`,timeOriginSelector:`atom3.w`,repeatType:`atom4.x`,easing:`atom4.y`,playAnimation:`atom4.z`,reverseAnimation:`atom4.w`,out:`fColor`}),`}`,`float fOpacity;`,`{`,...c({duration:`atom5.x`,startTimeOffset:`atom5.y`,repeatDelay:`atom5.z`,timeOriginSelector:`atom5.w`,repeatType:`atom6.x`,easing:`atom6.y`,playAnimation:`atom6.z`,reverseAnimation:`atom6.w`,out:`fOpacity`}),`}`,`vec4 aColor = mix(fromColor, toColor, fColor);`,`aColor.a *= mix(fromOpacity, toOpacity, fOpacity);`,`vec4 pColor = in0;`,`out0 = aColor * pColor;`]}encode(e){return[[this.opcode,e.opacity.from,e.opacity.to,0],[e.color.from[0],e.color.from[1],e.color.from[2],e.color.from[3]],[e.color.to[0],e.color.to[1],e.color.to[2],e.color.to[3]],...p(e.color.timing),...p(e.opacity.timing)]}}class g extends e{constructor(){super(...arguments),this.opcode=++t,this.length=4,this.ins=1,this.outs=1,this.microcode=[`float fromShift = atom0.y;`,`float toShift = atom0.z;`,`float duration = atom1.x;`,`bool multiplyToByLineLength = atom3.x == 1.0;`,`bool multiplyDurationByLineLength = atom3.y == 1.0;`,`bool continuous = atom3.z == 1.0;`,`toShift *= multiplyToByLineLength ? lineLength : 1.0;`,`duration *= multiplyDurationByLineLength ? lineLength : 1.0;`,`float fShift;`,`if (continuous) {`,...l({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`} else {`,...c({duration:`duration`,startTimeOffset:`atom1.y`,repeatDelay:`atom1.z`,timeOriginSelector:`atom1.w`,repeatType:`atom2.x`,easing:`atom2.y`,playAnimation:`atom2.z`,reverseAnimation:`atom2.w`,out:`fShift`}),`}`,`if (lineLength < 50.0) {`,` fShift = 0.0;`,`}`,`float aShift = mix(fromShift, toShift, fShift);`,`vec4 pShift = in0;`,`out0 = mod(aShift + pShift, lineLength);`]}encode(e){return[[this.opcode,e.shift.from,e.shift.to,0],...p(e.shift.timing),[+!!e.multiplyToByLineLength,+!!e.multiplyDurationByLineLength,+!!e.continuous,0]]}}const _={scalar:new r,vector3:new i,vector4:new a,animatedTransform:new m,animatedColor:new h,animatedShift:new g,ret:new n},v=4;function y(e){let t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`float lineLength = ${e.lineLength};`),t.push(`float globalRotation = ${e.globalRotation};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push(`int top = 0;`),t.push(`vec4 stack[4];`),t.push(`for (int counter = 0; counter < 40; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push(`pointer.x += 1.0;`),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push(`if (false) {`);for(let n in _){let r=_[n];t.push(`} else if (int(atom0.x) == ${r.opcode}) {`);for(let n of r.generateSource(e))t.push(n)}return t.push(`} // End if-else.`),t.push(`} // End for.`),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(`
12
12
  `)}export{e as AAnimationInstruction,h as AnimatedColorInstruction,g as AnimatedShiftInstruction,m as AnimatedTransformInstruction,n as RetInstruction,r as ScalarInstruction,i as Vector3Instruction,a as Vector4Instruction,u as easingCodes,y as generateVirtualMachineSource,c as getTweenFactor,l as getUnclampedTweenFactor,_ as instructions,d as repeatTypeCodes,f as timeOriginSelectorCodes};