@arcgis/core 5.2.0-next.168 → 5.2.0-next.169

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 (68) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/546f5f57c9249627bb89.js +1 -0
  3. package/assets/esri/core/workers/chunks/{c0a956d57fa28fd31052.js → 8d86b0cb0e004ad72040.js} +1 -1
  4. package/config.js +1 -1
  5. package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
  6. package/geometry/operators/containsOperator.d.ts +1 -1
  7. package/geometry/operators/densifyOperator.d.ts +1 -1
  8. package/geometry/operators/differenceOperator.d.ts +6 -4
  9. package/geometry/operators/distanceOperator.d.ts +1 -1
  10. package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
  11. package/geometry/operators/graphicBufferOperator.d.ts +6 -6
  12. package/geometry/operators/integrateOperator.d.ts +2 -2
  13. package/geometry/operators/intersectsOperator.d.ts +3 -3
  14. package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
  15. package/geometry/operators/locateBetweenOperator.d.ts +2 -2
  16. package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
  17. package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
  18. package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
  19. package/geometry/operators/projectOperator.d.ts +2 -2
  20. package/geometry/operators/proximityOperator.d.ts +15 -15
  21. package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
  22. package/geometry/operators/simplifyOperator.d.ts +2 -2
  23. package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
  24. package/geometry/operators/support/Transformation.d.ts +8 -8
  25. package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
  26. package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
  27. package/geometry/operators/withinOperator.d.ts +3 -3
  28. package/kernel.js +1 -1
  29. package/layers/GeospatialPDFLayer.d.ts +2 -2
  30. package/layers/ParquetLayer.d.ts +1 -1
  31. package/package.json +2 -2
  32. package/popup/FeaturesModel.js +1 -1
  33. package/popup/support/featureUtils.js +1 -1
  34. package/rest/featureService/FeatureService.d.ts +0 -5
  35. package/rest/networks/support/TraceLocation.d.ts +2 -1
  36. package/rest/networks/support/TraceResult.d.ts +0 -4
  37. package/rest/support/OutDistance.d.ts +0 -1
  38. package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
  39. package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
  40. package/symbols/cim/types.d.ts +7 -9
  41. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  42. package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
  43. package/views/2d/layers/features/FeatureContainer.js +1 -1
  44. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  45. package/views/3d/environment/SunLighting.d.ts +15 -2
  46. package/views/3d/environment/VirtualLighting.d.ts +15 -2
  47. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  48. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  49. package/views/draw/DrawOperation.js +1 -1
  50. package/views/draw/DrawScreenTool.js +1 -1
  51. package/views/input/types.d.ts +2 -4
  52. package/views/interactive/options/LabelOptions.d.ts +5 -5
  53. package/views/interactive/options/SnappingOptions.d.ts +2 -2
  54. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +0 -1
  55. package/widgets/Editor/VisibleElements.d.ts +4 -0
  56. package/widgets/Editor.d.ts +2 -0
  57. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  58. package/widgets/FeatureTable.js +1 -1
  59. package/widgets/Features/FeaturesViewModel.js +1 -1
  60. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  61. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
  62. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  63. package/widgets/PanoramicViewer/utils.js +1 -1
  64. package/widgets/Search/LayerSearchSource.d.ts +1 -1
  65. package/widgets/Sketch/VisibleElements.d.ts +4 -0
  66. package/widgets/Sketch.d.ts +2 -0
  67. package/widgets/support/iconUtils.js +1 -1
  68. package/assets/esri/core/workers/chunks/181b58bbbbfe4557ab5d.js +0 -1
@@ -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/5.2/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=`5.2.0-next.168`;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=`5.2.0-next.169`;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
@@ -365,7 +365,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
365
365
  /** Describes the layer's supported capabilities. */
366
366
  get capabilities(): FeatureLayerCapabilities | null | undefined;
