@arcgis/core 4.23.0-next.20220130 → 4.23.0-next.20220131

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 (108) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{357033117dfe61eb81ea.js → 0c15d77d8e817cf45a9a.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{e93dfdede0532a89ffa5.js → 2b25fc7945a187c2bb9d.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{7903a3e2e0faff0f86c0.js → 56657f890e0f79f5d2ad.js} +1 -1
  5. package/assets/esri/core/workers/chunks/70d6bb3c7112cb702389.js +1 -0
  6. package/assets/esri/core/workers/chunks/810a763373d7f78ae398.js +1 -0
  7. package/assets/esri/core/workers/chunks/{9d77467aa71d345fc1b6.js → bcc01bbffaa3bb5f60a8.js} +1 -1
  8. package/assets/esri/core/workers/chunks/d98dab12b71912fa397b.js +1 -0
  9. package/assets/esri/core/workers/chunks/{ff6abdc72076f3994659.js → f7150547d7e3259a0f29.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{386f86f961146f530aa7.js → fc046a15466c25d081ff.js} +1 -1
  11. package/assets/esri/images/portal/mediaservice16.png +0 -0
  12. package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
  13. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  14. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  15. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  16. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  17. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  18. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  19. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  20. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  21. package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
  22. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  23. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  24. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  25. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  26. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  27. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  28. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  29. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  30. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  31. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  32. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  33. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  34. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  35. package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
  36. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  37. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  38. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  39. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  40. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  41. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  42. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  43. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  44. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  45. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  46. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  47. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  48. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  49. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  50. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  51. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  52. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  53. package/interfaces.d.ts +449 -45
  54. package/layers/RouteLayer.d.ts +4 -0
  55. package/layers/RouteLayer.js +1 -1
  56. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  57. package/package.json +1 -1
  58. package/portal/PortalItem.js +1 -1
  59. package/rest/support/DirectionLine.d.ts +4 -0
  60. package/rest/support/DirectionPoint.d.ts +4 -0
  61. package/rest/support/RouteInfo.d.ts +4 -0
  62. package/rest/support/RouteInfo.js +1 -1
  63. package/rest/support/RouteSolveResult.d.ts +4 -0
  64. package/support/revision.js +1 -1
  65. package/views/2d/layers/RouteLayerView2D.js +1 -1
  66. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  67. package/views/3d/environment/CloudsComposition.js +1 -1
  68. package/views/3d/environment/CloudsGenerator.js +1 -1
  69. package/views/3d/environment/Fog.js +1 -1
  70. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  71. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  72. package/views/3d/environment/Precipitation.js +1 -1
  73. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  74. package/views/3d/environment/Stars.js +1 -1
  75. package/views/3d/layers/I3SMeshView3D.js +1 -1
  76. package/views/3d/layers/i3s/I3SCrossfadeHelper.js +1 -1
  77. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  78. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  79. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  80. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  81. package/views/3d/support/LaserLineRenderer.js +1 -1
  82. package/views/3d/terrain/OverlayRenderer.js +1 -1
  83. package/views/3d/terrain/TerrainRenderer.js +1 -1
  84. package/views/3d/terrain/TileRenderer.js +1 -1
  85. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  86. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  87. package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
  88. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  89. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  90. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  91. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  92. package/views/3d/webgl-engine/lib/ShadowHighlightHelper.js +1 -1
  93. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  94. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  95. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  96. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  97. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  98. package/widgets/Directions/DirectionsViewModel.js +1 -1
  99. package/widgets/Directions/support/directionsUtils.js +1 -1
  100. package/widgets/Directions/support/resources.js +1 -1
  101. package/widgets/Directions.js +1 -1
  102. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +0 -1
  103. package/assets/esri/core/workers/chunks/fc7e31d87555beb63291.js +0 -1
  104. package/assets/esri/core/workers/chunks/fff6b0338f06dad0c45d.js +0 -1
  105. package/widgets/Directions/support/CostSummary.js +0 -5
  106. package/widgets/Directions/support/RouteSection.js +0 -5
  107. package/widgets/Directions/support/RouteSections.js +0 -5
  108. package/widgets/Directions/support/maneuverUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as e}from"../../../assets.js";const i={base:"esri-directions esri-widget esri-widget--panel",directionsButton:"esri-directions__button",clearRouteButton:"esri-directions__clear-route-button",scroller:"esri-directions__scroller",panelContent:"esri-directions__panel-content",panelContentLoading:"esri-directions__panel-content--loading",panelContentError:"esri-directions__panel-content--error",panelContentSignIn:"esri-directions__panel-content--sign-in",loader:"esri-directions__loader",message:"esri-directions__message",travelModeSelect:"esri-directions__travel-modes-select",departureTime:"esri-directions__departure-time",departureTimeSelect:"esri-directions__departure-time-select",directionsSection:"esri-directions__directions-section",departureTimeControls:"esri-directions__departure-time-controls",section:"esri-directions__section",summary:"esri-directions__summary",stopIcon:"esri-directions__stop-icon",interactiveStopIcon:"esri-directions__stop-icon--interactive",removeStopButton:"esri-directions__remove-stop",removeStop:"esri-directions__remove-stop-icon",reverseStops:"esri-directions__reverse-stops",stopIconContainer:"esri-directions__stop-icon-container",lastStopIconContainer:"esri-directions__stop-icon-container--last",stopHandle:"esri-directions__stop-handle",stopInput:"esri-directions__stop-input",stopOptions:"esri-directions__stop-options",stopHandleIcon:"esri-directions__stop-handle-icon",verticalSplitter:"esri-directions__vertical-splitter",stopRow:"esri-directions__stop-row",stopRowGhost:"esri-directions__stop-row-ghost",validStopRow:"esri-directions__stop-row--valid",stops:"esri-directions__stops",addStop:"esri-directions__add-stop",addStopText:"esri-directions__add-stop-text",directionCosts:"esri-directions__costs",costsDetails:"esri-directions__costs-details",primaryCosts:"esri-directions__costs-value",secondaryCosts:"esri-directions__other-costs-total",routeActions:"esri-directions__route-actions",maneuvers:"esri-directions__maneuvers",maneuverList:"esri-directions__maneuver-list",maneuverSection:"esri-directions__maneuver-section",maneuverSectionHeader:"esri-directions__maneuver-section-header",maneuverSectionHeaderButton:"esri-directions__maneuver-section-header-toggle-button",maneuverSectionTitle:"esri-directions__maneuver-section-title",collapsibleSection:"esri-directions__maneuver-section--collapsible",maneuverSectionToggle:"esri-directions__maneuver-section-toggle",maneuver:"esri-directions__maneuver",maneuverActive:"esri-directions__maneuver--active",maneuverCosts:"esri-directions__maneuver-costs",maneuverCostsContainer:"esri-directions__maneuver-costs-container",maneuverIcon:"esri-directions__maneuver-icon",cumulativeCost:"esri-directions__cost--cumulative",intermediateCost:"esri-directions__cost--intermediate",horizontalSplitter:"esri-directions__horizontal-splitter",sectionSplitter:"esri-directions__section-splitter",disclaimer:"esri-directions__disclaimer",signInContent:"esri-directions__sign-in-content",signInButton:"esri-directions__sign-in-button",contentTitle:"esri-directions__content-title",warningCard:"esri-directions__warning-card",warningHeader:"esri-directions__warning-header",warningHeading:"esri-directions__warning-heading",warningMessage:"esri-directions__warning-message",stopsIcon:"esri-icon-radio-unchecked",lastStopIcon:"esri-icon-radio-checked",handleIcon:"esri-icon-handle-vertical",addStopIcon:"esri-icon-plus",removeStopIcon:"esri-icon-trash",reverseStopIcon:"esri-icon-up-down-arrows",openIcon:"esri-icon-down",closeIcon:"esri-icon-up",warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-directions",anchor:"esri-widget__anchor",button:"esri-button",buttonSecondary:"esri-button--secondary",buttonTertiary:"esri-button--tertiary",emptyContent:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",select:"esri-select",screenReaderText:"esri-icon-font-fallback-text"};var t;!function(e){e.NOW="now",e.DEPART_BY="depart-by",e.UNSPECIFIED="unspecified"}(t||(t={}));const r=()=>e("esri/themes/base/images/maneuvers/");export{i as CSS,t as DepartureTime,r as getManeuversIconDir};
5
+ import{getAssetUrl as e}from"../../../assets.js";import{isNone as t}from"../../../core/maybe.js";const n="esri-directions",r={base:`${n} esri-widget esri-widget--panel`,directionsButton:`${n}__button`,clearRouteButton:`${n}__clear-route-button`,scroller:`${n}__scroller`,panelContent:`${n}__panel-content`,panelContentLoading:`${n}__panel-content--loading`,panelContentError:`${n}__panel-content--error`,panelContentSignIn:`${n}__panel-content--sign-in`,loader:`${n}__loader`,message:`${n}__message`,travelModeSelect:`${n}__travel-modes-select`,departureTime:`${n}__departure-time`,departureTimeSelect:`${n}__departure-time-select`,directionsSection:`${n}__directions-section`,departureTimeControls:`${n}__departure-time-controls`,section:`${n}__section`,summary:`${n}__summary`,stopIcon:`${n}__stop-icon`,interactiveStopIcon:`${n}__stop-icon--interactive`,removeStopButton:`${n}__remove-stop`,removeStop:`${n}__remove-stop-icon`,reverseStops:`${n}__reverse-stops`,stopIconContainer:`${n}__stop-icon-container`,lastStopIconContainer:`${n}__stop-icon-container--last`,stopHandle:`${n}__stop-handle`,stopInput:`${n}__stop-input`,stopOptions:`${n}__stop-options`,stopHandleIcon:`${n}__stop-handle-icon`,verticalSplitter:`${n}__vertical-splitter`,stopRow:`${n}__stop-row`,stopRowGhost:`${n}__stop-row-ghost`,validStopRow:`${n}__stop-row--valid`,stops:`${n}__stops`,addStop:`${n}__add-stop`,addStopText:`${n}__add-stop-text`,directionCosts:`${n}__costs`,costsDetails:`${n}__costs-details`,primaryCosts:`${n}__costs-value`,secondaryCosts:`${n}__other-costs-total`,routeActions:`${n}__route-actions`,maneuvers:`${n}__maneuvers`,maneuverList:`${n}__maneuver-list`,maneuverSection:`${n}__maneuver-section`,maneuverSectionHeader:`${n}__maneuver-section-header`,maneuverSectionHeaderButton:`${n}__maneuver-section-header-toggle-button`,maneuverSectionTitle:`${n}__maneuver-section-title`,collapsibleSection:`${n}__maneuver-section--collapsible`,maneuverSectionToggle:`${n}__maneuver-section-toggle`,maneuver:`${n}__maneuver`,maneuverActive:`${n}__maneuver--active`,maneuverCosts:`${n}__maneuver-costs`,maneuverCostsContainer:`${n}__maneuver-costs-container`,maneuverIcon:`${n}__maneuver-icon`,cumulativeCost:`${n}__cost--cumulative`,intermediateCost:`${n}__cost--intermediate`,horizontalSplitter:`${n}__horizontal-splitter`,sectionSplitter:`${n}__section-splitter`,disclaimer:`${n}__disclaimer`,signInContent:`${n}__sign-in-content`,signInButton:`${n}__sign-in-button`,contentTitle:`${n}__content-title`,warningCard:`${n}__warning-card`,warningHeader:`${n}__warning-header`,warningHeading:`${n}__warning-heading`,warningMessage:`${n}__warning-message`,stopsIcon:"esri-icon-radio-unchecked",lastStopIcon:"esri-icon-radio-checked",handleIcon:"esri-icon-handle-vertical",addStopIcon:"esri-icon-plus",removeStopIcon:"esri-icon-trash",reverseStopIcon:"esri-icon-up-down-arrows",openIcon:"esri-icon-down",closeIcon:"esri-icon-up",warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-directions",anchor:"esri-widget__anchor",button:"esri-button",buttonSecondary:"esri-button--secondary",buttonTertiary:"esri-button--tertiary",emptyContent:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",select:"esri-select",screenReaderText:"esri-icon-font-fallback-text"},o=new Map([["bear-left","bear-left"],["bear-right","bear-right"],["central-fork","fork-middle"],["door","walk-through-door"],["elevator","elevator"],["escalator","escalator"],["left-fork","fork-left"],["left-ramp","ramp-left"],["left-turn","left"],["left-turn-and-immediate-left-turn","left-left"],["left-turn-and-immediate-right-turn","left-right"],["off-ferry","disembark"],["on-ferry","embark"],["pedestrian-ramp","take-pedestrian-ramp"],["right-fork","fork-right"],["right-ramp","exit-highway-right"],["right-ramp","ramp-right"],["right-turn","right"],["right-turn-and-immediate-left-turn","right-left"],["right-turn-and-immediate-right-turn","right-right"],["roundabout","roundabout-left"],["sharp-left","sharp-left"],["sharp-right","sharp-right"],["stairs","stairs"],["straight","straight"],["u-turn","u-turn-left"]]);var i;!function(e){e.NOW="now",e.DEPART_BY="depart-by",e.UNSPECIFIED="unspecified"}(i||(i={}));const a=()=>e("esri/themes/base/images/maneuvers/");function s(e){if(t(e)||!o.has(e))return null;const n=o.get(e),r=2===window.devicePixelRatio?"@2x":"";return`${a()}${n}${r}.png`}export{r as CSS,i as DepartureTime,s as getIconPath,a as getManeuversIconDir};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/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{pausable as s,on as i}from"../core/events.js";import r from"../core/Handles.js";import{init as o,when as n,whenOnce as a,watch as l,on as c}from"../core/watchUtils.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 h}from"../core/accessorSupport/decorators/property.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import p from"./Search.js";import m from"./Widget.js";import v from"./Directions/DirectionsViewModel.js";import _ from"./Directions/support/CostSummary.js";import{formatDistance as g,formatTime as S,getAssociatedStop as w,useSpatiallyLocalTime as M,toSpatiallyLocalTimeString as y}from"./Directions/support/directionsUtils.js";import{toIconName as T}from"./Directions/support/maneuverUtils.js";import{DepartureTime as C,CSS as b,getManeuversIconDir as f}from"./Directions/support/resources.js";import I from"./Directions/support/RouteSections.js";import{isArcGISWorldGeocoder as k,meteredArcGISLocatorUrl as D}from"./Search/support/locatorUtils.js";import R from"./support/DatePicker.js";import{Heading as P,incrementHeadingLevel as x}from"./support/Heading.js";import H from"./support/TimePicker.js";import{accessibleHandler as U}from"./support/decorators/accessibleHandler.js";import{messageBundle as j}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{tsx as E}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import L from"sortablejs";import{substitute as z}from"../intl/substitute.js";import{formatDate as A}from"../intl/date.js";import{formatNumber as O}from"../intl/number.js";const $={awaitingViewClickStop:"awaiting-view-click-stop"};function N(e){return e.results[0].results[0]}function B(){return[{},{}]}const F={hour:"numeric",minute:"numeric"},V={minimumIntegerDigits:2};function W(e){const t=e.getTimezoneOffset(),s=t>0?"-":"+",i=60,r=Math.abs(Math.floor(t/i)),o=Math.abs(Math.floor(t)%i);return`GMT${s}${O(r,V)}${O(o,V)}`}const K=100,q=500;function Y(e){return!(null==e.composedPath||!e.composedPath().find((e=>{var t;return null==(t=e.classList)?void 0:t.contains("esri-search__suggestions-list")})))}let G=class extends m{constructor(e,s){super(e,s),this._autoStopRemovalDelay=K,this._costSummary=new _,this._departureTime=C.NOW,this._datePicker=new R,this._handles=new r,this._newPlaceholderStop=null,this._pointerPressedSearchSuggestionStop=null,this._routeSections=new I,this._stops=new t(B()),this._stopsToSearches=new Map,this._timePicker=new H,this.apiKey=null,this.goToOverride=null,this.headingLevel=2,this.iconClass=b.widgetIcon,this.label=void 0,this.lastRoute=null,this.maxStops=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.routeServiceUrl=void 0,this.routeSymbol=null,this.searchProperties=null,this.stopSymbols=null,this.view=null,this.viewModel=new v,this._setUpDragAndDropStops=e=>{this._sortable=L.create(e,{draggable:`.${b.validStopRow}`,ghostClass:b.stopRowGhost,handle:`.${b.stopHandle}`,onEnd:this._handleStopInputDragEnd})},this._handleDragHandlePointerDown=()=>this._stops.forEach((e=>this._acquireSearch(e).activeMenu="none")),this._handleStopInputDragEnd=({oldIndex:e,newIndex:t,target:s})=>{if(e===t)return;const{children:i}=s,r=i[t],o=i[e],n=t-e<0;s.insertBefore(r,n?o.nextElementSibling:o);const a=this._stops;a.reorder(a.getItemAt(e),t),this._processStops()}}initialize(){this.own([o(this,"viewModel.lastRoute",(()=>{this._routeSections.routePath=this.get("viewModel.directionLines"),this._activeManeuver=null,this._focusedManeuver=null,this.scheduleRender()})),o(this,"viewModel.selectedTravelMode, viewModel.departureTime",(()=>{this.get("viewModel.stops.length")>1&&this.getDirections()})),n(this,"view",((e,t)=>{if(t&&(this._viewClickHandle=null,this._handles.remove(t)),e){const t=this._prepPointerDownUpClick(),s=this._prepViewClick();t.pause(),s.pause(),this._handles.add([i(e.surface,"mousedown",(()=>this._autoStopRemovalDelay=q)),i(e.surface,"mouseup",(()=>this._autoStopRemovalDelay=K)),t,s],this.view.surface),this._pointerDownUpHandle=t,this._viewClickHandle=s}})),a(this,"routeServiceUrl",(()=>this.viewModel.load())),l(this,"viewModel.stops.length",(e=>{0===e&&(this._stops.toArray().forEach((e=>this._removeStop(e,!0))),this._stops.addMany(B()),this.scheduleRender())}))])}destroy(){this._datePicker.destroy(),this._timePicker.destroy(),this._stopsToSearches.forEach((e=>e.destroy())),this._sortable&&this._sortable.destroy()}getDirections(){return null}zoomToRoute(){}render(){return E("div",{class:this.classes(b.base,b.scroller)},this._renderPanelContent())}_renderPanelContent(){const{viewModel:{state:e}}=this,t="initializing"===e,s="error"===e&&!this.viewModel.serviceDescription,i="unauthenticated"===e,r={[b.panelContentLoading]:t,[b.panelContentError]:s,[b.panelContentSignIn]:i},o=t?"presentation":"group",n=i?this._renderSignIn():s?this._renderMessage(this._getErrorMessage()):t?this._renderLoader():this._renderReadyContent();return E("div",{class:this.classes(b.panelContent,r),role:o},n)}_renderReadyContent(){return[this._renderStopsContainer(),this._renderTravelModeOptions(),this._renderDepartureTimeControls(),this._renderSectionSplitter(),this._renderDirectionsContainer(),this._renderDisclaimer()]}_renderSignIn(){return E("div",{key:"sign-in",class:b.signInContent},E(P,{class:b.contentTitle,level:this.headingLevel},this.messages.widgetLabel),this._renderPlaceholder(),E(P,{level:x(this.headingLevel)},this.messages.signInRequired),E("button",{class:this.classes(b.button,b.buttonSecondary,b.signInButton),tabIndex:0,onclick:this._handleSignInClick,bind:this,type:"button"},this.messagesCommon.auth.signIn))}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_renderTravelModeOptions(){const{travelModes:e}=this.viewModel;if(0===e.length)return null;const{selectedTravelMode:t}=this.viewModel,s=t.name||this.messages.travelMode;return E("select",{"aria-label":s,bind:this,class:this.classes(b.travelModeSelect,b.select),key:"esri-directions__travel-mode-options",onchange:this._handleTravelModeChange,title:s},e.map((e=>{const s=e.id===t.id;return E("option",{key:e,"data-mode":e,selected:s,value:e.id},e.name)})))}_handleTravelModeChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);this.viewModel.selectedTravelMode=s["data-mode"]}_renderStopsContainer(){return E("div",{class:b.section,key:"esri-directions__stops-container",role:"group"},this._renderStops())}_renderDepartureTimeControls(){const e=this._departureTime,{messages:t}=this,s=t.departureTime;return E("div",{class:b.departureTime,key:"esri-directions__departure-time-controls",role:"group"},E("select",{"aria-label":s,bind:this,class:this.classes(b.departureTimeSelect,b.select),onchange:this._handleDepartureOptionChange,title:s},E("option",{value:C.NOW,selected:e===C.NOW},t.leaveNow),E("option",{value:C.DEPART_BY,selected:e===C.DEPART_BY},t.departBy),E("option",{value:C.UNSPECIFIED,selected:e===C.UNSPECIFIED},t.timeUnspecified)),e===C.DEPART_BY?this._renderTimeControls():null)}_renderStops(){const e=this._stops;let t=0;e.forEach((e=>{"none"!==this._acquireSearch(e).activeMenu&&(t+=1)}));const s=e.toArray().map(((s,i)=>{const r=e.length,o=i>1&&!s.result,n={[b.stopsIcon]:i>=0&&i<r-1,[b.lastStopIcon]:i===r-1},a={[b.lastStopIconContainer]:i===r-1},l={[b.validStopRow]:!o},c=e.getItemAt(r-1),d=c&&c.result,h=e.getItemAt(i+1),u=h&&h.result,p=i===r-1,m=i===r-2,v=2===r&&0===i||r>2&&!p&&!m||r>2&&m&&u||r>2&&p&&!s.result,_=2===r||3===r&&!d||o,g=this._acquireSearch(s),{messages:S}=this,{removeStop:w,reverseStops:M,unlocated:y}=S,T=z(S.stopLabelTemplate,{number:i+1,label:s.result?s.result.name:y}),C=`${this.id}__stop--${i}`,f=!!g.searchTerm&&!!g.selectedResult&&!!s.result&&g.selectedResult===s.result,I={zIndex:"none"!==g.activeMenu?""+t--:""};return E("li",{"aria-label":T,afterCreate:this._handleStopFieldCreation,bind:this,class:this.classes(b.stopRow,l),id:C,key:i,"data-stop-index":i,styles:I},E("div",{class:b.stopHandle},E("span",{"aria-hidden":"true",class:this.classes(b.stopIcon,b.handleIcon,b.stopHandleIcon,b.interactiveStopIcon),onpointerdown:this._handleDragHandlePointerDown}),E("div",{bind:this,"aria-labelledby":C,class:this.classes(b.stopIconContainer,a),"data-stop-index":i,onclick:this._handleStopIconClick,onkeydown:this._handleStopIconClick,role:"button"},E("span",{class:this.classes(b.stopIcon,n),tabindex:f?"0":null}))),E("div",{class:b.stopInput},g.render()),E("div",{class:b.stopOptions,role:"group"},E("div",{"aria-label":w,class:b.removeStopButton,bind:this,"data-stop-index":i,hidden:_,onkeydown:this._handleRemoveStop,onclick:this._handleRemoveStop,role:"button",tabIndex:0,title:w},E("span",{"aria-hidden":"true",class:this.classes(b.stopIcon,b.removeStop,b.removeStopIcon,b.interactiveStopIcon)}),E("span",{class:b.screenReaderText},"removeStopTitle")),E("div",{"aria-label":M,class:b.reverseStops,bind:this,hidden:v,onkeydown:this._handleReverseStops,onclick:this._handleReverseStops,role:"button",tabIndex:0,title:M},E("span",{"aria-hidden":"true",class:this.classes(b.stopIcon,b.reverseStopIcon,b.interactiveStopIcon)}),E("span",{class:b.screenReaderText},"removeStopTitle"))))})),i=e.every((e=>{const t=this._stopsToSearches.get(e);return e.result&&t.selectedResult===e.result})),r=this._stops.length>=this.maxStops,o=this.messages.addStop,n=e.length>=2&&i&&!r?E("div",{"aria-label":o,bind:this,class:b.addStop,key:"esri-directions__add-stop",onfocus:this._handleAddStopFocus,tabIndex:0},E("span",{"aria-hidden":"true",class:this.classes(b.addStopIcon,b.stopIcon,b.interactiveStopIcon)}),E("div",{"aria-hidden":"true",class:b.addStopText},o)):null;return E("div",null,E("ol",{class:b.stops,role:"group",afterCreate:this._setUpDragAndDropStops},s),n)}_handleStopIconClick(e){const t=e.currentTarget["data-stop-index"],s=this._stops.getItemAt(t);s&&s.result&&this._centerAtStop(s)}_handleClearRouteClick(){this.viewModel.reset()}_centerAtStop(e){this.viewModel.centerAt(e.result.feature)}_handleStopFieldCreation(e){const t=this._newPlaceholderStop;if(!t)return;const s=e["data-stop-index"],i=this._stops.getItemAt(s);if(t===i){const e=this._acquireSearch(i);e.when((()=>{this.renderNow(),e.focus()}))}this._newPlaceholderStop=null}_handleStopInputBlur(e,t){this._handles.remove($.awaitingViewClickStop),this.view.cursor=this._previousCursor;if(!e.selectedResult||!t.result||e.selectedResult!==t.result)return"none"!==e.activeMenu||!e.searchTerm||e.selectedResult===t.result&&(e.selectedResult||t.result)?void(e.searchTerm||(this._viewClickHandle.resume(),clearTimeout(this._autoStopRemovalTimeoutId),this._autoStopRemovalTimeoutId=setTimeout((()=>{if(this.destroyed)return;if(this._viewClickHandle.pause(),"searching"===e.viewModel.state)return void this._pointerDownUpHandle.pause();if(this._pointerPressedSearchSuggestionStop)return;this._removeStop(t);!!t.result&&(t.result=null,this._processStops()),this.scheduleRender()}),this._autoStopRemovalDelay))):(e.search(),void this._pointerDownUpHandle.pause());this._pointerDownUpHandle.pause()}_handleStopInputFocus(e,t){if(this._pointerDownUpHandle.resume(),this._handles.has($.awaitingViewClickStop))return;const{view:s,view:{cursor:i}}=this;this._previousCursor=i,this._handles.add(o(e,"searchTerm",(e=>{s.cursor=0===e.length?"copy":i})),$.awaitingViewClickStop),this._activeStop=t}_prepViewClick(){const e=this.get("viewModel.view"),t=s(e,"click",this._handleViewClick.bind(this)),i=s(e.surface,"click",(()=>{clearTimeout(this._autoStopRemovalTimeoutId),i.pause()}));return{remove(){i.remove(),t.remove()},pause(){i.pause(),t.pause()},resume(){i.resume(),t.resume()}}}_prepPointerDownUpClick(){const e=s(document,"pointerdown",(e=>{this._pointerPressedSearchSuggestionStop=Y(e)?this._activeStop:null})),t=s(document,"pointerup",(e=>{this._pointerDownUpHandle.pause();const t=Y(e),s=this._activeStop;t||s!==this._pointerPressedSearchSuggestionStop||this._removeStop(s),this.scheduleRender(),this._pointerPressedSearchSuggestionStop=t?this._activeStop:null}));return{remove(){t.remove(),e.remove()},pause(){t.pause(),e.pause()},resume(){e.resume()}}}_handleViewClick(e){const t=this._stopsToSearches.get(this._activeStop);t&&!t.searchTerm&&(t.search(e.mapPoint).then((e=>{const s=N(e),i=this._activeStop;i.result=s,i.result.feature.attributes.Name=s.name,t.searchTerm=s.name})),this.scheduleRender()),this._viewClickHandle.pause(),clearTimeout(this._autoStopRemovalTimeoutId)}_handleAddStopFocus(){this._addNewPlaceholder()}_addNewPlaceholder(){if(this._pointerDownUpHandle.pause(),this._newPlaceholderStop)return;const e={};this._stops.add(e),this._newPlaceholderStop=e}_handleReverseStops(){this._reverseStops()}_reverseStops(){this._stops.reverse(),this._processStops()}_handleRemoveStop(e){const t=e.currentTarget["data-stop-index"];this._removeStop(this._stops.getItemAt(t)),this._processStops()}_removeStop(e,t=!1){this._stops.length<=2&&!t||(this._disposeSearch(e),this._stops.remove(e))}_handleDepartureOptionChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);s.value===C.NOW?(this._departureTime=C.NOW,this.viewModel.departureTime=C.NOW,this._handles.remove("departure-time-controls")):s.value===C.DEPART_BY?(this._departureTime=C.DEPART_BY,this._handles.add([o(this._datePicker,"value",(()=>this._updateDepartureTime())),o(this._timePicker,"value",(()=>this._updateDepartureTime()))],"departure-time-controls")):(this._departureTime=C.UNSPECIFIED,this.viewModel.departureTime=null)}_updateDepartureTime(){const e=this._datePicker.value,t=this._timePicker.value;this.viewModel.departureTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes())}_renderTimeControls(){return E("div",{class:b.departureTimeControls,key:"esri-directions__time-controls",role:"group"},this._datePicker.render(),this._timePicker.render())}_renderSectionSplitter(){return E("div",{class:b.sectionSplitter})}_renderDisclaimer(){const{messages:e}=this,t=`<a class="${b.anchor}" href="http://www.esri.com/legal/software-license" rel="noreferrer" target="_blank">${e.esriTerms}</a>`,s=z(e.disclaimer,{esriTerms:t});return E("div",{class:b.disclaimer,innerHTML:s,key:"esri-directions__disclaimer"})}_renderDirectionsContainer(){return E("div",{class:this.classes(b.directionsSection,b.section),key:"esri-directions__container"},this._renderDirectionsContainerContent())}_renderLoader(){return E("div",{class:b.loader,key:"loader"})}_renderWarningCard(){return E("div",{class:b.warningCard,role:"alert"},E("div",{class:b.warningHeader},E("span",{class:b.warningIcon,"aria-hidden":"true"}),E(P,{class:b.warningHeading,level:this.headingLevel},this.messagesCommon.warning)),E("div",{class:b.warningMessage},this._getErrorMessage()))}_renderDirectionsContainerContent(){const{lastRoute:e,state:t}=this.viewModel,s="routing"===t;return"error"===t?this._renderWarningCard():s?this._renderLoader():e?E("div",{class:b.summary,key:"esri-directions__summary",role:"group"},this._renderCosts(),this._renderRouteActions(),this._renderManeuverSections()):E("div",{key:"esri-directions__placeholder",class:b.emptyContent},this._renderPlaceholder(),E(P,{class:b.message,level:this.headingLevel},this.messages.directionsPlaceholder))}_renderPlaceholder(){return E("svg",{class:b.emptyIllustration,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},E("path",{fill:"currentcolor",d:"M192 36c-15.477 0-24 6.034-24 16.99v45.822l24 24 24-24v-45.82C216 42.033 207.477 36 192 36zm20 61.155l-20 20-20-20V52.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM192 52a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zM92 140.99C92 130.035 83.477 124 68 124s-24 6.034-24 16.99v45.822l24 24 24-24zm-4 44.165l-20 20-20-20V140.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM68 140a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zm84-44h16v4h-16zm-24 80h4v12h-12v-4h8zm0-28h4v16h-4zm0-52h12v4h-8v8h-4zm0 24h4v16h-4zm-36 64h16v4H92z"}))}_renderMessage(e){return E(P,{level:this.headingLevel},e)}_renderRouteActions(){return E("div",{class:b.routeActions},E("button",{"aria-label":this.messages.clearRoute,class:this.classes(b.clearRouteButton,b.button,b.buttonTertiary),tabIndex:0,onclick:this._handleClearRouteClick,bind:this,type:"button"},this.messages.clearRoute))}_renderManeuverSections(){const{sections:e}=this._routeSections;return E("div",{class:b.maneuvers,role:"group"},e.map(((t,s)=>{const{open:i}=t;let r;t.maneuvers.length>0&&i&&(r=E("ol",{class:b.maneuverList},t.maneuvers.map((e=>this._renderManeuver(e)))));const o=e.length>2,n=s===e.length-1,a={[b.collapsibleSection]:o},l={[b.openIcon]:!i,[b.closeIcon]:i};let c;if(o&&!n){const e=i?this.messagesCommon.open:this.messagesCommon.close;c=E("header",{class:this.classes(b.maneuverSectionHeader,b.maneuverSectionToggle),key:"esri-directions__maneuver-section-header"},E("div",{"aria-expanded":i.toString(),"aria-label":e,bind:this,class:b.maneuverSectionHeaderButton,"data-maneuver-section":t,onkeydown:this._handleSectionToggle,onclick:this._handleSectionToggle,role:"button",tabIndex:0,title:e},E(P,{class:b.maneuverSectionTitle,level:this.headingLevel},t.name),E("span",{"aria-hidden":"true",class:this.classes(l)})))}else c=E("header",{class:b.maneuverSectionHeader,key:"esri-directions__maneuver-section-header"},E(P,{class:b.maneuverSectionTitle,level:this.headingLevel},t.name));return E("section",{class:this.classes(b.maneuverSection,a)},c,r)})))}_handleSectionToggle(e){const t=e.currentTarget["data-maneuver-section"];t.open=!t.open}_renderCosts(){const e=this.get("viewModel.directionLines"),t=e[e.length-1],s=new Date(t.attributes.arriveTimeUTC),i=this._costSummary.set({directionsViewModel:this.viewModel,messages:this.messages,messagesUnits:this.messagesUnits}),{messages:r}=this,o=r.zoomToRoute,n=A(s,F),a=z(r.etaTemplate,{time:`<strong>${n}</strong>`,gmt:`${W(s)}`}),l=r.primaryCosts,c=r.secondaryCosts,d=r.eta;return E("div",{"aria-label":o,bind:this,class:b.directionCosts,onkeydown:this._handleSummaryInteraction,onclick:this._handleSummaryInteraction,role:"button",tabIndex:0,title:o},E("div",{class:b.costsDetails,role:"group"},E("div",{"aria-label":l,class:b.primaryCosts,title:l},i.primary),E("div",{class:b.verticalSplitter}),E("div",{"aria-label":c,class:b.secondaryCosts,title:c},i.secondary)),E("div",{"aria-label":d,innerHTML:a,title:d}))}_handleSummaryInteraction(){this._activeManeuver=null,this._focusedManeuver=null,this.viewModel.clearHighlights(),this.zoomToRoute()}_getErrorMessage(){const{messages:e}=this,{error:t}=this.viewModel;return"directions-view-model:unable-to-route"===t.name?e.errors.unableToRoute:"directions-view-model:service-metadata-unavailable"===t.name?e.errors.unableToLoadServiceMetadata:e.errors.unknownError}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){e.viewModel.defaultSources.forEach((e=>{e.autoNavigate=!1}))}_applyLocatorSourceOverrides({allSources:e}){0!==e.length&&e.forEach((e=>{"url"in e&&e.url&&(null===e.locationType&&(e.locationType="street"),k(e.url)&&this.apiKey&&null==e.apiKey&&(e.apiKey=this.apiKey,e.url=D))}))}_acquireSearch(e){const t=this.get("viewModel.view");if(this._stopsToSearches.has(e)){const s=this._stopsToSearches.get(e);return s.view=t,this._overrideDefaultSources(s),s}const s=new p({view:t,resultGraphicEnabled:!1,popupEnabled:!1,...this.searchProperties});return this._normalizeSearchSources(s),this._handles.add([c(s,"allSources","change",(()=>this._normalizeSearchSources(s))),s.on("select-result",(()=>{e.result=s.selectedResult,e.result.feature.attributes.Name=s.selectedResult.name,this._processStops(),this.scheduleRender()})),s.on("search-focus",(()=>this._handleStopInputFocus(s,e))),s.on("search-blur",(()=>this._handleStopInputBlur(s,e)))],s),this._stopsToSearches.set(e,s),s}_disposeSearch(e){this._stopsToSearches.get(e).destroy(),this._stopsToSearches.delete(e)}_processStops(){const e=this.viewModel;e.stops.removeAll(),e.stops.addMany(this._stops.filter((e=>!!e.result)).map((e=>e.result.feature))),e.stops.length>1&&e.getDirections()}_renderManeuver(e){const t="";let s;const{attributes:i}=e,r=this.get("viewModel.routeParameters.directionsLengthUnits"),{messages:o,messagesUnits:n}=this,a=g(o,n,i.length,{toUnits:r}),l=S(i.time),c=w(e);M(e,this.get("viewModel.routeParameters.startTime"))?s=y(o,i.arriveTimeUTC,i.ETA,this._departureTime===C.NOW):a&&(s=l?`${a}&nbsp;&middot;&nbsp;${l}`:a);const d=c,h=this._getFormattedManeuverText(e),u=this._getIconPath(i.maneuverType);if(d)return E("li",{class:b.maneuver,key:e},E("header",null,c.attributes.Name));const p=`esri-directions__maneuver-${e.uid}`,m=`esri-directions__cumulative-costs-${e.uid}`,v=`esri-directions__intermediate-costs-${e.uid}`,_={[b.maneuverActive]:this._activeManeuver===e};return E("li",{"aria-labelledby":`${p} ${m} ${v}`,bind:this,class:this.classes(b.maneuver,_),"data-maneuver":e,key:e,onclick:this._handleManeuverClick,onkeydown:this._handleManeuverClick,onfocus:this._handleManeuverFocus,onmouseover:this._handleManeuverMouseOver,onmouseout:this._handleManeuverMouseOut,onblur:this._handleManeuverBlur,tabIndex:0},E("img",{alt:"",class:b.maneuverIcon,src:u}),E("div",{class:b.maneuverCostsContainer},E("span",{id:p,innerHTML:h}),E("div",{class:b.maneuverCosts},E("div",{class:b.horizontalSplitter}),E("div",{id:m,"aria-label":o.cumulativeCosts,class:b.cumulativeCost,innerHTML:t,title:o.cumulativeCosts}),E("div",{id:v,"aria-label":o.intermediateCosts,class:b.intermediateCost,innerHTML:s,title:o.intermediateCosts}))))}_getIconPath(e){const t=T(e),s=2===window.devicePixelRatio?"@2x":"";return`${f()}${t}${s}.png`}_handleManeuverClick(e){const t=e.currentTarget["data-maneuver"];if(this._activeManeuver===t)return this._activeManeuver=null,void this.zoomToRoute();this._activeManeuver=t,this.viewModel.centerAt(t),this.viewModel.highlightSegment(t)}_handleManeuverMouseOver(e){if(this._activeManeuver||this._focusedManeuver)return;const t=e.currentTarget["data-maneuver"];this.viewModel.highlightSegment(t)}_handleManeuverMouseOut(){this._activeManeuver||this._focusedManeuver||this.viewModel.clearHighlights()}_handleManeuverBlur(){this._activeManeuver||(this._focusedManeuver=null,this.viewModel.clearHighlights())}_handleManeuverFocus(e){if(this._activeManeuver)return;const t=e.currentTarget["data-maneuver"];this._focusedManeuver=t,this.viewModel.highlightSegment(t)}_getFormattedManeuverText(e){const{attributes:{text:t},strings:s}=e;if(!s)return t;let i=t;return s.forEach((e=>{i=i.replace(e.string,`<strong>${e.string}</strong>`)})),i}};e([d("viewModel.apiKey")],G.prototype,"apiKey",void 0),e([d("viewModel.goToOverride")],G.prototype,"goToOverride",void 0),e([h()],G.prototype,"headingLevel",void 0),e([h()],G.prototype,"iconClass",void 0),e([h({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],G.prototype,"label",void 0),e([d("viewModel.lastRoute")],G.prototype,"lastRoute",void 0),e([d("viewModel.maxStops")],G.prototype,"maxStops",void 0),e([h(),j("esri/widgets/Directions/t9n/Directions")],G.prototype,"messages",void 0),e([h(),j("esri/t9n/common")],G.prototype,"messagesCommon",void 0),e([h(),j("esri/core/t9n/Units")],G.prototype,"messagesUnits",void 0),e([d("viewModel.routeServiceUrl")],G.prototype,"routeServiceUrl",void 0),e([d("viewModel.routeSymbol")],G.prototype,"routeSymbol",void 0),e([h()],G.prototype,"searchProperties",void 0),e([d("viewModel.stopSymbols")],G.prototype,"stopSymbols",void 0),e([d("viewModel.view")],G.prototype,"view",void 0),e([h({type:v})],G.prototype,"viewModel",void 0),e([d("viewModel.getDirections")],G.prototype,"getDirections",null),e([d("viewModel.zoomToRoute")],G.prototype,"zoomToRoute",null),e([U()],G.prototype,"_handleStopIconClick",null),e([U()],G.prototype,"_handleClearRouteClick",null),e([U()],G.prototype,"_handleReverseStops",null),e([U()],G.prototype,"_handleRemoveStop",null),e([U()],G.prototype,"_handleSectionToggle",null),e([U()],G.prototype,"_handleSummaryInteraction",null),e([U()],G.prototype,"_handleManeuverClick",null),G=e([u("esri.widgets.Directions")],G);const J=G;export{J as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import"../intl.js";import s from"../core/Collection.js";import{on as i,pausable as o}from"../core/events.js";import r from"../core/Handles.js";import{isSome as n,isNone as a,unwrap as l,unwrapOrValue as c}from"../core/maybe.js";import{watch as d,initial as h,when as u,on as p}from"../core/reactiveUtils.js";import{aliasOf as m}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import g from"../rest/support/Stop.js";import S from"./Search.js";import w from"./Widget.js";import y from"./Directions/DirectionsViewModel.js";import{formatDistance as b,formatTime as M,isTimeUnits as f}from"./Directions/support/directionsUtils.js";import{DepartureTime as T,CSS as C,getIconPath as I}from"./Directions/support/resources.js";import{isArcGISWorldGeocoder as k,meteredArcGISLocatorUrl as R}from"./Search/support/locatorUtils.js";import D from"./support/DatePicker.js";import{Heading as P,incrementHeadingLevel as j}from"./support/Heading.js";import x from"./support/TimePicker.js";import{accessibleHandler as H}from"./support/decorators/accessibleHandler.js";import{messageBundle as U}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{tsx as L}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import A from"sortablejs";import{substitute as z}from"../intl/substitute.js";import{formatDate as E,convertDateFormatToIntlOptions as O}from"../intl/date.js";import{formatNumber as $}from"../intl/number.js";function N(e){const t=e.getTimezoneOffset(),s=t>0?"-":"+",i=60,o=Math.abs(Math.floor(t/i)),r=Math.abs(Math.floor(t)%i),n={minimumIntegerDigits:2};return`GMT${s}${$(o,n)}${$(r,n)}`}function B(){return[{},{}]}function F(e){return e.results[0].results[0]}function V(e){return!(null==e.composedPath||!e.composedPath().find((e=>{var t;return null==(t=e.classList)?void 0:t.contains("esri-search__suggestions-list")})))}const W={awaitingViewClickStop:"awaiting-view-click-stop"},K=100,q=500;let Y=class extends w{constructor(e,t){super(e,t),this._autoStopRemovalDelay=K,this._departureTime=T.NOW,this._datePicker=new D,this._handles=new r,this._newPlaceholderStop=null,this._pointerPressedSearchSuggestionStop=null,this._sections=null,this._stops=new s(B()),this._stopsToSearches=new Map,this._timePicker=new x,this.apiKey=null,this.goToOverride=null,this.headingLevel=2,this.iconClass=C.widgetIcon,this.label=void 0,this.lastRoute=null,this.maxStops=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.routeServiceUrl=void 0,this.routeSymbol=null,this.searchProperties=null,this.stopSymbols=null,this.view=null,this.viewModel=new y,this._setUpDragAndDropStops=e=>{this._sortable=A.create(e,{draggable:`.${C.validStopRow}`,ghostClass:C.stopRowGhost,handle:`.${C.stopHandle}`,onEnd:this._handleStopInputDragEnd})},this._handleDragHandlePointerDown=()=>this._stops.forEach((e=>this._acquireSearch(e).activeMenu="none")),this._handleStopInputDragEnd=({oldIndex:e,newIndex:t,target:s})=>{if(e===t)return;const{children:i}=s,o=i[t],r=i[e],n=t-e<0;s.insertBefore(o,n?r.nextElementSibling:r);const a=this._stops;a.reorder(a.getItemAt(e),t),this._processStops()}}initialize(){this.own([d((()=>this.viewModel.lastRoute),(()=>{this._activeManeuver=null,this._focusedManeuver=null,this._sections=this._getSections(),this.scheduleRender()}),h),d((()=>[this.viewModel.selectedTravelMode,this.viewModel.departureTime]),(()=>{this.viewModel.stops.length>1&&this.getDirections()}),h),u((()=>this.view),((e,t)=>{if(t&&(this._viewClickHandle=null,this._handles.remove(t)),e){const t=this._prepPointerDownUpClick(),s=this._prepViewClick();t.pause(),s.pause(),this._handles.add([i(e.surface,"mousedown",(()=>this._autoStopRemovalDelay=q)),i(e.surface,"mouseup",(()=>this._autoStopRemovalDelay=K)),t,s],this.view.surface),this._pointerDownUpHandle=t,this._viewClickHandle=s}}),h),u((()=>0===this.viewModel.stops.length),(()=>{this._stops.drain((e=>{this._disposeSearch(e)})),this._stops.addMany(B()),this.scheduleRender()}))])}destroy(){this._datePicker.destroy(),this._timePicker.destroy(),this._stopsToSearches.forEach((e=>e.destroy())),this._sortable&&this._sortable.destroy()}getDirections(){return null}zoomToRoute(){}render(){return L("div",{class:this.classes(C.base,C.scroller)},this._renderPanelContent())}_renderPanelContent(){const{viewModel:{state:e}}=this,t="initializing"===e,s="error"===e&&!this.viewModel.serviceDescription,i="unauthenticated"===e,o={[C.panelContentLoading]:t,[C.panelContentError]:s,[C.panelContentSignIn]:i},r=t?"presentation":"group",n=i?this._renderSignIn():s?this._renderMessage(this._getErrorMessage()):t?this._renderLoader():this._renderReadyContent();return L("div",{class:this.classes(C.panelContent,o),role:r},n)}_renderReadyContent(){return[this._renderStopsContainer(),this._renderTravelModeOptions(),this._renderDepartureTimeControls(),this._renderSectionSplitter(),this._renderDirectionsContainer(),this._renderDisclaimer()]}_renderSignIn(){return L("div",{key:"sign-in",class:C.signInContent},L(P,{class:C.contentTitle,level:this.headingLevel},this.messages.widgetLabel),this._renderPlaceholder(),L(P,{level:j(this.headingLevel)},this.messages.signInRequired),L("button",{class:this.classes(C.button,C.buttonSecondary,C.signInButton),tabIndex:0,onclick:this._handleSignInClick,bind:this,type:"button"},this.messagesCommon.auth.signIn))}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_renderTravelModeOptions(){const{selectedTravelMode:e,travelModes:t}=this.viewModel;if(0===t.length)return null;const s=n(e)?e.name:this.messages.travelMode;return L("select",{"aria-label":s,bind:this,class:this.classes(C.travelModeSelect,C.select),key:"esri-directions__travel-mode-options",onchange:this._handleTravelModeChange,title:s},t.map((t=>{const s=n(e)&&t.id===e.id;return L("option",{key:t,"data-mode":t,selected:s,value:t.id},t.name)})))}_handleTravelModeChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);this.viewModel.selectedTravelMode=s["data-mode"]}_renderStopsContainer(){return L("div",{class:C.section,key:"esri-directions__stops-container",role:"group"},this._renderStops())}_renderDepartureTimeControls(){const e=this._departureTime,{messages:t}=this,s=t.departureTime;return L("div",{class:C.departureTime,key:"esri-directions__departure-time-controls",role:"group"},L("select",{"aria-label":s,bind:this,class:this.classes(C.departureTimeSelect,C.select),onchange:this._handleDepartureOptionChange,title:s},L("option",{value:T.NOW,selected:e===T.NOW},t.leaveNow),L("option",{value:T.DEPART_BY,selected:e===T.DEPART_BY},t.departBy),L("option",{value:T.UNSPECIFIED,selected:e===T.UNSPECIFIED},t.timeUnspecified)),e===T.DEPART_BY?this._renderTimeControls():null)}_renderStops(){const e=this._stops;let t=0;e.forEach((e=>{"none"!==this._acquireSearch(e).activeMenu&&(t+=1)}));const s=e.toArray().map(((s,i)=>{const o=e.length,r=i>1&&!s.result,n={[C.stopsIcon]:i>=0&&i<o-1,[C.lastStopIcon]:i===o-1},a={[C.lastStopIconContainer]:i===o-1},l={[C.validStopRow]:!r},c=e.getItemAt(o-1),d=c&&c.result,h=e.getItemAt(i+1),u=h&&h.result,p=i===o-1,m=i===o-2,v=2===o&&0===i||o>2&&!p&&!m||o>2&&m&&u||o>2&&p&&!s.result,_=2===o||3===o&&!d||r,g=this._acquireSearch(s),{messages:S}=this,{removeStop:w,reverseStops:y,unlocated:b}=S,M=z(S.stopLabelTemplate,{number:i+1,label:s.result?s.result.name:b}),f=`${this.id}__stop--${i}`,T=!!g.searchTerm&&!!g.selectedResult&&!!s.result&&g.selectedResult===s.result,I={zIndex:"none"!==g.activeMenu?""+t--:""};return L("li",{"aria-label":M,afterCreate:this._handleStopFieldCreation,bind:this,class:this.classes(C.stopRow,l),id:f,key:i,"data-stop-index":i,styles:I},L("div",{class:C.stopHandle},L("span",{"aria-hidden":"true",class:this.classes(C.stopIcon,C.handleIcon,C.stopHandleIcon,C.interactiveStopIcon),onpointerdown:this._handleDragHandlePointerDown}),L("div",{bind:this,"aria-labelledby":f,class:this.classes(C.stopIconContainer,a),"data-stop-index":i,onclick:this._handleStopIconClick,onkeydown:this._handleStopIconClick,role:"button"},L("span",{class:this.classes(C.stopIcon,n),tabindex:T?"0":null}))),L("div",{class:C.stopInput},g.render()),L("div",{class:C.stopOptions,role:"group"},L("div",{"aria-label":w,class:C.removeStopButton,bind:this,"data-stop-index":i,hidden:_,onkeydown:this._handleRemoveStop,onclick:this._handleRemoveStop,role:"button",tabIndex:0,title:w},L("span",{"aria-hidden":"true",class:this.classes(C.stopIcon,C.removeStop,C.removeStopIcon,C.interactiveStopIcon)}),L("span",{class:C.screenReaderText},"removeStopTitle")),L("div",{"aria-label":y,class:C.reverseStops,bind:this,hidden:v,onkeydown:this._handleReverseStops,onclick:this._handleReverseStops,role:"button",tabIndex:0,title:y},L("span",{"aria-hidden":"true",class:this.classes(C.stopIcon,C.reverseStopIcon,C.interactiveStopIcon)}),L("span",{class:C.screenReaderText},"removeStopTitle"))))})),i=e.every((e=>{const t=this._stopsToSearches.get(e);return e.result&&t.selectedResult===e.result})),o=this._stops.length>=this.maxStops,r=this.messages.addStop,n=e.length>=2&&i&&!o?L("div",{"aria-label":r,bind:this,class:C.addStop,key:"esri-directions__add-stop",onfocus:this._handleAddStopFocus,tabIndex:0},L("span",{"aria-hidden":"true",class:this.classes(C.addStopIcon,C.stopIcon,C.interactiveStopIcon)}),L("div",{"aria-hidden":"true",class:C.addStopText},r)):null;return L("div",null,L("ol",{class:C.stops,role:"group",afterCreate:this._setUpDragAndDropStops},s),n)}_handleStopIconClick(e){const t=e.currentTarget["data-stop-index"],s=this._stops.getItemAt(t);s&&s.result&&this._centerAtStop(s)}_handleClearRouteClick(){this.viewModel.reset()}_centerAtStop(e){this.viewModel.centerAt(e.result.feature)}_handleStopFieldCreation(e){const t=this._newPlaceholderStop;if(!t)return;const s=e["data-stop-index"],i=this._stops.getItemAt(s);if(t===i){const e=this._acquireSearch(i);e.when((()=>{this.renderNow(),e.focus()}))}this._newPlaceholderStop=null}_handleStopInputBlur(e,t){this._handles.remove(W.awaitingViewClickStop),this.view.cursor=this._previousCursor;if(!e.selectedResult||!t.result||e.selectedResult!==t.result)return"none"!==e.activeMenu||!e.searchTerm||e.selectedResult===t.result&&(e.selectedResult||t.result)?void(e.searchTerm||(this._viewClickHandle.resume(),clearTimeout(this._autoStopRemovalTimeoutId),this._autoStopRemovalTimeoutId=setTimeout((()=>{if(this.destroyed)return;if(this._viewClickHandle.pause(),"searching"===e.viewModel.state)return void this._pointerDownUpHandle.pause();if(this._pointerPressedSearchSuggestionStop)return;this._removeStop(t);!!t.result&&(t.result=null,this._processStops()),this.scheduleRender()}),this._autoStopRemovalDelay))):(e.search(),void this._pointerDownUpHandle.pause());this._pointerDownUpHandle.pause()}_handleStopInputFocus(e,t){if(this._pointerDownUpHandle.resume(),this._handles.has(W.awaitingViewClickStop))return;const{view:s,view:{cursor:i}}=this;this._previousCursor=i,this._handles.add(d((()=>e.searchTerm),(e=>{s.cursor=0===e.length?"copy":i}),h),W.awaitingViewClickStop),this._activeStop=t}_prepViewClick(){const{view:e}=this.viewModel,t=o(e,"click",this._handleViewClick.bind(this)),s=o(e.surface,"click",(()=>{clearTimeout(this._autoStopRemovalTimeoutId),s.pause()}));return{remove(){s.remove(),t.remove()},pause(){s.pause(),t.pause()},resume(){s.resume(),t.resume()}}}_prepPointerDownUpClick(){const e=o(document,"pointerdown",(e=>{this._pointerPressedSearchSuggestionStop=V(e)?this._activeStop:null})),t=o(document,"pointerup",(e=>{this._pointerDownUpHandle.pause();const t=V(e),s=this._activeStop;t||s!==this._pointerPressedSearchSuggestionStop||this._removeStop(s),this.scheduleRender(),this._pointerPressedSearchSuggestionStop=t?this._activeStop:null}));return{remove(){t.remove(),e.remove()},pause(){t.pause(),e.pause()},resume(){e.resume()}}}_handleViewClick(e){const t=this._stopsToSearches.get(this._activeStop);t&&!t.searchTerm&&(t.search(e.mapPoint).then((e=>{const s=F(e),i=this._activeStop;i.result=s,i.result.feature.attributes.Name=s.name,t.searchTerm=s.name})),this.scheduleRender()),this._viewClickHandle.pause(),clearTimeout(this._autoStopRemovalTimeoutId)}_handleAddStopFocus(){this._addNewPlaceholder()}_addNewPlaceholder(){if(this._pointerDownUpHandle.pause(),this._newPlaceholderStop)return;const e={};this._stops.add(e),this._newPlaceholderStop=e}_handleReverseStops(){this._reverseStops()}_reverseStops(){this._stops.reverse(),this._processStops()}_handleRemoveStop(e){const t=e.currentTarget["data-stop-index"];this._removeStop(this._stops.getItemAt(t)),this._processStops()}_removeStop(e){this._stops.length<=2||(this._disposeSearch(e),this._stops.remove(e))}_handleDepartureOptionChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);s.value===T.NOW?(this._departureTime=T.NOW,this.viewModel.departureTime=T.NOW,this._handles.remove("departure-time-controls")):s.value===T.DEPART_BY?(this._departureTime=T.DEPART_BY,this._handles.add([d((()=>this._datePicker.value),(()=>this._updateDepartureTime()),h),d((()=>this._timePicker.value),(()=>this._updateDepartureTime()),h)],"departure-time-controls")):(this._departureTime=T.UNSPECIFIED,this.viewModel.departureTime=null)}_updateDepartureTime(){const e=this._datePicker.value,t=this._timePicker.value;e&&t&&(this.viewModel.departureTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()))}_renderTimeControls(){return L("div",{class:C.departureTimeControls,key:"esri-directions__time-controls",role:"group"},this._datePicker.render(),this._timePicker.render())}_renderSectionSplitter(){return L("div",{class:C.sectionSplitter})}_renderDisclaimer(){const{messages:e}=this,t=`<a class="${C.anchor}" href="http://www.esri.com/legal/software-license" rel="noreferrer" target="_blank">${e.esriTerms}</a>`,s=z(e.disclaimer,{esriTerms:t});return L("div",{class:C.disclaimer,innerHTML:s,key:"esri-directions__disclaimer"})}_renderDirectionsContainer(){return L("div",{class:this.classes(C.directionsSection,C.section),key:"esri-directions__container"},this._renderDirectionsContainerContent())}_renderLoader(){return L("div",{class:C.loader,key:"loader"})}_renderWarningCard(){return L("div",{class:C.warningCard,role:"alert"},L("div",{class:C.warningHeader},L("span",{class:C.warningIcon,"aria-hidden":"true"}),L(P,{class:C.warningHeading,level:this.headingLevel},this.messagesCommon.warning)),L("div",{class:C.warningMessage},this._getErrorMessage()))}_renderDirectionsContainerContent(){const{lastRoute:e,viewModel:{state:t}}=this,s="routing"===t;return"error"===t?this._renderWarningCard():s?this._renderLoader():n(e)&&n(e.directionLines)?L("div",{class:C.summary,key:"esri-directions__summary",role:"group"},this._renderCosts(),this._renderRouteActions(),this._renderManeuverSections()):L("div",{key:"esri-directions__placeholder",class:C.emptyContent},this._renderPlaceholder(),L(P,{class:C.message,level:this.headingLevel},this.messages.directionsPlaceholder))}_renderPlaceholder(){return L("svg",{class:C.emptyIllustration,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},L("path",{fill:"currentcolor",d:"M192 36c-15.477 0-24 6.034-24 16.99v45.822l24 24 24-24v-45.82C216 42.033 207.477 36 192 36zm20 61.155l-20 20-20-20V52.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM192 52a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zM92 140.99C92 130.035 83.477 124 68 124s-24 6.034-24 16.99v45.822l24 24 24-24zm-4 44.165l-20 20-20-20V140.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM68 140a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zm84-44h16v4h-16zm-24 80h4v12h-12v-4h8zm0-28h4v16h-4zm0-52h12v4h-8v8h-4zm0 24h4v16h-4zm-36 64h16v4H92z"}))}_renderMessage(e){return L(P,{level:this.headingLevel},e)}_renderRouteActions(){return L("div",{class:C.routeActions},L("button",{"aria-label":this.messages.clearRoute,class:this.classes(C.clearRouteButton,C.button,C.buttonTertiary),tabIndex:0,onclick:this._handleClearRouteClick,bind:this,type:"button"},this.messages.clearRoute))}_getSections(){if(a(this.lastRoute))return null;const{directionPoints:e,directionLines:t,stops:s}=this.lastRoute;if(a(e)||a(t))return null;const i=[];let o=null;for(const r of e){const{objectId:e,stopId:l}=r;if(n(l)){const e=s.find((e=>e.objectId===l)),t=0===i.length;(a(o)||o.stop!==e)&&(o={stop:e,directions:[],open:t},i.push(o));continue}if(a(o))continue;const c=t.find((t=>t.directionPointId===e));a(c)||o.directions.push({directionPoint:r,directionLine:c})}return i}_renderManeuverSections(){return a(this._sections)?null:L("div",{class:C.maneuvers,role:"group"},this._sections.map(((e,t)=>{const{open:s}=e;let i;e.directions.length>0&&s&&(i=L("ol",{class:C.maneuverList},e.directions.map((e=>this._renderManeuver(e)))));const o=l(this._sections).length>2,r=t===l(this._sections).length-1,n={[C.collapsibleSection]:o},a={[C.openIcon]:!s,[C.closeIcon]:s};let c;if(o&&!r){const t=s?this.messagesCommon.open:this.messagesCommon.close;c=L("header",{class:this.classes(C.maneuverSectionHeader,C.maneuverSectionToggle),key:"esri-directions__maneuver-section-header"},L("div",{"aria-expanded":s.toString(),"aria-label":t,bind:this,class:C.maneuverSectionHeaderButton,"data-maneuver-section":e,onkeydown:this._handleSectionToggle,onclick:this._handleSectionToggle,role:"button",tabIndex:0,title:t},L(P,{class:C.maneuverSectionTitle,level:this.headingLevel},e.stop.name),L("span",{"aria-hidden":"true",class:this.classes(a)})))}else c=L("header",{class:C.maneuverSectionHeader,key:"esri-directions__maneuver-section-header"},L(P,{class:C.maneuverSectionTitle,level:this.headingLevel},e.stop.name));return L("section",{class:this.classes(C.maneuverSection,n),key:t},c,i)})))}_handleSectionToggle(e){const t=e.currentTarget["data-maneuver-section"];t.open=!t.open}_renderCosts(){const{lastRoute:e}=this;if(a(e))return null;const t=this._getCostSummary(),{directionPoints:s}=e;if(a(s)||a(t))return null;const i=s.getItemAt(s.length-1).arrivalTime,{primary:o,secondary:r}=t,{eta:l,etaTemplate:c,primaryCosts:d,secondaryCosts:h,zoomToRoute:u}=this.messages,p=O("short-time"),m=n(i)?`<strong>${E(i,p)}</strong>`:null,v=n(i)?`${N(i)}`:null,_=z(c,{time:m,gmt:v});return L("div",{"aria-label":u,bind:this,class:C.directionCosts,onkeydown:this._handleSummaryInteraction,onclick:this._handleSummaryInteraction,role:"button",tabIndex:0,title:u},L("div",{class:C.costsDetails,role:"group"},L("div",{"aria-label":d,class:C.primaryCosts,title:d},o),L("div",{class:C.verticalSplitter}),L("div",{"aria-label":h,class:C.secondaryCosts,title:h},r)),L("div",{"aria-label":l,innerHTML:_,title:l}))}_handleSummaryInteraction(){this._activeManeuver=null,this._focusedManeuver=null,this.viewModel.clearHighlights(),this.zoomToRoute()}_getErrorMessage(){const{messages:e,viewModel:{error:t}}=this;if(n(t))switch(t.name){case"directions-view-model:unable-to-route":return e.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return e.errors.unableToLoadServiceMetadata}return e.errors.unknownError}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){e.viewModel.defaultSources.forEach((e=>{e.autoNavigate=!1}))}_applyLocatorSourceOverrides({allSources:e}){0!==e.length&&e.forEach((e=>{"url"in e&&e.url&&(null===e.locationType&&(e.locationType="street"),k(e.url)&&this.apiKey&&null==e.apiKey&&(e.apiKey=this.apiKey,e.url=R))}))}_acquireSearch(e){const t=this.get("viewModel.view");if(this._stopsToSearches.has(e)){const s=this._stopsToSearches.get(e);return s.view=t,this._overrideDefaultSources(s),s}const s=new S({view:t,resultGraphicEnabled:!1,popupEnabled:!1,...this.searchProperties});return this._normalizeSearchSources(s),this._handles.add([p((()=>s.allSources),"change",(()=>this._normalizeSearchSources(s))),s.on("select-result",(()=>{e.result=s.selectedResult,e.result.feature.attributes.Name=s.selectedResult.name,this._processStops(),this.scheduleRender()})),s.on("search-focus",(()=>this._handleStopInputFocus(s,e))),s.on("search-blur",(()=>this._handleStopInputBlur(s,e)))],s),this._stopsToSearches.set(e,s),s}_disposeSearch(e){this._stopsToSearches.get(e).destroy(),this._stopsToSearches.delete(e)}_processStops(){const e=this._stops.filter((e=>!!e.result)).map((e=>g.fromJSON(e.result.feature.toJSON())));switch(e.length){case 0:break;case 1:e.getItemAt(0).symbol=this.stopSymbols.first;break;case 2:e.getItemAt(0).symbol=this.stopSymbols.first,e.getItemAt(1).symbol=this.stopSymbols.last;break;default:e.forEach(((t,s)=>{switch(s){case 0:t.symbol=this.stopSymbols.first;break;case e.length-1:t.symbol=this.stopSymbols.last;break;default:t.symbol=this.stopSymbols.middle}}))}this.viewModel.stops=e,e.length>1&&this.getDirections()}_renderManeuver(e){const t="",{directionsLengthUnits:s}=this.viewModel.routeParameters,{directionPoint:i,directionLine:o}=e,{distance:r,duration:a}=o,{messages:l,messagesUnits:d}=this,h=b(l,d,c(r,0),{fromUnits:"meters",toUnits:s}),u=M(c(a,0),"minutes"),p=h&&u?`${h}&nbsp;&middot;&nbsp;${u}`:`${h}${u}`,m=this._getFormattedManeuverText(i),{objectId:v,directionPointType:_}=i,g=I(_),S=`esri-directions__maneuver-${v}`,w=`esri-directions__cumulative-costs-${v}`,y=`esri-directions__intermediate-costs-${v}`,f={[C.maneuverActive]:this._activeManeuver===o};return L("li",{"aria-labelledby":`${S} ${w} ${y}`,bind:this,class:this.classes(C.maneuver,f),"data-maneuver":o,key:o,onclick:this._handleManeuverClick,onkeydown:this._handleManeuverClick,onfocus:this._handleManeuverFocus,onmouseover:this._handleManeuverMouseOver,onmouseout:this._handleManeuverMouseOut,onblur:this._handleManeuverBlur,tabIndex:0},n(g)&&L("img",{alt:"",class:C.maneuverIcon,src:g}),L("div",{class:C.maneuverCostsContainer},L("span",{id:S,innerHTML:c(m,"")}),L("div",{class:C.maneuverCosts},L("div",{class:C.horizontalSplitter}),L("div",{id:w,"aria-label":l.cumulativeCosts,class:C.cumulativeCost,innerHTML:t,title:l.cumulativeCosts}),L("div",{id:y,"aria-label":l.intermediateCosts,class:C.intermediateCost,innerHTML:p,title:l.intermediateCosts}))))}_handleManeuverClick(e){const s=e.currentTarget["data-maneuver"];if(this._activeManeuver===s)return this._activeManeuver=null,void this.zoomToRoute();this._activeManeuver=s;const{geometry:i,symbol:o}=s,r=new t({geometry:i,symbol:o});this.viewModel.centerAt(r),this.viewModel.highlightSegment(r)}_handleManeuverMouseOver(e){if(this._activeManeuver||this._focusedManeuver)return;const s=e.currentTarget["data-maneuver"],{geometry:i,symbol:o}=s,r=new t({geometry:i,symbol:o});this.viewModel.highlightSegment(r)}_handleManeuverMouseOut(){this._activeManeuver||this._focusedManeuver||this.viewModel.clearHighlights()}_handleManeuverBlur(){this._activeManeuver||(this._focusedManeuver=null,this.viewModel.clearHighlights())}_handleManeuverFocus(e){if(this._activeManeuver)return;const s=e.currentTarget["data-maneuver"];this._focusedManeuver=s;const{geometry:i,symbol:o}=s,r=new t({geometry:i,symbol:o});this.viewModel.highlightSegment(r)}_getFormattedManeuverText(e){const{displayText:t,name:s,intersectingName:i}=e;if(a(t))return"";let o=t;return n(s)&&o.includes(s)&&(o=o.replace(s,`<strong>${s}</strong>`)),n(i)&&o.includes(i)&&(o=o.replace(i,`<strong>${i}</strong>`)),o}_getCostSummary(){const{viewModel:{impedanceAttribute:e,routeParameters:t},lastRoute:s}=this;if(a(e)||a(s))return null;const{routeInfo:i}=s;let{totalDuration:o,totalDistance:r}=i;const{directionsLengthUnits:l}=t;r=n(r)?r:0,o=n(o)?o:0;const c=b(this.messages,this.messagesUnits,r,{fromUnits:"meters",toUnits:l}),d=M(o,"minutes"),[h,u]=f(e.units)?[d,c]:[c,d];return{primary:h,secondary:u}}};e([m("viewModel.apiKey")],Y.prototype,"apiKey",void 0),e([m("viewModel.goToOverride")],Y.prototype,"goToOverride",void 0),e([v()],Y.prototype,"headingLevel",void 0),e([v()],Y.prototype,"iconClass",void 0),e([v({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],Y.prototype,"label",void 0),e([m("viewModel.lastRoute")],Y.prototype,"lastRoute",void 0),e([m("viewModel.maxStops")],Y.prototype,"maxStops",void 0),e([v(),U("esri/widgets/Directions/t9n/Directions")],Y.prototype,"messages",void 0),e([v(),U("esri/t9n/common")],Y.prototype,"messagesCommon",void 0),e([v(),U("esri/core/t9n/Units")],Y.prototype,"messagesUnits",void 0),e([m("viewModel.routeServiceUrl")],Y.prototype,"routeServiceUrl",void 0),e([m("viewModel.routeSymbol")],Y.prototype,"routeSymbol",void 0),e([v()],Y.prototype,"searchProperties",void 0),e([m("viewModel.stopSymbols")],Y.prototype,"stopSymbols",void 0),e([m("viewModel.view")],Y.prototype,"view",void 0),e([v({type:y})],Y.prototype,"viewModel",void 0),e([m("viewModel.getDirections")],Y.prototype,"getDirections",null),e([m("viewModel.zoomToRoute")],Y.prototype,"zoomToRoute",null),e([H()],Y.prototype,"_handleStopIconClick",null),e([H()],Y.prototype,"_handleClearRouteClick",null),e([H()],Y.prototype,"_handleReverseStops",null),e([H()],Y.prototype,"_handleRemoveStop",null),e([H()],Y.prototype,"_handleSectionToggle",null),e([H()],Y.prototype,"_handleSummaryInteraction",null),e([H()],Y.prototype,"_handleManeuverClick",null),Y=e([_("esri.widgets.Directions")],Y);const G=Y;export{G as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8121,2515],{1692:(e,t,i)=>{i.d(t,{Z:()=>C});var r=i(43697),a=i(66577),o=i(51773),s=i(78223),n=i(15923),l=(i(80442),i(22974)),p=i(92604),c=i(70586),u=i(31263),d=i(1153),h=i(52011);p.Z.getLogger("esri.core.Clonable");const m=e=>{let t=class extends e{clone(){const e=(0,c.s3)((0,d.vw)(this),"unable to clone instance of non-accessor class"),t=e.metadatas,i=e.store,r={},a=new Map;for(const e in t){const o=t[e],s=null==i?void 0:i.originOf(e);if(o.readOnly||!1===o.clonable||s!==u.s3.USER&&s!==u.s3.DEFAULTS)continue;const n=this[e];let p=null;const c=o.clonable;p="function"==typeof c?c(n):"reference"===c?n:(0,l.Vo)(n),null!=n&&null==p||(s===u.s3.DEFAULTS?a.set(e,p):r[e]=p)}const o=new(0,Object.getPrototypeOf(this).constructor)(r);if(a.size){var s;const e=null==(s=(0,d.vw)(o))?void 0:s.store;if(e)for(const[t,i]of a)e.set(t,i,u.s3.DEFAULTS)}return o}};return t=(0,r._)([(0,h.j)("esri.core.Clonable")],t),t};let y=class extends(m(n.Z)){};y=(0,r._)([(0,h.j)("esri.core.Clonable")],y);var g=i(96674),f=i(99001),b=i(5600),v=(i(67676),i(75215),i(33955));let w=class extends(m(g.wq)){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:(0,f.D)(),configurable:!0})}normalizeCtorArgs(e,t,i,r){return e&&!e.declaredClass?e:{geometry:e,symbol:t,attributes:i,popupTemplate:r}}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),this._notifyLayer("geometry",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;for(const t of[this.sourceLayer,this.layer])if(t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&(0,c.pC)(t.defaultPopupTemplate))return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes&&this.attributes[e]}setAttribute(e,t){if(this.attributes){const i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t},this._notifyLayer("attributes",void 0,t,e)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(){(0,c.pC)(this.geometry)&&"mesh"===this.geometry.type&&this._notifyLayer("transform",this.geometry.transform,this.geometry.transform)}_notifyLayer(e,t,i,r){if(!this.layer||!("graphicChanged"in this.layer))return;const a={graphic:this,property:e,oldValue:t,newValue:i};"attributes"===e&&(a.attributeName=r),this.layer.graphicChanged(a)}};(0,r._)([(0,b.Cb)({value:null})],w.prototype,"attributes",null),(0,r._)([(0,b.Cb)({value:null,types:a.qM,json:{read:v.im}})],w.prototype,"geometry",null),(0,r._)([(0,b.Cb)({type:Boolean})],w.prototype,"isAggregate",void 0),(0,r._)([(0,b.Cb)({clonable:"reference"})],w.prototype,"layer",void 0),(0,r._)([(0,b.Cb)({type:o.Z})],w.prototype,"popupTemplate",void 0),(0,r._)([(0,b.Cb)({clonable:"reference"})],w.prototype,"sourceLayer",void 0),(0,r._)([(0,b.Cb)({value:null,types:s.LB})],w.prototype,"symbol",null),(0,r._)([(0,b.Cb)({type:Boolean,value:!0})],w.prototype,"visible",null),w=(0,r._)([(0,h.j)("esri.Graphic")],w),(w||(w={})).generateUID=f.D;const C=w},66643:(e,t,i)=>{i.d(t,{Ed:()=>o,UI:()=>s,q6:()=>n,mt:()=>l});var r=i(70586),a=i(95330);function o(e,t,i){return(0,a.as)(e.map(((e,r)=>t.apply(i,[e,r]))))}function s(e,t,i){return(0,a.as)(e.map(((e,r)=>t.apply(i,[e,r])))).then((e=>e.map((e=>e.value))))}function n(e){return(0,r.Wi)(e)?(0,a.DB)():e.then((e=>({ok:!0,value:e}))).catch((e=>({ok:!1,error:e})))}function l(e){return e.then((e=>({ok:!0,value:e}))).catch((e=>((0,a.r9)(e),{ok:!1,error:e})))}},74085:(e,t,i)=>{function r(e){}i.d(t,{Bg:()=>r}),i(80442)},70171:(e,t,i)=>{var r,a,o;let s;i.d(t,{Ze:()=>h,Kd:()=>p,qe:()=>u});const n=null!=(r=null==(a=globalThis.esriConfig)?void 0:a.locale)?r:null==(o=globalThis.dojoConfig)?void 0:o.locale;function l(){var e,t;return null!=(e=null!=n?n:null==(t=globalThis.navigator)?void 0:t.language)?e:"en"}function p(){return void 0===s&&(s=l()),s}const c=[];function u(e){return c.push(e),{remove(){c.splice(c.indexOf(e),1)}}}const d=[];function h(e){return d.push(e),{remove(){c.splice(d.indexOf(e),1)}}}null==globalThis.addEventListener||globalThis.addEventListener("languagechange",(function(){const e=null!=undefined?undefined:l();s!==e&&(s=e,[...d].forEach((t=>{t.call(null,e)})),[...c].forEach((t=>{t.call(null,e)})))}))},54295:(e,t,i)=>{i.d(t,{V:()=>s});var r=i(43697),a=i(5600),o=(i(67676),i(80442),i(75215),i(52011));const s=e=>{let t=class extends e{get apiKey(){var e;return this._isOverridden("apiKey")?this._get("apiKey"):function(e){return"portalItem"in e}(this)?null==(e=this.portalItem)?void 0:e.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,r._)([(0,a.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,r._)([(0,o.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,i)=>{i.d(t,{Y:()=>p});var r=i(43697),a=i(92604),o=i(70586),s=i(5600),n=(i(67676),i(80442),i(75215),i(52011)),l=i(66677);const p=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,o.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,a.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,s.Cb)()],t.prototype,"title",null),(0,r._)([(0,s.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,n.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>w});var r=i(43697),a=i(40330),o=i(3172),s=i(66643),n=i(20102),l=i(92604),p=i(70586),c=i(95330),u=i(17452),d=i(5600),h=(i(67676),i(80442),i(75215),i(71715)),m=i(52011),y=i(30556),g=i(65587),f=i(15235),b=i(86082);const v=l.Z.getLogger("esri.layers.mixins.PortalLayer"),w=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new f.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,c.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,c.D_)(e)||v.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==a.id?void 0:a.id.findCredential(this.url):null;if(!t)return!0;const i=C.credential===t?C.user:await this._fetchEditingUser(e);return C.credential=t,C.user=i,(0,p.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,i;const r=null==(t=this.portalItem)||null==(i=t.portal)?void 0:i.user;if(r)return r;const n=a.id.findServerInfo(this.url);if(null==n||!n.owningSystemUrl)return null;const l=`${n.owningSystemUrl}/sharing/rest`,c=g.Z.getDefault();if(c&&c.loaded&&(0,u.Fv)(c.restUrl)===(0,u.Fv)(l))return c.user;const d=`${l}/community/self`,h=(0,p.pC)(e)?e.signal:null,m=await(0,s.q6)((0,o.default)(d,{authMode:"no-prompt",query:{f:"json"},signal:h}));return m.ok?b.default.fromJSON(m.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||g.Z.getDefault());return i&&r&&!(0,u.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new n.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save the scene, set the layer.portalItem to null or save the scene to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,d.Cb)({type:f.default})],t.prototype,"portalItem",null),(0,r._)([(0,h.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.Cb)()],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,m.j)("esri.layers.mixins.PortalLayer")],t),t},C={credential:null,user:null}},70082:(e,t,i)=>{i.d(t,{Z:()=>c});var r=i(43697),a=i(35454),o=i(96674),s=i(5600),n=(i(67676),i(80442),i(75215),i(52011));const l=new a.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends o.wq{constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,r._)([(0,s.Cb)({json:{write:!0}})],p.prototype,"name",void 0),(0,r._)([(0,s.Cb)({json:{write:!0}})],p.prototype,"description",void 0),(0,r._)([(0,s.Cb)({json:{read:l.read,write:l.write}})],p.prototype,"drawingTool",void 0),(0,r._)([(0,s.Cb)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,r._)([(0,s.Cb)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,r._)([(0,n.j)("esri.layers.support.FeatureTemplate")],p);const c=p},16451:(e,t,i)=>{i.d(t,{Z:()=>d});var r=i(43697),a=i(96674),o=i(5600),s=(i(67676),i(80442),i(75215),i(71715)),n=i(52011),l=i(30556),p=i(72729),c=i(70082);let u=class extends a.wq{constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=(0,p.im)(e[i]);return t}writeDomains(e,t){const i={};for(const t of Object.keys(e)){var r;e[t]&&(i[t]=null==(r=e[t])?void 0:r.toJSON())}t.domains=i}};(0,r._)([(0,o.Cb)({json:{write:!0}})],u.prototype,"id",void 0),(0,r._)([(0,o.Cb)({json:{write:!0}})],u.prototype,"name",void 0),(0,r._)([(0,o.Cb)({json:{write:!0}})],u.prototype,"domains",void 0),(0,r._)([(0,s.r)("domains")],u.prototype,"readDomains",null),(0,r._)([(0,l.c)("domains")],u.prototype,"writeDomains",null),(0,r._)([(0,o.Cb)({type:[c.Z],json:{write:!0}})],u.prototype,"templates",void 0),u=(0,r._)([(0,n.j)("esri.layers.support.FeatureType")],u);const d=u},56765:(e,t,i)=>{i.d(t,{Z:()=>c});var r,a=i(43697),o=i(80539),s=i(96674),n=i(5600),l=(i(67676),i(80442),i(75215),i(52011));let p=r=class extends s.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new o.Z}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,a._)([(0,n.Cb)({type:String,json:{write:!0}})],p.prototype,"floorField",void 0),(0,a._)([(0,n.Cb)({json:{read:!1,write:!1}})],p.prototype,"viewAllMode",void 0),(0,a._)([(0,n.Cb)({json:{read:!1,write:!1}})],p.prototype,"viewAllLevelIds",void 0),p=r=(0,a._)([(0,l.j)("esri.layers.support.LayerFloorInfo")],p);const c=p},15235:(e,t,i)=>{i.r(t),i.d(t,{default:()=>O});var r=i(43697),a=i(99880),o=i(20102),s=i(96674),n=i(22974),l=i(83379),p=i(70586),c=i(17452),u=i(5600),d=i(75215),h=i(71715),m=i(52011),y=i(6570),g=i(65587),f=i(15923),b=i(92604),v=(i(67676),i(80442),i(90578));const w=b.Z.getLogger("esri.portal.PortalItemResource");let C=class extends f.Z{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){(0,p.pC)(e)&&(0,c.YP)(e)?w.error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const i=this.url;if((0,p.Wi)(i))throw new o.Z("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal._request(i,{responseType:e,query:{token:this.portalItem.apiKey},signal:(0,p.U2)(t,"signal")})}async update(e,t){return(await i.e(7873).then(i.bind(i,97873))).addOrUpdateResource(this,"update",e,t)}hasPath(){return(0,p.pC)(this.path)}_normalizePath(e,t){return(0,p.Wi)(e)?e:(e=e.replace(/^\/+/,""),(0,p.pC)(t)&&(0,c.YP)(e)&&(e=(0,c.PF)(e,t.itemUrl)),e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};(0,r._)([(0,u.Cb)()],C.prototype,"portalItem",void 0),(0,r._)([(0,u.Cb)({type:String,value:null})],C.prototype,"path",null),(0,r._)([(0,v.p)("path")],C.prototype,"_castPath",null),(0,r._)([(0,u.Cb)({type:String,readOnly:!0})],C.prototype,"url",null),(0,r._)([(0,u.Cb)({type:String,readOnly:!0})],C.prototype,"itemRelativeUrl",null),C=(0,r._)([(0,m.j)("esri.portal.PortalItemResource")],C);const x=C;let _=class extends f.Z{constructor(e){super(e),this.created=null,this.rating=null}};(0,r._)([(0,u.Cb)()],_.prototype,"created",void 0),(0,r._)([(0,u.Cb)()],_.prototype,"rating",void 0),_=(0,r._)([(0,m.j)("esri.portal.PortalRating")],_);const k=_;var S;let I=S=class extends((0,s.eC)(l.Z)){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return(0,d.TJ)(S,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.indexOf("Table")>-1?"Table":t.indexOf("Route Layer")>-1?"Route Layer":t.indexOf("Markup")>-1?"Markup":"Feature Layer":"Image Service"===e?i=t.indexOf("Elevation 3D Layer")>-1?"Elevation Layer":t.indexOf("Tiled Imagery")>-1?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?i=t.indexOf("Web Tool")>-1?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=-1===t.indexOf("Spatiotemporal")&&(t.indexOf("Hosted Service")>-1||t.indexOf("Tiled")>-1)&&-1===t.indexOf("Relational")?"Tile Layer":"Map Image Layer":e&&e.toLowerCase().indexOf("add in")>-1?i=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.indexOf("configurableApp")>-1&&(i="Instant App"),i}readExtent(e){return e&&e.length?new y.Z(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[];let i,r=!1,o=!1,s=!1,n=!1,l=!1,p=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(r=t.indexOf("Hosted Service")>-1,"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(o=t.indexOf("Table")>-1,s=t.indexOf("Route Layer")>-1,n=t.indexOf("Markup")>-1,l=-1!==t.indexOf("Spatiotemporal"),p=-1!==t.indexOf("UtilityNetwork"),i=l&&o?"spatiotemporaltable":o?"table":s?"routelayer":n?"markup":l?"spatiotemporal":r?"featureshosted":p?"utilitynetwork":"features"):i="map service"===e||"wms"===e||"wmts"===e?r||t.indexOf("Tiled")>-1||"wmts"===e?"maptiles":"mapimages":"scene service"===e?t.indexOf("Line")>-1?"sceneweblayerline":t.indexOf("3DObject")>-1?"sceneweblayermultipatch":t.indexOf("Point")>-1?"sceneweblayerpoint":t.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":t.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":t.indexOf("Polygon")>-1?"sceneweblayerpolygon":t.indexOf("Building")>-1?"sceneweblayerbuilding":t.indexOf("Voxel")>-1?"sceneweblayervoxel":"sceneweblayer":"image service"===e?t.indexOf("Elevation 3D Layer")>-1?"elevationlayer":t.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e&&t.indexOf("Web Tool")>-1&&this.portal&&this.portal.isPortal?"tool":"layers"):i="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?t.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===e&&t.indexOf("configurableApp")>-1?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&t.indexOf("ArcGIS Pro")>-1||"explorer map"===e&&t.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&t.indexOf("Explorer Mapping Application")>-1||t.indexOf("Document")>-1?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"maps",i?(0,a.V)("esri/images/portal/"+i+"16.png"):null}get isLayer(){return["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","WMTS","WMS"].indexOf(this.type)>-1}get itemUrl(){const e=this.get("portal.restUrl");return e?e+"/content/items/"+this.id:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){this.portal||(this.portal=g.Z.getDefault());const t=this.portal.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?this.portal._request(this.itemUrl,{signal:(0,p.pC)(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}addRating(e){const t={method:"post",query:{}};return e instanceof k&&(e=e.rating),isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal._request(this.itemUrl+"/addRating",t).then((()=>new k({rating:e,created:new Date})))}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:(0,n.d9)(this.applicationProxies),avgRating:this.avgRating,categories:(0,n.d9)(this.categories),created:(0,n.d9)(this.created),culture:this.culture,description:this.description,extent:(0,n.d9)(this.extent),groupCategories:(0,n.d9)(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:(0,n.d9)(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:(0,n.d9)(this.screenshots),size:this.size,snippet:this.snippet,tags:(0,n.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,n.d9)(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new S({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}deleteRating(){return this.portal._request(this.itemUrl+"/deleteRating",{method:"post"}).then((()=>{}))}fetchData(e="json",t){return this.portal._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}fetchRating(e){return this.portal._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e}).then((e=>null!=e.rating?(e.created=new Date(e.created),new k(e)):null))}fetchRelatedItems(e,t){return this.portal._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},S)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal._request(this.itemUrl,{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new o.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)(0,c.HK)(t)?r.query={data:t}:r.query={url:(0,c.hF)(t)},(0,p.pC)(i)&&(r.query.filename=i);else{const e=new FormData;(0,p.pC)(i)?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new o.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await i.e(7873).then(i.bind(i,97873))).fetchResources(this,e,t)}async addResource(e,t,r){const a=await i.e(7873).then(i.bind(i,97873));return e.portalItem=this,a.addOrUpdateResource(e,"add",t,r)}async removeResource(e,t){const r=await i.e(7873).then(i.bind(i,97873));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new o.Z("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r.removeResource(this,e,t)}async removeAllResources(e){return(await i.e(7873).then(i.bind(i,97873))).removeAllResources(this,e)}resourceFromPath(e){return new x({portalItem:this,path:e})}toJSON(){const e=this.extent,t={created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,tags:this.tags,thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:this.typeKeywords,url:this.url};return(0,n.yd)(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new S({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};(0,r._)([(0,u.Cb)({type:["private","shared","org","public"]})],I.prototype,"access",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"accessInformation",void 0),(0,r._)([(0,u.Cb)({type:String})],I.prototype,"apiKey",void 0),(0,r._)([(0,u.Cb)({json:{read:{source:"appProxies"}}})],I.prototype,"applicationProxies",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"avgRating",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"categories",void 0),(0,r._)([(0,u.Cb)({type:Date})],I.prototype,"created",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"culture",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"description",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],I.prototype,"displayName",null),(0,r._)([(0,u.Cb)({type:y.Z})],I.prototype,"extent",void 0),(0,r._)([(0,h.r)("extent")],I.prototype,"readExtent",null),(0,r._)([(0,u.Cb)()],I.prototype,"groupCategories",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],I.prototype,"iconUrl",null),(0,r._)([(0,u.Cb)()],I.prototype,"id",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],I.prototype,"isLayer",null),(0,r._)([(0,u.Cb)()],I.prototype,"itemControl",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],I.prototype,"itemUrl",null),(0,r._)([(0,u.Cb)()],I.prototype,"licenseInfo",void 0),(0,r._)([(0,u.Cb)({type:Date})],I.prototype,"modified",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"name",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"numComments",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"numRatings",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"numViews",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"owner",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"ownerFolder",void 0),(0,r._)([(0,u.Cb)({type:g.Z})],I.prototype,"portal",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"screenshots",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"size",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"snippet",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"sourceJSON",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"tags",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"thumbnail",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],I.prototype,"thumbnailUrl",null),(0,r._)([(0,u.Cb)()],I.prototype,"title",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"type",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"typeKeywords",void 0),(0,r._)([(0,u.Cb)()],I.prototype,"url",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],I.prototype,"userItemUrl",null),I=S=(0,r._)([(0,m.j)("esri.portal.PortalItem")],I);const O=I},99282:(e,t,i)=>{i.d(t,{a:()=>o});var r=i(67900),a=i(68441);const o={inches:(0,r.En)(1,"meters","inches"),feet:(0,r.En)(1,"meters","feet"),"us-feet":(0,r.En)(1,"meters","us-feet"),yards:(0,r.En)(1,"meters","yards"),miles:(0,r.En)(1,"meters","miles"),"nautical-miles":(0,r.En)(1,"meters","nautical-miles"),millimeters:(0,r.En)(1,"meters","millimeters"),centimeters:(0,r.En)(1,"meters","centimeters"),decimeters:(0,r.En)(1,"meters","decimeters"),meters:(0,r.En)(1,"meters","meters"),kilometers:(0,r.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,r.ty)(1,"meters",a.sv.radius)}},51706:(e,t,i)=>{var r,a;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function s(e){return null!=e&&!isNaN(e)&&isFinite(e)}function n(e){return e.valueExpression?r.Expression:e.field&&"string"==typeof e.field?r.Field:r.Unknown}function l(e,t){const i=t||n(e),o=e.valueUnit||"unknown";return i===r.Unknown?a.Constant:e.stops?a.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?a.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?a.Proportional:a.Additive:a.Identity:a.RealWorldSize}i.d(t,{RY:()=>r,hL:()=>a,PS:()=>n,QW:()=>l,iY:()=>o,qh:()=>s}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(r||(r={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(a||(a={}))},28101:(e,t,i)=>{i.d(t,{PR:()=>x,Lq:()=>m,Km:()=>y,cM:()=>g,ap:()=>f,V3:()=>w,B3:()=>h});var r=i(22303),a=i(1692),o=i(74085),s=i(92604),n=i(70586),l=i(99282),p=i(51706);const c=s.Z.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),u=new a.Z,d=Math.PI,h=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function m(e,t,i){const a="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"color"===e.type))[0]:e;if(!a)return;if("esri.renderers.visualVariables.ColorVariable"!==a.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const o="number"==typeof t,s=o?null:t,l=s&&s.attributes;let p=o?t:null;const u=a.field,{ipData:d,hasExpression:h}=a.cache;let m=a.cache.compiledFunc;if(!u&&!h){const e=a.stops;return e&&e[0]&&e[0].color}if("number"!=typeof p)if(h){if(!(0,n.pC)(i)||!(0,n.pC)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,r=t.getViewInfo(e),o=t.createExecContext(s,r);if(!m){const e=t.createSyntaxTree(a.valueExpression);m=t.createFunction(e),a.cache.compiledFunc=m}p=t.executeFunction(m,o)}else l&&(p=l[u]);const y=a.normalizationField,g=l?parseFloat(l[y]):void 0;if(null!=p&&(!y||o||!isNaN(g)&&0!==g)){isNaN(g)||o||(p/=g);const e=C(p,d);if(e){const t=e[0],o=e[1],s=t===o?a.stops[t].color:r.Z.blendColors(a.stops[t].color,a.stops[o].color,e[2],(0,n.pC)(i)?i.color:void 0);return new r.Z(s)}}}function y(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"opacity"===e.type))[0]:e;if(!r)return;if("esri.renderers.visualVariables.OpacityVariable"!==r.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const a="number"==typeof t,o=a?null:t,s=o&&o.attributes;let l=a?t:null;const p=r.field,{ipData:u,hasExpression:d}=r.cache;let h=r.cache.compiledFunc;if(!p&&!d){const e=r.stops;return e&&e[0]&&e[0].opacity}if("number"!=typeof l)if(d){if((0,n.Wi)(i)||(0,n.Wi)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,a=t.getViewInfo(e),s=t.createExecContext(o,a);if(!h){const e=t.createSyntaxTree(r.valueExpression);h=t.createFunction(e),r.cache.compiledFunc=h}l=t.executeFunction(h,s)}else s&&(l=s[p]);const m=r.normalizationField,y=s?parseFloat(s[m]):void 0;if(null!=l&&(!m||a||!isNaN(y)&&0!==y)){isNaN(y)||a||(l/=y);const e=C(l,u);if(e){const t=e[0],i=e[1];if(t===i)return r.stops[t].opacity;{const a=r.stops[t].opacity;return a+(r.stops[i].opacity-a)*e[2]}}}}function g(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"rotation"===e.type))[0]:e;if(!r)return;if("esri.renderers.visualVariables.RotationVariable"!==r.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const a=r.axis||"heading",o="heading"===a&&"arithmetic"===r.rotationType?90:0,s="heading"===a&&"arithmetic"===r.rotationType?-1:1,l="number"==typeof t?null:t,p=l&&l.attributes,u=r.field,{hasExpression:d}=r.cache;let h=r.cache.compiledFunc,m=0;if(!u&&!d)return m;if(d){if((0,n.Wi)(i)||(0,n.Wi)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,a=t.getViewInfo(e),o=t.createExecContext(l,a);if(!h){const e=t.createSyntaxTree(r.valueExpression);h=t.createFunction(e),r.cache.compiledFunc=h}m=t.executeFunction(h,o)}else p&&(m=p[u]||0);return m="number"!=typeof m||isNaN(m)?null:o+s*m,m}function f(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"size"===e.type))[0]:e;if(!r)return;if("esri.renderers.visualVariables.SizeVariable"!==r.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const a=function(e,t,i,r,a){switch(t.transformationType){case p.hL.Additive:return function(e,t,i,r){return e+(b(t.minSize,i,r)||t.minDataValue)}(e,t,i,r);case p.hL.Constant:return function(e,t,i){const r=e.stops;let a=r&&r.length&&r[0].size;return null==a&&(a=e.minSize),b(a,t,i)}(t,i,r);case p.hL.ClampedLinear:return function(e,t,i,r){const a=(e-t.minDataValue)/(t.maxDataValue-t.minDataValue),o=b(t.minSize,i,r),s=b(t.maxSize,i,r),l=(0,n.pC)(r)?r.shape:void 0;if(e<=t.minDataValue)return o;if(e>=t.maxDataValue)return s;if("area"===t.scaleBy&&l){const e="circle"===l,t=e?d*(o/2)**2:o*o,i=t+a*((e?d*(s/2)**2:s*s)-t);return e?2*Math.sqrt(i/d):Math.sqrt(i)}return o+a*(s-o)}(e,t,i,r);case p.hL.Proportional:return function(e,t,i,r){const a=(0,n.pC)(r)?r.shape:void 0,o=e/t.minDataValue,s=b(t.minSize,i,r),l=b(t.maxSize,i,r);let p=null;return p="circle"===a?2*Math.sqrt(o*(s/2)**2):"square"===a||"diamond"===a||"image"===a?Math.sqrt(o*s**2):o*s,v(p,s,l)}(e,t,i,r);case p.hL.Stops:return function(e,t,i,r,a){const[o,s,n]=C(e,a);if(o===s)return b(t.stops[o].size,i,r);{const e=b(t.stops[o].size,i,r);return e+(b(t.stops[s].size,i,r)-e)*n}}(e,t,i,r,a);case p.hL.RealWorldSize:return function(e,t,i,r){const a=((0,n.pC)(r)&&r.resolution?r.resolution:1)*l.a[t.valueUnit],o=b(t.minSize,i,r),s=b(t.maxSize,i,r),{valueRepresentation:p}=t;let c=null;return c="area"===p?2*Math.sqrt(e/d)/a:"radius"===p||"distance"===p?2*e/a:e/a,v(c,o,s)}(e,t,i,r);case p.hL.Identity:return e;case p.hL.Unknown:return null}}(function(e,t,i){const r="number"==typeof t,a=r?null:t,o=a&&a.attributes;let s=r?t:null;const{isScaleDriven:l}=e.cache;let u=e.cache.compiledFunc;if(l){const t=(0,n.pC)(i)?i.scale:void 0,r=(0,n.pC)(i)?i.view:void 0;s=null==t||"3d"===r?function(e){let t=null,i=null;const r=e.stops;return r?(t=r[0].value,i=r[r.length-1].value):(t=e.minDataValue||0,i=e.maxDataValue||0),(t+i)/2}(e):t}else if(!r)switch(e.inputValueType){case p.RY.Expression:{if((0,n.Wi)(i)||(0,n.Wi)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const t={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},r=i.arcade.arcadeUtils,o=r.getViewInfo(t),l=r.createExecContext(a,o);if(!u){const t=r.createSyntaxTree(e.valueExpression);u=r.createFunction(t),e.cache.compiledFunc=u}s=r.executeFunction(u,l);break}case p.RY.Field:o&&(s=o[e.field]);break;case p.RY.Unknown:s=null}if(!(0,p.qh)(s))return null;if(r||!e.normalizationField)return s;const d=o?parseFloat(o[e.normalizationField]):null;return(0,p.qh)(d)&&0!==d?s/d:null}(r,t,i),r,t,i,r.cache.ipData);return null==a||isNaN(a)?0:a}function b(e,t,i){return null==e?null:(0,p.iY)(e)?f(e,t,i):(0,p.qh)(e)?e:null}function v(e,t,i){return(0,p.qh)(i)&&e>i?i:(0,p.qh)(t)&&e<t?t:e}function w(e,t,i){const{isScaleDriven:r}=e.cache;if(!(r&&"3d"===i||t))return null;const a={scale:t,view:i};let o=b(e.minSize,u,a),s=b(e.maxSize,u,a);if(null!=o||null!=s){if(o>s){const e=s;s=o,o=e}return{minSize:o,maxSize:s}}}function C(e,t){if(!t)return;let i=0,r=t.length-1;return t.some(((t,a)=>e<t?(r=a,!0):(i=a,!1))),[i,r,(e-t[i])/(t[r]-t[i])]}function x(e,t,i){const r=["proportional","proportional","proportional"];for(const a of e){const e=a.useSymbolValue?"symbol-value":f(a,t,i);switch(a.axis){case"width":r[0]=e;break;case"depth":r[1]=e;break;case"height":r[2]=e;break;case"width-and-depth":r[0]=e,r[1]=e;break;case"all":case void 0:case null:r[0]=e,r[1]=e,r[2]=e;break;default:(0,o.Bg)(a.axis)}}return r}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9664,2515],{66643:(e,t,r)=>{r.d(t,{Ed:()=>a,UI:()=>s,q6:()=>n,mt:()=>l});var i=r(70586),o=r(95330);function a(e,t,r){return(0,o.as)(e.map(((e,i)=>t.apply(r,[e,i]))))}function s(e,t,r){return(0,o.as)(e.map(((e,i)=>t.apply(r,[e,i])))).then((e=>e.map((e=>e.value))))}function n(e){return(0,i.Wi)(e)?(0,o.DB)():e.then((e=>({ok:!0,value:e}))).catch((e=>({ok:!1,error:e})))}function l(e){return e.then((e=>({ok:!0,value:e}))).catch((e=>((0,o.r9)(e),{ok:!1,error:e})))}},15235:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I});var i=r(43697),o=r(99880),a=r(20102),s=r(96674),n=r(22974),l=r(83379),p=r(70586),c=r(17452),d=r(5600),u=r(75215),h=r(71715),m=r(52011),y=r(6570),g=r(65587),b=r(15923),v=r(92604),f=(r(67676),r(80442),r(90578));const w=v.Z.getLogger("esri.portal.PortalItemResource");let C=class extends b.Z{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){(0,p.pC)(e)&&(0,c.YP)(e)?w.error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.url;if((0,p.Wi)(r))throw new a.Z("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal._request(r,{responseType:e,query:{token:this.portalItem.apiKey},signal:(0,p.U2)(t,"signal")})}async update(e,t){return(await r.e(7873).then(r.bind(r,97873))).addOrUpdateResource(this,"update",e,t)}hasPath(){return(0,p.pC)(this.path)}_normalizePath(e,t){return(0,p.Wi)(e)?e:(e=e.replace(/^\/+/,""),(0,p.pC)(t)&&(0,c.YP)(e)&&(e=(0,c.PF)(e,t.itemUrl)),e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};(0,i._)([(0,d.Cb)()],C.prototype,"portalItem",void 0),(0,i._)([(0,d.Cb)({type:String,value:null})],C.prototype,"path",null),(0,i._)([(0,f.p)("path")],C.prototype,"_castPath",null),(0,i._)([(0,d.Cb)({type:String,readOnly:!0})],C.prototype,"url",null),(0,i._)([(0,d.Cb)({type:String,readOnly:!0})],C.prototype,"itemRelativeUrl",null),C=(0,i._)([(0,m.j)("esri.portal.PortalItemResource")],C);const k=C;let x=class extends b.Z{constructor(e){super(e),this.created=null,this.rating=null}};(0,i._)([(0,d.Cb)()],x.prototype,"created",void 0),(0,i._)([(0,d.Cb)()],x.prototype,"rating",void 0),x=(0,i._)([(0,m.j)("esri.portal.PortalRating")],x);const _=x;var O;let S=O=class extends((0,s.eC)(l.Z)){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return(0,u.TJ)(O,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return"Feature Service"===e||"Feature Collection"===e?r=t.indexOf("Table")>-1?"Table":t.indexOf("Route Layer")>-1?"Route Layer":t.indexOf("Markup")>-1?"Markup":"Feature Layer":"Image Service"===e?r=t.indexOf("Elevation 3D Layer")>-1?"Elevation Layer":t.indexOf("Tiled Imagery")>-1?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?r="Scene Layer":"Scene Package"===e?r="Scene Layer Package":"Stream Service"===e?r="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?r=t.indexOf("Web Tool")>-1?"Tool":"Geoprocessing Service":"Geocoding Service"===e?r="Locator":"Geoenrichment Service"===e?r="GeoEnrichment Service":"Microsoft Powerpoint"===e?r="Microsoft PowerPoint":"GeoJson"===e?r="GeoJSON":"Globe Service"===e?r="Globe Layer":"Vector Tile Service"===e?r="Tile Layer":"netCDF"===e?r="NetCDF":"Map Service"===e?r=-1===t.indexOf("Spatiotemporal")&&(t.indexOf("Hosted Service")>-1||t.indexOf("Tiled")>-1)&&-1===t.indexOf("Relational")?"Tile Layer":"Map Image Layer":e&&e.toLowerCase().indexOf("add in")>-1?r=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?r="Big Data File Share":"Compact Tile Package"===e?r="Tile Package (tpkx)":"OGCFeatureServer"===e?r="OGC Feature Layer":"web mapping application"===e&&t.indexOf("configurableApp")>-1&&(r="Instant App"),r}readExtent(e){return e&&e.length?new y.Z(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[];let r,i=!1,a=!1,s=!1,n=!1,l=!1,p=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(i=t.indexOf("Hosted Service")>-1,"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(a=t.indexOf("Table")>-1,s=t.indexOf("Route Layer")>-1,n=t.indexOf("Markup")>-1,l=-1!==t.indexOf("Spatiotemporal"),p=-1!==t.indexOf("UtilityNetwork"),r=l&&a?"spatiotemporaltable":a?"table":s?"routelayer":n?"markup":l?"spatiotemporal":i?"featureshosted":p?"utilitynetwork":"features"):r="map service"===e||"wms"===e||"wmts"===e?i||t.indexOf("Tiled")>-1||"wmts"===e?"maptiles":"mapimages":"scene service"===e?t.indexOf("Line")>-1?"sceneweblayerline":t.indexOf("3DObject")>-1?"sceneweblayermultipatch":t.indexOf("Point")>-1?"sceneweblayerpoint":t.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":t.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":t.indexOf("Polygon")>-1?"sceneweblayerpolygon":t.indexOf("Building")>-1?"sceneweblayerbuilding":t.indexOf("Voxel")>-1?"sceneweblayervoxel":"sceneweblayer":"image service"===e?t.indexOf("Elevation 3D Layer")>-1?"elevationlayer":t.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e&&t.indexOf("Web Tool")>-1&&this.portal&&this.portal.isPortal?"tool":"layers"):r="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?t.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===e&&t.indexOf("configurableApp")>-1?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&t.indexOf("ArcGIS Pro")>-1||"explorer map"===e&&t.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&t.indexOf("Explorer Mapping Application")>-1||t.indexOf("Document")>-1?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"maps",r?(0,o.V)("esri/images/portal/"+r+"16.png"):null}get isLayer(){return["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","WMTS","WMS"].indexOf(this.type)>-1}get itemUrl(){const e=this.get("portal.restUrl");return e?e+"/content/items/"+this.id:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){this.portal||(this.portal=g.Z.getDefault());const t=this.portal.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?this.portal._request(this.itemUrl,{signal:(0,p.pC)(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}addRating(e){const t={method:"post",query:{}};return e instanceof _&&(e=e.rating),isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal._request(this.itemUrl+"/addRating",t).then((()=>new _({rating:e,created:new Date})))}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:(0,n.d9)(this.applicationProxies),avgRating:this.avgRating,categories:(0,n.d9)(this.categories),created:(0,n.d9)(this.created),culture:this.culture,description:this.description,extent:(0,n.d9)(this.extent),groupCategories:(0,n.d9)(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:(0,n.d9)(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:(0,n.d9)(this.screenshots),size:this.size,snippet:this.snippet,tags:(0,n.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,n.d9)(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new O({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}deleteRating(){return this.portal._request(this.itemUrl+"/deleteRating",{method:"post"}).then((()=>{}))}fetchData(e="json",t){return this.portal._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}fetchRating(e){return this.portal._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e}).then((e=>null!=e.rating?(e.created=new Date(e.created),new _(e)):null))}fetchRelatedItems(e,t){return this.portal._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},O)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal._request(this.itemUrl,{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e&&e.data,r={method:"post"};r.query=this.createPostQuery();for(const e in r.query)null===r.query[e]&&(r.query[e]="");return r.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?r.query.text=t:"object"==typeof t&&(r.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,r).then((()=>this.reload()))})):Promise.reject(new a.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e.thumbnail,r=e.filename,i={method:"post"};if("string"==typeof t)(0,c.HK)(t)?i.query={data:t}:i.query={url:(0,c.hF)(t)},(0,p.pC)(r)&&(i.query.filename=r);else{const e=new FormData;(0,p.pC)(r)?e.append("file",t,r):e.append("file",t),i.body=e}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,i).then((()=>this.reload()))})):Promise.reject(new a.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await r.e(7873).then(r.bind(r,97873))).fetchResources(this,e,t)}async addResource(e,t,i){const o=await r.e(7873).then(r.bind(r,97873));return e.portalItem=this,o.addOrUpdateResource(e,"add",t,i)}async removeResource(e,t){const i=await r.e(7873).then(r.bind(r,97873));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new a.Z("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i.removeResource(this,e,t)}async removeAllResources(e){return(await r.e(7873).then(r.bind(r,97873))).removeAllResources(this,e)}resourceFromPath(e){return new k({portalItem:this,path:e})}toJSON(){const e=this.extent,t={created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,tags:this.tags,thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:this.typeKeywords,url:this.url};return(0,n.yd)(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new O({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};(0,i._)([(0,d.Cb)({type:["private","shared","org","public"]})],S.prototype,"access",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"accessInformation",void 0),(0,i._)([(0,d.Cb)({type:String})],S.prototype,"apiKey",void 0),(0,i._)([(0,d.Cb)({json:{read:{source:"appProxies"}}})],S.prototype,"applicationProxies",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"avgRating",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"categories",void 0),(0,i._)([(0,d.Cb)({type:Date})],S.prototype,"created",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"culture",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"description",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],S.prototype,"displayName",null),(0,i._)([(0,d.Cb)({type:y.Z})],S.prototype,"extent",void 0),(0,i._)([(0,h.r)("extent")],S.prototype,"readExtent",null),(0,i._)([(0,d.Cb)()],S.prototype,"groupCategories",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],S.prototype,"iconUrl",null),(0,i._)([(0,d.Cb)()],S.prototype,"id",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],S.prototype,"isLayer",null),(0,i._)([(0,d.Cb)()],S.prototype,"itemControl",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],S.prototype,"itemUrl",null),(0,i._)([(0,d.Cb)()],S.prototype,"licenseInfo",void 0),(0,i._)([(0,d.Cb)({type:Date})],S.prototype,"modified",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"name",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"numComments",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"numRatings",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"numViews",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"owner",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"ownerFolder",void 0),(0,i._)([(0,d.Cb)({type:g.Z})],S.prototype,"portal",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"screenshots",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"size",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"snippet",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"sourceJSON",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"tags",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"thumbnail",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],S.prototype,"thumbnailUrl",null),(0,i._)([(0,d.Cb)()],S.prototype,"title",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"type",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"typeKeywords",void 0),(0,i._)([(0,d.Cb)()],S.prototype,"url",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],S.prototype,"userItemUrl",null),S=O=(0,i._)([(0,m.j)("esri.portal.PortalItem")],S);const I=S},98046:(e,t,r)=>{r.d(t,{Z:()=>h});var i,o=r(43697),a=r(22303),s=r(22974),n=r(5600),l=r(75215),p=r(36030),c=r(52011),d=r(899);let u=i=class extends d.Z{constructor(e){super(e),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:(0,s.d9)(this.fromColor),toColor:(0,s.d9)(this.toColor),algorithm:this.algorithm})}};(0,o._)([(0,p.J)({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],u.prototype,"algorithm",void 0),(0,o._)([(0,n.Cb)({type:a.Z,json:{type:[l.z8],write:!0}})],u.prototype,"fromColor",void 0),(0,o._)([(0,n.Cb)({type:a.Z,json:{type:[l.z8],write:!0}})],u.prototype,"toColor",void 0),(0,o._)([(0,n.Cb)({type:["algorithmic"]})],u.prototype,"type",void 0),u=i=(0,o._)([(0,c.j)("esri.rest.support.AlgorithmicColorRamp")],u);const h=u},899:(e,t,r)=>{r.d(t,{Z:()=>l});var i=r(43697),o=r(96674),a=r(5600),s=(r(67676),r(80442),r(75215),r(52011));let n=class extends o.wq{constructor(e){super(e),this.type=null}};(0,i._)([(0,a.Cb)({readOnly:!0,json:{read:!1,write:!0}})],n.prototype,"type",void 0),n=(0,i._)([(0,s.j)("esri.rest.support.ColorRamp")],n);const l=n},1515:(e,t,r)=>{r.d(t,{Z:()=>d});var i,o=r(43697),a=r(22974),s=r(5600),n=(r(75215),r(52011)),l=r(98046),p=r(899);let c=i=class extends p.Z{constructor(e){super(e),this.colorRamps=null,this.type="multipart"}clone(){return new i({colorRamps:(0,a.d9)(this.colorRamps)})}};(0,o._)([(0,s.Cb)({type:[l.Z],json:{write:!0}})],c.prototype,"colorRamps",void 0),(0,o._)([(0,s.Cb)({type:["multipart"]})],c.prototype,"type",void 0),c=i=(0,o._)([(0,n.j)("esri.rest.support.MultipartColorRamp")],c);const d=c},94593:(e,t,r)=>{r.d(t,{i:()=>n,V:()=>s});var i=r(98046),o=r(899),a=r(1515);const s={key:"type",base:o.Z,typeMap:{algorithmic:i.Z,multipart:a.Z}};function n(e){return e&&e.type?"algorithmic"===e.type?i.Z.fromJSON(e):"multipart"===e.type?a.Z.fromJSON(e):null:null}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2515],{66643:(e,t,i)=>{i.d(t,{Ed:()=>a,UI:()=>s,q6:()=>n,mt:()=>l});var r=i(70586),o=i(95330);function a(e,t,i){return(0,o.as)(e.map(((e,r)=>t.apply(i,[e,r]))))}function s(e,t,i){return(0,o.as)(e.map(((e,r)=>t.apply(i,[e,r])))).then((e=>e.map((e=>e.value))))}function n(e){return(0,r.Wi)(e)?(0,o.DB)():e.then((e=>({ok:!0,value:e}))).catch((e=>({ok:!1,error:e})))}function l(e){return e.then((e=>({ok:!0,value:e}))).catch((e=>((0,o.r9)(e),{ok:!1,error:e})))}},15235:(e,t,i)=>{i.r(t),i.d(t,{default:()=>I});var r=i(43697),o=i(99880),a=i(20102),s=i(96674),n=i(22974),l=i(83379),p=i(70586),c=i(17452),d=i(5600),u=i(75215),h=i(71715),m=i(52011),y=i(6570),g=i(65587),b=i(15923),v=i(92604),f=(i(67676),i(80442),i(90578));const w=v.Z.getLogger("esri.portal.PortalItemResource");let k=class extends b.Z{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){(0,p.pC)(e)&&(0,c.YP)(e)?w.error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const i=this.url;if((0,p.Wi)(i))throw new a.Z("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal._request(i,{responseType:e,query:{token:this.portalItem.apiKey},signal:(0,p.U2)(t,"signal")})}async update(e,t){return(await i.e(7873).then(i.bind(i,97873))).addOrUpdateResource(this,"update",e,t)}hasPath(){return(0,p.pC)(this.path)}_normalizePath(e,t){return(0,p.Wi)(e)?e:(e=e.replace(/^\/+/,""),(0,p.pC)(t)&&(0,c.YP)(e)&&(e=(0,c.PF)(e,t.itemUrl)),e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};(0,r._)([(0,d.Cb)()],k.prototype,"portalItem",void 0),(0,r._)([(0,d.Cb)({type:String,value:null})],k.prototype,"path",null),(0,r._)([(0,f.p)("path")],k.prototype,"_castPath",null),(0,r._)([(0,d.Cb)({type:String,readOnly:!0})],k.prototype,"url",null),(0,r._)([(0,d.Cb)({type:String,readOnly:!0})],k.prototype,"itemRelativeUrl",null),k=(0,r._)([(0,m.j)("esri.portal.PortalItemResource")],k);const x=k;let C=class extends b.Z{constructor(e){super(e),this.created=null,this.rating=null}};(0,r._)([(0,d.Cb)()],C.prototype,"created",void 0),(0,r._)([(0,d.Cb)()],C.prototype,"rating",void 0),C=(0,r._)([(0,m.j)("esri.portal.PortalRating")],C);const O=C;var _;let S=_=class extends((0,s.eC)(l.Z)){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return(0,u.TJ)(_,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.indexOf("Table")>-1?"Table":t.indexOf("Route Layer")>-1?"Route Layer":t.indexOf("Markup")>-1?"Markup":"Feature Layer":"Image Service"===e?i=t.indexOf("Elevation 3D Layer")>-1?"Elevation Layer":t.indexOf("Tiled Imagery")>-1?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?i=t.indexOf("Web Tool")>-1?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=-1===t.indexOf("Spatiotemporal")&&(t.indexOf("Hosted Service")>-1||t.indexOf("Tiled")>-1)&&-1===t.indexOf("Relational")?"Tile Layer":"Map Image Layer":e&&e.toLowerCase().indexOf("add in")>-1?i=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.indexOf("configurableApp")>-1&&(i="Instant App"),i}readExtent(e){return e&&e.length?new y.Z(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[];let i,r=!1,a=!1,s=!1,n=!1,l=!1,p=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(r=t.indexOf("Hosted Service")>-1,"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(a=t.indexOf("Table")>-1,s=t.indexOf("Route Layer")>-1,n=t.indexOf("Markup")>-1,l=-1!==t.indexOf("Spatiotemporal"),p=-1!==t.indexOf("UtilityNetwork"),i=l&&a?"spatiotemporaltable":a?"table":s?"routelayer":n?"markup":l?"spatiotemporal":r?"featureshosted":p?"utilitynetwork":"features"):i="map service"===e||"wms"===e||"wmts"===e?r||t.indexOf("Tiled")>-1||"wmts"===e?"maptiles":"mapimages":"scene service"===e?t.indexOf("Line")>-1?"sceneweblayerline":t.indexOf("3DObject")>-1?"sceneweblayermultipatch":t.indexOf("Point")>-1?"sceneweblayerpoint":t.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":t.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":t.indexOf("Polygon")>-1?"sceneweblayerpolygon":t.indexOf("Building")>-1?"sceneweblayerbuilding":t.indexOf("Voxel")>-1?"sceneweblayervoxel":"sceneweblayer":"image service"===e?t.indexOf("Elevation 3D Layer")>-1?"elevationlayer":t.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e&&t.indexOf("Web Tool")>-1&&this.portal&&this.portal.isPortal?"tool":"layers"):i="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?t.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===e&&t.indexOf("configurableApp")>-1?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&t.indexOf("ArcGIS Pro")>-1||"explorer map"===e&&t.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&t.indexOf("Explorer Mapping Application")>-1||t.indexOf("Document")>-1?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"maps",i?(0,o.V)("esri/images/portal/"+i+"16.png"):null}get isLayer(){return["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","WMTS","WMS"].indexOf(this.type)>-1}get itemUrl(){const e=this.get("portal.restUrl");return e?e+"/content/items/"+this.id:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){this.portal||(this.portal=g.Z.getDefault());const t=this.portal.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?this.portal._request(this.itemUrl,{signal:(0,p.pC)(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}addRating(e){const t={method:"post",query:{}};return e instanceof O&&(e=e.rating),isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal._request(this.itemUrl+"/addRating",t).then((()=>new O({rating:e,created:new Date})))}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:(0,n.d9)(this.applicationProxies),avgRating:this.avgRating,categories:(0,n.d9)(this.categories),created:(0,n.d9)(this.created),culture:this.culture,description:this.description,extent:(0,n.d9)(this.extent),groupCategories:(0,n.d9)(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:(0,n.d9)(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:(0,n.d9)(this.screenshots),size:this.size,snippet:this.snippet,tags:(0,n.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,n.d9)(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new _({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}deleteRating(){return this.portal._request(this.itemUrl+"/deleteRating",{method:"post"}).then((()=>{}))}fetchData(e="json",t){return this.portal._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}fetchRating(e){return this.portal._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e}).then((e=>null!=e.rating?(e.created=new Date(e.created),new O(e)):null))}fetchRelatedItems(e,t){return this.portal._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},_)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal._request(this.itemUrl,{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new a.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)(0,c.HK)(t)?r.query={data:t}:r.query={url:(0,c.hF)(t)},(0,p.pC)(i)&&(r.query.filename=i);else{const e=new FormData;(0,p.pC)(i)?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new a.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await i.e(7873).then(i.bind(i,97873))).fetchResources(this,e,t)}async addResource(e,t,r){const o=await i.e(7873).then(i.bind(i,97873));return e.portalItem=this,o.addOrUpdateResource(e,"add",t,r)}async removeResource(e,t){const r=await i.e(7873).then(i.bind(i,97873));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new a.Z("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r.removeResource(this,e,t)}async removeAllResources(e){return(await i.e(7873).then(i.bind(i,97873))).removeAllResources(this,e)}resourceFromPath(e){return new x({portalItem:this,path:e})}toJSON(){const e=this.extent,t={created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,tags:this.tags,thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:this.typeKeywords,url:this.url};return(0,n.yd)(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new _({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};(0,r._)([(0,d.Cb)({type:["private","shared","org","public"]})],S.prototype,"access",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"accessInformation",void 0),(0,r._)([(0,d.Cb)({type:String})],S.prototype,"apiKey",void 0),(0,r._)([(0,d.Cb)({json:{read:{source:"appProxies"}}})],S.prototype,"applicationProxies",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"avgRating",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"categories",void 0),(0,r._)([(0,d.Cb)({type:Date})],S.prototype,"created",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"culture",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"description",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],S.prototype,"displayName",null),(0,r._)([(0,d.Cb)({type:y.Z})],S.prototype,"extent",void 0),(0,r._)([(0,h.r)("extent")],S.prototype,"readExtent",null),(0,r._)([(0,d.Cb)()],S.prototype,"groupCategories",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],S.prototype,"iconUrl",null),(0,r._)([(0,d.Cb)()],S.prototype,"id",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],S.prototype,"isLayer",null),(0,r._)([(0,d.Cb)()],S.prototype,"itemControl",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],S.prototype,"itemUrl",null),(0,r._)([(0,d.Cb)()],S.prototype,"licenseInfo",void 0),(0,r._)([(0,d.Cb)({type:Date})],S.prototype,"modified",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"name",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"numComments",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"numRatings",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"numViews",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"owner",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"ownerFolder",void 0),(0,r._)([(0,d.Cb)({type:g.Z})],S.prototype,"portal",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"screenshots",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"size",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"snippet",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"sourceJSON",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"tags",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"thumbnail",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],S.prototype,"thumbnailUrl",null),(0,r._)([(0,d.Cb)()],S.prototype,"title",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"type",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"typeKeywords",void 0),(0,r._)([(0,d.Cb)()],S.prototype,"url",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],S.prototype,"userItemUrl",null),S=_=(0,r._)([(0,m.j)("esri.portal.PortalItem")],S);const I=S}}]);
@@ -1,5 +0,0 @@
1
- /*
2
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
- */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{isNone as s}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{isTimeUnits as i,formatTime as n,formatDistance as c}from"./directionsUtils.js";let a=class extends e{constructor(){super(...arguments),this.messages=null,this.messagesUnits=null}get primary(){const t=this.get("directionsViewModel.lastRoute.routeResults.0.directions"),e=this.directionsViewModel.impedanceAttribute;if(s(e))return null;const o=this.get("directionsViewModel.routeParameters.directionsLengthUnits");return i(e.units)?n(t.totalTime,{unit:e.units.replace("esriNAU","")}):c(this.messages,this.messagesUnits,t.totalLength,{toUnits:o})}get secondary(){const t=this.get("directionsViewModel.lastRoute.routeResults.0.directions"),e=this.get("directionsViewModel.routeParameters.directionsLengthUnits"),{impedanceAttribute:o}=this.directionsViewModel;return s(o)?null:i(o.units)?c(this.messages,this.messagesUnits,t.totalLength,{toUnits:e}):n(t.totalTime)}};t([o()],a.prototype,"directionsViewModel",void 0),t([o()],a.prototype,"messages",void 0),t([o()],a.prototype,"messagesUnits",void 0),t([o({readOnly:!0})],a.prototype,"primary",null),t([o({readOnly:!0})],a.prototype,"secondary",null),a=t([r("esri.widgets.Directions.support.CostSummary")],a);const l=a;export{l as default};
@@ -1,5 +0,0 @@
1
- /*
2
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
- */
5
- import{_ as o}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";let t=class extends r{constructor(o){super(o),this.maneuvers=[],this.name=null,this.open=!1}};o([s()],t.prototype,"maneuvers",void 0),o([s()],t.prototype,"name",void 0),o([s()],t.prototype,"open",void 0),t=o([e("esri.widgets.Directions.support.RouteSection")],t);const p=t;export{p as default};
@@ -1,5 +0,0 @@
1
- /*
2
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
- */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getAssociatedStop as s}from"./directionsUtils.js";import c from"./RouteSection.js";let i=class extends r{constructor(t){super(t),this.routePath=null}get sections(){const t=this.routePath;return t?this._createSections(t):[]}_createSections(t){const r=(t=this._filterDuplicateStops(t)).map(((t,r)=>s(t)?r:-1)).filter((t=>t>-1));return r.map(((e,o)=>{const i=s(t[e]).attributes.Name,p=o===r.length-1?[]:t.slice(r[o]+1,r[o+1]);return new c({name:i,maneuvers:p,open:0===o})}))}_filterDuplicateStops(t){let r;return t.filter((t=>{const e=s(t),o=e===r;return r=e,!e||!o}))}};t([e()],i.prototype,"routePath",void 0),t([e({readOnly:!0})],i.prototype,"sections",null),i=t([o("esri.widgets.Directions.support.RouteSections")],i);const p=i;export{p as default};
@@ -1,5 +0,0 @@
1
- /*
2
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
- */
5
- const r={esriDMTBearLeft:"bear-left",esriDMTBearRight:"bear-right",esriDMTDoorPassage:"walk-through-door",esriDMTElevator:"elevator",esriDMTEndOfFerry:"disembark",esriDMTEscalator:"escalator",esriDMTFerry:"embark",esriDMTForkCenter:"fork-middle",esriDMTForkLeft:"fork-left",esriDMTForkRight:"fork-right",esriDMTHighwayChange:"highway-change",esriDMTHighwayExit:"exit-highway-right",esriDMTHighwayMerge:"merge-on-highway",esriDMTPedestrianRamp:"take-pedestrian-ramp",esriDMTRampLeft:"ramp-left",esriDMTRampRight:"ramp-right",esriDMTRoundabout:"roundabout-left",esriDMTSharpLeft:"sharp-left",esriDMTSharpRight:"sharp-right",esriDMTStairs:"stairs",esriDMTStraight:"straight",esriDMTTurnLeft:"left",esriDMTTurnLeftLeft:"left-left",esriDMTTurnLeftRight:"left-right",esriDMTTurnRight:"right",esriDMTTurnRightLeft:"right-left",esriDMTTurnRightRight:"right-right",esriDMTUnknown:"unknown",esriDMTUTurn:"u-turn-left"};function e(e){return r[e]}export{r as maneuverTypeJsonToIconName,e as toIconName};