@arcgis/core 4.31.0-next.20240521 → 4.31.0-next.20240523

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 (127) hide show
  1. package/WebMap.js +1 -1
  2. package/assets/components/assets/icon/developerCredentials16.json +1 -0
  3. package/assets/components/assets/icon/developerCredentials24.json +1 -0
  4. package/assets/components/assets/icon/developerCredentials32.json +1 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{d7722531be4892293cb1.js → 00c49f6c84444e69f3a1.js} +1 -1
  7. package/assets/esri/core/workers/chunks/01927419855947110cc1.js.LICENSE.txt +1 -1
  8. package/assets/esri/core/workers/chunks/{df26d7d07fed1f124fc2.js → 0903b492782dca69eb48.js} +1 -1
  9. package/assets/esri/core/workers/chunks/158c05b16372d8ed33ea.js.LICENSE.txt +1 -1
  10. package/assets/esri/core/workers/chunks/190913c221964292333b.js.LICENSE.txt +1 -1
  11. package/assets/esri/core/workers/chunks/{2529a4b1e135223833f0.js → 2635ab64e75d4ec700a8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{f965644347007e3d68e2.js → 27dc94db9ed42b237ecb.js} +1 -1
  13. package/assets/esri/core/workers/chunks/36d620a9c051e451e6b3.js +1 -0
  14. package/assets/esri/core/workers/chunks/{0ae3ea7a73f3b5083968.js → 3a01cf7e3355f3c78378.js} +1 -1
  15. package/assets/esri/core/workers/chunks/4268373bf374b2a6252a.js.LICENSE.txt +1 -1
  16. package/assets/esri/core/workers/chunks/43e1c935452b489e422e.js +1 -0
  17. package/assets/esri/core/workers/chunks/{15212a82e283d6df2873.js → 4ae885f257660545ceeb.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{4ea2ced4b5ea1c8a1cee.js → 4ba866a10711b6a8158f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/50ee28a1944bde74a7c1.js +1 -0
  20. package/assets/esri/core/workers/chunks/59b193d42e8abf9d4088.js.LICENSE.txt +1 -1
  21. package/assets/esri/core/workers/chunks/{eafbe663f7a61d3222c5.js → 5efe1300a39ab9c7bbab.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{eac4ec8c410eaf9e621c.js → 606f8b907166190a8b65.js} +2 -2
  23. package/assets/esri/core/workers/chunks/{eac4ec8c410eaf9e621c.js.LICENSE.txt → 606f8b907166190a8b65.js.LICENSE.txt} +1 -1
  24. package/assets/esri/core/workers/chunks/{5349b0de83ae4be8afe2.js → 6c1ded9acf5c8be493ea.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{46225ebc10a4398170b5.js → 712ba8ad69b1aab6f508.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{7d210c2a5a135da2c37d.js → 7c68dc664c0b4cf2a46b.js} +1 -1
  27. package/assets/esri/core/workers/chunks/88c7d84a1fde246ca71f.js +1 -0
  28. package/assets/esri/core/workers/chunks/948867b3c17f6c0e753a.js +1 -0
  29. package/assets/esri/core/workers/chunks/9b04a666726b5d2ff3c5.js.LICENSE.txt +1 -1
  30. package/assets/esri/core/workers/chunks/9c75837b7e75f0f38dc0.js.LICENSE.txt +1 -1
  31. package/assets/esri/core/workers/chunks/{9a217c5c55ce6fb1d3cd.js → a111eb0ae78a9f5be981.js} +1 -1
  32. package/assets/esri/core/workers/chunks/a6b138f330625d98f856.js +1 -0
  33. package/assets/esri/core/workers/chunks/{e4a0fd9e0f8887009b92.js → a8a19e5a7ae4ec16480a.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{fcf0016d56df8a69f6c1.js → aa198e898b46c6e89d0b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{04faa3bf4ef5a6f0ccb4.js → b3de9bc3e75476b0a7e9.js} +1 -1
  36. package/assets/esri/core/workers/chunks/b61e458ef5021adba1cb.js +1 -0
  37. package/assets/esri/core/workers/chunks/{bd0545bb100b3393fd85.js → bbec62f8792520993909.js} +1 -1
  38. package/assets/esri/core/workers/chunks/bf6e75cc75d3bdfb70cb.js +1 -0
  39. package/assets/esri/core/workers/chunks/{5acac4616c53a95cc48f.js → c0c8e1a709648e1305c6.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{4f3a87586e334c52d0bf.js → caffbaa8b0a67d117f34.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{7b4ed96554722be59ae2.js → d8140b5316e80d734155.js} +1 -1
  42. package/assets/esri/core/workers/chunks/dde183c6bb1710ff16df.js.LICENSE.txt +1 -1
  43. package/assets/esri/core/workers/chunks/e3711bc5b100b64cac3a.js +1 -0
  44. package/assets/esri/core/workers/chunks/{2d5d66cee7c3ec992bcd.js → e93e59f6907fa4c1081c.js} +1 -1
  45. package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
  46. package/assets/esri/themes/base/widgets/_FeatureTable.scss +15 -1
  47. package/assets/esri/themes/base/widgets/_Grid.scss +4 -1
  48. package/assets/esri/themes/dark/main.css +1 -1
  49. package/assets/esri/themes/light/main.css +1 -1
  50. package/assets/esri/themes/light/view.css +1 -1
  51. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  52. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  53. package/chunks/LineSeries.js +1 -1
  54. package/chunks/Theme.js +1 -1
  55. package/chunks/Tooltip.js +1 -1
  56. package/chunks/chartUtilsAm5.js +1 -1
  57. package/core/sql/WhereClause.js +1 -1
  58. package/core/workers/InvokeHandler.js +1 -1
  59. package/core/workers/RemoteClient.js +1 -1
  60. package/interfaces.d.ts +568 -48
  61. package/layers/ImageryTileLayer.js +1 -1
  62. package/layers/LinkChartLayer.js +1 -1
  63. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  64. package/layers/mixins/OperationalLayer.js +1 -1
  65. package/layers/support/editableLayers.js +1 -1
  66. package/package.json +2 -2
  67. package/portal/PortalItem.js +1 -1
  68. package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
  69. package/rest/print.js +1 -1
  70. package/rest/support/printTaskUtils.js +1 -1
  71. package/smartMapping/renderers/support/referenceSizeUtils.js +1 -1
  72. package/smartMapping/support/adapters/support/layerUtils.js +1 -1
  73. package/support/revision.js +1 -1
  74. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  75. package/views/2d/GoToManager.js +1 -1
  76. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  77. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
  78. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  79. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  80. package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
  81. package/views/2d/layers/features/Processor.js +1 -1
  82. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  83. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  84. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
  85. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  86. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  87. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  88. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  89. package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils.js +1 -1
  90. package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
  91. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  92. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  93. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  94. package/views/3d/interactive/editingTools/undoRecords.js +5 -0
  95. package/views/SceneView.js +1 -1
  96. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  97. package/views/layers/ImageryTileLayerView.js +1 -1
  98. package/webdoc/support/SlideThumbnail.js +1 -1
  99. package/widgets/Bookmarks/BookmarksUserState.js +1 -1
  100. package/widgets/Bookmarks.js +1 -1
  101. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +4 -0
  102. package/widgets/CatalogLayerList.d.ts +4 -0
  103. package/widgets/CatalogLayerList.js +1 -1
  104. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  105. package/widgets/Expand.js +1 -1
  106. package/widgets/FeatureForm/support/textManipulationUtils.js +1 -1
  107. package/widgets/FeatureTable/VisibleElements.js +1 -1
  108. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  109. package/widgets/FeatureTable.js +1 -1
  110. package/widgets/Features/FeaturesViewModel.js +1 -1
  111. package/widgets/LayerList/ListItemPanel.js +1 -1
  112. package/widgets/LayerList/support/layerListUtils.js +1 -1
  113. package/widgets/Sketch/SketchViewModel.js +1 -1
  114. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  115. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  116. package/assets/esri/core/workers/chunks/0753c636c2801f067235.js +0 -1
  117. package/assets/esri/core/workers/chunks/50936725c9bd23b780ef.js +0 -1
  118. package/assets/esri/core/workers/chunks/5c8c5290b9fcb5a4468f.js +0 -1
  119. package/assets/esri/core/workers/chunks/7745209175eb744aee5c.js +0 -1
  120. package/assets/esri/core/workers/chunks/80b1b1e8f3f7b9d2ad20.js +0 -1
  121. package/assets/esri/core/workers/chunks/aa020d495f464eff0134.js +0 -1
  122. package/assets/esri/core/workers/chunks/bf2af659da8e33d3c8bf.js +0 -1
  123. package/assets/esri/core/workers/chunks/cbb3a56e4072cdf25a9d.js +0 -1
  124. package/assets/esri/core/workers/chunks/fb48e8e42379fdf8a094.js +0 -1
  125. package/views/3d/interactive/editingTools/transform/undoRecords.js +0 -5
  126. package/views/3d/support/MapCoordsHelper.js +0 -5
  127. package/widgets/Bookmarks/bookmarkUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.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{makeHandle as o,handlesGroup as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{destroyMaybe as h,maybeProperty as d}from"../core/maybe.js";import{ObservableChangesType as c}from"../core/ObservableChangesType.js";import{throwIfAborted as u}from"../core/promiseUtils.js";import{on as g,watch as m,initial as y,syncAndInitial as f,whenOnce as w,sync as _}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPoint as b,createScreenPointArray as M}from"../core/screenUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as C}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as j,ensureClass as T}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as O}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import H from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as L,project as P}from"../geometry/projection.js";import{projectBoundingRect as A}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as I}from"../geometry/projection/projectPointToVector.js";import{create as G,toExtent as D}from"../geometry/support/aaBoundingRect.js";import{B as F,c as U}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as W}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as q}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as k,isTiledLayer as z,isVoxelLayer as B,isIntegratedMeshLayer as N}from"../layers/support/layerUtils.js";import{AnalysesCollection as Q}from"../support/AnalysesCollection.js";import{BreakpointsOwner as Y}from"./BreakpointsOwner.js";import{DOMContainer as Z}from"./DOMContainer.js";import $ from"./GroundView.js";import{PopupView as J}from"./PopupView.js";import K from"./View.js";import X from"./ViewAnimation.js";import{ViewingMode as ee,stringFromViewingMode as te,viewingModeFromString as ie}from"./ViewingMode.js";import{layerView3DImporter as re}from"./3d/layerViewModuleImportUtils.js";import se from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as ne}from"./3d/constraints/Constraints.js";import ae from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as oe}from"./3d/environment/SceneViewEnvironmentManager.js";import le from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as pe}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as he}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as de}from"./3d/layers/support/FeatureTileTree3D.js";import ce from"./3d/state/ViewState.js";import{ViewStateManager as ue}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ge}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as me}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as ye}from"./3d/support/debugFlags.js";import fe from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as we}from"./3d/support/ElevationProvider.js";import _e from"./3d/support/HighlightOptions.js";import{toMap as ve,hitTest as be}from"./3d/support/hitTest.js";import{MapCoordsHelper as Me}from"./3d/support/MapCoordsHelper.js";import{popupHitTest as Se}from"./3d/support/popupHitTest.js";import{PropertiesPool as Ve}from"./3d/support/PropertiesPool.js";import Ce from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Re}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as je}from"./3d/support/ResourceController.js";import Te from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Oe}from"./3d/support/SharedSymbolResources.js";import{TextureCollection as xe}from"./3d/support/TextureCollection.js";import{PointsOfInterest as Ee}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import He from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Le,getTiledLayerInfo as Pe,checkIfTileInfoSupportedForView as Ae}from"./3d/terrain/terrainUtils.js";import{Stage as Ie}from"./3d/webgl-engine/Stage.js";import{Decorations as Ge}from"./3d/webgl-engine/lib/basicInterfaces.js";import{defaultTolerance as De}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as Fe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{occludeesSupported as Ue}from"./support/layerViewUtils.js";import{encode as We,encodeData as qe,toRenderSettings as ke,screenshotSuperSampleSettings as ze}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Be,createScreenPointFromSupportedEvent as Ne}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Qe}from"./support/spatialReferenceSupport.js";import{check as Ye}from"./support/WebGLRequirements.js";import Ze from"./ui/DefaultUI.js";import $e from"./ui/3d/DefaultUI3D.js";import Je from"../webscene/Environment.js";import Ke from"../geometry/Extent.js";import Xe from"../geometry/SpatialReference.js";import et from"../geometry/Point.js";let tt=class extends(Y(J(Z(K)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new Ve({slicePlane:F},this),this._resourceController=je(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new pe({view:this}),this.labeler=new he({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new Q,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new ne,this.environment=new ae,this.environmentManager=new oe,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new se({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ce,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new $e,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.highlightOptions=new _e,S();const t=(e=null)=>{null!=e&&e.type===c.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([g((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),m((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new le({view:this}),this.stateManager=new ue({view:this})}initialize(){this.groundView=new $({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.addHandles(g((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),y),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),y),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),y),this.updatingHandles.add((()=>this.map?.ground),e,f),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),f),this.addHandles(m((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),_))}destroy(){this.destroyed||(this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=h(this.sharedSymbolResources),this._set("labeler",h(this.labeler)),this._set("deconflictor",h(this.deconflictor)),this._resourceController=h(this._resourceController),this._set("stateManager",h(this.stateManager)),this._set("inputManager",h(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",h(this.environmentManager)),this._set("environment",h(this.environment)),this.groundView=h(this.groundView),this._exitBasemapTerrain(),this._stage?.destroy())}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}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 center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||d(e,"clippingArea");return!this._userClippingArea&&!d(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof Ke?this.spatialReference&&(t=it(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(this.state.viewingMode===ee.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:it(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||Xe.WGS84,i=it(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||Xe.WGS84;let t;const i=i=>{const r=it(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new Ke({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(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 s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}castEnvironment(e){return e?e instanceof ae?e:e instanceof Je?this.environment?.cloneWithWebsceneEnvironment(e)??ae.fromWebsceneEnvironment(e):j(ae,e):new ae}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 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&&(null==this.state||this.state.stationary)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){fe.isValidProfile(e)&&(fe.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||fe.getDefaultProfile()}set slicePlane(e){if(null!=this._stage&&this._stage.renderer.setParameters({slicePlane:e}),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");U(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?q(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?H.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(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||Le(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._createGraphicsViewController||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))||this.textures?.updating),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 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]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return te(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?te(this.defaultsFromMap.viewingMode):Qe(t,ee.Global)?"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 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 Te(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=Be(e)?Ne(this,e):e;return ve(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;const t=(null==e.z?we(this.elevationProvider,e):null)??0;return I(e,rt,this.renderSpatialReference,t),this.state.camera.projectToScreen(rt,st),b(st[0],st[1])}pixelSizeAt(e){return this.ready?e?(I(e,rt,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(rt)):0:(p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.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=Be(e)?Ne(this,e):e;return be(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Se(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return We(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return qe(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t);return[qe(i[0],this._pixelFormat()),qe(i[1],this._pixelFormat())]}_completeSettings(e){const t=ke(e,this);return t.pixelRatio/=this.state.pixelRatio,ze(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!has("enable-feature:objectAndLayerId-rendering"))throw new Error("has enable-feature:objectAndLayerId-rendering must be true");const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t),r=We(i[0],t,this._pixelFormat()),s=this._completeSettings(e);s.format="png";return[r,We(i[1],s,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){if(null==this._stage.renderView.objectAndLayerIdRenderHelper)throw new Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return re.importLayerView(e)}hasLayerViewModule(e){return re.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Ye(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw p.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?ie(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ee.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ee.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ee.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ee.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Qe(e,i)&&(null==t||(!!k(t)||(!z(t)||null!=Pe(t,e,i))&&(!B(t)||i!==ee.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(k(t)&&(r||s)){return!s||i===ee.Local||null===Ae(t.tileInfo,t.fullExtent,e,ee.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:Xe.WebMercator,viewingMode:i}]:[{spatialReference:r?Xe.WGS84:Xe.WebMercator,viewingMode:i}]}return z(t)||B(t)||!r&&!s?z(t)&&r&&i!==ee.Global?[{spatialReference:e,viewingMode:i},{spatialReference:Xe.WGS84,viewingMode:ee.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?Xe.WGS84:Xe.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 ${te(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((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(r.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):o()}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&&Ue(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await w((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new n("no-view-for-graphic");return 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)}_initBasemapTerrain(){this._set("basemapTerrain",new He({view:this})),this._set("elevationProvider",new me({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Ee({view:this})),this._set("featureTiles",new de({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?P(D(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;null!=this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>ye.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&ye.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||ye.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),f),this.updatingHandles.add((()=>this.clippingArea),e,f),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Me(this.map,e));const t=this.state.isGlobal,i=W(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Re.create(this.state.viewingMode,i)),t||this.addHandles(m((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!A(e,this.basemapTerrain.spatialReference,nt,t)||(this.renderCoordsHelper.extent=nt)}),_),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===c.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(m((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),_),"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");return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t===Ge.OFF}),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 ge(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ie({view:this,options:e,container:i}),this._stage.renderer.setParameters({slicePlane:this.slicePlane}),this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this._stage.renderer.setParameters({highQualityTransparency:e})),y),this.on("pointer-move",(()=>this._stage?.renderer.resetAnimation())),a(this._stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=h(this._stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Oe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;u(e),await w((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ie(this.viewingMode);e===ee.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(g((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded();const t=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null,i=t?.environment;i&&O(this.environment,i),this.timeExtent=t?.timeExtent,this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect(),this._set("textures",new xe(this._stage,this.resourceController.scheduler));const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._set("textures",h(this.textures)),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(Fe);for(const e of this.map.allLayers.items)N(e.type)&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(Fe);for(const e of this.map.allLayers.items)N(e.type)&&e.opacity<1&&this._defaultHitTestOptions.exclude.add(e.uid)}}};function it(e,t){return null!=e&&L(e.spatialReference,t)?P(e,t):null}tt.type="3d",e([V()],tt.prototype,"_userClippingArea",void 0),e([V()],tt.prototype,"_resourceController",void 0),e([V()],tt.prototype,"_stage",void 0),e([V({readOnly:!0})],tt.prototype,"deconflictor",void 0),e([V({readOnly:!0})],tt.prototype,"labeler",void 0),e([V(E(Q,"analyses"))],tt.prototype,"analyses",void 0),e([V({type:X,readOnly:!0})],tt.prototype,"animation",null),e([V({readOnly:!0})],tt.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],tt.prototype,"elevationProvider",void 0),e([V()],tt.prototype,"camera",null),e([V({type:t})],tt.prototype,"contentCamera",null),e([V({readOnly:!0})],tt.prototype,"canvas",void 0),e([V({type:et})],tt.prototype,"center",null),e([V({type:Ke})],tt.prototype,"clippingArea",null),e([V({type:ne})],tt.prototype,"constraints",void 0),e([V({type:Ke,readOnly:!0})],tt.prototype,"renderDataExtent",null),e([V({readOnly:!0})],tt.prototype,"tileInfo",null),e([V({type:Ke,readOnly:!0})],tt.prototype,"dataExtent",null),e([V({type:Ke,readOnly:!0})],tt.prototype,"_groundAndLayersExtent",null),e([V({type:ae})],tt.prototype,"environment",void 0),e([C("environment")],tt.prototype,"castEnvironment",null),e([V({readOnly:!0})],tt.prototype,"environmentManager",void 0),e([V({type:Ke})],tt.prototype,"extent",null),e([V()],tt.prototype,"floors",void 0),e([V()],tt.prototype,"screenCenter",null),e([V()],tt.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],tt.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],tt.prototype,"graphicsView",void 0),e([V({readOnly:!0})],tt.prototype,"analysisViewManager",void 0),e([V()],tt.prototype,"groundView",void 0),e([V({type:Boolean})],tt.prototype,"initialExtentRequired",null),e([V()],tt.prototype,"_defaultsFromMapSettings",null),e([V()],tt.prototype,"interacting",null),e([V()],tt.prototype,"stationary",null),e([V()],tt.prototype,"navigating",null),e([V()],tt.prototype,"map",void 0),e([V({readOnly:!0})],tt.prototype,"mapCoordsHelper",void 0),e([V()],tt.prototype,"padding",null),e([V({type:Ee,readOnly:!0})],tt.prototype,"pointsOfInterest",void 0),e([V({type:de,readOnly:!0})],tt.prototype,"featureTiles",void 0),e([V()],tt.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],tt.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],tt.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],tt.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],tt.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],tt.prototype,"state",void 0),e([V({readOnly:!0})],tt.prototype,"inputManager",void 0),e([V({readOnly:!0})],tt.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],tt.prototype,"qualityProfile",null),e([V({type:Ce,get(){let e=this._get("qualitySettings");return e||(e=new Ce,fe.apply(this.qualityProfile,e)),e}})],tt.prototype,"qualitySettings",void 0),e([V()],tt.prototype,"slicePlane",null),e([V({readOnly:!0})],tt.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],tt.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],tt.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],tt.prototype,"resolution",null),e([V({type:Number})],tt.prototype,"scale",null),e([V()],tt.prototype,"heightModelInfo",null),e([V()],tt.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],tt.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],tt.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],tt.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],tt.prototype,"type",void 0),e([V(),C((e=>e instanceof Ze?e:T($e,e)))],tt.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],tt.prototype,"updating",null),e([V()],tt.prototype,"_updatingObjects",null),e([V()],tt.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],tt.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],tt.prototype,"viewingMode",null),e([V({type:i})],tt.prototype,"viewpoint",null),e([V({type:Number})],tt.prototype,"zoom",null),e([V({type:_e})],tt.prototype,"highlightOptions",void 0),e([V({readOnly:!0})],tt.prototype,"quality",null),e([V({readOnly:!0})],tt.prototype,"resolutionScale",null),e([V()],tt.prototype,"textures",void 0),tt=e([R("esri.views.SceneView")],tt);const rt=x(),st=M(),nt=G(),at=tt;export{at as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.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{makeHandle as o,handlesGroup as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{destroyMaybe as h,maybeProperty as d}from"../core/maybe.js";import{ObservableChangesType as c}from"../core/ObservableChangesType.js";import{throwIfAborted as u}from"../core/promiseUtils.js";import{on as g,watch as m,initial as y,syncAndInitial as f,whenOnce as w,sync as _}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPoint as b,createScreenPointArray as M}from"../core/screenUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as R}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as C}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as j,ensureClass as T}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as x}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as O}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import L from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as H,project as P}from"../geometry/projection.js";import{projectBoundingRect as A}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as I}from"../geometry/projection/projectPointToVector.js";import{create as G,toExtent as D}from"../geometry/support/aaBoundingRect.js";import{B as F,c as U}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as W}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as k}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as q,isTiledLayer as z,isVoxelLayer as B,isIntegratedMeshLayer as N}from"../layers/support/layerUtils.js";import{AnalysesCollection as Q}from"../support/AnalysesCollection.js";import{BreakpointsOwner as Y}from"./BreakpointsOwner.js";import{DOMContainer as Z}from"./DOMContainer.js";import $ from"./GroundView.js";import{PopupView as J}from"./PopupView.js";import K from"./View.js";import X from"./ViewAnimation.js";import{ViewingMode as ee,stringFromViewingMode as te,viewingModeFromString as ie}from"./ViewingMode.js";import{layerView3DImporter as re}from"./3d/layerViewModuleImportUtils.js";import se from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as ne}from"./3d/constraints/Constraints.js";import ae from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as oe}from"./3d/environment/SceneViewEnvironmentManager.js";import le from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as pe}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as he}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as de}from"./3d/layers/support/FeatureTileTree3D.js";import ce from"./3d/state/ViewState.js";import{ViewStateManager as ue}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ge}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as me}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as ye}from"./3d/support/debugFlags.js";import fe from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as we}from"./3d/support/ElevationProvider.js";import _e from"./3d/support/HighlightOptions.js";import{toMap as ve,hitTest as be}from"./3d/support/hitTest.js";import{popupHitTest as Me}from"./3d/support/popupHitTest.js";import{PropertiesPool as Se}from"./3d/support/PropertiesPool.js";import Ve from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Re}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ce}from"./3d/support/ResourceController.js";import je from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Te}from"./3d/support/SharedSymbolResources.js";import{TextureCollection as xe}from"./3d/support/TextureCollection.js";import{PointsOfInterest as Oe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ee from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Le,getTiledLayerInfo as He,checkIfTileInfoSupportedForView as Pe}from"./3d/terrain/terrainUtils.js";import{Stage as Ae}from"./3d/webgl-engine/Stage.js";import{Decorations as Ie}from"./3d/webgl-engine/lib/basicInterfaces.js";import{defaultTolerance as Ge}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as De}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{occludeesSupported as Fe}from"./support/layerViewUtils.js";import{encode as Ue,encodeData as We,toRenderSettings as ke,screenshotSuperSampleSettings as qe}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as ze,createScreenPointFromSupportedEvent as Be}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Ne}from"./support/spatialReferenceSupport.js";import{check as Qe}from"./support/WebGLRequirements.js";import Ye from"./ui/DefaultUI.js";import Ze from"./ui/3d/DefaultUI3D.js";import $e from"../webscene/Environment.js";import Je from"../geometry/Extent.js";import Ke from"../geometry/SpatialReference.js";import Xe from"../geometry/Point.js";let et=class extends(Y(J(Z(K)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new Se({slicePlane:F},this),this._resourceController=Ce(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new pe({view:this}),this.labeler=new he({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new Q,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new ne,this.environment=new ae,this.environmentManager=new oe,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new se({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ce,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Ze,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.highlightOptions=new _e,S();const t=(e=null)=>{null!=e&&e.type===c.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([g((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),m((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new le({view:this}),this.stateManager=new ue({view:this})}initialize(){this.groundView=new $({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.addHandles(g((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),y),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),y),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),y),this.updatingHandles.add((()=>this.map?.ground),e,f),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),f),this.addHandles(m((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),_))}destroy(){this.destroyed||(this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=h(this.sharedSymbolResources),this._set("labeler",h(this.labeler)),this._set("deconflictor",h(this.deconflictor)),this._resourceController=h(this._resourceController),this._set("stateManager",h(this.stateManager)),this._set("inputManager",h(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",h(this.environmentManager)),this._set("environment",h(this.environment)),this.groundView=h(this.groundView),this._exitBasemapTerrain(),this._stage?.destroy())}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}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 center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||d(e,"clippingArea");return!this._userClippingArea&&!d(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof Je?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(this.state.viewingMode===ee.Global)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||Ke.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||Ke.WGS84;let t;const i=i=>{const r=tt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new Je({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(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 s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}castEnvironment(e){return e?e instanceof ae?e:e instanceof $e?this.environment?.cloneWithWebsceneEnvironment(e)??ae.fromWebsceneEnvironment(e):j(ae,e):new ae}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 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&&(null==this.state||this.state.stationary)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){fe.isValidProfile(e)&&(fe.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||fe.getDefaultProfile()}set slicePlane(e){if(null!=this._stage&&this._stage.renderer.setParameters({slicePlane:e}),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");U(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?k(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(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||Le(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._createGraphicsViewController||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))||this.textures?.updating),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 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]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return te(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?te(this.defaultsFromMap.viewingMode):Ne(t,ee.Global)?"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 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 je(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=ze(e)?Be(this,e):e;return ve(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;const t=(null==e.z?we(this.elevationProvider,e):null)??0;return I(e,it,this.renderSpatialReference,t),this.state.camera.projectToScreen(it,rt),b(rt[0],rt[1])}pixelSizeAt(e){return this.ready?e?(I(e,it,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(it)):0:(p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.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=ze(e)?Be(this,e):e;return be(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Me(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Ue(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return We(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t);return[We(i[0],this._pixelFormat()),We(i[1],this._pixelFormat())]}_completeSettings(e){const t=ke(e,this);return t.pixelRatio/=this.state.pixelRatio,qe(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!has("enable-feature:objectAndLayerId-rendering"))throw new Error("has enable-feature:objectAndLayerId-rendering must be true");const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t),r=Ue(i[0],t,this._pixelFormat()),s=this._completeSettings(e);s.format="png";return[r,Ue(i[1],s,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){if(null==this._stage.renderView.objectAndLayerIdRenderHelper)throw new Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return re.importLayerView(e)}hasLayerViewModule(e){return re.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Qe(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw p.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?ie(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ee.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ee.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ee.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ee.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Ne(e,i)&&(null==t||(!!q(t)||(!z(t)||null!=He(t,e,i))&&(!B(t)||i!==ee.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(q(t)&&(r||s)){return!s||i===ee.Local||null===Pe(t.tileInfo,t.fullExtent,e,ee.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:Ke.WebMercator,viewingMode:i}]:[{spatialReference:r?Ke.WGS84:Ke.WebMercator,viewingMode:i}]}return z(t)||B(t)||!r&&!s?z(t)&&r&&i!==ee.Global?[{spatialReference:e,viewingMode:i},{spatialReference:Ke.WGS84,viewingMode:ee.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?Ke.WGS84:Ke.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 ${te(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((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(r.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):o()}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&&Fe(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await w((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new n("no-view-for-graphic");return 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)}_initBasemapTerrain(){this._set("basemapTerrain",new Ee({view:this})),this._set("elevationProvider",new me({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Oe({view:this})),this._set("featureTiles",new de({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?P(D(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;null!=this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>ye.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&ye.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||ye.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),f),this.updatingHandles.add((()=>this.clippingArea),e,f),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=W(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Re.create(this.state.viewingMode,i)),t||this.addHandles(m((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!A(e,this.basemapTerrain.spatialReference,st,t)||(this.renderCoordsHelper.extent=st)}),_),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===c.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(m((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),_),"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");return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t===Ie.OFF}),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 ge(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ae({view:this,options:e,container:i}),this._stage.renderer.setParameters({slicePlane:this.slicePlane}),this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this._stage.renderer.setParameters({highQualityTransparency:e})),y),this.on("pointer-move",(()=>this._stage?.renderer.resetAnimation())),a(this._stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=h(this._stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Te({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;u(e),await w((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ie(this.viewingMode);e===ee.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(g((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded();const t=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null,i=t?.environment;i&&x(this.environment,i),this.timeExtent=t?.timeExtent,this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect(),this._set("textures",new xe(this._stage,this.resourceController.scheduler));const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._set("textures",h(this.textures)),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(De);for(const e of this.map.allLayers.items)N(e.type)&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(De);for(const e of this.map.allLayers.items)N(e.type)&&e.opacity<1&&this._defaultHitTestOptions.exclude.add(e.uid)}}};function tt(e,t){return null!=e&&H(e.spatialReference,t)?P(e,t):null}et.type="3d",e([V()],et.prototype,"_userClippingArea",void 0),e([V()],et.prototype,"_resourceController",void 0),e([V()],et.prototype,"_stage",void 0),e([V({readOnly:!0})],et.prototype,"deconflictor",void 0),e([V({readOnly:!0})],et.prototype,"labeler",void 0),e([V(E(Q,"analyses"))],et.prototype,"analyses",void 0),e([V({type:X,readOnly:!0})],et.prototype,"animation",null),e([V({readOnly:!0})],et.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],et.prototype,"elevationProvider",void 0),e([V()],et.prototype,"camera",null),e([V({type:t})],et.prototype,"contentCamera",null),e([V({readOnly:!0})],et.prototype,"canvas",void 0),e([V({type:Xe})],et.prototype,"center",null),e([V({type:Je})],et.prototype,"clippingArea",null),e([V({type:ne})],et.prototype,"constraints",void 0),e([V({type:Je,readOnly:!0})],et.prototype,"renderDataExtent",null),e([V({readOnly:!0})],et.prototype,"tileInfo",null),e([V({type:Je,readOnly:!0})],et.prototype,"dataExtent",null),e([V({type:Je,readOnly:!0})],et.prototype,"_groundAndLayersExtent",null),e([V({type:ae})],et.prototype,"environment",void 0),e([R("environment")],et.prototype,"castEnvironment",null),e([V({readOnly:!0})],et.prototype,"environmentManager",void 0),e([V({type:Je})],et.prototype,"extent",null),e([V()],et.prototype,"floors",void 0),e([V()],et.prototype,"screenCenter",null),e([V()],et.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],et.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],et.prototype,"graphicsView",void 0),e([V({readOnly:!0})],et.prototype,"analysisViewManager",void 0),e([V()],et.prototype,"groundView",void 0),e([V({type:Boolean})],et.prototype,"initialExtentRequired",null),e([V()],et.prototype,"_defaultsFromMapSettings",null),e([V()],et.prototype,"interacting",null),e([V()],et.prototype,"stationary",null),e([V()],et.prototype,"navigating",null),e([V()],et.prototype,"map",void 0),e([V()],et.prototype,"padding",null),e([V({type:Oe,readOnly:!0})],et.prototype,"pointsOfInterest",void 0),e([V({type:de,readOnly:!0})],et.prototype,"featureTiles",void 0),e([V()],et.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],et.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],et.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],et.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],et.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],et.prototype,"state",void 0),e([V({readOnly:!0})],et.prototype,"inputManager",void 0),e([V({readOnly:!0})],et.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],et.prototype,"qualityProfile",null),e([V({type:Ve,get(){let e=this._get("qualitySettings");return e||(e=new Ve,fe.apply(this.qualityProfile,e)),e}})],et.prototype,"qualitySettings",void 0),e([V()],et.prototype,"slicePlane",null),e([V({readOnly:!0})],et.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],et.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],et.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],et.prototype,"resolution",null),e([V({type:Number})],et.prototype,"scale",null),e([V()],et.prototype,"heightModelInfo",null),e([V()],et.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],et.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],et.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],et.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],et.prototype,"type",void 0),e([V(),R((e=>e instanceof Ye?e:T(Ze,e)))],et.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],et.prototype,"updating",null),e([V()],et.prototype,"_updatingObjects",null),e([V()],et.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],et.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],et.prototype,"viewingMode",null),e([V({type:i})],et.prototype,"viewpoint",null),e([V({type:Number})],et.prototype,"zoom",null),e([V({type:_e})],et.prototype,"highlightOptions",void 0),e([V({readOnly:!0})],et.prototype,"quality",null),e([V({readOnly:!0})],et.prototype,"resolutionScale",null),e([V()],et.prototype,"textures",void 0),et=e([C("esri.views.SceneView")],et);const it=O(),rt=M(),st=G(),nt=et;export{nt as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as a,valueInUnit as l}from"../../../core/quantityUtils.js";import{verticalLengthUnitFromSpatialReference as i}from"../../../core/unitUtils.js";import{k as s,j as u,E as c}from"../../../chunks/vec32.js";import{clone as p,ONES as f,create as m,UNIT_Z as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as g,load as d}from"../../../geometry/coordinateFormatter.js";import v from"../../../geometry/Point.js";import x from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as j}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as S}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as h}from"../keybindings.js";import{parseLatitudeLongitude as U,parseXY as M}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as z,getDegreesGeographic as A}from"../../support/angularMeasurementUtils.js";function R(t,e){const o=j(e.vertexSpace),{scale:n,orientation:l}=t,{transform:i}=e,s=F(i);o&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),o?(n.actual=a(O(i)),n.visible=!0):(n.actual=null,n.visible=!1)}function k(t,e,o){V(t,e,o),"orientation"in t&&"scale"in t&&w(t,e,o)}function w(t,e,o){if(!e||!j(e.vertexSpace))return;const n=e.transform??=new x,{rotationAngle:r,rotationAxis:a}=n,l=z(t.orientation.actual),i=I(a);if(null!=l&&null!=i&&l!==r){o?.onRotateStart?.(r);const t=l*i;n.rotationAngle=t,o?.onRotate?.(t),o?.onRotateStop?.(t)}const s=t.scale.actual?.value,c=O(n);if(null!=s&&s!==c){const{scale:t}=n;let e;if(o?.onScaleStart?.(t[0],t[1],t[2]),0===c)e=p(f);else{const o=s/c;e=u(m(),t,o)}n.scale=e,o?.onScale?.(e[0],e[1],e[2]),o?.onScaleStop?.(e[0],e[1],e[2])}}function V(t,e,o){if(!e||!j(e.vertexSpace))return;const{origin:n,spatialReference:r}=e,{x:a,y:l,z:i}=P(t,r),{dx:s,dy:u,dz:c}=D(t,n);0===s&&0===u&&0===c||(o.onMoveStart?.(),e.centerAt(new v({x:a??n.x,y:l??n.y,z:i??n.z,spatialReference:r})),o.onMove?.(s,u,c),o.onMoveStop?.())}function D(t,e){const{x:o,y:r,z:a}=e,{x:l,y:i,z:s}=P(t,e.spatialReference);return{dx:null==l||n(l,o)?0:l-o,dy:null==i||n(i,r)?0:i-r,dz:null==s||null==a||n(s,a)?0:s-a}}function P(t,e){let o,n,r;if(t.geographic){o=A(t.longitude.actual),n=A(t.latitude.actual),b(e)&&(null!=o&&null!=n?[o,n]=S(o,n,E):null!=o?o=S(o,0,E)[0]:null!=n&&(n=S(0,n,E)[1]));const a=t.elevation.actual,s=i(e);r=null!=s&&null!=a?l(a,s):void 0}else o=t.x.actual?.value,n=t.y.actual?.value,r=t.elevation.actual?.value;return{x:o,y:n,z:r}}const E=[0,0];function F(t){if(!t)return 0;const e=I(t.rotationAxis);return null!=e?e*t.rotationAngle:null}function I(t){return c(t,y)?1:c(t,q)?-1:null}const q=s(m(),y);function O(t){return t?Math.max(...t.scale):1}function T(t,e){return!("key-down"!==t.type||t.key!==h.enterInputMode||!e||!B(e.info))&&(e.enterInputMode(),t.stopPropagation(),!0)}function B(t){const e=t?.sketchOptions;if(!e)return!1;const{inputEnabled:o,visibleElements:n}=e.tooltips;return o&&!0===t.editableFields.some((({name:t})=>"x"===t||"y"===t?n.coordinates:n[t]))}function C(n){let r=null;return e([n.on("paste",(async e=>{r?.abort(),r=t((async()=>{g()||await d(),G(e,n.info)}))})),t((()=>d())),o((()=>r?.abort()))])}function G(t,e){if(!e||!("geographic"in e))return;const o=t.clipboardData?.getData("text");if(o)if(e.geographic){const n=U(o);n&&(e.longitude.applyValue(n.longitude),e.latitude.applyValue(n.latitude),t.stopPropagation(),t.preventDefault())}else{const n=M(o);n&&(e.x.applyValue(n.x),e.y.applyValue(n.y),t.stopPropagation(),t.preventDefault())}}export{C as connectPasteEvent,T as enterInputModeIfAvailable,D as getXYZDeltasFromTooltipInfo,G as pasteLocation,k as updateMeshFromTooltipInfo,V as updateMeshOriginFromTooltipInfo,w as updateMeshTransformFromTooltipInfo,R as updateTooltipInfoFromMeshTransform};
5
+ import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as a,valueInUnit as l}from"../../../core/quantityUtils.js";import{verticalLengthUnitFromSpatialReference as i}from"../../../core/unitUtils.js";import{k as s,j as u,E as c}from"../../../chunks/vec32.js";import{clone as p,ONES as f,create as m,UNIT_Z as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as g,load as d}from"../../../geometry/coordinateFormatter.js";import v from"../../../geometry/Point.js";import x from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as j}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as S}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as h}from"../keybindings.js";import{parseLatitudeLongitude as U,parseXY as M}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as z,getDegreesGeographic as A}from"../../support/angularMeasurementUtils.js";function R(t,e){const o=j(e.vertexSpace),{scale:n,orientation:l}=t,{transform:i}=e,s=E(i);o&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),o?(n.actual=a(q(i)),n.visible=!0):(n.actual=null,n.visible=!1)}function k(t,e,o){if(!e||!j(e.vertexSpace))return;const n=e.transform??=new x,{rotationAngle:r,rotationAxis:a}=n,l=z(t.orientation.actual),i=F(a);if(null!=l&&null!=i&&l!==r){o?.onRotateStart?.(r);const t=l*i;n.rotationAngle=t,o?.onRotate?.(t),o?.onRotateStop?.(t)}const s=t.scale.actual?.value,c=q(n);if(null!=s&&s!==c){const{scale:t}=n;let e;if(o?.onScaleStart?.(t[0],t[1],t[2]),0===c)e=p(f);else{const o=s/c;e=u(m(),t,o)}n.scale=e,o?.onScale?.(e[0],e[1],e[2]),o?.onScaleStop?.(e[0],e[1],e[2])}}function w(t,e,o){if(!e||!j(e.vertexSpace))return;const{origin:n,spatialReference:r}=e,{x:a,y:l,z:i}=D(t,r),{dx:s,dy:u,dz:c}=V(t,n);0===s&&0===u&&0===c||(o.onMoveStart?.(),e.centerAt(new v({x:a??n.x,y:l??n.y,z:i??n.z,spatialReference:r})),o.onMove?.(s,u,c),o.onMoveStop?.())}function V(t,e){const{x:o,y:r,z:a}=e,{x:l,y:i,z:s}=D(t,e.spatialReference);return{dx:null==l||n(l,o)?0:l-o,dy:null==i||n(i,r)?0:i-r,dz:null==s||null==a||n(s,a)?0:s-a}}function D(t,e){let o,n,r;if(t.geographic){o=A(t.longitude.actual),n=A(t.latitude.actual),b(e)&&(null!=o&&null!=n?[o,n]=S(o,n,P):null!=o?o=S(o,0,P)[0]:null!=n&&(n=S(0,n,P)[1]));const a=t.elevation.actual,s=i(e);r=null!=s&&null!=a?l(a,s):void 0}else o=t.x.actual?.value,n=t.y.actual?.value,r=t.elevation.actual?.value;return{x:o,y:n,z:r}}const P=[0,0];function E(t){if(!t)return 0;const e=F(t.rotationAxis);return null!=e?e*t.rotationAngle:null}function F(t){return c(t,y)?1:c(t,I)?-1:null}const I=s(m(),y);function q(t){return t?Math.max(...t.scale):1}function O(t,e){return!("key-down"!==t.type||t.key!==h.enterInputMode||!e||!T(e.info))&&(e.enterInputMode(),t.stopPropagation(),!0)}function T(t){const e=t?.sketchOptions;if(!e)return!1;const{inputEnabled:o,visibleElements:n}=e.tooltips;return o&&!0===t.editableFields.some((({name:t})=>"x"===t||"y"===t?n.coordinates:n[t]))}function B(n){let r=null;return e([n.on("paste",(async e=>{r?.abort(),r=t((async()=>{g()||await d(),C(e,n.info)}))})),t((()=>d())),o((()=>r?.abort()))])}function C(t,e){if(!e||!("geographic"in e))return;const o=t.clipboardData?.getData("text");if(o)if(e.geographic){const n=U(o);n&&(e.longitude.applyValue(n.longitude),e.latitude.applyValue(n.latitude),t.stopPropagation(),t.preventDefault())}else{const n=M(o);n&&(e.x.applyValue(n.x),e.y.applyValue(n.y),t.stopPropagation(),t.preventDefault())}}export{B as connectPasteEvent,O as enterInputModeIfAvailable,V as getXYZDeltasFromTooltipInfo,C as pasteLocation,w as updateMeshOriginFromTooltipInfo,k as updateMeshTransformFromTooltipInfo,R as updateTooltipInfoFromMeshTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{combineTimeExtent as a}from"../../layers/support/timeSupport.js";import{getDefaultDatumTransformationForDataset as o,projectDatasetExtent as n}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as l}from"./support/popupUtils.js";const u=u=>{let p=class extends u{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return o(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(e){return!!n(this.layer.serviceRasterInfo,e)}async fetchPopupFeaturesAtLocation(e,i){const{layer:s}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s,o=l(s,i);if(!a||null==o)return[];const n=[],{value:u,magdirValue:p,processedValue:c}=await s.identify(e,{timeExtent:this.timeExtent,signal:i?.signal});let m="";if(u?.length){m="imagery-tile"===s.type&&s.hasStandardTime()&&null!=u[0]?u.map((e=>s.getStandardTimeValue(e))).join(", "):u.join(", ");const e={ObjectId:0},r="Raster.ServicePixelValue";e[r]="imagery-tile"===s.type&&"Function"===s.raster.datasetFormat?c?.join(", "):m,e[r+".Raw"]=m;const i=s.serviceRasterInfo?.attributeTable;if(null!=i){const{fields:t,features:r}=i,s=t.find((({name:e})=>"value"===e.toLowerCase())),a=s?r.find((e=>String(e.attributes[s.name])===m)):null;if(a)for(const i in a.attributes)if(a.attributes.hasOwnProperty(i)){e[this._rasterFieldPrefix+i]=a.attributes[i]}}const a=s.serviceRasterInfo?.dataType;"vector-magdir"!==a&&"vector-uv"!==a||(e["Raster.Magnitude"]=p?.[0],e["Raster.Direction"]=p?.[1]);const o=new t({geometry:this.fullExtent.clone(),attributes:e,layer:s,sourceLayer:s});n.push(o)}return n}_getfullExtent(){return n(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([i()],p.prototype,"fullExtent",null),e([i()],p.prototype,"layer",void 0),e([i({readOnly:!0})],p.prototype,"timeExtent",null),e([i()],p.prototype,"view",void 0),e([i()],p.prototype,"tileInfo",void 0),e([i({readOnly:!0})],p.prototype,"hasTilingEffects",null),e([i()],p.prototype,"datumTransformation",null),p=e([s("esri.views.layers.ImageryTileLayerView")],p),p};export{u as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{combineTimeExtent as a}from"../../layers/support/timeSupport.js";import{getDefaultDatumTransformationForDataset as o,projectDatasetExtent as n}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as l}from"./support/popupUtils.js";const u=u=>{let p=class extends u{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return o(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(e){return!!n(this.layer.serviceRasterInfo,e)}async fetchPopupFeaturesAtLocation(e,i){const{layer:s}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s,o=l(s,i);if(!a||null==o)return[];const n=[],{value:u,magdirValue:p,processedValue:c}=await s.identify(e,{timeExtent:this.timeExtent,signal:i?.signal});let m="";if(u?.length){m="imagery-tile"===s.type&&s.hasStandardTime()&&null!=u[0]?u.map((e=>s.getStandardTimeValue(e))).join(", "):u.join(", ");const e={ObjectId:0},r="Raster.ServicePixelValue";e[r]="imagery-tile"===s.type&&"Function"===s.raster.datasetFormat?c?.join(", "):m,e[r+".Raw"]=m;const i=s.raster?.rasterInfo??s.serviceRasterInfo,a=i?.attributeTable;if(null!=a){const{fields:t,features:i}=a,s=t.find((({name:e})=>"value"===e.toLowerCase())),o=e[r],n=s?i.find((e=>String(e.attributes[s.name])===o)):null;if(n)for(const r in n.attributes)if(n.attributes.hasOwnProperty(r)){e[this._rasterFieldPrefix+r]=n.attributes[r]}}const o=i?.dataType;"vector-magdir"!==o&&"vector-uv"!==o||(e["Raster.Magnitude"]=p?.[0],e["Raster.Direction"]=p?.[1]);const l=new t({geometry:this.fullExtent.clone(),attributes:e,layer:s,sourceLayer:s});n.push(l)}return n}_getfullExtent(){return n(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([i()],p.prototype,"fullExtent",null),e([i()],p.prototype,"layer",void 0),e([i({readOnly:!0})],p.prototype,"timeExtent",null),e([i()],p.prototype,"view",void 0),e([i()],p.prototype,"tileInfo",void 0),e([i({readOnly:!0})],p.prototype,"hasTilingEffects",null),e([i()],p.prototype,"datumTransformation",null),p=e([s("esri.views.layers.ImageryTileLayerView")],p),p};export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{isSecureUrl as e,isDataURI as i}from"../../widgets/Bookmarks/bookmarkUtils.js";var p;let u=p=class extends o{constructor(){super(...arguments),this.url=""}destroy(){this.url=""}get isSecureUrl(){return e(this.url)}get isDataURI(){return i(this.url)}clone(){return new p({url:this.url})}};r([t({type:String,json:{write:{isRequired:!0}}})],u.prototype,"url",void 0),r([t()],u.prototype,"isSecureUrl",null),r([t()],u.prototype,"isDataURI",null),u=p=r([s("esri.webdoc.support.SlideThumbnail")],u);export{u as SlideThumbnail};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isHTTPSProtocol as t,isDataProtocol as s}from"../../core/urlUtils.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";var p;let u=p=class extends o{constructor(){super(...arguments),this.url=""}destroy(){this.url=""}get isSecureUrl(){return t(this.url)}get isDataURI(){return s(this.url)}clone(){return new p({url:this.url})}};r([e({type:String,json:{write:{isRequired:!0}}})],u.prototype,"url",void 0),r([e()],u.prototype,"isSecureUrl",null),r([e()],u.prototype,"isDataURI",null),u=p=r([i("esri.webdoc.support.SlideThumbnail")],u);export{u as SlideThumbnail};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends e{constructor(t){super(t)}get editedBookmark(){const{bookmark:t}=this;return t?this._get("editedBookmark")||t.clone():null}get customUrl(){return this.editedBookmark?.thumbnail?.isSecureUrl?this.editedBookmark?.thumbnail?.url:null}set customUrl(t){this._override("customUrl",t)}get screenshotUrl(){return this.editedBookmark?.thumbnail?.isDataURI?this.editedBookmark?.thumbnail?.url:null}set screenshotUrl(t){this._override("screenshotUrl",t)}get state(){return this._get("state")}set state(t){this.validationState=void 0,this.loading=void 0,this._set("state",t)}get thumbnailState(){return this.editedBookmark?.thumbnail?.url?this.editedBookmark?.thumbnail?.isSecureUrl?"url":"screenshot":"none"}set thumbnailState(t){this._overrideIfSome("thumbnailState",t)}};t([o()],s.prototype,"bookmark",void 0),t([o({readOnly:!0})],s.prototype,"editedBookmark",null),t([o()],s.prototype,"customUrl",null),t([o()],s.prototype,"screenshotUrl",null),t([o()],s.prototype,"state",null),t([o()],s.prototype,"thumbnailState",null),t([o()],s.prototype,"validationState",void 0),t([o()],s.prototype,"loading",void 0),s=t([r("esri.widgets.Bookmarks.BookmarksUserState")],s);const i=s;export{i as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends e{constructor(t){super(t)}get editedBookmark(){const{bookmark:t}=this;return t?this._get("editedBookmark")||t.clone():null}get customUrl(){return this.editedBookmark?.thumbnail?.isSecureUrl?this.editedBookmark.thumbnail.url:null}set customUrl(t){this._override("customUrl",t)}get screenshotUrl(){return this.editedBookmark?.thumbnail?.isDataURI?this.editedBookmark.thumbnail.url:null}set screenshotUrl(t){this._override("screenshotUrl",t)}get state(){return this._get("state")}set state(t){this.validationState=void 0,this.loading=void 0,this._set("state",t)}get thumbnailState(){return this.editedBookmark?.thumbnail?.url?this.editedBookmark?.thumbnail?.isSecureUrl?"url":"screenshot":"none"}set thumbnailState(t){this._overrideIfSome("thumbnailState",t)}};t([o()],s.prototype,"bookmark",void 0),t([o({readOnly:!0})],s.prototype,"editedBookmark",null),t([o()],s.prototype,"customUrl",null),t([o()],s.prototype,"screenshotUrl",null),t([o()],s.prototype,"state",null),t([o()],s.prototype,"thumbnailState",null),t([o()],s.prototype,"validationState",void 0),t([o()],s.prototype,"loading",void 0),s=t([r("esri.widgets.Bookmarks.BookmarksUserState")],s);const i=s;export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{isSome as t}from"../core/arrayUtils.js";import{deprecatedProperty as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import r from"../core/Logger.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as n,convertDateFormatToIntlOptions as l}from"../intl/date.js";import{system as d}from"../time/timeZoneUtils.js";import{SlideThumbnail as m}from"../webdoc/support/SlideThumbnail.js";import c from"./Widget.js";import u from"./Bookmarks/BookmarksUserState.js";import k from"./Bookmarks/BookmarksViewModel.js";import h from"./Bookmarks/BookmarksVisibleElements.js";import{ThumbnailInputPattern as p}from"./Bookmarks/bookmarkUtils.js";import{css as b}from"./Bookmarks/css.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as _}from"./support/globalCss.js";import{Heading as v}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as B}from"./support/decorators/messageBundle.js";import{vmEvent as f}from"./support/decorators/vmEvent.js";import{tsx as E}from"./support/jsxFactory.js";let w=class extends(i(c)){constructor(e,t){super(e,t),this._addInputNode=null,this._editInputNode=null,this._urlEditInputNode=null,this._lastDragDetail=null,this._selectedDragBookmarkUid=null,this._editIncludeTimeExtent=void 0,this._userState=null,this._focusRootFlowItem=!1,this._focusAddFlowItem=!1,this._focusEditFlowItem=!1,this.disabled=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new k,this.visibleElements=new h,this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t,bookmarks:o}=this,{toEl:i,fromEl:r,dragEl:a,newIndex:s}=e;if(!o.length)return;if(!r||!i||t?.newIndex===s&&t?.dragEl===a&&t?.toEl===i&&t?.fromEl===r)return;this._lastDragDetail=e;const n=Array.from(r.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));o.sort(((e,t)=>{const o=n.indexOf(e.uid),i=n.indexOf(t.uid);return o>i?1:o<i?-1:0}))}}normalizeCtorArgs(e){return null!=e?.editingEnabled&&null!=e.visibleElements?{...e,visibleElements:new h({...e.visibleElements,addBookmarkButton:e.editingEnabled,editBookmarkButton:e.editingEnabled})}:e}loadDependencies(){return g({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),"chip-group":()=>import("@esri/calcite-components/dist/components/calcite-chip-group.js"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip.js"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),input:()=>import("@esri/calcite-components/dist/components/calcite-input.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js"),table:()=>import("@esri/calcite-components/dist/components/calcite-table.js"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell.js"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header.js"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row.js")})}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultEditOptions(){return this.viewModel.defaultEditOptions}set defaultEditOptions(e){this.viewModel.defaultEditOptions=e}get bookmarks(){return this.viewModel.bookmarks}set bookmarks(e){this.viewModel.bookmarks=e}get editingEnabled(){return o(r.getLogger(this),"editingEnabled",{replacement:"dragEnabled, visibleElements.editBookmarkButton, visibleElements.addBookmarkButton",version:"4.29",warnOnce:!0}),this.dragEnabled&&this.visibleElements.editBookmarkButton&&this.visibleElements.addBookmarkButton}set editingEnabled(e){o(r.getLogger(this),"editingEnabled",{replacement:"dragEnabled, visibleElements.editBookmarkButton, visibleElements.addBookmarkButton",version:"4.29",warnOnce:!0}),this.dragEnabled=e,this.visibleElements.editBookmarkButton=e,this.visibleElements.addBookmarkButton=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"bookmark"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}endAddBookmark(){this._userState=null}goTo(e){return this.viewModel.goTo(e)}render(){return E("div",{class:this.classes(b.base,_.widget,_.panel)},this._renderBookmarksContainer())}startAddBookmark(){this._userState=new u({state:"add"}),this._focusAddFlowItem=!0}_renderNoBookmarksContainer(e){const{messages:t,viewModel:{state:o}}=this;return e.length||"loading"===o?null:E("div",{class:_.empty,key:"no-bookmarks"},E("calcite-icon",{icon:"bookmark",scale:"l"}),E(v,{class:this.classes(_.heading,b.noBookmarksHeader),level:this.headingLevel},t?.noBookmarksHeading),E("p",{class:b.noBookmarksDescription},t.noBookmarksDescription))}_renderEditBookmarkFlowItems(){const{_userState:e}=this,t=e?.editedBookmark;return t&&"edit"===e?.state?this._renderEditingBookmark(t):[]}_renderBookmarkItems(e){return e?e.toArray().map((e=>this._renderBookmark(e))):[]}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:o,oldIndex:i}=e;t.insertBefore(o,t.children[i])}_renderBookmarksContainer(){const{viewModel:{state:e,bookmarks:o},dragEnabled:i,messages:r,disabled:a,filterPlaceholder:s,filterText:n,visible:l,headingLevel:d,visibleElements:{closeButton:m,collapseButton:c,filter:u,heading:k,flow:h},uid:p}=this,g=o.filter(t),_=g.length?E("calcite-list",{class:b.list,dragEnabled:i,filterEnabled:u,filterPlaceholder:s,filterText:n,group:`bookmarks-${p}`,key:"bookmark-list",label:r.widgetLabel,selectionAppearance:"border",selectionMode:"none",onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.target?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},this._renderBookmarkItems(g),u?E("div",{class:b.filterNoResults,slot:"filter-no-results"},E("calcite-notice",{kind:"info",open:!0,width:"full"},E("div",{slot:"message"},r.noBookmarksHeading),";")):null):null,v=[E("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:m,closed:!l,collapsible:c,disabled:a,heading:k?r.widgetLabel:void 0,headingLevel:d,loading:"loading"===e,onCalciteFlowItemClose:()=>this.visible=!1},this._renderNoBookmarksContainer(g),_,this._renderAddBookmarkButton()),this._renderAddingBookmark(),this._renderEditBookmarkFlowItems()];return l?h?E("calcite-flow",{key:"root-flow"},v):v:null}_renderAddBookmarkButton(){const{messages:e,_userState:t,disabled:o,viewModel:{view:i,state:r},visibleElements:{addBookmarkButton:a}}=this,s=t?.loading??!1;return i&&"loading"!==r&&a?E("calcite-fab",{appearance:"outline-fill",bind:this,class:b.addBookmarkButton,disabled:o||s,icon:"plus",key:"add-bookmark-item",kind:"neutral",loading:s,onclick:this.startAddBookmark,slot:"fab",text:e.addBookmark,textEnabled:!0,title:e.addBookmark,type:"button"}):null}_renderEditContainer(e){const{messagesCommon:t,visibleElements:{editBookmarkButton:o}}=this,i=`${t.edit} ${this._getBookmarkTitle(e)}`;return o?E("calcite-action",{appearance:"transparent",icon:"pencil",key:"edit-action",onclick:()=>this._showEditBookmarkForm(e),slot:"actions-end",text:i,title:i}):null}_renderBookmarkImage(e,t){return t?E("img",{alt:"",class:b.bookmarkImage,key:"bookmark-image",src:e.thumbnail?.url}):null}_renderBookmarkTimeSwitch(e){const{messages:t,viewModel:{view:o}}=this,{timeExtent:i}=e;return o?.timeExtent??i?E("calcite-label",{layout:"inline-space-between"},t.includeTimeExtent,E("calcite-switch",{checked:!!i,onCalciteSwitchChange:e=>{this._editIncludeTimeExtent=!!e.target.checked}})):null}_renderEditBookmarkTimeExtent(e){return this._editIncludeTimeExtent?this._renderBookmarkTimeExtent(e):null}_getTimeExtentStrings(e){const{visibleElements:t}=this,{timeExtent:o}=e;if(!o)return{};const{start:i,end:r}=o,a=null!=r&&(null==i||i.getTime()!==r.getTime()),s=i?this._formatDate(i):"",n=i&&t.time?this._formatTime(i):"";if(!a)return{startDate:s,startTime:n};return{startDate:s,startTime:n,endDate:this._formatDate(r),endTime:t.time?this._formatTime(r):""}}_renderTimeExtentDescription(e){const{startDate:t,startTime:o,endDate:i,endTime:r}=this._getTimeExtentStrings(e);if(!t)return"";const a=`${t} ${o}`;return i?`${a} - ${`${i} ${r}`}`:a}_renderBookmarkTimeExtent(e,t=!1){const{messages:o}=this,{startDate:i,startTime:r,endDate:a,endTime:s}=this._getTimeExtentStrings(e),n=t?null:E("calcite-table-row",{slot:"table-header"},E("calcite-table-header",{heading:o.startDate}),a?E("calcite-table-header",{heading:o.endDate}):null);return i?E("calcite-table",{caption:o.timeExtent,scale:"s"},n,E("calcite-table-row",null,E("calcite-table-cell",null,i," ",r?[E("br",null),r]:null),a?E("calcite-table-cell",null,a,s?[E("br",null),s]:null):null)):null}_renderBookmarkActiveScrim(e,t){return this.viewModel.activeBookmark===e&&t?E("calcite-scrim",{key:"bookmark-active-scrim",loading:!0}):null}_renderBookmarkActiveLoader(e,t){return this.viewModel.activeBookmark!==e||t?null:E("calcite-loader",{class:b.loader,inline:!0,key:"bookmark-active-loader",label:this.messagesCommon.loading})}_renderBookmarkImageIcon(e,t){return this.viewModel.activeBookmark===e||t?null:E("calcite-icon",{icon:"bookmark",key:"bookmark-icon",scale:"s"})}_renderBookmarkThumbnail(e){const t=this.visibleElements.thumbnail&&!!e.thumbnail?.url;return E("div",{class:b.bookmarkImageContainer,slot:"content-start"},this._renderBookmarkActiveScrim(e,t),this._renderBookmarkImage(e,t),this._renderBookmarkActiveLoader(e,t),this._renderBookmarkImageIcon(e,t))}_focusSelectedDragEl(e,t){this._selectedDragBookmarkUid===t.uid&&requestAnimationFrame((()=>e?.setFocus()))}_handleCalciteListItemDragHandleChange(e,t){e.stopPropagation();const o=e.target.dragSelected;this._selectedDragBookmarkUid=o?t.uid:null}_renderBookmark(e){return E("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes({[b.dragEnabled]:this.dragEnabled}),description:this._renderTimeExtentDescription(e),dragSelected:e.uid===this._selectedDragBookmarkUid,key:e.uid,label:this._getBookmarkTitle(e),value:e.uid,onCalciteListItemDragHandleChange:t=>this._handleCalciteListItemDragHandleChange(t,e),onCalciteListItemSelect:()=>this._goToBookmark(e)},this._renderBookmarkThumbnail(e),this._renderBookmarkContent(e),this._renderEditContainer(e))}_renderBookmarkContent(e){return E("div",{class:b.bookmarkContent,slot:"content"},E("span",{class:b.bookmarkContentLabel},this._getBookmarkTitle(e)),this._renderBookmarkTimeExtent(e,!0))}_renderEditingBookmarkName(e){const{messages:t,_userState:o}=this,i="name-required"===o?.validationState;return E("calcite-label",null,t.title,E("calcite-input",{afterCreate:this._storeEditInput,bind:this,class:b.editBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:e.name}),i?E("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderEditingBookmarkActions(){const{messagesCommon:e,_userState:t}=this,o=t?.bookmark;return[E("calcite-button",{appearance:"transparent",kind:"danger",onclick:()=>this._deleteBookmark(o),slot:"footer",type:"button",width:"full"},e.delete),E("calcite-button",{appearance:"outline",bind:this,onclick:this._closeEditBookmarkForm,slot:"footer",type:"button",width:"full"},e.cancel),E("calcite-button",{slot:"footer",type:"submit",width:"full"},e.save)]}_handleUrlEditInputChange(){const{_userState:e,_urlEditInputNode:t}=this,o=t?.value;if(!e?.editedBookmark||!o)return;e.validationState=void 0,e.editedBookmark.thumbnail?.isDataURI&&(e.screenshotUrl=e.editedBookmark.thumbnail?.url);const i=new m({url:o});i.isSecureUrl&&(e.customUrl=o,e.editedBookmark.thumbnail=i)}_renderEditingTimeExtent(e){const{capabilities:t,view:o}=this.viewModel,{timeExtent:i}=e;return t.time&&(o?.timeExtent??i)?E("div",{key:"edit-bookmark-time-container"},this._renderBookmarkTimeSwitch(e),this._renderEditBookmarkTimeExtent(e)):null}_renderEditingBookmarkImage(e){const{_userState:t}=this,o=t?.thumbnailState,i=e.thumbnail?.isSecureUrl?"url"===o:e.thumbnail?.isDataURI?"screenshot"===o:null;if(i)return this._renderBookmarkImage(e,i)}_renderEditingThumbnail(e){const{_userState:t,visibleElements:o}=this,i=t?.thumbnailState;return o.thumbnail&&"none"!==i?E("div",{class:b.authoringImageContainer},this._renderEditingBookmarkImage(e)):null}_renderUpdateThumbnailButton(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail&&"screenshot"===i?E("calcite-button",{appearance:"outline",class:b.authoringRefreshThumbnailButton,iconStart:"refresh",key:"update-thumbnail",kind:"neutral",onclick:()=>{this._updateThumbnail()},width:"half"},t.updateThumbnail):null}_renderEditingBookmarkUrlInput(e){const{messages:t,_userState:o}=this,i=e.thumbnail?.url,r=e.thumbnail?.isSecureUrl?i:void 0,a=i&&"absolute-url-required"===o?.validationState,s=o?.thumbnailState;return"url"===s?E("calcite-label",{key:"thumbnail-url-input"},E("calcite-input",{afterCreate:this._storeUrlEditInput,bind:this,name:"bookmark-thumbnail-url",pattern:p,placeholder:t?`https://<${t.imageUrlPlaceholder}>`:void 0,required:!0,title:t.imageUrlTooltip,type:"text",value:r,onCalciteInputChange:this._handleUrlEditInputChange,onCalciteInputInput:this._handleUrlEditInputChange}),a?E("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidImageUrl):null):null}_renderThumbnailSelector(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail?E("calcite-label",{key:"thumbnail-chip-group"},t.thumbnail,E("calcite-chip-group",{label:t.thumbnail,selectionMode:"single-persist",onCalciteChipGroupSelect:e=>this._handleThumbnailTypeSelect(e.target.selectedItems[0].value)},E("calcite-chip",{selected:"screenshot"===i,value:"screenshot"},t.screenshot),E("calcite-chip",{selected:"url"===i,value:"url"},t.url),E("calcite-chip",{selected:"none"===i,value:"none"},t.none))):null}_renderEditingBookmark(e){const{disabled:t,messagesCommon:o,headingLevel:i}=this;return e?E("form",{bind:this,class:b.form,disabled:this.disabled,onsubmit:this._editBookmarkSubmit},E("calcite-flow-item",{afterCreate:this._focusEditFlowItemNode,afterUpdate:this._focusEditFlowItemNode,bind:this,disabled:t,heading:o.edit,headingLevel:i,key:"edit-bookmark-form",onCalciteFlowItemBack:e=>{e.preventDefault(),this._closeEditBookmarkForm()}},E("div",{class:b.formContent},E("div",{class:b.authoring},this._renderEditingBookmarkName(e),this._renderThumbnailSelector(),this._renderEditingThumbnail(e),this._renderEditingBookmarkUrlInput(e),this._renderUpdateThumbnailButton(),this._renderEditingTimeExtent(e))),this._renderEditingBookmarkActions())):null}_renderAddingBookmarkName(){const{_userState:e,messages:t}=this,o="name-required"===e?.validationState;return E("calcite-label",null,t.title,E("calcite-input",{afterCreate:this._storeAddInput,bind:this,class:b.addBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:""}),o?E("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderAddingBookmarkActions(){const{messagesCommon:e}=this;return[E("calcite-button",{appearance:"outline",bind:this,onclick:this._endAddBookmark,slot:"footer",type:"button",width:"half"},e.cancel),E("calcite-button",{slot:"footer",type:"submit",width:"half"},e.add)]}_renderAddingBookmark(){const{disabled:e,messages:t,headingLevel:o,_userState:i}=this;return"add"===i?.state?E("form",{bind:this,class:b.form,disabled:e,onsubmit:this._addBookmarkSubmitClick},E("calcite-flow-item",{afterCreate:this._focusAddFlowItemNode,afterUpdate:this._focusAddFlowItemNode,bind:this,disabled:e,heading:t.addBookmark,headingLevel:o,key:"add-bookmark-form",onCalciteFlowItemBack:e=>{e.preventDefault(),this._endAddBookmark()}},E("div",{class:b.formContent},this._renderAddingBookmarkName()),this._renderAddingBookmarkActions())):null}_getBookmarkTitle(e){return e?.name||this.messagesCommon.untitled}_formatDate(e){return e?n(e,{...l("short-date"),timeZone:this.viewModel.view?.timeZone??d}):""}_formatTime(e){return e?n(e,{...l("long-time"),timeZone:this.viewModel.view?.timeZone??d}):""}_endAddBookmark(){this.endAddBookmark(),this._focusRootFlowItem=!0}_showEditBookmarkForm(e){e&&(this._editIncludeTimeExtent=!!e.timeExtent,this._userState=new u({bookmark:e,state:"edit"}),this._focusEditFlowItem=!0,this.viewModel.goTo(e))}async _createNewScreenshotUrl(){const e=await this.viewModel.createBookmark();return e.thumbnail?.url??null}_storeCurrentUrl(){const{_userState:e}=this,t=e?.editedBookmark?.thumbnail?.url;t&&(e?.editedBookmark?.thumbnail?.isSecureUrl?e.customUrl=t:e?.editedBookmark?.thumbnail?.isDataURI&&(e.screenshotUrl=t))}async _handleThumbnailTypeSelect(e){const{_userState:t}=this;if(!t)return;const{screenshotUrl:o,customUrl:i,editedBookmark:r}=t,a="screenshot"===e?o??await this._createNewScreenshotUrl():"url"===e&&i?i:null;this._storeCurrentUrl(),r&&a&&(r.thumbnail=new m({url:a})),t.validationState=void 0,t.thumbnailState=e}_closeEditBookmarkForm(){this._userState=null,this._focusRootFlowItem=!0}_addBookmarkSubmitClick(e){e.preventDefault(),this._addBookmarkSubmit()}async _addBookmarkSubmit(){const{_addInputNode:e,_userState:t,viewModel:o,viewModel:{bookmarks:i}}=this;if(!t)return;const r=e?e.value.trim():null;if(!r)return void(t.validationState="name-required");t.loading=!0;const a=await o.createBookmark();a.name=r,i.add(a),this._endAddBookmark()}async _editBookmarkAndClose(e,t){const{viewModel:o,viewModel:{defaultEditOptions:i}}=this;await o.editBookmark(e,{...i,...t}),this._closeEditBookmarkForm()}_editBookmarkSubmit(e){e.preventDefault();const{_editInputNode:t,_userState:o,_editIncludeTimeExtent:i,_urlEditInputNode:r}=this;if(!o?.bookmark||!o.editedBookmark)return;o.validationState=void 0,o.customUrl=void 0,o.screenshotUrl=void 0;const a=t?.value.trim();if(!a)return void(o.validationState="name-required");o.bookmark.name=a,o.bookmark.thumbnail=o.editedBookmark.thumbnail,i||(o.bookmark.timeExtent=null);const s=o.thumbnailState;if("url"===s&&r){const e=r.value,t=new m({url:e});if(!t.isSecureUrl)return void(o.validationState="absolute-url-required");o.bookmark.thumbnail=t}else"none"===s&&(o.bookmark.thumbnail=null);this._editBookmarkAndClose(o.bookmark,{takeScreenshot:!1,captureTimeExtent:i})}_storeEditInput(e){this._editInputNode=e}_storeAddInput(e){this._addInputNode=e}_storeUrlEditInput(e){this._urlEditInputNode=e}_deleteBookmark(e){this._closeEditBookmarkForm(),e&&(this.viewModel.bookmarks.remove(e),e.destroy())}_goToBookmark(e){e&&(this.endAddBookmark(),this.viewModel.goTo(e))}async _updateThumbnail(){const{_userState:e,viewModel:t}=this;e&&(e.validationState=void 0,await t.editBookmark(e.editedBookmark,{takeScreenshot:!0,captureViewpoint:!1,captureRotation:!1,captureScale:!1,captureTimeExtent:!1}))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusEditFlowItemNode(e){this._focusEditFlowItem&&(this._focusEditFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusAddFlowItemNode(e){this._focusAddFlowItem&&(this._focusAddFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}};e([a()],w.prototype,"_editIncludeTimeExtent",void 0),e([a({type:u})],w.prototype,"_userState",void 0),e([a()],w.prototype,"_focusRootFlowItem",void 0),e([a()],w.prototype,"_focusAddFlowItem",void 0),e([a()],w.prototype,"_focusEditFlowItem",void 0),e([a()],w.prototype,"defaultCreateOptions",null),e([a()],w.prototype,"defaultEditOptions",null),e([a()],w.prototype,"bookmarks",null),e([a()],w.prototype,"disabled",void 0),e([a()],w.prototype,"dragEnabled",void 0),e([a()],w.prototype,"editingEnabled",null),e([a()],w.prototype,"filterPlaceholder",void 0),e([a()],w.prototype,"filterText",void 0),e([a()],w.prototype,"headingLevel",void 0),e([a()],w.prototype,"goToOverride",null),e([a()],w.prototype,"icon",null),e([a()],w.prototype,"label",null),e([a(),B("esri/widgets/Bookmarks/t9n/Bookmarks")],w.prototype,"messages",void 0),e([a(),B("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([a()],w.prototype,"uiStrings",void 0),e([a()],w.prototype,"view",null),e([a({type:k}),f(["select-bookmark","bookmark-edit","bookmark-select"])],w.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([a()],w.prototype,"endAddBookmark",null),e([a()],w.prototype,"startAddBookmark",null),w=e([s("esri.widgets.Bookmarks")],w);const I=w;export{I as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{isSome as t}from"../core/arrayUtils.js";import{deprecatedProperty as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import r from"../core/Logger.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as n,convertDateFormatToIntlOptions as l}from"../intl/date.js";import{system as d}from"../time/timeZoneUtils.js";import{SlideThumbnail as m}from"../webdoc/support/SlideThumbnail.js";import c from"./Widget.js";import u from"./Bookmarks/BookmarksUserState.js";import k from"./Bookmarks/BookmarksViewModel.js";import h from"./Bookmarks/BookmarksVisibleElements.js";import{css as p}from"./Bookmarks/css.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as _}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as v}from"./support/decorators/messageBundle.js";import{vmEvent as B}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";let E=class extends(i(c)){constructor(e,t){super(e,t),this._addInputNode=null,this._editInputNode=null,this._urlEditInputNode=null,this._lastDragDetail=null,this._selectedDragBookmarkUid=null,this._editIncludeTimeExtent=void 0,this._userState=null,this._focusRootFlowItem=!1,this._focusAddFlowItem=!1,this._focusEditFlowItem=!1,this.disabled=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new k,this.visibleElements=new h,this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t,bookmarks:o}=this,{toEl:i,fromEl:r,dragEl:a,newIndex:s}=e;if(!o.length)return;if(!r||!i||t?.newIndex===s&&t?.dragEl===a&&t?.toEl===i&&t?.fromEl===r)return;this._lastDragDetail=e;const n=Array.from(r.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));o.sort(((e,t)=>{const o=n.indexOf(e.uid),i=n.indexOf(t.uid);return o>i?1:o<i?-1:0}))}}normalizeCtorArgs(e){return null!=e?.editingEnabled&&null!=e.visibleElements?{...e,visibleElements:new h({...e.visibleElements,addBookmarkButton:e.editingEnabled,editBookmarkButton:e.editingEnabled})}:e}loadDependencies(){return b({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),"chip-group":()=>import("@esri/calcite-components/dist/components/calcite-chip-group.js"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip.js"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),input:()=>import("@esri/calcite-components/dist/components/calcite-input.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js"),table:()=>import("@esri/calcite-components/dist/components/calcite-table.js"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell.js"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header.js"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row.js")})}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultEditOptions(){return this.viewModel.defaultEditOptions}set defaultEditOptions(e){this.viewModel.defaultEditOptions=e}get bookmarks(){return this.viewModel.bookmarks}set bookmarks(e){this.viewModel.bookmarks=e}get editingEnabled(){return o(r.getLogger(this),"editingEnabled",{replacement:"dragEnabled, visibleElements.editBookmarkButton, visibleElements.addBookmarkButton",version:"4.29",warnOnce:!0}),this.dragEnabled&&this.visibleElements.editBookmarkButton&&this.visibleElements.addBookmarkButton}set editingEnabled(e){o(r.getLogger(this),"editingEnabled",{replacement:"dragEnabled, visibleElements.editBookmarkButton, visibleElements.addBookmarkButton",version:"4.29",warnOnce:!0}),this.dragEnabled=e,this.visibleElements.editBookmarkButton=e,this.visibleElements.addBookmarkButton=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"bookmark"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}endAddBookmark(){this._userState=null}goTo(e){return this.viewModel.goTo(e)}render(){return f("div",{class:this.classes(p.base,g.widget,g.panel)},this._renderBookmarksContainer())}startAddBookmark(){this._userState=new u({state:"add"}),this._focusAddFlowItem=!0}_renderNoBookmarksContainer(e){const{messages:t,viewModel:{state:o}}=this;return e.length||"loading"===o?null:f("div",{class:g.empty,key:"no-bookmarks"},f("calcite-icon",{icon:"bookmark",scale:"l"}),f(_,{class:this.classes(g.heading,p.noBookmarksHeader),level:this.headingLevel},t?.noBookmarksHeading),f("p",{class:p.noBookmarksDescription},t.noBookmarksDescription))}_renderEditBookmarkFlowItems(){const{_userState:e}=this,t=e?.editedBookmark;return t&&"edit"===e?.state?this._renderEditingBookmark(t):[]}_renderBookmarkItems(e){return e?e.toArray().map((e=>this._renderBookmark(e))):[]}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:o,oldIndex:i}=e;t.insertBefore(o,t.children[i])}_renderBookmarksContainer(){const{viewModel:{state:e,bookmarks:o},dragEnabled:i,messages:r,disabled:a,filterPlaceholder:s,filterText:n,visible:l,headingLevel:d,visibleElements:{closeButton:m,collapseButton:c,filter:u,heading:k,flow:h},uid:b}=this,g=o.filter(t),_=g.length?f("calcite-list",{class:p.list,dragEnabled:i,filterEnabled:u,filterPlaceholder:s,filterText:n,group:`bookmarks-${b}`,key:"bookmark-list",label:r.widgetLabel,selectionAppearance:"border",selectionMode:"none",onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.target?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},this._renderBookmarkItems(g),u?f("div",{class:p.filterNoResults,slot:"filter-no-results"},f("calcite-notice",{kind:"info",open:!0,width:"full"},f("div",{slot:"message"},r.noBookmarksHeading),";")):null):null,v=[f("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:m,closed:!l,collapsible:c,disabled:a,heading:k?r.widgetLabel:void 0,headingLevel:d,loading:"loading"===e,onCalciteFlowItemClose:()=>this.visible=!1},this._renderNoBookmarksContainer(g),_,this._renderAddBookmarkButton()),this._renderAddingBookmark(),this._renderEditBookmarkFlowItems()];return l?h?f("calcite-flow",{key:"root-flow"},v):v:null}_renderAddBookmarkButton(){const{messages:e,_userState:t,disabled:o,viewModel:{view:i,state:r},visibleElements:{addBookmarkButton:a}}=this,s=t?.loading??!1;return i&&"loading"!==r&&a?f("calcite-fab",{appearance:"outline-fill",bind:this,class:p.addBookmarkButton,disabled:o||s,icon:"plus",key:"add-bookmark-item",kind:"neutral",loading:s,onclick:this.startAddBookmark,slot:"fab",text:e.addBookmark,textEnabled:!0,title:e.addBookmark,type:"button"}):null}_renderEditContainer(e){const{messagesCommon:t,visibleElements:{editBookmarkButton:o}}=this,i=`${t.edit} ${this._getBookmarkTitle(e)}`;return o?f("calcite-action",{appearance:"transparent",icon:"pencil",key:"edit-action",onclick:()=>this._showEditBookmarkForm(e),slot:"actions-end",text:i,title:i}):null}_renderBookmarkImage(e,t){return t?f("img",{alt:"",class:p.bookmarkImage,key:"bookmark-image",src:e.thumbnail?.url}):null}_renderBookmarkTimeSwitch(e){const{messages:t,viewModel:{view:o}}=this,{timeExtent:i}=e;return o?.timeExtent??i?f("calcite-label",{layout:"inline-space-between"},t.includeTimeExtent,f("calcite-switch",{checked:!!i,onCalciteSwitchChange:e=>{this._editIncludeTimeExtent=!!e.target.checked}})):null}_renderEditBookmarkTimeExtent(e){return this._editIncludeTimeExtent?this._renderBookmarkTimeExtent(e):null}_getTimeExtentStrings(e){const{visibleElements:t}=this,{timeExtent:o}=e;if(!o)return{};const{start:i,end:r}=o,a=null!=r&&(null==i||i.getTime()!==r.getTime()),s=i?this._formatDate(i):"",n=i&&t.time?this._formatTime(i):"";if(!a)return{startDate:s,startTime:n};return{startDate:s,startTime:n,endDate:this._formatDate(r),endTime:t.time?this._formatTime(r):""}}_renderTimeExtentDescription(e){const{startDate:t,startTime:o,endDate:i,endTime:r}=this._getTimeExtentStrings(e);if(!t)return"";const a=`${t} ${o}`;return i?`${a} - ${`${i} ${r}`}`:a}_renderBookmarkTimeExtent(e,t=!1){const{messages:o}=this,{startDate:i,startTime:r,endDate:a,endTime:s}=this._getTimeExtentStrings(e),n=t?null:f("calcite-table-row",{slot:"table-header"},f("calcite-table-header",{heading:o.startDate}),a?f("calcite-table-header",{heading:o.endDate}):null);return i?f("calcite-table",{caption:o.timeExtent,scale:"s"},n,f("calcite-table-row",null,f("calcite-table-cell",null,i," ",r?[f("br",null),r]:null),a?f("calcite-table-cell",null,a,s?[f("br",null),s]:null):null)):null}_renderBookmarkActiveScrim(e,t){return this.viewModel.activeBookmark===e&&t?f("calcite-scrim",{key:"bookmark-active-scrim",loading:!0}):null}_renderBookmarkActiveLoader(e,t){return this.viewModel.activeBookmark!==e||t?null:f("calcite-loader",{class:p.loader,inline:!0,key:"bookmark-active-loader",label:this.messagesCommon.loading})}_renderBookmarkImageIcon(e,t){return this.viewModel.activeBookmark===e||t?null:f("calcite-icon",{icon:"bookmark",key:"bookmark-icon",scale:"s"})}_renderBookmarkThumbnail(e){const t=this.visibleElements.thumbnail&&!!e.thumbnail?.url;return f("div",{class:p.bookmarkImageContainer,slot:"content-start"},this._renderBookmarkActiveScrim(e,t),this._renderBookmarkImage(e,t),this._renderBookmarkActiveLoader(e,t),this._renderBookmarkImageIcon(e,t))}_focusSelectedDragEl(e,t){this._selectedDragBookmarkUid===t.uid&&requestAnimationFrame((()=>e?.setFocus()))}_handleCalciteListItemDragHandleChange(e,t){e.stopPropagation();const o=e.target.dragSelected;this._selectedDragBookmarkUid=o?t.uid:null}_renderBookmark(e){return f("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes({[p.dragEnabled]:this.dragEnabled}),description:this._renderTimeExtentDescription(e),dragSelected:e.uid===this._selectedDragBookmarkUid,key:e.uid,label:this._getBookmarkTitle(e),value:e.uid,onCalciteListItemDragHandleChange:t=>this._handleCalciteListItemDragHandleChange(t,e),onCalciteListItemSelect:()=>this._goToBookmark(e)},this._renderBookmarkThumbnail(e),this._renderBookmarkContent(e),this._renderEditContainer(e))}_renderBookmarkContent(e){return f("div",{class:p.bookmarkContent,slot:"content"},f("span",{class:p.bookmarkContentLabel},this._getBookmarkTitle(e)),this._renderBookmarkTimeExtent(e,!0))}_renderEditingBookmarkName(e){const{messages:t,_userState:o}=this,i="name-required"===o?.validationState;return f("calcite-label",null,t.title,f("calcite-input",{afterCreate:this._storeEditInput,bind:this,class:p.editBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:e.name}),i?f("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderEditingBookmarkActions(){const{messagesCommon:e,_userState:t}=this,o=t?.bookmark;return[f("calcite-button",{appearance:"transparent",kind:"danger",onclick:()=>this._deleteBookmark(o),slot:"footer",type:"button",width:"full"},e.delete),f("calcite-button",{appearance:"outline",bind:this,onclick:this._closeEditBookmarkForm,slot:"footer",type:"button",width:"full"},e.cancel),f("calcite-button",{slot:"footer",type:"submit",width:"full"},e.save)]}_handleUrlEditInputChange(){const{_userState:e,_urlEditInputNode:t}=this,o=t?.value;if(!e?.editedBookmark||!o)return;e.validationState=void 0,e.editedBookmark.thumbnail?.isDataURI&&(e.screenshotUrl=e.editedBookmark.thumbnail?.url);const i=new m({url:o});i.isSecureUrl&&(e.customUrl=o,e.editedBookmark.thumbnail=i)}_renderEditingTimeExtent(e){const{capabilities:t,view:o}=this.viewModel,{timeExtent:i}=e;return t.time&&(o?.timeExtent??i)?f("div",{key:"edit-bookmark-time-container"},this._renderBookmarkTimeSwitch(e),this._renderEditBookmarkTimeExtent(e)):null}_renderEditingBookmarkImage(e){const{_userState:t}=this,o=t?.thumbnailState,i=e.thumbnail?.isSecureUrl?"url"===o:e.thumbnail?.isDataURI?"screenshot"===o:null;if(i)return this._renderBookmarkImage(e,i)}_renderEditingThumbnail(e){const{_userState:t,visibleElements:o}=this,i=t?.thumbnailState;return o.thumbnail&&"none"!==i?f("div",{class:p.authoringImageContainer},this._renderEditingBookmarkImage(e)):null}_renderUpdateThumbnailButton(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail&&"screenshot"===i?f("calcite-button",{appearance:"outline",class:p.authoringRefreshThumbnailButton,iconStart:"refresh",key:"update-thumbnail",kind:"neutral",onclick:()=>{this._updateThumbnail()},width:"half"},t.updateThumbnail):null}_renderEditingBookmarkUrlInput(e){const{messages:t,_userState:o}=this,i=e.thumbnail?.url,r=e.thumbnail?.isSecureUrl?i:void 0,a=i&&"absolute-url-required"===o?.validationState,s=o?.thumbnailState;return"url"===s?f("calcite-label",{key:"thumbnail-url-input"},f("calcite-input",{afterCreate:this._storeUrlEditInput,bind:this,name:"bookmark-thumbnail-url",pattern:"https://.*",placeholder:t?`https://<${t.imageUrlPlaceholder}>`:void 0,required:!0,title:t.imageUrlTooltip,type:"text",value:r,onCalciteInputChange:this._handleUrlEditInputChange,onCalciteInputInput:this._handleUrlEditInputChange}),a?f("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidImageUrl):null):null}_renderThumbnailSelector(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail?f("calcite-label",{key:"thumbnail-chip-group"},t.thumbnail,f("calcite-chip-group",{label:t.thumbnail,selectionMode:"single-persist",onCalciteChipGroupSelect:e=>this._handleThumbnailTypeSelect(e.target.selectedItems[0].value)},f("calcite-chip",{selected:"screenshot"===i,value:"screenshot"},t.screenshot),f("calcite-chip",{selected:"url"===i,value:"url"},t.url),f("calcite-chip",{selected:"none"===i,value:"none"},t.none))):null}_renderEditingBookmark(e){const{disabled:t,messagesCommon:o,headingLevel:i}=this;return e?f("form",{bind:this,class:p.form,disabled:this.disabled,onsubmit:this._editBookmarkSubmit},f("calcite-flow-item",{afterCreate:this._focusEditFlowItemNode,afterUpdate:this._focusEditFlowItemNode,bind:this,disabled:t,heading:o.edit,headingLevel:i,key:"edit-bookmark-form",onCalciteFlowItemBack:e=>{e.preventDefault(),this._closeEditBookmarkForm()}},f("div",{class:p.formContent},f("div",{class:p.authoring},this._renderEditingBookmarkName(e),this._renderThumbnailSelector(),this._renderEditingThumbnail(e),this._renderEditingBookmarkUrlInput(e),this._renderUpdateThumbnailButton(),this._renderEditingTimeExtent(e))),this._renderEditingBookmarkActions())):null}_renderAddingBookmarkName(){const{_userState:e,messages:t}=this,o="name-required"===e?.validationState;return f("calcite-label",null,t.title,f("calcite-input",{afterCreate:this._storeAddInput,bind:this,class:p.addBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:""}),o?f("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderAddingBookmarkActions(){const{messagesCommon:e}=this;return[f("calcite-button",{appearance:"outline",bind:this,onclick:this._endAddBookmark,slot:"footer",type:"button",width:"half"},e.cancel),f("calcite-button",{slot:"footer",type:"submit",width:"half"},e.add)]}_renderAddingBookmark(){const{disabled:e,messages:t,headingLevel:o,_userState:i}=this;return"add"===i?.state?f("form",{bind:this,class:p.form,disabled:e,onsubmit:this._addBookmarkSubmitClick},f("calcite-flow-item",{afterCreate:this._focusAddFlowItemNode,afterUpdate:this._focusAddFlowItemNode,bind:this,disabled:e,heading:t.addBookmark,headingLevel:o,key:"add-bookmark-form",onCalciteFlowItemBack:e=>{e.preventDefault(),this._endAddBookmark()}},f("div",{class:p.formContent},this._renderAddingBookmarkName()),this._renderAddingBookmarkActions())):null}_getBookmarkTitle(e){return e?.name||this.messagesCommon.untitled}_formatDate(e){return e?n(e,{...l("short-date"),timeZone:this.viewModel.view?.timeZone??d}):""}_formatTime(e){return e?n(e,{...l("long-time"),timeZone:this.viewModel.view?.timeZone??d}):""}_endAddBookmark(){this.endAddBookmark(),this._focusRootFlowItem=!0}_showEditBookmarkForm(e){e&&(this._editIncludeTimeExtent=!!e.timeExtent,this._userState=new u({bookmark:e,state:"edit"}),this._focusEditFlowItem=!0,this.viewModel.goTo(e))}async _createNewScreenshotUrl(){const e=await this.viewModel.createBookmark();return e.thumbnail?.url??null}_storeCurrentUrl(){const{_userState:e}=this,t=e?.editedBookmark?.thumbnail?.url;t&&(e?.editedBookmark?.thumbnail?.isSecureUrl?e.customUrl=t:e?.editedBookmark?.thumbnail?.isDataURI&&(e.screenshotUrl=t))}async _handleThumbnailTypeSelect(e){const{_userState:t}=this;if(!t)return;const{screenshotUrl:o,customUrl:i,editedBookmark:r}=t,a="screenshot"===e?o??await this._createNewScreenshotUrl():"url"===e&&i?i:null;this._storeCurrentUrl(),r&&a&&(r.thumbnail=new m({url:a})),t.validationState=void 0,t.thumbnailState=e}_closeEditBookmarkForm(){this._userState=null,this._focusRootFlowItem=!0}_addBookmarkSubmitClick(e){e.preventDefault(),this._addBookmarkSubmit()}async _addBookmarkSubmit(){const{_addInputNode:e,_userState:t,viewModel:o,viewModel:{bookmarks:i}}=this;if(!t)return;const r=e?e.value.trim():null;if(!r)return void(t.validationState="name-required");t.loading=!0;const a=await o.createBookmark();a.name=r,i.add(a),this._endAddBookmark()}async _editBookmarkAndClose(e,t){const{viewModel:o,viewModel:{defaultEditOptions:i}}=this;await o.editBookmark(e,{...i,...t}),this._closeEditBookmarkForm()}_editBookmarkSubmit(e){e.preventDefault();const{_editInputNode:t,_userState:o,_editIncludeTimeExtent:i,_urlEditInputNode:r}=this;if(!o?.bookmark||!o.editedBookmark)return;o.validationState=void 0,o.customUrl=void 0,o.screenshotUrl=void 0;const a=t?.value.trim();if(!a)return void(o.validationState="name-required");o.bookmark.name=a,o.bookmark.thumbnail=o.editedBookmark.thumbnail,i||(o.bookmark.timeExtent=null);const s=o.thumbnailState;if("url"===s&&r){const e=r.value,t=new m({url:e});if(!t.isSecureUrl)return void(o.validationState="absolute-url-required");o.bookmark.thumbnail=t}else"none"===s&&(o.bookmark.thumbnail=null);this._editBookmarkAndClose(o.bookmark,{takeScreenshot:!1,captureTimeExtent:i})}_storeEditInput(e){this._editInputNode=e}_storeAddInput(e){this._addInputNode=e}_storeUrlEditInput(e){this._urlEditInputNode=e}_deleteBookmark(e){this._closeEditBookmarkForm(),e&&(this.viewModel.bookmarks.remove(e),e.destroy())}_goToBookmark(e){e&&(this.endAddBookmark(),this.viewModel.goTo(e))}async _updateThumbnail(){const{_userState:e,viewModel:t}=this;e&&(e.validationState=void 0,await t.editBookmark(e.editedBookmark,{takeScreenshot:!0,captureViewpoint:!1,captureRotation:!1,captureScale:!1,captureTimeExtent:!1}))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusEditFlowItemNode(e){this._focusEditFlowItem&&(this._focusEditFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusAddFlowItemNode(e){this._focusAddFlowItem&&(this._focusAddFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}};e([a()],E.prototype,"_editIncludeTimeExtent",void 0),e([a({type:u})],E.prototype,"_userState",void 0),e([a()],E.prototype,"_focusRootFlowItem",void 0),e([a()],E.prototype,"_focusAddFlowItem",void 0),e([a()],E.prototype,"_focusEditFlowItem",void 0),e([a()],E.prototype,"defaultCreateOptions",null),e([a()],E.prototype,"defaultEditOptions",null),e([a()],E.prototype,"bookmarks",null),e([a()],E.prototype,"disabled",void 0),e([a()],E.prototype,"dragEnabled",void 0),e([a()],E.prototype,"editingEnabled",null),e([a()],E.prototype,"filterPlaceholder",void 0),e([a()],E.prototype,"filterText",void 0),e([a()],E.prototype,"headingLevel",void 0),e([a()],E.prototype,"goToOverride",null),e([a()],E.prototype,"icon",null),e([a()],E.prototype,"label",null),e([a(),v("esri/widgets/Bookmarks/t9n/Bookmarks")],E.prototype,"messages",void 0),e([a(),v("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([a()],E.prototype,"uiStrings",void 0),e([a()],E.prototype,"view",null),e([a({type:k}),B(["select-bookmark","bookmark-edit","bookmark-select"])],E.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([a()],E.prototype,"endAddBookmark",null),e([a()],E.prototype,"startAddBookmark",null),E=e([s("esri.widgets.Bookmarks")],E);const w=E;export{w as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import CatalogLayerListViewModel = __esri.CatalogLayerListViewModel;
4
+ export default CatalogLayerListViewModel;
@@ -0,0 +1,4 @@
1
+ import "../interfaces";
2
+
3
+ import CatalogLayerList = __esri.CatalogLayerList;
4
+ export default CatalogLayerList;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{getActionIcon as n,getActionStyles as r}from"../support/actions/actionUtils.js";import a from"./Widget.js";import c from"./CatalogLayerList/CatalogLayerListViewModel.js";import d from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as m}from"./CatalogLayerList/css.js";import p from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as h,getItem as g,listItemHasChildren as v,areChildrenHidden as y,getStatusIcon as f,getVisibilityIcon as _}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as b}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as w}from"./support/decorators/messageBundle.js";import{vmEvent as L}from"./support/decorators/vmEvent.js";import{tsx as A}from"./support/jsxFactory.js";const C=t.ofType(p);let M=class extends(i(a)){constructor(e,t){super(e,t),this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._rootGroupUid=`operational-${this.uid}`,this.collapsed=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=h,this.selectedItems=new C,this.selectionMode="none",this.viewModel=new c,this.visibilityAppearance="default",this.visibleElements=new d,this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(m.item)));this._activeItem=g(t)}}loadDependencies(){return I({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[b.hidden]:"loading"===e,[b.disabled]:"disabled"===e},i=this.catalogItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)));return A("div",{class:this.classes(m.base,b.widget,b.panel,t)},i?.length?[this._renderItemTooltips(i),this._renderItems(i)]:this._renderNoItems())}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?A("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,referenceElement:t.get(e.layer.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(e){return e?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return A("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return A("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},A("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(e){return e?e.flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)).toArray().map((({title:e,panel:t})=>{const i=()=>this._handlePanelFlowItemBack(t);return A("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:e,heading:t.title,headingLevel:this.headingLevel,key:`flow-panel-${t.uid}`,onCalciteFlowItemBack:e=>{e.preventDefault(),i()}},t.render(),A("calcite-button",{appearance:"transparent",onclick:i,slot:"footer-actions",width:"full"},this.messagesCommon.back))})):[]}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_renderItems(e){const{visible:t,collapsed:i,_filterEnabled:o,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:n,heading:r,flow:a},selectionMode:c,filterText:d,filterPlaceholder:p,messages:u}=this,h=[A("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!t,collapsed:i,collapsible:n,heading:r?u.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",onCalciteFlowItemClose:()=>this.visible=!1},A("calcite-list",{afterCreate:e=>{e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,filterEnabled:o,filterPlaceholder:p,filterText:o?d:"",group:s,key:"root-list",label:u.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.target?.filterText??""},e?.toArray().map((e=>this._renderItem(e))),e?.length&&o?A("div",{class:m.filterNoResults,slot:"filter-no-results"},A("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(e)];return t?a?A("calcite-flow",{key:"root-flow"},h):h:null}_renderChildList(e,t=[]){const{_rootGroupUid:i,viewModel:{listModeDisabled:o},selectionMode:s}=this,{children:l}=e,n=v(e),r=!(!o&&y(e.layer))&&!n&&"group"===e.layer?.type;return n||r?A("calcite-list",{"data-item":e,"data-layer-type":i,group:`${i}-${e.layer.uid}`,key:`child-list-${e.layer.uid}`,selectionAppearance:"border",selectionMode:s},l?.filter((e=>!e.hidden)).toArray().map((i=>this._renderItem(i,e,[...t,e.title])))):null}_renderItemMessage(e){return e.error?A("div",{class:m.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},A("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},A("div",{slot:"message"},this.messages.layerError))):e.incompatible?A("div",{class:m.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},A("calcite-notice",{afterCreate:t=>this._setTooltipReference(t,e),afterRemoved:()=>this._removeTooltipReference(e),bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},A("div",{slot:"message"},this.messages.layerIncompatible))):null}_getLayerTitle(e){return e.title||this.messages.untitledLayer}_renderItem(e,t,i){const{_activeItem:o,selectionMode:s,selectedItems:l,messages:n}=this,r=this._getLayerTitle(e),a=e.visibleAtCurrentScale?r:`${r} (${n.layerInvisibleAtScale})`,c=this._filterActions(e.actionsSections),d=this._countActions(c);return A("calcite-list-item",{class:this.classes(m.item,{[m.itemActive]:o===e}),"data-item":e,"data-layer-id":e.layer.id,id:e.layer.uid,key:`list-item-${e.layer.uid}`,label:r,metadata:{parentTitles:i,title:r},open:e.open,selected:"none"!==s&&l.includes(e),title:a,value:e.layer.uid,onCalciteListItemSelect:i=>this._handleCalciteListItemSelect(i,e,t),onCalciteListItemToggle:t=>this._handleCalciteListItemToggle(t,e)},A("div",{class:this.classes({[m.itemContent]:!0,[m.itemInvisibleAtScale]:!e.visibleAtCurrentScale}),slot:"content"},r),this._renderItemStatus(e,t),this._renderItemToggle(e,t),this._renderItemTemporaryIcon(e),this._renderChildList(e,i),this._renderItemMessage(e),this._renderPanel(e.panel),this._renderPanelAction(e.panel),d>1?this._renderActionsSections(e,c):1===d?this._renderAction({item:e,action:this._getSingleAction(c),textEnabled:!1}):null)}_renderItemStatus(e,t){const{visibleElements:i}=this;if(!i.statusIndicators)return null;const{connectionStatus:o,publishing:s,updating:l}=e,n=l&&!t,r=!!o;return A("calcite-icon",{class:this.classes({[m.statusIndicator]:!0,[m.publishing]:s,[m.updating]:n,[m.connectionStatus]:r,[m.connectionStatusConnected]:r&&"connected"===o}),icon:f({connectionStatus:o,publishing:s}),key:"layer-item-status",scale:"s",slot:"actions-end"})}_renderItemTemporaryIcon(e){return this.visibleElements.temporaryLayerIndicators&&"persistenceEnabled"in e.layer&&!e.layer.persistenceEnabled?A("calcite-icon",{class:m.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"actions-start",title:this.messages.temporary}):null}_renderItemToggle(e,t){const{messages:i,visibilityAppearance:o}=this,{visible:s}=e,l=t?.visibilityMode;if("inherited"===l)return null;const n=_({visible:s,exclusive:"exclusive"===l,visibilityAppearance:o}),r="checkbox"===o,a=i.layerVisibility;return A("calcite-action",{appearance:"transparent",class:m.visibleToggle,icon:r?n:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:a,title:a},r?null:A("calcite-icon",{class:this.classes({[m.visibleIcon]:"exclusive"!==l&&s}),icon:n,scale:"s"}))}_renderPanel(e){return!e?.open||e.disabled||e.flowEnabled?null:A("div",{class:m.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}_renderPanelAction(e){if(!e?.visible)return null;const{open:t,title:i,disabled:o}=e;return A("calcite-action",{active:t,appearance:"transparent",disabled:o,icon:n(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}_renderActionsSections(e,t){const i=this.messagesCommon.options;return A("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:this.messagesCommon.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:t=>e.actionsOpen=t.target.open},A("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),t.toArray().map(((t,i)=>this._renderActionSection(e,t,i))))}_renderActionSection(e,t,i){return A("calcite-action-group",{key:`action-section-${i}`},t.toArray().map((t=>this._renderAction({item:e,action:t,textEnabled:!0}))))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o="image"in e?e.image:void 0,s={[m.itemActionIcon]:!!t,[m.itemActionImage]:!!o};return t&&(s[t]=!0),o||t?A("span",{"aria-hidden":"true",class:this.classes(m.itemActionIcon,s),key:"icon",styles:r(o)}):null}_renderAction(e){const{item:t,action:i,textEnabled:o}=e;if(!i)return null;const{active:s,disabled:l,title:r,type:a,indicator:c}=i;return A("calcite-action",{active:"toggle"===a&&i.value,appearance:"transparent",disabled:l,icon:n(i),indicator:c,key:`action-${i.uid}`,loading:s,onclick:()=>this._triggerAction(t,i),scale:"s",slot:o?void 0:"actions-end",text:r??"",textEnabled:o,title:r??void 0},this._renderFallbackIcon(i))}_setTooltipReference(e,t){this._tooltipReferenceMap.set(t.layer.uid,e)}_removeTooltipReference(e){this._tooltipReferenceMap.delete(e.layer.uid)}_getSingleAction(e){return e.reduce((e=>e)).find((e=>e&&("button"===e.type||"toggle"===e.type)))}_filterActions(e){return e.map((e=>e.filter((e=>e.visible))))}_countActions(e){return e.reduce(((e,t)=>e+t.length),0)}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.triggerAction(t,e))}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>g(e))).filter(Boolean);i.removeAll(),i.addMany(o)}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_handleCalciteListItemSelect(e,t,i){g(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&(this._focusPanelFlowItem=!0)}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};e([s()],M.prototype,"_activeItem",void 0),e([s()],M.prototype,"_tooltipReferenceMap",void 0),e([s()],M.prototype,"_focusRootFlowItem",void 0),e([s()],M.prototype,"_focusPanelFlowItem",void 0),e([s()],M.prototype,"_filterEnabled",null),e([s()],M.prototype,"catalogItems",null),e([s()],M.prototype,"catalogLayer",null),e([s()],M.prototype,"collapsed",void 0),e([s()],M.prototype,"filterPlaceholder",void 0),e([s()],M.prototype,"filterText",void 0),e([s()],M.prototype,"headingLevel",void 0),e([s()],M.prototype,"icon",null),e([s()],M.prototype,"label",null),e([s()],M.prototype,"listItemCreatedFunction",null),e([s(),w("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],M.prototype,"messages",void 0),e([s(),w("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([s()],M.prototype,"minDragEnabledItems",void 0),e([s()],M.prototype,"minFilterItems",void 0),e([s()],M.prototype,"selectedItems",void 0),e([s()],M.prototype,"selectionMode",void 0),e([s()],M.prototype,"view",null),e([L("trigger-action"),s({type:c})],M.prototype,"viewModel",void 0),e([s()],M.prototype,"visibilityAppearance",void 0),e([s({type:d,nonNullable:!0})],M.prototype,"visibleElements",void 0),M=e([l("esri.widgets.CatalogLayerList")],M);const F=M;export{F as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{getActionIcon as n,getActionStyles as r}from"../support/actions/actionUtils.js";import a from"./Widget.js";import c from"./CatalogLayerList/CatalogLayerListViewModel.js";import d from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as m}from"./CatalogLayerList/css.js";import p from"./LayerList/ListItem.js";import{minFilterItems as u,getItem as h,listItemHasChildren as g,areChildrenHidden as v,getStatusIcon as y,getVisibilityIcon as f}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{globalCss as I}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as w}from"./support/decorators/vmEvent.js";import{tsx as L}from"./support/jsxFactory.js";const A=t.ofType(p);let C=class extends(i(a)){constructor(e,t){super(e,t),this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._rootGroupUid=`operational-${this.uid}`,this.collapsed=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.minFilterItems=u,this.selectedItems=new A,this.selectionMode="none",this.viewModel=new c,this.visibilityAppearance="default",this.visibleElements=new d,this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(m.item)));this._activeItem=h(t)}}loadDependencies(){return _({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[I.hidden]:"loading"===e,[I.disabled]:"disabled"===e},i=this.catalogItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)));return L("div",{class:this.classes(m.base,I.widget,I.panel,t)},i?.length?[this._renderItemTooltips(i),this._renderItems(i)]:this._renderNoItems())}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?L("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,referenceElement:t.get(e.layer.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(e){return e?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return L("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return L("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},L("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(e){return e?e.flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)).toArray().map((({title:e,panel:t})=>{const i=()=>this._handlePanelFlowItemBack(t);return L("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:e,heading:t.title,headingLevel:this.headingLevel,key:`flow-panel-${t.uid}`,onCalciteFlowItemBack:e=>{e.preventDefault(),i()}},t.render(),L("calcite-button",{appearance:"transparent",onclick:i,slot:"footer-actions",width:"full"},this.messagesCommon.back))})):[]}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_renderItems(e){const{visible:t,collapsed:i,_filterEnabled:o,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:n,heading:r,flow:a},selectionMode:c,filterText:d,filterPlaceholder:p,messages:u}=this,h=[L("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!t,collapsed:i,collapsible:n,heading:r?u.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",onCalciteFlowItemClose:()=>this.visible=!1},L("calcite-list",{afterCreate:e=>{e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,filterEnabled:o,filterPlaceholder:p,filterText:o?d:"",group:s,key:"root-list",label:u.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.target?.filterText??""},e?.toArray().map((e=>this._renderItem(e))),e?.length&&o?L("div",{class:m.filterNoResults,slot:"filter-no-results"},L("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(e)];return t?a?L("calcite-flow",{key:"root-flow"},h):h:null}_renderChildList(e,t=[]){const{_rootGroupUid:i,viewModel:{listModeDisabled:o},selectionMode:s}=this,{children:l}=e,n=g(e),r=!(!o&&v(e.layer))&&!n&&"group"===e.layer?.type;return n||r?L("calcite-list",{"data-item":e,"data-layer-type":i,group:`${i}-${e.layer.uid}`,key:`child-list-${e.layer.uid}`,selectionAppearance:"border",selectionMode:s},l?.filter((e=>!e.hidden)).toArray().map((i=>this._renderItem(i,e,[...t,e.title])))):null}_renderItemMessage(e){return e.error?L("div",{class:m.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},L("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},L("div",{slot:"message"},this.messages.layerError))):e.incompatible?L("div",{class:m.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},L("calcite-notice",{afterCreate:t=>this._setTooltipReference(t,e),afterRemoved:()=>this._removeTooltipReference(e),bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},L("div",{slot:"message"},this.messages.layerIncompatible))):null}_getLayerTitle(e){return e.title||this.messages.untitledLayer}_renderItem(e,t,i){const{_activeItem:o,selectionMode:s,selectedItems:l,messages:n}=this,r=this._getLayerTitle(e),a=e.visibleAtCurrentScale?r:`${r} (${n.layerInvisibleAtScale})`,c=this._filterActions(e.actionsSections),d=this._countActions(c);return L("calcite-list-item",{class:this.classes(m.item,{[m.itemActive]:o===e}),"data-item":e,"data-layer-id":e.layer.id,id:e.layer.uid,key:`list-item-${e.layer.uid}`,label:r,metadata:{parentTitles:i,title:r},open:e.open,selected:"none"!==s&&l.includes(e),title:a,value:e.layer.uid,onCalciteListItemSelect:i=>this._handleCalciteListItemSelect(i,e,t),onCalciteListItemToggle:t=>this._handleCalciteListItemToggle(t,e)},L("div",{class:this.classes({[m.itemContent]:!0,[m.itemInvisibleAtScale]:!e.visibleAtCurrentScale}),slot:"content"},r),this._renderItemStatus(e,t),this._renderItemToggle(e,t),this._renderItemTemporaryIcon(e),this._renderChildList(e,i),this._renderItemMessage(e),this._renderPanel(e.panel),this._renderPanelAction(e.panel),d>1?this._renderActionsSections(e,c):1===d?this._renderAction({item:e,action:this._getSingleAction(c),textEnabled:!1}):null)}_renderItemStatus(e,t){const{visibleElements:i}=this;if(!i.statusIndicators)return null;const{connectionStatus:o,publishing:s,updating:l}=e,n=l&&!t,r=!!o;return L("calcite-icon",{class:this.classes({[m.statusIndicator]:!0,[m.publishing]:s,[m.updating]:n,[m.connectionStatus]:r,[m.connectionStatusConnected]:r&&"connected"===o}),icon:y({connectionStatus:o,publishing:s}),key:"layer-item-status",scale:"s",slot:"actions-end"})}_renderItemTemporaryIcon(e){return this.visibleElements.temporaryLayerIndicators&&"persistenceEnabled"in e.layer&&!e.layer.persistenceEnabled?L("calcite-icon",{class:m.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"actions-start",title:this.messages.temporary}):null}_renderItemToggle(e,t){const{messages:i,visibilityAppearance:o}=this,{visible:s}=e,l=t?.visibilityMode;if("inherited"===l)return null;const n=f({visible:s,exclusive:"exclusive"===l,visibilityAppearance:o}),r="checkbox"===o,a=i.layerVisibility;return L("calcite-action",{appearance:"transparent",class:m.visibleToggle,icon:r?n:void 0,key:"visibility-toggle",onclick:()=>this._toggleVisibility(e,t),scale:"s",slot:r?"actions-start":"actions-end",text:a,title:a},r?null:L("calcite-icon",{class:this.classes({[m.visibleIcon]:"exclusive"!==l&&s}),icon:n,scale:"s"}))}_renderPanel(e){return!e?.open||e.disabled||e.flowEnabled?null:L("div",{class:m.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}_renderPanelAction(e){if(!e?.visible)return null;const{open:t,title:i,disabled:o}=e;return L("calcite-action",{active:t,appearance:"transparent",disabled:o,icon:n(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}_renderActionsSections(e,t){const i=this.messagesCommon.options;return L("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:this.messagesCommon.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:t=>e.actionsOpen=t.target.open},L("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),t.toArray().map(((t,i)=>this._renderActionSection(e,t,i))))}_renderActionSection(e,t,i){return L("calcite-action-group",{key:`action-section-${i}`},t.toArray().map((t=>this._renderAction({item:e,action:t,textEnabled:!0}))))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o="image"in e?e.image:void 0,s={[m.itemActionIcon]:!!t,[m.itemActionImage]:!!o};return t&&(s[t]=!0),o||t?L("span",{"aria-hidden":"true",class:this.classes(m.itemActionIcon,s),key:"icon",styles:r(o)}):null}_renderAction(e){const{item:t,action:i,textEnabled:o}=e;if(!i)return null;const{active:s,disabled:l,title:r,type:a,indicator:c}=i;return L("calcite-action",{active:"toggle"===a&&i.value,appearance:"transparent",disabled:l,icon:n(i),indicator:c,key:`action-${i.uid}`,loading:s,onclick:()=>this._triggerAction(t,i),scale:"s",slot:o?void 0:"actions-end",text:r??"",textEnabled:o,title:r??void 0},this._renderFallbackIcon(i))}_setTooltipReference(e,t){this._tooltipReferenceMap.set(t.layer.uid,e)}_removeTooltipReference(e){this._tooltipReferenceMap.delete(e.layer.uid)}_getSingleAction(e){return e.reduce((e=>e)).find((e=>e&&("button"===e.type||"toggle"===e.type)))}_filterActions(e){return e.map((e=>e.filter((e=>e.visible))))}_countActions(e){return e.reduce(((e,t)=>e+t.length),0)}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.triggerAction(t,e))}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>h(e))).filter(Boolean);i.removeAll(),i.addMany(o)}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.open}_handleCalciteListItemSelect(e,t,i){h(e.target)===t&&"none"===this.selectionMode&&"inherited"!==i?.visibilityMode&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&(this._focusPanelFlowItem=!0)}_toggleVisibility(e,t){if(!e)return;const i=t?.visibilityMode;"exclusive"===i&&e.visible||(e.visible=!e.visible)}};e([s()],C.prototype,"_activeItem",void 0),e([s()],C.prototype,"_tooltipReferenceMap",void 0),e([s()],C.prototype,"_focusRootFlowItem",void 0),e([s()],C.prototype,"_focusPanelFlowItem",void 0),e([s()],C.prototype,"_filterEnabled",null),e([s()],C.prototype,"catalogItems",null),e([s()],C.prototype,"catalogLayer",null),e([s()],C.prototype,"collapsed",void 0),e([s()],C.prototype,"filterPlaceholder",void 0),e([s()],C.prototype,"filterText",void 0),e([s()],C.prototype,"headingLevel",void 0),e([s()],C.prototype,"icon",null),e([s()],C.prototype,"label",null),e([s()],C.prototype,"listItemCreatedFunction",null),e([s(),b("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],C.prototype,"messages",void 0),e([s(),b("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([s()],C.prototype,"minFilterItems",void 0),e([s()],C.prototype,"selectedItems",void 0),e([s()],C.prototype,"selectionMode",void 0),e([s()],C.prototype,"view",null),e([w("trigger-action"),s({type:c})],C.prototype,"viewModel",void 0),e([s()],C.prototype,"visibilityAppearance",void 0),e([s({type:d,nonNullable:!0})],C.prototype,"visibleElements",void 0),C=e([l("esri.widgets.CatalogLayerList")],C);const M=C;export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{directionalPadMoveOnceDuration as s}from"./constants.js";import{css as n}from"./css.js";import{angleToUnitVector as r,toUnitVector as v,vectorToClosestAngle as m}from"./utils.js";import{GoToMixin as a}from"../support/GoTo.js";let d=class extends(a(e.EventedAccessor)){constructor(t){super(t),this._initialAngle=void 0,this._movementVector=void 0,this._widgetCenter=void 0,this._anyAngleMovementEnabled=!1,this._movementTimeout=void 0,this._disabled=!1,this._moveOnceDuration=s,this.angle=void 0,this.speed=1,this.beginFollowingPointer=(t,e)=>{if(this.disabled)return;this._widgetCenter=e;const o=this._pointerLocationToVector(t);if(void 0===o)return;const i=this._resolveClosestAngle(t,o);void 0!==i&&(this._emitMove(r(i)),this.angle=i,this._initialAngle=i,this._setMovementTimeout((()=>{void 0===this._widgetCenter&&this._stopMovement()})),document.addEventListener("pointermove",this._onPointerMove,{passive:!0}),document.addEventListener("pointerup",this._onPointerUp,{passive:!0,once:!0}))},this.moveOnce=t=>{const e=r(t);this._emitMove(e),this._setMovementTimeout(this._stopMovement)},this._pointerLocationToVector=t=>{if(void 0===this._widgetCenter)return;const{x:e,y:o}=v(this._widgetCenter,t);return{x:e,y:-o}},this._resolveClosestAngle=(t,e)=>{const o=t.target,i=o?.getAttribute?.("data-angle"),s=o?.classList?.contains(n.compassButton);if(s)return;const r=Number.parseInt(i??"",10);return Number.isNaN(r)?m(e):r},this._onPointerMove=t=>{if(0===t.buttons)return void this._stopMovement();const e=this._pointerLocationToVector(t);if(void 0===e)return;this._setMovementTimeout(void 0);const o=this._resolveClosestAngle(t,e);if(void 0===o)return void this._emitStop();const i=r(o),s=null!=this._initialAngle&&this._initialAngle!==o;this._anyAngleMovementEnabled||=s;const n=this._anyAngleMovementEnabled?e:i;(n.x!==this._movementVector?.x||n.y!==this._movementVector?.y)&&(this.angle=o,this._emitMove(n))},this._onPointerUp=()=>{void 0===this._movementTimeout?this._stopMovement():this._widgetCenter=void 0},this._stopMovement=()=>{this._emitStop(),this._widgetCenter=void 0,this._initialAngle=void 0,this._anyAngleMovementEnabled=!1,document.removeEventListener("pointermove",this._onPointerMove),document.removeEventListener("pointerup",this._stopMovement),this._setMovementTimeout(void 0)},this.on("move-start",(()=>this.view?.mapViewNavigation.begin())),this.on("move-direction-change",(({vector:{x:t,y:e}})=>this.view?.mapViewNavigation.continuousPanVector({x:t*this.speed,y:e*this.speed}))),this.on("move-stop",(()=>this.view?.mapViewNavigation.stop()))}destroy(){this._stopMovement()}get disabled(){const{view:t,_disabled:e,supported:o}=this;return!1===t?.ready||e||!o}set disabled(t){this._disabled=t}get rotation(){return this.view?.rotation??this._get("rotation")??0}set rotation(t){this.view?this.view.constraints.rotationEnabled&&this.callGoTo({target:{rotation:t},options:{animate:0===t}}):this._set("rotation",t)}get supported(){return null==this.view||"2d"===this.view.type}get state(){const{disabled:t,angle:e}=this;return t?"disabled":null!=e?"moving":"ready"}_setMovementTimeout(t){clearTimeout(this._movementTimeout),this._movementTimeout=void 0===t?void 0:setTimeout((()=>{this._movementTimeout=void 0,t()}),this._moveOnceDuration)}_emitMove(t){null==this._movementVector&&this._emitMoveStartEvent({vector:t});const e=this._movementVector;this._movementVector=t,this._emitMoveDirectionChangeEvent({vector:t,oldVector:e})}_emitStop(){this.angle=void 0,void 0!==this._movementVector&&(this._emitMoveStopEvent({oldVector:this._movementVector}),this._movementVector=void 0)}_emitMoveStartEvent(t){this.emit("move-start",{...t,type:"move-start"})}_emitMoveDirectionChangeEvent(t){this.emit("move-direction-change",{...t,type:"move-direction-change"})}_emitMoveStopEvent(t){this.emit("move-stop",{...t,type:"move-stop"})}};t([o()],d.prototype,"_initialAngle",void 0),t([o()],d.prototype,"_movementVector",void 0),t([o()],d.prototype,"_widgetCenter",void 0),t([o()],d.prototype,"_anyAngleMovementEnabled",void 0),t([o()],d.prototype,"_movementTimeout",void 0),t([o()],d.prototype,"_disabled",void 0),t([o()],d.prototype,"_moveOnceDuration",void 0),t([o()],d.prototype,"disabled",null),t([o()],d.prototype,"angle",void 0),t([o({type:Number,range:{min:0,max:100}})],d.prototype,"speed",void 0),t([o()],d.prototype,"rotation",null),t([o()],d.prototype,"supported",null),t([o({readOnly:!0})],d.prototype,"state",null),t([o()],d.prototype,"view",void 0),d=t([i("esri.widgets.DirectionalPad.DirectionalPadViewModel")],d);const h=d;export{h as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{directionalPadMoveOnceDuration as s}from"./constants.js";import{css as n}from"./css.js";import{angleToUnitVector as r,toUnitVector as v,vectorToClosestAngle as m}from"./utils.js";import{GoToMixin as a}from"../support/GoTo.js";let d=class extends(a(e.EventedAccessor)){constructor(t){super(t),this._initialAngle=void 0,this._movementVector=void 0,this._widgetCenter=void 0,this._anyAngleMovementEnabled=!1,this._movementTimeout=void 0,this._disabled=!1,this._moveOnceDuration=s,this.angle=void 0,this.speed=1,this.beginFollowingPointer=(t,e)=>{if(this.disabled)return;this._widgetCenter=e;const o=this._pointerLocationToVector(t);if(void 0===o)return;const i=this._resolveClosestAngle(t,o);void 0!==i&&(this._emitMove(r(i)),this.angle=i,this._initialAngle=i,this._setMovementTimeout((()=>{void 0===this._widgetCenter&&this._stopMovement()})),document.addEventListener("pointermove",this._onPointerMove,{passive:!0}),document.addEventListener("pointerup",this._onPointerUp,{passive:!0,once:!0}))},this.moveOnce=t=>{const e=r(t);this._emitMove(e),this._setMovementTimeout(this._stopMovement)},this._pointerLocationToVector=t=>{if(void 0===this._widgetCenter)return;const{x:e,y:o}=v(this._widgetCenter,t);return{x:e,y:-o}},this._resolveClosestAngle=(t,e)=>{const o=t.target,i=o?.getAttribute?.("data-angle"),s=o?.classList?.contains(n.compassButton);if(s)return;const r=Number.parseInt(i??"",10);return Number.isNaN(r)?m(e):r},this._onPointerMove=t=>{if(0===t.buttons)return void this._stopMovement();const e=this._pointerLocationToVector(t);if(void 0===e)return;this._setMovementTimeout(void 0);const o=this._resolveClosestAngle(t,e);if(void 0===o)return void this._emitStop();const i=r(o),s=null!=this._initialAngle&&this._initialAngle!==o;this._anyAngleMovementEnabled||=s;const n=this._anyAngleMovementEnabled?e:i;(n.x!==this._movementVector?.x||n.y!==this._movementVector?.y)&&(this.angle=o,this._emitMove(n))},this._onPointerUp=()=>{void 0===this._movementTimeout?this._stopMovement():this._widgetCenter=void 0},this._stopMovement=()=>{this._emitStop(),this._widgetCenter=void 0,this._initialAngle=void 0,this._anyAngleMovementEnabled=!1,document.removeEventListener("pointermove",this._onPointerMove),document.removeEventListener("pointerup",this._stopMovement),this._setMovementTimeout(void 0)},this.on("move-start",(()=>this.view?.mapViewNavigation.begin())),this.on("move-direction-change",(({vector:{x:t,y:e}})=>this.view?.mapViewNavigation.continuousPanVector({x:t*this.speed,y:e*this.speed}))),this.on("move-stop",(()=>this.view?.mapViewNavigation.stop()))}destroy(){this._stopMovement()}get disabled(){const{view:t,_disabled:e,supported:o}=this;return!1===t?.ready||e||!o}set disabled(t){this._disabled=t}get rotation(){return this.view?.rotation??this._get("rotation")??0}set rotation(t){this.view?this.view.constraints.rotationEnabled&&this.callGoTo({target:{rotation:t},options:{animate:0===t&&void 0}}):this._set("rotation",t)}get supported(){return null==this.view||"2d"===this.view.type}get state(){const{disabled:t,angle:e}=this;return t?"disabled":null!=e?"moving":"ready"}_setMovementTimeout(t){clearTimeout(this._movementTimeout),this._movementTimeout=void 0===t?void 0:setTimeout((()=>{this._movementTimeout=void 0,t()}),this._moveOnceDuration)}_emitMove(t){null==this._movementVector&&this._emitMoveStartEvent({vector:t});const e=this._movementVector;this._movementVector=t,this._emitMoveDirectionChangeEvent({vector:t,oldVector:e})}_emitStop(){this.angle=void 0,void 0!==this._movementVector&&(this._emitMoveStopEvent({oldVector:this._movementVector}),this._movementVector=void 0)}_emitMoveStartEvent(t){this.emit("move-start",{...t,type:"move-start"})}_emitMoveDirectionChangeEvent(t){this.emit("move-direction-change",{...t,type:"move-direction-change"})}_emitMoveStopEvent(t){this.emit("move-stop",{...t,type:"move-stop"})}};t([o()],d.prototype,"_initialAngle",void 0),t([o()],d.prototype,"_movementVector",void 0),t([o()],d.prototype,"_widgetCenter",void 0),t([o()],d.prototype,"_anyAngleMovementEnabled",void 0),t([o()],d.prototype,"_movementTimeout",void 0),t([o()],d.prototype,"_disabled",void 0),t([o()],d.prototype,"_moveOnceDuration",void 0),t([o()],d.prototype,"disabled",null),t([o()],d.prototype,"angle",void 0),t([o({type:Number,range:{min:0,max:100}})],d.prototype,"speed",void 0),t([o()],d.prototype,"rotation",null),t([o()],d.prototype,"supported",null),t([o({readOnly:!0})],d.prototype,"state",null),t([o()],d.prototype,"view",void 0),d=t([i("esri.widgets.DirectionalPad.DirectionalPadViewModel")],d);const h=d;export{h as default};
package/widgets/Expand.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import s from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as i}from"./support/globalCss.js";import{isWidget as r,hasDomNode as a}from"./support/widget.js";import{tsx as p}from"./support/jsxFactory.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";const d="esri-expand",h={base:d,toggle:`${d}__toggle`,popoverContent:`${d}__popover-content`,panelContent:`${d}__panel-content`,sheet:`${d}__sheet`,panelIconNumber:`${d}__panel-icon-number`,contentContainer:`${d}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconExpanded:`${d}__icon--expanded`,iconNumber:`${d}__icon-number`,content:`${d}__content`,contentExpanded:`${d}__content--expanded`},u="chevrons-left",m="chevrons-right";let g=class extends n{constructor(e,t){super(e,t),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new s,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.target.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.target.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.target.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleButtonEl=e=>{this._toggleButtonEl=e},this._storePopoverEl=e=>{this._popoverEl=e}}loadDependencies(){return l({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel.js"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover.js"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet.js")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return m}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return r(this.content)?this.content.icon:u}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return(r(this.content)?this.content.label:null)??this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleButtonEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return p("div",{class:this.classes(h.base,i.widget)},this._renderToggle(),e?p("calcite-sheet",{class:h.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},p("calcite-panel",{closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},p("div",{class:h.panelContent},this._renderContent()))):t?p("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},p("div",{class:h.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;return o?.startsWith("bottom")?"auto-end":"auto-start"}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?p("span",{class:h.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,l=s===u||s===m;return p("calcite-button",{afterCreate:this._storeToggleButtonEl,afterUpdate:this._storeToggleButtonEl,class:i.widgetButton,kind:"neutral",label:t,onclick:this.toggle,scale:"s",title:t},s?p("calcite-icon",{class:this.classes(h.icon,l&&h.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return p("div",{class:h.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?p("div",{class:h.contentContainer,innerHTML:e,key:"content__string"}):r(e)?p("div",{class:h.contentContainer,key:"content__widget"},e.render()):e instanceof HTMLElement?p("div",{afterCreate:this._attachToNode,bind:e,class:h.contentContainer,key:"content__html-element"}):a(e)?p("div",{afterCreate:this._attachToNode,bind:e.domNode,class:h.contentContainer,key:"content__node"}):null}_attachToNode(e){const t=this;e.appendChild(t)}};e([t({readOnly:!0})],g.prototype,"expandTitle",null),e([t()],g.prototype,"_toggleButtonEl",void 0),e([t()],g.prototype,"_displaySheet",null),e([t()],g.prototype,"autoCollapse",null),e([t()],g.prototype,"closeOnEsc",void 0),e([t()],g.prototype,"collapseIcon",null),e([t()],g.prototype,"collapseTooltip",void 0),e([t()],g.prototype,"content",void 0),e([t()],g.prototype,"expanded",null),e([t()],g.prototype,"expandIcon",null),e([t()],g.prototype,"expandTooltip",void 0),e([t()],g.prototype,"group",null),e([t()],g.prototype,"icon",null),e([t()],g.prototype,"iconNumber",void 0),e([t()],g.prototype,"label",null),e([t(),c("esri/widgets/Expand/t9n/Expand")],g.prototype,"messages",void 0),e([t(),c("esri/t9n/common")],g.prototype,"messagesCommon",void 0),e([t()],g.prototype,"mode",void 0),e([t()],g.prototype,"placement",void 0),e([t()],g.prototype,"view",null),e([t({type:s})],g.prototype,"viewModel",void 0),g=e([o("esri.widgets.Expand")],g);const _=g;export{_ as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import s from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as i}from"./support/globalCss.js";import{isWidget as r,hasDomNode as p}from"./support/widget.js";import{tsx as a}from"./support/jsxFactory.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";const d="esri-expand",h={base:d,toggle:`${d}__toggle`,popoverContent:`${d}__popover-content`,panelContent:`${d}__panel-content`,sheet:`${d}__sheet`,panelIconNumber:`${d}__panel-icon-number`,contentContainer:`${d}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconExpanded:`${d}__icon--expanded`,iconNumber:`${d}__icon-number`,content:`${d}__content`,contentExpanded:`${d}__content--expanded`},u="chevrons-left",m="chevrons-right";let g=class extends n{constructor(e,t){super(e,t),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new s,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.target.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.target.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.target.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleButtonEl=e=>{this._toggleButtonEl=e},this._storePopoverEl=e=>{this._popoverEl=e}}loadDependencies(){return l({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel.js"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover.js"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet.js")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return m}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return r(this.content)?this.content.icon:u}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return(r(this.content)?this.content.label:null)??this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleButtonEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return a("div",{class:this.classes(h.base,i.widget)},this._renderToggle(),e?a("calcite-sheet",{class:h.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},a("calcite-panel",{closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},a("div",{class:h.panelContent},this._renderContent()))):t?a("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},a("div",{class:h.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;if(!o||"manual"===o)return"auto";const[n,s]=o.split("-");return`${"right"===s?"left":"right"}-${"bottom"===n?"end":"start"}`}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?a("span",{class:h.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,l=s===u||s===m;return a("calcite-button",{afterCreate:this._storeToggleButtonEl,afterUpdate:this._storeToggleButtonEl,class:i.widgetButton,kind:"neutral",label:t,onclick:this.toggle,scale:"s",title:t},s?a("calcite-icon",{class:this.classes(h.icon,l&&h.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return a("div",{class:h.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?a("div",{class:h.contentContainer,innerHTML:e,key:"content__string"}):r(e)?a("div",{class:h.contentContainer,key:"content__widget"},e.render()):e instanceof HTMLElement?a("div",{afterCreate:this._attachToNode,bind:e,class:h.contentContainer,key:"content__html-element"}):p(e)?a("div",{afterCreate:this._attachToNode,bind:e.domNode,class:h.contentContainer,key:"content__node"}):null}_attachToNode(e){const t=this;e.appendChild(t)}};e([t({readOnly:!0})],g.prototype,"expandTitle",null),e([t()],g.prototype,"_toggleButtonEl",void 0),e([t()],g.prototype,"_displaySheet",null),e([t()],g.prototype,"autoCollapse",null),e([t()],g.prototype,"closeOnEsc",void 0),e([t()],g.prototype,"collapseIcon",null),e([t()],g.prototype,"collapseTooltip",void 0),e([t()],g.prototype,"content",void 0),e([t()],g.prototype,"expanded",null),e([t()],g.prototype,"expandIcon",null),e([t()],g.prototype,"expandTooltip",void 0),e([t()],g.prototype,"group",null),e([t()],g.prototype,"icon",null),e([t()],g.prototype,"iconNumber",void 0),e([t()],g.prototype,"label",null),e([t(),c("esri/widgets/Expand/t9n/Expand")],g.prototype,"messages",void 0),e([t(),c("esri/t9n/common")],g.prototype,"messagesCommon",void 0),e([t()],g.prototype,"mode",void 0),e([t()],g.prototype,"placement",void 0),e([t()],g.prototype,"view",null),e([t({type:s})],g.prototype,"viewModel",void 0),g=e([o("esri.widgets.Expand")],g);const _=g;export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- let e;async function n(n){return e||await t(),e.parse(n)}async function t(){const{Marked:n}=await import("marked");e=new n({renderer:{del:e=>`<span style="text-decoration:line-through;">${e}</span>`,link:(e,n,t)=>`<a${null!=e?` href="${e}"`:""}${null!=n?` title="${n}"`:""} target="_blank">${t??""}</a>`}})}export{n as compileTextElementMarkdownToHTML};
5
+ let e;const t=["blockquote","html","hr","checkbox","table","tablerow","tablecell","image"];async function a(t){return e||await n(),e.parse(t)}async function n(){const{Marked:a}=await import("marked"),n=e=>`<span style="text-decoration:line-through;">${e}</span>`,l=(e,t,a)=>`<a${null!=e?` href="${e}"`:""}${null!=t?` title="${t}"`:""} target="_blank">${a??""}</a>`,r=()=>"",o={};for(const e of t)o[e]=r;e=new a({renderer:{del:n,link:l,...o}})}export{a as compileTextElementMarkdownToHTML};