367
367
  /**
368
- * Array of Chart Items of type WebMapWebChart available on the parquet layer.
368
+ * Array of chart items of type WebMapWebChart available on the Parquet layer.
369
369
  *
370
370
  * @since 5.2
371
371
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.168",
3
+ "version": "5.2.0-next.169",
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.20.8",
23
- "@arcgis/toolkit": "5.2.0-next.168",
23
+ "@arcgis/toolkit": "5.2.0-next.169",
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.2",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/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){if(e==null){this.featureCount||this._set(`featurePage`,null);return}!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;if(this.initialDisplayMode===`list`){n||(this.selectedFeatureIndex=-1);return}if(n&&t===-1){this.selectedFeatureIndex=0;return}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);return}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);return}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){if(e==null){this.featureCount||this._set(`featurePage`,null);return}!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;if(this.initialDisplayMode===`list`){n||(this.selectedFeatureIndex=-1);return}if(n&&t===-1){this.selectedFeatureIndex=0;return}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);return}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);return}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/5.2/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;continue}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;continue}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/)
@@ -44,7 +44,6 @@ export default class OutDistance extends OutDistanceSuperclass {
44
44
  * Indicates whether to return features sorted by distance.
45
45
  * The `"ascending"` option returns the nearest features first while the `"descending"` option returns farthest
46
46
  * features first, and null indicates there should be no distance-based ordering.
47
- * A `null` value indicates that there should be no distance-based ordering.
48
47
  *
49
48
  * @since 5.2
50
49
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/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/5.2/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};
@@ -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
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=0,p=0,m=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.bounds=d,this.recordStart=f,this.recordCount=p,this.additionalRecordRanges=m,this.priority=0,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let l=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,u=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,d=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),f=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+f,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:l,maxLod:u})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){if(t!==0){if(e===this.recordStart+this.recordCount){this.recordCount+=t;return}this.additionalRecordRanges.push({recordStart:e,recordCount:t})}}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this._colliders=null)}includeCalloutPartCollisionBounds(e){let t=o(e);t&&!this.bounds.some(e=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)&&(this.bounds.push(t),this._colliders=null)}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.push(this.additionalRecordRanges.length);for(let t of this.additionalRecordRanges)e.push(t.recordStart),e.push(t.recordCount);e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){let t=e.readInt32(),r=e.readInt32(),o=e.readInt32(),s=e.readInt32(),c=e.readInt32(),l=e.readInt32(),u=e.readInt32(),d=[];for(let t=0;t<u;t++)d.push({recordStart:e.readInt32(),recordCount:e.readInt32()});let f=e.readF32(),p=e.readF32(),m=e.readF32(),h=e.readF32(),g=e.readF32(),_=e.readF32(),v=e.readF32(),y=e.readF32(),b=e.readF32(),x=i(e,n)??[];return new a(t,r,o,s,f,p,m,h,g,_,{size:v,offsetX:y,offsetY:b},x,c,l,d)}}function o(e){let t=e.xmax-e.xmin,r=e.ymax-e.ymin;return e.xmin==null||isNaN(e.xmin)||e.ymin==null||isNaN(e.ymin)||e.xmax==null||isNaN(e.xmax)||e.ymax==null||isNaN(e.ymax)||t<=0||r<=0?null:new n(e.xmin+t/2,-(e.ymin+r/2),t,r)}export{a as LabelMetric};
2
+ import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=0,p=0,m=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.bounds=d,this.recordStart=f,this.recordCount=p,this.additionalRecordRanges=m,this.priority=0,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}invalidateColliders(){this._colliders=null}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let l=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,u=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,d=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),f=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+f,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:l,maxLod:u})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){if(t!==0){if(e===this.recordStart+this.recordCount){this.recordCount+=t;return}this.additionalRecordRanges.push({recordStart:e,recordCount:t})}}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this.invalidateColliders())}includeCalloutPartCollisionBounds(e){let t=o(e);t&&!this.bounds.some(e=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)&&(this.bounds.push(t),this.invalidateColliders())}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.push(this.additionalRecordRanges.length);for(let t of this.additionalRecordRanges)e.push(t.recordStart),e.push(t.recordCount);e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){let t=e.readInt32(),r=e.readInt32(),o=e.readInt32(),s=e.readInt32(),c=e.readInt32(),l=e.readInt32(),u=e.readInt32(),d=[];for(let t=0;t<u;t++)d.push({recordStart:e.readInt32(),recordCount:e.readInt32()});let f=e.readF32(),p=e.readF32(),m=e.readF32(),h=e.readF32(),g=e.readF32(),_=e.readF32(),v=e.readF32(),y=e.readF32(),b=e.readF32(),x=i(e,n)??[];return new a(t,r,o,s,f,p,m,h,g,_,{size:v,offsetX:y,offsetY:b},x,c,l,d)}}function o(e){let t=e.xmax-e.xmin,r=e.ymax-e.ymin;return e.xmin==null||isNaN(e.xmin)||e.ymin==null||isNaN(e.ymin)||e.xmax==null||isNaN(e.xmax)||e.ymax==null||isNaN(e.ymax)||t<=0||r<=0?null:new n(e.xmin+t/2,-(e.ymin+r/2),t,r)}export{a as LabelMetric};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import i from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this._writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}_writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
2
+ import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import i from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this._writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}invalidateColliders(){for(let e of this._entries.values())e.invalidateColliders()}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}_writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as n}from"../../../../core/signal.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as a,filterFlag0 as o}from"../../engine/webgl/definitions.js";import s from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as c}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as l}from"./FeatureTilePresentStrategy.js";import{RenderState as u}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";import{createHittestQuery as f}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class m{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class h{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class g{constructor(e,t){this.id=e,this.version=t}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=n(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=n(null),this._renderStateNext=n(null),this._store=new s,this._subscriptions=new Map,this._presentation=new l,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.removeAllChildren(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value),super.destroy()}get batching(){return has(`featurelayer-strict-draw-order`)?1:has(`featurelayer-force-marker-text-draw-order`)?2:0}get firstDrawTime(){return this._firstDrawTime}get updating(){let e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,n=!!this._renderStateNext.value,r=this.attributeView.updating;return e||t||n||r}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this.labelSchema!==null}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e+=this.labelStore.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw Error(`InternalError: DeconflictionInfo not defined. Was update called?`);return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&c.heatmap.drawPhase))return null;for(let e of this._instanceStore.values())if(v(e))return e;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){let e=new Set;for(let t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(let t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(let e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this.labelStore.upload(e.context),this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 8:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&this._schema?.mesh.factory.symbology.type!==`dictionary`,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,n){return this._updateResolver=new m({schema:e,deconflictionInfo:t,invalidateMesh:n}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e)}updateSubscriptions(e){for(let{tileId:t,version:n}of e.subscribe){if(!this._subscriptions.has(t)){let e=new g(t,n);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=n}for(let t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){let t=this.attributeView.getFilterFlags(e),n=t&o,r=this._layerView.featureEffectView.featureEffect==null||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&a;return!(n&&r)}getDisplayStatistics(e,t){let n=this._statisticsByLevel.get(e);return n?n.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates){this._updateStatisticsRequests.push({level:e,statistics:t});return}let n=this._statisticsByLevel.get(e);n||(n=new Map,this._statisticsByLevel.set(e,n));for(let e of t)n.set(e.fieldName,{minValue:e.minValue,maxValue:e.maxValue})}beginLevelMeshUpdate(e){if(this._pendingLevelUpdate!=null)throw Error(`InternalError: Pending level mesh update in progress`);return this._pendingLevelUpdate=new h(e),has(`esri-2d-update-debug`)&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(this._pendingLevelUpdate==null)throw Error(`InternalError: No level mesh update to apply`);if(this._pendingLevelUpdate.id!==e)throw Error(`InternalError: Unexpected id`);if(has(`esri-2d-update-debug`)){let{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}let{level:t,messages:n}=this._pendingLevelUpdate,r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.enqueueLevelReplace(t,n),this._pendingLevelUpdate=null,this.requestRender()}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&=(this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),!1),this._lockStatisticUpdates=!1;for(let e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw Error(`InternalError: renderStateNext already exists`);has(`esri-2d-update-debug`)&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new u(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme,this.labelStore)}async swapRenderState(){if(!this._renderStateNext.value)throw Error(`InternalError: renderStateNext not yet created`);if(this._renderStateSwapResolver)throw Error(`InternalError: renderState swap already in progress`);this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,n){if(t(n),this._pendingLevelUpdate){this._pendingLevelUpdate.messages.push(e);return}return this._applyMessage(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}async hitTest(e,t){let n=f(e,t);if(!n)return console.warn(`Unexpected hittest input:`,e),{trueHitIds:[],candidateHitIds:[]};let r=this._hitTestsRequests.find(({query:e})=>n.hittestType===e.hittestType&&n.input===e.input&&n.options===e.options),a=Promise.withResolvers();if(r)r.resolvers.push(a);else{if(n.hittestType===`polygon`&&(n.polygonMesh=await i.create(new p({path:[n.input.map(e=>[e.x,e.y])]})),!n.polygonMesh))return a.resolve({trueHitIds:[],candidateHitIds:[]}),a.promise;this._hitTestsRequests.push({query:n,resolvers:[a]})}return this.requestRender(),a.promise}getSortKeys(e){let t=new Set(e),n=new Map;for(let e of this.children)if(e.getSortKeys(t).forEach((e,t)=>n.set(t,e)),n.size===t.size)break;return n}get hasAnimation(){return this.hasLabels}doRender(e){let{minScale:t,maxScale:n}=this._layerView.layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=n&&super.doRender(e)}setStencilReference(e){if(this._getHeatmapInstance(e)!=null){for(let e of this.children)e.stencilRef=c.heatmap.getStencilReference(e);return}super.setStencilReference(e)}createRenderParams(e){let t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){let t=e.inner;if(!this._subscriptions.has(t.id))return;let n=this._subscriptions.get(t.id);if(n.version!==t.subscriptionVesrion){if(has(`esri-2d-update-debug`)){let e=`${t.subscriptionVesrion} != ${n.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}let r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;let{schema:e,deconflictionInfo:t,invalidateMesh:n}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),this.instanceStore.updateEnd(this._supportsInstanceCleanup),n&&(this.restartAllAnimations(),this.swapRenderState());let r=e.mesh.factory.symbology.type===`heatmap`?`target-defer`:`eager`;this._presentation.updateStrategy(r),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has(`esri-2d-update-debug`)&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);let e=this._renderState.value,t=new Set,n=new Set;for(let r of e?.tiles()??[])r.decluttering&&t.add(r.id),r.presenting&&n.add(r.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(let e of this._renderState.value.tiles())t.has(e.id)&&(e.decluttering=!0),n.has(e.id)&&(e.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){let t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){let t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){let t=e.painter.effects.hittest,n=this._hitTestsRequests.shift(),r=n.query.hittestType;t.prepareResources(e,r),t.render(e,n,e=>{let r=t.getHittestableTiles(e,this.children,n.query);for(let t of r)this._renderTile(t,e,0)}),r===`polygon`&&n.query.polygonMesh&&n.query.polygonMesh.destroy(),t.readback(e,n)}_renderFeatures(e,t){let n=this._getHeatmapInstance(e);n==null?this._renderGeometryFeatures(e,t):this._renderHeatmapFeatures(e,t,n)}_renderGeometryFeatures(e,t){for(let n of this.children)n.visible&&this._renderTile(n,e,t)}_renderHeatmapFeatures(e,t,n){for(let n of this.children)n.visible&&this._renderTile(n,e,t,19);n.techniqueRef.renderResolvePass(e,n)}_renderTile(e,t,n,r){t.selection=n;let i=e.getDisplayList()?.render(t,r)??!1;this._firstDrawTime==null&&i&&t.drawPhase===1&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function v(e){return e.techniqueRef.type===19}export{_ as FeatureContainer};
2
+ import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{signal as n}from"../../../../core/signal.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{ClipMesh as i}from"../../engine/webgl/ClipMesh.js";import{effectFlag0 as a,filterFlag0 as o}from"../../engine/webgl/definitions.js";import s from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as c}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{FeatureTilePresentStrategy as l}from"./FeatureTilePresentStrategy.js";import{RenderState as u}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";import{createHittestQuery as f}from"../../support/hitTestUtils.js";import p from"../../../layers/support/Path.js";class m{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class h{constructor(e){this.level=e,this.id=performance.now(),this.messages=[]}}class g{constructor(e,t){this.id=e,this.version=t}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.referenceScale=null,this._updatingChildren=n(!1),this._hitTestsRequests=[],this._firstDrawTime=null,this._renderState=n(null),this._renderStateNext=n(null),this._store=new s,this._subscriptions=new Map,this._presentation=new l,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._supportsInstanceCleanup=!0,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.removeAllChildren(),this._renderState.value=e(this._renderState.value),this._renderStateNext.value=e(this._renderStateNext.value),super.destroy()}get batching(){return has(`featurelayer-strict-draw-order`)?1:has(`featurelayer-force-marker-text-draw-order`)?2:0}get firstDrawTime(){return this._firstDrawTime}get updating(){let e=this._updatingChildren.value,t=!this._renderState.value||this._renderState.value.updating,n=!!this._renderStateNext.value,r=this.attributeView.updating;return e||t||n||r}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this.labelSchema!==null}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState.value?this._renderState.value.tiles().filter(e=>e.presenting):[]}get usedMemory(){let e=0;return this._renderState.value&&(e+=this._renderState.value.usedMemory),this._renderStateNext.value&&(e+=this._renderStateNext.value.usedMemory),e+=this.attributeView.usedMemory,e+=this.labelStore.usedMemory,e}get instanceStore(){return this._store}get labelingCollisionInfos(){if(!this._deconflictionInfo)throw Error(`InternalError: DeconflictionInfo not defined. Was update called?`);return this._deconflictionInfo}get labelSchema(){return this._schema?.mesh.factory.labels??null}get layerOrder(){return this._layerView.view.allLayerViews.items.indexOf(this._layerView)}get tiles(){return this._renderState.value?.tiles()}get requiresRefresh(){return!!this._renderState.value?.requiresRefresh}get _instanceStore(){return this._store}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&c.heatmap.drawPhase))return null;for(let e of this._instanceStore.values())if(v(e))return e;return null}update(e,t){this._schema=e,this._deconflictionInfo=t}setCoverage(e){this._presentation.updateCoverage(e)}getPresenting(){let e=new Set;for(let t of this._renderState.value?.tiles()??[])t.presenting&&e.add(t.id);return e}beforeRender(e){if(super.beforeRender(e),this._renderState.value){for(let t of this._renderState.value.tiles())t.setTransform(e.state);if(!e.decluttering){this._presentation.update(this._renderState.value.tiles());for(let e of this._renderState.value.tiles())e.upload(this._instanceStore,this.batching)}this.labelStore.upload(e.context),this._updatingChildren.value=!this.children.every(e=>e.ended&&e.presenting)}}renderChildren(e){switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 8:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}afterRender(e){super.afterRender(e),e.decluttering||(this._finializeUpdate(),this._updateAttributeView(),this._handleSwapRenderState(),this._renderState.value?.update(this.attributeView.currentEpoch)),this._hitTestsRequests.length&&this.requestRender()}updateStart(e){return this.attributeView.lockTextureUploads(),this._supportsInstanceCleanup=!e&&this._schema?.mesh.factory.symbology.type!==`dictionary`,this.instanceStore.updateStart(this._supportsInstanceCleanup),this.instanceStore}async updateEnd(e,t,n){return this._updateResolver=new m({schema:e,deconflictionInfo:t,invalidateMesh:n}),this.requestRender(),e.mesh.factory.referenceScale&&(this.referenceScale=e.mesh.factory.referenceScale),this._updateResolver.resolver.promise}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e)}updateSubscriptions(e){for(let{tileId:t,version:n}of e.subscribe){if(!this._subscriptions.has(t)){let e=new g(t,n);this._subscriptions.set(t,e);continue}this._subscriptions.get(t).version=n}for(let t of e.unsubscribe)this._subscriptions.delete(t),this.removeTile(t)}isFeatureFiltered(e){let t=this.attributeView.getFilterFlags(e),n=t&o,r=this._layerView.featureEffectView.featureEffect==null||this._layerView.featureEffectView.featureEffect.excludedLabelsVisible||t&a;return!(n&&r)}getDisplayStatistics(e,t){let n=this._statisticsByLevel.get(e);return n?n.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates){this._updateStatisticsRequests.push({level:e,statistics:t});return}let n=this._statisticsByLevel.get(e);n||(n=new Map,this._statisticsByLevel.set(e,n));for(let e of t)n.set(e.fieldName,{minValue:e.minValue,maxValue:e.maxValue})}beginLevelMeshUpdate(e){if(this._pendingLevelUpdate!=null)throw Error(`InternalError: Pending level mesh update in progress`);return this._pendingLevelUpdate=new h(e),has(`esri-2d-update-debug`)&&console.debug(`FeatureContainer.beginLevelMeshUpdate(level=${e}, id=${this._pendingLevelUpdate.id})`),this._pendingLevelUpdate.id}applyLevelMeshUpdate(e){if(this._pendingLevelUpdate==null)throw Error(`InternalError: No level mesh update to apply`);if(this._pendingLevelUpdate.id!==e)throw Error(`InternalError: Unexpected id`);if(has(`esri-2d-update-debug`)){let{id:e,level:t}=this._pendingLevelUpdate;console.debug(`FeatureContainer.applyLevelMeshUpdate(level=${t}, id=${e})`)}let{level:t,messages:n}=this._pendingLevelUpdate,r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.enqueueLevelReplace(t,n),this._pendingLevelUpdate=null,this.requestRender()}lockForOverrides(){this._renderState.value?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState.value?.unlockUploads(),this._shouldUnlockAttributeView&&=(this.attributeView.unlockTextureUploads()&&this.hasLabels&&this.requestDeclutter(),!1),this._lockStatisticUpdates=!1;for(let e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState.value?.flush(this.attributeView.currentEpoch),this.requestRender()}async updateRenderState(e){if(this._renderStateNext.value)throw Error(`InternalError: renderStateNext already exists`);has(`esri-2d-update-debug`)&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext.value=new u(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.tilingScheme,this.labelStore)}async swapRenderState(){if(!this._renderStateNext.value)throw Error(`InternalError: renderStateNext not yet created`);if(this._renderStateSwapResolver)throw Error(`InternalError: renderState swap already in progress`);this._renderStateSwapResolver=Promise.withResolvers(),await this._renderStateSwapResolver.promise}async onMessage(e,n){if(t(n),this._pendingLevelUpdate){this._pendingLevelUpdate.messages.push(e);return}return this._applyMessage(e)}removeTile(e){(this._renderState.value||this._renderStateNext.value)&&(this._renderState.value&&this._renderState.value.removeTile(e),this._renderStateNext.value&&this._renderStateNext.value.removeTile(e))}async hitTest(e,t){let n=f(e,t);if(!n)return console.warn(`Unexpected hittest input:`,e),{trueHitIds:[],candidateHitIds:[]};let r=this._hitTestsRequests.find(({query:e})=>n.hittestType===e.hittestType&&n.input===e.input&&n.options===e.options),a=Promise.withResolvers();if(r)r.resolvers.push(a);else{if(n.hittestType===`polygon`&&(n.polygonMesh=await i.create(new p({path:[n.input.map(e=>[e.x,e.y])]})),!n.polygonMesh))return a.resolve({trueHitIds:[],candidateHitIds:[]}),a.promise;this._hitTestsRequests.push({query:n,resolvers:[a]})}return this.requestRender(),a.promise}getSortKeys(e){let t=new Set(e),n=new Map;for(let e of this.children)if(e.getSortKeys(t).forEach((e,t)=>n.set(t,e)),n.size===t.size)break;return n}get hasAnimation(){return this.hasLabels}doRender(e){let{minScale:t,maxScale:n}=this._layerView.layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=n&&super.doRender(e)}setStencilReference(e){if(this._getHeatmapInstance(e)!=null){for(let e of this.children)e.stencilRef=c.heatmap.getStencilReference(e);return}super.setStencilReference(e)}createRenderParams(e){let t=super.createRenderParams(e);return t.referenceScale=this.referenceScale,t}_applyMessage(e){let t=e.inner;if(!this._subscriptions.has(t.id))return;let n=this._subscriptions.get(t.id);if(n.version!==t.subscriptionVesrion){if(has(`esri-2d-update-debug`)){let e=`${t.subscriptionVesrion} != ${n.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}let r=this._renderStateNext.value??this._renderState.value;if(!r)throw Error(`InternalError: No renderState defined`);r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.enqueueUpdate(e),this.requestRender()}_finializeUpdate(){if(!this._updateResolver)return;let{schema:e,deconflictionInfo:t,invalidateMesh:n}=this._updateResolver.inner;this._schema=e,this._deconflictionInfo=t,this.attributeView.unlockTextureUploads(),this.hasLabels&&(this.labelStore.invalidateColliders(),this.requestDeclutter()),this.instanceStore.updateEnd(this._supportsInstanceCleanup),n&&(this.restartAllAnimations(),this.swapRenderState());let r=e.mesh.factory.symbology.type===`heatmap`?`target-defer`:`eager`;this._presentation.updateStrategy(r),this._updateResolver.resolver.resolve(),this._updateResolver=null,this.requestRender()}_handleSwapRenderState(){if(this._renderStateSwapResolver&&this._renderStateNext.value){has(`esri-2d-update-debug`)&&console.debug(`Version[${this._renderStateNext.value}] FeatureContainer.update.swapRenderState`);let e=this._renderState.value,t=new Set,n=new Set;for(let r of e?.tiles()??[])r.decluttering&&t.add(r.id),r.presenting&&n.add(r.id);this._renderState.value=this._renderStateNext.value,this._renderStateNext.value=null,this._renderState.value.flush(this.attributeView.currentEpoch),e?.destroy(),this._renderStateSwapResolver.resolve(),this._renderStateSwapResolver=null;for(let e of this._renderState.value.tiles())t.has(e.id)&&(e.decluttering=!0),n.has(e.id)&&(e.presenting=!0);this.requestRender(),this.hasLabels&&this.requestDeclutter()}}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){let t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){let t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){let t=e.painter.effects.hittest,n=this._hitTestsRequests.shift(),r=n.query.hittestType;t.prepareResources(e,r),t.render(e,n,e=>{let r=t.getHittestableTiles(e,this.children,n.query);for(let t of r)this._renderTile(t,e,0)}),r===`polygon`&&n.query.polygonMesh&&n.query.polygonMesh.destroy(),t.readback(e,n)}_renderFeatures(e,t){let n=this._getHeatmapInstance(e);n==null?this._renderGeometryFeatures(e,t):this._renderHeatmapFeatures(e,t,n)}_renderGeometryFeatures(e,t){for(let n of this.children)n.visible&&this._renderTile(n,e,t)}_renderHeatmapFeatures(e,t,n){for(let n of this.children)n.visible&&this._renderTile(n,e,t,19);n.techniqueRef.renderResolvePass(e,n)}_renderTile(e,t,n,r){t.selection=n;let i=e.getDisplayList()?.render(t,r)??!1;this._firstDrawTime==null&&i&&t.drawPhase===1&&(this._firstDrawTime=performance.now(),this._layerView.emitFirstDraw(this._firstDrawTime))}}function v(e){return e.techniqueRef.type===19}export{_ as FeatureContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e}from"../../../../core/mathUtils.js";import{meterIn as t}from"../../../../renderers/support/lengthUtils.js";const n=Math.PI;function r(e,t,n){switch(t.transformationType){case`additive`:return a(e,t,n);case`constant`:return o(t,e,n);case`clamped-linear`:return s(e,t,n);case`proportional`:return c(e,t,n);case`stops`:return l(e,t,n);case`real-world-size`:return u(e,t);case`identity`:return e;case`unknown`:return null}}function i(e,t,n){return typeof e==`number`?e:r(e.valueExpression===`$view.scale`?n:t,e,n)}function a(e,t,n){return e+(i(t.minSize,e,n)||t.minDataValue)}function o(e,t,n){let r=e.stops,a=r?.length&&r[0].size;return a??=e.minSize,i(a,t,n)}function s(e,t,n){let r=t.minDataValue,a=t.maxDataValue,o=(e-r)/(a-r),s=i(t.minSize,e,n),c=i(t.maxSize,e,n);return e<=r?s:e>=a?c:s+o*(c-s)}function c(t,n,r){let a=t/n.minDataValue,o=i(n.minSize,t,r),s=i(n.maxSize,t,r),c=null;return c=a*o,e(c,o,s)}function l(e,t,n){let[r,a,o]=d(e,t.cache.ipData);if(r===a)return i(t.stops[r].size,e,n);{let s=i(t.stops[r].size,e,n);return s+(i(t.stops[a].size,e,n)-s)*o}}function u(e,r){let i=t[r.valueUnit],{valueRepresentation:a}=r,o=null;return o=a===`area`?2*Math.sqrt(e/n)/i:a===`radius`||a===`distance`?2*e/i:e/i,o}function d(e,t){if(!t)return;let n=0,r=t.length-1;return t.some((t,i)=>e<t?(r=i,!0):(n=i,!1)),[n,r,(e-t[n])/(t[r]-t[n])]}export{r as getSizeForValueSimple};
2
+ import{clamp as e}from"../../../../core/mathUtils.js";import{meterIn as t}from"../../../../renderers/support/lengthUtils.js";const n=Math.PI;function r(e,t,n){switch(t.valueExpression===`$view.scale`&&(e=n),t.transformationType){case`additive`:return a(e,t,n);case`constant`:return o(t,e,n);case`clamped-linear`:return s(e,t,n);case`proportional`:return c(e,t,n);case`stops`:return l(e,t,n);case`real-world-size`:return u(e,t);case`identity`:return e;case`unknown`:return null}}function i(e,t,n){return typeof e==`number`?e:r(t,e,n)}function a(e,t,n){return e+(i(t.minSize,e,n)||t.minDataValue)}function o(e,t,n){let r=e.stops,a=r?.length&&r[0].size;return a??=e.minSize,i(a,t,n)}function s(e,t,n){let r=t.minDataValue,a=t.maxDataValue,o=(e-r)/(a-r),s=i(t.minSize,e,n),c=i(t.maxSize,e,n);return e<=r?s:e>=a?c:s+o*(c-s)}function c(t,n,r){let a=t/n.minDataValue,o=i(n.minSize,t,r),s=i(n.maxSize,t,r),c=null;return c=a*o,e(c,o,s)}function l(e,t,n){let[r,a,o]=d(e,t.cache.ipData);if(r===a)return i(t.stops[r].size,e,n);{let s=i(t.stops[r].size,e,n);return s+(i(t.stops[a].size,e,n)-s)*o}}function u(e,r){let i=t[r.valueUnit],{valueRepresentation:a}=r,o=null;return o=a===`area`?2*Math.sqrt(e/n)/i:a===`radius`||a===`distance`?2*e/i:e/i,o}function d(e,t){if(!t)return;let n=0,r=t.length-1;return t.some((t,i)=>e<t?(r=i,!0):(n=i,!1)),[n,r,(e-t[n])/(t[r]-t[n])]}export{r as getSizeForValueSimple};
@@ -64,8 +64,19 @@ export default class SunLighting extends SunLightingSuperclass {
64
64
  get date(): Date;
65
65
  set date(value: (Date | number | string));
66
66
  /**
67
- * Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
68
- * surfaces, while areas where surrounding objects block ambient light receive more natural shading.
67
+ * Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
68
+ * * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
69
+ * * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
70
+ *
71
+ * <figure>
72
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
73
+ * alt="Comparison of scene lighting with global illumination enabled and disabled" />
74
+ * <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
75
+ * </figure>
76
+ *
77
+ * Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
78
+ *
79
+ * Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
69
80
  *
70
81
  * **Known limitations**
71
82
  *
@@ -74,8 +85,10 @@ export default class SunLighting extends SunLightingSuperclass {
74
85
  * - May produce temporarily noisy lighting after camera or scene changes.
75
86
  * - May reduce rendering performance.
76
87
  *
88
+ * @default false
77
89
  * @beta
78
90
  * @since 5.2
91
+ * @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
79
92
  */
