@arcgis/core 4.28.0-next.20230818 → 4.28.0-next.20230821

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 (200) hide show
  1. package/arcade/functions/centroid.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/003744a45b07865f1be9.js +1 -0
  4. package/assets/esri/core/workers/chunks/034accc7cab6c88a3b31.js +1 -0
  5. package/assets/esri/core/workers/chunks/05ab09713d599687afa3.js +1 -0
  6. package/assets/esri/core/workers/chunks/{3724f23b6f5ac8ec2568.js → 12b8fe0374fa9ab4ca09.js} +1 -1
  7. package/assets/esri/core/workers/chunks/16d1a72014074e87ecb9.js +1 -0
  8. package/assets/esri/core/workers/chunks/{e4b6565c16430b28ad93.js → 19857e5420cdf23c5f2e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{1a804dea42c0fb5e5c07.js → 1bab408eaffd2c18976d.js} +1 -1
  10. package/assets/esri/core/workers/chunks/201365f53509e3f78e17.js +1 -0
  11. package/assets/esri/core/workers/chunks/{2031451b82ff70fb201a.js → 2f48f4a9a0a056ac5e1c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/318b51fdee09c1fd750f.js +1 -0
  13. package/assets/esri/core/workers/chunks/{5b799dc155adeb728c74.js → 3361e3e8385f8de8820c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/3ce1870c28ab6ac3648e.js +1 -0
  15. package/assets/esri/core/workers/chunks/41929e4531787389804b.js +1 -0
  16. package/assets/esri/core/workers/chunks/{55ac725127c5ea9fb942.js → 4e39252f40bc57be9d12.js} +1 -1
  17. package/assets/esri/core/workers/chunks/4e496b03ce24b1206f86.js +1 -0
  18. package/assets/esri/core/workers/chunks/{ee5f17c1790dc07f9d9e.js → 50455c84131b634ca6b4.js} +1 -1
  19. package/assets/esri/core/workers/chunks/54513578f735d274a20e.js +1 -0
  20. package/assets/esri/core/workers/chunks/{d46f8ef92e79d12384c9.js → 587437526ea77f764986.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{ab720e2f0a35138564b2.js → 5ffabd1a90c5b08109aa.js} +1 -1
  22. package/assets/esri/core/workers/chunks/6108d72faf48a592c8ba.js +1 -0
  23. package/assets/esri/core/workers/chunks/6479439afae01f9bb5e6.js +1 -0
  24. package/assets/esri/core/workers/chunks/69306dfc89e877539223.js +1 -0
  25. package/assets/esri/core/workers/chunks/6db4a6f9d25691830829.js +1 -0
  26. package/assets/esri/core/workers/chunks/{61393fd3376ea599a447.js → 76e27cece1559ae815df.js} +1 -1
  27. package/assets/esri/core/workers/chunks/81526909c0fa11639038.js +1 -0
  28. package/assets/esri/core/workers/chunks/873111ddf4813cdd4903.js +1 -0
  29. package/assets/esri/core/workers/chunks/8d4f1170394a8be15da9.js +1 -0
  30. package/assets/esri/core/workers/chunks/8d8bdfda09c24e363f78.js +1 -0
  31. package/assets/esri/core/workers/chunks/9b54b5bdb6367c36f6e9.js +1 -0
  32. package/assets/esri/core/workers/chunks/b2752e038c5fa3c21e49.js +1 -0
  33. package/assets/esri/core/workers/chunks/{dd3b7cfc6f78552249a4.js → b78dc6cbe14e5817b4d9.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{e31d0c7363cbceeb5ac9.js → c35b850fbfcb28133235.js} +1 -1
  35. package/assets/esri/core/workers/chunks/c83e1be4ee64320cf2fe.js +1 -0
  36. package/assets/esri/core/workers/chunks/c88869d2a647c22dc3e6.js +1 -0
  37. package/assets/esri/core/workers/chunks/cb0a5bc6deaa98026bb5.js +1 -0
  38. package/assets/esri/core/workers/chunks/{767467738aeabec14abd.js → d0c4367a197b193e95d4.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{f113141e254505116b82.js → d1cc2c050423595e54e0.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{7f34945036495ad7c3f8.js → d2a8bf2d090b94cb294b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{08af7f7f1950a59a8e47.js → d6c96a20e9640b433719.js} +4 -4
  42. package/assets/esri/core/workers/chunks/da5453e67d00ff546640.js +1 -0
  43. package/assets/esri/core/workers/chunks/daa79c14150c12d8bc3d.js +1 -0
  44. package/assets/esri/core/workers/chunks/ef03b78659c72de93076.js +1 -0
  45. package/assets/esri/core/workers/chunks/{c3cace5b25b5170228ba.js → f2fe89b6ac6bf6817e71.js} +1 -1
  46. package/assets/esri/core/workers/chunks/f3554627664a419e00fa.js +1 -0
  47. package/assets/esri/themes/base/_core.scss +2 -0
  48. package/assets/esri/themes/base/widgets/_DirectionalPad.scss +76 -0
  49. package/assets/esri/themes/base/widgets/_Editor.scss +65 -4
  50. package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +97 -39
  51. package/assets/esri/themes/dark/main.css +1 -1
  52. package/assets/esri/themes/light/main.css +1 -1
  53. package/assets/esri/themes/light/view.css +1 -1
  54. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad.json +1 -0
  55. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_en.json +1 -0
  56. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  57. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  58. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/butt.png +0 -0
  59. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/round.png +0 -0
  60. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/square.png +0 -0
  61. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dash-dot.png +0 -0
  62. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dash.png +0 -0
  63. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dot.png +0 -0
  64. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash-dot-dot.png +0 -0
  65. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash-dot.png +0 -0
  66. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash.png +0 -0
  67. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash-dot-dot.png +0 -0
  68. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash-dot.png +0 -0
  69. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash.png +0 -0
  70. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dot.png +0 -0
  71. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/solid.png +0 -0
  72. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations.json +1 -1
  73. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_en.json +1 -1
  74. package/chunks/HighlightBlur.glsl.js +3 -3
  75. package/chunks/HighlightDownsample.glsl.js +24 -6
  76. package/chunks/SSAO.glsl.js +2 -2
  77. package/core/timeUtils.js +1 -1
  78. package/interfaces.d.ts +182 -2
  79. package/intl/date.js +1 -1
  80. package/layers/FeatureLayer.js +1 -1
  81. package/layers/ImageryLayer.js +1 -1
  82. package/layers/ImageryTileLayer.js +1 -1
  83. package/layers/StreamLayer.js +1 -1
  84. package/layers/SubtypeGroupLayer.js +1 -1
  85. package/layers/VoxelWasmPerSceneView.js +1 -1
  86. package/layers/graphics/sources/support/uploads.js +1 -1
  87. package/layers/mixins/ArcGISImageService.js +1 -1
  88. package/layers/mixins/ImageryTileMixin.js +1 -1
  89. package/layers/save/featureLayerUtils.js +1 -1
  90. package/layers/save/imageryUtils.js +1 -1
  91. package/layers/save/streamLayerUtils.js +1 -1
  92. package/libs/maquette-advanced-projector/utils.js +1 -1
  93. package/package.json +1 -1
  94. package/popup/support/FieldInfoFormat.js +1 -1
  95. package/portal/PortalItem.js +1 -1
  96. package/support/revision.js +1 -1
  97. package/views/2d/navigation/MapViewNavigation.js +1 -1
  98. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  99. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  100. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  101. package/views/3d/support/LaserLineRenderer.js +1 -1
  102. package/views/3d/terrain/OverlayRenderer.js +1 -1
  103. package/views/3d/terrain/TerrainRenderer.js +1 -1
  104. package/views/3d/terrain/TerrainSurface.js +1 -1
  105. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  106. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  107. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  108. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  109. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  110. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  111. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  112. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  113. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  114. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  115. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  116. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  117. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  118. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  119. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  120. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  121. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  122. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  123. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  124. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  125. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  126. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  127. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  128. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  129. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  130. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  131. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  132. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  133. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
  134. package/views/draw/DrawGraphicTool.js +1 -1
  135. package/views/draw/DrawOperation.js +1 -1
  136. package/views/interactive/sketch/constraints.js +1 -1
  137. package/views/interactive/sketch/normalizedPoint.js +1 -1
  138. package/views/interactive/snapping/SnappingManager.js +1 -1
  139. package/views/interactive/snapping/candidates/IntersectionSnappingCandidate.js +1 -1
  140. package/views/interactive/tooltip/TooltipEditableField.js +1 -1
  141. package/views/interactive/tooltip/TooltipEditableFieldAngle.js +1 -1
  142. package/views/interactive/tooltip/constraintUtils.js +5 -0
  143. package/views/support/angularMeasurementUtils.js +1 -1
  144. package/widgets/Compass/CompassViewModel.js +1 -1
  145. package/widgets/Compass/utils.js +5 -0
  146. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +4 -0
  147. package/widgets/DirectionalPad/DirectionalPadViewModel.js +5 -0
  148. package/widgets/DirectionalPad/VisibleElements.js +5 -0
  149. package/widgets/DirectionalPad/constants.js +5 -0
  150. package/widgets/DirectionalPad/css.js +5 -0
  151. package/widgets/DirectionalPad/utils.js +5 -0
  152. package/widgets/DirectionalPad.d.ts +4 -0
  153. package/widgets/DirectionalPad.js +5 -0
  154. package/widgets/Editor/EditorViewModel.js +1 -1
  155. package/widgets/Editor/Upload.js +1 -1
  156. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  157. package/widgets/Editor/components/UploadDetails.js +1 -1
  158. package/widgets/Editor/modelUploadUtils.js +1 -1
  159. package/widgets/Editor.js +1 -1
  160. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  161. package/widgets/ElevationProfile.js +1 -1
  162. package/widgets/Feature/FeatureViewModel.js +1 -1
  163. package/widgets/Feature/support/featureUtils.js +1 -1
  164. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  165. package/widgets/FeatureForm/FieldInput.js +1 -1
  166. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  167. package/widgets/FeatureForm/InputBase.js +1 -1
  168. package/widgets/FeatureForm.js +1 -1
  169. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +5 -0
  170. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  171. package/widgets/UtilityNetworkAssociations/VisibleElements.js +5 -0
  172. package/widgets/UtilityNetworkAssociations/VisibleElementsSettingsPane.js +5 -0
  173. package/widgets/UtilityNetworkAssociations.js +1 -1
  174. package/assets/esri/core/workers/chunks/11abbbf97093b55e2417.js +0 -1
  175. package/assets/esri/core/workers/chunks/1b2a081f2c3b97ba7e00.js +0 -1
  176. package/assets/esri/core/workers/chunks/235f333177ed7ea21e01.js +0 -1
  177. package/assets/esri/core/workers/chunks/3725dd14c2da0f47198f.js +0 -1
  178. package/assets/esri/core/workers/chunks/39467e1da18924cfb9b6.js +0 -1
  179. package/assets/esri/core/workers/chunks/42595c4870c673ed451c.js +0 -1
  180. package/assets/esri/core/workers/chunks/481cdd2a4bc40c6fef66.js +0 -1
  181. package/assets/esri/core/workers/chunks/54893132e70c515ea7e3.js +0 -1
  182. package/assets/esri/core/workers/chunks/6509a4198972b323d9b6.js +0 -1
  183. package/assets/esri/core/workers/chunks/68598d2806d4aa3d8acc.js +0 -1
  184. package/assets/esri/core/workers/chunks/718d2e8ea61f3b7b70c5.js +0 -1
  185. package/assets/esri/core/workers/chunks/7bce4b5eec630ef57f1e.js +0 -1
  186. package/assets/esri/core/workers/chunks/81df7304f97d1fc3ba16.js +0 -1
  187. package/assets/esri/core/workers/chunks/8706dc9f852df9b2095d.js +0 -1
  188. package/assets/esri/core/workers/chunks/8ef26aac0fe7feb8c324.js +0 -1
  189. package/assets/esri/core/workers/chunks/91e61da22f258d9e86c5.js +0 -1
  190. package/assets/esri/core/workers/chunks/9f039bf79b34d8fd75ae.js +0 -1
  191. package/assets/esri/core/workers/chunks/a1f3352301472e4b8956.js +0 -1
  192. package/assets/esri/core/workers/chunks/a20fd9e7db37b3c3b041.js +0 -1
  193. package/assets/esri/core/workers/chunks/aa83dce42d64034a0a13.js +0 -1
  194. package/assets/esri/core/workers/chunks/c8c8471b59700914ee9d.js +0 -1
  195. package/assets/esri/core/workers/chunks/cdcf0a5e05283d37b3ac.js +0 -1
  196. package/assets/esri/core/workers/chunks/d4f9106bf2ea5d66d96a.js +0 -1
  197. package/assets/esri/core/workers/chunks/e6bfbc4347fa13db4df2.js +0 -1
  198. package/assets/esri/core/workers/chunks/f1d5487f2d828fb142ba.js +0 -1
  199. package/assets/esri/core/workers/chunks/f97f165d05439e668e05.js +0 -1
  200. package/assets/esri/core/workers/chunks/fe973d8155c22d73a4f9.js +0 -1
@@ -1 +0,0 @@
1
- (self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[450,661,5234,9880],{41993:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=41993,e.exports=t},99880:(e,t,s)=>{"use strict";s.d(t,{V:()=>l});var r=s(68773),i=(s(3172),s(20102)),n=s(92604),o=s(17452);const a=n.Z.getLogger("esri.assets");function l(e){if(!r.default.assetsPath)throw a.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new i.Z("assets:path-not-set","config.assetsPath is not set");return(0,o.v_)(r.default.assetsPath,e)}},46791:(e,t,s)=>{"use strict";s.d(t,{Z:()=>O});var r,i=s(43697),n=s(3894),o=s(32448),a=s(50758),l=s(22974),h=s(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(r||(r={}));var c,d=s(1654),u=s(75215),p=s(58971),f=s(5600),_=s(52421),m=s(52011),g=s(10661);class v{constructor(e,t,s,r,i){this.target=e,this.added=t,this.removed=s,this.start=r,this.deleteCount=i}}const y=new h.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function w(e){return e?e instanceof x?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function b(e){if(e&&e.length)return e[0]}function S(e,t,s,r){const i=Math.min(e.length-s,t.length-r);let n=0;for(;n<i&&e[s+n]===t[r+n];)n++;return n}function I(e,t,s,r){t&&t.forEach(((t,i,n)=>{e.push(t),I(e,s.call(r,t,i,n),s,r)}))}const A=new Set,k=new Set,C=new Set,T=new Map;let U=0,x=c=class extends o.Z.EventedAccessor{static isCollection(e){return null!=e&&e instanceof c}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new g.s,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:U++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof c?{items:e}:e:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return(0,p.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(r.ADD)||(this._splice(0,this.length,w(e)),this._emitAfterChanges(r.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,a.kB)((()=>{s.removed=!0,e.splice(e.indexOf(s),1)}))}return this._emitter.on(e,t)}once(e,t){const s="deref"in t?()=>t.deref():()=>t,r=this.on(e,(e=>{s()?.call(null,e),r.remove()}));return r}add(e,t){if((0,p.it)(this._observable),this._emitBeforeChanges(r.ADD))return this;const s=this.getNextIndex(t??null);return this._splice(s,0,[e]),this._emitAfterChanges(r.ADD),this}addMany(e,t=this._items.length){if((0,p.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(r.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,w(e)),this._emitAfterChanges(r.ADD),this}at(e){if((0,p.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(r.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.map(l.d9)})}concat(...e){(0,p.it)(this._observable);const t=e.map(w);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const s=this._splice(0,this.length),i=s.length;for(let r=0;r<i;r++)e.call(t,s[r],r,s);this._emitAfterChanges(r.REMOVE)}every(e,t){return(0,p.it)(this._observable),this._items.every(e,t)}filter(e,t){let s;return(0,p.it)(this._observable),s=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:s})}find(e,t){return(0,p.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,p.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,p.it)(this._observable);const s=[];return I(s,this,e,t),new c(s)}forEach(e,t){return(0,p.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,p.it)(this._observable),this._items[e]}getNextIndex(e){(0,p.it)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,p.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,p.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,p.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,p.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,p.it)(this._observable);const s=this._items.map(e,t);return new c({items:s})}reorder(e,t=this.length-1){(0,p.it)(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(r.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(r.MOVE)}return e}}pop(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=b(this._splice(this.length-1,1));return this._emitAfterChanges(r.REMOVE),e}push(...e){return(0,p.it)(this._observable),this._emitBeforeChanges(r.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(r.ADD)),this.length}reduce(e,t){(0,p.it)(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){(0,p.it)(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return(0,p.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,p.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(r.REMOVE))return;const t=b(this._splice(e,1));return this._emitAfterChanges(r.REMOVE),t}removeMany(e){if((0,p.it)(this._observable),!e||!e.length||this._emitBeforeChanges(r.REMOVE))return[];const t=e instanceof c?e.toArray():e,s=this._items,i=[],n=t.length;for(let e=0;e<n;e++){const r=t[e],n=s.indexOf(r);if(n>-1){const r=1+S(t,s,e+1,n+1),o=this._splice(n,r);o&&o.length>0&&i.push.apply(i,o),e+=r-1}}return this._emitAfterChanges(r.REMOVE),i}reverse(){if((0,p.it)(this._observable),this._emitBeforeChanges(r.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(r.MOVE),this}shift(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=b(this._splice(0,1));return this._emitAfterChanges(r.REMOVE),e}slice(e=0,t=this.length){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,p.it)(this._observable),this._items.some(e,t)}sort(e){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(r.MOVE),this}splice(e,t,...s){(0,p.it)(this._observable);const i=(t?r.REMOVE:0)|(s.length?r.ADD:0);if(this._emitBeforeChanges(i))return[];const n=this._splice(e,t,s)||[];return this._emitAfterChanges(i),n}toArray(){return(0,p.it)(this._observable),this._items.slice()}toJSON(){return(0,p.it)(this._observable),this.toArray()}toLocaleString(){return(0,p.it)(this._observable),this._items.toLocaleString()}toString(){return(0,p.it)(this._observable),this._items.toString()}unshift(...e){return(0,p.it)(this._observable),!e.length||this._emitBeforeChanges(r.ADD)||(this._splice(0,0,e),this._emitAfterChanges(r.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const r=this._items,i=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,d.Os)((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(o=r.splice(e,t),this.hasEventListener("before-remove")){const t=y.acquire();t.target=this,t.cancellable=!0;for(let s=0,i=o.length;s<i;s++)n=o[s],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(o.splice(s,1),r.splice(e,0,n),e+=1,s-=1,i-=1);y.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=y.acquire();e.target=this,e.cancellable=!1;const t=o.length;for(let s=0;s<t;s++)e.reset(o[s]),this.emit("after-remove",e);y.release(e)}}if(s&&s.length){if(i){const e=[];for(const t of s){const s=i.ensureType(t);null==s&&null!=t||e.push(s)}s=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),o=e===this.length;if(t||n){const i=y.acquire();i.target=this,i.cancellable=!0;const a=y.acquire();a.target=this,a.cancellable=!1;for(const l of s)t?(i.reset(l),this.emit("before-add",i),i.defaultPrevented||(o?r.push(l):r.splice(e++,0,l),this._set("length",r.length),n&&(a.reset(l),this.emit("after-add",a)))):(o?r.push(l):r.splice(e++,0,l),this._set("length",r.length),a.reset(l),this.emit("after-add",a));y.release(a),y.release(i)}else{if(o)for(const e of s)r.push(e);else r.splice(e,0,...s);this._set("length",r.length)}}if((s&&s.length||o&&o.length)&&this._notifyChangeEvent(s,o),this.hasEventListener("after-splice")){const r=new v(this,s,o,e,t);this.emit("after-splice",r)}return o}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const s=y.acquire();s.target=this,s.cancellable=!0,s.type=e,this.emit("before-changes",s),t=s.defaultPrevented,y.release(s)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=y.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),y.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;A.clear(),k.clear(),C.clear();for(const{added:t,removed:s}of e){if(t)if(0===C.size&&0===k.size)for(const e of t)A.add(e);else for(const e of t)k.has(e)?(C.add(e),k.delete(e)):C.has(e)||A.add(e);if(s)if(0===C.size&&0===A.size)for(const e of s)k.add(e);else for(const e of s)A.has(e)?A.delete(e):(C.delete(e),k.add(e))}const s=n.Z.acquire();A.forEach((e=>{s.push(e)}));const r=n.Z.acquire();k.forEach((e=>{r.push(e)}));const i=this._items,o=t.items,a=n.Z.acquire();if(C.forEach((e=>{o.indexOf(e)!==i.indexOf(e)&&a.push(e)})),t.listeners&&(s.length||r.length||a.length)){const e={target:this,added:s,removed:r,moved:a},i=t.listeners.length;for(let s=0;s<i;s++){const r=t.listeners[s];r.removed||r.callback.call(this,e)}}n.Z.release(s),n.Z.release(r),n.Z.release(a)}A.clear(),k.clear(),C.clear()}};x.ofType=e=>{if(!e)return c;if(T.has(e))return T.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const s in e.typeMap){const r=e.typeMap[s].prototype.declaredClass;t?t+=` | ${r}`:t=r}let s=class extends c{};return(0,i._)([(0,_.c)({Type:e,ensureType:"function"==typeof e?(0,u.se)(e):(0,u.N7)(e)})],s.prototype,"itemType",void 0),s=(0,i._)([(0,m.j)(`esri.core.Collection<${t}>`)],s),T.set(e,s),s},(0,i._)([(0,f.Cb)()],x.prototype,"length",void 0),(0,i._)([(0,f.Cb)()],x.prototype,"items",null),x=c=(0,i._)([(0,m.j)("esri.core.Collection")],x);const O=x},32448:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var r=s(43697),i=s(92036),n=s(50758),o=s(52011);class a{constructor(){this._emitter=new a.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this._target=e,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(e,t){let s=this._listenersMap?.get(e);if(!s)return!1;const r=this._target||this;let i=!1;for(const e of s.slice()){const s="deref"in e?e.deref():e;s?s?.call(r,t):i=!0}return i&&(s=s.filter((e=>!("deref"in e)||null!=e.deref())),this._listenersMap.set(e,s)),s.length>0}on(e,t){if(Array.isArray(e)){const s=e.map((e=>this.on(e,t)));return(0,n.AL)(s)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const s=this._listenersMap.get(e)||[];return s.push(t),this._listenersMap.set(e,s),(0,n.kB)((()=>{const s=this._listenersMap?.get(e),r=s?.indexOf(t)??-1;r>=0&&s.splice(r,1)}))}once(e,t){const s=this.on(e,(e=>{s.remove();const r="deref"in t?t.deref():t;r?.call(null,e)}));return s}hasEventListener(e){const t=this._listenersMap&&this._listenersMap.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let s=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return s=(0,r._)([(0,o.j)("esri.core.Evented")],s),s};let s=class extends i.Z{constructor(){super(...arguments),this._emitter=new a.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};s=(0,r._)([(0,o.j)("esri.core.Evented")],s),e.EventedAccessor=s}(a||(a={}));const l=a},609:(e,t,s)=>{"use strict";s.d(t,{D:()=>d,v:()=>c});var r,i,n=s(43697),o=s(92036),a=s(95330),l=s(52011);(i=r||(r={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class h{constructor(){this._resolver=(0,a.hh)(),this._status=r.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=r.RESOLVED,this._cleanUp()}),(()=>{this._status=r.REJECTED,this._cleanUp()})),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===r.RESOLVED}isRejected(){return this._status===r.REJECTED}isFulfilled(){return this._status!==r.PENDING}abort(){this._resolver.reject((0,a.zE)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,a.hh)(),t=[...this._resolvingPromises,e.promise],s=this._allPromise=Promise.all(t);s.then((()=>{this.isFulfilled()||this._allPromise!==s||this._resolver.resolve()}),(e=>{this.isFulfilled()||this._allPromise!==s||(0,a.D_)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new h,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then((()=>this)).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}};return t=(0,n._)([(0,l.j)("esri.core.Promise")],t),t};let d=class extends(c(o.Z)){};d=(0,n._)([(0,l.j)("esri.core.Promise")],d)},90578:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var r=s(75215),i=s(7628);const n=Object.prototype.toString;function o(e){const t="__accessorMetadata__"in e?(0,r.se)(e):e;return function(...e){if(e.push(t),"number"==typeof e[2])throw new Error("Using @cast has parameter decorator is not supported since 4.16");return a.apply(this,e)}}function a(e,t,s,r){(0,i.Oe)(e,t).cast=r}function l(...e){if(3!==e.length||"string"!=typeof e[1])return 1===e.length&&"[object Function]"===n.call(e[0])?o(e[0]):1===e.length&&"string"==typeof e[0]?function(e){return(t,s)=>{(0,i.Oe)(t,e).cast=t[s]}}(e[0]):void 0}},52421:(e,t,s)=>{"use strict";function r(e){return(t,s)=>{t[s]=e}}s.d(t,{c:()=>r})},10661:(e,t,s)=>{"use strict";s.d(t,{s:()=>i});var r=s(42100);class i extends r.s{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onInvalidated(),e.onCommitted()}}}},66643:(e,t,s)=>{"use strict";s.d(t,{Ed:()=>h,UI:()=>c,mt:()=>f,q6:()=>p,vr:()=>_});var r=s(43697),i=s(92036),n=s(70586),o=s(95330),a=s(5600),l=s(52011);function h(e,t,s){return(0,o.as)(e.map(((e,r)=>t.apply(s,[e,r]))))}async function c(e,t,s){return(await(0,o.as)(e.map(((e,r)=>t.apply(s,[e,r]))))).map((e=>e.value))}function d(e){return{ok:!0,value:e}}function u(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return u(e)}}async function f(e){try{return d(await e)}catch(e){return(0,o.r9)(e),u(e)}}function _(e,t){return new m(e,t)}let m=class extends i.Z{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:s}=this._abortController;this.promise=e(s),this.promise.then((e=>{this._result=d(e),this._cleanup()}),(e=>{this._result=u(e),this._cleanup()})),this._abortHandle=(0,o.fu)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.hw)(this._abortHandle),this._abortController=null}};(0,r._)([(0,a.Cb)()],m.prototype,"value",null),(0,r._)([(0,a.Cb)()],m.prototype,"error",null),(0,r._)([(0,a.Cb)()],m.prototype,"finished",null),(0,r._)([(0,a.Cb)()],m.prototype,"promise",void 0),(0,r._)([(0,a.Cb)()],m.prototype,"_result",void 0),m=(0,r._)([(0,l.j)("esri.core.asyncUtils.ReactiveTask")],m)},35454:(e,t,s)=>{"use strict";s.d(t,{X:()=>i,w:()=>n});var r=s(78286);class i{constructor(e,t={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=t,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=e=>this.fromJSON(e),this.write=(e,t,s)=>{const i=this.toJSON(e);void 0!==i&&(0,r.RB)(s,i,t)},this.write.isJSONMapWriter=!0}toJSON(e){if(null==e)return null;if(this._apiToJSON.hasOwnProperty(e)){const t=this._apiToJSON[e];return this._options.useNumericKeys?+t:t}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return null!=e&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const t={};for(const s in e)t[e[s]]=s;return t}_getKeysSorted(e){const t=[];for(const s in e)t.push(s);return t.sort(),t}}function n(){return function(e,t){return new i(e,{ignoreUnknown:!0,...t})}}},17445:(e,t,s)=>{"use strict";s.d(t,{N1:()=>u,YP:()=>l,Z_:()=>_,gx:()=>h,nn:()=>m,on:()=>d,tX:()=>g}),s(66643),s(46791);var r=s(91460),i=s(50758),n=s(70586),o=s(95330),a=s(26258);function l(e,t,s={}){return c(e,t,s,p)}function h(e,t,s={}){return c(e,t,s,f)}function c(e,t,s={},r){let i=null;const o=s.once?(e,s)=>{r(e)&&((0,n.hw)(i),t(e,s))}:(e,s)=>{r(e)&&t(e,s)};if(i=(0,a.aQ)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return i}function d(e,t,s,o={}){let a=null,h=null,c=null;function d(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.hw)(c),s(e)}const p=l(e,((e,s)=>{d(),(0,r.vT)(e)&&(a=e,h=(0,r.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return c=(0,i.kB)((()=>{p.remove(),d()})),c}function u(e,t){return function(e,t,s){if((0,o.Hc)(s))return Promise.reject((0,o.zE)());const r=e();if(t?.(r))return Promise.resolve(r);let a=null;function l(){a=(0,n.hw)(a)}return new Promise(((r,n)=>{a=(0,i.AL)([(0,o.fu)(s,(()=>{l(),n((0,o.zE)())})),c(e,(e=>{l(),r(e)}),{sync:!1,once:!0},t??p)])}))}(e,f,t)}function p(e){return!0}function f(e){return!!e}s(87538);const _={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},41123:(e,t,s)=>{"use strict";s.d(t,{D:()=>i,z:()=>n});const r="randomUUID"in crypto;function i(){if(r)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${i()}}`}},73660:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>mt});var r=s(40330),i=s(43697),n=s(68773),o=s(3172),a=s(20102),l=s(32448),h=s(91460),c=s(22974),d=s(78286),u=s(95330),p=s(17445),f=s(17452),_=s(5600),m=(s(75215),s(52011)),g=(s(67676),s(80442),s(940)),v=(s(2587),s(60235));Element.prototype.closest;var y=s(92604),w=s(70586),b=s(609),S=s(41123),I=s(90578),A=s(58971),k=s(38805),C=s(8728),T=s(3894),U=s(50758);const x=new Map;function O(){x.clear()}function P(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function E(e){const t=T.Z.acquire();for(let e=0;e<arguments.length;e++){const s=arguments[e],r=typeof s;if("string"===r)t.push(s);else if(Array.isArray(s))t.push.apply(t,s);else if("object"===r)for(const e in s)s[e]&&t.push(e)}const s=t.join(" ");return T.Z.release(t),s}function R(e){this[e.getAttribute("data-node-ref")]=e}(()=>{const e=new Map;new ResizeObserver((t=>{O();for(const s of t)e.get(s.target)?.(s)}))})();const D=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce(((e,t)=>(e[t]=[],e)),{}),N=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],L=new C.Z({whiteList:D,onTagAttr:(e,t,s)=>{const r=`${t}="${s}"`;if(N.includes(t))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),j="http://www.w3.org/",M=`${j}2000/svg`,q=`${j}1999/xlink`;let B=[],V=(e,t)=>{let s={};return Object.keys(e).forEach((t=>{s[t]=e[t]})),t&&Object.keys(t).forEach((e=>{s[e]=t[e]})),s},Z=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),$=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},F=(e,t,s)=>{if(""!==t.vnodeSelector)for(let r=s;r<e.length;r++)if(Z(e[r],t))return r;return-1},z=(e,t,s,r)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if(Z(t,i))throw new Error(`${s.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===r?r:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},H=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},J=[],W=!1,G=e=>{(e.children||[]).forEach(G),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},Y=()=>{W=!1,J.forEach(G),J.length=0},K=e=>{J.push(e),W||(W=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(Y,{timeout:16}):setTimeout(Y,16))},X=e=>{let t=e.domNode;if(e.properties){let s=e.properties.exitAnimation;if(s){t.style.pointerEvents="none";let r=()=>{t.parentNode&&(t.parentNode.removeChild(t),K(e))};return void s(t,r,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),K(e))},Q=(e,t,s)=>{if(!t)return;let r=s.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)ie(e,a,!0);else if("classes"===n){let t=Object.keys(a),s=t.length;for(let r=0;r<s;r++){let s=t[r];a[s]&&e.classList.add(s)}}else if("styles"===n){let t=Object.keys(a),r=t.length;for(let i=0;i<r;i++){let r=t[i],n=a[r];n&&($(n),s.styleApplyer(e,r,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(r&&(a=r(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):s.namespace===M?"href"===n?e.setAttributeNS(q,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=L.sanitize(a):ee(e)&&n in e?e[n]=a:e.setAttribute(n,a):e[n]=a}}};function ee(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let te,se=(e,t,s)=>{((e,t,s)=>{if(t)for(let r of t)re(r,e,void 0,s)})(e,t.children,s),t.text&&(e.textContent=t.text),Q(e,t.properties,s),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,s,t.vnodeSelector,t.properties,t.children])},re=(e,t,s,r)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==s?t.insertBefore(i,s):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),c=o.slice(n,l);"."===h?i.classList.add(c):"#"===h?i.id=c:("svg"===c&&(r=V(r,{namespace:M})),void 0!==r.namespace?i=e.domNode=a.createElementNS(r.namespace,c):(i=e.domNode=e.domNode||a.createElement(c),"input"===c&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==s?t.insertBefore(i,s):i.parentNode!==t&&t.appendChild(i)),n=l+1}}se(i,e,r)}},ie=(e,t,s)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,s)}))},ne=(e,t,s,r,i)=>{if(s===r)return!1;r=r||B;let n,o=(s=s||B).length,a=r.length,l=0,h=0,c=!1;for(;h<a;){let a=l<o?s[l]:void 0,d=r[h];if(void 0!==a&&Z(a,d))c=te(a,d,i)||c,l++;else{let a=F(s,d,l+1);if(a>=0){for(n=l;n<a;n++)X(s[n]),z(s,n,e,"removed");c=te(s[a],d,i)||c,l=a+1}else re(d,t,l<o?s[l].domNode:void 0,i),H(d),z(r,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)X(s[n]),z(s,n,e,"removed");return c};te=(e,t,s)=>{let r=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=r.ownerDocument.createTextNode(t.text);return r.parentNode.replaceChild(e,r),t.domNode=e,i=!0,i}t.domNode=r}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(s=V(s,{namespace:M})),e.text!==t.text&&(n=!0,void 0===t.text?r.removeChild(r.firstChild):r.textContent=t.text),t.domNode=r,n=ne(t,r,e.children,t.children,s)||n,n=((e,t,s,r)=>{if(!s)return;let i=!1,n=Object.keys(s),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=s[o],h=t[o];if("class"===o)h!==l&&(ie(e,h,!1),ie(e,l,!0));else if("classes"===o){let t=e.classList,s=Object.keys(l),r=s.length;for(let e=0;e<r;e++){let r=s[e],n=!!l[r];n!==!!h[r]&&(i=!0,n?t.add(r):t.remove(r))}}else if("styles"===o){let t=Object.keys(l),s=t.length;for(let n=0;n<s;n++){let s=t[n],o=l[s];o!==h[s]&&(i=!0,o?($(o),r.styleApplyer(e,s,o)):r.styleApplyer(e,s,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||ee(e)){if(l!==h){let t=typeof l;"function"===t&&r.eventHandlerInterceptor||(r.namespace===M?"href"===o?e.setAttributeNS(q,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=L.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):ee(e)&&o in e?e[o]=l:e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}else{let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i})(r,e.properties,t.properties,s)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[r,s,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(r,t.properties,e.properties),i};let oe=(e,t)=>({getLastRender:()=>e,update:s=>{if(e.vnodeSelector!==s.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let r=e;e=s,te(r,s,t)},domNode:e.domNode});const ae={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,s)=>{"-"===t.charAt(0)?e.style.setProperty(t,s):e.style[t]=s}};let le,he=e=>V(ae,e),ce=(e,t,s)=>(s=he(s),re(t,e,void 0,s),oe(t,s)),de=(e,t,s)=>(s=he(s),re(t,e.parentNode,e,s),oe(t,s)),ue=(e,t,s)=>(s=he(s),t.domNode=e,se(e,t,s),oe(t,s)),pe=(e,t,s)=>(s=he(s),re(t,e.parentNode,e,s),e.parentNode.removeChild(e),oe(t,s));le=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const fe={handleInterceptedEvent:(e,t,s,r)=>(e.scheduleRender(),t.properties[`on${r.type}`].apply(t.properties.bind||s,[r]))},_e={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,s)=>{e.style[t]=s}},me=(e,t,s=!1)=>{let r=e;return t.forEach(((e,i)=>{const n=r?.children?((e,t)=>e.find(t))(r.children,(t=>t.domNode===e)):void 0;s&&!n&&i!==t.length-1||(r=n)})),r};var ge=s(65161),ve=s(99880);let ye;ye="components/assets";const we=Symbol("widget"),be=Symbol("widget-test-data"),Se=[],Ie={},Ae=new WeakMap;function ke(e,t){let s=t.children;if(s&&s.length)for(let t=0;t<s.length;++t)s[t]=ke(e,s[t]);else s=Se;const r=t.vnodeSelector;if(xe(r)){const i=t.properties||Ie,n=i.key||r;return{vnodeSelector:"div",properties:{key:n,afterCreate:Ce,afterUpdate:Te,afterRemoved:Ue,parentWidget:e,widgetConstructor:r,widgetProperties:{...i,key:n,children:s}},children:void 0,text:void 0,domNode:null}}return t}function Ce(e,t,s,{parentWidget:r,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,Ae.set(e,o),o.afterCreate?.(o,e),r.addHandles((0,U.kB)((()=>Ue(e)))),queueMicrotask((()=>{o[be].projector.renderNow()}))}function Te(e,t,s,{widgetProperties:r}){const i=Ae.get(e);i&&(i.set(r),i.afterUpdate?.(i,e))}function Ue(e){const t=Ae.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),Ae.delete(e))}function xe(e){return"function"==typeof e&&e[we]}const Oe=new Set;var Pe,Ee=s(70171),Re=s(94443);let De=0;function Ne(e,t){for(const s in t)null!=e[s]&&("object"==typeof e[s]&&"object"==typeof t[s]?Ne(e[s],t?.[s]):e[s]=t[s]);return e}const Le=(e=>{let t;const s={...fe,...e},r=(n=s,{..._e,...n}),i=r.performanceLogger;var n;let o,a=!0,l=!1;const h=[],c=[],d=(e,n,o)=>{let a;r.eventHandlerInterceptor=(e,r,n,o)=>function(e){let r;i("domEvent",e);const n=((e,t)=>{const s=[];for(;e&&e!==t;)s.push(e),e=e.parentNode;return s})(e.currentTarget,a.domNode),o=n.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),s=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).filter((e=>e.getRootNode()===e.ownerDocument)).reverse();r=me(a.getLastRender(),s,!0)}else n.reverse(),r=me(a.getLastRender(),n);let l;return r&&(l=s.handleInterceptedEvent(t,r,this,e)),i("domEventProcessed",e),l},s.postProcessProjectionOptions?.(r);const l=o();a=e(n,l,r),r.eventHandlerInterceptor=void 0,h.push(a),c.push(o),s.afterFirstVNodeRendered&&s.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=c[e]();i("rendered",void 0),h[e].update(t),i("patched",void 0)}i("renderDone",void 0),a=!0}};return s.modifyDoRenderImplementation&&(u=s.modifyDoRenderImplementation(u,h,c)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{d(ce,e,t)},insertBefore:(e,t)=>{d(de,e,t)},merge:(e,t)=>{d(ue,e,t)},replace:(e,t)=>{d(pe,e,t)},detach:e=>{for(let t=0;t<c.length;t++)if(c[t]===e)return c.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,s=/capture$/i;e.eventHandlerInterceptor=(e,r,i,n)=>{const o=t?.(e,r,i,n),a=s.test(e);if(!((e=e.replace(s,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),s=e=>o?.call(i,e);i.addEventListener(t,s,a);const r=()=>i.removeEventListener(t,s,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),r()}}return o}},handleInterceptedEvent(e,t,s,r){const{eventPhase:i,type:n}=r,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(O(),e.scheduleRender(),l[a].call(l.bind||s,r))}});let je=!1,Me=class extends((0,b.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._projector=Le,this._readyForTrueRender=!1,this.iconClass="esri-icon-checkbox-unchecked",this.icon=null,this.key=this,this._loadLocale=(0,u.Ds)((async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let s=await(0,Re.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(s=Ne((0,c.d9)(s),this.uiStrings)),this[t]=s})));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&y.Z.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()})),function(){try{(0,ge.K3)(".")}catch{(0,ge.YY)((0,f.hF)((0,ve.V)("components/assets")))}}();const s="esri-widget-uid-"+(0,S.D)(),r=this.render.bind(this);this._trackingTarget=new k.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=r();let{properties:t}=e;t||(e.properties=t={});const{key:i}=t;if(i||(t.key=s),xe(e.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${s}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display||(t.styles.display="");let n=0;return e.children?.forEach((e=>{if(xe(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${n++}`)})),ke(this,e)};this.render=()=>{if(je)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),je=!0;try{e=(0,A.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{je=!1}return e&&function(e,t){x.set(e,t)}(this,e),e};const n=this.beforeFirstRender();var o;n?this._resourcesFetch=n.then((()=>{this._readyForTrueRender=!0,this._postInitialize()})):(this._resourcesFetch=Promise.resolve().then((()=>{this._postInitialize()})),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),o=this._resourcesFetch,Oe.add(o),o.finally((()=>Oe.delete(o)))}normalizeCtorArgs(e,t){const s={...e};return t&&(s.container=t),s}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then((()=>{})).catch(u.H9):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,P(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return function(e){return"string"==typeof e?document.getElementById(e):e??null}(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+De++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(Pe=we,be)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(P(this),this._projector.scheduleRender())}own(e){(0,v.XV)(y.Z.getLogger(this.declaredClass),"`Widget.own()` is deprecated in favor of Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return E.apply(this,e)}renderNow(){P(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,p.YP)((()=>this.viewModel),((e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.vT)(e)&&this.addHandles(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),p.tX)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.H9),this.scheduleRender()};this.addHandles([(0,Ee.qe)(e),(0,p.YP)((()=>this.uiStrings),e),(0,p.gx)((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};Me[Pe]=!0,(0,i._)([(0,_.Cb)()],Me.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,_.Cb)({value:null})],Me.prototype,"container",null),(0,i._)([(0,I.p)("container")],Me.prototype,"castContainer",null),(0,i._)([(0,_.Cb)()],Me.prototype,"iconClass",void 0),(0,i._)([(0,_.Cb)()],Me.prototype,"icon",void 0),(0,i._)([(0,_.Cb)()],Me.prototype,"id",null),(0,i._)([(0,_.Cb)()],Me.prototype,"label",null),(0,i._)([(0,_.Cb)()],Me.prototype,"renderable",null),(0,i._)([(0,_.Cb)()],Me.prototype,"uiStrings",void 0),(0,i._)([(0,_.Cb)()],Me.prototype,"viewModel",void 0),(0,i._)([(0,_.Cb)({value:!0})],Me.prototype,"visible",null),(0,i._)([(0,_.Cb)()],Me.prototype,"key",void 0),(0,i._)([(0,_.Cb)()],Me.prototype,"children",void 0),(0,i._)([(0,_.Cb)()],Me.prototype,"afterCreate",void 0),(0,i._)([(0,_.Cb)()],Me.prototype,"afterUpdate",void 0),(0,i._)([(0,_.Cb)()],Me.prototype,"afterRemoved",void 0),Me=(0,i._)([(0,m.j)("esri.widgets.Widget")],Me);const qe=Me;function Be(e){return(t,s)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:s})}}var Ve=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Ze=function(e,t){for(var s=0,r=e.length;s<r;s++){var i=e[s];Array.isArray(i)?Ze(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=Ve(i)),t.push(i))}};function $e(e,t,...s){return"function"!=typeof e||xe(e)?function(e,t){for(var s=[],r=2;r<arguments.length;r++)s[r-2]=arguments[r];if(1===s.length&&"string"==typeof s[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:s[0],domNode:null};var i=[];return Ze(s,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t,...s):e(t,...s)}const Fe="esri-identity-form",ze={base:Fe,group:`${Fe}__group`,label:`${Fe}__label`,footer:`${Fe}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"};let He=class extends qe{constructor(e,t){super(e,t),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:t,resource:s,signingIn:r,oAuthPrompt:i,messages:n}=this,o=$e("div",{class:ze.group},(0,g.n)(i?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${s||n.lblItem})`})),a=i?null:$e("div",{class:ze.group,key:"username"},$e("label",{class:ze.label},n.lblUser,$e("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:R,"data-node-ref":"_usernameInputNode",class:ze.esriInput}))),l=i?null:$e("div",{class:ze.group,key:"password"},$e("label",{class:ze.label},n.lblPwd,$e("input",{value:"",required:!0,type:"password",bind:this,afterCreate:R,"data-node-ref":"_passwordInputNode",class:ze.esriInput}))),h=$e("div",{class:this.classes(ze.group,ze.footer)},$e("input",{type:"submit",disabled:!!r,value:r?n.lblSigning:n.lblOk,class:ze.esriButton}),$e("input",{type:"button",value:n.lblCancel,bind:this,onclick:this._cancel,class:this.classes(ze.esriButton,ze.esriButtonSecondary)})),c=e?$e("div",null,e.details&&e.details.httpStatus?n.invalidUser:n.noAuthService):null;return $e("form",{class:ze.base,bind:this,onsubmit:this._submit},o,c,a,l,h)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",t)}};(0,i._)([(0,_.Cb)(),Be("esri/identity/t9n/identity")],He.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],He.prototype,"signingIn",void 0),(0,i._)([(0,_.Cb)()],He.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],He.prototype,"resource",void 0),(0,i._)([(0,_.Cb)()],He.prototype,"error",void 0),(0,i._)([(0,_.Cb)()],He.prototype,"oAuthPrompt",void 0),He=(0,i._)([(0,m.j)("esri.identity.IdentityForm")],He);const Je=He;var We=s(44291);const Ge="esri-identity-modal",Ye={base:Ge,open:`${Ge}--open`,closed:`${Ge}--closed`,title:`${Ge}__title`,dialog:`${Ge}__dialog`,content:`${Ge}__content`,closeButton:`${Ge}__close-button`,iconClose:"esri-icon-close"};let Ke=class extends qe{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles((0,p.YP)((()=>this.open),(()=>this._toggleFocusTrap())))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const e=this.id,{open:t,content:s,title:r,messages:i}=this,n=t&&!!s,o={[Ye.open]:n,[Ye.closed]:!n},a=$e("button",{class:Ye.closeButton,"aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},$e("span",{"aria-hidden":"true",class:Ye.iconClose})),l=`${e}_title`,h=`${e}_content`,c=r?$e("h1",{id:l,class:Ye.title},r):null,d=n?$e("div",{bind:this,class:Ye.dialog,role:"dialog","aria-labelledby":l,"aria-describedby":h,afterCreate:this._createFocusTrap},a,c,this._renderContent(h)):null;return $e("div",{tabIndex:-1,class:this.classes(Ye.base,o)},d)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:e,open:t}=this;e&&(t?e.activate():e.deactivate())}_createFocusTrap(e){this._destroyFocusTrap();const t=requestAnimationFrame((()=>{this._focusTrap=(0,We.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,U.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?$e("div",{class:Ye.content,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?$e("div",{class:Ye.content,id:e},t.render()):t instanceof HTMLElement?$e("div",{class:Ye.content,id:e,bind:t,afterCreate:this._attachToNode}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,_.Cb)({readOnly:!0})],Ke.prototype,"container",void 0),(0,i._)([(0,_.Cb)()],Ke.prototype,"content",void 0),(0,i._)([(0,_.Cb)()],Ke.prototype,"open",void 0),(0,i._)([(0,_.Cb)(),Be("esri/t9n/common")],Ke.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Ke.prototype,"title",null),Ke=(0,i._)([(0,m.j)("esri.identity.IdentityModal")],Ke);const Xe=Ke,Qe="esriJSAPIOAuth";class et{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let s=e[t.authNamespace];s||(s=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),s[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(Qe,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t&&t.appId&&t.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",s=new FormData;if(s.append("f","json"),s.append("auth_token",this.refreshToken||this.token),s.append("client_id",t.appId),s.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(e,s);else{const t=new XMLHttpRequest;t.open("POST",e),t.send(s)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const s=e[t.authNamespace];if(s){delete s[t.portalUrl];try{this.storage.setItem(Qe,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let s=e[t.authNamespace];s&&(s=s[t.portalUrl],s&&(this.appId=s.appId,this.codeVerifier=s.codeVerifier,this.expires=s.expires,this.refreshToken=s.refreshToken,this.ssl=s.ssl,this.stateUID=s.stateUID,this.token=s.token,this.userId=s.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(Qe);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}et.prototype.declaredClass="esri.identity.OAuthCredential";var tt,st=s(96674);let rt=tt=class extends st.wq{constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return tt.fromJSON(this.toJSON())}};(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"appId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"authNamespace",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"expiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"flowType",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"forceLogin",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"forceUserId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"locale",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"popup",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"portalUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"preserveUrlHash",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],rt.prototype,"userId",void 0),rt=tt=(0,i._)([(0,m.j)("esri.identity.OAuthInfo")],rt);const it=rt;let nt=class extends st.wq{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"currentVersion",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"hasPortal",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"hasServer",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"owningSystemUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"owningTenant",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"server",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"webTierAuth",void 0),nt=(0,i._)([(0,m.j)("esri.identity.ServerInfo")],nt);const ot=nt;var at=s(19745);const lt={},ht=e=>{const t=new f.R9(e.owningSystemUrl).host,s=new f.R9(e.server).host,r=/.+\.arcgis\.com$/i;return r.test(t)&&r.test(s)},ct=(e,t)=>!!(ht(e)&&t&&t.some((t=>t.test(e.server))));let dt=null,ut=null;try{dt=window.localStorage,ut=window.sessionStorage}catch{}class pt extends l.Z{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.formConstructor=Je,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,f.mN)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",(e=>{this._pageShowHandler(e)}))}registerServers(e){const t=this.serverInfos;t?(e=e.filter((e=>!this.findServerInfo(e.server))),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach((e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)}))}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const s of e){const e=this.findOAuthInfo(s.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),s=this._isServerRsrc(t);let r,i=this.findServerInfo(t),n=!0;i||(i=new ot,i.server=this._getServerInstanceRoot(t),s?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),r=this._findCredential(t),r?(delete e.server,Object.assign(r,e),n=!1):(r=new ft({userId:e.userId,server:i.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:s?"server":"portal"}),r.resources=[t],this.credentials.push(r)),r.emitTokenChange(!1),n||r.refreshServerTokens()}toJSON(){return(0,c.yd)({serverInfos:this.serverInfos.map((e=>e.toJSON())),oAuthInfos:this.oAuthInfos.map((e=>e.toJSON())),credentials:this.credentials.map((e=>e.toJSON()))})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,s=e.oAuthInfos,r=e.credentials;if(t){const e=[];t.forEach((t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new ot(t))})),e.length&&this.registerServers(e)}if(s){const e=[];s.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new it(t))})),e.length&&this.registerOAuthInfos(e)}r&&r.forEach((e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new ft(e)).emitTokenChange(),this.credentials.push(e))}))}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const s of this.serverInfos)if(this._hasSameServerInstance(s.server,e)){t=s;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const s of this.oAuthInfos)if(this._hasSameServerInstance(s.portalUrl,e)){t=s;break}return t}findCredential(e,t){if(!e)return;let s;e=this._sanitizeUrl(e);const r=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===r){s=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===r){s=t;break}return s}getCredential(e,t){let s,r,i=!0;t&&(s=!!t.token,r=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.hh)();if(t.signal&&(0,u.fu)(t.signal,(()=>{n.abort()})),(0,u.fu)(n,(()=>{o.reject(new a.Z("identity-manager:user-aborted","ABORTED"))})),(0,u.Hc)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=s?this.findCredential(e):null;let c;if(h&&r&&r.details&&498===r.details.httpStatus)h.destroy();else if(h)return c=new a.Z("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:r}),o.reject(c),o.promise;const d=this._findCredential(e,t);if(d)return o.resolve(d),o.promise;let p=this.findServerInfo(e);if(p)!p.hasPortal&&p.server&&p.owningSystemUrl&&this._hasSameServerInstance(p.server,p.owningSystemUrl)&&(p.hasPortal=!0),!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return c=new a.Z("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(c),o.promise;p=new ot,p.server=this._getServerInstanceRoot(e),"string"==typeof t?(p.tokenServiceUrl=t,p.hasPortal=!0):(p._restInfoPms=t,p.hasServer=!0),this.registerServers([p])}return p.hasPortal&&void 0===p._selfReq&&(i||(0,f.D6)(p.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===p.tokenServiceUrl)))&&(p._selfReq={owningTenant:t&&t.owningTenant,selfDfd:this._getPortalSelf(p.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,p,t,o,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,s){const r=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new f.R9(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,c,d,u,p,_,m;t&&(m=this.tokenValidity||n||this._defaultTokenValidity,m>n&&n>0&&(m=n)),s&&(l=s.isAdmin,h=s.serverUrl,c=s.token,p=s.signal,_=s.ssl,e.customParameters=s.customParameters),l?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,u=new f.R9(d.toLowerCase()),e.webTierAuth&&s?.serverUrl&&!_&&"http"===i.scheme&&((0,f.D6)(i.uri,d,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const g={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:c,expiration:m,referer:l||r?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,s),signal:p,...s?.ioArgs};return r||(g.withCredentials=!1),(0,o.Z)(d,g).then((s=>{const r=s.data;if(!r||!r.token)return new a.Z("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return lt[i]||(lt[i]={}),t&&(lt[i][t.username]=t.password),r.validity=m,r}))}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then((e=>e.credential))}checkAppAccess(e,t,s){let r=!1;return this.getCredential(e,{prompt:!1}).then((i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||s&&s.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.Z)(n,{query:l,authMode:"anonymous"}).then((e=>{if(!1===e.data.valid)throw new a.Z("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return r=!!e.data.viewOnlyUserTypeApp,{credential:i}})).catch((e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details&&e.details.httpStatus;if(498===t)throw i.destroy(),new a.Z("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.Z("identity-manager:invalid-request");return{credential:i}}))})).then((e=>({credential:e.credential,viewOnly:r})))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,f.u0)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,s={}){const r=(0,u.hh)(),i=()=>{l?.remove(),h?.remove(),c?.remove(),o?.destroy(),this.dialog?.destroy(),this.dialog=o=l=h=c=null},n=()=>{i(),this._oAuthDfd=null,r.reject(new a.Z("identity-manager:user-aborted","ABORTED"))};s.signal&&(0,u.fu)(s.signal,(()=>{n()}));let o=new this.formConstructor;o.resource=this.getResourceName(e),o.server=t.server,this.dialog=new Xe,this.dialog.content=o,this.dialog.open=!0,this.emit("dialog-create");let l=o.on("cancel",n),h=(0,p.YP)((()=>this.dialog.open),n),c=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:s.isAdmin,signal:s.signal}).then((n=>{i();const o=new ft({userId:e.username,server:t.server,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:s.isAdmin,validity:n.validity});r.resolve(o)})).catch((e=>{o.error=e,o.signingIn=!1}))}));return r.promise}oAuthSignIn(e,t,s,r){this._oAuthDfd=(0,u.hh)();const i=this._oAuthDfd;let n;r?.signal&&(0,u.fu)(r.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&_()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=s;const o=s._oAuthCred;if(o.storage&&("authorization-code"===s.flowType||"auto"===s.flowType&&!s.popup&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,f.rS)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,f.rS)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h,c,d;this._getCodeChallenge(n).then((i=>{const n=!r||!1!==r.oAuthPopupConfirmation;s.popup&&n?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=t.server,this.dialog=new Xe,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",_),c=(0,p.YP)((()=>this.dialog.open),_),d=l.on("submit",(()=>{m(),this._doOAuthSignIn(e,t,s,i)}))):this._doOAuthSignIn(e,t,s,i)}));const _=()=>{m(),this._oAuthDfd=null,i.reject(new a.Z("identity-manager:user-aborted","ABORTED"))},m=()=>{h?.remove(),c?.remove(),d?.remove(),l?.destroy(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach((e=>{e.destroy()})),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",(t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const s=t.source;this.getCredential(e).then((e=>{s.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)})).catch((e=>{s.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)}))}}))}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){"#"===e.charAt(0)&&(e=e.substring(1));const t=(0,f.u0)(e);let s=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,s=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(s=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}s&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){"?"===t.charAt(0)&&(t=t.substring(1));const e=(0,f.u0)(t);let s=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,s=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(s=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(s){const t={...e};["code","error","error_description","message_code","persist","state"].forEach((e=>{delete t[e]}));const s=(0,f.B7)(t),r=window.location.pathname+(s?`?${s}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",r)}}}_getOAuthToken(e,t,s,r,i){return e=e.replace(/^http:/i,"https:"),(0,o.Z)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:r&&i?{grant_type:"authorization_code",code:t,redirect_uri:r,client_id:s,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:s}}).then((e=>e.data))}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",t).then((e=>(0,f.rS)(new Uint8Array(e))))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.Z("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let s,r,i,n,o=-1;const a=t&&t.token,l=t&&t.resource,h=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,c.length)if(1===c.length){if(s=c[0],i=this.findServerInfo(s.server),r=i&&i.owningSystemUrl,n=r?this.findCredential(r,s.userId):void 0,o=this._getIdenticalSvcIdx(e,s),!a)return-1===o&&s.resources.push(e),this._addResource(e,n),s;-1!==o&&(s.resources.splice(o,1),this._removeResource(e,n))}else{let t,s;if(c.some((a=>(s=this._getIdenticalSvcIdx(e,a),-1!==s&&(t=a,i=this.findServerInfo(t.server),r=i&&i.owningSystemUrl,n=r?this.findCredential(r,t.userId):void 0,o=s,!0)))),a)t&&(t.resources.splice(o,1),this._removeResource(e,n));else if(t)return this._addResource(e,n),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const s of this.oAuthInfos)if(this._isIdProvider(s.portalUrl,e)){t=s;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let s=-1;t&&(s=this._getIdenticalSvcIdx(e,t),s>-1&&t.resources.splice(s,1))}_useProxy(e,t){return t&&t.isAdmin&&!(0,f.D6)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,f.D6)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new f.R9(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let s=t.indexOf(this._agsRest);return-1===s&&this._isAdminResource(e)&&(s=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==s||(0,at.P)(t)||(s=t.indexOf("/sharing")),-1===s&&"/"===t.substr(-1)&&(s=t.length-1),s>-1?e.substring(0,s):e}_hasSameServerInstance(e,t){return"/"===e.substr(-1)&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===t.substr(t.indexOf(":"))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,s=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,r=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):s.test(e)?e=e.replace(s,"https://devext.arcgis.com"):r.test(e)&&(e=e.replace(r,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(n.default.request.proxyUrl||"").toLowerCase(),s=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==s&&(e=e.substring(s+t.length+1)),e=(0,f.Fv)(e),(0,f.mN)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let s=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const r=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(s=r===i,!s){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;s=r.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?s=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(s=!0);return s}_isPortalDomain(e){const t=new f.R9(e.toLowerCase()),s=this._portalConfig;let r=this._gwDomains.some((e=>e.regex.test(t.uri)));return!r&&s&&(r=this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),t.uri)),r||n.default.portalUrl&&(r=(0,f.D6)(t,n.default.portalUrl,!0)),r||(r=this._portals.some((e=>this._hasSameServerInstance(e,t.uri)))),r=r||this._agsPortal.test(t.path),r}_isIdProvider(e,t){let s=-1,r=-1;this._gwDomains.forEach(((i,n)=>{-1===s&&i.regex.test(e)&&(s=n),-1===r&&i.regex.test(t)&&(r=n)}));let i=!1;if(s>-1&&r>-1&&(0===s||4===s?0!==r&&4!==r||(i=!0):1===s?1!==r&&2!==r||(i=!0):2===s?2===r&&(i=!0):3===s&&3===r&&(i=!0)),!i){const s=this.findServerInfo(t),r=s?.owningSystemUrl;r&&ht(s)&&this._isPortalDomain(r)&&this._isIdProvider(e,r)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let s=-1;for(let r=0;r<t.resources.length;r++){const i=t.resources[r];if(this._isIdenticalService(e,i)){s=r;break}}return s}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,s,r;if(this._isRESTService(e)||this._isAdminResource(e)){const r=this._getServerInstanceRoot(e);return t=r+"/admin/generateToken",s=(0,o.Z)(e=r+"/rest/info",{query:{f:"json"}}).then((e=>e.data)),{adminUrl:t,promise:s}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some((s=>(s.regex.test(e)&&(t=s.tokenServiceUrl),!!t))),t||this._portals.some((s=>(this._hasSameServerInstance(s,e)&&(t=s+this._gwTokenUrl),!!t))),t||(r=e.toLowerCase().indexOf("/sharing"),-1!==r&&(t=e.substring(0,r)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const s=new f.R9(e).port;/^http:\/\//i.test(e)&&"7080"===s&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,s){const r=t._oAuthCred;if(e.code){const i=r.codeVerifier;return r.codeVerifier=null,r.stateUID=null,r.save(),this._getOAuthToken(s.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then((i=>{const n=new ft({userId:i.username,server:s.server,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:r});return t.userId=n.userId,r.storage=i.persist?dt:ut,r.refreshToken=i.refresh_token,r.token=null,r.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,r.userId=n.userId,r.ssl=n.ssl,r.save(),n}))}const i=new ft({userId:e.username,server:s.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:r});return t.userId=i.userId,r.storage=e.persist?dt:ut,r.refreshToken=null,r.token=i.token,r.expires=i.expires,r.userId=i.userId,r.ssl=i.ssl,r.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const s="access_denied"===e.error,r=new a.Z(s?"identity-manager:user-aborted":"identity-manager:authentication-failed",s?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(r)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then((e=>{t.resolve(e)})).catch((e=>{t.reject(e)}))}_setOAuthResponseQueryString(e){e&&("?"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,f.u0)(e)))}_exchangeToken(e,t,s){return(0,o.Z)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:s}}).then((e=>e.data.token))}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),(0,o.Z)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then((e=>e.data))}_getPortalSelf(e,t){let s;return this._gwDomains.some((t=>(t.regex.test(e)&&(s=t.customBaseUrl),!!s))),s?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:s,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,o.Z)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then((e=>e.data)))}_doPortalSignIn(e){const t=this._portalConfig,s=window.location.href,r=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(s)||!(r?r.hasPortal||r.owningSystemUrl&&this._isPortalDomain(r.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(s,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,f.D6)(s,e,!0)))}_checkProtocol(e,t,s,r){let i=!0;const n=r?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,f.ed)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&s(new a.Z("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,s,r,i,n){return r||(r=(0,u.hh)()),r.resUrl_=e,r.sinfo_=t,r.options_=s,r.admin_=i,r.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(r)):this._xoReqs.push(r):this._doSignIn(r),r.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const s=e.options_&&e.options_.resource,r=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(s||r)||t.resources.push(s||r),t.scope=this._isServerRsrc(r)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach((e=>{if(!this._isIdenticalService(r,e.resUrl_)){const s=this._getSuffix(e.resUrl_);a[s]||(a[s]=!0,t.resources.push(e.resUrl_))}})),e.resolve(t),o.forEach((e=>{this._hasSameServerInstance(this._getServerInstanceRoot(r),e.resUrl_)?e.resolve(t):this._soReqs.push(e)})),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=(i,n,o,l)=>{const c=e.sinfo_,d=!e.options_||!1!==e.options_.prompt,p=c.hasPortal&&this._findOAuthInfo(e.resUrl_);let _,m;if(i)t(new ft({userId:i,server:c.server,token:o||null,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const r=(0,h.on)(window,"message",(e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(r.remove(),e.data.credential.expires<Date.now()?s(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new ft(e.data.credential))):"arcgis:auth:error"===e.data.type&&(r.remove(),"tokenExpiredError"===e.data.error.name?s(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):s(a.Z.fromJSON(e.data.error))))}));(0,u.fu)(e.options_?.signal,(()=>{r.remove()}))}else if(p){let i=p._oAuthCred;if(!i){const e=new et(p,dt),t=new et(p,ut);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,p._oAuthCred=i}if(i.isValid()){_=new ft({userId:i.userId,server:c.server,token:i.token,expires:i.expires,ssl:i.ssl,_oAuthCred:i});const s=p.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);s||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(c.server,i.refreshToken,i.appId).then((e=>(_.expires=Date.now()+1e3*e.expires_in,_.token=e.access_token,_))):Promise.resolve(_),e._pendingDfd.then((e=>s?this._exchangeToken(e.server,p.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((()=>{i?.destroy(),r()}))):t(_)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(p.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const r=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(r,p,c).then((e=>{t(e)})).catch(s)}else{const r=()=>{d?e._pendingDfd=this.oAuthSignIn(e.resUrl_,c,p,e.options_).then(t,s):(m=new a.Z("identity-manager:not-authenticated","User is not signed in."),s(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(c.server,p.appId).then((e=>{(0,f.D6)(e.portalUrl,this._appOrigin,!0)?(_=new ft({userId:e.username,server:c.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(_)):r()})).catch(r):r()}}else if(d){if(this._checkProtocol(e.resUrl_,c,s,e.admin_)){let r=e.options_;e.admin_&&(r=r||{},r.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,c,r).then(t,s)}}else m=new a.Z("identity-manager:not-authenticated","User is not signed in."),s(m)},i=()=>{const r=e.sinfo_,i=r.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(ct(r,this._legacyFed)){const e=h.toJSON();e.server=r.server,e.resources=null,t(new ft(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then((s=>{t(new ft({userId:h?.userId,server:r.server,token:s.token,expires:null!=s.expires?Number(s.expires):null,ssl:!!s.ssl,isAdmin:e.admin_,validity:s.validity}))}),s)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:r.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then((()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)}),(t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)}))};this._errbackFunc=s;const n=e.sinfo_.owningSystemUrl,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then((t=>{const s=e.sinfo_;if(s._restInfoPms){s.adminTokenServiceUrl=s._restInfoPms.adminUrl,s._restInfoPms=null,s.tokenServiceUrl=((0,d.hS)("authInfo.tokenServicesUrl",t)||(0,d.hS)("authInfo.tokenServiceUrl",t)||(0,d.hS)("tokenServiceUrl",t))??null,s.shortLivedTokenValidity=(0,d.hS)("authInfo.shortLivedTokenValidity",t)??null,s.currentVersion=t.currentVersion,s.owningTenant=t.owningTenant;const e=s.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&s.owningSystemUrl?i():r()}),(()=>{e.sinfo_._restInfoPms=null;const t=new a.Z("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");s(t)})):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const s={};let r,i,n,o;return t&&(r=t.user&&t.user.username,s.username=r,s.allSSL=t.allSSL,i=t.supportsOAuth,o=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(n=t.customBaseUrl),e.sinfo_.currentVersion=o),e.sinfo_.webTierAuth=!!r,r&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:s.allSSL}).catch((()=>null)).then((e=>(s.portalToken=e&&e.token,s.tokenExpiration=e&&e.expires,s))):!r&&i&&o>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:n,owningTenant:e.sinfo_._selfReq.owningTenant}).catch((()=>null)).then((()=>s)):s})).catch((()=>null)).then((t=>{e.sinfo_._selfReq=null,t?r(t.username,t.allSSL,t.portalToken,t.tokenExpiration):r()})):r()}_generateOAuthInfo(e){let t,s=null,r=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){s=window.location.href;let e=s.indexOf("?");e>-1&&(s=s.slice(0,e)),e=s.search(/\/(apps|home)\//),s=e>-1?s.slice(0,e):null}return a&&s?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.Z)(s+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new it({appId:"arcgisonline",popupCallbackUrl:s+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this._defaultOAuthInfo)return r=r.replace(/^http:/i,"https:"),(0,o.Z)(r+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,f.hF)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then((e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=r,t.popup=window!==window.top||!((0,f.D6)(r,this._appOrigin)||this._gwDomains.some((e=>e.regex.test(r)&&e.regex.test(this._appOrigin)))),this.oAuthInfos.push(t)}}))}))}_doOAuthSignIn(e,t,s,r){const i=s._oAuthCred,n={portalUrl:s.portalUrl};!s.popup&&s.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const o={client_id:s.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:s.expiration,locale:s.locale,redirect_uri:this._getRedirectURI(s,!!i.codeVerifier)};s.forceLogin&&(o.force_login=!0),s.forceUserId&&s.userId&&(o.prepopulatedusername=s.userId),!s.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=r||i.codeVerifier,o.code_challenge_method=r?"S256":"plain");const l=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",c=l+"?"+(0,f.B7)(o);if(s.popup){const e=window.open(c,"esriJSAPIOAuth",s.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval((()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.Z("identity-manager:user-aborted","ABORTED");e.reject(t)}}}),500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],(e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)}));else{const e=new a.Z("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:s}):window.location.href=c}_getRedirectURI(e,t){const s=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,f.hF)(e.popupCallbackUrl);if(t){const e=(0,f.mN)(s);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,f.fl)(e.path,e.query)}return s}}pt.prototype.declaredClass="esri.identity.IdentityManagerBase";let ft=class extends l.Z.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e&&e._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=r.id.findServerInfo(this.server),t=e?.owningSystemUrl,s=!!t&&"server"===this.scope,i=s&&ct(e,r.id._legacyFed),n=e.webTierAuth,o=n&&r.id.normalizeWebTierAuth,a=lt[this.server],l=a&&a[this.userId];let h,c=this.resources&&this.resources[0],d=s?r.id.findServerInfo(t):null,u={username:this.userId,password:l};if(n&&!o)return;s&&!d&&r.id.serverInfos.some((e=>(r.id._isIdProvider(t,e.server)&&(d=e),!!d)));const p=d?r.id.findCredential(d.server,this.userId):null;if(!s||p){if(!i){if(s)h={serverUrl:c,token:p&&p.token,ssl:p&&p.ssl};else if(o)u=null,h={ssl:this.ssl};else{if(!l){let t;return c&&(c=r.id._sanitizeUrl(c),this._enqueued=1,t=r.id._enqueue(c,e,null,null,this.isAdmin,this),t.then((()=>{this._enqueued=0,this.refreshServerTokens()})).catch((()=>{this._enqueued=0}))),t}this.isAdmin&&(h={isAdmin:!0})}return r.id.generateToken(s?d:e,s?null:u,h).then((e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()})).catch((()=>{}))}p?.refreshToken()}}refreshServerTokens(){"portal"===this.scope&&r.id.credentials.forEach((e=>{const t=r.id.findServerInfo(e.server),s=t?.owningSystemUrl;e!==this&&e.userId===this.userId&&s&&"server"===e.scope&&(r.id._hasSameServerInstance(this.server,s)||r.id._isIdProvider(s,this.server))&&(ct(t,r.id._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())}))}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=this.server?r.id.findServerInfo(this.server):null,s=t?.owningSystemUrl,i=s?r.id.findServerInfo(s):null;!1===e||s&&"portal"!==this.scope&&(!i?.webTierAuth||r.id.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=r.id.credentials.indexOf(this);e>-1&&r.id.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,c.yd)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let s=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();s<0?s=0:s>t&&(s=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),s>e?s-e:s)}};(0,i._)([(0,_.Cb)()],ft.prototype,"creationTime",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"expires",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"isAdmin",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"oAuthState",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"resources",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"scope",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"ssl",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"token",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"userId",void 0),(0,i._)([(0,_.Cb)()],ft.prototype,"validity",void 0),ft=(0,i._)([(0,m.j)("esri.identity.Credential")],ft);class _t extends pt{}_t.prototype.declaredClass="esri.identity.IdentityManager";const mt=new _t;(0,r.qh)(mt)},2587:(e,t,s)=>{"use strict";s(90344),s(18848),s(940),s(70171);var r=s(94443),i=s(3172),n=s(20102);async function o(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,i.Z)(e,{responseType:"text"});return JSON.parse(t.data)}class a{constructor({base:e="",pattern:t,location:s=new URL(window.location.href)}){let r;r="string"==typeof s?e=>new URL(e,new URL(s,window.location.href)).href:s instanceof URL?e=>new URL(e,s).href:s,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=r,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,s,i){const a=t.exec(s);if(!a)throw new n.Z("esri-intl:invalid-bundle",`Bundle id "${s}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",h=a[2],c=(0,r.Su)(i),d=`${l}${h}.json`,u=c?`${l}${h}_${c}.json`:d;let p;try{p=await o(e(u))}catch(t){if(u===d)throw new n.Z("intl:unknown-bundle",`Bundle "${s}" cannot be loaded`,{error:t});try{p=await o(e(d))}catch(e){throw new n.Z("intl:unknown-bundle",`Bundle "${s}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const l={};var h,c=s(99880);(0,r.tz)((h={pattern:"esri/",location:c.V},new a(h)))},90344:(e,t,s)=>{"use strict";s.d(t,{LJ:()=>A,Xr:()=>g,Ze:()=>b,cZ:()=>h,f1:()=>C,i$:()=>k,o8:()=>I,p6:()=>S});var r=s(35454),i=s(70171),n=s(17126);const o={year:void 0,month:void 0,day:void 0,weekday:void 0},a={hour:void 0,minute:void 0,second:void 0},l={timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},h={timeZone:"Etc/UTC"},c={year:"numeric",month:"numeric",day:"numeric"},d={year:"numeric",month:"long",day:"numeric"},u={year:"numeric",month:"short",day:"numeric"},p={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},_={...f,second:"numeric"},m={"short-date":c,"short-date-short-time":{...c,...f},"short-date-short-time-24":{...c,...f,hour12:!1},"short-date-long-time":{...c,..._},"short-date-long-time-24":{...c,..._,hour12:!1},"short-date-le":c,"short-date-le-short-time":{...c,...f},"short-date-le-short-time-24":{...c,...f,hour12:!1},"short-date-le-long-time":{...c,..._},"short-date-le-long-time-24":{...c,..._,hour12:!1},"long-month-day-year":d,"long-month-day-year-short-time":{...d,...f},"long-month-day-year-short-time-24":{...d,...f,hour12:!1},"long-month-day-year-long-time":{...d,..._},"long-month-day-year-long-time-24":{...d,..._,hour12:!1},"day-short-month-year":u,"day-short-month-year-short-time":{...u,...f},"day-short-month-year-short-time-24":{...u,...f,hour12:!1},"day-short-month-year-long-time":{...u,..._},"day-short-month-year-long-time-24":{...u,..._,hour12:!1},"long-date":p,"long-date-short-time":{...p,...f},"long-date-short-time-24":{...p,...f,hour12:!1},"long-date-long-time":{...p,..._},"long-date-long-time-24":{...p,..._,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":_},g=(0,r.w)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),v={ar:"ar-u-nu-latn-ca-gregory"};let y=new WeakMap;const w=m["short-date-short-time"];function b(e){return m[e]}function S(e,t=w){return function(e){let t=y.get(e);if(!t){const s=(0,i.Kd)(),r=v[s]||s,n=C(e.timeZone??"system"),o={...e,timeZone:n};t=new Intl.DateTimeFormat(r,o),y.set(e,t)}return t}(t).format(e)}function I(e,t=w){return S(new Date(e),{...t,...h,...a})}function A(e,t=w){return S(new Date(`1970-01-01T${e}Z`),{...t,...h,...o})}function k(e,t=w){const s=n.ou.fromISO(e,{setZone:!0}),r=(0,i.Kd)(),o=v[r]??r;return s.toLocaleString({...l,...t},{locale:o})}function C(e){switch(e){case"system":return;case"unknown":return"UTC";default:return e}}(0,i.Ze)((()=>{y=new WeakMap}))},70171:(e,t,s)=>{"use strict";s.d(t,{G3:()=>l,Kd:()=>a,Ze:()=>u,qe:()=>c});var r=s(50758);let i;const n=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function o(){return n??globalThis.navigator?.language??"en"}function a(){return void 0===i&&(i=o()),i}function l(e=a()){const t=/^([a-zA-Z]{2,3})(?:[_\-]\w+)*$/.exec(e);return t?.[1].toLowerCase()}const h=[];function c(e){return h.push(e),(0,r.kB)((()=>h.splice(h.indexOf(e),1)))}const d=[];function u(e){return d.push(e),(0,r.kB)((()=>h.splice(d.indexOf(e),1)))}globalThis.addEventListener?.("languagechange",(function(){const e=o();i!==e&&(i=e,[...d].forEach((t=>{t.call(null,e)})),[...h].forEach((t=>{t.call(null,e)})))}))},94443:(e,t,s)=>{"use strict";s.d(t,{ME:()=>f,Su:()=>_,tz:()=>p});var r=s(20102),i=s(50758),n=s(95330),o=s(70171);const a=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,l={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function h(e){return e in l}Object.keys(l);const c=[],d=new Map;function u(e){for(const t of d.keys())m(e.pattern,t)&&d.delete(t)}function p(e){return c.includes(e)||(u(e),c.unshift(e)),(0,i.kB)((()=>{const t=c.indexOf(e);t>-1&&(c.splice(t,1),u(e))}))}async function f(e){const t=(0,o.Kd)();d.has(e)||d.set(e,async function(e,t){const s=[];for(const r of c)if(m(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(e){s.push(e)}if(s.length)throw new r.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:s});throw new r.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const s=d.get(e);return s&&await g.add(s),s}function _(e){if(!a.test(e))return null;const t=a.exec(e);if(null===t)return null;const[,s,r]=t,i=s+(r?"-"+r.toUpperCase():"");return h(i)?i:h(s)?s:null}function m(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,o.Ze)((()=>{d.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,n.hh)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},18848:(e,t,s)=>{"use strict";s.d(t,{sh:()=>a,uf:()=>l});var r=s(70171);const i={ar:"ar-u-nu-latn"};let n=new WeakMap,o={};function a(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function l(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!n.has(t)){const s=(0,r.Kd)(),o=i[(0,r.Kd)()]||s;n.set(t,new Intl.NumberFormat(o,e))}return n.get(t)}(t).format(e)}(0,r.Ze)((()=>{n=new WeakMap,o={}}))},940:(e,t,s)=>{"use strict";s.d(t,{n:()=>h});var r=s(92604),i=s(78286),n=s(19153),o=s(90344),a=s(18848);const l=r.Z.getLogger("esri.intl.substitute");function h(e,t,s={}){const{format:r={}}=s;return(0,n.gx)(e,(e=>function(e,t,s){let r,n;const o=e.indexOf(":");if(-1===o?r=e.trim():(r=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!r)return"";const a=(0,i.hS)(r,t);if(null==a)return"";const l=(n?s?.[n]:null)??s?.[r];return l?c(a,l):n?d(a,n):u(a)}(e,t,r)))}function c(e,t){switch(t.type){case"date":return(0,o.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),u(e)}}function d(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.p6)(e):""}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3831,2664],{65845:(e,t,r)=>{r.d(t,{D:()=>n});var a=r(81153);function n(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,a.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>a})},32664:(e,t,r)=>{r.d(t,{save:()=>D,saveAs:()=>$});var a=r(67676),n=r(20102),o=r(95330),s=r(65845),i=r(19238),l=r(64383),u=r(66677),p=r(52104),c=r(84230),y=r(33516),f=r(14661);const m="Feature Service",d="feature-layer-utils",h=`${d}-save`,w=`${d}-save-as`,g=`${d}-saveall`,v=`${d}-saveall-as`;function b(e){return{isValid:(0,c.fP)(e)&&("feature"!==e.type||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function x(e){const t=[],r=[];for(const{layer:a,layerJSON:n}of e)a.isTable?r.push(n):t.push(n);return{layers:t,tables:r}}function S(e){return x([e])}async function T(e,t){return/\/\d+\/?$/.test(e.url)?S(t[0]):N(t,e)}async function N(e,t){if(!t)return x(e);const{layer:{url:r,customParameters:a,apiKey:n}}=e[0];let o=await t.fetchData("json");o&&null!=o.layers&&null!=o.tables||(o=await async function(e,t,r){e||={},e.layers||=[],e.tables||=[];const{url:a,customParameters:n,apiKey:o}=t,{serviceJSON:s,layersJSON:l}=await(0,p.V)(a,{customParameters:n,apiKey:o}),u=P(e.layers,s.layers,r),c=P(e.tables,s.tables,r);e.layers=u.itemResources,e.tables=c.itemResources;const y=[...u.added,...c.added],f=l?[...l.layers,...l.tables]:[];return await async function(e,t,r,a){const n=t.map((({id:e})=>new i.default({url:r,layerId:e,sourceJSON:a.find((({id:t})=>t===e))})));await Promise.allSettled(n.map((e=>e.load()))),n.forEach((t=>{const{layerId:r,loaded:a,defaultPopupTemplate:n}=t;a&&null!=n&&I(t,{id:r,popupInfo:n.toJSON()},e)}))}(e,y,a,f),e}(o,{url:r??"",customParameters:a,apiKey:n},e.map((e=>e.layer.layerId))));for(const t of e)I(t.layer,t.layerJSON,o);return o}function P(e,t,r){const n=(0,a.e5)(e,t,((e,t)=>e.id===t.id));e=e.filter((e=>!n.removed.some((t=>t.id===e.id))));const o=n.added.map((({id:e})=>({id:e})));return o.forEach((({id:t})=>{e.push({id:t})})),{itemResources:e,added:o.filter((({id:e})=>!r.includes(e)))}}function I(e,t,r){e.isTable?_(r.tables,t):_(r.layers,t)}function _(e,t){const r=e.findIndex((({id:e})=>e===t.id));-1===r?e.push(t):e[r]=t}function O(e,t){if(!e.length)throw new n.Z(`${t}:missing-parameters`,"'layers' array should contain at least one feature layer")}function Z(e,t){const r=e.map((e=>e.layerId));if(new Set(r).size!==r.length)throw new n.Z(`${t}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function R(e,t){const{url:r,layerId:a,title:n,fullExtent:o,isTable:s}=e,i=(0,u.Qc)(r);t.url="FeatureServer"===i?.serverType?r:`${r}/${a}`,t.title||=n,t.extent=null,s||null==o||(t.extent=await(0,f.$o)(o)),(0,f.ck)(t,f.Kz.METADATA),(0,f.ck)(t,f.Kz.MULTI_LAYER),(0,f.qj)(t,f.Kz.SINGLE_LAYER),s&&(0,f.qj)(t,f.Kz.TABLE)}const D=(0,o.Ds)((async function(e,t){return(0,l.a1)({layer:e,itemType:m,validateLayer:b,createItemData:(e,t)=>T(t,[e]),errorNamePrefix:h},t)}));(0,o.Ds)((async(e,t)=>{await async function(e){O(e,g),await Promise.all(e.map((e=>e.load())));for(const t of e)(0,l.DC)(t,g,b),(0,l.Ym)(t,g,m);(function(e,t){const r=e.map((e=>e.portalItem.id));if(new Set(r).size>1)throw new n.Z(`${t}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")})(e,g),Z(e,g)}(e);const r=e[0].portalItem,a=(0,y.Y)(r),o=await Promise.all(e.map((e=>(0,l.Nw)(e,a,t)))),i=await T(r,e.map(((e,t)=>({layer:e,layerJSON:o[t]}))));return(0,l.UY)(r),await r.update({data:i}),await Promise.all(e.slice(1).map((e=>e.portalItem.reload()))),(0,s.D)(a),r.clone()}));const $=(0,o.Ds)((async function(e,t,r){return(0,l.po)({layer:e,itemType:m,validateLayer:b,createItemData:(e,t)=>Promise.resolve(S(e)),errorNamePrefix:w,newItem:t,setItemProperties:R},r)}));(0,o.Ds)((async(e,t,r)=>{await async function(e){O(e,v),await Promise.all(e.map((e=>e.load())));for(const t of e)(0,l.DC)(t,v,b);(function(e,t){for(const r of e){const a=r.parsedUrl.path,o=(0,u.Qc)(a),s=o?.url.path;if(!s)throw new n.Z(`${t}:invalid-parameters`,(0,l.xG)(r,`has unsupported url pattern: ${a}`),{layer:r});const i=o?.serverType;if("FeatureServer"!==i&&"MapServer"!==i)throw new n.Z(`${t}:invalid-parameters`,(0,l.xG)(r,`has unsupported server type: ${i}`),{layer:r});if("MapServer"===i&&e.length>1)throw new n.Z(`${t}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const r=(0,u.Qc)(e[0].parsedUrl.path),a=r?.url.path,o=e.every((e=>{const t=(0,u.Qc)(e.parsedUrl.path);return t?.url.path===a}));if(!o)throw new n.Z(`${t}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")})(e,v),Z(e,v)}(e);const o=(0,l.uT)(t,v,m),i=(0,y.Y)(o),p=await Promise.all(e.map((e=>(0,l.Nw)(e,i,r)))),c=await N(e.map(((e,t)=>({layer:e,layerJSON:p[t]}))));await async function(e,t){let r=0,n=0;for(const{isTable:e}of t)e?n++:r++;const o=t[0].parsedUrl.path,s=(0,u.Qc)(o);if(e.url="FeatureServer"===s?.serverType?s.url.path:o,e.title||=s.title,e.extent=null,r>0){const r=t.map((e=>e.fullExtent)).filter(a.pC).reduce(((e,t)=>e.clone().union(t)));r&&(e.extent=await(0,f.$o)(r))}(0,f.ck)(e,f.Kz.METADATA),(0,f.Ct)(e,f.Kz.MULTI_LAYER,t.length>1),(0,f.Ct)(e,f.Kz.SINGLE_LAYER,1===t.length),(0,f.Ct)(e,f.Kz.TABLE,n>0&&0===r),(0,l.UY)(e)}(o,e),await(0,l.jX)(o,c,r);for(const t of e)t.portalItem=o.clone();return(0,s.D)(i),o}))},64383:(e,t,r)=>{r.d(t,{DC:()=>u,Nw:()=>d,UY:()=>h,Ym:()=>f,a1:()=>g,jX:()=>w,po:()=>v,uT:()=>m,xG:()=>c});var a=r(20102),n=r(65845),o=r(48522),s=r(15235),i=r(33516),l=r(14661);function u(e,t,r){const n=r(e);if(!n.isValid)throw new a.Z(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}async function p(e){const{layer:t,errorNamePrefix:r,validateLayer:a}=e;await t.load(),u(t,r,a)}function c(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function y(e,t,r,n){if(e.type!==r)throw new a.Z(`${t}:portal-item-wrong-type`,`Portal item type should be "${r}"`,{item:e,layer:n})}function f(e,t,r){const{portalItem:n}=e;if(!n)throw new a.Z(`${t}:portal-item-not-set`,c(e,"requires the portalItem property to be set"));if(!n.loaded)throw new a.Z(`${t}:portal-item-not-loaded`,c(e,"cannot be saved to a portal item that does not exist or is inaccessible"));y(n,t,r,e)}function m(e,t,r,a){let n=s.default.from(e);return n.id&&(n=n.clone(),n.id=null),n.type??=r,n.portal??=o.Z.getDefault(),y(n,t,r,a),n}async function d(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const n=e.write({},t);return function(e,t){let r=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new a.Z(e,t,r)));if(t?.ignoreUnsupported&&(r=r.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),r.length>0)throw new a.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}(t,r),n}function h(e){(0,l.qj)(e,l.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function w(e,t,r){const a=e.portal;await a.signIn(),await(a.user?.addItem({item:e,data:t,folder:r?.folder}))}async function g(e,t){const{layer:r,createItemData:a,errorNamePrefix:o,itemType:s}=e;await p(e),f(r,o,s);const l=r.portalItem,u=(0,i.Y)(l),c=await d(r,u,t),y=await a({layer:r,layerJSON:c},l);return h(l),await l.update({data:y}),(0,n.D)(u),l}async function v(e,t){const{layer:r,createItemData:a,setItemProperties:o,newItem:s,errorNamePrefix:l,itemType:u}=e;await p(e);const c=m(s,l,u,r),y=(0,i.Y)(c),f=await d(r,y,t),g=await a({layer:r,layerJSON:f},c);return await o(r,c),h(c),await w(c,g,t),r.portalItem=c,(0,n.D)(y),c}},16451:(e,t,r)=>{r.d(t,{Z:()=>f});var a=r(43697),n=r(2368),o=r(96674),s=r(5600),i=(r(75215),r(67676),r(80442),r(71715)),l=r(52011),u=r(30556),p=r(72729),c=r(70082);let y=class extends((0,n.J)(o.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,a._)([(0,s.Cb)({json:{write:!0}})],y.prototype,"id",void 0),(0,a._)([(0,s.Cb)({json:{write:!0}})],y.prototype,"name",void 0),(0,a._)([(0,s.Cb)({json:{write:!0}})],y.prototype,"domains",void 0),(0,a._)([(0,i.r)("domains")],y.prototype,"readDomains",null),(0,a._)([(0,u.c)("domains")],y.prototype,"writeDomains",null),(0,a._)([(0,s.Cb)({type:[c.Z],json:{write:!0}})],y.prototype,"templates",void 0),y=(0,a._)([(0,l.j)("esri.layers.support.FeatureType")],y);const f=y},52104:(e,t,r)=>{r.d(t,{V:()=>n});var a=r(96187);async function n(e,t){const r=await(0,a.T)(e,t);r.layers=r.layers.filter(o);const n={serviceJSON:r};if((r.currentVersion??0)<10.5)return n;const s=await(0,a.T)(e+"/layers",t);return n.layersJSON={layers:s.layers.filter(o),tables:s.tables},n}function o(e){return!e.type||"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}},33516:(e,t,r)=>{r.d(t,{Y:()=>s,h:()=>o});var a=r(17452),n=r(48522);function o(e){return{origin:"portal-item",url:(0,a.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function s(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,a.mN)(e.itemUrl):null,portal:e.portal||n.Z.getDefault(),portalItem:e}}},28694:(e,t,r)=>{r.d(t,{p:()=>n});var a=r(69285);function n(e,t,r){if(!r||!r.features||!r.hasZ)return;const n=(0,a.k)(r.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of r.features)n(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>v});var a,n=r(43697),o=r(66577),s=r(38171),i=r(35454),l=r(96674),u=r(22974),p=r(5600),c=(r(75215),r(71715)),y=r(52011),f=r(30556),m=r(82971),d=r(33955),h=r(1231);const w=new i.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let g=a=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),a=[];for(let t=0;t<e.length;t++){const n=e[t],o=s.Z.fromJSON(n),i=n.geometry&&n.geometry.spatialReference;null==o.geometry||i||(o.geometry.spatialReference=r);const l=n.aggregateGeometries,u=o.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],a=l[e],n=a?.spatialReference;null==t||n||(t.spatialReference=r)}a.push(o)}return a}writeGeometryType(e,t,r,a){if(e)return void w.write(e,t,r,a);const{features:n}=this;if(n)for(const e of n)if(e&&null!=e.geometry)return void w.write(e.geometry.type,t,r,a)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,a=(0,d.im)(e);return a&&!r&&t.spatialReference&&(a.spatialReference=m.Z.fromJSON(t.spatialReference)),a}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new a(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const a=t.features[r];if(a.geometry){const t=e&&e[r];a.geometry=t&&t.toJSON()||a.geometry}}return t}quantize(e){const{scale:[t,r],translate:[a,n]}=e,o=this.features,s=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-a)/t)),(e=>Math.round((n-e)/r)));for(let e=0,t=o.length;e<t;e++)s?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[a,n],scale:[o,s]}=r;let i=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;i=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*o+a),(e=>n-e*s),i,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let a,n;const o=[];for(let s=0,i=e.length;s<i;s++){const i=e[s];if(s>0){const e=t(i[0]),s=r(i[1]);e===a&&s===n||(o.push([e-a,s-n]),a=e,n=s)}else a=t(i[0]),n=r(i[1]),o.push([a,n])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const a=(0,d.oU)(e)?e.rings:e.paths,n=[];for(let e=0,o=a.length;e<o;e++){const o=a[e],s=this._quantizePoints(o,t,r);s&&n.push(s)}return n.length>0?((0,d.oU)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const a=this._quantizePoints(e.points,t,r);return a&&a.length>0?(e.points=a,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,a,n){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),a&&(e.z=a(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,d.oU)(e)?e.rings:e.paths;let s,i;for(let e=0,a=o.length;e<a;e++){const a=o[e];for(let e=0,n=a.length;e<n;e++){const n=a[e];e>0?(s+=n[0],i+=n[1]):(s=n[0],i=n[1]),n[0]=t(s),n[1]=r(i)}}if(a&&n)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=a(r[2]),r[3]=n(r[3])}}else if(a)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=a(r[2])}}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),a&&null!=e.zmax&&null!=e.zmin&&(e.zmax=a(e.zmax),e.zmin=a(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let s,i;for(let e=0,a=o.length;e<a;e++){const a=o[e];e>0?(s+=a[0],i+=a[1]):(s=a[0],i=a[1]),a[0]=t(s),a[1]=r(i)}if(a&&n)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=a(t[2]),t[3]=n(t[3])}else if(a)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=a(t[2])}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=n(t[2])}}:null}};(0,n._)([(0,p.Cb)({type:String,json:{write:!0}})],g.prototype,"displayFieldName",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"exceededTransferLimit",void 0),(0,n._)([(0,p.Cb)({type:[s.Z],json:{write:!0}})],g.prototype,"features",void 0),(0,n._)([(0,c.r)("features")],g.prototype,"readFeatures",null),(0,n._)([(0,p.Cb)({type:[h.Z],json:{write:!0}})],g.prototype,"fields",void 0),(0,n._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],g.prototype,"geometryType",void 0),(0,n._)([(0,f.c)("geometryType")],g.prototype,"writeGeometryType",null),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasM",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasZ",void 0),(0,n._)([(0,p.Cb)({types:o.qM,json:{write:!0}})],g.prototype,"queryGeometry",void 0),(0,n._)([(0,c.r)("queryGeometry")],g.prototype,"readQueryGeometry",null),(0,n._)([(0,p.Cb)({type:m.Z,json:{write:!0}})],g.prototype,"spatialReference",void 0),(0,n._)([(0,f.c)("spatialReference")],g.prototype,"writeSpatialReference",null),(0,n._)([(0,p.Cb)({json:{write:!0}})],g.prototype,"transform",void 0),g=a=(0,n._)([(0,y.j)("esri.rest.support.FeatureSet")],g),g.prototype.toJSON.isDefaultToJSON=!0;const v=g},96187:(e,t,r)=>{r.d(t,{T:()=>n});var a=r(3172);async function n(e,t){const{data:r}=await(0,a.Z)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}});return r}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2664],{65845:(e,t,a)=>{a.d(t,{D:()=>n});var r=a(81153);function n(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:a})=>{(0,r.l)(e)&&a&&e.originOf(t)!==a&&e.updateOrigin(t,a)}))}},81153:(e,t,a)=>{function r(e){return e&&"getAtOrigin"in e&&"originOf"in e}a.d(t,{l:()=>r})},32664:(e,t,a)=>{a.d(t,{save:()=>Z,saveAs:()=>A});var r=a(67676),n=a(20102),o=a(95330),i=a(65845),l=a(19238),s=a(64383),u=a(66677),c=a(52104),p=a(84230),y=a(33516),d=a(14661);const f="Feature Service",m="feature-layer-utils",w=`${m}-save`,h=`${m}-save-as`,v=`${m}-saveall`,b=`${m}-saveall-as`;function I(e){return{isValid:(0,p.fP)(e)&&("feature"!==e.type||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function g(e){const t=[],a=[];for(const{layer:r,layerJSON:n}of e)r.isTable?a.push(n):t.push(n);return{layers:t,tables:a}}function S(e){return g([e])}async function P(e,t){return/\/\d+\/?$/.test(e.url)?S(t[0]):$(t,e)}async function $(e,t){if(!t)return g(e);const{layer:{url:a,customParameters:r,apiKey:n}}=e[0];let o=await t.fetchData("json");o&&null!=o.layers&&null!=o.tables||(o=await async function(e,t,a){e||={},e.layers||=[],e.tables||=[];const{url:r,customParameters:n,apiKey:o}=t,{serviceJSON:i,layersJSON:s}=await(0,c.V)(r,{customParameters:n,apiKey:o}),u=T(e.layers,i.layers,a),p=T(e.tables,i.tables,a);e.layers=u.itemResources,e.tables=p.itemResources;const y=[...u.added,...p.added],d=s?[...s.layers,...s.tables]:[];return await async function(e,t,a,r){const n=t.map((({id:e})=>new l.default({url:a,layerId:e,sourceJSON:r.find((({id:t})=>t===e))})));await Promise.allSettled(n.map((e=>e.load()))),n.forEach((t=>{const{layerId:a,loaded:r,defaultPopupTemplate:n}=t;r&&null!=n&&N(t,{id:a,popupInfo:n.toJSON()},e)}))}(e,y,r,d),e}(o,{url:a??"",customParameters:r,apiKey:n},e.map((e=>e.layer.layerId))));for(const t of e)N(t.layer,t.layerJSON,o);return o}function T(e,t,a){const n=(0,r.e5)(e,t,((e,t)=>e.id===t.id));e=e.filter((e=>!n.removed.some((t=>t.id===e.id))));const o=n.added.map((({id:e})=>({id:e})));return o.forEach((({id:t})=>{e.push({id:t})})),{itemResources:e,added:o.filter((({id:e})=>!a.includes(e)))}}function N(e,t,a){e.isTable?D(a.tables,t):D(a.layers,t)}function D(e,t){const a=e.findIndex((({id:e})=>e===t.id));-1===a?e.push(t):e[a]=t}function O(e,t){if(!e.length)throw new n.Z(`${t}:missing-parameters`,"'layers' array should contain at least one feature layer")}function x(e,t){const a=e.map((e=>e.layerId));if(new Set(a).size!==a.length)throw new n.Z(`${t}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function K(e,t){const{url:a,layerId:r,title:n,fullExtent:o,isTable:i}=e,l=(0,u.Qc)(a);t.url="FeatureServer"===l?.serverType?a:`${a}/${r}`,t.title||=n,t.extent=null,i||null==o||(t.extent=await(0,d.$o)(o)),(0,d.ck)(t,d.Kz.METADATA),(0,d.ck)(t,d.Kz.MULTI_LAYER),(0,d.qj)(t,d.Kz.SINGLE_LAYER),i&&(0,d.qj)(t,d.Kz.TABLE)}const Z=(0,o.Ds)((async function(e,t){return(0,s.a1)({layer:e,itemType:f,validateLayer:I,createItemData:(e,t)=>P(t,[e]),errorNamePrefix:w},t)}));(0,o.Ds)((async(e,t)=>{await async function(e){O(e,v),await Promise.all(e.map((e=>e.load())));for(const t of e)(0,s.DC)(t,v,I),(0,s.Ym)(t,v,f);(function(e,t){const a=e.map((e=>e.portalItem.id));if(new Set(a).size>1)throw new n.Z(`${t}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")})(e,v),x(e,v)}(e);const a=e[0].portalItem,r=(0,y.Y)(a),o=await Promise.all(e.map((e=>(0,s.Nw)(e,r,t)))),l=await P(a,e.map(((e,t)=>({layer:e,layerJSON:o[t]}))));return(0,s.UY)(a),await a.update({data:l}),await Promise.all(e.slice(1).map((e=>e.portalItem.reload()))),(0,i.D)(r),a.clone()}));const A=(0,o.Ds)((async function(e,t,a){return(0,s.po)({layer:e,itemType:f,validateLayer:I,createItemData:(e,t)=>Promise.resolve(S(e)),errorNamePrefix:h,newItem:t,setItemProperties:K},a)}));(0,o.Ds)((async(e,t,a)=>{await async function(e){O(e,b),await Promise.all(e.map((e=>e.load())));for(const t of e)(0,s.DC)(t,b,I);(function(e,t){for(const a of e){const r=a.parsedUrl.path,o=(0,u.Qc)(r),i=o?.url.path;if(!i)throw new n.Z(`${t}:invalid-parameters`,(0,s.xG)(a,`has unsupported url pattern: ${r}`),{layer:a});const l=o?.serverType;if("FeatureServer"!==l&&"MapServer"!==l)throw new n.Z(`${t}:invalid-parameters`,(0,s.xG)(a,`has unsupported server type: ${l}`),{layer:a});if("MapServer"===l&&e.length>1)throw new n.Z(`${t}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const a=(0,u.Qc)(e[0].parsedUrl.path),r=a?.url.path,o=e.every((e=>{const t=(0,u.Qc)(e.parsedUrl.path);return t?.url.path===r}));if(!o)throw new n.Z(`${t}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")})(e,b),x(e,b)}(e);const o=(0,s.uT)(t,b,f),l=(0,y.Y)(o),c=await Promise.all(e.map((e=>(0,s.Nw)(e,l,a)))),p=await $(e.map(((e,t)=>({layer:e,layerJSON:c[t]}))));await async function(e,t){let a=0,n=0;for(const{isTable:e}of t)e?n++:a++;const o=t[0].parsedUrl.path,i=(0,u.Qc)(o);if(e.url="FeatureServer"===i?.serverType?i.url.path:o,e.title||=i.title,e.extent=null,a>0){const a=t.map((e=>e.fullExtent)).filter(r.pC).reduce(((e,t)=>e.clone().union(t)));a&&(e.extent=await(0,d.$o)(a))}(0,d.ck)(e,d.Kz.METADATA),(0,d.Ct)(e,d.Kz.MULTI_LAYER,t.length>1),(0,d.Ct)(e,d.Kz.SINGLE_LAYER,1===t.length),(0,d.Ct)(e,d.Kz.TABLE,n>0&&0===a),(0,s.UY)(e)}(o,e),await(0,s.jX)(o,p,a);for(const t of e)t.portalItem=o.clone();return(0,i.D)(l),o}))},64383:(e,t,a)=>{a.d(t,{DC:()=>u,Nw:()=>m,UY:()=>w,Ym:()=>d,a1:()=>v,jX:()=>h,po:()=>b,uT:()=>f,xG:()=>p});var r=a(20102),n=a(65845),o=a(48522),i=a(15235),l=a(33516),s=a(14661);function u(e,t,a){const n=a(e);if(!n.isValid)throw new r.Z(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}async function c(e){const{layer:t,errorNamePrefix:a,validateLayer:r}=e;await t.load(),u(t,a,r)}function p(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function y(e,t,a,n){if(e.type!==a)throw new r.Z(`${t}:portal-item-wrong-type`,`Portal item type should be "${a}"`,{item:e,layer:n})}function d(e,t,a){const{portalItem:n}=e;if(!n)throw new r.Z(`${t}:portal-item-not-set`,p(e,"requires the portalItem property to be set"));if(!n.loaded)throw new r.Z(`${t}:portal-item-not-loaded`,p(e,"cannot be saved to a portal item that does not exist or is inaccessible"));y(n,t,a,e)}function f(e,t,a,r){let n=i.default.from(e);return n.id&&(n=n.clone(),n.id=null),n.type??=a,n.portal??=o.Z.getDefault(),y(n,t,a,r),n}async function m(e,t,a){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const n=e.write({},t);return function(e,t){let a=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:a})=>new r.Z(e,t,a)));if(t?.ignoreUnsupported&&(a=a.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),a.length>0)throw new r.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:a})}(t,a),n}function w(e){(0,s.qj)(e,s.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,a)=>a.indexOf(e)===t)))}async function h(e,t,a){const r=e.portal;await r.signIn(),await(r.user?.addItem({item:e,data:t,folder:a?.folder}))}async function v(e,t){const{layer:a,createItemData:r,errorNamePrefix:o,itemType:i}=e;await c(e),d(a,o,i);const s=a.portalItem,u=(0,l.Y)(s),p=await m(a,u,t),y=await r({layer:a,layerJSON:p},s);return w(s),await s.update({data:y}),(0,n.D)(u),s}async function b(e,t){const{layer:a,createItemData:r,setItemProperties:o,newItem:i,errorNamePrefix:s,itemType:u}=e;await c(e);const p=f(i,s,u,a),y=(0,l.Y)(p),d=await m(a,y,t),v=await r({layer:a,layerJSON:d},p);return await o(a,p),w(p),await h(p,v,t),a.portalItem=p,(0,n.D)(y),p}},52104:(e,t,a)=>{a.d(t,{V:()=>n});var r=a(96187);async function n(e,t){const a=await(0,r.T)(e,t);a.layers=a.layers.filter(o);const n={serviceJSON:a};if((a.currentVersion??0)<10.5)return n;const i=await(0,r.T)(e+"/layers",t);return n.layersJSON={layers:i.layers.filter(o),tables:i.tables},n}function o(e){return!e.type||"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}},33516:(e,t,a)=>{a.d(t,{Y:()=>i,h:()=>o});var r=a(17452),n=a(48522);function o(e){return{origin:"portal-item",url:(0,r.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function i(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,r.mN)(e.itemUrl):null,portal:e.portal||n.Z.getDefault(),portalItem:e}}},96187:(e,t,a)=>{a.d(t,{T:()=>n});var r=a(3172);async function n(e,t){const{data:a}=await(0,r.Z)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}});return a}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4998],{92835:(t,e,r)=>{r.d(e,{Z:()=>y});var n,o=r(43697),i=r(96674),s=r(35463),a=r(5600),l=(r(75215),r(67676),r(80442),r(71715)),u=r(52011),c=r(30556);let d=n=class extends i.wq{static get allTime(){return p}static get empty(){return h}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(n.allTime)}get isEmpty(){return this.equals(n.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new n({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,n=t.start?.getTime()??t.start,o=t.end?.getTime()??t.end;return e===n&&r===o}expandTo(t,e="system"){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,s.JE)(r,t,e));let o=this.end;if(o){const r=(0,s.JE)(o,t,e);o=o.getTime()===r.getTime()?r:(0,s.Nm)(r,1,t,e)}return new n({start:r,end:o})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return n.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,o=t.start?.getTime()??-1/0,i=t.end?.getTime()??1/0;let s,a;if(o>=e&&o<=r?s=o:e>=o&&e<=i&&(s=e),r>=o&&r<=i?a=r:i>=e&&i<=r&&(a=i),null!=s&&null!=a&&!isNaN(s)&&!isNaN(a)){const t=new n;return t.start=s===-1/0?null:new Date(s),t.end=a===1/0?null:new Date(a),t}return n.empty}offset(t,e,r="system"){if(this.isEmpty||this.isAllTime)return this.clone();const o=new n,{start:i,end:a}=this;return null!=i&&(o.start=(0,s.Nm)(i,t,e,r)),null!=a&&(o.end=(0,s.Nm)(a,t,e,r)),o}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return p.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new n({start:e,end:r})}};(0,o._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,o._)([(0,l.r)("end")],d.prototype,"readEnd",null),(0,o._)([(0,c.c)("end")],d.prototype,"writeEnd",null),(0,o._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,o._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,o._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,o._)([(0,l.r)("start")],d.prototype,"readStart",null),(0,o._)([(0,c.c)("start")],d.prototype,"writeStart",null),d=n=(0,o._)([(0,u.j)("esri.TimeExtent")],d);const p=new d,h=new d({start:void 0,end:void 0}),y=d},4757:(t,e,r)=>{r.d(e,{Z:()=>h});var n=r(43697),o=r(92036),i=r(67676),s=r(2368),a=r(10699),l=r(96674),u=r(5600),c=(r(75215),r(80442),r(52011));let d=0,p=class extends((0,l.eC)((0,s.J)((0,a.IG)(o.Z)))){constructor(t){super(t),this.id=`${Date.now().toString(16)}-analysis-${d++}`,this.title=null}get parent(){return this._get("parent")}set parent(t){const e=this.parent;if(null!=e)switch(e.type){case"line-of-sight":case"dimension":e.releaseAnalysis(this);break;case"2d":case"3d":e.analyses.includes(this)&&e.analyses.remove(this)}this._set("parent",t)}get isEditable(){return this.requiredPropertiesForEditing.every(i.pC)}};(0,n._)([(0,u.Cb)({type:String,constructOnly:!0,clonable:!1})],p.prototype,"id",void 0),(0,n._)([(0,u.Cb)({type:String})],p.prototype,"title",void 0),(0,n._)([(0,u.Cb)({constructOnly:!0})],p.prototype,"type",void 0),(0,n._)([(0,u.Cb)({clonable:!1,value:null})],p.prototype,"parent",null),(0,n._)([(0,u.Cb)({readOnly:!0})],p.prototype,"isEditable",null),(0,n._)([(0,u.Cb)({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",void 0),p=(0,n._)([(0,c.j)("esri.analysis.Analysis")],p);const h=p},25929:(t,e,r)=>{r.d(e,{M:()=>y,a:()=>f,e:()=>p,f:()=>o,i:()=>c,p:()=>d,r:()=>s,t:()=>i,w:()=>a});var n=r(17452);function o(t,e){const r=e&&e.url&&e.url.path;if(t&&r&&(t=(0,n.hF)(t,r,{preserveProtocolRelative:!0}),e.portalItem&&e.readResourcePaths)){const r=(0,n.PF)(t,e.portalItem.itemUrl);null!=r&&u.test(r)&&e.readResourcePaths.push(e.portalItem.resourceFromPath(r).path)}return h(t,e&&e.portal)}function i(t,e,r=y.YES){if(null==t)return t;!(0,n.YP)(t)&&e&&e.blockedRelativeUrls&&e.blockedRelativeUrls.push(t);let o=(0,n.hF)(t);if(e){const r=e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.rootPath||e.url&&e.url.path;if(r){const i=h(r,e.portal),s=h(o,e.portal);o=(0,n.PF)(s,i,i),null!=o&&o!==s&&o!==t&&e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.push(o)}}return o=p(o,e?.portal),(0,n.YP)(o)&&(o=(0,n.Fv)(o)),e?.resources&&e?.portalItem&&!(0,n.YP)(o)&&!(0,n.HK)(o)&&r===y.YES&&e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(o),compress:!1}),o}function s(t,e,r){return o(t,r)}function a(t,e,r,n){const o=i(t,n);void 0!==o&&(e[r]=o)}const l=/\/items\/([^\/]+)\/resources\/(.*)/,u=/^\.\/resources\//;function c(t){const e=t?.match(l)??null;return e?.[1]??null}function d(t){const e=t?.match(l)??null;if(null==e)return null;const r=e[2],o=r.lastIndexOf("/");if(-1===o){const{path:t,extension:e}=(0,n.fZ)(r);return{prefix:null,filename:t,extension:e}}const{path:i,extension:s}=(0,n.fZ)(r.slice(o+1));return{prefix:r.slice(0,o),filename:i,extension:s}}function p(t,e){return e&&!e.isPortal&&e.urlKey&&e.customBaseUrl?(0,n.Ie)(t,`${e.urlKey}.${e.customBaseUrl}`,e.portalHostname):t}function h(t,e){if(!e||e.isPortal||!e.urlKey||!e.customBaseUrl)return t;const r=`${e.urlKey}.${e.customBaseUrl}`,o=(0,n.TI)();return(0,n.D6)(o,`${o.scheme}://${r}`)?(0,n.Ie)(t,e.portalHostname,r):(0,n.Ie)(t,r,e.portalHostname)}var y,m;(m=y||(y={}))[m.YES=0]="YES",m[m.NO=1]="NO";const f=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return y},ensureMainOnlineDomain:p,fromJSON:o,itemIdFromResourceUrl:c,prefixAndFilenameFromResourceUrl:d,read:s,toJSON:i,write:a},Symbol.toStringTag,{value:"Module"}))},10699:(t,e,r)=>{r.d(e,{IG:()=>s,iv:()=>a});var n=r(43697),o=r(52011);let i=0;const s=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+i++})}};return e=(0,n._)([(0,o.j)("esri.core.Identifiable")],e),e},a=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:i++})}};return e=(0,n._)([(0,o.j)("esri.core.NumericIdentifiable")],e),e};let l=class extends(s(class{})){};l=(0,n._)([(0,o.j)("esri.core.Identifiable")],l)},28576:(t,e,r)=>{r.d(e,{B:()=>d});var n=r(81153),o=r(17452),i=r(41123),s=r(7628),a=r(31263),l=r(5600),u=r(66094),c=r(25929);function d(t){const e=t?.origins??[void 0];return(r,i)=>{const d=function(t,e,r){if("resource"===t?.type)return function(t,e,r){const i=(0,s.Oe)(e,r);return{type:String,read:(t,e,r)=>{const n=(0,c.r)(t,e,r);return i.type===String?n:"function"==typeof i.type?new i.type({url:n}):void 0},write:{writer(e,s,l,d){if(!d||!d.resources)return"string"==typeof e?void(s[l]=(0,c.t)(e,d)):void(s[l]=e.write({},d));const m=function(t){return null==t?null:"string"==typeof t?t:t.url}(e),f=(0,c.t)(m,{...d,verifyItemRelativeUrls:d&&d.verifyItemRelativeUrls?{writtenUrls:d.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},c.M.NO),g=i.type!==String&&(!(0,n.l)(this)||d&&d.origin&&this.originIdOf(r)>(0,a.M9)(d.origin)),b={object:this,propertyName:r,value:e,targetUrl:f,dest:s,targetPropertyName:l,context:d,params:t};d&&d.portalItem&&f&&!(0,o.YP)(f)?g?function(t){const{context:e,targetUrl:r,params:n,value:i,dest:s,targetPropertyName:a}=t;if(!e.portalItem)return;const l=e.portalItem.resourceFromPath(r),c=y(i,r,e),d=(0,u.B)(c),m=(0,o.Ml)(l.path),f=n?.compress??!1;d===m?(e.resources&&h({...t,resource:l,content:c,compress:f,updates:e.resources.toUpdate}),s[a]=r):p(t)}(b):function({context:t,targetUrl:e,dest:r,targetPropertyName:n}){t.portalItem&&t.resources&&(t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(e),compress:!1}),r[n]=e)}(b):d&&d.portalItem&&(null==f||null!=(0,c.i)(f)||(0,o.jc)(f)||g)?p(b):s[l]=f}}}}(t,e,r);switch(t?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:t,write:e}=c.a;return{read:t,write:e}}}}(t,r,i);for(const t of e){const e=(0,l.CJ)(r,t,i);for(const t in d)e[t]=d[t]}}}function p(t){const{targetUrl:e,params:r,value:n,context:s,dest:a,targetPropertyName:l}=t;if(!s.portalItem)return;const d=(0,c.p)(e),p=d?.filename??(0,i.D)(),m=r?.prefix??d?.prefix,f=y(n,e,s),g=(0,o.v_)(m,p),b=`${g}.${(0,u.B)(f)}`,v=s.portalItem.resourceFromPath(b);(0,o.jc)(e)&&s.resources&&s.resources.pendingOperations.push((0,o.gi)(e).then((t=>{v.path=`${g}.${(0,u.B)(t)}`,a[l]=v.itemRelativeUrl})).catch((()=>{})));const w=r?.compress??!1;s.resources&&h({...t,resource:v,content:f,compress:w,updates:s.resources.toAdd}),a[l]=v.itemRelativeUrl}function h({object:t,propertyName:e,updates:r,resource:n,content:o,compress:i}){r.push({resource:n,content:o,compress:i,finish:r=>{!function(t,e,r){"string"==typeof t[e]?t[e]=r.url:t[e].url=r.url}(t,e,r)}})}function y(t,e,r){return"string"==typeof t?{url:e}:new Blob([JSON.stringify(t.toJSON(r))],{type:"application/json"})}},70921:(t,e,r)=>{r.d(e,{R:()=>i,Z:()=>o});var n=r(46791);function o(t,e,r=n.Z){return e||(e=new r),e===t||(e.removeAll(),(o=t)&&(Array.isArray(o)||"items"in o&&Array.isArray(o.items))?e.addMany(t):t&&e.add(t)),e;var o}function i(t){return t}},81153:(t,e,r)=>{function n(t){return t&&"getAtOrigin"in t&&"originOf"in t}r.d(e,{l:()=>n})},17445:(t,e,r)=>{r.d(e,{N1:()=>p,YP:()=>l,Z_:()=>m,gx:()=>u,nn:()=>f,on:()=>d,tX:()=>g}),r(66643),r(46791);var n=r(91460),o=r(50758),i=r(70586),s=r(95330),a=r(26258);function l(t,e,r={}){return c(t,e,r,h)}function u(t,e,r={}){return c(t,e,r,y)}function c(t,e,r={},n){let o=null;const s=r.once?(t,r)=>{n(t)&&((0,i.hw)(o),e(t,r))}:(t,r)=>{n(t)&&e(t,r)};if(o=(0,a.aQ)(t,s,r.sync,r.equals),r.initial){const e=t();s(e,e)}return o}function d(t,e,r,s={}){let a=null,u=null,c=null;function d(){a&&u&&(u.remove(),s.onListenerRemove?.(a),a=null,u=null)}function p(t){s.once&&s.once&&(0,i.hw)(c),r(t)}const h=l(t,((t,r)=>{d(),(0,n.vT)(t)&&(a=t,u=(0,n.on)(t,e,p),s.onListenerAdd?.(t))}),{sync:s.sync,initial:!0});return c=(0,o.kB)((()=>{h.remove(),d()})),c}function p(t,e){return function(t,e,r){if((0,s.Hc)(r))return Promise.reject((0,s.zE)());const n=t();if(e?.(n))return Promise.resolve(n);let a=null;function l(){a=(0,i.hw)(a)}return new Promise(((n,i)=>{a=(0,o.AL)([(0,s.fu)(r,(()=>{l(),i((0,s.zE)())})),c(t,(t=>{l(),n(t)}),{sync:!1,once:!0},e??h)])}))}(t,y,e)}function h(t){return!0}function y(t){return!!t}r(87538);const m={sync:!0},f={initial:!0},g={sync:!0,initial:!0}},35463:(t,e,r)=>{r.d(e,{JE:()=>a,Nm:()=>s,rJ:()=>l});var n=r(90344),o=r(17126);const i={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function s(t,e,r,n="system"){const i=c(n),s=o.ou.fromJSDate(t,{zone:i}),a="decades"===r||"centuries"===r?"year":u(r);return"decades"===r&&(e*=10),"centuries"===r&&(e*=100),s.plus({[a]:e}).toJSDate()}function a(t,e,r="system"){const n=c(r),i=o.ou.fromJSDate(t,{zone:n});if("decades"===e||"centuries"===e){const t=i.startOf("year"),{year:r}=t,n=r-r%("decades"===e?10:100);return t.set({year:n}).toJSDate()}const s=u(e);return i.startOf(s).toJSDate()}function l(t,e,r){return 0===t?0:t*i[e]/i[r]}function u(t){switch(t){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}function c(t){const e=(0,n.f1)(t);return e?new o.vF(e):o.Oh.instance}},41123:(t,e,r)=>{r.d(e,{D:()=>o,z:()=>i});const n="randomUUID"in crypto;function o(){if(n)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=e=>t[e].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function i(){return`{${o()}}`}},90344:(t,e,r)=>{r.d(e,{LJ:()=>x,Xr:()=>g,Ze:()=>_,cZ:()=>u,f1:()=>C,i$:()=>S,o8:()=>T,p6:()=>I});var n=r(35454),o=r(70171),i=r(17126);const s={year:void 0,month:void 0,day:void 0,weekday:void 0},a={hour:void 0,minute:void 0,second:void 0},l={timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},u={timeZone:"Etc/UTC"},c={year:"numeric",month:"numeric",day:"numeric"},d={year:"numeric",month:"long",day:"numeric"},p={year:"numeric",month:"short",day:"numeric"},h={year:"numeric",month:"long",weekday:"long",day:"numeric"},y={hour:"numeric",minute:"numeric"},m={...y,second:"numeric"},f={"short-date":c,"short-date-short-time":{...c,...y},"short-date-short-time-24":{...c,...y,hour12:!1},"short-date-long-time":{...c,...m},"short-date-long-time-24":{...c,...m,hour12:!1},"short-date-le":c,"short-date-le-short-time":{...c,...y},"short-date-le-short-time-24":{...c,...y,hour12:!1},"short-date-le-long-time":{...c,...m},"short-date-le-long-time-24":{...c,...m,hour12:!1},"long-month-day-year":d,"long-month-day-year-short-time":{...d,...y},"long-month-day-year-short-time-24":{...d,...y,hour12:!1},"long-month-day-year-long-time":{...d,...m},"long-month-day-year-long-time-24":{...d,...m,hour12:!1},"day-short-month-year":p,"day-short-month-year-short-time":{...p,...y},"day-short-month-year-short-time-24":{...p,...y,hour12:!1},"day-short-month-year-long-time":{...p,...m},"day-short-month-year-long-time-24":{...p,...m,hour12:!1},"long-date":h,"long-date-short-time":{...h,...y},"long-date-short-time-24":{...h,...y,hour12:!1},"long-date-long-time":{...h,...m},"long-date-long-time-24":{...h,...m,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":y,"long-time":m},g=(0,n.w)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),b={ar:"ar-u-nu-latn-ca-gregory"};let v=new WeakMap;const w=f["short-date-short-time"];function _(t){return f[t]}function I(t,e=w){return function(t){let e=v.get(t);if(!e){const r=(0,o.Kd)(),n=b[r]||r,i=C(t.timeZone??"system"),s={...t,timeZone:i};e=new Intl.DateTimeFormat(n,s),v.set(t,e)}return e}(e).format(t)}function T(t,e=w){return I(new Date(t),{...e,...u,...a})}function x(t,e=w){return I(new Date(`1970-01-01T${t}Z`),{...e,...u,...s})}function S(t,e=w){const r=i.ou.fromISO(t,{setZone:!0}),n=(0,o.Kd)(),s=b[n]??n;return r.toLocaleString({...l,...e},{locale:s})}function C(t){switch(t){case"system":return;case"unknown":return"UTC";default:return t}}(0,o.Ze)((()=>{v=new WeakMap}))},87085:(t,e,r)=>{r.d(e,{Z:()=>v});var n=r(43697),o=(r(66577),r(3172)),i=r(20102),s=r(32448),a=r(10699),l=r(83379),u=r(92604),c=r(95330),d=r(17452),p=r(5600),h=(r(75215),r(67676),r(80442),r(52011)),y=r(68773),m=r(6570),f=r(82971);let g=0,b=class extends(s.Z.EventedMixin((0,a.IG)(l.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new m.Z(-180,-90,180,90,f.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=f.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:n}=await r.e(8008).then(r.bind(r,28008));try{return await n(e)}catch(t){const r=e&&e.portalItem,n=r&&r.id||"unset",o=r&&r.portal&&r.portal.url||y.default.portalUrl;throw u.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+n+"')",t),t}}(t)}initialize(){this.when().catch((t=>{(0,c.D_)(t)||u.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})}))}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,d.mN)(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,o.Z)(t,{query:{f:"json"},responseType:"json"})).data;throw new i.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,n._)([(0,p.Cb)({type:String})],b.prototype,"attributionDataUrl",void 0),(0,n._)([(0,p.Cb)({type:m.Z})],b.prototype,"fullExtent",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],b.prototype,"hasAttributionData",null),(0,n._)([(0,p.Cb)({type:String,clonable:!1})],b.prototype,"id",void 0),(0,n._)([(0,p.Cb)({type:Boolean,nonNullable:!0})],b.prototype,"legendEnabled",void 0),(0,n._)([(0,p.Cb)({type:["show","hide","hide-children"]})],b.prototype,"listMode",void 0),(0,n._)([(0,p.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],b.prototype,"opacity",void 0),(0,n._)([(0,p.Cb)({clonable:!1})],b.prototype,"parent",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],b.prototype,"parsedUrl",null),(0,n._)([(0,p.Cb)({type:Boolean})],b.prototype,"popupEnabled",void 0),(0,n._)([(0,p.Cb)({type:Boolean})],b.prototype,"attributionVisible",void 0),(0,n._)([(0,p.Cb)({type:f.Z})],b.prototype,"spatialReference",void 0),(0,n._)([(0,p.Cb)({type:String})],b.prototype,"title",void 0),(0,n._)([(0,p.Cb)({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),(0,n._)([(0,p.Cb)()],b.prototype,"url",void 0),(0,n._)([(0,p.Cb)({type:Boolean,nonNullable:!0})],b.prototype,"visible",void 0),b=(0,n._)([(0,h.j)("esri.layers.Layer")],b);const v=b},21786:(t,e,r)=>{r.r(e),r.d(e,{default:()=>R});var n=r(43697),o=r(4757);function i(t,e){return s(t)===s(e)}function s(t){if(null==t)return null;const e=null!=t.layer?t.layer.id:"";let r=null;return r=null!=t.objectId?t.objectId:null!=t.layer&&"objectIdField"in t.layer&&null!=t.layer.objectIdField&&null!=t.attributes?t.attributes[t.layer.objectIdField]:t.uid,null==r?null:`o-${e}-${r}`}const a={json:{write:{writer:function(t,e){null!=t&&null!=t.layer?.objectIdField&&null!=t.attributes&&(e.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})},target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:function(t){if(null!=t.layerId&&null!=t.objectId)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}}}}};var l=r(92036),u=r(2368),c=r(96674),d=r(70586),p=r(5600),h=(r(75215),r(67676),r(80442),r(52011)),y=r(28576),m=r(94139),f=r(86787);let g=class extends((0,c.eC)((0,u.J)(l.Z))){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return(0,d._W)(this.position,t.position)&&(0,d._W)(this.elevationInfo,t.elevationInfo)&&i(this.feature,t.feature)}};(0,n._)([(0,p.Cb)({type:m.Z,json:{write:{isRequired:!0}}})],g.prototype,"position",void 0),(0,n._)([(0,p.Cb)({type:f.Z}),(0,y.B)()],g.prototype,"elevationInfo",void 0),(0,n._)([(0,p.Cb)(a)],g.prototype,"feature",void 0),g=(0,n._)([(0,h.j)("esri.analysis.LineOfSightAnalysisObserver")],g);const b=g;let v=class extends((0,c.eC)(u.j)){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return(0,d._W)(this.position,t.position)&&(0,d._W)(this.elevationInfo,t.elevationInfo)&&i(this.feature,t.feature)}};(0,n._)([(0,p.Cb)({type:m.Z}),(0,y.B)()],v.prototype,"position",void 0),(0,n._)([(0,p.Cb)({type:f.Z}),(0,y.B)()],v.prototype,"elevationInfo",void 0),(0,n._)([(0,p.Cb)(a)],v.prototype,"feature",void 0),v=(0,n._)([(0,h.j)("esri.analysis.LineOfSightAnalysisTarget")],v);const w=v;var _=r(46791),I=r(70921),T=r(17445),x=r(73615),S=r(60437),C=r(36405);const j=_.Z.ofType(w);let D=class extends o.Z{constructor(t){super(t),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles((0,T.YP)((()=>this._computeExtent()),(t=>{null!=t&&null!=t.pending||this._set("extent",null!=t?t.extent:null)}),T.tX))}get targets(){return this._get("targets")||new j}set targets(t){this._set("targets",(0,I.Z)(t,this.targets,j))}get spatialReference(){return null!=this.observer&&null!=this.observer.position?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return null!=t?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(null==this.observer||null==this.observer.position||null==t)return null;const e=t=>"absolute-height"===(0,C.VW)(t.position,t.elevationInfo),r=this.observer.position,n=(0,S.al)(r.x,r.y,r.z,r.x,r.y,r.z);for(const e of this.targets)if(null!=e.position){const r=(0,x.projectOrLoad)(e.position,t);if(null!=r.pending)return{pending:r.pending,extent:null};if(null!=r.geometry){const{x:t,y:e,z:o}=r.geometry;(0,S.pp)(n,[t,e,o])}}const o=(0,S.HH)(n,t);return e(this.observer)&&this.targets.every(e)||(o.zmin=void 0,o.zmax=void 0),{pending:null,extent:o}}clear(){this.observer=null,this.targets.removeAll()}};(0,n._)([(0,p.Cb)({type:["line-of-sight"]})],D.prototype,"type",void 0),(0,n._)([(0,p.Cb)({type:b,json:{read:!0,write:!0}})],D.prototype,"observer",void 0),(0,n._)([(0,p.Cb)({cast:I.R,type:j,nonNullable:!0,json:{read:!0,write:!0}})],D.prototype,"targets",null),(0,n._)([(0,p.Cb)({value:null,readOnly:!0})],D.prototype,"extent",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],D.prototype,"spatialReference",null),(0,n._)([(0,p.Cb)({readOnly:!0})],D.prototype,"requiredPropertiesForEditing",null),D=(0,n._)([(0,h.j)("esri.analysis.LineOfSightAnalysis")],D);const E=D;var O=r(16453),L=r(87085),U=r(38009);const Z=_.Z.ofType(w);let P=class extends((0,U.q)((0,O.R)(L.Z))){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new E,this.opacity=1}initialize(){this.addHandles((0,T.YP)((()=>this.analysis),((t,e)=>{null!=e&&e.parent===this&&(e.parent=null),null!=t&&(t.parent=this)}),T.tX))}async load(){return null!=this.analysis&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(t){const{analysis:e}=this;e&&(e.observer=t)}get targets(){return null!=this.analysis?this.analysis.targets:new _.Z}set targets(t){(0,I.Z)(t,this.analysis?.targets)}get fullExtent(){return null!=this.analysis?this.analysis.extent:null}get spatialReference(){return null!=this.analysis?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new E)}};(0,n._)([(0,p.Cb)({json:{read:!1},readOnly:!0})],P.prototype,"type",void 0),(0,n._)([(0,p.Cb)({type:["LineOfSightLayer"]})],P.prototype,"operationalLayerType",void 0),(0,n._)([(0,p.Cb)({type:b,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],P.prototype,"observer",null),(0,n._)([(0,p.Cb)({type:Z,json:{read:!0,write:{ignoreOrigin:!0}}})],P.prototype,"targets",null),(0,n._)([(0,p.Cb)({nonNullable:!0,json:{read:!1,write:!1}})],P.prototype,"analysis",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],P.prototype,"fullExtent",null),(0,n._)([(0,p.Cb)({readOnly:!0})],P.prototype,"spatialReference",null),(0,n._)([(0,p.Cb)({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],P.prototype,"opacity",void 0),(0,n._)([(0,p.Cb)({type:["show","hide"]})],P.prototype,"listMode",void 0),P=(0,n._)([(0,h.j)("esri.layers.LineOfSightLayer")],P);const R=P},66094:(t,e,r)=>{r.d(e,{B:()=>o});var n=r(17452);function o(t){return i[function(t){return t instanceof Blob?t.type:function(t){const e=(0,n.Ml)(t);return l[e]||s}(t.url)}(t)]||a}const i={},s="text/plain",a=i[s],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const t in l)i[l[t]]=t},36405:(t,e,r)=>{function n(t,e){return null!=e&&e.mode?e.mode:function(t){return t?u:c}(t).mode}function o(t,e){return n(null!=t&&t.hasZ,e)}function i(t,e,r){return r&&r.mode!==e?`${t} only support ${e} elevation mode`:null}function s(t,e,r){return r?.mode===e?`${t} do not support ${e} elevation mode`:null}function a(t,e){return null!=e?.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression?`${t} do not support featureExpressionInfo`:null}function l(t,e){e&&t.warn(".elevationInfo=",e)}r.d(e,{LR:()=>l,Uy:()=>i,VW:()=>o,Wb:()=>s,kf:()=>a}),r(12541);const u={mode:"absolute-height",offset:0},c={mode:"on-the-ground",offset:null}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9111],{68668:(e,t,r)=>{r.d(t,{G:()=>n,w:()=>l});var s=r(66643),i=r(46791),o=r(83379);async function n(e,t){return await e.load(),l(e,t)}async function l(e,t){const r=[],n=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?n(...t):i.Z.isCollection(t)?t.forEach((e=>n(e))):o.Z.isLoadable(t)&&r.push(t))};t(n);let l=null;if(await(0,s.UI)(r,(async e=>{const t=await(0,s.q6)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||l||(l=t)})),l)throw l.error;return e}},30359:(e,t,r)=>{r.r(t),r.d(t,{default:()=>_e});var s=r(43697),i=r(2368),o=r(46791),n=r(20102),l=r(68668),a=r(16453),u=r(95330),p=r(17445),d=r(42033),c=r(17452),y=r(5600),h=(r(75215),r(67676),r(80442),r(71715)),f=r(52011),b=r(31263),m=r(87085),g=r(54295),v=r(17287),w=r(71612),C=r(17017),S=r(54253),_=r(53713),I=r(38009),F=r(16859),E=r(34760),T=r(72965),A=r(28294),P=r(66677),O=r(21506),j=r(50957),x=r(53518),L=r(35671),R=r(96674),U=r(30556),Z=r(72729);let Q=class extends((0,i.J)(R.wq)){constructor(){super(...arguments),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(e){if(!e)return null;const t={};for(const r of Object.keys(e))t[r]=(0,Z.im)(e[r]);return t}writeDomains(e,t){if(!e)return;const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,s._)([(0,y.Cb)({type:Number,json:{write:!0}})],Q.prototype,"code",void 0),(0,s._)([(0,y.Cb)({type:Object,json:{write:!0}})],Q.prototype,"defaultValues",void 0),(0,s._)([(0,y.Cb)({json:{write:!0}})],Q.prototype,"domains",void 0),(0,s._)([(0,h.r)("domains")],Q.prototype,"readDomains",null),(0,s._)([(0,U.c)("domains")],Q.prototype,"writeDomains",null),(0,s._)([(0,y.Cb)({type:String,json:{write:!0}})],Q.prototype,"name",void 0),Q=(0,s._)([(0,f.j)("esri.layers.support.Subtype")],Q);const D=Q;var M=r(51773),G=r(16050),q=(r(12501),r(28756),r(92271),r(72529),r(5499)),H=r(84382),$=r(81571),k=(r(91423),r(92604)),N=r(10699),V=r(22974),z=r(83379),B=r(78286),K=r(63213),J=r(55343),W=r(70082),Y=r(54306),X=r(30707),ee=r(14165),te=r(32163),re=r(28412);const se=["charts","editingEnabled","formTemplate","labelsVisible","labelingInfo","legendEnabled","minScale","maxScale","opacity","popupEnabled","popupTemplate","renderer","subtypeCode","templates","title","visible"],ie={key:"type",base:q.Z,errorContext:"renderer",typeMap:{simple:H.Z,"unique-value":$.Z,"class-breaks":G.Z}},oe=(0,x.v)(),ne=(0,K.d)({types:ie});let le=0;function ae(e){const t=e.json.write;return"object"==typeof t?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function ue(e){switch(e){case"point":case"multipoint":return re.xA.clone();case"polyline":return re.CJ.clone();case"polygon":case"multipatch":return re.z3.clone();default:return null}}function pe(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function de(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const s={},i=pe(e,t);if(null!=i){const{defaultValues:e}=i;for(const t in e)s[t]=e[t]}return s[t.subtypeField]=e,new W.Z({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}const ce="esri.layers.support.SubtypeSublayer";let ye=class extends((0,a.R)((0,i.J)((0,N.IG)(z.Z)))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${le++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:i}=this;let o;if(s){o=[];let e=0;s.forEach((({name:t,alias:r,editable:s,visible:n})=>{if(!n)return;const l=i?.fields?.find((e=>e.name===t));if(!l)return;const a={name:t};let u=!1;r!==l.alias&&(a.alias=r,u=!0),s!==l.editable&&(a.editable=s,u=!0),o.push(a),u&&e++})),0===e&&o.length===s.length&&(o=null)}else o=(0,V.d9)(e);o?.length&&(0,B.RB)(r,o,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e?.fields;if(!e||!s?.length)return null;const{subtypes:i,subtypeField:o}=e,n=i?.find((e=>e.code===r)),l=n?.defaultValues,a=n?.domains,u=[];for(const e of s){const s=e.clone(),{name:i}=s,n=t?.find((e=>e.name===i));if(s.visible=!t||!!n,n){const{alias:e,editable:t}=n;e&&(s.alias=e),!1===t&&(s.editable=!1)}const p=l?.[i]??null;s.defaultValue=i===o?r:p;const d=a?.[i]??null;s.domain=i===o?null:d?"inherited"===d.type?s.domain:d.clone():null,u.push(s)}return u}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||k.Z.getLogger(ce).error(fe("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){(0,L.YN)(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?function(e){return new H.Z({symbol:ue(e)})}(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const s=t.drawingInfo?.renderer,i=ne(s,t,r);let o;const{subtypeCode:n}=this;if(null!=n&&function(e,t){return!(!t||"unique-value"!==e?.type||"string"!=typeof e.field||e.field.toLowerCase()!==t.toLowerCase()||e.field2||e.field3||e.valueExpression)}(i,t.subtypeField)){const e=i.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(n)));e&&(o=new H.Z({symbol:e.symbol}))}else"simple"!==i?.type||i.visualVariables?.length||(o=i);return o}readRenderer(e,t,r){const s=t?.layerDefinition?.drawingInfo?.renderer;if(!s)return;const i=s.visualVariables?.some((e=>"rotationInfo"!==e.type));return i?void 0:ne(s,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference}readTemplatesFromService(e,t){return[de(this.subtypeCode,t)]}readTitleFromService(e,t){const r=pe(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw fe("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new n.Z("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw fe("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new n.Z("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw fe("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new n.Z("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw fe("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:i}=this;if(r){const{displayField:e,editFieldsInfo:o,objectIdField:n}=r;t={displayField:e,editFieldsInfo:o,fields:s,objectIdField:n,title:i}}return(0,te.eZ)(t,e)}createQuery(){if(!this.parent)throw fe("createQuery");const e=(0,j.rP)(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=(0,d._)(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}hasUserOverrides(){return se.some((e=>this.originIdOf(e)===b.s3.USER))}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw fe("queryAttachments");const s=e.clone();return s.where=he(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw fe("queryFeatures");const s=ee.Z.from(e)??r.createQuery();return null!=e&&(s.where=he(s.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(s,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"capabilities",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"effectiveCapabilities",null),(0,s._)([(0,y.Cb)({json:{write:{ignoreOrigin:!0}}})],ye.prototype,"charts",void 0),(0,s._)([(0,y.Cb)({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],ye.prototype,"editingEnabled",void 0),(0,s._)([(0,y.Cb)({type:Boolean,readOnly:!0})],ye.prototype,"effectiveEditingEnabled",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"elevationInfo",null),(0,s._)([(0,y.Cb)({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],ye.prototype,"fieldOverrides",void 0),(0,s._)([(0,U.c)("fieldOverrides")],ye.prototype,"writeFieldOverrides",null),(0,s._)([(0,y.Cb)({...oe.fields,readOnly:!0,json:{read:!1}})],ye.prototype,"fields",null),(0,s._)([(0,y.Cb)(oe.fieldsIndex)],ye.prototype,"fieldsIndex",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"floorInfo",null),(0,s._)([(0,y.Cb)({type:J.Z,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],ye.prototype,"formTemplate",void 0),(0,s._)([(0,y.Cb)({type:String,clonable:!1,readOnly:!0,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],ye.prototype,"id",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"geometryType",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"type",void 0),(0,s._)([(0,y.Cb)(ae((0,V.d9)(O.iR)))],ye.prototype,"labelsVisible",void 0),(0,s._)([(0,y.Cb)({type:[Y.Z],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:X.r},write:{ignoreOrigin:!0}}})],ye.prototype,"labelingInfo",void 0),(0,s._)([(0,y.Cb)({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],ye.prototype,"layerType",void 0),(0,s._)([(0,y.Cb)(ae((0,V.d9)(O.rn)))],ye.prototype,"legendEnabled",void 0),(0,s._)([(0,y.Cb)({type:["show","hide"]})],ye.prototype,"listMode",void 0),(0,s._)([(0,y.Cb)((()=>{const e=(0,V.d9)(O.rO);return e.json.origins.service.read=!1,ae(e)})())],ye.prototype,"minScale",void 0),(0,s._)([(0,y.Cb)((()=>{const e=(0,V.d9)(O.u1);return e.json.origins.service.read=!1,ae(e)})())],ye.prototype,"maxScale",void 0),(0,s._)([(0,y.Cb)({readOnly:!0})],ye.prototype,"effectiveScaleRange",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"objectIdField",null),(0,s._)([(0,y.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"opacity",void 0),(0,s._)([(0,y.Cb)({clonable:!1})],ye.prototype,"parent",void 0),(0,s._)([(0,y.Cb)(ae((0,V.d9)(O.C_)))],ye.prototype,"popupEnabled",void 0),(0,s._)([(0,y.Cb)({type:M.Z,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],ye.prototype,"popupTemplate",void 0),(0,s._)([(0,y.Cb)({readOnly:!0})],ye.prototype,"defaultPopupTemplate",null),(0,s._)([(0,y.Cb)({types:ie,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],ye.prototype,"renderer",null),(0,s._)([(0,h.r)("service","renderer",["drawingInfo.renderer","subtypeField","type"])],ye.prototype,"readRendererFromService",null),(0,s._)([(0,h.r)("renderer",["layerDefinition.drawingInfo.renderer"])],ye.prototype,"readRenderer",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"spatialReference",null),(0,s._)([(0,y.Cb)({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],ye.prototype,"subtypeCode",void 0),(0,s._)([(0,y.Cb)({type:[W.Z],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],ye.prototype,"templates",void 0),(0,s._)([(0,h.r)("service","templates",["geometryType","subtypeField","subtypes","type"])],ye.prototype,"readTemplatesFromService",null),(0,s._)([(0,y.Cb)({type:String,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"title",void 0),(0,s._)([(0,h.r)("service","title",["subtypes"])],ye.prototype,"readTitleFromService",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"url",null),(0,s._)([(0,y.Cb)({readOnly:!0})],ye.prototype,"userHasUpdateItemPrivileges",null),(0,s._)([(0,y.Cb)({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],ye.prototype,"visible",void 0),ye=(0,s._)([(0,f.j)(ce)],ye);const he=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),i=`${t}=${r}`,o=e??"";return s.test(o)?o.replace(s,i):(0,d._)(i,o)},fe=e=>new n.Z(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),be=ye;var me=r(76259),ge=r(60199);const ve="SubtypeGroupLayer";function we(e,t){return new n.Z("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const Ce=(0,x.v)();let Se=class extends((0,_.B)((0,S.o1)((0,w.h)((0,A.n)((0,T.M)((0,E.Q)((0,v.Y)((0,I.q)((0,F.I)((0,a.R)((0,C.N)((0,g.V)((0,i.J)(m.Z)))))))))))))){constructor(...e){super(...e),this._sublayersCollectionChanged=!1,this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.subtypes=null,this.sublayers=new(o.Z.ofType(be)),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this.addHandles((0,p.YP)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),p.Z_))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u.r9).then((async()=>{if(!this.url)throw new n.Z("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new n.Z("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>(0,j.nU)(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return(0,j.sX)(this)}get parsedUrl(){const e=(0,c.mN)(this.url);return null!=e&&null!=this.layerId&&(e.path=(0,c.v_)(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?(0,P.a7)(this.url,t):t}async addAttachment(e,t){return(0,j.JD)(this,e,t,ve)}async updateAttachment(e,t,r){return(0,j.Y5)(this,e,t,r,ve)}async applyEdits(e,t){return(0,j.Jj)(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await(0,u.Hl)(Promise.all([r.e(4599),r.e(3919),r.e(8949)]).then(r.bind(r,73919)),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=(0,j.rP)(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=(0,d._)(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return(0,j.FV)(this,e,t,ve)}async fetchRecomputedExtents(e){return(0,j.Ci)(this,e,ve)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return(0,l.G)(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return(0,j.SU)(this,e,t,ve)}async queryFeatures(e,t){const r=await this.load(),s=ee.Z.from(e)??r.createQuery(),i=s.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),s.outFields=i);const o=await r.source.queryFeatures(s,t);if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this.findSublayerForFeature(e);return o}async queryObjectIds(e,t){return(0,j.tD)(this,e,t,ve)}async queryFeatureCount(e,t){return(0,j.VG)(this,e,t,ve)}async queryExtent(e,t){return(0,j.KE)(this,e,t,ve)}async queryRelatedFeatures(e,t){return(0,j.kp)(this,e,t,ve)}async queryRelatedFeaturesCount(e,t){return(0,j.C9)(this,e,t,ve)}async save(e){const{save:t}=await Promise.all([r.e(6569),r.e(6404),r.e(9238),r.e(3831)]).then(r.bind(r,32664));return t(this,e)}async saveAs(e,t){const{saveAs:s}=await Promise.all([r.e(6569),r.e(6404),r.e(9238),r.e(3831)]).then(r.bind(r,32664));return s(this,e,t)}write(e,t){const{origin:r,layerContainerType:s,messages:i}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==s)return i?.push(we(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===s)return i?.push(we(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(i?.push(new n.Z("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&(0,ge.D)(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),this.isTable)throw new n.Z("subtype-grouplayer:unsupported-source","SubtypeGroupLayer cannot be created using a layer with table source");if(!this.subtypes?.length)throw new n.Z("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),(0,L.UF)(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return(0,j.gG)(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this._sublayersCollectionChanged=!1,this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})),e.on("after-changes",(()=>{this._sublayersCollectionChanged=!0}))],"sublayers-owner"))}};(0,s._)([(0,y.Cb)({readOnly:!0})],Se.prototype,"createQueryVersion",null),(0,s._)([(0,y.Cb)({readOnly:!0})],Se.prototype,"editingEnabled",null),(0,s._)([(0,y.Cb)({readOnly:!0})],Se.prototype,"effectiveEditingEnabled",null),(0,s._)([(0,y.Cb)({...Ce.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Se.prototype,"fields",void 0),(0,s._)([(0,y.Cb)(Ce.fieldsIndex)],Se.prototype,"fieldsIndex",void 0),(0,s._)([(0,y.Cb)(O.id)],Se.prototype,"id",void 0),(0,s._)([(0,y.Cb)({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],Se.prototype,"listMode",void 0),(0,s._)([(0,y.Cb)({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],Se.prototype,"operationalLayerType",void 0),(0,s._)([(0,y.Cb)(Ce.outFields)],Se.prototype,"outFields",void 0),(0,s._)([(0,y.Cb)({readOnly:!0})],Se.prototype,"parsedUrl",null),(0,s._)([(0,y.Cb)({clonable:!1})],Se.prototype,"source",null),(0,s._)([(0,y.Cb)({type:[D],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"subtypes",void 0),(0,s._)([(0,y.Cb)({type:o.Z.ofType(be),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const s=e.map((({code:e})=>{const s=new be({subtypeCode:e});return s.read(t,r),s}));return new(o.Z.ofType(be))(s)}}}},name:"layers",write:{overridePolicy(e,t,r){const s=this.originOf("sublayers"),i=b.s3.PORTAL_ITEM;let o=!0;if((0,b.M9)(s)===i&&(0,b.M9)(r.origin)>i){const t=e.some((e=>e.hasUserOverrides()));o=this._sublayersCollectionChanged||t}return{enabled:o,ignoreOrigin:!0}}}}})],Se.prototype,"sublayers",void 0),(0,s._)([(0,y.Cb)({type:me.Z})],Se.prototype,"timeInfo",void 0),(0,s._)([(0,y.Cb)({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],Se.prototype,"title",void 0),(0,s._)([(0,h.r)("service","title",["name"])],Se.prototype,"readTitleFromService",null),(0,s._)([(0,y.Cb)({json:{read:!1}})],Se.prototype,"type",void 0),Se=(0,s._)([(0,f.j)("esri.layers.SubtypeGroupLayer")],Se);const _e=Se},54295:(e,t,r)=>{r.d(t,{V:()=>n});var s=r(43697),i=r(5600),o=(r(75215),r(67676),r(80442),r(52011));const n=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,s._)([(0,i.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,s._)([(0,o.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>a});var s=r(43697),i=r(92604),o=r(5600),n=(r(75215),r(67676),r(80442),r(52011)),l=r(66677);const a=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(null!=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,i.Z.getLogger(this)))}};return(0,s._)([(0,o.Cb)()],t.prototype,"title",null),(0,s._)([(0,o.Cb)({type:String})],t.prototype,"url",null),t=(0,s._)([(0,n.j)("esri.layers.mixins.ArcGISService")],t),t}},17017:(e,t,r)=>{r.d(t,{N:()=>n});var s=r(43697),i=r(5600),o=(r(75215),r(67676),r(80442),r(52011));const n=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,s._)([(0,i.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,s._)([(0,o.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},16859:(e,t,r)=>{r.d(t,{I:()=>S});var s=r(43697),i=r(68773),o=r(40330),n=r(3172),l=r(66643),a=r(20102),u=r(92604),p=r(70586),d=r(95330),c=r(17452),y=r(5600),h=(r(75215),r(67676),r(80442),r(71715)),f=r(52011),b=r(30556),m=r(84230),g=r(48522),v=r(15235),w=r(86082),C=r(14661);const S=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,p.SC)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:s}=await r.e(8062).then(r.bind(r,18062));return(0,d.k_)(t),await s({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,d.D_)(e)||u.Z.getLogger(this).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,d.r9)(e),!0))))}async setUserPrivileges(e,t){if(!i.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,d.r9)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const s=e===r.id;if(s&&r.portal.user)return(0,C.Ss)(r);let i,n;if(s)i=r.portal.url;else try{i=await(0,m.oP)(this.url,t)}catch(e){(0,d.r9)(e)}if(!i||!(0,c.Zo)(i,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;n=await(o.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,d.r9)(e)}if(!n)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(s?await r.reload():(r=new v.default({id:e,portal:{url:i}}),await r.load(t)),r.portal.user)return(0,C.Ss)(r)}catch(e){(0,d.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,d.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const r=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=r,null==r||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=o.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,i=g.Z.getDefault();if(i&&i.loaded&&(0,c.Fv)(i.restUrl)===(0,c.Fv)(s))return i.user;const a=`${s}/community/self`,u=null!=e?e.signal:null,p=await(0,l.q6)((0,n.Z)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return p.ok?w.Z.fromJSON(p.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||g.Z.getDefault());return r&&s&&!(0,c.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.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, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,y.Cb)({type:v.default})],t.prototype,"portalItem",null),(0,s._)([(0,h.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,b.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,y.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,y.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,s._)([(0,y.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,s._)([(0,y.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,s._)([(0,f.j)("esri.layers.mixins.PortalLayer")],t),t},_={credential:null,user:null}},70082:(e,t,r)=>{r.d(t,{Z:()=>d});var s=r(43697),i=r(2368),o=r(35454),n=r(96674),l=r(5600),a=(r(75215),r(67676),r(80442),r(52011));const u=new o.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((0,i.J)(n.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,s._)([(0,l.Cb)({json:{write:!0}})],p.prototype,"name",void 0),(0,s._)([(0,l.Cb)({json:{write:!0}})],p.prototype,"description",void 0),(0,s._)([(0,l.Cb)({json:{read:u.read,write:u.write}})],p.prototype,"drawingTool",void 0),(0,s._)([(0,l.Cb)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,s._)([(0,l.Cb)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,s._)([(0,a.j)("esri.layers.support.FeatureTemplate")],p);const d=p},56765:(e,t,r)=>{r.d(t,{Z:()=>p});var s,i=r(43697),o=r(46791),n=r(96674),l=r(5600),a=(r(75215),r(67676),r(80442),r(52011));let u=s=class extends n.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new o.Z}clone(){return new s({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,i._)([(0,l.Cb)({type:String,json:{write:!0}})],u.prototype,"floorField",void 0),(0,i._)([(0,l.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,i._)([(0,l.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=s=(0,i._)([(0,a.j)("esri.layers.support.LayerFloorInfo")],u);const p=u},66677:(e,t,r)=>{r.d(t,{B5:()=>p,DR:()=>c,G:()=>v,M8:()=>f,Nm:()=>b,Qc:()=>d,XG:()=>m,a7:()=>h,ld:()=>y,wH:()=>g});var s=r(17452),i=r(25929);const o={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},n=Object.values(o),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function p(e){return!!l.test(e)}function d(e){if(null==e)return null;const t=(0,s.mN)(e),r=t.path.match(l)||t.path.match(a);if(!r)return null;const[,i,n,u,p]=r,d=n.indexOf("/");return{title:y(-1!==d?n.slice(d+1):n),serverType:o[u.toLowerCase()],sublayer:null!=p&&""!==p?parseInt(p,10):null,url:{path:i}}}function c(e){const t=(0,s.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function y(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function h(e,t){const r=[];if(e){const t=d(e);null!=t&&t.title&&r.push(t.title)}if(t){const e=y(t);r.push(e)}if(2===r.length){if(r[0].toLowerCase().includes(r[1].toLowerCase()))return r[0];if(r[1].toLowerCase().includes(r[0].toLowerCase()))return r[1]}return r.join(" - ")}function f(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),r=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&r}function b(e,t){return e?(0,s.Qj)((0,s.Hu)(e,t)):e}function m(e){let{url:t}=e;if(!t)return{url:t};t=(0,s.Hu)(t,e.logger);const r=(0,s.mN)(t),i=d(r.path);let o;if(null!=i)null!=i.sublayer&&null==e.layer.layerId&&(o=i.sublayer),t=i.url.path;else if(e.nonStandardUrlAllowed){const e=c(r.path);null!=e&&(t=e.serviceUrl,o=e.sublayerId)}return{url:(0,s.Qj)(t),layerId:o}}function g(e,t,r,o,n){(0,i.w)(t,o,"url",n),o.url&&null!=e.layerId&&(o.url=(0,s.v_)(o.url,r,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),r=t.includes("/services/"),s=t.includes("/mapserver/wmsserver"),i=t.includes("/imageserver/wmsserver"),o=t.includes("/wmsserver");return r&&(s||i||o)}},30707:(e,t,r)=>{r.d(t,{a:()=>d,r:()=>u});var s=r(20102),i=r(22974),o=r(92604),n=r(54306);const l=o.Z.getLogger("esri.layers.support.labelingInfo"),a=/\[([^\[\]]+)\]/gi;function u(e,t,r){return e?e.map((e=>{const s=new n.Z;if(s.read(e,r),s.labelExpression){const e=t.fields||t.layerDefinition&&t.layerDefinition.fields||this.fields;s.labelExpression=s.labelExpression.replaceAll(a,((t,r)=>`[${function(e,t){if(!t)return e;const r=e.toLowerCase();for(let e=0;e<t.length;e++){const s=t[e].name;if(s.toLowerCase()===r)return s}return e}(r,e)}]`))}return s})):null}const p={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function d(e,t){const r=(0,i.d9)(e);return r.some((e=>function(e,t){const r=e.labelPlacement,i=p[t];if(!e.symbol)return l.warn("No ILabelClass symbol specified."),!0;if(!i)return l.error(new s.Z("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!i.includes(r)){const s=i[0];r&&l.warn(`Found invalid label placement type ${r} for ${t}. Defaulting to ${s}`),e.labelPlacement=s}return!1}(e,t)))?[]:r}},54275:(e,t,r)=>{r.d(t,{h:()=>d});var s=r(80442),i=r(66677);function o(e,t,r){return!!l(e,t,r)}function n(e,t,r){return l(e,t,r)}function l(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}const a={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function p(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function d(e,t){return{analytics:c(e),attachment:y(e),data:h(e),metadata:f(e),operations:b(e.capabilities,e,t),query:m(e,t),queryRelated:g(e),queryTopFeatures:v(e),editing:w(e)}}function c(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:p(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:o(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=a[e.name];t&&(r[t]=!!e.isEnabled)})),r}function h(e){return{isVersioned:o(e,"isDataVersioned",!1),supportsAttachment:o(e,"hasAttachments",!1),supportsM:o(e,"hasM",!1),supportsZ:o(e,"hasZ",!1)}}function f(e){return{supportsAdvancedFieldProperties:o(e,"supportsFieldDescriptionProperty",!1)}}function b(e,t,r){const s=e?e.toLowerCase().split(",").map((e=>e.trim())):[],n=r?(0,i.Qc)(r):null,l=s.includes(null!=n&&"MapServer"===n.serverType?"data":"query"),a=s.includes("editing")&&!t.datesInUnknownTimezone;let u=a&&s.includes("create"),p=a&&s.includes("delete"),d=a&&s.includes("update");const c=s.includes("changetracking"),y=t.advancedQueryCapabilities;return a&&!(u||p||d)&&(u=p=d=!0),{supportsCalculate:o(t,"supportsCalculate",!1),supportsTruncate:o(t,"supportsTruncate",!1),supportsValidateSql:o(t,"supportsValidateSql",!1),supportsAdd:u,supportsDelete:p,supportsEditing:a,supportsChangeTracking:c,supportsQuery:l,supportsQueryAnalytics:o(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:o(y,"supportsQueryAttachments",!1),supportsQueryTopFeatures:o(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:o(t,"supportsAttachmentsResizing",!1),supportsSync:s.includes("sync"),supportsUpdate:d,supportsExceedsLimitStatistics:o(t,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:o(t,"supportsAsyncConvert3D",!1)}}function m(e,t){const r=e.advancedQueryCapabilities,l=e.ownershipBasedAccessControlForFeatures,a=e.archivingInfo,d=e.currentVersion,c=t?.includes("MapServer"),y=!c||d>=(0,s.Z)("mapserver-pbf-version-support"),h=(0,i.M8)(t),f=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:o(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:o(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:o(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:u(r),supportsCentroid:o(r,"supportsReturningGeometryCentroid",!1),supportsDistance:o(r,"supportsQueryWithDistance",!1),supportsDistinct:o(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:o(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:o(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:o(r,"supportsHavingClause",!1),supportsOrderBy:o(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:o(r,"supportsPagination",!1),supportsQuantization:o(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:o(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:o(e,"supportsReturningQueryGeometry",!1),supportsResultType:o(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:o(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:o(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:o(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:o(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:o(l,"allowAnonymousToQuery",!0),supportsQueryByOthers:o(l,"allowOthersToQuery",!0),supportsHistoricMoment:o(a,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&f.has("pbf"),supportsDisjointSpatialRelationship:o(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:o(r,"supportsQueryWithCacheHint",!1)||p(r,"query"),supportsDefaultSpatialReference:o(r,"supportsDefaultSR",!1),supportsCompactGeometry:h,supportsFullTextSearch:o(r,"supportsFullTextSearch",!1),maxRecordCountFactor:n(e,"maxRecordCountFactor",void 0),maxRecordCount:n(e,"maxRecordCount",void 0),standardMaxRecordCount:n(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:n(e,"tileMaxRecordCount",void 0)}}function g(e){const t=e.advancedQueryCapabilities,r=o(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:o(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:p(t,"queryRelated")}}function v(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryTopFilter")}}function w(e){const t=e.ownershipBasedAccessControlForFeatures,r=e?e.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:o(e,"allowGeometryUpdates",!0),supportsGlobalId:o(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:o(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:o(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:o(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:o(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:o(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:o(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:o(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:o(t,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:o(r,"supportsAsyncApplyEdits",!1)}}},58333:(e,t,r)=>{r.d(t,{ET:()=>o,I4:()=>i,eG:()=>a,lF:()=>n,lj:()=>p,qP:()=>l,wW:()=>u});const s=[252,146,31,255],i={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},n={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},l={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},a={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4697],{65845:(e,t,r)=>{r.d(t,{D:()=>i});var a=r(81153);function i(e){e&&e.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,a.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>a})},64697:(e,t,r)=>{r.d(t,{save:()=>u,saveAs:()=>y});var a=r(95330),i=r(64383),n=r(14661);const o="Image Service";function l(e){if("imagery"===e.type)return{isValid:!0};const{raster:t}=e;return{isValid:"RasterTileServer"===t?.datasetFormat&&("Raster"===t.tileType||"Map"===t.tileType),errorMessage:"imagery tile layer should be created from a tiled image service."}}function s(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function p(e,t){const{parsedUrl:r,title:a,fullExtent:i}=e;t.url=r.path,t.title||=a,t.extent=await(0,n.$o)(i),"imagery-tile"===e.type&&(0,n.qj)(t,n.Kz.TILED_IMAGERY)}const u=(0,a.Ds)((async function(e,t){const r="imagery"===e.type?"imagery-layer-save":"imagery-tile-layer-save";return(0,i.a1)({layer:e,itemType:o,validateLayer:l,createItemData:s,errorNamePrefix:r},t)})),y=(0,a.Ds)((async function(e,t,r){const a="imagery"===e.type?"imagery-layer-save-as":"imagery-tile-layer-save-as";return(0,i.po)({layer:e,itemType:o,validateLayer:l,createItemData:s,errorNamePrefix:a,newItem:t,setItemProperties:p},r)}))},64383:(e,t,r)=>{r.d(t,{DC:()=>p,Nw:()=>f,UY:()=>w,Ym:()=>c,a1:()=>v,jX:()=>g,po:()=>I,uT:()=>d,xG:()=>y});var a=r(20102),i=r(65845),n=r(48522),o=r(15235),l=r(33516),s=r(14661);function p(e,t,r){const i=r(e);if(!i.isValid)throw new a.Z(`${t}:invalid-parameters`,i.errorMessage,{layer:e})}async function u(e){const{layer:t,errorNamePrefix:r,validateLayer:a}=e;await t.load(),p(t,r,a)}function y(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function m(e,t,r,i){if(e.type!==r)throw new a.Z(`${t}:portal-item-wrong-type`,`Portal item type should be "${r}"`,{item:e,layer:i})}function c(e,t,r){const{portalItem:i}=e;if(!i)throw new a.Z(`${t}:portal-item-not-set`,y(e,"requires the portalItem property to be set"));if(!i.loaded)throw new a.Z(`${t}:portal-item-not-loaded`,y(e,"cannot be saved to a portal item that does not exist or is inaccessible"));m(i,t,r,e)}function d(e,t,r,a){let i=o.default.from(e);return i.id&&(i=i.clone(),i.id=null),i.type??=r,i.portal??=n.Z.getDefault(),m(i,t,r,a),i}async function f(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const i=e.write({},t);return function(e,t){let r=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new a.Z(e,t,r)));if(t?.ignoreUnsupported&&(r=r.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),r.length>0)throw new a.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}(t,r),i}function w(e){(0,s.qj)(e,s.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function g(e,t,r){const a=e.portal;await a.signIn(),await(a.user?.addItem({item:e,data:t,folder:r?.folder}))}async function v(e,t){const{layer:r,createItemData:a,errorNamePrefix:n,itemType:o}=e;await u(e),c(r,n,o);const s=r.portalItem,p=(0,l.Y)(s),y=await f(r,p,t),m=await a({layer:r,layerJSON:y},s);return w(s),await s.update({data:m}),(0,i.D)(p),s}async function I(e,t){const{layer:r,createItemData:a,setItemProperties:n,newItem:o,errorNamePrefix:s,itemType:p}=e;await u(e);const y=d(o,s,p,r),m=(0,l.Y)(y),c=await f(r,m,t),v=await a({layer:r,layerJSON:c},y);return await n(r,y),w(y),await g(y,v,t),r.portalItem=y,(0,i.D)(m),y}},33516:(e,t,r)=>{r.d(t,{Y:()=>o,h:()=>n});var a=r(17452),i=r(48522);function n(e){return{origin:"portal-item",url:(0,a.mN)(e.itemUrl),portal:e.portal||i.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function o(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,a.mN)(e.itemUrl):null,portal:e.portal||i.Z.getDefault(),portalItem:e}}}}]);