@arcgis/core 5.2.0-next.90 → 5.2.0-next.93

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 (90) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/19ab024f6f732fd6c69b.js +1 -0
  4. package/assets/esri/core/workers/chunks/24a6b28db94e07a702a4.js +1 -0
  5. package/assets/esri/core/workers/chunks/{c6ec0e966106f66360d9.js → 349b0c7febc46267441d.js} +3 -3
  6. package/assets/esri/core/workers/chunks/75b90fb05e4a2d32b7bb.js +1 -0
  7. package/assets/esri/core/workers/chunks/9246e2468528650bdc7c.js +1 -0
  8. package/assets/esri/core/workers/chunks/9509bef285929c52c244.js +1 -0
  9. package/assets/esri/core/workers/chunks/a74182ff402c3a808323.js +1 -0
  10. package/assets/esri/core/workers/chunks/bb23e670736bcace8b6f.js +1 -0
  11. package/config.js +1 -1
  12. package/core/has.js +1 -1
  13. package/geometry/support/HalfFloatArray.js +1 -1
  14. package/geometry/support/buffer/BufferView.js +1 -1
  15. package/kernel.js +1 -1
  16. package/layers/ImageryTileLayer.d.ts +20 -20
  17. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  18. package/layers/MapImageLayer.d.ts +20 -21
  19. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  20. package/layers/mixins/FeatureLayerBase.d.ts +20 -21
  21. package/layers/support/DateTimeFieldFormat.d.ts +1 -1
  22. package/layers/support/FieldConfiguration.d.ts +1 -1
  23. package/package.json +4 -4
  24. package/popup/FeatureContent.d.ts +3 -3
  25. package/popup/FeatureContentCollection.d.ts +3 -3
  26. package/popup/FieldInfo.d.ts +18 -12
  27. package/popup/support/FieldInfoFormat.d.ts +13 -8
  28. package/portal/Portal.js +1 -1
  29. package/smartMapping/symbology/types.d.ts +1 -1
  30. package/support/revision.js +1 -1
  31. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  32. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  33. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  34. package/views/3d/layers/graphics/Labeler.js +1 -1
  35. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  36. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +11 -11
  37. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  38. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  39. package/views/3d/webgl-engine/effects/raymarching/DistanceFalloff.glsl.js +2 -2
  40. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  41. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  42. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  43. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  44. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  45. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  46. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  47. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  48. package/views/SceneView.d.ts +64 -1
  49. package/views/SceneView.js +1 -1
  50. package/views/View2D.d.ts +17 -4
  51. package/views/support/LayerLayerViewInfo.js +1 -1
  52. package/views/support/LayerViewManager.js +1 -1
  53. package/webmap/InitialViewProperties.d.ts +1 -1
  54. package/webscene/SunLighting.d.ts +3 -1
  55. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  56. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  57. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  58. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +4 -4
  59. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  60. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  61. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  62. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
  63. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.d.ts +12 -0
  64. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +2 -0
  65. package/widgets/BatchAttributeForm/inputs/support/controllerUtils.d.ts +5 -0
  66. package/widgets/BatchAttributeForm/inputs/support/controllerUtils.js +2 -0
  67. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  68. package/widgets/BatchAttributeForm.js +1 -1
  69. package/widgets/Daylight.d.ts +4 -0
  70. package/widgets/Directions.d.ts +1 -1
  71. package/widgets/Editor.d.ts +1 -1
  72. package/widgets/Feature/FeatureViewModel.d.ts +3 -3
  73. package/widgets/Feature.d.ts +3 -3
  74. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +3 -3
  75. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -0
  76. package/widgets/FeatureTable.d.ts +1 -1
  77. package/widgets/Features/FeaturesViewModel.d.ts +3 -3
  78. package/widgets/Features.d.ts +2 -2
  79. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  80. package/widgets/OrientedImageryViewer.js +1 -1
  81. package/widgets/TimeSlider.d.ts +3 -3
  82. package/widgets/support/FilterBuilder.js +1 -1
  83. package/assets/esri/core/workers/chunks/05fbd1f373cfa3724f0c.js +0 -1
  84. package/assets/esri/core/workers/chunks/07613ecf13c38ad58b79.js +0 -1
  85. package/assets/esri/core/workers/chunks/27c0bed59626c7f64125.js +0 -1
  86. package/assets/esri/core/workers/chunks/41cf6163758d28fb1968.js +0 -1
  87. package/assets/esri/core/workers/chunks/48e2d0bfb62e1f4f2ad9.js +0 -1
  88. package/assets/esri/core/workers/chunks/bf11319138facf44752c.js +0 -1
  89. package/assets/esri/core/workers/chunks/e55507e4114b34d1ef4e.js +0 -1
  90. package/geometry/support/float16.js +0 -2
@@ -20,6 +20,7 @@ import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
20
20
  import type { EventNames } from "../core/Evented.js";
21
21
  import type { ResourceHandle } from "../core/Handles.js";
22
22
  import type { ScreenPoint, ScreenPolygon, ScreenRect } from "../core/types.js";
23
+ import type { TimeZone } from "../time/types.js";
23
24
  import type { BreakpointsOwner, BreakpointsOwnerProperties } from "./BreakpointsOwner.js";
24
25
  import type { DOMContainer, DOMContainerProperties } from "./DOMContainer.js";
25
26
  import type { PopupView, PopupViewProperties } from "./PopupView.js";
@@ -34,7 +35,7 @@ import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js
34
35
  import type { ViewpointProperties } from "../Viewpoint.js";
35
36
  import type { ViewProperties } from "./View.js";
36
37
 
