@arcgis/core 4.25.0-next.20220708 → 4.25.0-next.20220711

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 (51) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/40d9c753be00b81d9e79.js +1 -0
  3. package/assets/esri/core/workers/chunks/{8cdeccb6b67098d6a8d7.js → 54b01d2a4aba08d7e16b.js} +1 -1
  4. package/assets/esri/core/workers/chunks/5db5afec37f69c4acaaf.js +1 -0
  5. package/assets/esri/core/workers/chunks/63922dadaa642a959164.js +1 -0
  6. package/assets/esri/core/workers/chunks/{35d46e4eeb43c256a63b.js → 8d6fb50fff035f21878b.js} +1 -1
  7. package/assets/esri/core/workers/chunks/937eed1e51055f730270.js +1 -0
  8. package/assets/esri/core/workers/chunks/9b802fcf571c91347da4.js +1 -0
  9. package/assets/esri/core/workers/chunks/b02a43cf767d8ee13313.js +1 -0
  10. package/assets/esri/core/workers/chunks/ba6c6957830b3f0c4ec8.js +1 -0
  11. package/assets/esri/core/workers/chunks/fc6423ca92289c739e19.js +1 -0
  12. package/interfaces.d.ts +8395 -6016
  13. package/layers/BaseElevationLayer.js +1 -1
  14. package/layers/BaseTileLayer.js +1 -1
  15. package/layers/support/ElevationQuery.js +1 -1
  16. package/layers/support/ExportImageServiceParameters.js +1 -1
  17. package/layers/support/Sublayer.js +1 -1
  18. package/layers/support/TileInfo.js +1 -1
  19. package/layers/support/TileKey.js +5 -0
  20. package/layers/support/TilemapCache.js +1 -1
  21. package/package.json +1 -1
  22. package/renderers/DotDensityRenderer.js +1 -1
  23. package/support/revision.js +1 -1
  24. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  25. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  26. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  27. package/views/3d/terrain/TerrainSurface.js +1 -1
  28. package/views/DOMContainer.js +1 -1
  29. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  30. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  31. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  32. package/views/interactive/snapping/snappingUtils.js +1 -1
  33. package/widgets/AreaMeasurement3D.js +1 -1
  34. package/widgets/Daylight.js +1 -1
  35. package/widgets/DirectLineMeasurement3D.js +1 -1
  36. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  37. package/widgets/ElevationProfile.js +1 -1
  38. package/widgets/Measurement.js +1 -1
  39. package/widgets/Popup.js +1 -1
  40. package/widgets/ShadowCast.js +1 -1
  41. package/widgets/Spinner.js +1 -1
  42. package/widgets/Weather.js +1 -1
  43. package/widgets/Widget.js +1 -1
  44. package/assets/esri/core/workers/chunks/009386ed70740f87a014.js +0 -1
  45. package/assets/esri/core/workers/chunks/1970d7a65832b70f7f5c.js +0 -1
  46. package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +0 -1
  47. package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +0 -1
  48. package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +0 -1
  49. package/assets/esri/core/workers/chunks/a9a459639c82c35ada1f.js +0 -1
  50. package/assets/esri/core/workers/chunks/beead2b06c994b4e61af.js +0 -1
  51. package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import{isSome as s,destroyMaybe as i,isNone as r,applySome as o,abortMaybe as n}from"../core/maybe.js";import{memoize as a}from"../core/memoize.js";import{createAbortError as l}from"../core/promiseUtils.js";import{watch as c,initial as h}from"../core/reactiveUtils.js";import{aliasOf as d}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import m from"./Widget.js";import{CSS as _}from"./ElevationProfile/css.js";import C from"./ElevationProfile/ElevationProfileViewModel.js";import v from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as g}from"./ElevationProfile/components/Legend.js";import{SettingsButton as f}from"./ElevationProfile/components/SettingsButton.js";import{createChart as y}from"./ElevationProfile/support/chartUtils.js";import{ElevationProfileErrorState as k,getConfig as w,ElevationProfileState as b}from"./ElevationProfile/support/constants.js";import{onResize as S}from"./support/widgetUtils.js";import{messageBundle as B}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";var P;!function(t){t.Sketch="sketch",t.SketchCancel="sketch-cancel",t.SketchDone="sketch-done",t.Select="select",t.SelectCancel="select-cancel"}(P||(P={}));const E=[{type:P.Select},{type:P.Sketch}],j={[k.None]:null,[k.NoValidInput]:"noProfile",[k.NoVisibleProfiles]:"noProfile",[k.RefinedButNoChartData]:"noProfile",[k.TooComplex]:"tooComplex",[k.UnknownError]:"unknown",[k.InvalidGeometry]:"invalidGeometry",[k.InvalidElevationInfo]:"invalidElevationInfo"};let z=class extends m{constructor(t,e){super(t,e),this.viewModel=null,this.view=null,this.input=null,this.profiles=null,this.unitOptions=[],this.unit="metric",this.geodesicDistanceThreshold=1e5,this.visibleElements=new v,this.iconClass=_.widgetIcon,this.label=void 0,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._width=0,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=a(((t,e,s,i)=>({chart:t,data:e,stationary:s,messages:i}))),this._getDetailsPropsMemoized=a(((t,e)=>({effectiveUnits:t,profiles:e}))),t?.viewModel||(this._defaultViewModel=new C({view:t?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._legend=new g(this._legendProps),this._settingsButton=new f(this._settingsButtonProps),this.addHandles([c((()=>this._legendProps),(t=>this._legend.set(t))),c((()=>this._settingsButtonProps),(t=>this._settingsButton.set(t)))])}postInitialize(){this.addHandles([c((()=>({container:this._chartContainer,width:this._width})),(({container:t,width:e})=>{this._destroyChart(),s(t)&&e>0&&this._initializeChart(t)}),h),c((()=>this._chartUpdateParams),(()=>this._updateChart(this._chartUpdateParams)),h)])}destroy(){this._destroyChart(),s(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy(),this._legend=i(this._legend),this._settingsButton=i(this._settingsButton)}get _portrait(){return this._width<w().portraitModePixelBreakpoint}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,!s(t)||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _legendProps(){return this._getDetailsPropsMemoized(this.viewModel.effectiveUnits,this._profilesArray)}get _profilesArray(){return this.profiles.toArray()}get _settingsButtonProps(){return{viewModel:this.viewModel,visibleElements:this.visibleElements}}render(){const{viewModel:t,visible:e}=this;return M("div",{key:this,class:this.classes({[_.base]:e,[_.esriWidget]:e,[_.esriWidgetDisabled]:e&&"disabled"===t.state,[_.portrait]:this._portrait,[_.refined]:1===t.progress}),"aria-label":this.messages.widgetLabel,afterCreate:t=>{this.addHandles(S(t,(t=>{this._width=t.contentRect.width})))}},e&&this._renderContentForState())}_renderContentForState(){switch(this.viewModel.state){case b.Ready:return this._renderContentForReadyState();case b.Selecting:return this._renderContentForSelectingState();case b.Creating:return this._renderContentForCreatingState();case b.Selected:return this._renderContentForSelectedState();case b.Created:return this._renderContentForCreatedState();case b.Disabled:return this._renderContentForReadyState()}}_renderContentForReadyState(){const{sketchButton:t,selectButton:e}=this.visibleElements,s=this.messages;let i;return i=t&&e?s.readyPrompt:t?s.readyPromptCreateOnly:e?s.readyPromptSelectOnly:s.errors?.noProfile,this._renderContent({prompt:i,chart:!1,actions:E})}_renderContentForSelectingState(){const t=this.view;if(r(t))return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:P.SelectCancel}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(r(t))return null;const s=e.hasVertices?[{type:P.SketchCancel},{type:P.SketchDone,disabled:!e.tool.interaction.canStopCreating}]:[{type:P.Select},{type:P.Sketch,disabled:!0}];if(e.errorState===k.NoValidInput){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:s,prompt:e})}const i=this._getErrorMessage();return i?this._renderContent({chart:!1,actions:s,prompt:i}):this._renderContent({chart:!0,actions:s})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:E,prompt:t}):this._renderContent({chart:!0,actions:E})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:E,prompt:t}):this._renderContent({chart:!0,actions:E})}_getErrorMessage(){const t=j[this.viewModel.errorState];return this.messages?.errors?.[t]}_renderContent(t){const e=s(t.prompt)?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),i=s(this.viewModel.input);return[M("header",{key:"header",class:_.header},this._zoomOutButtonVisible&&this._renderZoomOutButton(),this.visibleElements.clearButton&&i&&this._renderClearButton(),this.visibleElements.settingsButton&&this._settingsButton.render()),M("div",{class:_.mainContainer},e),this.visibleElements.legend&&this._legend.render(),this._renderActions(t)]}_renderZoomOutButton(){return M("button",{key:"zoom-out",class:_.zoomOutButton,bind:this,onclick:this._onZoomOutButtonClick,title:this.messages.zoomOut,type:"button"})}_onZoomOutButtonClick(){o(this._chart,(t=>t.zoomOut()))}_renderClearButton(){return M("button",{key:"clear-profile",class:_.clearButton,bind:this,onclick:this._onClearButtonClick,title:this.messages.clearProfile,type:"button"})}_onClearButtonClick(){this.viewModel.clear()}_renderPrompt(t){return[M("div",{key:"prompt-container",bind:this,class:_.promptContainer},M("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return[M("div",{key:"empty-chart-container",class:_.chartContainer})];const t=this._chartIsRefined||this._canRenderChart();if(!t)return[this._renderSpinner({size:"large"}),M("div",{key:"chart-container-empty",class:_.chartContainer})];const{chartData:e,progress:i}=this.viewModel;return[s(e)&&i>0&&i<1&&this._renderSpinner({size:t?"small":"large"}),M("div",{key:"chart-container",bind:this,class:_.chartContainer,afterCreate:this._onChartContainerAfterCreate,afterRemoved:this._onChartContainerRemoved})]}_renderSpinner(t){return M("div",{key:"spinner",class:this.classes(_.chartSpinner,{[_.chartSpinnerSmall]:"small"===t.size}),afterCreate:this._onSpinnerAfterCreate,exitAnimation:this._onSpinnerExit})}_onSpinnerAfterCreate(t){requestAnimationFrame((()=>t.classList.add(_.chartSpinnerVisible)))}_onSpinnerExit(t,e){t.classList.remove(_.chartSpinnerVisible),setTimeout(e,200)}_canRenderChart(){const t=this.viewModel.chartData;if(r(t))return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=s(i)?i.length:0;return t.refined||e<=w().largeChartSamples}_renderActions({actions:t}){const e=t.map((t=>{switch(t.type){case P.Sketch:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onSketchButtonClick,className:_.sketchButton,label:this.messages.sketchButtonLabel});case P.SketchCancel:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:_.sketchCancelButton,label:this.messagesCommon.cancel});case P.SketchDone:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:_.sketchDoneButton,label:this.messagesCommon.done});case P.Select:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:_.selectButton,label:this.messages.selectButtonLabel});case P.SelectCancel:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:_.selectCancelButton,label:this.messagesCommon.cancel})}})).filter(Boolean);return e.length?M("footer",{key:"footer",class:_.footer},e):null}_renderAction({action:t,onClick:e,className:s,label:i}){return M("button",{key:`action-${t.type}`,class:this.classes(_.actionButton,s,{[_.buttonDisabled]:t.disabled}),bind:this,disabled:t.disabled,onclick:e,type:"button"},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:o,stationary:n}=t;!r(i)&&!r(o)&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=s(e)&&e.refined)}_onChartContainerAfterCreate(t){this._chartContainer=t}_onChartContainerRemoved(){this._chartContainer=null}_initializeChart(t){n(this._chartInitTask),this._chartInitTask=e((async e=>{const s=await y({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw i(s),l();this._chart=s,this._updateChart(this._chartUpdateParams)}))}_destroyChart(){this._chartInitTask=n(this._chartInitTask),this._chart=i(this._chart),this._chartIsRefined=!1}get test(){return{projector:this._projector,chart:this._chart}}};t([p({type:C})],z.prototype,"viewModel",void 0),t([d("viewModel.view")],z.prototype,"view",void 0),t([d("viewModel.input")],z.prototype,"input",void 0),t([d("viewModel.profiles")],z.prototype,"profiles",void 0),t([d("viewModel.unitOptions")],z.prototype,"unitOptions",void 0),t([d("viewModel.unit")],z.prototype,"unit",void 0),t([d("viewModel.geodesicDistanceThreshold")],z.prototype,"geodesicDistanceThreshold",void 0),t([p({type:v,nonNullable:!0})],z.prototype,"visibleElements",void 0),t([p()],z.prototype,"iconClass",void 0),t([d("messages.widgetLabel",{overridable:!0})],z.prototype,"label",void 0),t([d("viewModel.visible")],z.prototype,"visible",void 0),t([p(),B("esri/widgets/ElevationProfile/t9n/ElevationProfile")],z.prototype,"messages",void 0),t([p(),B("esri/t9n/common")],z.prototype,"messagesCommon",void 0),t([p(),B("esri/core/t9n/Units")],z.prototype,"messagesUnits",void 0),t([p()],z.prototype,"_chartContainer",void 0),t([p()],z.prototype,"_chart",void 0),t([p()],z.prototype,"_chartInitTask",void 0),t([p()],z.prototype,"_chartIsRefined",void 0),t([p()],z.prototype,"_settingsButton",void 0),t([p()],z.prototype,"_legend",void 0),t([p()],z.prototype,"_width",void 0),t([p()],z.prototype,"_portrait",null),t([p()],z.prototype,"_zoomOutButtonVisible",void 0),t([p()],z.prototype,"_chartUpdateParams",null),t([p()],z.prototype,"_chartMessages",null),t([p()],z.prototype,"_legendProps",null),t([p()],z.prototype,"_profilesArray",null),t([p()],z.prototype,"_settingsButtonProps",null),z=t([u("esri.widgets.ElevationProfile")],z);const I=z;export{I as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import{isSome as s,destroyMaybe as i,isNone as r,applySome as o,abortMaybe as n}from"../core/maybe.js";import{memoize as a}from"../core/memoize.js";import{createAbortError as l}from"../core/promiseUtils.js";import{watch as h,initial as c}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import u from"./Widget.js";import{CSS as m}from"./ElevationProfile/css.js";import _ from"./ElevationProfile/ElevationProfileViewModel.js";import C from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as v}from"./ElevationProfile/components/Legend.js";import{SettingsButton as g}from"./ElevationProfile/components/SettingsButton.js";import{createChart as f}from"./ElevationProfile/support/chartUtils.js";import{ElevationProfileErrorState as y,getConfig as w,ElevationProfileState as b}from"./ElevationProfile/support/constants.js";import{onResize as k}from"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{tsx as B}from"./support/jsxFactory.js";var M;!function(t){t.Sketch="sketch",t.SketchCancel="sketch-cancel",t.SketchDone="sketch-done",t.Select="select",t.SelectCancel="select-cancel"}(M||(M={}));const P=[{type:M.Select},{type:M.Sketch}],E={[y.None]:null,[y.NoValidInput]:"noProfile",[y.NoVisibleProfiles]:"noProfile",[y.RefinedButNoChartData]:"noProfile",[y.TooComplex]:"tooComplex",[y.UnknownError]:"unknown",[y.InvalidGeometry]:"invalidGeometry",[y.InvalidElevationInfo]:"invalidElevationInfo"};let j=class extends u{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new C,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._width=0,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=a(((t,e,s,i)=>({chart:t,data:e,stationary:s,messages:i}))),this._getDetailsPropsMemoized=a(((t,e)=>({effectiveUnits:t,profiles:e}))),t?.viewModel||(this._defaultViewModel=new _({view:t?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._legend=new v(this._legendProps),this._settingsButton=new g(this._settingsButtonProps),this.addHandles([h((()=>this._legendProps),(t=>this._legend.set(t))),h((()=>this._settingsButtonProps),(t=>this._settingsButton.set(t)))])}postInitialize(){this.addHandles([h((()=>({container:this._chartContainer,width:this._width})),(({container:t,width:e})=>{this._destroyChart(),s(t)&&e>0&&this._initializeChart(t)}),c),h((()=>this._chartUpdateParams),(()=>this._updateChart(this._chartUpdateParams)),c)])}destroy(){this._destroyChart(),s(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy(),this._legend=i(this._legend),this._settingsButton=i(this._settingsButton)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get geodesicDistanceThreshold(){return this.viewModel.geodesicDistanceThreshold}set geodesicDistanceThreshold(t){this.viewModel.geodesicDistanceThreshold=t}get label(){return this._get("label")??this.messages?.widgetLabel}set label(t){this._set("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get _portrait(){return this._width<w().portraitModePixelBreakpoint}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,!s(t)||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _legendProps(){return this._getDetailsPropsMemoized(this.viewModel.effectiveUnits,this._profilesArray)}get _profilesArray(){return this.profiles.toArray()}get _settingsButtonProps(){return{viewModel:this.viewModel,visibleElements:this.visibleElements}}render(){const{viewModel:t,visible:e}=this;return B("div",{key:this,class:this.classes({[m.base]:e,[m.esriWidget]:e,[m.esriWidgetDisabled]:e&&"disabled"===t.state,[m.portrait]:this._portrait,[m.refined]:1===t.progress}),"aria-label":this.messages.widgetLabel,afterCreate:t=>{this.addHandles(k(t,(t=>{this._width=t.contentRect.width})))}},e&&this._renderContentForState())}_renderContentForState(){switch(this.viewModel.state){case b.Ready:return this._renderContentForReadyState();case b.Selecting:return this._renderContentForSelectingState();case b.Creating:return this._renderContentForCreatingState();case b.Selected:return this._renderContentForSelectedState();case b.Created:return this._renderContentForCreatedState();case b.Disabled:return this._renderContentForReadyState()}}_renderContentForReadyState(){const{sketchButton:t,selectButton:e}=this.visibleElements,s=this.messages;let i;return i=t&&e?s.readyPrompt:t?s.readyPromptCreateOnly:e?s.readyPromptSelectOnly:s.errors?.noProfile,this._renderContent({prompt:i,chart:!1,actions:P})}_renderContentForSelectingState(){const t=this.view;if(r(t))return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:M.SelectCancel}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(r(t))return null;const s=e.hasVertices?[{type:M.SketchCancel},{type:M.SketchDone,disabled:!e.tool.interaction.canStopCreating}]:[{type:M.Select},{type:M.Sketch,disabled:!0}];if(e.errorState===y.NoValidInput){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:s,prompt:e})}const i=this._getErrorMessage();return i?this._renderContent({chart:!1,actions:s,prompt:i}):this._renderContent({chart:!0,actions:s})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_getErrorMessage(){const t=E[this.viewModel.errorState];return this.messages?.errors?.[t]}_renderContent(t){const e=s(t.prompt)?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),i=s(this.viewModel.input);return[B("header",{key:"header",class:m.header},this._zoomOutButtonVisible&&this._renderZoomOutButton(),this.visibleElements.clearButton&&i&&this._renderClearButton(),this.visibleElements.settingsButton&&this._settingsButton.render()),B("div",{class:m.mainContainer},e),this.visibleElements.legend&&this._legend.render(),this._renderActions(t)]}_renderZoomOutButton(){return B("button",{key:"zoom-out",class:m.zoomOutButton,bind:this,onclick:this._onZoomOutButtonClick,title:this.messages.zoomOut,type:"button"})}_onZoomOutButtonClick(){o(this._chart,(t=>t.zoomOut()))}_renderClearButton(){return B("button",{key:"clear-profile",class:m.clearButton,bind:this,onclick:this._onClearButtonClick,title:this.messages.clearProfile,type:"button"})}_onClearButtonClick(){this.viewModel.clear()}_renderPrompt(t){return[B("div",{key:"prompt-container",bind:this,class:m.promptContainer},B("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return[B("div",{key:"empty-chart-container",class:m.chartContainer})];const t=this._chartIsRefined||this._canRenderChart();if(!t)return[this._renderSpinner({size:"large"}),B("div",{key:"chart-container-empty",class:m.chartContainer})];const{chartData:e,progress:i}=this.viewModel;return[s(e)&&i>0&&i<1&&this._renderSpinner({size:t?"small":"large"}),B("div",{key:"chart-container",bind:this,class:m.chartContainer,afterCreate:this._onChartContainerAfterCreate,afterRemoved:this._onChartContainerRemoved})]}_renderSpinner(t){return B("div",{key:"spinner",class:this.classes(m.chartSpinner,{[m.chartSpinnerSmall]:"small"===t.size}),afterCreate:this._onSpinnerAfterCreate,exitAnimation:this._onSpinnerExit})}_onSpinnerAfterCreate(t){requestAnimationFrame((()=>t.classList.add(m.chartSpinnerVisible)))}_onSpinnerExit(t,e){t.classList.remove(m.chartSpinnerVisible),setTimeout(e,200)}_canRenderChart(){const t=this.viewModel.chartData;if(r(t))return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=s(i)?i.length:0;return t.refined||e<=w().largeChartSamples}_renderActions({actions:t}){const e=t.map((t=>{switch(t.type){case M.Sketch:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onSketchButtonClick,className:m.sketchButton,label:this.messages.sketchButtonLabel});case M.SketchCancel:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.sketchCancelButton,label:this.messagesCommon.cancel});case M.SketchDone:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:m.sketchDoneButton,label:this.messagesCommon.done});case M.Select:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:m.selectButton,label:this.messages.selectButtonLabel});case M.SelectCancel:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.selectCancelButton,label:this.messagesCommon.cancel})}})).filter(Boolean);return e.length?B("footer",{key:"footer",class:m.footer},e):null}_renderAction({action:t,onClick:e,className:s,label:i}){return B("button",{key:`action-${t.type}`,class:this.classes(m.actionButton,s,{[m.buttonDisabled]:t.disabled}),bind:this,disabled:t.disabled,onclick:e,type:"button"},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:o,stationary:n}=t;!r(i)&&!r(o)&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=s(e)&&e.refined)}_onChartContainerAfterCreate(t){this._chartContainer=t}_onChartContainerRemoved(){this._chartContainer=null}_initializeChart(t){n(this._chartInitTask),this._chartInitTask=e((async e=>{const s=await f({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw i(s),l();this._chart=s,this._updateChart(this._chartUpdateParams)}))}_destroyChart(){this._chartInitTask=n(this._chartInitTask),this._chart=i(this._chart),this._chartIsRefined=!1}get test(){return{projector:this._projector,chart:this._chart}}};t([d({type:_})],j.prototype,"viewModel",void 0),t([d()],j.prototype,"view",null),t([d()],j.prototype,"input",null),t([d()],j.prototype,"profiles",null),t([d()],j.prototype,"unitOptions",null),t([d()],j.prototype,"unit",null),t([d()],j.prototype,"geodesicDistanceThreshold",null),t([d({type:C,nonNullable:!0})],j.prototype,"visibleElements",void 0),t([d()],j.prototype,"iconClass",void 0),t([d()],j.prototype,"label",null),t([d()],j.prototype,"visible",null),t([d(),S("esri/widgets/ElevationProfile/t9n/ElevationProfile")],j.prototype,"messages",void 0),t([d(),S("esri/t9n/common")],j.prototype,"messagesCommon",void 0),t([d(),S("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),t([d()],j.prototype,"_chartContainer",void 0),t([d()],j.prototype,"_chart",void 0),t([d()],j.prototype,"_chartInitTask",void 0),t([d()],j.prototype,"_chartIsRefined",void 0),t([d()],j.prototype,"_settingsButton",void 0),t([d()],j.prototype,"_legend",void 0),t([d()],j.prototype,"_width",void 0),t([d()],j.prototype,"_portrait",null),t([d()],j.prototype,"_zoomOutButtonVisible",void 0),t([d()],j.prototype,"_chartUpdateParams",null),t([d()],j.prototype,"_chartMessages",null),t([d()],j.prototype,"_legendProps",null),t([d()],j.prototype,"_profilesArray",null),t([d()],j.prototype,"_settingsButtonProps",null),j=t([p("esri.widgets.ElevationProfile")],j);const z=j;export{z 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../core/has.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{aliasOf as s}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import n from"./Measurement/MeasurementViewModel.js";import"./support/widgetUtils.js";import{messageBundle as d}from"./support/decorators/messageBundle.js";import{tsx as l}from"./support/jsxFactory.js";const c={base:"esri-measurement",widgetIcon:"esri-icon-measure"};function u(e){return e&&("esri.widgets.AreaMeasurement2D"===e.declaredClass||"esri.widgets.AreaMeasurement3D"===e.declaredClass)}let p=class extends a{constructor(e,t){super(e,t),this._widgets=new Map,this.activeTool=null,this.activeWidget=null,this.areaUnit=null,this.iconClass=c.widgetIcon,this.label=void 0,this.linearUnit=null,this.messages=null,this.view=null,this.viewModel=new n}initialize(){this.activeWidget&&this.viewModel.set("activeViewModel",this.activeWidget.viewModel),this.view&&this.activeTool&&this._getActiveWidget().then((e=>{this._set("activeWidget",e)})),this.addHandles([i((()=>[this.view,this.activeTool]),(async()=>{this._set("activeWidget",await this._getActiveWidget())})),i((()=>this.activeWidget),((e,t)=>{this.viewModel.set("activeViewModel",e?e.viewModel:null),t&&(t.visible=!1)})),i((()=>[this.areaUnit,this.linearUnit,this.uiStrings]),(()=>this._updateSubWidgetProperties()))])}destroy(){this._destroyWidgets()}render(){const{activeWidget:e}=this,t=e&&!e.destroyed?e.render():null;return l("div",{class:c.base},t)}clear(){this.activeTool=null,this._destroyWidgets()}startMeasurement(){const{activeViewModel:e}=this.viewModel;e&&t(e.start())}async _createWidget(e){const{areaUnit:t,linearUnit:i,view:s}=this;switch(e){case"area":{const{type:i}=s;switch(i){case"2d":return new(0,(await import("./AreaMeasurement2D.js")).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});case"3d":return new(0,(await import("./AreaMeasurement3D.js")).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});default:return null}}case"distance":return new(0,(await import("./DistanceMeasurement2D.js")).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)});case"direct-line":return new(0,(await import("./DirectLineMeasurement3D.js")).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)});default:return null}}_destroyWidgets(){this._widgets.forEach((e=>e.destroy())),this._widgets.clear()}async _getActiveWidget(){const{activeTool:e,view:t}=this;if(!t||!e)return null;let i=null;if(this._widgets.has(e))i=this._widgets.get(e),i.visible=!0;else{if(i=await this._createWidget(e),!i)return null;await i.viewModel.start(),this._widgets.set(e,i)}return i}_createUIStringsForWidget(e){if(!this.uiStrings)return null;const t=e+"-"+this.view.type;return this.uiStrings[t]}_updateSubWidgetProperties(){this._widgets.forEach(((e,t)=>{const{areaUnit:i,linearUnit:s}=this;e.unit=u(e)?i:s,e.uiStrings=this._createUIStringsForWidget(t)}))}};e([s("viewModel.activeTool")],p.prototype,"activeTool",void 0),e([r({readOnly:!0})],p.prototype,"activeWidget",void 0),e([s("viewModel.areaUnit")],p.prototype,"areaUnit",void 0),e([r()],p.prototype,"iconClass",void 0),e([r({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],p.prototype,"label",void 0),e([s("viewModel.linearUnit")],p.prototype,"linearUnit",void 0),e([r(),d("esri/widgets/Measurement/t9n/Measurement")],p.prototype,"messages",void 0),e([r()],p.prototype,"uiStrings",void 0),e([s("viewModel.view")],p.prototype,"view",void 0),e([r({type:n})],p.prototype,"viewModel",void 0),p=e([o("esri.widgets.Measurement")],p);const g=p;export{g as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{aliasOf as s}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import n from"./Measurement/MeasurementViewModel.js";import"./support/widgetUtils.js";import{messageBundle as d}from"./support/decorators/messageBundle.js";import{tsx as l}from"./support/jsxFactory.js";const c={base:"esri-measurement",widgetIcon:"esri-icon-measure"};function u(e){return e&&("esri.widgets.AreaMeasurement2D"===e.declaredClass||"esri.widgets.AreaMeasurement3D"===e.declaredClass)}let p=class extends a{constructor(e,t){super(e,t),this._widgets=new Map,this.activeTool=null,this.activeWidget=null,this.areaUnit=null,this.iconClass=c.widgetIcon,this.label=void 0,this.linearUnit=null,this.messages=null,this.view=null,this.viewModel=new n}initialize(){this.activeWidget&&this.viewModel.set("activeViewModel",this.activeWidget.viewModel),this.view&&this.activeTool&&this._getActiveWidget().then((e=>{this._set("activeWidget",e)})),this.addHandles([i((()=>[this.view,this.activeTool]),(async()=>{this._set("activeWidget",await this._getActiveWidget())})),i((()=>this.activeWidget),((e,t)=>{this.viewModel.set("activeViewModel",e?e.viewModel:null),t&&(t.visible=!1)})),i((()=>[this.areaUnit,this.linearUnit,this.uiStrings]),(()=>this._updateSubWidgetProperties()))])}destroy(){this._destroyWidgets()}render(){const{activeWidget:e}=this,t=e&&!e.destroyed?e.render():null;return l("div",{class:c.base},t)}clear(){this.activeTool=null,this._destroyWidgets()}startMeasurement(){const{activeViewModel:e}=this.viewModel;e&&t(e.start())}async _createWidget(e){const{areaUnit:t,linearUnit:i,view:s}=this;switch(e){case"area":{const{type:i}=s;switch(i){case"2d":return new(0,(await import("./AreaMeasurement2D.js")).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});case"3d":return new(0,(await import("./AreaMeasurement3D.js")).default)({view:s,unit:t,uiStrings:this._createUIStringsForWidget(e)});default:return null}}case"distance":{const{type:t}=s;if("2d"===t){return new(0,(await import("./DistanceMeasurement2D.js")).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)})}return null}case"direct-line":{const{type:t}=s;if("3d"===t){return new(0,(await import("./DirectLineMeasurement3D.js")).default)({view:s,unit:i,uiStrings:this._createUIStringsForWidget(e)})}return null}default:return null}}_destroyWidgets(){this._widgets.forEach((e=>e.destroy())),this._widgets.clear()}async _getActiveWidget(){const{activeTool:e,view:t}=this;if(!t||!e)return null;let i=null;if(this._widgets.has(e))i=this._widgets.get(e),i.visible=!0;else{if(i=await this._createWidget(e),!i)return null;await i.viewModel.start(),this._widgets.set(e,i)}return i}_createUIStringsForWidget(e){if(!this.uiStrings)return null;const t=e+"-"+this.view.type;return this.uiStrings[t]}_updateSubWidgetProperties(){this._widgets.forEach(((e,t)=>{const{areaUnit:i,linearUnit:s}=this;e.unit=u(e)?i:s,e.uiStrings=this._createUIStringsForWidget(t)}))}};e([s("viewModel.activeTool")],p.prototype,"activeTool",void 0),e([r({readOnly:!0})],p.prototype,"activeWidget",void 0),e([s("viewModel.areaUnit")],p.prototype,"areaUnit",void 0),e([r()],p.prototype,"iconClass",void 0),e([r({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],p.prototype,"label",void 0),e([s("viewModel.linearUnit")],p.prototype,"linearUnit",void 0),e([r(),d("esri/widgets/Measurement/t9n/Measurement")],p.prototype,"messages",void 0),e([r()],p.prototype,"uiStrings",void 0),e([s("viewModel.view")],p.prototype,"view",void 0),e([r({type:n})],p.prototype,"viewModel",void 0),p=e([o("esri.widgets.Measurement")],p);const g=p;export{g as default};
package/widgets/Popup.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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Handles.js";import n from"../core/Logger.js";import{isNone as s}from"../core/maybe.js";import{watch as r,when as a,on as l,whenOnce as u,initial as c}from"../core/reactiveUtils.js";import{throttle as d}from"../core/throttle.js";import{aliasOf as p}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import f from"./Feature.js";import v from"./Spinner.js";import m from"./Widget.js";import{FeatureContentMixin as b}from"./Feature/support/FeatureContentMixin.js";import M from"./Popup/PopupViewModel.js";import{Heading as w}from"./support/Heading.js";import{accessibleHandler as y}from"./support/decorators/accessibleHandler.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{vmEvent as A}from"./support/decorators/vmEvent.js";import{tsx as C}from"./support/jsxFactory.js";import{isRTL as F,storeNode as I,cssTransition as O}from"./support/widgetUtils.js";import{substitute as x}from"../intl/substitute.js";const N="selected-index",T=0,B="popup-spinner",D={iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:"esri-popup",widget:"esri-widget",main:"esri-popup__main-container",loadingContainer:"esri-popup__loading-container",isCollapsible:"esri-popup--is-collapsible",isCollapsed:"esri-popup--is-collapsed",shadow:"esri-popup--shadow",isDocked:"esri-popup--is-docked",isDockedTopLeft:"esri-popup--is-docked-top-left",isDockedTopCenter:"esri-popup--is-docked-top-center",isDockedTopRight:"esri-popup--is-docked-top-right",isDockedBottomLeft:"esri-popup--is-docked-bottom-left",isDockedBottomCenter:"esri-popup--is-docked-bottom-center",isDockedBottomRight:"esri-popup--is-docked-bottom-right",alignTopCenter:"esri-popup--aligned-top-center",alignBottomCenter:"esri-popup--aligned-bottom-center",alignTopLeft:"esri-popup--aligned-top-left",alignBottomLeft:"esri-popup--aligned-bottom-left",alignTopRight:"esri-popup--aligned-top-right",alignBottomRight:"esri-popup--aligned-bottom-right",isFeatureMenuOpen:"esri-popup--feature-menu-open",isActionsMenuOpen:"esri-popup--actions-menu-open",hasFeatureUpdated:"esri-popup--feature-updated",header:"esri-popup__header",headerButtons:"esri-popup__header-buttons",headerContainer:"esri-popup__header-container",headerContainerButton:"esri-popup__header-container--button",headerTitle:"esri-popup__header-title",content:"esri-popup__content",footer:"esri-popup__footer",footerHasPagination:"esri-popup__footer--has-pagination",footerHasActions:"esri-popup__footer--has-actions",footerHasActionsMenu:"esri-popup__footer--has-actions-menu",button:"esri-popup__button",buttonDisabled:"esri-popup__button--disabled",buttonDock:"esri-popup__button--dock",icon:"esri-popup__icon",iconDock:"esri-popup__icon--dock-icon",inlineActionsContainer:"esri-popup__inline-actions-container",actionsMenuButton:"esri-popup__actions-menu-button",actions:"esri-popup__actions",action:"esri-popup__action",actionImage:"esri-popup__action-image",actionText:"esri-popup__action-text",actionToggle:"esri-popup__action-toggle",actionToggleOn:"esri-popup__action-toggle--on",pointer:"esri-popup__pointer",pointerDirection:"esri-popup__pointer-direction",navigation:"esri-popup__navigation",paginationPrevious:"esri-popup__pagination-previous",paginationNext:"esri-popup__pagination-next",paginationPreviousIconLTR:"esri-popup__pagination-previous-icon",paginationPreviousIconRTL:"esri-popup__pagination-previous-icon--rtl",paginationNextIconLTR:"esri-popup__pagination-next-icon",paginationNextIconRTL:"esri-popup__pagination-next-icon--rtl",featureMenu:"esri-popup__feature-menu",featureMenuList:"esri-popup__feature-menu-list",featureMenuItem:"esri-popup__feature-menu-item",featureMenuViewport:"esri-popup__feature-menu-viewport",featureMenuHeader:"esri-popup__feature-menu-header",featureMenuNote:"esri-popup__feature-menu-note",featureMenuSelected:"esri-popup__feature-menu-item--selected",featureMenuButton:"esri-popup__feature-menu-button",featureMenuTitle:"esri-popup__feature-menu-title",featureMenuObserver:"esri-popup__feature-menu-observer",featureMenuLoader:"esri-popup__feature-menu-loader",collapseButton:"esri-popup__collapse-button"},E={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},P="esri-popup";function L(e,t){return void 0===t?`${P}__${e}`:`${P}__${e}-${t}`}const S={closeButton:!0,featureNavigation:!0};let V=class extends(b(m)){constructor(e,t){super(e,t),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new o,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=d((()=>this._displaySpinner()),T),this.actions=null,this.alignment="auto",this.autoCloseEnabled=null,this.autoOpenEnabled=null,this.defaultPopupTemplateEnabled=null,this.content=null,this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureCount=null,this.featureMenuOpen=!1,this.features=null,this.goToOverride=null,this.headingLevel=2,this.highlightEnabled=null,this.location=null,this.label=void 0,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.promises=null,this.selectedFeature=null,this.selectedFeatureIndex=null,this.spinnerEnabled=!0,this.title=null,this.updateLocationEnabled=null,this.view=null,this.viewModel=new M,this.visible=null,this.visibleElements={...S},this._addSelectedFeatureIndexHandle(),this.addHandles([r((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),r((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),r((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),r((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),r((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e,t))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),r((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),a((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),l((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),r((()=>this.viewModel?.allActions),(()=>this._watchActions()),c),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop()))])}destroy(){this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._handles=null}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){return!!(this.selectedFeatureWidget?this.selectedFeatureWidget?.viewModel?.waitingForContent||"error"===this.selectedFeatureWidget?.viewModel?.state||this.selectedFeatureWidget?.viewModel?.content:this.viewModel?.content)}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||E}set dockOptions(e){const t={...E},i=this.get("viewModel.view.breakpoints"),o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;!0===r?n.breakpoint=s:"object"==typeof r&&(n.breakpoint={...s,...r}),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i}=this,{selectedFeatureViewModel:o}=this.viewModel,n={...t,title:!1};return o?(e?(e.viewModel=o,e.visibleElements=n):this._feature=new f({headingLevel:i+1,viewModel:o,visibleElements:n}),this._feature):null}castVisibleElements(e){return{...S,...e}}blur(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(N);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:a}=o,l=r&&a.length>1&&e,u=r&&t,c=r&&!t,d=this.selectedFeature?.layer?.title,p=this.selectedFeature?.layer?.id,h={[D.alignTopCenter]:"top-center"===n,[D.alignBottomCenter]:"bottom-center"===n,[D.alignTopLeft]:"top-left"===n,[D.alignBottomLeft]:"bottom-left"===n,[D.alignTopRight]:"top-right"===n,[D.alignBottomRight]:"bottom-right"===n,[D.isDocked]:u,[D.shadow]:c,[D.isDockedTopLeft]:"top-left"===s,[D.isDockedTopCenter]:"top-center"===s,[D.isDockedTopRight]:"top-right"===s,[D.isDockedBottomLeft]:"bottom-left"===s,[D.isDockedBottomCenter]:"bottom-center"===s,[D.isDockedBottomRight]:"bottom-right"===s,[D.isFeatureMenuOpen]:i,[D.isActionsMenuOpen]:l};return C("div",{class:this.classes(D.base,h),role:"presentation","data-layer-title":d,"data-layer-id":p,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return C("span",{"aria-hidden":"true",class:this.classes(D.icon,D.iconLoading,D.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?C("div",{key:L("loading-container"),role:"presentation",class:D.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=F(this.container),t={[D.iconRightTriangleArrow]:e,[D.paginationPreviousIconRTL]:e,[D.iconLeftTriangleArrow]:!e,[D.paginationPreviousIconLTR]:!e};return C("span",{"aria-hidden":"true",class:this.classes(D.icon,t)})}renderPreviousButton(){const{messages:e}=this;return C("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(D.button,D.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=F(this.container),t={[D.iconLeftTriangleArrow]:e,[D.paginationNextIconRTL]:e,[D.iconRightTriangleArrow]:!e,[D.paginationNextIconLTR]:!e};return C("span",{"aria-hidden":"true",class:this.classes(D.icon,t)})}renderNextButton(){const{messages:e}=this;return C("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(D.button,D.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return C("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(D.button,D.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:null}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[D.iconUndock]:e,[D.iconDock]:!e,[D.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[D.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[D.iconDockToTop]:!e&&"top-center"===t,[D.iconDockToBottom]:!e&&"bottom-center"===t};return C("span",{"aria-hidden":"true",class:this.classes(i,D.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?C("div",{role:"button","aria-label":o,title:o,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(D.button,D.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[D.headerContainerButton]:i},r=C(w,{level:this.headingLevel,class:D.headerTitle,innerHTML:e}),a=i?C("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(D.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r):C("div",{key:e,id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(D.headerContainer,s)},r);return e?a:null}renderCloseIcon(){return C("span",{"aria-hidden":"true",class:this.classes(D.icon,D.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?C("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:D.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return C("header",{class:D.header},this.renderTitle(),C("div",{class:D.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i}=this,{content:o}=this.viewModel;return t&&!i?C("article",{key:o,enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:D.content},this.renderContent()):null}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?C("div",{key:L("actions-menu-button"),class:this.classes(D.button,D.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":s,title:s},C("span",{"aria-hidden":"true",class:D.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?C("ul",{id:e,role:"menu","aria-labelledby":t,key:L("actions"),class:D.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return!!e.length&&e.toArray().map((e=>this.renderAction({action:e,type:"inline"})))}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?C("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:D.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?C("section",{key:L("navigation"),class:this.classes(D.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[D.footerHasPagination]:e,[D.footerHasActions]:n,[D.footerHasActionsMenu]:s};return e||n?C("div",{key:L("feature-buttons"),class:this.classes(D.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=x(e.selectedFeatures,{total:t.length});return C("section",{key:L("menu"),class:D.featureMenu},C("strong",{class:D.featureMenuHeader},o),C("nav",{bind:this,class:D.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:I},this.renderFeatureMenu(),C("div",{class:D.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?C("div",{class:D.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:C("div",{key:L("pointer"),class:D.pointer,role:"presentation"},C("div",{class:this.classes(D.pointerDirection,D.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:a,visibleElements:l}=this,{title:u}=this.viewModel,c="bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===i||"top-center"===i||"top-right"===i,d="top-left"===t||"top-center"===t||"top-right"===t||"bottom-left"===i||"bottom-center"===i||"bottom-right"===i,p={[D.shadow]:e,[D.isCollapsible]:s,[D.isCollapsed]:a};return C("div",{class:this.classes(D.main,D.widget,p),tabIndex:l.closeButton?null:-1,role:"dialog","aria-labelledby":u?o:"","aria-describedby":r&&!a?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},c?this.renderFooter():null,c?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?C("div",{key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return C("span",{key:"text",class:D.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[D.iconLoading]:e.active,[D.rotating]:e.active,[D.icon]:!!t,[D.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),C("span",{key:"icon","aria-hidden":"true",class:this.classes(D.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[D.action]:"toggle"!==t.type,[D.actionToggle]:"toggle"===t.type,[D.actionToggleOn]:"toggle"===t.type&&t.value,[D.buttonDisabled]:t.disabled},s=[this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?C("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(D.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):C("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(D.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,a={[D.featureMenuSelected]:r},l=r?C("span",{key:L(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:D.iconCheckMark}):null,u=C("span",{innerHTML:e.title||o.untitled});return C("li",{role:"menuitem",tabIndex:-1,key:L(`feature-menu-feature-${n}`),class:this.classes(a,D.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},C("span",{class:D.featureMenuTitle},u,l))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?C("ol",{class:D.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter((e=>!!e.graphic)).map(((e,t)=>this.renderFeatureMenuItem(e,t)))):null}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r="zoom-to-feature"===n?x(e.title,{messages:t}):"remove-selected-feature"===n?x(e.title,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?x(e.title,{messages:t}):e.title;return r&&s?x(r,s):r}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:D.iconDefaultAction;return s&&i?x(s,i):s}_getActionImage(e){const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?x(o,i):o}_createFeatureUpdatedAnimation(){return O("enter",D.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if("number"!=typeof e)return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach((e=>{this._handles.add(r((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=i(e),{_featureMenuNode:o}=this,n=e.currentTarget["data-feature-index"];if(!o)return;const s=o.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=i(e),{_actionsMenuNode:o}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!o)return;const a=o.querySelectorAll("li"),l=a.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();a[a.length-1].focus()}else{e.stopPropagation();a[0].focus()}else{e.stopPropagation();a[(r+1+l)%l].focus()}else{e.stopPropagation();a[(r-1+l)%l].focus()}}_handleMainKeyup(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e.shouldFocus&&(await u((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,N)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this.actionsMenuOpen=!1,this.featureMenuOpen=!1)}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:r,view:a}=n;if(s(r)||!a||!i)return"top-center";if(!this._isScreenLocationWithinView(r,a))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replace(/[^-\d\.]/g,""),10)}const u=o?window.getComputedStyle(o,null):null,c=u?l(u.getPropertyValue("max-height")):0,d=u?l(u.getPropertyValue("height")):0,{height:p,width:h}=i.getBoundingClientRect(),g=h+t,_=Math.max(p,c,d)+t,f=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"right",view:a}),v=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"left",view:a}),m=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"top",view:a}),b=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"bottom",view:a});return v?m?"bottom-right":"top-right":f?m?"bottom-left":"top-left":m?b?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return"function"==typeof e?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return F(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=F(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!e)return;const{screenLocation:t}=this.viewModel,{width:i}=e.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&(e.style.top=o.top,e.style.left=o.left,e.style.bottom=o.bottom,e.style.right=o.right)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return"top-left"===t||"bottom-left"===t||"top-right"===t||"bottom-right"===t?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this,r=o/2,a=i.height-t,l=i.width-e,{padding:u}=this.view;return"bottom-center"===n?{top:t+s-u.top,left:e-r-u.left}:"top-left"===n?{bottom:a+s-u.bottom,right:l+s-u.right}:"bottom-left"===n?{top:t+s-u.top,right:l+s-u.right}:"top-right"===n?{bottom:a+s-u.bottom,left:e+s-u.left}:"bottom-right"===n?{top:t+s-u.top,left:e+s-u.left}:"top-center"===n?{bottom:a+s-u.bottom,left:e-r-u.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(s(e)||!t)return;const n=this._calculateFullWidth(t),r=this._calculateAlignmentPosition(e.x,e.y,o,n);return r?{top:void 0!==r.top?`${r.top}px`:"auto",left:void 0!==r.left?`${r.left}px`:"auto",bottom:void 0!==r.bottom?`${r.bottom}px`:"auto",right:void 0!==r.right?`${r.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const e=this.get("viewModel.view");this._wireUpView(e)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,r]=t,{width:a,height:l}=i;return o<=a&&s>a||o>a&&s<=a||n<=l&&r>l||n>l&&r<=l}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:a}=this,l=a.breakpoint;this._dockingThresholdCrossed(s,r,l)&&this._setDockEnabledForViewSize(a),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;const s=t.hasOwnProperty("width")&&o<=t.width,r=t.hasOwnProperty("height")&&n<=t.height;return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?x(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(this._spinner,B),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new v({view:e}),e.ui.add(this._spinner,{key:B,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};e([g({readOnly:!0})],V.prototype,"actionsMenuId",null),e([g({readOnly:!0})],V.prototype,"actionsMenuButtonId",null),e([g({readOnly:!0})],V.prototype,"featureMenuId",null),e([g({readOnly:!0})],V.prototype,"titleId",null),e([g({readOnly:!0})],V.prototype,"contentId",null),e([g({readOnly:!0})],V.prototype,"hasContent",null),e([g({readOnly:!0})],V.prototype,"featureNavigationVisible",null),e([g({readOnly:!0})],V.prototype,"collapsible",null),e([g({readOnly:!0})],V.prototype,"featureMenuVisible",null),e([g({readOnly:!0})],V.prototype,"contentCollapsed",null),e([g({readOnly:!0})],V.prototype,"dividedActions",null),e([p("viewModel.actions")],V.prototype,"actions",void 0),e([g()],V.prototype,"actionsMenuOpen",null),e([g()],V.prototype,"alignment",void 0),e([p("viewModel.autoCloseEnabled")],V.prototype,"autoCloseEnabled",void 0),e([p("viewModel.autoOpenEnabled")],V.prototype,"autoOpenEnabled",void 0),e([p("viewModel.defaultPopupTemplateEnabled")],V.prototype,"defaultPopupTemplateEnabled",void 0),e([p("viewModel.content")],V.prototype,"content",void 0),e([g()],V.prototype,"collapsed",void 0),e([g()],V.prototype,"collapseEnabled",void 0),e([g({readOnly:!0})],V.prototype,"currentAlignment",null),e([g({readOnly:!0})],V.prototype,"currentDockPosition",null),e([g()],V.prototype,"dockOptions",null),e([g()],V.prototype,"dockEnabled",void 0),e([p("viewModel.featureCount")],V.prototype,"featureCount",void 0),e([g()],V.prototype,"featureMenuOpen",void 0),e([p("viewModel.features")],V.prototype,"features",void 0),e([p("viewModel.goToOverride")],V.prototype,"goToOverride",void 0),e([g()],V.prototype,"headingLevel",void 0),e([p("viewModel.highlightEnabled")],V.prototype,"highlightEnabled",void 0),e([p("viewModel.location")],V.prototype,"location",void 0),e([g({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],V.prototype,"label",void 0),e([g()],V.prototype,"maxInlineActions",void 0),e([g(),k("esri/widgets/Popup/t9n/Popup")],V.prototype,"messages",void 0),e([g(),k("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([p("viewModel.promises")],V.prototype,"promises",void 0),e([p("viewModel.selectedFeature")],V.prototype,"selectedFeature",void 0),e([p("viewModel.selectedFeatureIndex")],V.prototype,"selectedFeatureIndex",void 0),e([g({readOnly:!0})],V.prototype,"selectedFeatureWidget",null),e([g()],V.prototype,"spinnerEnabled",void 0),e([p("viewModel.title")],V.prototype,"title",void 0),e([p("viewModel.updateLocationEnabled")],V.prototype,"updateLocationEnabled",void 0),e([p("viewModel.view")],V.prototype,"view",void 0),e([g({type:M}),A(["triggerAction","trigger-action"])],V.prototype,"viewModel",void 0),e([p("viewModel.visible")],V.prototype,"visible",void 0),e([g()],V.prototype,"visibleElements",void 0),e([h("visibleElements")],V.prototype,"castVisibleElements",null),e([y()],V.prototype,"_close",null),e([y()],V.prototype,"_toggleDockEnabled",null),e([y()],V.prototype,"_toggleFeatureMenu",null),e([y()],V.prototype,"_toggleActionsMenu",null),e([y()],V.prototype,"_triggerAction",null),e([y()],V.prototype,"_selectFeature",null),e([y()],V.prototype,"_next",null),e([y()],V.prototype,"_previous",null),V=e([_("esri.widgets.Popup")],V);const U=V;export{U as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Handles.js";import n from"../core/Logger.js";import{isNone as s}from"../core/maybe.js";import{watch as r,when as a,on as l,whenOnce as u,initial as c}from"../core/reactiveUtils.js";import{throttle as d}from"../core/throttle.js";import{aliasOf as p}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import{property as g}from"../core/accessorSupport/decorators/property.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import f from"./Feature.js";import v from"./Spinner.js";import m from"./Widget.js";import{FeatureContentMixin as b}from"./Feature/support/FeatureContentMixin.js";import M from"./Popup/PopupViewModel.js";import{Heading as w}from"./support/Heading.js";import{accessibleHandler as y}from"./support/decorators/accessibleHandler.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{vmEvent as A}from"./support/decorators/vmEvent.js";import{tsx as C}from"./support/jsxFactory.js";import{isRTL as F,storeNode as I,cssTransition as O}from"./support/widgetUtils.js";import{substitute as x}from"../intl/substitute.js";const N="selected-index",T=0,B="popup-spinner",D={iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:"esri-popup",widget:"esri-widget",main:"esri-popup__main-container",loadingContainer:"esri-popup__loading-container",isCollapsible:"esri-popup--is-collapsible",isCollapsed:"esri-popup--is-collapsed",shadow:"esri-popup--shadow",isDocked:"esri-popup--is-docked",isDockedTopLeft:"esri-popup--is-docked-top-left",isDockedTopCenter:"esri-popup--is-docked-top-center",isDockedTopRight:"esri-popup--is-docked-top-right",isDockedBottomLeft:"esri-popup--is-docked-bottom-left",isDockedBottomCenter:"esri-popup--is-docked-bottom-center",isDockedBottomRight:"esri-popup--is-docked-bottom-right",alignTopCenter:"esri-popup--aligned-top-center",alignBottomCenter:"esri-popup--aligned-bottom-center",alignTopLeft:"esri-popup--aligned-top-left",alignBottomLeft:"esri-popup--aligned-bottom-left",alignTopRight:"esri-popup--aligned-top-right",alignBottomRight:"esri-popup--aligned-bottom-right",isFeatureMenuOpen:"esri-popup--feature-menu-open",isActionsMenuOpen:"esri-popup--actions-menu-open",hasFeatureUpdated:"esri-popup--feature-updated",header:"esri-popup__header",headerButtons:"esri-popup__header-buttons",headerContainer:"esri-popup__header-container",headerContainerButton:"esri-popup__header-container--button",headerTitle:"esri-popup__header-title",content:"esri-popup__content",footer:"esri-popup__footer",footerHasPagination:"esri-popup__footer--has-pagination",footerHasActions:"esri-popup__footer--has-actions",footerHasActionsMenu:"esri-popup__footer--has-actions-menu",button:"esri-popup__button",buttonDisabled:"esri-popup__button--disabled",buttonDock:"esri-popup__button--dock",icon:"esri-popup__icon",iconDock:"esri-popup__icon--dock-icon",inlineActionsContainer:"esri-popup__inline-actions-container",actionsMenuButton:"esri-popup__actions-menu-button",actions:"esri-popup__actions",action:"esri-popup__action",actionImage:"esri-popup__action-image",actionText:"esri-popup__action-text",actionToggle:"esri-popup__action-toggle",actionToggleOn:"esri-popup__action-toggle--on",pointer:"esri-popup__pointer",pointerDirection:"esri-popup__pointer-direction",navigation:"esri-popup__navigation",paginationPrevious:"esri-popup__pagination-previous",paginationNext:"esri-popup__pagination-next",paginationPreviousIconLTR:"esri-popup__pagination-previous-icon",paginationPreviousIconRTL:"esri-popup__pagination-previous-icon--rtl",paginationNextIconLTR:"esri-popup__pagination-next-icon",paginationNextIconRTL:"esri-popup__pagination-next-icon--rtl",featureMenu:"esri-popup__feature-menu",featureMenuList:"esri-popup__feature-menu-list",featureMenuItem:"esri-popup__feature-menu-item",featureMenuViewport:"esri-popup__feature-menu-viewport",featureMenuHeader:"esri-popup__feature-menu-header",featureMenuNote:"esri-popup__feature-menu-note",featureMenuSelected:"esri-popup__feature-menu-item--selected",featureMenuButton:"esri-popup__feature-menu-button",featureMenuTitle:"esri-popup__feature-menu-title",featureMenuObserver:"esri-popup__feature-menu-observer",featureMenuLoader:"esri-popup__feature-menu-loader",collapseButton:"esri-popup__collapse-button"},E={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},P="esri-popup";function L(e,t){return void 0===t?`${P}__${e}`:`${P}__${e}-${t}`}const S={closeButton:!0,featureNavigation:!0};let V=class extends(b(m)){constructor(e,t){super(e,t),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new o,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=d((()=>this._displaySpinner()),T),this.actions=null,this.alignment="auto",this.autoCloseEnabled=null,this.autoOpenEnabled=null,this.defaultPopupTemplateEnabled=null,this.content=null,this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureCount=null,this.featureMenuOpen=!1,this.features=null,this.goToOverride=null,this.headingLevel=2,this.highlightEnabled=null,this.location=null,this.label=void 0,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.promises=null,this.selectedFeature=null,this.selectedFeatureIndex=null,this.spinnerEnabled=!0,this.title=null,this.updateLocationEnabled=null,this.view=null,this.viewModel=new M,this.visibleElements={...S},this._addSelectedFeatureIndexHandle(),this.addHandles([r((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),r((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),r((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),r((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),r((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e,t))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),r((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),a((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),l((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),r((()=>this.viewModel?.allActions),(()=>this._watchActions()),c),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop()))])}destroy(){this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._handles=null}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){return!!(this.selectedFeatureWidget?this.selectedFeatureWidget?.viewModel?.waitingForContent||"error"===this.selectedFeatureWidget?.viewModel?.state||this.selectedFeatureWidget?.viewModel?.content:this.viewModel?.content)}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||E}set dockOptions(e){const t={...E},i=this.get("viewModel.view.breakpoints"),o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;!0===r?n.breakpoint=s:"object"==typeof r&&(n.breakpoint={...s,...r}),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i}=this,{selectedFeatureViewModel:o}=this.viewModel,n={...t,title:!1};return o?(e?(e.viewModel=o,e.visibleElements=n):this._feature=new f({headingLevel:i+1,viewModel:o,visibleElements:n}),this._feature):null}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...S,...e}}blur(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(N);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:a}=o,l=r&&a.length>1&&e,u=r&&t,c=r&&!t,d=this.selectedFeature?.layer?.title,p=this.selectedFeature?.layer?.id,h={[D.alignTopCenter]:"top-center"===n,[D.alignBottomCenter]:"bottom-center"===n,[D.alignTopLeft]:"top-left"===n,[D.alignBottomLeft]:"bottom-left"===n,[D.alignTopRight]:"top-right"===n,[D.alignBottomRight]:"bottom-right"===n,[D.isDocked]:u,[D.shadow]:c,[D.isDockedTopLeft]:"top-left"===s,[D.isDockedTopCenter]:"top-center"===s,[D.isDockedTopRight]:"top-right"===s,[D.isDockedBottomLeft]:"bottom-left"===s,[D.isDockedBottomCenter]:"bottom-center"===s,[D.isDockedBottomRight]:"bottom-right"===s,[D.isFeatureMenuOpen]:i,[D.isActionsMenuOpen]:l};return C("div",{class:this.classes(D.base,h),role:"presentation","data-layer-title":d,"data-layer-id":p,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return C("span",{"aria-hidden":"true",class:this.classes(D.icon,D.iconLoading,D.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?C("div",{key:L("loading-container"),role:"presentation",class:D.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=F(this.container),t={[D.iconRightTriangleArrow]:e,[D.paginationPreviousIconRTL]:e,[D.iconLeftTriangleArrow]:!e,[D.paginationPreviousIconLTR]:!e};return C("span",{"aria-hidden":"true",class:this.classes(D.icon,t)})}renderPreviousButton(){const{messages:e}=this;return C("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(D.button,D.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=F(this.container),t={[D.iconLeftTriangleArrow]:e,[D.paginationNextIconRTL]:e,[D.iconRightTriangleArrow]:!e,[D.paginationNextIconLTR]:!e};return C("span",{"aria-hidden":"true",class:this.classes(D.icon,t)})}renderNextButton(){const{messages:e}=this;return C("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(D.button,D.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return C("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(D.button,D.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:null}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[D.iconUndock]:e,[D.iconDock]:!e,[D.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[D.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[D.iconDockToTop]:!e&&"top-center"===t,[D.iconDockToBottom]:!e&&"bottom-center"===t};return C("span",{"aria-hidden":"true",class:this.classes(i,D.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?C("div",{role:"button","aria-label":o,title:o,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(D.button,D.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[D.headerContainerButton]:i},r=C(w,{level:this.headingLevel,class:D.headerTitle,innerHTML:e}),a=i?C("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(D.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r):C("div",{key:e,id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(D.headerContainer,s)},r);return e?a:null}renderCloseIcon(){return C("span",{"aria-hidden":"true",class:this.classes(D.icon,D.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?C("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:D.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return C("header",{class:D.header},this.renderTitle(),C("div",{class:D.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i}=this,{content:o}=this.viewModel;return t&&!i?C("article",{key:o,enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:D.content},this.renderContent()):null}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?C("div",{key:L("actions-menu-button"),class:this.classes(D.button,D.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":s,title:s},C("span",{"aria-hidden":"true",class:D.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?C("ul",{id:e,role:"menu","aria-labelledby":t,key:L("actions"),class:D.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return!!e.length&&e.toArray().map((e=>this.renderAction({action:e,type:"inline"})))}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?C("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:D.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?C("section",{key:L("navigation"),class:this.classes(D.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[D.footerHasPagination]:e,[D.footerHasActions]:n,[D.footerHasActionsMenu]:s};return e||n?C("div",{key:L("feature-buttons"),class:this.classes(D.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=x(e.selectedFeatures,{total:t.length});return C("section",{key:L("menu"),class:D.featureMenu},C("strong",{class:D.featureMenuHeader},o),C("nav",{bind:this,class:D.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:I},this.renderFeatureMenu(),C("div",{class:D.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?C("div",{class:D.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:C("div",{key:L("pointer"),class:D.pointer,role:"presentation"},C("div",{class:this.classes(D.pointerDirection,D.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:a,visibleElements:l}=this,{title:u}=this.viewModel,c="bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===i||"top-center"===i||"top-right"===i,d="top-left"===t||"top-center"===t||"top-right"===t||"bottom-left"===i||"bottom-center"===i||"bottom-right"===i,p={[D.shadow]:e,[D.isCollapsible]:s,[D.isCollapsed]:a};return C("div",{class:this.classes(D.main,D.widget,p),tabIndex:l.closeButton?null:-1,role:"dialog","aria-labelledby":u?o:"","aria-describedby":r&&!a?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},c?this.renderFooter():null,c?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?C("div",{key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return C("span",{key:"text",class:D.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[D.iconLoading]:e.active,[D.rotating]:e.active,[D.icon]:!!t,[D.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),C("span",{key:"icon","aria-hidden":"true",class:this.classes(D.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[D.action]:"toggle"!==t.type,[D.actionToggle]:"toggle"===t.type,[D.actionToggleOn]:"toggle"===t.type&&t.value,[D.buttonDisabled]:t.disabled},s=[this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?C("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(D.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):C("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(D.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,a={[D.featureMenuSelected]:r},l=r?C("span",{key:L(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:D.iconCheckMark}):null,u=C("span",{innerHTML:e.title||o.untitled});return C("li",{role:"menuitem",tabIndex:-1,key:L(`feature-menu-feature-${n}`),class:this.classes(a,D.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},C("span",{class:D.featureMenuTitle},u,l))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?C("ol",{class:D.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter((e=>!!e.graphic)).map(((e,t)=>this.renderFeatureMenuItem(e,t)))):null}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r="zoom-to-feature"===n?x(e.title,{messages:t}):"remove-selected-feature"===n?x(e.title,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?x(e.title,{messages:t}):e.title;return r&&s?x(r,s):r}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:D.iconDefaultAction;return s&&i?x(s,i):s}_getActionImage(e){const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?x(o,i):o}_createFeatureUpdatedAnimation(){return O("enter",D.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if("number"!=typeof e)return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach((e=>{this._handles.add(r((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=i(e),{_featureMenuNode:o}=this,n=e.currentTarget["data-feature-index"];if(!o)return;const s=o.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=i(e),{_actionsMenuNode:o}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!o)return;const a=o.querySelectorAll("li"),l=a.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();a[a.length-1].focus()}else{e.stopPropagation();a[0].focus()}else{e.stopPropagation();a[(r+1+l)%l].focus()}else{e.stopPropagation();a[(r-1+l)%l].focus()}}_handleMainKeyup(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e.shouldFocus&&(await u((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,N)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this.actionsMenuOpen=!1,this.featureMenuOpen=!1)}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:r,view:a}=n;if(s(r)||!a||!i)return"top-center";if(!this._isScreenLocationWithinView(r,a))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replace(/[^-\d\.]/g,""),10)}const u=o?window.getComputedStyle(o,null):null,c=u?l(u.getPropertyValue("max-height")):0,d=u?l(u.getPropertyValue("height")):0,{height:p,width:h}=i.getBoundingClientRect(),g=h+t,_=Math.max(p,c,d)+t,f=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"right",view:a}),v=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"left",view:a}),m=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"top",view:a}),b=this._isOutsideView({popupHeight:_,popupWidth:g,screenLocation:r,side:"bottom",view:a});return v?m?"bottom-right":"top-right":f?m?"bottom-left":"top-left":m?b?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return"function"==typeof e?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return F(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=F(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!e)return;const{screenLocation:t}=this.viewModel,{width:i}=e.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&(e.style.top=o.top,e.style.left=o.left,e.style.bottom=o.bottom,e.style.right=o.right)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return"top-left"===t||"bottom-left"===t||"top-right"===t||"bottom-right"===t?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this,r=o/2,a=i.height-t,l=i.width-e,{padding:u}=this.view;return"bottom-center"===n?{top:t+s-u.top,left:e-r-u.left}:"top-left"===n?{bottom:a+s-u.bottom,right:l+s-u.right}:"bottom-left"===n?{top:t+s-u.top,right:l+s-u.right}:"top-right"===n?{bottom:a+s-u.bottom,left:e+s-u.left}:"bottom-right"===n?{top:t+s-u.top,left:e+s-u.left}:"top-center"===n?{bottom:a+s-u.bottom,left:e-r-u.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(s(e)||!t)return;const n=this._calculateFullWidth(t),r=this._calculateAlignmentPosition(e.x,e.y,o,n);return r?{top:void 0!==r.top?`${r.top}px`:"auto",left:void 0!==r.left?`${r.left}px`:"auto",bottom:void 0!==r.bottom?`${r.bottom}px`:"auto",right:void 0!==r.right?`${r.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const e=this.get("viewModel.view");this._wireUpView(e)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,r]=t,{width:a,height:l}=i;return o<=a&&s>a||o>a&&s<=a||n<=l&&r>l||n>l&&r<=l}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:a}=this,l=a.breakpoint;this._dockingThresholdCrossed(s,r,l)&&this._setDockEnabledForViewSize(a),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(t.length){t[0].focus()}}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;const s=t.hasOwnProperty("width")&&o<=t.width,r=t.hasOwnProperty("height")&&n<=t.height;return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?x(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(this._spinner,B),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new v({view:e}),e.ui.add(this._spinner,{key:B,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};e([g({readOnly:!0})],V.prototype,"actionsMenuId",null),e([g({readOnly:!0})],V.prototype,"actionsMenuButtonId",null),e([g({readOnly:!0})],V.prototype,"featureMenuId",null),e([g({readOnly:!0})],V.prototype,"titleId",null),e([g({readOnly:!0})],V.prototype,"contentId",null),e([g({readOnly:!0})],V.prototype,"hasContent",null),e([g({readOnly:!0})],V.prototype,"featureNavigationVisible",null),e([g({readOnly:!0})],V.prototype,"collapsible",null),e([g({readOnly:!0})],V.prototype,"featureMenuVisible",null),e([g({readOnly:!0})],V.prototype,"contentCollapsed",null),e([g({readOnly:!0})],V.prototype,"dividedActions",null),e([p("viewModel.actions")],V.prototype,"actions",void 0),e([g()],V.prototype,"actionsMenuOpen",null),e([g()],V.prototype,"alignment",void 0),e([p("viewModel.autoCloseEnabled")],V.prototype,"autoCloseEnabled",void 0),e([p("viewModel.autoOpenEnabled")],V.prototype,"autoOpenEnabled",void 0),e([p("viewModel.defaultPopupTemplateEnabled")],V.prototype,"defaultPopupTemplateEnabled",void 0),e([p("viewModel.content")],V.prototype,"content",void 0),e([g()],V.prototype,"collapsed",void 0),e([g()],V.prototype,"collapseEnabled",void 0),e([g({readOnly:!0})],V.prototype,"currentAlignment",null),e([g({readOnly:!0})],V.prototype,"currentDockPosition",null),e([g()],V.prototype,"dockOptions",null),e([g()],V.prototype,"dockEnabled",void 0),e([p("viewModel.featureCount")],V.prototype,"featureCount",void 0),e([g()],V.prototype,"featureMenuOpen",void 0),e([p("viewModel.features")],V.prototype,"features",void 0),e([p("viewModel.goToOverride")],V.prototype,"goToOverride",void 0),e([g()],V.prototype,"headingLevel",void 0),e([p("viewModel.highlightEnabled")],V.prototype,"highlightEnabled",void 0),e([p("viewModel.location")],V.prototype,"location",void 0),e([g({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],V.prototype,"label",void 0),e([g()],V.prototype,"maxInlineActions",void 0),e([g(),k("esri/widgets/Popup/t9n/Popup")],V.prototype,"messages",void 0),e([g(),k("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([p("viewModel.promises")],V.prototype,"promises",void 0),e([p("viewModel.selectedFeature")],V.prototype,"selectedFeature",void 0),e([p("viewModel.selectedFeatureIndex")],V.prototype,"selectedFeatureIndex",void 0),e([g({readOnly:!0})],V.prototype,"selectedFeatureWidget",null),e([g()],V.prototype,"spinnerEnabled",void 0),e([p("viewModel.title")],V.prototype,"title",void 0),e([p("viewModel.updateLocationEnabled")],V.prototype,"updateLocationEnabled",void 0),e([p("viewModel.view")],V.prototype,"view",void 0),e([g({type:M}),A(["triggerAction","trigger-action"])],V.prototype,"viewModel",void 0),e([g()],V.prototype,"visible",null),e([g()],V.prototype,"visibleElements",void 0),e([h("visibleElements")],V.prototype,"castVisibleElements",null),e([y()],V.prototype,"_close",null),e([y()],V.prototype,"_toggleDockEnabled",null),e([y()],V.prototype,"_toggleFeatureMenu",null),e([y()],V.prototype,"_toggleActionsMenu",null),e([y()],V.prototype,"_triggerAction",null),e([y()],V.prototype,"_selectFeature",null),e([y()],V.prototype,"_next",null),e([y()],V.prototype,"_previous",null),V=e([_("esri.widgets.Popup")],V);const U=V;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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import i from"../core/Handles.js";import{destroyMaybe as t,isNone as s,applySome as o,isSome as a}from"../core/maybe.js";import{watch as r,syncAndInitial as l}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{aliasOf as d}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{substitute as p}from"../intl/substitute.js";import h from"./Slider.js";import u from"./Widget.js";import{CSS as v}from"./ShadowCast/css.js";import{ShadowCastState as w}from"./ShadowCast/ShadowCastState.js";import f from"./ShadowCast/ShadowCastViewModel.js";import g from"./ShadowCast/ShadowCastVisibleElements.js";import{ShadowVisualizationType as b}from"./ShadowCast/ShadowVisualizationType.js";import{DiscreteConfigurator as S}from"./ShadowCast/components/DiscreteConfigurator.js";import{DurationConfigurator as y}from"./ShadowCast/components/DurationConfigurator.js";import{ShadowTooltip as _}from"./ShadowCast/components/ShadowTooltip.js";import{ThresholdConfigurator as C}from"./ShadowCast/components/ThresholdConfigurator.js";import{TimezonePicker as j}from"./ShadowCast/components/TimezonePicker.js";import M from"./support/DatePicker.js";import{Heading as T}from"./support/Heading.js";import{formatSliderLabel as k}from"./support/timeWidgetUtils.js";import"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{tsx as z}from"./support/jsxFactory.js";import{formatDate as V}from"../intl/date.js";var O;!function(e){e.Slider="slider"}(O||(O={}));const R={hour:"2-digit",minute:"2-digit",timeZone:"UTC"},L=/(.*)\s(.*)/,P={labelFormatFunction:k,min:0,max:1439,steps:15,rangeLabelInputsEnabled:!1,visibleElements:{labels:!1,rangeLabels:!1},tickConfigs:[{mode:"position",values:[0,360,720,1080,1439],labelsVisible:!0,tickCreatedFunction:(e,i,t)=>{i.classList.add(v.timeRangePrimaryTick),t.classList.add(v.timeRangePrimaryTickLabel);const s=t.innerText.match(L);s&&(t.innerHTML=`${s[1]}<br><div class="${v.timeRangeAMPMLabel}">${s[2]}</div>`)}},{mode:"position",values:[120,240,480,600,840,960,1200,1320],tickCreatedFunction:(e,i)=>{i.classList.add(v.timeRangeSecondaryTick)}}]};let E=class extends u{constructor(e,t){super(e,t),this.viewModel=null,this.view=null,this.headingLevel=4,this.iconClass=v.widgetIcon,this.label=void 0,this.visibleElements=new g,this._handles=new i,this._defaultViewModel=null,this._timeSlider=new h({...P,container:document.createElement("div")}),this._tooltip=null,this._onTimezoneChange=e=>{this.viewModel.utcOffset=e},this._onDateChange=e=>{this.viewModel.date=e},e?.viewModel||(this._defaultViewModel=new f({view:e?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._handles.add([r((()=>({viewModel:this.viewModel,slider:this._timeSlider})),(e=>this._connectTimeSlider(e)),l),r((()=>({container:o(this.view,(e=>e.surface)),viewModel:this.viewModel,tooltipVisible:this.visibleElements.tooltip})),(({container:e,viewModel:i,tooltipVisible:o})=>{this._tooltip=t(this._tooltip),!s(e)&&o&&(this._tooltip=new _({viewModel:i,container:e}))}),l),r((()=>({viewModel:this.viewModel,visible:this.visible})),(({viewModel:e,visible:i})=>e.setRunning(i)),l)])}destroy(){this._handles=t(this._handles),this._timeSlider=t(this._timeSlider),a(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-select.js"),import("@esri/calcite-components/dist/components/calcite-option.js")])}render(){const{visibleElements:e,viewModel:i}=this,t=i.state===w.Disabled;return z("div",{key:this,class:this.classes(v.base,v.esriWidget,{[v.esriWidgetDisabled]:t})},this._renderTimeRangeSection(),e.visualizationOptions&&this._renderVisualizationOptionsSection())}get testData(){return{tooltip:this._tooltip}}_connectTimeSlider({viewModel:e,slider:i}){if(this._handles.remove(O.Slider),s(i))return;const t=e=>n(e,"milliseconds","minutes"),o=e=>n(e,"minutes","milliseconds"),a=({index:i,value:t})=>{0===i?e.startTimeOfDay=o(t):e.endTimeOfDay=o(t)};this._handles.add([r((()=>[e.startTimeOfDay,e.endTimeOfDay]),(e=>{i.values=e.map(t)}),l),i.on("thumb-change",a),i.on("thumb-drag",a),i.on("segment-drag",(()=>{[e.startTimeOfDay,e.endTimeOfDay]=i.values.map(o)}))],O.Slider)}_renderTimeRangeSection(){const{visibleElements:e}=this;return e.timeRangeSlider||e.datePicker?z("section",{key:"time-range",class:v.timeRange},z(T,{level:this.headingLevel},this.messages.timeLabel),e.timeRangeSlider&&this._renderTimeRange(),e.datePicker&&this._renderDatePicker()):null}_renderTimeRange(){const{messages:e,viewModel:i,visibleElements:t}=this,{startTimeOfDay:s,endTimeOfDay:o}=i,[a,r]=[s,o].map((e=>V(new Date(e),R)));return[z("div",{key:"time-range-indicator",class:v.timeRangeIndicator},p(e.timeRange,{start:a,end:r}),t.timezone&&z(j,{value:i.utcOffset,onChange:this._onTimezoneChange})),z("div",{key:"time-slider-container",bind:this,afterCreate:this._timeSliderContainerAfterCreate,afterRemoved:this._timeSliderContainerAfterRemoved})]}_timeSliderContainerAfterCreate(e){o(this._timeSlider,(i=>{e.appendChild(i.container)}))}_timeSliderContainerAfterRemoved(e){o(this._timeSlider,(i=>{e.removeChild(i.container)}))}_renderDatePicker(){return z("div",{key:"date-picker",class:v.datePickerContainer},z(M,{value:this.viewModel.date,onChange:this._onDateChange}))}_renderVisualizationOptionsSection(){const{headingLevel:e,messages:i,viewModel:t,visibleElements:s}=this,o=s.colorPicker,a=e=>this.classes(t.visualizationType===e?null:v.visualizationConfigHidden);return z("section",{key:"visualization",class:v.visualization},z(T,{level:e},i.visualizationLabel),this._renderVisualizationSelect(),z("div",{key:"threshold-configurator",class:a(b.Threshold)},z(C,{options:t.thresholdOptions,colorPickerVisible:o})),z("div",{key:"duration-configurator",class:a(b.Duration)},z(y,{options:t.durationOptions,colorPickerVisible:o})),z("div",{key:"discrete-configurator",class:a(b.Discrete)},z(S,{options:t.discreteOptions,colorPickerVisible:o})))}_renderVisualizationSelect(){const e=this.messages,i=this.viewModel.visualizationType;return z("calcite-select",{class:v.visualizationSelect,key:"visualization-select",label:e.visualizationLabel,bind:this,onCalciteSelectChange:this._onVisualizationTypeChange},[{type:b.Threshold,label:e.threshold.label},{type:b.Duration,label:e.duration.label},{type:b.Discrete,label:e.discrete.label}].map((({type:e,label:t})=>z("calcite-option",{value:e,selected:e===i},t))))}_onVisualizationTypeChange(e){const i=e.target.selectedOption?.value;this.viewModel.visualizationType=i??b.Threshold}};e([m()],E.prototype,"viewModel",void 0),e([d("viewModel.view")],E.prototype,"view",void 0),e([m()],E.prototype,"headingLevel",void 0),e([m()],E.prototype,"iconClass",void 0),e([d("messages.widgetLabel",{overridable:!0})],E.prototype,"label",void 0),e([m({type:g,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([m(),D("esri/widgets/ShadowCast/t9n/ShadowCast")],E.prototype,"messages",void 0),e([m()],E.prototype,"_defaultViewModel",void 0),e([m()],E.prototype,"_timeSlider",void 0),e([m()],E.prototype,"_tooltip",void 0),E=e([c("esri.widgets.ShadowCast")],E);const x=E;export{x as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import i from"../core/Handles.js";import{destroyMaybe as t,isNone as s,applySome as o,isSome as a}from"../core/maybe.js";import{watch as r,syncAndInitial as l}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{substitute as c}from"../intl/substitute.js";import h from"./Slider.js";import p from"./Widget.js";import{CSS as u}from"./ShadowCast/css.js";import{ShadowCastState as v}from"./ShadowCast/ShadowCastState.js";import w from"./ShadowCast/ShadowCastViewModel.js";import g from"./ShadowCast/ShadowCastVisibleElements.js";import{ShadowVisualizationType as f}from"./ShadowCast/ShadowVisualizationType.js";import{DiscreteConfigurator as b}from"./ShadowCast/components/DiscreteConfigurator.js";import{DurationConfigurator as _}from"./ShadowCast/components/DurationConfigurator.js";import{ShadowTooltip as S}from"./ShadowCast/components/ShadowTooltip.js";import{ThresholdConfigurator as y}from"./ShadowCast/components/ThresholdConfigurator.js";import{TimezonePicker as C}from"./ShadowCast/components/TimezonePicker.js";import M from"./support/DatePicker.js";import{Heading as T}from"./support/Heading.js";import{formatSliderLabel as j}from"./support/timeWidgetUtils.js";import"./support/widgetUtils.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{tsx as D}from"./support/jsxFactory.js";import{formatDate as z}from"../intl/date.js";var V;!function(e){e.Slider="slider"}(V||(V={}));const O={hour:"2-digit",minute:"2-digit",timeZone:"UTC"},R=/(.*)\s(.*)/,L={labelFormatFunction:j,min:0,max:1439,steps:15,rangeLabelInputsEnabled:!1,visibleElements:{labels:!1,rangeLabels:!1},tickConfigs:[{mode:"position",values:[0,360,720,1080,1439],labelsVisible:!0,tickCreatedFunction:(e,i,t)=>{i.classList.add(u.timeRangePrimaryTick),t.classList.add(u.timeRangePrimaryTickLabel);const s=t.innerText.match(R);s&&(t.innerHTML=`${s[1]}<br><div class="${u.timeRangeAMPMLabel}">${s[2]}</div>`)}},{mode:"position",values:[120,240,480,600,840,960,1200,1320],tickCreatedFunction:(e,i)=>{i.classList.add(u.timeRangeSecondaryTick)}}]};let P=class extends p{constructor(e,t){super(e,t),this.viewModel=null,this.headingLevel=4,this.iconClass=u.widgetIcon,this.visibleElements=new g,this._handles=new i,this._defaultViewModel=null,this._timeSlider=new h({...L,container:document.createElement("div")}),this._tooltip=null,this._onTimezoneChange=e=>{this.viewModel.utcOffset=e},this._onDateChange=e=>{this.viewModel.date=e},e?.viewModel||(this._defaultViewModel=new w({view:e?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._handles.add([r((()=>({viewModel:this.viewModel,slider:this._timeSlider})),(e=>this._connectTimeSlider(e)),l),r((()=>({container:o(this.view,(e=>e.surface)),viewModel:this.viewModel,tooltipVisible:this.visibleElements.tooltip})),(({container:e,viewModel:i,tooltipVisible:o})=>{this._tooltip=t(this._tooltip),!s(e)&&o&&(this._tooltip=new S({viewModel:i,container:e}))}),l),r((()=>({viewModel:this.viewModel,visible:this.visible})),(({viewModel:e,visible:i})=>e.setRunning(i)),l)])}destroy(){this._handles=t(this._handles),this._timeSlider=t(this._timeSlider),a(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-select.js"),import("@esri/calcite-components/dist/components/calcite-option.js")])}render(){const{visibleElements:e,viewModel:i}=this,t=i.state===v.Disabled;return D("div",{key:this,class:this.classes(u.base,u.esriWidget,{[u.esriWidgetDisabled]:t})},this._renderTimeRangeSection(),e.visualizationOptions&&this._renderVisualizationOptionsSection())}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get label(){return this._get("label")??this.messages?.widgetLabel}set label(e){this._set("label",e)}get testData(){return{tooltip:this._tooltip}}_connectTimeSlider({viewModel:e,slider:i}){if(this._handles.remove(V.Slider),s(i))return;const t=e=>n(e,"milliseconds","minutes"),o=e=>n(e,"minutes","milliseconds"),a=({index:i,value:t})=>{0===i?e.startTimeOfDay=o(t):e.endTimeOfDay=o(t)};this._handles.add([r((()=>[e.startTimeOfDay,e.endTimeOfDay]),(e=>{i.values=e.map(t)}),l),i.on("thumb-change",a),i.on("thumb-drag",a),i.on("segment-drag",(()=>{[e.startTimeOfDay,e.endTimeOfDay]=i.values.map(o)}))],V.Slider)}_renderTimeRangeSection(){const{visibleElements:e}=this;return e.timeRangeSlider||e.datePicker?D("section",{key:"time-range",class:u.timeRange},D(T,{level:this.headingLevel},this.messages.timeLabel),e.timeRangeSlider&&this._renderTimeRange(),e.datePicker&&this._renderDatePicker()):null}_renderTimeRange(){const{messages:e,viewModel:i,visibleElements:t}=this,{startTimeOfDay:s,endTimeOfDay:o}=i,[a,r]=[s,o].map((e=>z(new Date(e),O)));return[D("div",{key:"time-range-indicator",class:u.timeRangeIndicator},c(e.timeRange,{start:a,end:r}),t.timezone&&D(C,{value:i.utcOffset,onChange:this._onTimezoneChange})),D("div",{key:"time-slider-container",bind:this,afterCreate:this._timeSliderContainerAfterCreate,afterRemoved:this._timeSliderContainerAfterRemoved})]}_timeSliderContainerAfterCreate(e){o(this._timeSlider,(i=>{e.appendChild(i.container)}))}_timeSliderContainerAfterRemoved(e){o(this._timeSlider,(i=>{e.removeChild(i.container)}))}_renderDatePicker(){return D("div",{key:"date-picker",class:u.datePickerContainer},D(M,{value:this.viewModel.date,onChange:this._onDateChange}))}_renderVisualizationOptionsSection(){const{headingLevel:e,messages:i,viewModel:t,visibleElements:s}=this,o=s.colorPicker,a=e=>this.classes(t.visualizationType===e?null:u.visualizationConfigHidden);return D("section",{key:"visualization",class:u.visualization},D(T,{level:e},i.visualizationLabel),this._renderVisualizationSelect(),D("div",{key:"threshold-configurator",class:a(f.Threshold)},D(y,{options:t.thresholdOptions,colorPickerVisible:o})),D("div",{key:"duration-configurator",class:a(f.Duration)},D(_,{options:t.durationOptions,colorPickerVisible:o})),D("div",{key:"discrete-configurator",class:a(f.Discrete)},D(b,{options:t.discreteOptions,colorPickerVisible:o})))}_renderVisualizationSelect(){const e=this.messages,i=this.viewModel.visualizationType;return D("calcite-select",{class:u.visualizationSelect,key:"visualization-select",label:e.visualizationLabel,bind:this,onCalciteSelectChange:this._onVisualizationTypeChange},[{type:f.Threshold,label:e.threshold.label},{type:f.Duration,label:e.duration.label},{type:f.Discrete,label:e.discrete.label}].map((({type:e,label:t})=>D("calcite-option",{value:e,selected:e===i},t))))}_onVisualizationTypeChange(e){const i=e.target.selectedOption?.value;this.viewModel.visualizationType=i??f.Threshold}};e([d()],P.prototype,"viewModel",void 0),e([d()],P.prototype,"view",null),e([d()],P.prototype,"headingLevel",void 0),e([d()],P.prototype,"iconClass",void 0),e([d({type:g,nonNullable:!0})],P.prototype,"visibleElements",void 0),e([d(),k("esri/widgets/ShadowCast/t9n/ShadowCast")],P.prototype,"messages",void 0),e([d()],P.prototype,"_defaultViewModel",void 0),e([d()],P.prototype,"_timeSlider",void 0),e([d()],P.prototype,"_tooltip",void 0),P=e([m("esri.widgets.ShadowCast")],P);const E=P;export{E 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../chunks/tslib.es6.js";import{isNone as s}from"../core/maybe.js";import{after as e}from"../core/promiseUtils.js";import{watch as o}from"../core/reactiveUtils.js";import{aliasOf as t}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import l from"./Spinner/SpinnerViewModel.js";import"./support/widgetUtils.js";import{tsx as p}from"./support/jsxFactory.js";const c={base:"esri-spinner",spinnerStart:"esri-spinner--start",spinnerFinish:"esri-spinner--finish"};let h=class extends a{constructor(i,s){super(i,s),this._animationDelay=500,this._animationPromise=null,this.location=null,this.view=null,this.viewModel=new l,this.visible=!1}initialize(){this.addHandles(o((()=>this.visible),(i=>this._visibleChange(i))))}destroy(){this._animationPromise=null}show(i){const{location:s,promise:e}=i;s&&(this.viewModel.location=s),this.visible=!0;const o=()=>this.hide();e&&e.catch((()=>{})).then(o)}hide(){this.visible=!1}render(){const{visible:i}=this,{screenLocation:s}=this.viewModel,e=!!s,o=i&&e,t=!i&&e,r={[c.spinnerStart]:o,[c.spinnerFinish]:t},n=this._getPositionStyles();return p("div",{class:this.classes(c.base,r),styles:n})}_visibleChange(i){if(i)return void(this.viewModel.screenLocationEnabled=!0);const s=e(this._animationDelay);this._animationPromise=s,s.catch((()=>{})).then((()=>{this._animationPromise===s&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)}))}_getPositionStyles(){const{screenLocation:i,view:e}=this.viewModel;if(s(e)||s(i))return{};const{padding:o}=e;return{left:i.x-o.left+"px",top:i.y-o.top+"px"}}};i([t("viewModel.location")],h.prototype,"location",void 0),i([t("viewModel.view")],h.prototype,"view",void 0),i([r({type:l})],h.prototype,"viewModel",void 0),i([t("viewModel.visible")],h.prototype,"visible",void 0),h=i([n("esri.widgets.Spinner")],h);const m=h;export{m as default};
5
+ import{_ as i}from"../chunks/tslib.es6.js";import{isNone as e}from"../core/maybe.js";import{after as s}from"../core/promiseUtils.js";import{watch as o}from"../core/reactiveUtils.js";import{aliasOf as t}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import l from"./Spinner/SpinnerViewModel.js";import"./support/widgetUtils.js";import{tsx as p}from"./support/jsxFactory.js";const c={base:"esri-spinner",spinnerStart:"esri-spinner--start",spinnerFinish:"esri-spinner--finish"};let m=class extends a{constructor(i,e){super(i,e),this._animationDelay=500,this._animationPromise=null,this.location=null,this.view=null,this.viewModel=new l}initialize(){this.addHandles(o((()=>this.visible),(i=>this._visibleChange(i))))}destroy(){this._animationPromise=null}show(i){const{location:e,promise:s}=i;e&&(this.viewModel.location=e),this.visible=!0;const o=()=>this.hide();s&&s.catch((()=>{})).then(o)}hide(){this.visible=!1}render(){const{visible:i}=this,{screenLocation:e}=this.viewModel,s=!!e,o=i&&s,t=!i&&s,r={[c.spinnerStart]:o,[c.spinnerFinish]:t},n=this._getPositionStyles();return p("div",{class:this.classes(c.base,r),styles:n})}_visibleChange(i){if(i)return void(this.viewModel.screenLocationEnabled=!0);const e=s(this._animationDelay);this._animationPromise=e,e.catch((()=>{})).then((()=>{this._animationPromise===e&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)}))}_getPositionStyles(){const{screenLocation:i,view:s}=this.viewModel;if(e(s)||e(i))return{};const{padding:o}=s;return{left:i.x-o.left+"px",top:i.y-o.top+"px"}}};i([t("viewModel.location")],m.prototype,"location",void 0),i([t("viewModel.view")],m.prototype,"view",void 0),i([r({type:l})],m.prototype,"viewModel",void 0),i([t("viewModel.visible")],m.prototype,"visible",void 0),m=i([n("esri.widgets.Spinner")],m);const h=m;export{h 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{isSome as o}from"../core/maybe.js";import{memoize as r}from"../core/memoize.js";import{aliasOf as t}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{weatherTypesArray as n}from"../views/3d/environment/weather.js";import a from"./Widget.js";import{Heading as l}from"./support/Heading.js";import{classes as c}from"./support/widgetUtils.js";import{messageBundle as d}from"./support/decorators/messageBundle.js";import{tsx as p,tsxFragment as u}from"./support/jsxFactory.js";import{CSS as h}from"./Weather/css.js";import{WeatherState as g,WeatherError as m}from"./Weather/enums.js";import{LabeledSlider as v}from"./Weather/LabeledSlider.js";import y from"./Weather/VisibleElements.js";import b from"./Weather/WeatherViewModel.js";const w={sunny:"brightness",cloudy:"partly-cloudy",rainy:"rain",snowy:"snow",foggy:"fog"};let C=class extends a{constructor(e){super(e),this.viewModel=new b,this.headingLevel=4,this.visibleElements=new y,this.iconClass=h.widgetIcon,this.label=void 0,this._renderWeatherTypeButton=e=>{const o=this.viewModel,r=this.messages[e].label,t=o.state===g.Disabled,s=!t&&o.current.type===e;return p("calcite-button",{appearance:s?"solid":"outline","aria-checked":s?"true":"false",color:s?"blue":"neutral",disabled:t,"icon-start":w[e],key:`${e}-type-button`,label:r,role:"radio",scale:"l",title:r,onclick:()=>{s||o.setWeatherByType(e)}})},this._memoizedCallbacks=r((e=>({onCloudCoverChange:o=>{"cloudCover"in e&&(e.cloudCover=o)},onPrecipitationChange:o=>{"precipitation"in e&&(e.precipitation=o)},onFogStrengthChange:o=>{"fogStrength"in e&&(e.fogStrength=o)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.target.checked)}})))}render(){const e=this.viewModel.state===g.Disabled;return p("div",{class:this.classes(h.base,h.esriWidget,e&&h.esriWidgetDisabled),role:"region","aria-label":this.messages.widgetLabelAccessible},this._renderContent())}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-checkbox.js"),import("@esri/calcite-components/dist/components/calcite-icon.js"),import("@esri/calcite-components/dist/components/calcite-label.js")])}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get _errorMessage(){const e=this.messages.error;switch(this.viewModel.error){case m.LocalScene:return e.localScene;case m.NoAtmosphere:return e.noAtmosphere;case m.UnsupportedView:return e.unsupported;default:return null}}get _warningMessage(){if(this.viewModel.error===m.NotVisible){return o(this.view)&&"3d"===this.view?.type&&this.view.environment.atmosphereEnabled?this.messages.error.notVisible:null}return null}_renderContent(){const e=this.messages,r=this._warningMessage,t=this.viewModel.state===g.Error;return p(u,null,this.visibleElements.header&&p(l,{level:this.headingLevel},e.widgetLabel),t&&p("div",{key:"error",class:h.error},this._errorMessage),p("div",{key:"content",class:c({[h.content]:!0,[h.hasError]:t})},p("div",{class:h.selector,role:"radiogroup","aria-label":e.weatherType},n.map(this._renderWeatherTypeButton)),p("div",{class:h.options},this._renderOptions()),o(r)&&this._renderWarning(r)))}_renderOptions(){const{viewModel:e,messages:o}=this,r=e.state===g.Disabled,t=e.current,s=this._memoizedCallbacks(t);switch(t.type){case"sunny":return p(v,{key:"sunny-cover",disabled:r,label:o.sunny.cloudCover,value:t.cloudCover,onChange:s.onCloudCoverChange});case"cloudy":return p(v,{key:"cloudy-cover",disabled:r,label:o.cloudy.cloudCover,value:t.cloudCover,onChange:s.onCloudCoverChange});case"rainy":return p(u,null,p(v,{key:"rainy-cover",disabled:r,label:o.rainy.cloudCover,value:t.cloudCover,onChange:s.onCloudCoverChange}),p(v,{key:"rainy-precipitation",disabled:r,debounceDelay:0,label:o.rainy.precipitation,value:t.precipitation,onChange:s.onPrecipitationChange}));case"snowy":return p(u,null,p(v,{key:"snowy-cloud-cover",disabled:r,label:o.snowy.cloudCover,value:t.cloudCover,onChange:s.onCloudCoverChange}),p(v,{key:"snowy-precipitation",disabled:r,debounceDelay:0,label:o.snowy.precipitation,value:t.precipitation,onChange:s.onPrecipitationChange}),p("calcite-label",{key:"snow-cover",scale:"s",disabled:r,layout:"inline",title:o.snowy.snowCoverTooltip},p("calcite-checkbox",{checked:"enabled"===t.snowCover,onCalciteCheckboxChange:s.onSnowCoverChange}),o.snowy.snowCover));case"foggy":return p(v,{key:"foggy-cover",disabled:r,debounceDelay:0,label:o.foggy.fogStrength,value:t.fogStrength,onChange:s.onFogStrengthChange})}}_renderWarning(e){return p("div",{key:"warning",class:h.warning},p("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s"}),e)}};e([s()],C.prototype,"viewModel",void 0),e([s()],C.prototype,"view",null),e([s()],C.prototype,"headingLevel",void 0),e([s({type:y,nonNullable:!0})],C.prototype,"visibleElements",void 0),e([s()],C.prototype,"iconClass",void 0),e([t("messages.widgetLabel",{overridable:!0})],C.prototype,"label",void 0),e([s(),d("esri/widgets/Weather/t9n/Weather")],C.prototype,"messages",void 0),e([s()],C.prototype,"_errorMessage",null),e([s()],C.prototype,"_warningMessage",null),C=e([i("esri.widgets.Weather")],C);const f=C;export{f as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{isSome as o}from"../core/maybe.js";import{memoize as t}from"../core/memoize.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{weatherTypesArray as i}from"../views/3d/environment/weather.js";import n from"./Widget.js";import{Heading as a}from"./support/Heading.js";import{classes as l}from"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as d,tsxFragment as p}from"./support/jsxFactory.js";import{CSS as h}from"./Weather/css.js";import{WeatherState as u,WeatherError as g}from"./Weather/enums.js";import{LabeledSlider as m}from"./Weather/LabeledSlider.js";import v from"./Weather/VisibleElements.js";import y from"./Weather/WeatherViewModel.js";const b={sunny:"brightness",cloudy:"partly-cloudy",rainy:"rain",snowy:"snow",foggy:"fog"};let w=class extends n{constructor(e){super(e),this.viewModel=new y,this.headingLevel=4,this.visibleElements=new v,this.iconClass=h.widgetIcon,this._renderWeatherTypeButton=e=>{const o=this.viewModel,t=this.messages[e].label,r=o.state===u.Disabled,s=!r&&o.current.type===e;return d("calcite-button",{appearance:s?"solid":"outline","aria-checked":s?"true":"false",color:s?"blue":"neutral",disabled:r,"icon-start":b[e],key:`${e}-type-button`,label:t,role:"radio",scale:"l",title:t,onclick:()=>{s||o.setWeatherByType(e)}})},this._memoizedCallbacks=t((e=>({onCloudCoverChange:o=>{"cloudCover"in e&&(e.cloudCover=o)},onPrecipitationChange:o=>{"precipitation"in e&&(e.precipitation=o)},onFogStrengthChange:o=>{"fogStrength"in e&&(e.fogStrength=o)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.target.checked)}})))}render(){const e=this.viewModel.state===u.Disabled;return d("div",{class:this.classes(h.base,h.esriWidget,e&&h.esriWidgetDisabled),role:"region","aria-label":this.messages.widgetLabelAccessible},this._renderContent())}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-checkbox.js"),import("@esri/calcite-components/dist/components/calcite-icon.js"),import("@esri/calcite-components/dist/components/calcite-label.js")])}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get label(){return this._get("label")??this.messages?.widgetLabel}set label(e){this._set("label",e)}get _errorMessage(){const e=this.messages.error;switch(this.viewModel.error){case g.LocalScene:return e.localScene;case g.NoAtmosphere:return e.noAtmosphere;case g.UnsupportedView:return e.unsupported;default:return null}}get _warningMessage(){if(this.viewModel.error===g.NotVisible){return o(this.view)&&"3d"===this.view?.type&&this.view.environment.atmosphereEnabled?this.messages.error.notVisible:null}return null}_renderContent(){const e=this.messages,t=this._warningMessage,r=this.viewModel.state===u.Error;return d(p,null,this.visibleElements.header&&d(a,{level:this.headingLevel},e.widgetLabel),r&&d("div",{key:"error",class:h.error},this._errorMessage),d("div",{key:"content",class:l({[h.content]:!0,[h.hasError]:r})},d("div",{class:h.selector,role:"radiogroup","aria-label":e.weatherType},i.map(this._renderWeatherTypeButton)),d("div",{class:h.options},this._renderOptions()),o(t)&&this._renderWarning(t)))}_renderOptions(){const{viewModel:e,messages:o}=this,t=e.state===u.Disabled,r=e.current,s=this._memoizedCallbacks(r);switch(r.type){case"sunny":return d(m,{key:"sunny-cover",disabled:t,label:o.sunny.cloudCover,value:r.cloudCover,onChange:s.onCloudCoverChange});case"cloudy":return d(m,{key:"cloudy-cover",disabled:t,label:o.cloudy.cloudCover,value:r.cloudCover,onChange:s.onCloudCoverChange});case"rainy":return d(p,null,d(m,{key:"rainy-cover",disabled:t,label:o.rainy.cloudCover,value:r.cloudCover,onChange:s.onCloudCoverChange}),d(m,{key:"rainy-precipitation",disabled:t,debounceDelay:0,label:o.rainy.precipitation,value:r.precipitation,onChange:s.onPrecipitationChange}));case"snowy":return d(p,null,d(m,{key:"snowy-cloud-cover",disabled:t,label:o.snowy.cloudCover,value:r.cloudCover,onChange:s.onCloudCoverChange}),d(m,{key:"snowy-precipitation",disabled:t,debounceDelay:0,label:o.snowy.precipitation,value:r.precipitation,onChange:s.onPrecipitationChange}),d("calcite-label",{key:"snow-cover",scale:"s",disabled:t,layout:"inline",title:o.snowy.snowCoverTooltip},d("calcite-checkbox",{checked:"enabled"===r.snowCover,onCalciteCheckboxChange:s.onSnowCoverChange}),o.snowy.snowCover));case"foggy":return d(m,{key:"foggy-cover",disabled:t,debounceDelay:0,label:o.foggy.fogStrength,value:r.fogStrength,onChange:s.onFogStrengthChange})}}_renderWarning(e){return d("div",{key:"warning",class:h.warning},d("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s"}),e)}};e([r()],w.prototype,"viewModel",void 0),e([r()],w.prototype,"view",null),e([r()],w.prototype,"headingLevel",void 0),e([r({type:v,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([r()],w.prototype,"iconClass",void 0),e([r()],w.prototype,"label",null),e([r(),c("esri/widgets/Weather/t9n/Weather")],w.prototype,"messages",void 0),e([r()],w.prototype,"_errorMessage",null),e([r()],w.prototype,"_warningMessage",null),w=e([s("esri.widgets.Weather")],w);const C=w;export{C as default};
package/widgets/Widget.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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{byId as t}from"../core/domUtils.js";import r from"../core/Evented.js";import{isEventTarget as o,on as s}from"../core/events.js";import i from"../core/Handles.js";import"../core/has.js";import{clone as n}from"../core/lang.js";import a from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{EsriPromiseMixin as d}from"../core/Promise.js";import{debounce as l,throwIfNotAbortError as p,eachAlways as h}from"../core/promiseUtils.js";import{watch as m,when as u,initial as y}from"../core/reactiveUtils.js";import{generateUUID as g}from"../core/uuid.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import{cast as _}from"../core/accessorSupport/decorators/cast.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import{runTracked as j}from"../core/accessorSupport/tracking.js";import{SimpleTrackingTarget as w}from"../core/accessorSupport/tracking/SimpleTrackingTarget.js";import{createAdvancedProjector as b}from"../libs/maquette-advanced-projector/projector.js";import{commitAssetPath as k}from"./support/componentsUtils.js";import{isWidgetConstructor as R,processWidgets as C,WIDGET_SYMBOL as S}from"./support/jsxWidgetSupport.js";import{registerLoading as P}from"./support/tests.js";import{getVNodeCache as E,setVNodeCache as L,deleteVNodeCache as N,clearVNodeCache as T}from"./support/vnodeCache.js";import{classes as H}from"./support/widgetUtils.js";import{onLocaleChange as I}from"../intl/locale.js";import{fetchMessageBundle as F}from"../intl/messages.js";const U="esri.widgets.Widget";let $=0;const x={widgetIcon:"esri-icon-checkbox-unchecked"};function z(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?z(e[r],t?.[r]):e[r]=t[r]);return e}const A=b({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,o,s,i)=>{const n=t?.(e,o,s,i),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in s)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n?.call(s,e);s.addEventListener(t,r,a);const o=()=>s.removeEventListener(t,r,a),c=i.afterRemoved;i.afterRemoved=e=>{c?.(e),o()}}return n}},handleInterceptedEvent(e,t,r,o){const{eventPhase:s,type:i}=o,n=s===Event.CAPTURING_PHASE;let a=`on${i}${n?"capture":""}`;const c=t.properties;(c&&a in c||(a=`on${i[0].toUpperCase()}${i.slice(1)}${n?"Capture":""}`,c&&a in c))&&(T(),e.scheduleRender(),c[a].call(c.bind||r,o))}});let B=!1,D=class extends(d(r.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._internalHandles=new i,this._projector=A,this._readyForTrueRender=!1,this.domNode=null,this.iconClass=x.widgetIcon,this.label=this.declaredClass.split(".").pop(),this.visible=!0,this.key=this,this._loadLocale=l((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await h(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await F(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=z(n(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&a.getLogger(this.declaredClass).error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),k();const r="esri-widget-uid-"+g(),o=this.render.bind(this);this._trackingTarget=new w((()=>this.scheduleRender()));const s=()=>{if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:r,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0};const e=o();let{properties:t}=e;t||(e.properties=t={});let{key:s,styles:i}=t;s||(t.key=r),i||(t.styles=i={}),i.display||(i.display="");let n=0;return e.children?.forEach((e=>{if(R(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${n++}`)})),C(this,e)};this.render=()=>{if(B)return s();let e=E(this)??null;if(e)return e;this._trackingTarget.clear(),B=!0;try{e=j(this._trackingTarget,s)}catch(t){throw console.error(t),t}finally{B=!1}return e&&L(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()}))),P(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(p)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(c(this._trackingTarget),c(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,N(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return t(e)}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+$++}set id(e){e&&this._set("id",e)}get renderable(){return this._resourcesFetch}get test(){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(N(this),this._projector.scheduleRender())}classes(...e){return H.apply(this,e)}renderNow(){N(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this._internalHandles.add(m((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&o(e)&&this._internalHandles.add(this._delegatedEventNames.map((t=>s(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),y)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(p),this.scheduleRender()};this._internalHandles.add([I(e),m((()=>this.uiStrings),e),u((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){e&&this._attached&&(this._projector.detach(this.render),e.parentNode&&e.parentNode.removeChild(e),this._attached=!1)}};D[S]=!0,e([f()],D.prototype,"_readyForTrueRender",void 0),e([f({value:null})],D.prototype,"container",null),e([_("container")],D.prototype,"castContainer",null),e([f({aliasOf:"container"})],D.prototype,"domNode",void 0),e([f()],D.prototype,"iconClass",void 0),e([f()],D.prototype,"id",null),e([f()],D.prototype,"label",void 0),e([f()],D.prototype,"renderable",null),e([f()],D.prototype,"uiStrings",void 0),e([f()],D.prototype,"viewModel",void 0),e([f()],D.prototype,"visible",void 0),e([f()],D.prototype,"key",void 0),e([f()],D.prototype,"children",void 0),e([f()],D.prototype,"afterCreate",void 0),e([f()],D.prototype,"afterUpdate",void 0),e([f()],D.prototype,"afterRemoved",void 0),D=e([v(U)],D);const M=D;export{M as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{byId as t}from"../core/domUtils.js";import r from"../core/Evented.js";import{isEventTarget as o,on as s}from"../core/events.js";import i from"../core/Handles.js";import"../core/has.js";import{clone as n}from"../core/lang.js";import a from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{EsriPromiseMixin as d}from"../core/Promise.js";import{debounce as l,throwIfNotAbortError as p,eachAlways as h}from"../core/promiseUtils.js";import{watch as m,when as u,initial as y}from"../core/reactiveUtils.js";import{generateUUID as g}from"../core/uuid.js";import{property as _}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{runTracked as j}from"../core/accessorSupport/tracking.js";import{SimpleTrackingTarget as w}from"../core/accessorSupport/tracking/SimpleTrackingTarget.js";import{createAdvancedProjector as b}from"../libs/maquette-advanced-projector/projector.js";import{commitAssetPath as k}from"./support/componentsUtils.js";import{isWidgetConstructor as R,processWidgets as C,WIDGET_SYMBOL as S}from"./support/jsxWidgetSupport.js";import{registerLoading as P}from"./support/tests.js";import{getVNodeCache as E,setVNodeCache as L,deleteVNodeCache as N,clearVNodeCache as T}from"./support/vnodeCache.js";import{classes as H}from"./support/widgetUtils.js";import{onLocaleChange as I}from"../intl/locale.js";import{fetchMessageBundle as F}from"../intl/messages.js";const U="esri.widgets.Widget";let $=0;const x={widgetIcon:"esri-icon-checkbox-unchecked"};function z(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?z(e[r],t?.[r]):e[r]=t[r]);return e}const A=b({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,o,s,i)=>{const n=t?.(e,o,s,i),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in s)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n?.call(s,e);s.addEventListener(t,r,a);const o=()=>s.removeEventListener(t,r,a),c=i.afterRemoved;i.afterRemoved=e=>{c?.(e),o()}}return n}},handleInterceptedEvent(e,t,r,o){const{eventPhase:s,type:i}=o,n=s===Event.CAPTURING_PHASE;let a=`on${i}${n?"capture":""}`;const c=t.properties;(c&&a in c||(a=`on${i[0].toUpperCase()}${i.slice(1)}${n?"Capture":""}`,c&&a in c))&&(T(),e.scheduleRender(),c[a].call(c.bind||r,o))}});let B=!1,D=class extends(d(r.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._internalHandles=new i,this._projector=A,this._readyForTrueRender=!1,this.domNode=null,this.iconClass=x.widgetIcon,this.label=this.declaredClass.split(".").pop(),this.key=this,this._loadLocale=l((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await h(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await F(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=z(n(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&a.getLogger(this.declaredClass).error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),k();const r="esri-widget-uid-"+g(),o=this.render.bind(this);this._trackingTarget=new w((()=>this.scheduleRender()));const s=()=>{if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:r,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0};const e=o();let{properties:t}=e;t||(e.properties=t={});let{key:s,styles:i}=t;s||(t.key=r),i||(t.styles=i={}),i.display||(i.display="");let n=0;return e.children?.forEach((e=>{if(R(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${n++}`)})),C(this,e)};this.render=()=>{if(B)return s();let e=E(this)??null;if(e)return e;this._trackingTarget.clear(),B=!0;try{e=j(this._trackingTarget,s)}catch(t){throw console.error(t),t}finally{B=!1}return e&&L(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()}))),P(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(p)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(c(this._trackingTarget),c(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,N(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return t(e)}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+$++}set id(e){e&&this._set("id",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get test(){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(N(this),this._projector.scheduleRender())}classes(...e){return H.apply(this,e)}renderNow(){N(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this._internalHandles.add(m((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&o(e)&&this._internalHandles.add(this._delegatedEventNames.map((t=>s(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),y)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(p),this.scheduleRender()};this._internalHandles.add([I(e),m((()=>this.uiStrings),e),u((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){e&&this._attached&&(this._projector.detach(this.render),e.parentNode&&e.parentNode.removeChild(e),this._attached=!1)}};D[S]=!0,e([_()],D.prototype,"_readyForTrueRender",void 0),e([_({value:null})],D.prototype,"container",null),e([v("container")],D.prototype,"castContainer",null),e([_({aliasOf:"container"})],D.prototype,"domNode",void 0),e([_()],D.prototype,"iconClass",void 0),e([_()],D.prototype,"id",null),e([_()],D.prototype,"label",void 0),e([_()],D.prototype,"renderable",null),e([_()],D.prototype,"uiStrings",void 0),e([_()],D.prototype,"viewModel",void 0),e([_({value:!0})],D.prototype,"visible",null),e([_()],D.prototype,"key",void 0),e([_()],D.prototype,"children",void 0),e([_()],D.prototype,"afterCreate",void 0),e([_()],D.prototype,"afterUpdate",void 0),e([_()],D.prototype,"afterRemoved",void 0),D=e([f(U)],D);const M=D;export{M as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2723],{10699:(e,t,r)=>{r.d(t,{IG:()=>l});var i=r(43697),s=r(52011);let o=0;const l=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+o++})}};return t=(0,i._)([(0,s.j)("esri.core.Identifiable")],t),t};let n=class extends(l(class{})){};n=(0,i._)([(0,s.j)("esri.core.Identifiable")],n)},16453:(e,t,r)=>{r.d(t,{R:()=>m,w:()=>_});var i=r(43697),s=r(15923),o=r(70586),l=r(41103),n=r(22974),a=r(31263);class p{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.kk),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new p,r=this._originStores[a.s3.DEFAULTS];r&&r.forEach(((e,r)=>{t.set(r,(0,n.d9)(e),a.s3.DEFAULTS)}));for(let r=a.s3.SERVICE;r<a.kk;r++){const i=this._originStores[r];i&&i.forEach(((i,s)=>{e&&e.has(s)||t.set(s,(0,n.d9)(i),r)}))}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=a.s3.USER){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(e,t),!this._values.has(e)||(0,o.j0)(this._propertyOriginMap.get(e))<=r){const i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),i!==t}return!1}delete(e,t=a.s3.USER){const r=this._originStores[t];if(!r)return;const i=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],i=r&&r.get(e),s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),s!==i}originOf(e){return this._propertyOriginMap.get(e)||a.s3.DEFAULTS}forEach(e){this._values.forEach(e)}}var u=r(50549),h=r(1153),c=r(52011);const d=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,o.j0)((0,h.vw)(this)),r=t.store,i=new p;t.store=i,(0,l.M)(t,r,i)}read(e,t){(0,u.i)(this,e,t)}getAtOrigin(e,t){const r=g(this),i=(0,a.M9)(t);if("string"==typeof e)return r.get(e,i);const s={};return e.forEach((e=>{s[e]=r.get(e,i)})),s}originOf(e){return(0,a.x3)(this.originIdOf(e))}originIdOf(e){return g(this).originOf(e)}revert(e,t){const r=g(this),i=(0,a.M9)(t),s=(0,h.vw)(this);let o;o="string"==typeof e?"*"===e?r.keys(i):[e]:e,o.forEach((e=>{s.invalidate(e),r.revert(e,i),s.commit(e)}))}};return t=(0,i._)([(0,c.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function g(e){return(0,h.vw)(e).store}let y=class extends(d(s.Z)){};y=(0,i._)([(0,c.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],y);var b=r(76169);const v=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return f(this).delete(e,(0,a.M9)(t))}write(e={},t){return(0,b.c)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,h.vw)(this).setAtOrigin(e,t,(0,a.M9)(r))}removeOrigin(e){const t=f(this),r=(0,a.M9)(e),i=t.keys(r);for(const e of i)t.originOf(e)===r&&t.set(e,t.get(e,r),a.s3.USER)}updateOrigin(e,t){const r=f(this),i=(0,a.M9)(t),s=this.get(e);for(let t=i+1;t<a.kk;++t)r.delete(e,t);r.set(e,s,i)}toJSON(e){return this.write({},e)}};return t=(0,i._)([(0,c.j)("esri.core.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function f(e){return(0,h.vw)(e).store}const m=e=>{let t=class extends(v(d(e))){constructor(...e){super(...e)}};return t=(0,i._)([(0,c.j)("esri.core.MultiOriginJSONSupport")],t),t};let _=class extends(m(s.Z)){};_=(0,i._)([(0,c.j)("esri.core.MultiOriginJSONSupport")],_)},2723:(e,t,r)=>{r.r(t),r.d(t,{default:()=>C});var i=r(43697),s=r(3172),o=r(20102),l=r(35454),n=r(70586),a=r(16453),p=r(5600),u=(r(67676),r(80442),r(75215),r(52011)),h=r(82971),c=r(6570),d=r(24470),g=r(87085),y=r(71612),b=r(34760),v=r(72965),f=r(11145);const m={id:"0/0/0",level:0,row:0,col:0,extent:null};let _=class extends((0,y.h)((0,v.M)((0,b.Q)(g.Z)))){constructor(){super(...arguments),this.tileInfo=f.Z.create({spatialReference:h.Z.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new c.Z(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,h.Z.WebMercator),this.spatialReference=h.Z.WebMercator}getTileBounds(e,t,r,i){const s=i||(0,d.Ue)();return m.level=e,m.row=t,m.col=r,m.extent=s,this.tileInfo.updateTileInfo(m),m.extent=null,s}fetchTile(e,t,r,i={}){const{signal:o}=i,l=this.getTileUrl(e,t,r),n={responseType:"image",signal:o,query:{...this.refreshParameters}};return(0,s.default)(l,n).then((e=>e.data))}getTileUrl(){throw new o.Z("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};(0,i._)([(0,p.Cb)({type:f.Z})],_.prototype,"tileInfo",void 0),(0,i._)([(0,p.Cb)({type:["show","hide"]})],_.prototype,"listMode",void 0),(0,i._)([(0,p.Cb)({readOnly:!0,value:"base-tile"})],_.prototype,"type",void 0),(0,i._)([(0,p.Cb)({nonNullable:!0})],_.prototype,"fullExtent",void 0),(0,i._)([(0,p.Cb)()],_.prototype,"spatialReference",void 0),_=(0,i._)([(0,u.j)("esri.layers.BaseTileLayer")],_);const w=_;var M=r(38009);const S=new l.X({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"});let O=class extends((0,y.h)((0,M.q)((0,a.R)(w)))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new f.Z({size:[256,256],dpi:96,origin:{x:-20037508.342787,y:20037508.342787,spatialReference:h.Z.WebMercator},spatialReference:h.Z.WebMercator,lods:[{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176},{level:20,resolution:.1492910708238085,scale:564.248588}]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return(0,n.pC)(this.bingMetadata)?this.bingMetadata.copyright:null}get operationalLayerType(){return S.toJSON(this.style)}get bingLogo(){return(0,n.pC)(this.bingMetadata)?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then((()=>this._getMetadata()))):this.addResolvingPromise(Promise.reject(new o.Z("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,r){if(!this.loaded||(0,n.Wi)(this.bingMetadata))return null;const i=this.bingMetadata.resourceSets[0].resources[0],s=i.imageUrlSubdomains[t%i.imageUrlSubdomains.length],o=this._getQuadKey(e,t,r);return i.imageUrl.replace("{subdomain}",s).replace("{quadkey}",o)}async fetchAttributionData(){return this.load().then((()=>(0,n.Wi)(this.bingMetadata)?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map((e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map((e=>({zoomMin:e.zoomMin,zoomMax:e.zoomMax,score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]})))})))}))}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return(0,s.default)(`https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then((e=>{const t=e.data;if(200!==t.statusCode)throw new o.Z("bingmapslayer:getmetadata",t.statusDescription);if(this.bingMetadata=t,0===this.bingMetadata.resourceSets.length)throw new o.Z("bingmapslayer:getmetadata","no bing resourcesets");if(0===this.bingMetadata.resourceSets[0].resources.length)throw new o.Z("bingmapslayer:getmetadata","no bing resources")})).catch((e=>{throw new o.Z("bingmapslayer:getmetadata",e.message)}))}_getPortalBingKey(){return(0,s.default)(this.portalUrl,{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then((e=>{if(!e.data.bingKey)throw new o.Z("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey})).catch((e=>{throw new o.Z("bingmapslayer:getportalbingkey",e.message)}))}_getQuadKey(e,t,r){let i="";for(let s=e;s>0;s--){let e=0;const o=1<<s-1;0!=(r&o)&&(e+=1),0!=(t&o)&&(e+=2),i+=e.toString()}return i}};(0,i._)([(0,p.Cb)({json:{read:!1,write:!1},value:null})],O.prototype,"bingMetadata",null),(0,i._)([(0,p.Cb)({json:{read:!1,write:!1},value:"bing-maps",readOnly:!0})],O.prototype,"type",void 0),(0,i._)([(0,p.Cb)({type:f.Z})],O.prototype,"tileInfo",void 0),(0,i._)([(0,p.Cb)({type:String,readOnly:!0,json:{read:!1,write:!1}})],O.prototype,"copyright",null),(0,i._)([(0,p.Cb)({type:String,json:{write:!1,read:!1}})],O.prototype,"key",void 0),(0,i._)([(0,p.Cb)({type:S.apiValues,nonNullable:!0,json:{read:{source:"layerType",reader:S.read}}})],O.prototype,"style",void 0),(0,i._)([(0,p.Cb)({type:["BingMapsAerial","BingMapsHybrid","BingMapsRoad"]})],O.prototype,"operationalLayerType",null),(0,i._)([(0,p.Cb)({type:String,json:{write:!1,read:!1}})],O.prototype,"culture",void 0),(0,i._)([(0,p.Cb)({type:String,json:{write:!1,read:!1}})],O.prototype,"region",void 0),(0,i._)([(0,p.Cb)({type:String,json:{write:!0,read:!0}})],O.prototype,"portalUrl",void 0),(0,i._)([(0,p.Cb)({type:Boolean,json:{write:!1,read:!1}})],O.prototype,"hasAttributionData",void 0),(0,i._)([(0,p.Cb)({type:String,readOnly:!0})],O.prototype,"bingLogo",null),O=(0,i._)([(0,u.j)("esri.layers.BingMapsLayer")],O);const C=O},87085:(e,t,r)=>{r.d(t,{Z:()=>m});var i=r(43697),s=(r(66577),r(3172)),o=r(20102),l=r(32448),n=r(10699),a=r(83379),p=r(92604),u=r(95330),h=r(17452),c=r(5600),d=(r(67676),r(80442),r(75215),r(52011)),g=r(68773),y=r(6570),b=r(82971);let v=0,f=class extends(l.Z.EventedMixin((0,n.IG)(a.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.Z(-180,-90,180,90,b.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=b.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},i=await Promise.all([r.e(4547),r.e(8008)]).then(r.bind(r,28008));try{return await i.fromItem(t)}catch(e){const r=t&&t.portalItem,i=r&&r.id||"unset",s=r&&r.portal&&r.portal.url||g.Z.portalUrl;throw p.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,u.D_)(e)||p.Z.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){if(this.parent){const e=this,t=this.parent;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"baseLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){const e=this.url;return e?(0,h.mN)(e):null}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.default)(e,{query:{f:"json"},responseType:"json"})).data;throw new o.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,c.Cb)({type:String})],f.prototype,"attributionDataUrl",void 0),(0,i._)([(0,c.Cb)({type:y.Z})],f.prototype,"fullExtent",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],f.prototype,"hasAttributionData",null),(0,i._)([(0,c.Cb)({type:String,clonable:!1})],f.prototype,"id",void 0),(0,i._)([(0,c.Cb)({type:Boolean,nonNullable:!0})],f.prototype,"legendEnabled",void 0),(0,i._)([(0,c.Cb)({type:["show","hide","hide-children"]})],f.prototype,"listMode",void 0),(0,i._)([(0,c.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],f.prototype,"opacity",void 0),(0,i._)([(0,c.Cb)({clonable:!1})],f.prototype,"parent",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],f.prototype,"parsedUrl",null),(0,i._)([(0,c.Cb)({type:Boolean})],f.prototype,"popupEnabled",void 0),(0,i._)([(0,c.Cb)({type:Boolean})],f.prototype,"attributionVisible",void 0),(0,i._)([(0,c.Cb)({type:b.Z})],f.prototype,"spatialReference",void 0),(0,i._)([(0,c.Cb)({type:String})],f.prototype,"title",void 0),(0,i._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],f.prototype,"type",void 0),(0,i._)([(0,c.Cb)()],f.prototype,"url",void 0),(0,i._)([(0,c.Cb)({type:Boolean,nonNullable:!0})],f.prototype,"visible",void 0),f=(0,i._)([(0,d.j)("esri.layers.Layer")],f);const m=f},34760:(e,t,r)=>{r.d(t,{Q:()=>v});var i=r(43697),s=r(92604),o=r(95330),l=r(5600),n=(r(67676),r(80442),r(75215),r(52011)),a=r(46791),p=(r(20102),r(26258),r(87538));const u=new a.Z,h=new WeakMap;function c(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let g=0,y=0;function b(){const e=Date.now();for(const t of u)t.refreshInterval&&e-(h.get(t)??0)+5>=6e4*t.refreshInterval&&(h.set(t,e),t.refresh(e))}(0,p.EH)((()=>{const e=Date.now();let t=0;for(const r of u)t=d(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?h.get(r)||h.set(r,e):h.delete(r);if(t!==y){if(y=t,clearInterval(g),0===y)return void(g=0);g=setInterval(b,y)}}));const v=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){c(e)&&u.push(e)}(this)}),(()=>{}))}destroy(){var e;c(e=this)&&u.includes(e)&&u.remove(e)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{s.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,i._)([(0,l.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,i._)([(0,l.Cb)()],t.prototype,"refreshParameters",null),t=(0,i._)([(0,n.j)("esri.layers.mixins.RefreshableLayer")],t),t}},39450:(e,t,r)=>{r.d(t,{Z:()=>u});var i,s=r(43697),o=r(96674),l=r(5600),n=(r(67676),r(80442),r(75215)),a=r(52011);let p=i=class extends o.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s._)([(0,l.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"cols",void 0),(0,s._)([(0,l.Cb)({type:n.z8,json:{write:!0}})],p.prototype,"level",void 0),(0,s._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"levelValue",void 0),(0,s._)([(0,l.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"origin",void 0),(0,s._)([(0,l.Cb)({type:Number,json:{write:!0}})],p.prototype,"resolution",void 0),(0,s._)([(0,l.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"rows",void 0),(0,s._)([(0,l.Cb)({type:Number,json:{write:!0}})],p.prototype,"scale",void 0),p=i=(0,s._)([(0,a.j)("esri.layers.support.LOD")],p);const u=p},11145:(e,t,r)=>{r.d(t,{Z:()=>O});var i,s=r(43697),o=r(35454),l=r(96674),n=r(70586),a=r(67900),p=r(5600),u=(r(67676),r(80442),r(75215)),h=r(71715),c=r(52011),d=r(30556),g=r(13473),y=r(82971),b=r(24470),v=r(8744),f=r(40488),m=r(39450);const _=new o.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=i=class extends l.wq{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:r,size:s=256,spatialReference:o=y.Z.WebMercator,numLODs:l=24}=e;if(!(0,v.JY)(o)){const e=[];if(r)for(let t=0;t<r.length;t++){const i=r[t];e.push({level:t,scale:i,resolution:i})}else{let t=5e-4;for(let r=l-1;r>=0;r--)e.unshift({level:r,scale:t,resolution:t}),t*=2}return new i({dpi:96,lods:e,origin:new g.Z(0,0,o),size:[s,s],spatialReference:o})}const n=(0,v.C5)(o),p=e.origin?new g.Z({x:e.origin.x,y:e.origin.y,spatialReference:o}):new g.Z(n?{x:n.origin[0],y:n.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),u=1/(39.37*(0,a.c9)(o)*96),h=[];if(r)for(let e=0;e<r.length;e++){const t=r[e],i=t*u;h.push({level:e,scale:t,resolution:i})}else{let e=(0,v.sT)(o)?512/s*591657527.5917094:256/s*591657527.591555;const r=Math.ceil(l/t);h.push({level:0,scale:e,resolution:e*u});for(let i=1;i<r;i++){const r=e/2**t,s=r*u;h.push({level:i,scale:r,resolution:s}),e=r}}return new i({dpi:96,lods:h,origin:p,size:[s,s],spatialReference:o})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const r=(0,v.C5)(e);return e.isWrappable&&Math.abs(r.origin[0]-t.x)<=r.dx}return!1}readOrigin(e,t){return g.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,r=0;const i=[];this._levelToLOD={},e&&(t=-1/0,r=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,r=e.scale<r?e.scale:r,this._levelToLOD[e.level]=e}))),this._set("scales",i),this._set("minScale",t),this._set("maxScale",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const r=Math.floor(e),i=r+1;return t[r]/(t[r]/t[i])**(e-r)}scaleToZoom(e){const t=this.scales,r=t.length-1;let i=0;for(;i<r;i++){const r=t[i],s=t[i+1];if(r<=e)return i;if(s===e)return i+1;if(r>e&&s<e)return i+Math.log(r/e)/Math.log(r/s)}return i}snapScale(e,t=.95){const r=this.scaleToZoom(e);return r%Math.floor(r)>=t?this.zoomToScale(Math.ceil(r)):this.zoomToScale(Math.floor(r))}tileAt(e,t,r,i){const s=this.lodAt(e);if(!s)return null;let o,l;if("number"==typeof t)o=t,l=r;else if((0,v.fS)(t.spatialReference,this.spatialReference))o=t.x,l=t.y,i=r;else{const e=(0,f.iV)(t,this.spatialReference);if((0,n.Wi)(e))return null;o=e.x,l=e.y,i=r}const a=s.resolution*this.size[0],p=s.resolution*this.size[1];return i||(i={id:null,level:0,row:0,col:0,extent:(0,b.Ue)()}),i.level=e,i.row=Math.floor((this.origin.y-l)/p+.001),i.col=Math.floor((o-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let r=this.lodAt(e.level);if(!r&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(r=t)}if(!r)return;const s=e.level-r.level,o=r.resolution*this.size[0]/2**s,l=r.resolution*this.size[1]/2**s;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,b.Ue)()),e.extent[0]=this.origin.x+e.col*o,e.extent[1]=this.origin.y-(e.row+1)*l,e.extent[2]=e.extent[0]+o,e.extent[3]=e.extent[1]+l}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const{resolution:r}=this.lodAt(t.level),i=r*this.size[0],s=r*this.size[1];return e[0]=this.origin.x+t.col*i,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+i,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const r=[],s=this.lods.length;for(let e=0;e<s;e++){const i=this.lods[e],s=i.resolution*t;r.push(new m.Z({level:i.level,scale:i.scale,resolution:s}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:r})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let r=0;r<e.length;r++){const i=e[r];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var M,S;(0,s._)([(0,p.Cb)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,s._)([(0,p.Cb)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,s._)([(0,p.Cb)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,s._)([(0,p.Cb)({readOnly:!0})],w.prototype,"isWrappable",null),(0,s._)([(0,p.Cb)({type:g.Z,json:{write:!0}})],w.prototype,"origin",void 0),(0,s._)([(0,h.r)("origin")],w.prototype,"readOrigin",null),(0,s._)([(0,p.Cb)({type:[m.Z],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,s._)([(0,p.Cb)({readOnly:!0})],w.prototype,"minScale",void 0),(0,s._)([(0,p.Cb)({readOnly:!0})],w.prototype,"maxScale",void 0),(0,s._)([(0,p.Cb)({readOnly:!0})],w.prototype,"scales",void 0),(0,s._)([(0,p.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,s._)([(0,h.r)("size",["rows","cols"])],w.prototype,"readSize",null),(0,s._)([(0,d.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],w.prototype,"writeSize",null),(0,s._)([(0,p.Cb)({type:y.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=i=(0,s._)([(0,c.j)("esri.layers.support.TileInfo")],w),M=w||(w={}),(S=M.ExtrapolateOptions||(M.ExtrapolateOptions={}))[S.NONE=0]="NONE",S[S.POWER_OF_TWO=1]="POWER_OF_TWO";const O=w}}]);