80
93
  accessor globalIllumination: boolean;
81
94
  /** Indicates that the light source is simulated position of the sun. */
@@ -42,8 +42,19 @@ export interface VirtualLightingProperties extends WebSceneVirtualLightingProper
42
42
  export default class VirtualLighting extends VirtualLightingSuperclass {
43
43
  constructor(properties?: VirtualLightingProperties);
44
44
  /**
45
- * Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
46
- * surfaces, while areas where surrounding objects block ambient light receive more natural shading.
45
+ * Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
46
+ * * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
47
+ * * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
48
+ *
49
+ * <figure>
50
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
51
+ * alt="Comparison of scene lighting with global illumination enabled and disabled" />
52
+ * <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
53
+ * </figure>
54
+ *
55
+ * Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
56
+ *
57
+ * Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
47
58
  *
48
59
  * **Known limitations**
49
60
  *
@@ -52,8 +63,10 @@ export default class VirtualLighting extends VirtualLightingSuperclass {
52
63
  * - May produce temporarily noisy lighting after camera or scene changes.
53
64
  * - May reduce rendering performance.
54
65
  *
66
+ * @default false
55
67
  * @beta
56
68
  * @since 5.2
69
+ * @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
57
70
  */
58
71
  accessor globalIllumination: boolean;
59
72
  /**