37
- export interface SceneViewProperties extends ViewProperties, DOMContainerProperties, PopupViewProperties, BreakpointsOwnerProperties, Partial<Pick<SceneView, "alphaCompositingEnabled" | "qualityProfile" | "scale" | "zoom">> {
38
+ export interface SceneViewProperties extends ViewProperties, DOMContainerProperties, PopupViewProperties, BreakpointsOwnerProperties, Partial<Pick<SceneView, "alphaCompositingEnabled" | "qualityProfile" | "scale" | "timeZone" | "zoom">> {
38
39
  /**
39
40
  * A collection of analyses associated with the view.
40
41
  *
@@ -1197,6 +1198,68 @@ export default class SceneView extends SceneViewSuperclass {
1197
1198
  set spatialReference(value: SpatialReferenceProperties);
1198
1199
  /** The tiling scheme information of the view. */
1199
1200
  get tileInfo(): TileInfo | null | undefined;
1201
+ /**
1202
+ * Defines the time zone of the view. The time zone property determines how dates and times are represented to the
1203
+ * user, but the underlying data is unchanged. Changing the time zone will have the following effect:
1204
+ *
1205
+ * - **Arcade**: [Arcade expressions](https://developers.arcgis.com/javascript/latest/arcade/) referencing date values in labels, renderers, and forms
1206
+ * will represent dates by default in the time zone of the view. When the view's time zone
1207
+ * is changed, the output of Arcade expressions working with dates may change to match the time zone of the view.
1208
+ * The user can use the [ChangeTimeZone](https://developers.arcgis.com/arcade/function-reference/date_functions/#changetimezone) Arcade function (e.g.
1209
+ * `ChangeTimeZone($feature.dateField, "system")`) to display dates in another time zone regardless of the view
1210
+ * time zone. Alternatively they can construct Date values in the context of a specific time zone
1211
+ * (e.g. `Date(2013, 1, 1, 10, 00, 00, 00, "UTC")`).
1212
+ * - **Components**: Date values, including values from `date` and `timestamp-offset` fields, will be displayed in the view's time zone by default in the
1213
+ * [Bookmarks](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/),
1214
+ * [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/),
1215
+ * [Feature](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/),
1216
+ * [Feature Form](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-form/),
1217
+ * [Features](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/),
1218
+ * [Feature Table](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-table/),
1219
+ * [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/),
1220
+ * [Popup](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-popup/), and
1221
+ * [Time Bar](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/) components.
1222
+ *
1223
+ * > [!IMPORTANT]
1224
+ * >
1225
+ * > This property does not apply to solar lighting or shadow analysis. The
1226
+ * > [Daylight](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-daylight/)
1227
+ * > and [Shadow Cast](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-shadow-cast/)
1228
+ * > components use their own `utcOffset` properties. Support for using the view's time zone in these components is
1229
+ * > planned for a future release.
1230
+ *
1231
+ * The time zone can be set to one of the following values:
1232
+ *
1233
+ * **Possible Values**
1234
+ *
1235
+ * Value | Description |
1236
+ * ----- | ----------- |
1237
+ * system | Dates and times will be displayed in the time zone of the device or browser.
1238
+ * unknown | Dates and times will be displayed based on the time zone that has been defined for the layer. No adjustments are made to the display of date info. The [Time Bar component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/) is disabled.
1239
+ * Specified IANA time zone | Dates and times will be displayed in the specified IANA time zone. See [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
1240
+ *
1241
+ * > [!NOTE]
1242
+ * >
1243
+ * > When `timeZone` is `system`, Arcade-based labels, renderers, and visual variables that use date values can produce
1244
+ * > different results on devices in different system time zones. Set an explicit IANA time zone for consistent
1245
+ * > visualization.
1246
+ *
1247
+ * > [!WARNING]
1248
+ * >
1249
+ * > If the `timeZone` is set to `unknown` and a layer's date/time field includes time information, set the [DateTimeFieldFormat.timeStyle](https://developers.arcgis.com/javascript/latest/references/core/layers/support/DateTimeFieldFormat/#timeStyle) property to either long or full on the corresponding [date/time field](https://developers.arcgis.com/javascript/latest/references/core/layers/support/DateTimeFieldFormat/).
1250
+ *
1251
+ * @default "system"
1252
+ * @since 5.2
1253
+ * @see [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
1254
+ * @example
1255
+ * // Date and time will be displayed in Pacific/Auckland (NZ) time zone
1256
+ * const view = new SceneView({
1257
+ * map,
1258
+ * container: "viewDiv",
1259
+ * timeZone: "Pacific/Auckland"
1260
+ * });
1261
+ */
1262
+ accessor timeZone: TimeZone;
1200
1263
  /** The type of the view. */
1201
1264
  get type(): "3d";
1202
1265
  /**
@@ -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"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{destroyHandle as o,makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{mapCollectionAsync as h}from"../core/mapCollectionUtils.js";import{destroyMaybe as d,maybeProperty as u}from"../core/maybe.js";import{ignoreAbortErrors as c,throwIfDestroyed as g,throwIfAborted as m,createAbortError as y}from"../core/promiseUtils.js";import f from"../core/ReactiveSet.js";import{on as w,watch as v,initial as _,sync as b,whenOnce as M,syncAndInitial as S}from"../core/reactiveUtils.js";import{setFrameDuration as V,cleanupScheduling as j}from"../core/scheduling.js";import{createScreenPoint as C,isScreenRect as T,createScreenPointArray as R}from"../core/screenUtils.js";import{cleanupWhereClauseCache as x}from"../core/sql.js";import{getMetersPerUnitForSR as A}from"../core/units.js";import{property as O,cast as E,subclass as L}from"../core/accessorSupport/decorators.js";import{ensureType as I,ensureClass as H}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as P}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as D}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as F}from"../core/accessorSupport/trackingUtils.js";import{create as U}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as G}from"../core/libs/rbush/PooledRBush.js";import{initialize as W}from"../core/workers/workers.js";import z from"../geometry/Extent.js";import q from"../geometry/HeightModelInfo.js";import k from"../geometry/Point.js";import{project as B,canProjectWithoutEngine as N}from"../geometry/projectionUtils.js";import Q from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Z}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Y}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as $}from"../geometry/projection/projectPointToVector.js";import{toExtent as J,create as K}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as X}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as ee}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as te}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as ie,isTiledLayer as re,isVoxelLayer as se,isIntegratedMeshLayer as ne,isGaussianSplatLayer as ae}from"../layers/support/layerUtils.js";import{TilemapCache as oe}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as le}from"../portal/portalDefault.js";import{WebSceneTag as pe}from"../support/tagSymbols.js";import{BreakpointsOwner as he}from"./BreakpointsOwner.js";import{DOMContainer as de}from"./DOMContainer.js";import{PopupView as ue}from"./PopupView.js";import ce from"./View.js";import ge from"./ViewAnimation.js";import{stringFromViewingMode as me,viewingModeFromString as ye}from"./ViewingMode.js";import{GroundView3D as fe}from"./3d/GroundView3D.js";import{layerView3DImporter as we}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ve}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as _e}from"./3d/camera/intersectionUtils.js";import be from"./3d/constraints/Constraints.js";import Me from"./3d/environment/Environment.js";import{EnvironmentManager as Se}from"./3d/environment/EnvironmentManager.js";import Ve from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as je}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ce}from"./3d/layers/graphics/Labeler.js";import Te from"./3d/layers/i3s/I3SLodHandling.js";import{ScreenSizePerspective as Re}from"./3d/state/ScreenSizePerspective.js";import xe from"./3d/state/ViewState.js";import{ViewStateManager as Ae,cleanupViewStateManager as Oe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ee}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Le}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ie}from"./3d/state/utils/navigationUtils.js";import He from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Pe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as De}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Fe}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as Ue}from"./3d/support/GroundAndIMSurface.js";import{toMap as Ge,hitTest as We}from"./3d/support/hitTest.js";import{popupHitTest as ze}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as qe,getQualityProfileSettings as ke}from"./3d/support/QualityProfile.js";import Be from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ne}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Qe}from"./3d/support/ResourceController.js";import Ze from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ye}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as $e}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Je}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ke from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Xe,getTiledLayerInfo as et,checkIfTileInfoSupportedForView as tt}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as it}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as rt}from"./3d/terrain/TileRenderer.js";import{Stage as st}from"./3d/webgl-engine/Stage.js";import{olidEnabled as nt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as at}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as ot}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as lt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as pt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as ht}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import dt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as ut}from"./support/drapedUtils.js";import{occludeesSupported as ct}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as gt,createScreenPointFromSupportedEvent as mt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as yt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as ft,destroyTextureCompressionWorker as wt}from"./support/TextureCompressionHelper.js";import vt from"./ui/DefaultUI.js";import _t from"./ui/3d/DefaultUI3D.js";import bt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var St;const Vt=Symbol(),jt=Symbol();let Ct=class extends(he(ue(de(ce)))){static{St=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Qe(this),this.deconflictor=new je({view:this}),this.attribution3D=new He({view:this}),this.labeler=new Ce({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=new Pe({view:this}),this._canvas=null,this.constraints=new be,this._environment=new Me,this.environmentManager=new Se,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new dt({importAnalysisViewModule:e=>ve(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new f,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new xe({view:this}),this.slice=new $e,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new _t,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,W();const t=()=>this._updatingChanged();this.addHandles(o(h(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([w(()=>this.map?.allLayers,"after-changes",t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),v(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ve({view:this}),this.stateManager=new Ae({view:this}),this.screenSizePerspective=new Re({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=ft(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new fe({view:this}),this.groundAndIMSurface=new Ue({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>V(e>0?1e3/Math.ceil(e):0),_),this.addHandles([v(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),b),v(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),b)])}destroy(){this.destroyed||(wt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set("analysisViewManager",d(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=d(this.sharedSymbolResources),this._set("labeler",d(this.labeler)),this._set("deconflictor",d(this.deconflictor)),this._resourceController=d(this._resourceController),this._set("stateManager",d(this.stateManager)),this._set("inputManager",d(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",d(this.environmentManager)),this._set("environment",d(this.environment)),this.groundView=d(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=I(k,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||u(e,"clippingArea");return!this._userClippingArea&&!u(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof z?this.spatialReference&&(t=Tt(t,this.spatialReference),null==t)?(p.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(p.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?p.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Tt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||Q.WGS84,i=Tt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||Q.WGS84;let t;const i=i=>{const r=Tt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new z({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof Me?e:e instanceof bt?this.environment?.cloneWithWebsceneEnvironment(e)??Me.fromWebsceneEnvironment(e):I(Me,e):new Me}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return St._layerToLayerview}static{this._layerToLayerview=ce._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=ke(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new Be(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||qe()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){const{scale:e,spatialReference:t}=this;return t?D(()=>ee(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?q.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&p.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Xe(r))return;++i,e+=r.updatingProgress}}else++i});const r=.1;for(const n of this._updatingObjects)n?.updating&&(i+=r,e+=.5*r);for(const n of this._updatingObjectsWithProgress)n?.updating&&(++i,e+=n.updatingProgress);const s=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||s||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return De.UPDATING&&console.log("Updating:",this._updatingObjectsToDebug.filter(e=>null!=e&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return De.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return me(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?me(this.defaultsFromMap.viewingMode):yt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?p.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Ze(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return p.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=gt(e)?mt(this,e):e;return Ge(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return p.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Fe(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),$(t,Rt,this.renderSpatialReference),this.state.camera.projectToScreen(Rt,xt),C(xt[0],xt[1])}pixelSizeAt(e,t){if(!this.ready)return p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;$(e,Rt,i);const r=this.state.camera.computeScreenPixelSizeAt(Rt);return t&&i!==t?r*A(i)/A(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return p.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=gt(e)?mt(this,e):e;return We(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return T(e)&&(p.getLogger(this).warn("#fetchPopupFeatures()","rectangle isn't a supported input, using its center point instead"),e=C(e.x+e.width/2,e.y+e.height/2)),ze(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return c(this.goTo({zoomFactor:2}))}async zoomOut(){if(this.canZoomOut)return c(this.goTo({zoomFactor:.5}))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await(import("./support/screenshotUtils.js"));return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await(import("./support/screenshotUtils.js")),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!nt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await(import("./support/screenshotUtils.js")),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return we.importLayerView(e)}hasLayerViewModule(e){return we.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ye(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,i):null,s=i?r(i):[...r(1)??[],...r(2)??[]];return s?.length?{constraints:s}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!yt(e,i)&&(null==t||(!!ie(t)||(!re(t)||null!=et(t,e,i))&&(!se(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i,r){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:s,isWGS84:n}=e;if(ie(t)&&(s||n)){return!n||2===r||null===tt(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:Q.WebMercator,viewingMode:i}]:[{spatialReference:s?Q.WGS84:Q.WebMercator,viewingMode:i}]}return re(t)||se(t)||!s&&!n?re(t)&&s&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:Q.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:s?Q.WGS84:Q.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?p.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${me(i)} viewing mode.`):e.isGeographic&&p.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return p.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return p.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ct(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await M(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),l(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Et[e]();if(t&&(g(this),m(i.signal),await t(i.signal)),this.destroyed)throw y();return m(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ke({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Je({view:this})),this.addHandles([this.updatingHandles.add(()=>De.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&De.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=d(this._featureTreeDebugger))},S),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?B(J(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},S),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=d(this._featureTiles)},b)],Vt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(jt),this.removeHandles(Vt),this._featureTiles=d(this.featureTiles),this._set("pointsOfInterest",d(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=X(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ne.create(this.state.viewingMode,i)),t||this.addHandles(v(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!Y(e,this.groundView.spatialReference,At,t)||(this.renderCoordsHelper.extent=At)},b),jt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(ot/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(jt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(v(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),b),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Le(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new st({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage||"WebGL context lost")})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(ot/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=d(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Ye({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>M(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=d(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ye(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(w(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?P(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(pt);for(const t of this.allLayerViews)(ne(t.layer)||ae(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(pt);for(const t of this.allLayerViews)ne(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){Mt(),F(),x(),ht(),Oe(),_e(),Z(),ut(),le(),rt(),lt(),Ee(),Ie(),G(),j(),at(),it(),Te.cleanupI3SLodHandling(),oe.cleanupTilemapCache(),xe.cleanupViewstate(),Ke.cleanupTerrainSurface()}};function Tt(e,t){return null!=e&&N(e.spatialReference,t)?B(e,t):null}e([O()],Ct.prototype,"_userClippingArea",void 0),e([O()],Ct.prototype,"_resourceController",void 0),e([O()],Ct.prototype,"stage",null),e([O({readOnly:!0})],Ct.prototype,"deconflictor",void 0),e([O({readOnly:!0})],Ct.prototype,"labeler",void 0),e([O({type:ge,readOnly:!0})],Ct.prototype,"animation",null),e([O({readOnly:!0})],Ct.prototype,"basemapTerrain",void 0),e([O({readOnly:!0})],Ct.prototype,"overlayManager",null),e([O({readOnly:!0})],Ct.prototype,"elevationProvider",void 0),e([O()],Ct.prototype,"camera",null),e([O({type:t})],Ct.prototype,"contentCamera",null),e([O({readOnly:!0})],Ct.prototype,"canvas",null),e([O({type:k,useTypeForAutocast:!1})],Ct.prototype,"center",null),e([O({type:z})],Ct.prototype,"clippingArea",null),e([O({type:be,nonNullable:!0})],Ct.prototype,"constraints",void 0),e([O({type:z,readOnly:!0})],Ct.prototype,"renderDataExtent",null),e([O({readOnly:!0})],Ct.prototype,"tileInfo",null),e([O({type:z,readOnly:!0})],Ct.prototype,"dataExtent",null),e([O({type:z,readOnly:!0})],Ct.prototype,"_groundAndLayersExtent",null),e([O({type:Me})],Ct.prototype,"environment",null),e([E("environment")],Ct.prototype,"castEnvironment",null),e([O({readOnly:!0})],Ct.prototype,"environmentManager",void 0),e([O({type:z})],Ct.prototype,"extent",null),e([O({type:r})],Ct.prototype,"floors",void 0),e([O()],Ct.prototype,"screenCenter",null),e([O()],Ct.prototype,"frustum",null),e([O({type:Number,readOnly:!0})],Ct.prototype,"fullOpacity",void 0),e([O({readOnly:!0})],Ct.prototype,"graphicsView",void 0),e([O()],Ct.prototype,"analysisViewManager",void 0),e([O()],Ct.prototype,"groundView",void 0),e([O({readOnly:!0})],Ct.prototype,"layerviewCollections",null),e([O({type:Boolean})],Ct.prototype,"initialExtentRequired",null),e([O()],Ct.prototype,"defaultsFromMapSettings",null),e([O()],Ct.prototype,"interacting",null),e([O()],Ct.prototype,"stationary",null),e([O()],Ct.prototype,"navigating",null),e([O()],Ct.prototype,"map",void 0),e([O()],Ct.prototype,"padding",null),e([O({type:Je,readOnly:!0})],Ct.prototype,"pointsOfInterest",void 0),e([O()],Ct.prototype,"_featureTiles",void 0),e([O()],Ct.prototype,"featureTiles",null),e([O()],Ct.prototype,"_featureTreeDebugger",void 0),e([O({constructOnly:!0})],Ct.prototype,"deactivatedWebGLExtensions",void 0),e([O({constructOnly:!0})],Ct.prototype,"debugWebGLExtensions",void 0),e([O({constructOnly:!0})],Ct.prototype,"renderCanvas",void 0),e([O({constructOnly:!0})],Ct.prototype,"state",void 0),e([O()],Ct.prototype,"screenSizePerspective",void 0),e([O({readOnly:!0})],Ct.prototype,"inputManager",void 0),e([O({readOnly:!0})],Ct.prototype,"stateManager",void 0),e([O({type:["low","medium","high"]})],Ct.prototype,"qualityProfile",null),e([O({type:Be,get(){let e=this._get("qualitySettings");if(!e){const t=ke(this.qualityProfile);e=new Be(t)}return e}})],Ct.prototype,"qualitySettings",void 0),e([O()],Ct.prototype,"slice",void 0),e([O({readOnly:!0})],Ct.prototype,"typeSpecificPreconditionsReady",null),e([O({readOnly:!0})],Ct.prototype,"renderCoordsHelper",void 0),e([O({readOnly:!0})],Ct.prototype,"sceneIntersectionHelper",void 0),e([O({type:Number,readOnly:!0})],Ct.prototype,"resolution",null),e([O({type:Number})],Ct.prototype,"scale",null),e([O({readOnly:!0,type:Number})],Ct.prototype,"terrainLevel",null),e([O()],Ct.prototype,"heightModelInfo",null),e([O({type:Q})],Ct.prototype,"spatialReference",void 0),e([O({type:Boolean,value:!1})],Ct.prototype,"alphaCompositingEnabled",null),e([O({constructOnly:!0})],Ct.prototype,"preserveDrawingBufferEnabled",void 0),e([O({type:Boolean})],Ct.prototype,"supersampleScreenshotsEnabled",void 0),e([O({readOnly:!0})],Ct.prototype,"type",void 0),e([O(),E(e=>e instanceof vt?e:H(_t,e))],Ct.prototype,"ui",void 0),e([O({type:Boolean,readOnly:!0})],Ct.prototype,"updating",null),e([O()],Ct.prototype,"_updatingObjects",null),e([O()],Ct.prototype,"_updatingObjectsWithProgress",null),e([O()],Ct.prototype,"_updatingObjectsToDebug",null),e([O({type:Number,readOnly:!0})],Ct.prototype,"updatingProgress",void 0),e([O({type:["global","local"]})],Ct.prototype,"viewingMode",null),e([O({type:i})],Ct.prototype,"viewpoint",null),e([O({readOnly:!0})],Ct.prototype,"visibleArea",null),e([O({type:Number})],Ct.prototype,"zoom",null),e([O({readOnly:!0})],Ct.prototype,"quality",null),e([O({readOnly:!0})],Ct.prototype,"resolutionScale",null),e([O()],Ct.prototype,"focusAreasView",void 0),e([O()],Ct.prototype,"_defaultToMapOptions",null),e([O()],Ct.prototype,"_defaultHitTestOptions",null),Ct=St=e([L("esri.views.SceneView")],Ct);const Rt=U(),xt=R(),At=K(),Ot=te(0,0,0,Q.WebMercator),Et={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Lt=Ct;export{Lt as default};
2
+ import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{destroyHandle as o,makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{mapCollectionAsync as h}from"../core/mapCollectionUtils.js";import{destroyMaybe as d,maybeProperty as u}from"../core/maybe.js";import{ignoreAbortErrors as c,throwIfDestroyed as g,throwIfAborted as m,createAbortError as y}from"../core/promiseUtils.js";import f from"../core/ReactiveSet.js";import{on as w,watch as v,initial as _,sync as b,whenOnce as M,syncAndInitial as S}from"../core/reactiveUtils.js";import{setFrameDuration as V,cleanupScheduling as j}from"../core/scheduling.js";import{createScreenPoint as C,isScreenRect as T,createScreenPointArray as R}from"../core/screenUtils.js";import{cleanupWhereClauseCache as x}from"../core/sql.js";import{getMetersPerUnitForSR as A}from"../core/units.js";import{property as O,cast as E,subclass as L}from"../core/accessorSupport/decorators.js";import{ensureType as I,ensureClass as H}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as P}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as D}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as F}from"../core/accessorSupport/trackingUtils.js";import{create as U}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as G}from"../core/libs/rbush/PooledRBush.js";import{initialize as W}from"../core/workers/workers.js";import z from"../geometry/Extent.js";import q from"../geometry/HeightModelInfo.js";import k from"../geometry/Point.js";import{project as B,canProjectWithoutEngine as N}from"../geometry/projectionUtils.js";import Z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Q}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Y}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as $}from"../geometry/projection/projectPointToVector.js";import{toExtent as J,create as K}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as X}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as ee}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as te}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as ie,isTiledLayer as re,isVoxelLayer as se,isIntegratedMeshLayer as ne,isGaussianSplatLayer as ae}from"../layers/support/layerUtils.js";import{TilemapCache as oe}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as le}from"../portal/portalDefault.js";import{WebSceneTag as pe}from"../support/tagSymbols.js";import{BreakpointsOwner as he}from"./BreakpointsOwner.js";import{DOMContainer as de}from"./DOMContainer.js";import{PopupView as ue}from"./PopupView.js";import ce from"./View.js";import ge from"./ViewAnimation.js";import{stringFromViewingMode as me,viewingModeFromString as ye}from"./ViewingMode.js";import{GroundView3D as fe}from"./3d/GroundView3D.js";import{layerView3DImporter as we}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ve}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as _e}from"./3d/camera/intersectionUtils.js";import be from"./3d/constraints/Constraints.js";import Me from"./3d/environment/Environment.js";import{EnvironmentManager as Se}from"./3d/environment/EnvironmentManager.js";import Ve from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as je}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ce}from"./3d/layers/graphics/Labeler.js";import Te from"./3d/layers/i3s/I3SLodHandling.js";import{ScreenSizePerspective as Re}from"./3d/state/ScreenSizePerspective.js";import xe from"./3d/state/ViewState.js";import{ViewStateManager as Ae,cleanupViewStateManager as Oe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ee}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Le}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ie}from"./3d/state/utils/navigationUtils.js";import He from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Pe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as De}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Fe}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as Ue}from"./3d/support/GroundAndIMSurface.js";import{toMap as Ge,hitTest as We}from"./3d/support/hitTest.js";import{popupHitTest as ze}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as qe,getQualityProfileSettings as ke}from"./3d/support/QualityProfile.js";import Be from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ne}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ze}from"./3d/support/ResourceController.js";import Qe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ye}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as $e}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Je}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ke from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Xe,getTiledLayerInfo as et,checkIfTileInfoSupportedForView as tt}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as it}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as rt}from"./3d/terrain/TileRenderer.js";import{Stage as st}from"./3d/webgl-engine/Stage.js";import{olidEnabled as nt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as at}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as ot}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as lt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as pt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as ht}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import dt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as ut}from"./support/drapedUtils.js";import{occludeesSupported as ct}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as gt,createScreenPointFromSupportedEvent as mt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as yt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as ft,destroyTextureCompressionWorker as wt}from"./support/TextureCompressionHelper.js";import vt from"./ui/DefaultUI.js";import _t from"./ui/3d/DefaultUI3D.js";import bt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var St;const Vt=Symbol(),jt=Symbol();let Ct=class extends(he(ue(de(ce)))){static{St=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ze(this),this.deconflictor=new je({view:this}),this.attribution3D=new He({view:this}),this.labeler=new Ce({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=new Pe({view:this}),this._canvas=null,this.constraints=new be,this._environment=new Me,this.environmentManager=new Se,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new dt({importAnalysisViewModule:e=>ve(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new f,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new xe({view:this}),this.slice=new $e,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new _t,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,W();const t=()=>this._updatingChanged();this.addHandles(o(h(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([w(()=>this.map?.allLayers,"after-changes",t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),v(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ve({view:this}),this.stateManager=new Ae({view:this}),this.screenSizePerspective=new Re({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=ft(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new fe({view:this}),this.groundAndIMSurface=new Ue({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>V(e>0?1e3/Math.ceil(e):0),_),this.addHandles([v(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),b),v(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),b)])}destroy(){this.destroyed||(wt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set("analysisViewManager",d(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=d(this.sharedSymbolResources),this._set("labeler",d(this.labeler)),this._set("deconflictor",d(this.deconflictor)),this._resourceController=d(this._resourceController),this._set("stateManager",d(this.stateManager)),this._set("inputManager",d(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",d(this.environmentManager)),this._set("environment",d(this.environment)),this.groundView=d(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=I(k,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||u(e,"clippingArea");return!this._userClippingArea&&!u(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof z?this.spatialReference&&(t=Tt(t,this.spatialReference),null==t)?(p.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(p.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?p.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Tt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||Z.WGS84,i=Tt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||Z.WGS84;let t;const i=i=>{const r=Tt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new z({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof Me?e:e instanceof bt?this.environment?.cloneWithWebsceneEnvironment(e)??Me.fromWebsceneEnvironment(e):I(Me,e):new Me}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return St._layerToLayerview}static{this._layerToLayerview=ce._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=ke(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new Be(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||qe()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){const{scale:e,spatialReference:t}=this;return t?D(()=>ee(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?q.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&p.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Xe(r))return;++i,e+=r.updatingProgress}}else++i});const r=.1;for(const n of this._updatingObjects)n?.updating&&(i+=r,e+=.5*r);for(const n of this._updatingObjectsWithProgress)n?.updating&&(++i,e+=n.updatingProgress);const s=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||s||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return De.UPDATING&&console.log("Updating:",this._updatingObjectsToDebug.filter(e=>null!=e&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return De.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return me(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?me(this.defaultsFromMap.viewingMode):yt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?p.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Qe(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return p.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=gt(e)?mt(this,e):e;return Ge(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return p.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Fe(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),$(t,Rt,this.renderSpatialReference),this.state.camera.projectToScreen(Rt,xt),C(xt[0],xt[1])}pixelSizeAt(e,t){if(!this.ready)return p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;$(e,Rt,i);const r=this.state.camera.computeScreenPixelSizeAt(Rt);return t&&i!==t?r*A(i)/A(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return p.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=gt(e)?mt(this,e):e;return We(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return T(e)&&(p.getLogger(this).warn("#fetchPopupFeatures()","rectangle isn't a supported input, using its center point instead"),e=C(e.x+e.width/2,e.y+e.height/2)),ze(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return c(this.goTo({zoomFactor:2}))}async zoomOut(){if(this.canZoomOut)return c(this.goTo({zoomFactor:.5}))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await(import("./support/screenshotUtils.js"));return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await(import("./support/screenshotUtils.js")),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!nt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await(import("./support/screenshotUtils.js")),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return we.importLayerView(e)}hasLayerViewModule(e){return we.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ye(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,i):null,s=i?r(i):[...r(1)??[],...r(2)??[]];return s?.length?{constraints:s}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!yt(e,i)&&(null==t||(!!ie(t)||(!re(t)||null!=et(t,e,i))&&(!se(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i,r){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:s,isWGS84:n}=e;if(ie(t)&&(s||n)){return!n||2===r||null===tt(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:Z.WebMercator,viewingMode:i}]:[{spatialReference:s?Z.WGS84:Z.WebMercator,viewingMode:i}]}return re(t)||se(t)||!s&&!n?re(t)&&s&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:Z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:s?Z.WGS84:Z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?p.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${me(i)} viewing mode.`):e.isGeographic&&p.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return p.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return p.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ct(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await M(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),l(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Et[e]();if(t&&(g(this),m(i.signal),await t(i.signal)),this.destroyed)throw y();return m(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ke({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Je({view:this})),this.addHandles([this.updatingHandles.add(()=>De.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&De.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=d(this._featureTreeDebugger))},S),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?B(J(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},S),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=d(this._featureTiles)},b)],Vt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(jt),this.removeHandles(Vt),this._featureTiles=d(this.featureTiles),this._set("pointsOfInterest",d(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=X(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ne.create(this.state.viewingMode,i)),t||this.addHandles(v(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!Y(e,this.groundView.spatialReference,At,t)||(this.renderCoordsHelper.extent=At)},b),jt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(ot/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(jt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(v(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),b),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Le(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new st({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage||"WebGL context lost")})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(ot/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=d(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Ye({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>M(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=d(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ye(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(w(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?P(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(pt);for(const t of this.allLayerViews)(ne(t.layer)||ae(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(pt);for(const t of this.allLayerViews)ne(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){Mt(),F(),x(),ht(),Oe(),_e(),Q(),ut(),le(),rt(),lt(),Ee(),Ie(),G(),j(),at(),it(),Te.cleanupI3SLodHandling(),oe.cleanupTilemapCache(),xe.cleanupViewstate(),Ke.cleanupTerrainSurface()}};function Tt(e,t){return null!=e&&N(e.spatialReference,t)?B(e,t):null}e([O()],Ct.prototype,"_userClippingArea",void 0),e([O()],Ct.prototype,"_resourceController",void 0),e([O()],Ct.prototype,"stage",null),e([O({readOnly:!0})],Ct.prototype,"deconflictor",void 0),e([O({readOnly:!0})],Ct.prototype,"labeler",void 0),e([O({type:ge,readOnly:!0})],Ct.prototype,"animation",null),e([O({readOnly:!0})],Ct.prototype,"basemapTerrain",void 0),e([O({readOnly:!0})],Ct.prototype,"overlayManager",null),e([O({readOnly:!0})],Ct.prototype,"elevationProvider",void 0),e([O()],Ct.prototype,"camera",null),e([O({type:t})],Ct.prototype,"contentCamera",null),e([O({readOnly:!0})],Ct.prototype,"canvas",null),e([O({type:k,useTypeForAutocast:!1})],Ct.prototype,"center",null),e([O({type:z})],Ct.prototype,"clippingArea",null),e([O({type:be,nonNullable:!0})],Ct.prototype,"constraints",void 0),e([O({type:z,readOnly:!0})],Ct.prototype,"renderDataExtent",null),e([O({readOnly:!0})],Ct.prototype,"tileInfo",null),e([O({type:z,readOnly:!0})],Ct.prototype,"dataExtent",null),e([O({type:z,readOnly:!0})],Ct.prototype,"_groundAndLayersExtent",null),e([O({type:Me})],Ct.prototype,"environment",null),e([E("environment")],Ct.prototype,"castEnvironment",null),e([O({readOnly:!0})],Ct.prototype,"environmentManager",void 0),e([O({type:z})],Ct.prototype,"extent",null),e([O({type:r})],Ct.prototype,"floors",void 0),e([O()],Ct.prototype,"screenCenter",null),e([O()],Ct.prototype,"frustum",null),e([O({type:Number,readOnly:!0})],Ct.prototype,"fullOpacity",void 0),e([O({readOnly:!0})],Ct.prototype,"graphicsView",void 0),e([O()],Ct.prototype,"analysisViewManager",void 0),e([O()],Ct.prototype,"groundView",void 0),e([O({readOnly:!0})],Ct.prototype,"layerviewCollections",null),e([O({type:Boolean})],Ct.prototype,"initialExtentRequired",null),e([O()],Ct.prototype,"defaultsFromMapSettings",null),e([O()],Ct.prototype,"interacting",null),e([O()],Ct.prototype,"stationary",null),e([O()],Ct.prototype,"navigating",null),e([O()],Ct.prototype,"map",void 0),e([O()],Ct.prototype,"padding",null),e([O({type:Je,readOnly:!0})],Ct.prototype,"pointsOfInterest",void 0),e([O()],Ct.prototype,"_featureTiles",void 0),e([O()],Ct.prototype,"featureTiles",null),e([O()],Ct.prototype,"_featureTreeDebugger",void 0),e([O({constructOnly:!0})],Ct.prototype,"deactivatedWebGLExtensions",void 0),e([O({constructOnly:!0})],Ct.prototype,"debugWebGLExtensions",void 0),e([O({constructOnly:!0})],Ct.prototype,"renderCanvas",void 0),e([O({constructOnly:!0})],Ct.prototype,"state",void 0),e([O()],Ct.prototype,"screenSizePerspective",void 0),e([O({readOnly:!0})],Ct.prototype,"inputManager",void 0),e([O({readOnly:!0})],Ct.prototype,"stateManager",void 0),e([O({type:["low","medium","high"]})],Ct.prototype,"qualityProfile",null),e([O({type:Be,get(){let e=this._get("qualitySettings");if(!e){const t=ke(this.qualityProfile);e=new Be(t)}return e}})],Ct.prototype,"qualitySettings",void 0),e([O()],Ct.prototype,"slice",void 0),e([O({readOnly:!0})],Ct.prototype,"typeSpecificPreconditionsReady",null),e([O({readOnly:!0})],Ct.prototype,"renderCoordsHelper",void 0),e([O({readOnly:!0})],Ct.prototype,"sceneIntersectionHelper",void 0),e([O({type:Number,readOnly:!0})],Ct.prototype,"resolution",null),e([O({type:Number})],Ct.prototype,"scale",null),e([O({readOnly:!0,type:Number})],Ct.prototype,"terrainLevel",null),e([O()],Ct.prototype,"heightModelInfo",null),e([O({type:Z})],Ct.prototype,"spatialReference",void 0),e([O({type:Boolean,value:!1})],Ct.prototype,"alphaCompositingEnabled",null),e([O({constructOnly:!0})],Ct.prototype,"preserveDrawingBufferEnabled",void 0),e([O({type:Boolean})],Ct.prototype,"supersampleScreenshotsEnabled",void 0),e([O({readOnly:!0})],Ct.prototype,"type",void 0),e([O(),E(e=>e instanceof vt?e:H(_t,e))],Ct.prototype,"ui",void 0),e([O({type:Boolean,readOnly:!0})],Ct.prototype,"updating",null),e([O()],Ct.prototype,"_updatingObjects",null),e([O()],Ct.prototype,"_updatingObjectsWithProgress",null),e([O()],Ct.prototype,"_updatingObjectsToDebug",null),e([O({type:Number,readOnly:!0})],Ct.prototype,"updatingProgress",void 0),e([O({type:["global","local"]})],Ct.prototype,"viewingMode",null),e([O({type:i})],Ct.prototype,"viewpoint",null),e([O({readOnly:!0})],Ct.prototype,"visibleArea",null),e([O({type:Number})],Ct.prototype,"zoom",null),e([O({readOnly:!0})],Ct.prototype,"quality",null),e([O({readOnly:!0})],Ct.prototype,"resolutionScale",null),e([O()],Ct.prototype,"focusAreasView",void 0),e([O()],Ct.prototype,"_defaultToMapOptions",null),e([O()],Ct.prototype,"_defaultHitTestOptions",null),Ct=St=e([L("esri.views.SceneView")],Ct);const Rt=U(),xt=R(),At=K(),Ot=te(0,0,0,Z.WebMercator),Et={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Lt=Ct;export{Lt as default};
package/views/View2D.d.ts CHANGED
@@ -715,9 +715,16 @@ export default abstract class View2D extends View2DSuperclass {
715
715
  * `ChangeTimeZone($feature.dateField, "system")`) to display dates in another time zone regardless of web map
716
716
  * time zone. Alternatively they can construct Date values in the context of a specific time zone
717
717
  * (e.g. `Date(2013, 1, 1, 10, 00, 00, 00, "UTC")`).
718
- * - **Components/widgets**: Date values, including values from `date` and `timestamp-offset` fields, will be displayed in the view's time zone by default in the following components/widgets:
719
- * [Bookmarks](https://developers.arcgis.com/javascript/latest/references/core/widgets/Bookmarks/), [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/), [Feature](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/), [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/), [Features](https://developers.arcgis.com/javascript/latest/references/core/widgets/Features/),
720
- * [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/), [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/), [Popup](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/) and [TimeSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/).
718
+ * - **Components**: Date values, including values from `date` and `timestamp-offset` fields, will be displayed in the view's time zone by default in the
719
+ * [Bookmarks](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-bookmarks/),
720
+ * [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/),
721
+ * [Feature](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/),
722
+ * [Feature Form](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-form/),
723
+ * [Features](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/),
724
+ * [Feature Table](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature-table/),
725
+ * [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/),
726
+ * [Popup](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-popup/), and
727
+ * [Time Bar](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/) components.
721
728
  *
722
729
  * The time zone can be set to one of the following values:
723
730
  *
@@ -726,9 +733,15 @@ export default abstract class View2D extends View2DSuperclass {
726
733
  * Value | Description |
727
734
  * ----- | ----------- |
728
735
  * system | Dates and times will be displayed in the time zone of the device or browser.
729
- * unknown | Dates and times will be displayed based on the time zone that has been defined for the layer. No adjustments are made to the display of date info. [TimeSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/) is disabled.
736
+ * unknown | Dates and times will be displayed based on the time zone that has been defined for the layer. No adjustments are made to the display of date info. The [Time Bar component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/) is disabled.
730
737
  * Specified IANA time zone | Dates and times will be displayed in the specified IANA time zone. See [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
731
738
  *
739
+ * > [!NOTE]
740
+ * >
741
+ * > When `timeZone` is `system`, Arcade-based labels, renderers, and visual variables that use date values can produce
742
+ * > different results on devices in different system time zones. Set an explicit IANA time zone for consistent
743
+ * > visualization.
744
+ *
732
745
  * > [!WARNING]
733
746
  * >
734
747
  * > If the `timeZone` is set to `unknown` and a layer’s date/time field includes time information, set the [DateTimeFieldFormat.timeStyle](https://developers.arcgis.com/javascript/latest/references/core/layers/support/DateTimeFieldFormat/#timeStyle) property to either long or full on the corresponding [date/time field](https://developers.arcgis.com/javascript/latest/references/core/layers/support/DateTimeFieldFormat/).
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{onAbort as t,throwIfAborted as i}from"../../core/promiseUtils.js";import l from"../../layers/Layer.js";function a(e){return"tryRecycleWith"in e}class s{constructor(r,i,l){this.layer=r,this.view=i,this.layerViewImporter=l,this._controller=new AbortController,this._started=!1,this.done=!1,this._deferred=Promise.withResolvers(),this.promise=this._deferred.promise,t(this._controller.signal,()=>{this._recycleController?.abort();const t=new e("cancelled:layerview-create","layerview creation cancelled",{layer:r});this._deferred?.reject(t)})}tryRecycle(e){if(!this.done||!this.layerView||!a(this.layerView))return null;this._recycleController?.abort(),this._recycleController=new AbortController;const r=this.layer.type,t=this._recycleController.signal;for(let l=0;l<e.length;l++){const a=e[l];if(a.type!==r)continue;const s=this.layerView.tryRecycleWith(a,{signal:t});if(s){e.splice(l,1),this.layer.emit("layerview-destroy",{view:this.layerView.view,layerView:this.layerView}),this.layerView.view?.emit("layerview-destroy",{view:this.layerView.view,layerView:this.layerView,layer:this.layer}),this.layer=a;const r=this.layerView,o=r.view;return this.promise=s.then(()=>(i(t),a.emit("layerview-create",{view:o,layerView:r}),o.emit("layerview-create",{view:o,layerView:r,layer:a}),r)),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:t}=this;r.emit("layerview-destroy",{view:t,layerView:e}),t.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null,this.promise=null,this._deferred=null}async start(){const{view:l}=this;if(this._started||!l.map)return;this._started=!0;const{_controller:{signal:a},layer:s}=this;this._map=l.map;try{let n,w;if(await s.load({signal:a}),s.prefetchResources&&await s.prefetchResources({signal:a}),o(s))n=await s.createLayerView(l,{signal:a});else{if(!this.layerViewImporter.hasLayerViewModule(s))throw new e("layer:view-not-supported","No layerview implementation was found");const r=await this.layerViewImporter.importLayerView(s);i(a),n="default"in r?new r.default({layer:s,view:l}):new r({layer:s,view:l})}const h=()=>{w=r(w),n.destroyed||n.destroy(),this.done=!0};w=t(a,h),i(a);try{await n.when()}catch(y){throw h(),y}const c=this._map?.allLayers?.includes(s);if(!c)return h(),void this._deferred?.reject(new e("view:no-layerview-for-layer","The layer has been removed from the map",{layer:s}));this.layerView=n,s.emit("layerview-create",{view:l,layerView:n}),l.emit("layerview-create",{layer:s,layerView:n}),this.done=!0,this._deferred?.resolve(n)}catch(y){s.emit("layerview-create-error",{view:l,error:y}),l.emit("layerview-create-error",{layer:s,error:y}),this.done=!0,this._deferred?.reject(new e("layerview:create-error","layerview creation failed",{layer:s,error:y}))}}}function o(e){return e.createLayerView!==l.prototype.createLayerView}export{s as LayerLayerViewInfo};
2
+ import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{onAbort as t,throwIfAborted as i}from"../../core/promiseUtils.js";import{signal as l}from"../../core/signal.js";import a from"../../layers/Layer.js";function s(e){return"tryRecycleWith"in e}class o{constructor(r,i,a){this.layer=r,this.view=i,this.layerViewImporter=a,this._controller=new AbortController,this._started=!1,this._done=l(!1),this._layerView=l(null),this._deferred=Promise.withResolvers(),this.promise=this._deferred.promise,t(this._controller.signal,()=>{this._recycleController?.abort();const t=new e("cancelled:layerview-create","layerview creation cancelled",{layer:r});this._deferred?.reject(t)})}get done(){return this._done.value}get layerView(){return this._layerView.value}tryRecycle(e){if(!this.done||!this.layerView||!s(this.layerView))return null;this._recycleController?.abort(),this._recycleController=new AbortController;const r=this.layer.type,t=this._recycleController.signal;for(let l=0;l<e.length;l++){const a=e[l];if(a.type!==r)continue;const s=this.layerView.tryRecycleWith(a,{signal:t});if(s){e.splice(l,1),this.layer.emit("layerview-destroy",{view:this.layerView.view,layerView:this.layerView}),this.layerView.view?.emit("layerview-destroy",{view:this.layerView.view,layerView:this.layerView,layer:this.layer}),this.layer=a;const r=this.layerView,o=r.view;return this.promise=s.then(()=>(i(t),a.emit("layerview-create",{view:o,layerView:r}),o.emit("layerview-create",{view:o,layerView:r,layer:a}),r)),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:t}=this;r.emit("layerview-destroy",{view:t,layerView:e}),t.emit("layerview-destroy",{layer:r,layerView:e})}this._done.value=!0,this.layer=null,this._layerView.value=null,this.view=null,this.layerViewImporter=null,this._map=null,this.promise=null,this._deferred=null}async start(){const{view:l}=this;if(this._started||!l.map)return;this._started=!0;const{_controller:{signal:a},layer:s}=this;this._map=l.map;try{let n,w;if(await s.load({signal:a}),s.prefetchResources&&await s.prefetchResources({signal:a}),y(s))n=await s.createLayerView(l,{signal:a});else{if(!this.layerViewImporter.hasLayerViewModule(s))throw new e("layer:view-not-supported","No layerview implementation was found");const r=await this.layerViewImporter.importLayerView(s);i(a),n="default"in r?new r.default({layer:s,view:l}):new r({layer:s,view:l})}const h=()=>{w=r(w),n.destroyed||n.destroy(),this._done.value=!0};w=t(a,h),i(a);try{await n.when()}catch(o){throw h(),o}const c=this._map?.allLayers?.includes(s);if(!c)return h(),void this._deferred?.reject(new e("view:no-layerview-for-layer","The layer has been removed from the map",{layer:s}));this._layerView.value=n,s.emit("layerview-create",{view:l,layerView:n}),l.emit("layerview-create",{layer:s,layerView:n}),this._done.value=!0,this._deferred?.resolve(n)}catch(o){s.emit("layerview-create-error",{view:l,error:o}),l.emit("layerview-create-error",{layer:s,error:o}),this._done.value=!0,this._deferred?.reject(new e("layerview:create-error","layerview creation failed",{layer:s,error:o}))}}}function y(e){return e.createLayerView!==a.prototype.createLayerView}export{o as LayerLayerViewInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import i from"../../core/Error.js";import t from"../../core/Logger.js";import{someMap as s}from"../../core/MapUtils.js";import{createAbortError as o,isAbortError as a}from"../../core/promiseUtils.js";import{on as n,watch as l,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as y}from"../../core/scheduling.js";import{property as c,subclass as p}from"../../core/accessorSupport/decorators.js";import{get as d}from"../../core/accessorSupport/get.js";import{UpdatingHandles as w}from"../../core/support/UpdatingHandles.js";import{destroyMap as f}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as g}from"./LayerLayerViewInfo.js";function u(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let m=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new w,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)!1!==this.layerViewFilter?.(r)&&this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=Promise.withResolvers(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(y(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const{map:e}=this.view;if(!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,i=[],t=this.view.ready,s=e=>{if(null!=e)for(const o of e)if(o){if(!1===this.layerViewFilter?.(o))continue;r.add(o);const e=this._layerLayerViewInfoMap.get(o);e&&t?e.start():e||this._recyclingInfoMap.has(o)||i.push(o),"layers"in o&&o.layers&&s(o.layers)}};for(const a of this._rootCollectionNames)s(d(this,a));const o=new Array,n=e=>{const r=e.tryRecycle(i);if(r){const i=e.layer;this._recyclingInfoMap.set(i,e),this._watchUpdatingTracking.consumePromise(r),this.notifyChange("updating"),r.then(()=>{this._recyclingInfoMap.get(i)===e&&e.promise===r&&(this._recyclingInfoMap.delete(i),this._layerLayerViewInfoMap.set(i,e),this._reschedule(),this.notifyChange("updating"),this.notifyChange("allLayerViews"))}).catch(t=>{this._recyclingInfoMap.get(i)!==e||e.promise!==r||a(t)||(this._recyclingInfoMap.delete(i),e.destroy(),this._reschedule(),this.notifyChange("updating"),this.notifyChange("allLayerViews"))})}else o.push(e)};for(const a of this._layerLayerViewInfoMap.values())r.has(a.layer)||(this._layerLayerViewInfoMap.delete(a.layer),n(a));for(const a of this._recyclingInfoMap.values())r.has(a.layer)||(this._recyclingInfoMap.delete(a.layer),n(a));for(const a of i)this._createLayerView(a);this._refreshCollections(),o.forEach(e=>e.destroy());const l=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.groundLayers,e?.basemap?.referenceLayers,e?.layers].filter(e=>!!e);r.forEach(e=>"layers"in e&&l.push(e.layers)),this.addHandles(l.map(e=>this._watchUpdatingTracking.addOnCollectionChange(()=>e,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null},this._layersToLayerViews=new Map(e.layerviewMapping)}initialize(){this.addHandles([n(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),l(()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]},()=>this._reschedule().catch(()=>{}),h)]),this._preloadLayerViewModules(),this._reschedule().catch(()=>{})}clearHandles(){this._watchUpdatingTracking.removeAll()}destroy(){this.clear(),f(this._recyclingInfoMap),f(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(o()),this._workPromise=null)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),f(this._layerLayerViewInfoMap),f(this._recyclingInfoMap),this.notifyChange("allLayerViews"))}async whenLayerView(e){await this._reschedule();const r=this._layerLayerViewInfoMap.get(e)?.promise;if(!r){const r=this._recyclingInfoMap.get(e)?.promise;if(!r)throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return r}return r}isCreatingLayerViewsForLayer(e,r){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(e);if(!i?.done)return!0;const t=i.layerView;return!(!t||!r||t.parent===r)||!!(i.done&&t&&"layers"in e&&e.layers?.length)&&e.layers.some(e=>this.isCreatingLayerViewsForLayer(e,t))}get allLayerViews(){const e=[];for(const r of this._layerLayerViewInfoMap.values())r.layerView&&e.push(r.layerView);for(const r of this._recyclingInfoMap.values())r.layerView&&e.push(r.layerView);return e}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(d(this,e),d(this,r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining"),this.notifyChange("allLayerViews")}_clearCollections(){for(const e of this._layersToLayerViews.values())d(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void r?.removeAll();let t=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e?.layerView)continue;const{layerView:o}=e;o.layer=s,o.parent=i,r.at(t)!==o&&r.splice(t,0,o),"layers"in s&&u(o)&&this._populateLayerViewsOwners(s.layers,o.layerViews,o),++t}t<r.length&&r.splice(t)}_createLayerView(e){e.load().catch(()=>{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new g(e,this.view,this.layerViewImporter),i=r.promise?.then(()=>this._refreshCollections(),r=>{r&&(a(r)||"cancelled:layerview-create"===r.name)||t.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this.destroyed||this._refreshCollections()});this._watchUpdatingTracking.consumePromise(i),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining"),this.notifyChange("allLayerViews")}};e([c()],m.prototype,"_workPromise",void 0),e([c({readOnly:!0})],m.prototype,"_watchUpdatingTracking",void 0),e([c({readOnly:!0})],m.prototype,"_layersToLayerViews",void 0),e([c({constructOnly:!0})],m.prototype,"layerviewMapping",void 0),e([c({readOnly:!0})],m.prototype,"_rootCollectionNames",null),e([c({constructOnly:!0})],m.prototype,"layerViewFilter",void 0),e([c()],m.prototype,"layerViewImporter",void 0),e([c({readOnly:!0})],m.prototype,"updating",null),e([c({readOnly:!0})],m.prototype,"updatingRemaining",null),e([c({constructOnly:!0})],m.prototype,"view",void 0),e([c({readOnly:!0})],m.prototype,"allLayerViews",null),m=e([p("esri.views.support.LayerViewManager")],m);const _=m;export{_ as default};
2
+ import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{someMap as s}from"../../core/MapUtils.js";import{createAbortError as o,isAbortError as a}from"../../core/promiseUtils.js";import l from"../../core/ReactiveMap.js";import{on as n,watch as c,syncAndInitial as y}from"../../core/reactiveUtils.js";import{schedule as h}from"../../core/scheduling.js";import{property as p,subclass as w}from"../../core/accessorSupport/decorators.js";import{get as d}from"../../core/accessorSupport/get.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{destroyMap as m}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as u}from"./LayerLayerViewInfo.js";function _(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let g=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new l,this._recyclingInfoMap=new l,this._watchUpdatingTracking=new f,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)!1!==this.layerViewFilter?.(r)&&this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=Promise.withResolvers(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(h(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const{map:e}=this.view;if(!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return;this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,t=[],i=this.view.ready,s=e=>{if(null!=e)for(const o of e)if(o){if(!1===this.layerViewFilter?.(o))continue;r.add(o);const e=this._layerLayerViewInfoMap.get(o);e&&i?e.start():e||this._recyclingInfoMap.has(o)||t.push(o),"layers"in o&&o.layers&&s(o.layers)}};for(const a of this._rootCollectionNames)s(d(this,a));const o=new Array,l=e=>{const r=e.tryRecycle(t);if(r){const t=e.layer;this._recyclingInfoMap.set(t,e),this._watchUpdatingTracking.consumePromise(r),r.then(()=>{this._recyclingInfoMap.get(t)===e&&e.promise===r&&(this._recyclingInfoMap.delete(t),this._layerLayerViewInfoMap.set(t,e),this._reschedule())}).catch(i=>{this._recyclingInfoMap.get(t)!==e||e.promise!==r||a(i)||(this._recyclingInfoMap.delete(t),e.destroy(),this._reschedule())})}else o.push(e)};for(const a of this._layerLayerViewInfoMap.values())r.has(a.layer)||(this._layerLayerViewInfoMap.delete(a.layer),l(a));for(const a of this._recyclingInfoMap.values())r.has(a.layer)||(this._recyclingInfoMap.delete(a.layer),l(a));for(const a of t)this._createLayerView(a);this._refreshCollections(),o.forEach(e=>e.destroy());const n=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.groundLayers,e?.basemap?.referenceLayers,e?.layers].filter(e=>!!e);r.forEach(e=>"layers"in e&&n.push(e.layers)),this.addHandles(n.map(e=>this._watchUpdatingTracking.addOnCollectionChange(()=>e,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null},this._layersToLayerViews=new Map(e.layerviewMapping)}initialize(){this.addHandles([n(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),c(()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]},()=>this._reschedule().catch(()=>{}),y)]),this._preloadLayerViewModules(),this._reschedule().catch(()=>{})}clearHandles(){this._watchUpdatingTracking.removeAll()}destroy(){this.clear(),m(this._recyclingInfoMap),m(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(o()),this._workPromise=null)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),m(this._layerLayerViewInfoMap),m(this._recyclingInfoMap))}async whenLayerView(e){await this._reschedule();const r=this._layerLayerViewInfoMap.get(e)?.promise;if(!r){const r=this._recyclingInfoMap.get(e)?.promise;if(!r)throw new t("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return r}return r}isCreatingLayerViewsForLayer(e,r){const t=this._layerLayerViewInfoMap.get(e);if(!t?.done)return!0;const i=t.layerView;return!(!i||!r||i.parent===r)||!!(t.done&&i&&"layers"in e&&e.layers?.length)&&e.layers.some(e=>this.isCreatingLayerViewsForLayer(e,i))}get allLayerViews(){const e=[];for(const r of this._layerLayerViewInfoMap.values())r.layerView&&e.push(r.layerView);for(const r of this._recyclingInfoMap.values())r.layerView&&e.push(r.layerView);return e}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(d(this,e),d(this,r),this.view)}_clearCollections(){for(const e of this._layersToLayerViews.values())d(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,t){if(!e||!r)return void r?.removeAll();let i=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e?.layerView)continue;const{layerView:o}=e;o.layer=s,o.parent=t,r.at(i)!==o&&r.splice(i,0,o),"layers"in s&&_(o)&&this._populateLayerViewsOwners(s.layers,o.layerViews,o),++i}i<r.length&&r.splice(i)}_createLayerView(e){e.load().catch(()=>{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new u(e,this.view,this.layerViewImporter),t=r.promise?.then(()=>this._refreshCollections(),r=>{r&&(a(r)||"cancelled:layerview-create"===r.name)||i.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this.destroyed||this._refreshCollections()});this._watchUpdatingTracking.consumePromise(t),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start()}};e([p()],g.prototype,"_workPromise",void 0),e([p({readOnly:!0})],g.prototype,"_watchUpdatingTracking",void 0),e([p({readOnly:!0})],g.prototype,"_layersToLayerViews",void 0),e([p({constructOnly:!0})],g.prototype,"layerviewMapping",void 0),e([p({readOnly:!0})],g.prototype,"_rootCollectionNames",null),e([p({constructOnly:!0})],g.prototype,"layerViewFilter",void 0),e([p()],g.prototype,"layerViewImporter",void 0),e([p({readOnly:!0})],g.prototype,"updating",null),e([p({readOnly:!0})],g.prototype,"updatingRemaining",null),e([p({constructOnly:!0})],g.prototype,"view",void 0),e([p({readOnly:!0})],g.prototype,"allLayerViews",null),g=e([w("esri.views.support.LayerViewManager")],g);const V=g;export{V as default};
@@ -64,7 +64,7 @@ export default class InitialViewProperties extends InitialViewPropertiesSupercla
64
64
  * Value | Description |
65
65
  * ----- | ----------- |
66
66
  * system | Dates and times are be displayed in the timezone of the device or browser.
67
- * unknown | Dates and times will be displayed based on the time zone that has been defined for the layer. No adjustments are made to the display of date info. Additionally, the [TimeSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/) is disabled.
67
+ * unknown | Dates and times will be displayed based on the time zone that has been defined for the layer. No adjustments are made to the display of date info. Additionally, the [Time Bar component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-time-bar/) is disabled.
68
68
  * Specified IANA timezone | Dates and times will be displayed in the specified IANA time zone. See [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
69
69
  *
70
70
  * > [!WARNING]
@@ -52,7 +52,9 @@ export default class SunLighting extends JSONSupport {
52
52
  accessor directShadowsEnabled: boolean;
53
53
  /**
54
54
  * The UTC time zone offset in hours that should be displayed in the UI to represent the date.
55
- * This value does not have an impact on the actual lighting of the scene.
55
+ * The Daylight component and widget use this value when displaying and editing the simulated sun date.
56
+ * It is separate from [SceneView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone), which controls how supported date/time values are displayed.
57
+ * This value does not affect the actual lighting of the scene.
56
58
  */
57
59
  accessor displayUTCOffset: number | null | undefined;
58
60
  /**
@@ -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/Accessor.js";import s from"../../../core/Error.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{whenOrAbort as a,settleWithPromise as n}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{addMany as l}from"../../../core/SetUtils.js";import{property as c,subclass as u}from"../../../core/accessorSupport/decorators.js";import{makeArcadeContext as p,castArcadeValue as d}from"./expressionUtils.js";import{makeUseId as f}from"../inputs/support/inputUtils.js";import{isFieldElementTemplate as h,isGroupElementTemplate as m}from"../templates/support/templateUtils.js";let x=null;const v=()=>r.getLogger("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager");let g=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new i,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,y,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,E,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],C,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,s])=>this.runExpressionsDependentOnChangedFieldsForFeature([...s.keys()],t,e));_(await Promise.allSettled(t))}catch(t){v().error(t),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async runExpressionsDependentOnChangedFieldsForFeature(e,t,s){if(this._abortController.signal.aborted)return;const r=this.layerExpressionsModelMap.get(t.layer);if(!r||0===r.components.length)return;const o=w(r,e);0!==o.length&&await this.evaluateAffectedComponents([...o],t,r,s)}async evaluateAffectedComponents(e,t,s,r){const n=new Map;for(const a of e){o(n,a,()=>this.createSccEvaluator({scc:a,feature:t,evaluatorMap:n,expressionModel:s,isRoot:!0})).isRoot=!0}if(0===n.size)return;const l=[...n.values()],c={transaction:r,previousOutcomes:new i},u=l.map(e=>e.evaluate(c));_(await a(Promise.allSettled(u),this._abortController))}createSccEvaluator({scc:e,feature:t,evaluatorMap:s,expressionModel:r,isRoot:a}){const n=new b(e,t,this.arcadeContext,r,this.evaluatedExpressions,a,this._abortController);for(const i of e.adjacencyList){o(s,i,()=>this.createSccEvaluator({scc:i,feature:t,evaluatorMap:s,expressionModel:r,isRoot:!1})).dependencies.push(n)}return n}async _evaluateSpecifiedComponentsForEachFeature(e,t,s){this.calculating=!0;try{const r=[];for(const o of e){const e=this.layerExpressionsModelMap.get(o.layer);e&&0!==e.components.length&&r.push(this.evaluateAffectedComponents(t(e),o,e,s))}_(await a(Promise.allSettled(r),this._abortController))}catch(r){v().error(r),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([c()],g.prototype,"calculating",void 0),e([c({constructOnly:!0})],g.prototype,"arcadeContext",void 0),e([c()],g.prototype,"_abortController",void 0),e([c()],g.prototype,"layerExpressionsModelMap",void 0),e([c()],g.prototype,"evaluatedExpressions",void 0),e([c()],g.prototype,"expressionEvaluationFailed",void 0),g=e([u("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],g);class b{constructor(e,t,s,r,o,a,n){this.scc=e,this.feature=t,this.arcadeContextInfo=s,this.expressionsModel=r,this.evaluatedExpressions=o,this.isRoot=a,this._abortController=n,this._resolver=null,this.dependencies=[]}get baseContext(){return p(this.arcadeContextInfo,this.feature,this._abortController.signal)}evaluate(e){return this._resolver||(this._resolver=Promise.withResolvers(),n(this._resolver,this._evaluate(e))),this._resolver.promise}async _evaluate(e){null===x&&(x=await(import("../../../arcade/languageUtils.js")));const t=[],r=this.dependencies.map(t=>t.evaluate(e));if(_(await a(Promise.allSettled(r),this._abortController)),this._shouldEvaluate(e.transaction)){for(const r of this.scc.executors){const a=this.baseContext;if(this._abortController.signal.aborted)break;const c=this.expressionsModel.arcadeExecutorUses.get(r)??[],u=o(this.evaluatedExpressions,this.feature,()=>new i);let p=null,h=null;try{p=r.isAsync?await r.executeAsync(a.variables,a.executeContext):r.execute(a.variables,a.executeContext),h={result:p,status:"success"}}catch(n){h={error:n,status:"error"}}const{transaction:m,previousOutcomes:g}=e;for(const t of c){const s=f(t),r=u.get(s);r&&g.set(s,r),u.set(f(t),h);const o=this.expressionsModel.elementTemplateMap.get(t.elementId);switch(t.executorPurpose){case"editable":if(!1===h.result&&!1!==r?.result){const e=u.get(f({elementId:o.elementId,executorPurpose:"value"}));if(e){const{fieldName:t}=o,s=F(this.feature,t),r=d(e.result,s,this.arcadeContextInfo.timeZone,x);m.setValue(this.feature,t,r)}}break;case"value":{if("error"===h?.status)continue;const e=o.getExpressionExecutorsForLayer(this.feature.layer);let t=!0;if(e?.editableExpression&&(t=!1===u.get(f({elementId:o.elementId,executorPurpose:"editable"}))?.result),t){const e=o.fieldName,t=this.feature.getAttribute(e)??null;try{const s=F(this.feature,e),r=d(h.result,s,this.arcadeContextInfo.timeZone,x);r!==t&&m.setValue(this.feature,e,r)}catch(l){v().error(`Failed to set calculated value for field '${e}'`,l)}}}break;case"visibility":this.expressionsModel.preserveFieldValuesWhenHidden||!0!==r?.result||!1!==h.result||"user"!==m.originActor||A(o,this.feature,u,e)}}if("error"===h?.status){const e=new Set;for(const t of c){const s=this.expressionsModel.elementTemplateMap.get(t.elementId);if(s)switch(t.executorPurpose){case"editable":e.add(s.label+" - Editable expression");break;case"required":e.add(s.label+" - Required expression");break;case"value":e.add(s.label+" - Value expression");break;case"visibility":e.add(s.label+" - Visibility expression")}}t.push(e.size>0?new s("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")"):new s("expression-evaluation-failed","Arcade evaluation failed "))}}if(t.length>0)throw M(t)}}_shouldEvaluate(e){if(this._abortController.signal.aborted)return!1;if(this.isRoot)return!0;const t=e.changesForFeature(this.feature);return!(!t||0===t.size)&&this.scc.fieldsReferenced.values().some(e=>t.has(e))}}function y(e){return e.components}function E(e){return Array.from(e.geometryReferences)}function C(e){return Array.from(e.originalFeatureReferences)}function F(e,t){const r=e.layer.fieldsIndex.get(t);if(!r)throw new s("field-not-found",`Field '${t}' not found on layer.`);return r}function w(e,t){const s=new Set;for(const r of t)l(s,e.fieldReferencesMap.get(r));return Array.from(s)}function M(e){return new AggregateError(e,`One or more expression executions failed. First error message: ${e[0].message}`)}function _(e){const t=[],s=new Set;for(const r of e){if("fulfilled"===r.status)continue;const e=r.reason instanceof AggregateError?r.reason.errors:[r.reason];for(const r of e)s.has(r)||(s.add(r),t.push(r))}if(t.length>0)throw M(t)}function A(e,t,s,r){h(e)?S(e,t,s,r):m(e)&&j(e,t,s,r)}function S(e,t,s,r){const{group:o}=e;o&&!R(o,s,r.previousOutcomes)||I(t,e,r)}function j(e,t,s,r){for(const o of e.elements)h(o)&&R(o,s,r.previousOutcomes)&&I(t,o,r)}function I(e,{fieldName:t},s){s.transaction.setValue(e,t,null)}function R(e,t,s){const r=f({elementId:e.elementId,executorPurpose:"visibility"}),o=s.get(r)??t.get(r);return!o||!!o.result}export{g as ExpressionsManager};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import s from"../../../core/Error.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{whenOrAbort as n,settleWithPromise as a}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{addMany as l}from"../../../core/SetUtils.js";import{property as c,subclass as u}from"../../../core/accessorSupport/decorators.js";import{makeArcadeContext as p,castArcadeValue as d}from"./expressionUtils.js";import{makeUseId as f}from"../inputs/support/inputUtils.js";import{isFieldElementTemplate as h,isGroupElementTemplate as m}from"../templates/support/templateUtils.js";let x=null;const v=()=>r.getLogger("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager");let g=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new i,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,b,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,y,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],C,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,s])=>this.runExpressionsDependentOnChangedFieldsForFeature([...s.keys()],t,e));_(await Promise.allSettled(t))}catch(t){v().error(t),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async runExpressionsDependentOnChangedFieldsForFeature(e,t,s){if(this._abortController.signal.aborted)return;const r=this.layerExpressionsModelMap.get(t.layer);if(!r||0===r.components.length)return;const o=w(r,e);0!==o.length&&await this.evaluateAffectedComponents([...o],t,r,s)}async evaluateAffectedComponents(e,t,s,r){const a=new Map;for(const n of e){o(a,n,()=>this.createSccEvaluator({scc:n,feature:t,evaluatorMap:a,expressionModel:s,isRoot:!0})).isRoot=!0}if(0===a.size)return;const l=[...a.values()],c={transaction:r,previousOutcomes:new i},u=l.map(e=>e.evaluate(c));_(await n(Promise.allSettled(u),this._abortController))}createSccEvaluator({scc:e,feature:t,evaluatorMap:s,expressionModel:r,isRoot:n}){const a=new E(e,t,this.arcadeContext,r,this.evaluatedExpressions,n,this._abortController);for(const i of e.adjacencyList){o(s,i,()=>this.createSccEvaluator({scc:i,feature:t,evaluatorMap:s,expressionModel:r,isRoot:!1})).dependencies.push(a)}return a}async _evaluateSpecifiedComponentsForEachFeature(e,t,s){this.calculating=!0;try{const r=[];for(const o of e){const e=this.layerExpressionsModelMap.get(o.layer);e&&0!==e.components.length&&r.push(this.evaluateAffectedComponents(t(e),o,e,s))}_(await n(Promise.allSettled(r),this._abortController))}catch(r){v().error(r),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([c()],g.prototype,"calculating",void 0),e([c({constructOnly:!0})],g.prototype,"arcadeContext",void 0),e([c()],g.prototype,"_abortController",void 0),e([c()],g.prototype,"layerExpressionsModelMap",void 0),e([c()],g.prototype,"evaluatedExpressions",void 0),e([c()],g.prototype,"expressionEvaluationFailed",void 0),g=e([u("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],g);class E{constructor(e,t,s,r,o,n,a){this.scc=e,this.feature=t,this.arcadeContextInfo=s,this.expressionsModel=r,this.evaluatedExpressions=o,this.isRoot=n,this._abortController=a,this._resolver=null,this.dependencies=[]}get baseContext(){return p(this.arcadeContextInfo,this.feature,this._abortController.signal)}evaluate(e){return this._resolver||(this._resolver=Promise.withResolvers(),a(this._resolver,this._evaluate(e))),this._resolver.promise}async _evaluate(e){null===x&&(x=await(import("../../../arcade/languageUtils.js")));const t=[],r=this.dependencies.map(t=>t.evaluate(e));if(_(await n(Promise.allSettled(r),this._abortController)),this._shouldEvaluate(e.transaction)){for(const r of this.scc.executors){const n=this.baseContext;if(this._abortController.signal.aborted)break;const c=this.expressionsModel.arcadeExecutorUses.get(r)??[],u=o(this.evaluatedExpressions,this.feature,()=>new i);let p=null,h=null;try{p=r.isAsync?await r.executeAsync(n.variables,n.executeContext):r.execute(n.variables,n.executeContext),h={result:p,status:"success"}}catch(a){h={error:a,status:"error"}}const{transaction:m,previousOutcomes:g}=e;for(const t of c){const s=f(t),r=u.get(s);r&&g.set(s,r),u.set(f(t),h);const o=this.expressionsModel.elementTemplateMap.get(t.elementId);switch(t.executorPurpose){case"editableExpression":if(!1===h.result&&!1!==r?.result){const e=u.get(f({elementId:o.elementId,executorPurpose:"valueExpression"}));if(e){const{fieldName:t}=o,s=F(this.feature,t),r=d(e.result,s,this.arcadeContextInfo.timeZone,x);m.setValue(this.feature,t,r)}}break;case"valueExpression":{if("error"===h?.status)continue;const e=o.getExpressionExecutorsForLayer(this.feature.layer);let t=!0;if(e?.editableExpression&&(t=!1===u.get(f({elementId:o.elementId,executorPurpose:"editableExpression"}))?.result),t){const e=o.fieldName,t=this.feature.getAttribute(e)??null;try{const s=F(this.feature,e),r=d(h.result,s,this.arcadeContextInfo.timeZone,x);r!==t&&m.setValue(this.feature,e,r)}catch(l){v().error(`Failed to set calculated value for field '${e}'`,l)}}}break;case"visibilityExpression":this.expressionsModel.preserveFieldValuesWhenHidden||!0!==r?.result||!1!==h.result||"user"!==m.originActor||A(o,this.feature,u,e)}}if("error"===h?.status){const e=new Set;for(const t of c){const s=this.expressionsModel.elementTemplateMap.get(t.elementId);if(s)switch(t.executorPurpose){case"editableExpression":e.add(s.label+" - Editable expression");break;case"requiredExpression":e.add(s.label+" - Required expression");break;case"valueExpression":e.add(s.label+" - Value expression");break;case"visibilityExpression":e.add(s.label+" - Visibility expression")}}t.push(e.size>0?new s("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")"):new s("expression-evaluation-failed","Arcade evaluation failed "))}}if(t.length>0)throw M(t)}}_shouldEvaluate(e){if(this._abortController.signal.aborted)return!1;if(this.isRoot)return!0;const t=e.changesForFeature(this.feature);return!(!t||0===t.size)&&this.scc.fieldsReferenced.values().some(e=>t.has(e))}}function b(e){return e.components}function y(e){return Array.from(e.geometryReferences)}function C(e){return Array.from(e.originalFeatureReferences)}function F(e,t){const r=e.layer.fieldsIndex.get(t);if(!r)throw new s("field-not-found",`Field '${t}' not found on layer.`);return r}function w(e,t){const s=new Set;for(const r of t)l(s,e.fieldReferencesMap.get(r));return Array.from(s)}function M(e){return new AggregateError(e,`One or more expression executions failed. First error message: ${e[0].message}`)}function _(e){const t=[],s=new Set;for(const r of e){if("fulfilled"===r.status)continue;const e=r.reason instanceof AggregateError?r.reason.errors:[r.reason];for(const r of e)s.has(r)||(s.add(r),t.push(r))}if(t.length>0)throw M(t)}function A(e,t,s,r){h(e)?S(e,t,s,r):m(e)&&j(e,t,s,r)}function S(e,t,s,r){const{group:o}=e;o&&!R(o,s,r.previousOutcomes)||I(t,e,r)}function j(e,t,s,r){for(const o of e.elements)h(o)&&R(o,s,r.previousOutcomes)&&I(t,o,r)}function I(e,{fieldName:t},s){s.transaction.setValue(e,t,null)}function R(e,t,s){const r=f({elementId:e.elementId,executorPurpose:"visibilityExpression"}),o=s.get(r)??t.get(r);return!o||!!o.result}export{g as ExpressionsManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isSome as e,addMany as t,pushIfSome as n}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as i,last as r}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";class d{constructor({executorMap:e,fieldsIndex:t,preserveFieldValuesWhenHidden:n}){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.fieldsIndex=t,this.preserveFieldValuesWhenHidden=!0===n,this.elementTemplateMap=new Map;for(const s of e.keys())this.elementTemplateMap.set(s.elementId,s);this._buildDependencyGraph(e)}_buildDependencyGraph(e){const t=m(e,this.fieldsIndex),n={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...e.keys()].map(e=>[e.elementId,e])),executorMap:e,fieldElementTemplateMap:f(e),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:t,nodeStack:new o(r),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const[o,i]of e)null!=i&&(i.editableExpression&&s(this.arcadeExecutorUses,i.editableExpression,()=>[]).push({elementId:o.elementId,executorPurpose:"editable"}),i.valueExpression&&s(this.arcadeExecutorUses,i.valueExpression,()=>[]).push({elementId:o.elementId,executorPurpose:"value"}),i.visibilityExpression&&s(this.arcadeExecutorUses,i.visibilityExpression,()=>[]).push({elementId:o.elementId,executorPurpose:"visibility"}),i.requiredExpression&&s(this.arcadeExecutorUses,i.requiredExpression,()=>[]).push({elementId:o.elementId,executorPurpose:"required"}),i.textExpressions&&i.textExpressions.forEach((e,t)=>{s(this.arcadeExecutorUses,e,()=>[]).push({elementId:o.elementId,executorPurpose:"text",textExpressionIndex:t})}));for(const s of this.arcadeExecutorUses.values())s.sort(e=>"editable"===e.executorPurpose?-1:1);for(const s of t.values())-1===s.index&&c(s,n);this.dependencyGraphComponents=x(t),this.fieldReferencesMap=h(n),this.geometryReferences=E(n.geometryReferences,t),this.originalFeatureReferences=E(n.originalFeatureReferences,t),this.components=n.components}}class l{constructor(){this._executors=new Set,this._fieldsReferenced=new Set,this.adjacencyList=new Set}get executors(){return this._executors}get fieldsReferenced(){return this._fieldsReferenced}addExecutor(e){this._executors.add(e.executor),i(this._fieldsReferenced,e.fieldsUsedNormalized)}}function c(e,t){e.index=e.lowlink=t.nextIndex++,t.nodeStack.push(e);for(const n of p(e,t))-1===n.index?(c(n,t),e.lowlink=Math.min(e.lowlink,n.lowlink)):n.index<e.index&&t.nodeStack.contains(n)&&(e.lowlink=Math.min(e.lowlink,n.index)),t.nodeStack.contains(n)||null!=n.component&&e.incomingCrossLinkNeighbors.add(n.component);if(e.lowlink===e.index){const n=new l;for(t.components.push(n);y(t.nodeStack)>=e.index;){const e=t.nodeStack.pop();if(null!=e){e.component=n,n.addExecutor(e);for(const t of e.incomingCrossLinkNeighbors)t.adjacencyList.add(n)}}}}function p({executor:t,fieldsUsedNormalized:n},o){const r=new Set;for(const e of n){s(o.fieldReferencesMap,e,()=>new Set).add(t),i(r,u(e,o))}t.geometryUsed&&o.geometryReferences.add(t),t.variablesUsed.includes("$originalfeature")&&o.originalFeatureReferences.add(t);const d=o.arcadeExecutorUses.get(t)??[];for(const e of d)switch(e.executorPurpose){case"value":{const n=o.executorMap.get(o.elementTemplatesById.get(e.elementId));n?.editableExpression&&n.editableExpression!==t&&r.add(n.editableExpression);break}case"visibility":{const t=o.elementTemplatesById.get(e.elementId);if(o.shouldConsiderVisibility&&t&&a(t)){const e=t.group,n=e?o.executorMap.get(e):null;n?.visibilityExpression&&r.add(n.visibilityExpression)}break}}return Array.from(r).map(e=>o.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:t,fieldElementTemplateMap:s,shouldConsiderVisibility:o}){const i=[],r=s.get(e);if(null==r)return i;const a=t.get(r);if(null==a)return i;if(n(i,a.editableExpression),n(i,a.valueExpression),o){n(i,a.visibilityExpression);const{group:e}=r;if(null!=e){const s=t.get(e)?.visibilityExpression;n(i,s)}}return i}function f(e){const t=new Map;for(const n of e.keys())a(n)&&t.set(n.fieldName,n);return t}function m(n,s){const o=Array.from(n.values()).filter(e),i=new Set(o.flatMap(e=>{const{textExpressions:n,...s}=e,o=[];return n?.length&&t(o,n),t(o,Object.values(s)),o})),r=Array.from(i).filter(e).map(e=>({component:null,incomingCrossLinkNeighbors:new Set,executor:e,fieldsUsedNormalized:e.fieldsUsed.map(e=>s.normalizeFieldName(e)??e),index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function x(e){return new Map([...e.values()].map(({component:e,executor:t})=>[t,e]))}function h({fieldReferencesMap:e,nodeInfoMap:t}){const n=new Map;for(const[s,o]of e.entries())n.set(s,E(o,t));return n}function E(e,t){const n=new Set;for(const s of e){const e=t.get(s);e?.component&&n.add(e.component)}return n}function y(e){return e.peek()?.index??-1}export{d as ExpressionsModel,l as StronglyConnectedComponent,p as getDirectDependencies};
2
+ import{isSome as e,addMany as n,pushIfSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as i,last as r}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";class c{constructor({executorMap:e,fieldsIndex:n,preserveFieldValuesWhenHidden:t}){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.fieldsIndex=n,this.preserveFieldValuesWhenHidden=!0===t,this.elementTemplateMap=new Map;for(const s of e.keys())this.elementTemplateMap.set(s.elementId,s);this._buildDependencyGraph(e)}_buildDependencyGraph(e){const n=m(e,this.fieldsIndex),t={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...e.keys()].map(e=>[e.elementId,e])),executorMap:e,fieldElementTemplateMap:f(e),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:n,nodeStack:new o(r),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const[o,i]of e)if(null!=i)for(const e of Object.keys(i))switch(e){case"editableExpression":case"requiredExpression":case"valueExpression":case"visibilityExpression":{const n=i[e];if(null==n)break;s(this.arcadeExecutorUses,n,()=>[]).push({elementId:o.elementId,executorPurpose:e});break}case"textExpressions":{const n=i[e];if(!Array.isArray(n))break;n.forEach((e,n)=>{s(this.arcadeExecutorUses,e,()=>[]).push({elementId:o.elementId,executorPurpose:"textExpressions",textExpressionIndex:n})});break}}for(const s of this.arcadeExecutorUses.values())s.sort(e=>"editableExpression"===e.executorPurpose?-1:1);for(const s of n.values())-1===s.index&&d(s,t);this.dependencyGraphComponents=x(n),this.fieldReferencesMap=h(t),this.geometryReferences=y(t.geometryReferences,n),this.originalFeatureReferences=y(t.originalFeatureReferences,n),this.components=t.components}}class l{constructor(){this._executors=new Set,this._fieldsReferenced=new Set,this.adjacencyList=new Set}get executors(){return this._executors}get fieldsReferenced(){return this._fieldsReferenced}addExecutor(e){this._executors.add(e.executor),i(this._fieldsReferenced,e.fieldsUsedNormalized)}}function d(e,n){e.index=e.lowlink=n.nextIndex++,n.nodeStack.push(e);for(const t of p(e,n))-1===t.index?(d(t,n),e.lowlink=Math.min(e.lowlink,t.lowlink)):t.index<e.index&&n.nodeStack.contains(t)&&(e.lowlink=Math.min(e.lowlink,t.index)),n.nodeStack.contains(t)||null!=t.component&&e.incomingCrossLinkNeighbors.add(t.component);if(e.lowlink===e.index){const t=new l;for(n.components.push(t);E(n.nodeStack)>=e.index;){const e=n.nodeStack.pop();if(null!=e){e.component=t,t.addExecutor(e);for(const n of e.incomingCrossLinkNeighbors)n.adjacencyList.add(t)}}}}function p({executor:n,fieldsUsedNormalized:t},o){const r=new Set;for(const e of t){s(o.fieldReferencesMap,e,()=>new Set).add(n),i(r,u(e,o))}n.geometryUsed&&o.geometryReferences.add(n),n.variablesUsed.includes("$originalfeature")&&o.originalFeatureReferences.add(n);const c=o.arcadeExecutorUses.get(n)??[];for(const e of c)switch(e.executorPurpose){case"valueExpression":{const t=o.executorMap.get(o.elementTemplatesById.get(e.elementId));t?.editableExpression&&t.editableExpression!==n&&r.add(t.editableExpression);break}case"visibilityExpression":{const n=o.elementTemplatesById.get(e.elementId);if(o.shouldConsiderVisibility&&n&&a(n)){const e=n.group,t=e?o.executorMap.get(e):null;t?.visibilityExpression&&r.add(t.visibilityExpression)}break}}return Array.from(r).map(e=>o.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:n,fieldElementTemplateMap:s,shouldConsiderVisibility:o}){const i=[],r=s.get(e);if(null==r)return i;const a=n.get(r);if(null==a)return i;if(t(i,a.editableExpression),t(i,a.valueExpression),o){t(i,a.visibilityExpression);const{group:e}=r;if(null!=e){const s=n.get(e)?.visibilityExpression;t(i,s)}}return i}function f(e){const n=new Map;for(const t of e.keys())a(t)&&n.set(t.fieldName,t);return n}function m(t,s){const o=Array.from(t.values()).filter(e),i=new Set(o.flatMap(e=>{const{textExpressions:t,...s}=e,o=[];return t?.length&&n(o,t),n(o,Object.values(s)),o})),r=Array.from(i).filter(e).map(e=>({component:null,incomingCrossLinkNeighbors:new Set,executor:e,fieldsUsedNormalized:e.fieldsUsed.map(e=>s.normalizeFieldName(e)??e),index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function x(e){return new Map([...e.values()].map(({component:e,executor:n})=>[n,e]))}function h({fieldReferencesMap:e,nodeInfoMap:n}){const t=new Map;for(const[s,o]of e.entries())t.set(s,y(o,n));return t}function y(e,n){const t=new Set;for(const s of e){const e=n.get(s);e?.component&&t.add(e.component)}return t}function E(e){return e.peek()?.index??-1}export{c as ExpressionsModel,l as StronglyConnectedComponent,p as getDirectDependencies};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"./InputBase.js";let o=class extends r{constructor(){super(...arguments),this.editType="NA"}get editable(){return this._evaluatedEditableExpression??!0}get valid(){return!0}get _evaluatedEditableExpression(){let t=!0,e=!0;for(const s of this.features){if(null==this.template.getExpressionExecutorsForLayer(s.layer)?.editableExpression){t=t&&!0;continue}e=!1;const r=this._lookupEvaluatedExpression(s,"editable");"success"===r?.status?t=t&&!0===r.result:t=!1}return e?null:t}};t([e()],o.prototype,"editable",null),t([e({readOnly:!0})],o.prototype,"valid",null),t([e()],o.prototype,"editType",void 0),t([e()],o.prototype,"_evaluatedEditableExpression",null),o=t([s("esri.widgets.BatchAttributeForm.inputs.EditableInput")],o);const i=o;export{i as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"./InputBase.js";let o=class extends r{constructor(){super(...arguments),this.editType="NA"}get editable(){return this._evaluatedEditableExpression??!0}get valid(){return!0}get _evaluatedEditableExpression(){let e=!0,t=!0;for(const s of this.features){if(null==this.template.getExpressionExecutorsForLayer(s.layer)?.editableExpression){e=e&&!0;continue}t=!1;const r=this._lookupEvaluatedExpression(s,"editableExpression");"success"===r?.status?e=e&&!0===r.result:e=!1}return t?null:e}};e([t()],o.prototype,"editable",null),e([t({readOnly:!0})],o.prototype,"valid",null),e([t()],o.prototype,"editType",void 0),e([t()],o.prototype,"_evaluatedEditableExpression",null),o=e([s("esri.widgets.BatchAttributeForm.inputs.EditableInput")],o);const i=o;export{i as default};
@@ -2,15 +2,15 @@ import type Graphic from "../../../Graphic.js";
2
2
  import type Field from "../../../layers/support/Field.js";
3
3
  import type EditableInput from "./EditableInput.js";
4
4
  import type GroupInput from "./GroupInput.js";
5
- import type MultipleChoiceController from "./support/MultipleChoiceController.js";
6
5
  import type { Input } from "../../../form/elements/inputs.js";
7
6
  import type { FieldValue } from "../../../layers/support/fieldUtils.js";
8
7
  import type { DomainUnion as Domain } from "../../../layers/support/types.js";
9
8
  import type { EditableInputProperties } from "./EditableInput.js";
9
+ import type { InputController } from "./support/controllerUtils.js";
10
10
  import type { MultipleChoiceOtherChoiceRenderState } from "./support/MultipleChoiceController.js";
11
11
  import type { FieldInputDataTypes } from "../../support/forms/types.js";
12
12
 
13
- export interface FieldInputProperties extends EditableInputProperties, Partial<Pick<FieldInput, "multipleChoiceController">> {}
13
+ export interface FieldInputProperties extends EditableInputProperties, Partial<Pick<FieldInput, "inputController">> {}
14
14
 
15
15
  /**
16
16
  * This is a read-only support class that represents a [field element](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) in a [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/).
@@ -61,6 +61,8 @@ export default class FieldInput extends EditableInput<any> {
61
61
  get includeTimeOffset(): boolean;
62
62
  /** The configured input for this field. */
63
63
  get input(): Input | null | undefined;
64
+ /** @internal */
65
+ accessor inputController: InputController | null;
64
66
  /** An array of features that do not have a valid value for this field. */
65
67
  get invalidFeatures(): Graphic[];
66
68
  /** The input's label. */
@@ -69,8 +71,6 @@ export default class FieldInput extends EditableInput<any> {
69
71
  get maxLength(): number;
70
72
  /** The minimum length of the input. If no length is specified, the value is `-1`. */
71
73
  get minLength(): number;
72
- /** @internal */
73
- accessor multipleChoiceController: MultipleChoiceController | null;
74
74
  /**
75
75
  * The checked state derived from the current other-choice values across all features.
76
76
  *